[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1260531086-23857-3-git-send-email-felipe.balbi@nokia.com>
Date: Fri, 11 Dec 2009 13:31:23 +0200
From: Felipe Balbi <felipe.balbi@...ia.com>
To: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Anton Vorontsov <avorontsov@...mvista.com>,
Grazvydas Ignotas <notasas@...il.com>,
Madhusudhan Chikkature <madhu.cr@...com>,
linux-omap@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
David Brownell <dbrownell@...rs.sourceforge.net>,
Felipe Balbi <felipe.balbi@...ia.com>
Subject: [RFC/PATCH 2/5] usb: otg: twl4030: add support for notifier
it's expected that the transceiver driver will
initialize and call the notifier chain when
necessary. Implement that for twl4030-usb driver.
Signed-off-by: Felipe Balbi <felipe.balbi@...ia.com>
---
drivers/usb/otg/twl4030-usb.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 2ffc8eb..c3e498a 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -36,7 +36,7 @@
#include <linux/i2c/twl4030.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
-
+#include <linux/notifier.h>
/* Register defines */
@@ -628,7 +628,8 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
else
twl4030_phy_resume(twl);
- twl4030charger_usb_en(status == USB_LINK_VBUS);
+ blocking_notifier_call_chain(&twl->otg.notifier, status,
+ twl->otg.gadget);
}
sysfs_notify(&twl->dev->kobj, NULL, "vbus");
@@ -718,6 +719,8 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)
if (device_create_file(&pdev->dev, &dev_attr_vbus))
dev_warn(&pdev->dev, "could not create sysfs file\n");
+ BLOCKING_INIT_NOTIFIER_HEAD(&twl->otg.notifier);
+
/* Our job is to use irqs and status from the power module
* to keep the transceiver disabled when nothing's connected.
*
--
1.6.6.rc0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists