summaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorGraeme Gregory <gg@slimlogic.co.uk>2013-05-28 10:50:11 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-17 16:08:36 -0700
commitb1f254e35d85535b17af2786d06fe88f15f304f7 (patch)
treef20a4fc680fa2af1793ab11e11c09a6d23acad40 /include/linux/mfd
parent9c8a013af49cb82a1a47bede56e8ce5efd93b734 (diff)
extcon: Palmas Extcon Driver
This is the driver for the USB comparator built into the palmas chip. It handles the various USB OTG events that can be generated by cable insertion/removal. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Ruchika Kharwar <ruchika@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: George Cherian <george.cherian@ti.com> [kishon@ti.com: adapted palmas usb driver to use the extcon framework] Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/palmas.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 8f21daf62fb..9b81b2bdc46 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -20,6 +20,8 @@
#include <linux/leds.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
+#include <linux/extcon.h>
+#include <linux/usb/phy_companion.h>
#define PALMAS_NUM_CLIENTS 3
@@ -37,6 +39,12 @@ struct palmas_gpadc;
struct palmas_resource;
struct palmas_usb;
+enum palmas_usb_state {
+ PALMAS_USB_STATE_DISCONNECT,
+ PALMAS_USB_STATE_VBUS,
+ PALMAS_USB_STATE_ID,
+};
+
struct palmas {
struct device *dev;
@@ -180,9 +188,6 @@ struct palmas_pmic_platform_data {
};
struct palmas_usb_platform_data {
- /* Set this if platform wishes its own vbus control */
- int no_control_vbus;
-
/* Do we enable the wakeup comparator on probe */
int wakeup;
};
@@ -350,22 +355,19 @@ struct palmas_usb {
struct palmas *palmas;
struct device *dev;
- /* for vbus reporting with irqs disabled */
- spinlock_t lock;
-
- struct regulator *vbus_reg;
+ struct extcon_dev edev;
/* used to set vbus, in atomic path */
struct work_struct set_vbus_work;
- int irq1;
- int irq2;
- int irq3;
- int irq4;
+ int id_otg_irq;
+ int id_irq;
+ int vbus_otg_irq;
+ int vbus_irq;
int vbus_enable;
- u8 linkstat;
+ enum palmas_usb_state linkstat;
};
#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)