summaryrefslogtreecommitdiff
path: root/include/linux/mfd/tps65912.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mfd/tps65912.h')
-rw-r--r--include/linux/mfd/tps65912.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
index 6d309032dc0..426f5e5e08f 100644
--- a/include/linux/mfd/tps65912.h
+++ b/include/linux/mfd/tps65912.h
@@ -264,6 +264,31 @@
#define DCDC_LIMIT_MAX_SEL_MASK 0x3F
#define DCDC_LIMIT_MAX_SEL_SHIFT 0
+/* Register LOADSWITCH */
+#define LOADSWITCH_MASK 0x03
+#define LOADSWITCH_DISABLE 0
+#define LOADSWITCH_ENABLE 1
+
+/* Number of step-down converters available */
+#define TPS65912_NUM_DCDC 4
+
+/* Number of LDO voltage regulators available */
+#define TPS65912_NUM_LDO 10
+
+/* Number of total regulators available */
+#define TPS65912_NUM_REGULATOR (TPS65912_NUM_DCDC + TPS65912_NUM_LDO)
+
+enum pwrkey_states {
+ PWRKEY_RELEASE, /* Power key released state. */
+ PWRKEY_PRESS, /* Power key pressed state. */
+ PWRKEY_UNKNOWN, /* Unknown power key state. */
+};
+
+struct tps65912_register_init_data {
+ u8 addr;
+ u16 data;
+};
+
/**
* struct tps65912_board
* Board platform dat may be used to initialize regulators.
@@ -276,7 +301,10 @@ struct tps65912_board {
int irq;
int irq_base;
int gpio_base;
- struct regulator_init_data *tps65912_pmic_init_data;
+ int num_init_registers;
+ struct tps65912_register_init_data *register_init_data;
+ struct regulator_init_data
+ *regulator_init_data[TPS65912_NUM_REGULATOR];
};
/**
@@ -306,6 +334,13 @@ struct tps65912 {
int irq_base;
int irq_num;
u32 irq_mask;
+ void *debugfs_data;
+ void *keydata;
+ u32 powerkey_state;
+ u32 powerkey_code;
+ u32 powerkey_up_irq;
+ u32 powerkey_down_irq;
+ struct mutex pm_lock; /* guard access to spi bus from irq */
};
struct tps65912_platform_data {
@@ -313,6 +348,16 @@ struct tps65912_platform_data {
int irq_base;
};
+static inline void tps65912_set_keydata(struct tps65912 *tps65912, void *data)
+{
+ tps65912->keydata = data;
+}
+
+static inline void *tps65912_get_keydata(struct tps65912 *tps65912)
+{
+ return tps65912->keydata;
+}
+
unsigned int tps_chip(void);
int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
@@ -324,5 +369,10 @@ void tps65912_device_exit(struct tps65912 *tps65912);
int tps65912_irq_init(struct tps65912 *tps65912, int irq,
struct tps65912_platform_data *pdata);
int tps65912_irq_exit(struct tps65912 *tps65912);
+int tps65912_debugfs_create(struct tps65912 *tps65912);
+void tps65912_debugfs_remove(struct tps65912 *tps65912);
+void tps65912_dump_registers(struct tps65912 *tps65912);
+void tps65912_broadcast_key_event(struct tps65912 *tps65912,
+ unsigned int code, int value);
#endif /* __LINUX_MFD_TPS65912_H */