Commit 159c5249 authored by Andre Przywara's avatar Andre Przywara
Browse files

allwinner: sun50i_h6: initialise I2C just before powering down



Even though we initialise the platform part and the I2C controller
itself at boot time, we actually only access the bus on power down.
Meanwhile a rich OS might have configured the I2C pins differently or
even disabled the controller.
So repeat the platform setup and controller initialisation just before
we actually access the bus to power off the system. This is safe,
because at this point the rich OS should no longer be running.
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent 1a910bce
...@@ -120,10 +120,9 @@ void __dead2 sunxi_power_down(void) ...@@ -120,10 +120,9 @@ void __dead2 sunxi_power_down(void)
switch (pmic) { switch (pmic) {
case AXP805: case AXP805:
val = 0x26; /* Default value for REG 32H */ sunxi_init_r_i2c();
axp_i2c_read(AXP805_ADDR, 0x32, &val); axp_i2c_read(AXP805_ADDR, 0x32, &val);
val |= 0x80; axp_i2c_write(AXP805_ADDR, 0x32, val | 0x80);
axp_i2c_write(AXP805_ADDR, 0x32, val);
break; break;
default: default:
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment