lkml.org 
[lkml]   [2010]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4/4] power_supply: isp1704: Detect charger after probe
Hi,

On Fri, Nov 05, 2010 at 04:11:25PM +0100, ext Sergei Shtylyov wrote:
> > @@ -422,6 +422,23 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
> >
> > dev_info(isp->dev, "registered with product id %s\n", isp->model);
> >
> > + /*
> > + * Taking over the D+ pullup.
> > + *
> > + * FIXME: The device will be disconnected if the it was already
> ^^^
> "the" is not needed here.

Here's the fix removing the extra "the". Thanks.

--
heikki
From 22adc046938bdb57adca5acf59fd94539d5e0110 Mon Sep 17 00:00:00 2001
From: Heikki Krogerus <heikki.krogerus@nokia.com>
Date: Thu, 4 Nov 2010 16:14:22 +0200
Subject: [PATCH] power_supply: isp1704: Detect charger after probe

If the device is booted up with cable connected, or the
module is loaded after plugging in the cable, the
notification has come and gone, so not relying on it at
probe time. Instead this checks the VBUS level manually
after probe.

Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
---
drivers/power/isp1704_charger.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index 77c11f1..2ad9b14 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -422,6 +422,23 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)

dev_info(isp->dev, "registered with product id %s\n", isp->model);

+ /*
+ * Taking over the D+ pullup.
+ *
+ * FIXME: The device will be disconnected if it was already
+ * enumerated. The charger driver should be always loaded before any
+ * gadget is loaded.
+ */
+ if (isp->otg->gadget)
+ usb_gadget_disconnect(isp->otg->gadget);
+
+ /* Detect charger if VBUS is valid (the cable was already plugged). */
+ ret = otg_io_read(isp->otg, ULPI_USB_INT_STS);
+ if ((ret & ULPI_INT_VBUS_VALID) && !isp->otg->default_a) {
+ isp->event = USB_EVENT_VBUS;
+ schedule_work(&isp->work);
+ }
+
return 0;
fail2:
power_supply_unregister(&isp->psy);
--
1.7.1
\
 
 \ /
  Last update: 2010-11-08 11:25    [W:0.046 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site