diff options
author | Mike Westerhof <mwester@dls.net> | 2009-05-13 20:15:54 -0500 |
---|---|---|
committer | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-05-15 00:13:52 -0500 |
commit | f16c3431a1a7510eb3504ec5d96677dd0fac4cd6 (patch) | |
tree | aba8891a70648970b201e65dac3ac6dce054eeb1 /arch | |
parent | 37d2b0bea0314d0947af19152898c1ca7fe736cc (diff) |
Add a vbus polling function for use by the udc driver.
Signed-off-by: Mike Westerhof <mwester@dls.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index d16e9d638c1..cb821cedcd0 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -476,11 +476,22 @@ static void gta02_udc_vbus_draw(unsigned int ma) schedule_delayed_work(>a02_charger_work, GTA02_CHARGER_CONFIGURE_TIMEOUT); } + +static int gta02_udc_vbus_status(void) +{ + struct pcf50633 *pcf = gta02_pcf; + + if (!gta02_pcf) + return -ENODEV; + + return !!(pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ONLINE); +} #else /* !CONFIG_CHARGER_PCF50633 */ #define gta02_get_charger_online_status NULL #define gta02_get_charger_active_status NULL #define gta02_pmu_event_callback NULL #define gta02_udc_vbus_draw NULL +#define gta02_udc_vbus_status NULL #endif static struct platform_device gta01_pm_gps_dev = { @@ -954,6 +965,7 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd) static struct s3c2410_udc_mach_info gta02_udc_cfg = { .vbus_draw = gta02_udc_vbus_draw, .udc_command = gta02_udc_command, + .get_vbus_status= gta02_udc_vbus_status, }; |