diff options
| author | Graeme Gregory <gg@slimlogic.co.uk> | 2013-05-27 21:50:11 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 19:08:36 -0400 |
| commit | b1f254e35d85535b17af2786d06fe88f15f304f7 (patch) | |
| tree | f20a4fc680fa2af1793ab11e11c09a6d23acad40 /include/linux | |
| parent | 9c8a013af49cb82a1a47bede56e8ce5efd93b734 (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')
| -rw-r--r-- | include/linux/mfd/palmas.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 8f21daf62fb5..9b81b2bdc46b 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
| 21 | #include <linux/regmap.h> | 21 | #include <linux/regmap.h> |
| 22 | #include <linux/regulator/driver.h> | 22 | #include <linux/regulator/driver.h> |
| 23 | #include <linux/extcon.h> | ||
| 24 | #include <linux/usb/phy_companion.h> | ||
| 23 | 25 | ||
| 24 | #define PALMAS_NUM_CLIENTS 3 | 26 | #define PALMAS_NUM_CLIENTS 3 |
| 25 | 27 | ||
| @@ -37,6 +39,12 @@ struct palmas_gpadc; | |||
| 37 | struct palmas_resource; | 39 | struct palmas_resource; |
| 38 | struct palmas_usb; | 40 | struct palmas_usb; |
| 39 | 41 | ||
| 42 | enum palmas_usb_state { | ||
| 43 | PALMAS_USB_STATE_DISCONNECT, | ||
| 44 | PALMAS_USB_STATE_VBUS, | ||
| 45 | PALMAS_USB_STATE_ID, | ||
| 46 | }; | ||
| 47 | |||
| 40 | struct palmas { | 48 | struct palmas { |
| 41 | struct device *dev; | 49 | struct device *dev; |
| 42 | 50 | ||
| @@ -180,9 +188,6 @@ struct palmas_pmic_platform_data { | |||
| 180 | }; | 188 | }; |
| 181 | 189 | ||
| 182 | struct palmas_usb_platform_data { | 190 | struct palmas_usb_platform_data { |
| 183 | /* Set this if platform wishes its own vbus control */ | ||
| 184 | int no_control_vbus; | ||
| 185 | |||
| 186 | /* Do we enable the wakeup comparator on probe */ | 191 | /* Do we enable the wakeup comparator on probe */ |
| 187 | int wakeup; | 192 | int wakeup; |
| 188 | }; | 193 | }; |
| @@ -350,22 +355,19 @@ struct palmas_usb { | |||
| 350 | struct palmas *palmas; | 355 | struct palmas *palmas; |
| 351 | struct device *dev; | 356 | struct device *dev; |
| 352 | 357 | ||
| 353 | /* for vbus reporting with irqs disabled */ | 358 | struct extcon_dev edev; |
| 354 | spinlock_t lock; | ||
| 355 | |||
| 356 | struct regulator *vbus_reg; | ||
| 357 | 359 | ||
| 358 | /* used to set vbus, in atomic path */ | 360 | /* used to set vbus, in atomic path */ |
| 359 | struct work_struct set_vbus_work; | 361 | struct work_struct set_vbus_work; |
| 360 | 362 | ||
| 361 | int irq1; | 363 | int id_otg_irq; |
| 362 | int irq2; | 364 | int id_irq; |
| 363 | int irq3; | 365 | int vbus_otg_irq; |
| 364 | int irq4; | 366 | int vbus_irq; |
| 365 | 367 | ||
| 366 | int vbus_enable; | 368 | int vbus_enable; |
| 367 | 369 | ||
| 368 | u8 linkstat; | 370 | enum palmas_usb_state linkstat; |
| 369 | }; | 371 | }; |
| 370 | 372 | ||
| 371 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) | 373 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) |
