summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2014-08-26 15:36:55 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-08-26 15:42:03 -0700
commitdddf3bc454fe9b558c13ffd7896e8bea5d39ec29 (patch)
treeb4ea7ac6b3668a42c0fa91275e5662925bd8760c /drivers/input
parent6aa9751679b04b351bf4b2e2678bc11ea7d0fea4 (diff)
downloadblackbird-op-linux-dddf3bc454fe9b558c13ffd7896e8bea5d39ec29.tar.gz
blackbird-op-linux-dddf3bc454fe9b558c13ffd7896e8bea5d39ec29.zip
Input: drv260x - add check for ERM mode and LRA Libraries
Add a check to ensure that LRA libraries are not mixed with the ERM mode. If ERM mode and the Library is empty "OR" the LRA library then exit, as the LRA and empty libraries are not applicable for the ERM actuator. Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/drv260x.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index a7a19e68f4a7..cab87f5ce6d3 100644
--- a/drivers/input/misc/drv260x.c
+++ b/drivers/input/misc/drv260x.c
@@ -564,6 +564,14 @@ static int drv260x_probe(struct i2c_client *client,
return -EINVAL;
}
+ if (haptics->mode == DRV260X_ERM_MODE &&
+ (haptics->library == DRV260X_LIB_EMPTY ||
+ haptics->library == DRV260X_LIB_LRA)) {
+ dev_err(&client->dev,
+ "ERM Mode with LRA Library mismatch\n");
+ return -EINVAL;
+ }
+
haptics->regulator = devm_regulator_get(&client->dev, "vbat");
if (IS_ERR(haptics->regulator)) {
error = PTR_ERR(haptics->regulator);
OpenPOWER on IntegriCloud