From 26c8da7f8317564407d162a521ac06ad3a1f5aa6 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Sat, 26 Nov 2022 15:18:14 +0100 Subject: [PATCH 384/464] input: pinephone-keyboard: Wait a bit after enabling vbus In case the MCU was browned out, we want to wait a bit after enabling VBUS and before probing the MCU over I2C, for the MCU to initialize. Otherwise it may be possible for the MCU to fail to respond during probe and for the driver to fail initialization. Signed-off-by: Ondrej Jirman --- drivers/input/keyboard/pinephone-keyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c index 1e745fd761c7..3e5a656bc8ec 100644 --- a/drivers/input/keyboard/pinephone-keyboard.c +++ b/drivers/input/keyboard/pinephone-keyboard.c @@ -368,6 +368,8 @@ static int ppkb_probe(struct i2c_client *client) if (error) return error; + mdelay(100); + ret = i2c_smbus_read_i2c_block_data(client, 0, sizeof(info), info); if (ret != sizeof(info)) { error = ret < 0 ? ret : -EIO; -- 2.34.1