1 From 76035ed0bd7fcc2c0af5a038139b50231b95fa37 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 29 Nov 2021 18:31:37 +0000
4 Subject: [PATCH] regulator/rpi-panel-attiny: Don't read the LCD power
7 The I2C to the Atmel is very fussy, and locks up easily on
8 Pi0-3 particularly on reads.
10 The LCD power status is controlled solely by this driver, so
11 rather than reading it back from the Atmel, use the cached
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 drivers/regulator/rpi-panel-attiny-regulator.c | 18 +-----------------
17 1 file changed, 1 insertion(+), 17 deletions(-)
19 --- a/drivers/regulator/rpi-panel-attiny-regulator.c
20 +++ b/drivers/regulator/rpi-panel-attiny-regulator.c
21 @@ -144,24 +144,8 @@ static int attiny_lcd_power_disable(stru
22 static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev)
24 struct attiny_lcd *state = rdev_get_drvdata(rdev);
28 - mutex_lock(&state->lock);
30 - for (i = 0; i < 10; i++) {
31 - ret = regmap_read(rdev->regmap, REG_PORTC, &data);
34 - usleep_range(10000, 12000);
37 - mutex_unlock(&state->lock);
42 - return data & PC_RST_BRIDGE_N;
43 + return state->port_states[REG_PORTC - REG_PORTA] & PC_RST_BRIDGE_N;
46 static const struct regulator_init_data attiny_regulator_default = {