summaryrefslogtreecommitdiff
path: root/include/linux/mfd/palmas.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/palmas.h')
-rw-r--r--include/linux/mfd/palmas.h40
1 files changed, 28 insertions, 12 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 8f21daf..1a8dd7a 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
@@ -32,11 +34,30 @@
((a) == PALMAS_CHIP_ID))
#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
+/**
+ * Palmas PMIC feature types
+ *
+ * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10_BOOST
+ * regulator.
+ *
+ * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a
+ * specific feature (above) or not. Return non-zero, if yes.
+ */
+#define PALMAS_PMIC_FEATURE_SMPS10_BOOST BIT(0)
+#define PALMAS_PMIC_HAS(b, f) \
+ ((b)->features & PALMAS_PMIC_FEATURE_ ## f)
+
struct palmas_pmic;
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;
@@ -46,6 +67,7 @@ struct palmas {
/* Stored chip id */
int id;
+ unsigned int features;
/* IRQ Data */
int irq;
u32 irq_mask;
@@ -180,9 +202,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 +369,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)