summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-10-23 01:05:28 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-10-23 13:33:02 +0200
commit78c060b09c7f5da4e2d71aedfc7dedb74e7d70a8 (patch)
treeeaa1ad8ae25ba363241fb9898c63fa4f8c4cc177
parent4aa32fb8f4b2921cca6e17716d7ad8a7a30f192a (diff)
downloadrockbox-78c060b.tar.gz
rockbox-78c060b.tar.bz2
rockbox-78c060b.zip
imx233: rework vdd5v shared irq handling
The previous code disabled the irq when there were fired. This seems unreliable for some mysterious reason. Instead simply disable them before enabling the irq. Change-Id: I7ee1aa25dbc41c7dd53aa7c7744aa5e4d70ff2d8 Reviewed-on: http://gerrit.rockbox.org/640 Reviewed-by: benjamin brown <foolshperson@gmail.com> Tested-by: benjamin brown <foolshperson@gmail.com> Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
-rw-r--r--firmware/target/arm/imx233/power-imx233.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/firmware/target/arm/imx233/power-imx233.c b/firmware/target/arm/imx233/power-imx233.c
index dbecce5c77..b0e614afe7 100644
--- a/firmware/target/arm/imx233/power-imx233.c
+++ b/firmware/target/arm/imx233/power-imx233.c
@@ -120,26 +120,6 @@ void INT_VDD5V(void)
BF_CLR(POWER_CTRL, VDD5V_GT_VDDIO_IRQ);
}
#endif
-#if IMX233_SUBTARGET >= 3700
- /* this IRQ is shared by several sources, disable them */
- if(BF_RD(POWER_CTRL, PSWITCH_IRQ))
- {
- BF_CLR(POWER_CTRL, ENIRQ_PSWITCH);
- BF_CLR(POWER_CTRL, PSWITCH_IRQ);
- }
-#if IMX233_SUBTARGET < 3780
- if(BF_RD(POWER_CTRL, LINREG_OK_IRQ))
- {
- BF_CLR(POWER_CTRL, ENIRQ_LINREG_OK);
- BF_CLR(POWER_CTRL, LINREG_OK_IRQ);
- }
-#endif /* IMX233_SUBTARGET < 3780 */
- if(BF_RD(POWER_CTRL, DC_OK_IRQ))
- {
- BF_CLR(POWER_CTRL, ENIRQ_DC_OK);
- BF_CLR(POWER_CTRL, DC_OK_IRQ);
- }
-#endif /* IMX233_SUBTARGET >= 3700 */
}
void imx233_power_init(void)
@@ -174,7 +154,17 @@ void imx233_power_init(void)
else
BF_SET(POWER_CTRL, POLARITY_VDD5V_GT_VDDIO);
BF_SET(POWER_CTRL, ENIRQ_VDD5V_GT_VDDIO);
+ /* make the vbusvalid detection way is not enabled */
+ BF_CLR(POWER_CTRL, ENIRQ_VBUS_VALID);
#endif
+ /* the VDD5V IRQ is shared by several sources, disable them */
+#if IMX233_SUBTARGET >= 3700
+ BF_CLR(POWER_CTRL, ENIRQ_PSWITCH);
+ BF_CLR(POWER_CTRL, ENIRQ_DC_OK);
+#if IMX233_SUBTARGET < 3780
+ BF_CLR(POWER_CTRL, ENIRQ_LINREG_OK);
+#endif /* IMX233_SUBTARGET < 3780 */
+#endif /* IMX233_SUBTARGET >= 3700 */
imx233_icoll_enable_interrupt(INT_SRC_VDD5V, true);
}