Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Murphy and committed by
Dmitry Torokhov
dddf3bc4 6aa97516

+8
+8
drivers/input/misc/drv260x.c
··· 564 564 return -EINVAL; 565 565 } 566 566 567 + if (haptics->mode == DRV260X_ERM_MODE && 568 + (haptics->library == DRV260X_LIB_EMPTY || 569 + haptics->library == DRV260X_LIB_LRA)) { 570 + dev_err(&client->dev, 571 + "ERM Mode with LRA Library mismatch\n"); 572 + return -EINVAL; 573 + } 574 + 567 575 haptics->regulator = devm_regulator_get(&client->dev, "vbat"); 568 576 if (IS_ERR(haptics->regulator)) { 569 577 error = PTR_ERR(haptics->regulator);