The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] Input: max77693-haptic - disable bias on failed open
@ 2026-11-16  2:24 Haowen Tu
  2026-11-16  7:24 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Haowen Tu @ 2026-11-16  2:24 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Haowen Tu

max77693_haptic_open() enables the MAX77843 bias before enabling the motor
regulator. If regulator_enable() fails, the function returns without
turning the bias off. The input core does not call the close callback
after a failed open, so its bias cleanup does not run either.

Disable the bias before returning the regulator error. The bias helper
already handles reporting register access errors and is a no-op for the
other supported chip variants.

Fixes: 56bbc99e6914 ("Input: max77693: Add support for Maxim 77843")
Signed-off-by: Haowen Tu <tuhaowen@uniontech.com>
---
 drivers/input/misc/max77693-haptic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c
index 96d6d4620eb4..2bf4581b6adc 100644
--- a/drivers/input/misc/max77693-haptic.c
+++ b/drivers/input/misc/max77693-haptic.c
@@ -278,6 +278,7 @@ static int max77693_haptic_open(struct input_dev *dev)
 	if (error) {
 		dev_err(haptic->dev,
 			"failed to enable regulator: %d\n", error);
+		max77843_haptic_bias(haptic, false);
 		return error;
 	}
 
-- 
2.50.1


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

end of thread, other threads:[~2026-11-16  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  2:24 [PATCH] Input: max77693-haptic - disable bias on failed open Haowen Tu
2026-11-16  7:24 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox