summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-08-08 02:35:23 +0100
committerAndre Przywara <andre.przywara@arm.com>2016-08-08 23:54:04 +0100
commitf11ecb4af7f9f337a2bae0adc6c340236823bfbf (patch)
tree75b2cbd003ae19a49daaf6887dbf5b1c887ce907
parentd697594a5db02f6aa1e2368a110530ea29da329d (diff)
sunxi: power: enable DLDO4 switch as well
The DLDO4 switch enables power to the SDIO module slot, which usually carries a WiFi module. Enable this power rail unconditionally for now until we have proper regulator support. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
-rw-r--r--plat/sun50iw1p1/sunxi_power.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plat/sun50iw1p1/sunxi_power.c b/plat/sun50iw1p1/sunxi_power.c
index 8507f7c..71d7775 100644
--- a/plat/sun50iw1p1/sunxi_power.c
+++ b/plat/sun50iw1p1/sunxi_power.c
@@ -212,7 +212,7 @@ static int pmic_init(uint16_t hw_addr, uint8_t rt_addr)
return 0;
}
-/* Setup the PMIC: DCDC1 to 3.3V, enable DC1SW */
+/* Setup the PMIC: DCDC1 to 3.3V, enable DC1SW and DLDO4 */
static int pmic_setup(void)
{
int ret;
@@ -236,17 +236,17 @@ static int pmic_setup(void)
}
ret = sunxi_pmic_read(0x12);
- if (ret != 0x01 && ret != 0x81) {
+ if ((ret & 0x3f) != 0x01) {
NOTICE("PMIC: Output power control 2 is an unexpected 0x%x\n",
ret);
return -3;
}
- if (ret != 0x81) {
- /* Enable DC1SW to power PHY */
- ret = sunxi_pmic_write(0x12, ret | 0x80);
+ if ((ret & 0xc1) != 0xc1) {
+ /* Enable DC1SW to power PHY and DLDO4 for WiFi */
+ ret = sunxi_pmic_write(0x12, ret | 0xc0);
if (ret < 0) {
- NOTICE("PMIC: error %d enabling DC1SW\n", ret);
+ NOTICE("PMIC: error %d enabling DC1SW/DLDO4\n", ret);
return -4;
}
}