Skip to content

Commit d8f083a

Browse files
s-mochLee Jones
authored andcommitted
mfd: rk808: Always use poweroff when requested
With the device tree property "rockchip,system-power-controller" we explicitly request to use this PMIC to power off the system. So always register our poweroff function, even if some other handler (probably PSCI poweroff) was registered before. This does tend to reveal a warning on shutdown due to the Rockchip I2C driver not implementing an atomic transfer method, however since the write to DEV_OFF takes effect immediately the I2C completion interrupt is moot anyway, and as the very last thing written to the console it is only visible to users going out of their way to capture serial output. Signed-off-by: Soeren Moch <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> [ rm: note potential warning in commit message ] Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 9a153b0 commit d8f083a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/mfd/rk808.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static int rk808_probe(struct i2c_client *client,
550550
const struct mfd_cell *cells;
551551
int nr_pre_init_regs;
552552
int nr_cells;
553-
int pm_off = 0, msb, lsb;
553+
int msb, lsb;
554554
unsigned char pmic_id_msb, pmic_id_lsb;
555555
int ret;
556556
int i;
@@ -674,16 +674,9 @@ static int rk808_probe(struct i2c_client *client,
674674
goto err_irq;
675675
}
676676

677-
pm_off = of_property_read_bool(np,
678-
"rockchip,system-power-controller");
679-
if (pm_off && !pm_power_off) {
677+
if (of_property_read_bool(np, "rockchip,system-power-controller")) {
680678
rk808_i2c_client = client;
681679
pm_power_off = rk808->pm_pwroff_fn;
682-
}
683-
684-
if (pm_off && !pm_power_off_prepare) {
685-
if (!rk808_i2c_client)
686-
rk808_i2c_client = client;
687680
pm_power_off_prepare = rk808->pm_pwroff_prep_fn;
688681
}
689682

0 commit comments

Comments
 (0)