Commit dddf3bc4 authored by Dan Murphy's avatar Dan Murphy Committed by Dmitry Torokhov

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: default avatarDan Murphy <dmurphy@ti.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 6aa97516
...@@ -564,6 +564,14 @@ static int drv260x_probe(struct i2c_client *client, ...@@ -564,6 +564,14 @@ static int drv260x_probe(struct i2c_client *client,
return -EINVAL; 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"); haptics->regulator = devm_regulator_get(&client->dev, "vbat");
if (IS_ERR(haptics->regulator)) { if (IS_ERR(haptics->regulator)) {
error = PTR_ERR(haptics->regulator); error = PTR_ERR(haptics->regulator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment