linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: misc: drv260x: add check for ERM mode and LRA Libraries
@ 2014-08-22 14:11 Dan Murphy
  2014-08-26 22:46 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Murphy @ 2014-08-22 14:11 UTC (permalink / raw)
  To: linux-input, dmitry.torokhov; +Cc: linux-kernel, linux-arm-kernel, Dan Murphy

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>
---
 drivers/input/misc/drv260x.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index a7a19e6..d6a26a7 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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-26 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22 14:11 [PATCH] input: misc: drv260x: add check for ERM mode and LRA Libraries Dan Murphy
2014-08-26 22:46 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).