diff options
Diffstat (limited to 'firmware/target/arm/imx31')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c | 37 | ||||
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/usb-imx31.c | 4 |
3 files changed, 22 insertions, 21 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c index 27c6957184..d26d708da1 100644 --- a/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/adc-imx31.c | |||
@@ -102,5 +102,5 @@ void adc_init(void) | |||
102 | mc13783_write(MC13783_ADC1, MC13783_ADEN); | 102 | mc13783_write(MC13783_ADC1, MC13783_ADEN); |
103 | /* Enable the ADCDONE interrupt - notifications are dispatched by | 103 | /* Enable the ADCDONE interrupt - notifications are dispatched by |
104 | * event handler. */ | 104 | * event handler. */ |
105 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_ADCDONE); | 105 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_ADCDONEM); |
106 | } | 106 | } |
diff --git a/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c b/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c index ddf8d1360f..4f2bd9d931 100644 --- a/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/mc13783-imx31.c | |||
@@ -74,18 +74,18 @@ static void mc13783_interrupt_thread(void) | |||
74 | 74 | ||
75 | gpio_enable_event(MC13783_GPIO_NUM, MC13783_EVENT_ID); | 75 | gpio_enable_event(MC13783_GPIO_NUM, MC13783_EVENT_ID); |
76 | 76 | ||
77 | if (pending[1] & MC13783_TODA) /* only needs to be polled on startup */ | 77 | if (pending[1] & MC13783_TODAI) /* only needs to be polled on startup */ |
78 | mc13783_alarm_start(); | 78 | mc13783_alarm_start(); |
79 | 79 | ||
80 | /* Check initial states for events with a sense bit */ | 80 | /* Check initial states for events with a sense bit */ |
81 | value = mc13783_read(MC13783_INTERRUPT_SENSE0); | 81 | value = mc13783_read(MC13783_INTERRUPT_SENSE0); |
82 | usb_set_status(value & MC13783_USB4V4); | 82 | usb_set_status(value & MC13783_USB4V4S); |
83 | set_charger_inserted(value & MC13783_CHGDET); | 83 | set_charger_inserted(value & MC13783_CHGDETS); |
84 | 84 | ||
85 | value = mc13783_read(MC13783_INTERRUPT_SENSE1); | 85 | value = mc13783_read(MC13783_INTERRUPT_SENSE1); |
86 | button_power_set_state((value & MC13783_ONOFD1) == 0); | 86 | button_power_set_state((value & MC13783_ONOFD1S) == 0); |
87 | #ifdef HAVE_HEADPHONE_DETECTION | 87 | #ifdef HAVE_HEADPHONE_DETECTION |
88 | set_headphones_inserted((value & MC13783_ONOFD2) == 0); | 88 | set_headphones_inserted((value & MC13783_ONOFD2S) == 0); |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | pending[0] = pending[1] = 0xffffff; | 91 | pending[0] = pending[1] = 0xffffff; |
@@ -93,8 +93,9 @@ static void mc13783_interrupt_thread(void) | |||
93 | 93 | ||
94 | /* Enable desired PMIC interrupts - some are unmasked in the drivers that | 94 | /* Enable desired PMIC interrupts - some are unmasked in the drivers that |
95 | * handle a specific task */ | 95 | * handle a specific task */ |
96 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_CHGDET); | 96 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_CHGDETM); |
97 | mc13783_clear(MC13783_INTERRUPT_MASK1, MC13783_ONOFD1 | MC13783_ONOFD2); | 97 | mc13783_clear(MC13783_INTERRUPT_MASK1, MC13783_ONOFD1M | |
98 | MC13783_ONOFD2M); | ||
98 | 99 | ||
99 | while (1) | 100 | while (1) |
100 | { | 101 | { |
@@ -116,20 +117,20 @@ static void mc13783_interrupt_thread(void) | |||
116 | /* Handle ...PENDING0 */ | 117 | /* Handle ...PENDING0 */ |
117 | 118 | ||
118 | /* Handle interrupts without a sense bit */ | 119 | /* Handle interrupts without a sense bit */ |
119 | if (pending[0] & MC13783_ADCDONE) | 120 | if (pending[0] & MC13783_ADCDONEI) |
120 | adc_done(); | 121 | adc_done(); |
121 | 122 | ||
122 | /* Handle interrupts that have a sense bit that needs to | 123 | /* Handle interrupts that have a sense bit that needs to |
123 | * be checked */ | 124 | * be checked */ |
124 | if (pending[0] & (MC13783_CHGDET | MC13783_USB4V4)) | 125 | if (pending[0] & (MC13783_CHGDETI | MC13783_USB4V4I)) |
125 | { | 126 | { |
126 | value = mc13783_read(MC13783_INTERRUPT_SENSE0); | 127 | value = mc13783_read(MC13783_INTERRUPT_SENSE0); |
127 | 128 | ||
128 | if (pending[0] & MC13783_CHGDET) | 129 | if (pending[0] & MC13783_CHGDETI) |
129 | set_charger_inserted(value & MC13783_CHGDET); | 130 | set_charger_inserted(value & MC13783_CHGDETS); |
130 | 131 | ||
131 | if (pending[0] & MC13783_USB4V4) | 132 | if (pending[0] & MC13783_USB4V4I) |
132 | usb_set_status(value & MC13783_USB4V4); | 133 | usb_set_status(value & MC13783_USB4V4S); |
133 | } | 134 | } |
134 | } | 135 | } |
135 | 136 | ||
@@ -142,15 +143,15 @@ static void mc13783_interrupt_thread(void) | |||
142 | 143 | ||
143 | /* Handle interrupts that have a sense bit that needs to | 144 | /* Handle interrupts that have a sense bit that needs to |
144 | * be checked */ | 145 | * be checked */ |
145 | if (pending[1] & (MC13783_ONOFD1 | MC13783_ONOFD2)) | 146 | if (pending[1] & (MC13783_ONOFD1I | MC13783_ONOFD2I)) |
146 | { | 147 | { |
147 | value = mc13783_read(MC13783_INTERRUPT_SENSE1); | 148 | value = mc13783_read(MC13783_INTERRUPT_SENSE1); |
148 | 149 | ||
149 | if (pending[1] & MC13783_ONOFD1) | 150 | if (pending[1] & MC13783_ONOFD1I) |
150 | button_power_set_state((value & MC13783_ONOFD1) == 0); | 151 | button_power_set_state((value & MC13783_ONOFD1S) == 0); |
151 | #ifdef HAVE_HEADPHONE_DETECTION | 152 | #ifdef HAVE_HEADPHONE_DETECTION |
152 | if (pending[1] & MC13783_ONOFD2) | 153 | if (pending[1] & MC13783_ONOFD2I) |
153 | set_headphones_inserted((value & MC13783_ONOFD2) == 0); | 154 | set_headphones_inserted((value & MC13783_ONOFD2S) == 0); |
154 | #endif | 155 | #endif |
155 | } | 156 | } |
156 | } | 157 | } |
diff --git a/firmware/target/arm/imx31/gigabeat-s/usb-imx31.c b/firmware/target/arm/imx31/gigabeat-s/usb-imx31.c index a90384d35e..f12fd8f0b1 100644 --- a/firmware/target/arm/imx31/gigabeat-s/usb-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/usb-imx31.c | |||
@@ -61,7 +61,7 @@ int usb_detect(void) | |||
61 | /* Read the immediate state of the cable from the PMIC */ | 61 | /* Read the immediate state of the cable from the PMIC */ |
62 | bool usb_plugged(void) | 62 | bool usb_plugged(void) |
63 | { | 63 | { |
64 | return mc13783_read(MC13783_INTERRUPT_SENSE0) & MC13783_USB4V4; | 64 | return mc13783_read(MC13783_INTERRUPT_SENSE0) & MC13783_USB4V4S; |
65 | } | 65 | } |
66 | 66 | ||
67 | void usb_init_device(void) | 67 | void usb_init_device(void) |
@@ -73,7 +73,7 @@ void usb_init_device(void) | |||
73 | /* Module will be turned off later after firmware init */ | 73 | /* Module will be turned off later after firmware init */ |
74 | usb_drv_startup(); | 74 | usb_drv_startup(); |
75 | 75 | ||
76 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_USB4V4); | 76 | mc13783_clear(MC13783_INTERRUPT_MASK0, MC13783_USB4V4M); |
77 | } | 77 | } |
78 | 78 | ||
79 | void usb_enable(bool on) | 79 | void usb_enable(bool on) |