summaryrefslogtreecommitdiff
path: root/firmware/target/arm/powermgmt-ascodec.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-19 13:41:25 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-19 13:41:25 +0000
commit616c98b38f6ddac0ac3dde8ec0fa248f835717e2 (patch)
tree5eeeabb85fbefa162a438edca88611c1bc688269 /firmware/target/arm/powermgmt-ascodec.c
parentcef6399c4c3bcaa35733bdab8b9016b66b71a6f0 (diff)
downloadrockbox-616c98b38f6ddac0ac3dde8ec0fa248f835717e2.tar.gz
rockbox-616c98b38f6ddac0ac3dde8ec0fa248f835717e2.zip
USB detection changes. c200/e200: Consider USB to be powered when charger is plugged but detect USB connection by bus reset. When received, disconnect and restart the driver fully enabled. imx31: Fix hack used to make initial connect succeeded-- set PHY type before initial reset. General: Move some target code out of usb-drv-arc.c and implement it in respective usb sources and CPU headers so things stay clean.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19797 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/powermgmt-ascodec.c')
-rw-r--r--firmware/target/arm/powermgmt-ascodec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/target/arm/powermgmt-ascodec.c b/firmware/target/arm/powermgmt-ascodec.c
index ab9fd7b490..6ee6209823 100644
--- a/firmware/target/arm/powermgmt-ascodec.c
+++ b/firmware/target/arm/powermgmt-ascodec.c
@@ -27,6 +27,8 @@
27#include "adc.h" 27#include "adc.h"
28#include "powermgmt.h" 28#include "powermgmt.h"
29#include "power.h" 29#include "power.h"
30#include "usb-target.h"
31#include "usb.h"
30 32
31/*=========================================================================== 33/*===========================================================================
32 * These parameters may be defined per target: 34 * These parameters may be defined per target:
@@ -132,6 +134,10 @@ static inline void charger_plugged(void)
132{ 134{
133 batt_threshold = BATT_FULL_VOLTAGE; /* Start with topped value. */ 135 batt_threshold = BATT_FULL_VOLTAGE; /* Start with topped value. */
134 battery_voltage_sync(); 136 battery_voltage_sync();
137#if defined(USB_STATUS_BY_EVENT) && defined(USB_DETECT_BY_DRV)
138 /* Charger pin detect is USB pin detect */
139 usb_connect_event(true);
140#endif
135} 141}
136 142
137static inline void charger_control(void) 143static inline void charger_control(void)
@@ -186,6 +192,10 @@ static inline void charger_unplugged(void)
186 disable_charger(); 192 disable_charger();
187 if (charge_state >= CHARGE_STATE_ERROR) 193 if (charge_state >= CHARGE_STATE_ERROR)
188 charge_state = DISCHARGING; /* Reset error */ 194 charge_state = DISCHARGING; /* Reset error */
195#if defined(USB_STATUS_BY_EVENT) && defined(USB_DETECT_BY_DRV)
196 /* Charger pin detect is USB pin detect */
197 usb_connect_event(false);
198#endif
189} 199}
190 200
191/* Main charging algorithm - called from powermgmt.c */ 201/* Main charging algorithm - called from powermgmt.c */