Skip to content

Commit

Permalink
regulator/rpi-panel-attiny: Don't read the LCD power status
Browse files Browse the repository at this point in the history
The I2C to the Atmel is very fussy, and locks up easily on
Pi0-3 particularly on reads.

The LCD power status is controlled solely by this driver, so
rather than reading it back from the Atmel, use the cached
status last set.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 authored and popcornmix committed Oct 10, 2024
1 parent 832c2d6 commit 0084eb1
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions drivers/regulator/rpi-panel-attiny-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,8 @@ static int attiny_lcd_power_disable(struct regulator_dev *rdev)
static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev)
{
struct attiny_lcd *state = rdev_get_drvdata(rdev);
unsigned int data;
int ret, i;

mutex_lock(&state->lock);

for (i = 0; i < 10; i++) {
ret = regmap_read(rdev->regmap, REG_PORTC, &data);
if (!ret)
break;
usleep_range(10000, 12000);
}

mutex_unlock(&state->lock);

if (ret < 0)
return ret;

return data & PC_RST_BRIDGE_N;
return state->port_states[REG_PORTC - REG_PORTA] & PC_RST_BRIDGE_N;
}

static const struct regulator_init_data attiny_regulator_default = {
Expand Down

0 comments on commit 0084eb1

Please sign in to comment.