aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c/twl.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 09:43:54 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 10:06:11 -0400
commit7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch)
tree5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/linux/i2c/twl.h
parent7d754596756240fa918b94cd0c3011c77a638987 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
Merge 'Linux v3.0' into Litmus
Some notes: * Litmus^RT scheduling class is the topmost scheduling class (above stop_sched_class). * scheduler_ipi() function (e.g., in smp_reschedule_interrupt()) may increase IPI latencies. * Added path into schedule() to quickly re-evaluate scheduling decision without becoming preemptive again. This used to be a standard path before the removal of BKL. Conflicts: Makefile arch/arm/kernel/calls.S arch/arm/kernel/smp.c arch/x86/include/asm/unistd_32.h arch/x86/kernel/smp.c arch/x86/kernel/syscall_table_32.S include/linux/hrtimer.h kernel/printk.c kernel/sched.c kernel/sched_fair.c
Diffstat (limited to 'include/linux/i2c/twl.h')
-rw-r--r--include/linux/i2c/twl.h146
1 files changed, 143 insertions, 3 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 6de90bfc6acd..ba4f88624fcd 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -91,6 +91,7 @@
91#define BCI_INTR_OFFSET 2 91#define BCI_INTR_OFFSET 2
92#define MADC_INTR_OFFSET 3 92#define MADC_INTR_OFFSET 3
93#define USB_INTR_OFFSET 4 93#define USB_INTR_OFFSET 4
94#define CHARGERFAULT_INTR_OFFSET 5
94#define BCI_PRES_INTR_OFFSET 9 95#define BCI_PRES_INTR_OFFSET 9
95#define USB_PRES_INTR_OFFSET 10 96#define USB_PRES_INTR_OFFSET 10
96#define RTC_INTR_OFFSET 11 97#define RTC_INTR_OFFSET 11
@@ -141,6 +142,21 @@
141#define TWL6030_CHARGER_CTRL_INT_MASK 0x10 142#define TWL6030_CHARGER_CTRL_INT_MASK 0x10
142#define TWL6030_CHARGER_FAULT_INT_MASK 0x60 143#define TWL6030_CHARGER_FAULT_INT_MASK 0x60
143 144
145#define TWL6030_MMCCTRL 0xEE
146#define VMMC_AUTO_OFF (0x1 << 3)
147#define SW_FC (0x1 << 2)
148#define STS_MMC 0x1
149
150#define TWL6030_CFG_INPUT_PUPD3 0xF2
151#define MMC_PU (0x1 << 3)
152#define MMC_PD (0x1 << 2)
153
154#define TWL_SIL_TYPE(rev) ((rev) & 0x00FFFFFF)
155#define TWL_SIL_REV(rev) ((rev) >> 24)
156#define TWL_SIL_5030 0x09002F
157#define TWL5030_REV_1_0 0x00
158#define TWL5030_REV_1_1 0x10
159#define TWL5030_REV_1_2 0x30
144 160
145#define TWL4030_CLASS_ID 0x4030 161#define TWL4030_CLASS_ID 0x4030
146#define TWL6030_CLASS_ID 0x6030 162#define TWL6030_CLASS_ID 0x6030
@@ -155,6 +171,8 @@ static inline int twl_class_is_ ##class(void) \
155TWL_CLASS_IS(4030, TWL4030_CLASS_ID) 171TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
156TWL_CLASS_IS(6030, TWL6030_CLASS_ID) 172TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
157 173
174#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
175
158/* 176/*
159 * Read and write single 8-bit registers 177 * Read and write single 8-bit registers
160 */ 178 */
@@ -170,9 +188,33 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
170int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 188int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
171int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 189int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
172 190
191int twl_get_type(void);
192int twl_get_version(void);
193
173int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 194int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
174int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 195int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
175 196
197/* Card detect Configuration for MMC1 Controller on OMAP4 */
198#ifdef CONFIG_TWL4030_CORE
199int twl6030_mmc_card_detect_config(void);
200#else
201static inline int twl6030_mmc_card_detect_config(void)
202{
203 pr_debug("twl6030_mmc_card_detect_config not supported\n");
204 return 0;
205}
206#endif
207
208/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */
209#ifdef CONFIG_TWL4030_CORE
210int twl6030_mmc_card_detect(struct device *dev, int slot);
211#else
212static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
213{
214 pr_debug("Call back twl6030_mmc_card_detect not supported\n");
215 return -EIO;
216}
217#endif
176/*----------------------------------------------------------------------*/ 218/*----------------------------------------------------------------------*/
177 219
178/* 220/*
@@ -248,7 +290,12 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
248 *(Use TWL_4030_MODULE_INTBR) 290 *(Use TWL_4030_MODULE_INTBR)
249 */ 291 */
250 292
293#define REG_IDCODE_7_0 0x00
294#define REG_IDCODE_15_8 0x01
295#define REG_IDCODE_16_23 0x02
296#define REG_IDCODE_31_24 0x03
251#define REG_GPPUPDCTR1 0x0F 297#define REG_GPPUPDCTR1 0x0F
298#define REG_UNLOCK_TEST_REG 0x12
252 299
253/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ 300/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
254 301
@@ -257,6 +304,8 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
257#define SR_I2C_SCL_CTRL_PU BIT(4) 304#define SR_I2C_SCL_CTRL_PU BIT(4)
258#define SR_I2C_SDA_CTRL_PU BIT(6) 305#define SR_I2C_SDA_CTRL_PU BIT(6)
259 306
307#define TWL_EEPROM_R_UNLOCK 0x49
308
260/*----------------------------------------------------------------------*/ 309/*----------------------------------------------------------------------*/
261 310
262/* 311/*
@@ -357,6 +406,52 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
357 406
358/*----------------------------------------------------------------------*/ 407/*----------------------------------------------------------------------*/
359 408
409/*
410 * PM Master module register offsets (use TWL4030_MODULE_PM_MASTER)
411 */
412
413#define TWL4030_PM_MASTER_CFG_P1_TRANSITION 0x00
414#define TWL4030_PM_MASTER_CFG_P2_TRANSITION 0x01
415#define TWL4030_PM_MASTER_CFG_P3_TRANSITION 0x02
416#define TWL4030_PM_MASTER_CFG_P123_TRANSITION 0x03
417#define TWL4030_PM_MASTER_STS_BOOT 0x04
418#define TWL4030_PM_MASTER_CFG_BOOT 0x05
419#define TWL4030_PM_MASTER_SHUNDAN 0x06
420#define TWL4030_PM_MASTER_BOOT_BCI 0x07
421#define TWL4030_PM_MASTER_CFG_PWRANA1 0x08
422#define TWL4030_PM_MASTER_CFG_PWRANA2 0x09
423#define TWL4030_PM_MASTER_BACKUP_MISC_STS 0x0b
424#define TWL4030_PM_MASTER_BACKUP_MISC_CFG 0x0c
425#define TWL4030_PM_MASTER_BACKUP_MISC_TST 0x0d
426#define TWL4030_PM_MASTER_PROTECT_KEY 0x0e
427#define TWL4030_PM_MASTER_STS_HW_CONDITIONS 0x0f
428#define TWL4030_PM_MASTER_P1_SW_EVENTS 0x10
429#define TWL4030_PM_MASTER_P2_SW_EVENTS 0x11
430#define TWL4030_PM_MASTER_P3_SW_EVENTS 0x12
431#define TWL4030_PM_MASTER_STS_P123_STATE 0x13
432#define TWL4030_PM_MASTER_PB_CFG 0x14
433#define TWL4030_PM_MASTER_PB_WORD_MSB 0x15
434#define TWL4030_PM_MASTER_PB_WORD_LSB 0x16
435#define TWL4030_PM_MASTER_SEQ_ADD_W2P 0x1c
436#define TWL4030_PM_MASTER_SEQ_ADD_P2A 0x1d
437#define TWL4030_PM_MASTER_SEQ_ADD_A2W 0x1e
438#define TWL4030_PM_MASTER_SEQ_ADD_A2S 0x1f
439#define TWL4030_PM_MASTER_SEQ_ADD_S2A12 0x20
440#define TWL4030_PM_MASTER_SEQ_ADD_S2A3 0x21
441#define TWL4030_PM_MASTER_SEQ_ADD_WARM 0x22
442#define TWL4030_PM_MASTER_MEMORY_ADDRESS 0x23
443#define TWL4030_PM_MASTER_MEMORY_DATA 0x24
444
445#define TWL4030_PM_MASTER_KEY_CFG1 0xc0
446#define TWL4030_PM_MASTER_KEY_CFG2 0x0c
447
448#define TWL4030_PM_MASTER_KEY_TST1 0xe0
449#define TWL4030_PM_MASTER_KEY_TST2 0x0e
450
451#define TWL4030_PM_MASTER_GLOBAL_TST 0xb6
452
453/*----------------------------------------------------------------------*/
454
360/* Power bus message definitions */ 455/* Power bus message definitions */
361 456
362/* The TWL4030/5030 splits its power-management resources (the various 457/* The TWL4030/5030 splits its power-management resources (the various
@@ -424,7 +519,7 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
424#define RES_32KCLKOUT 26 519#define RES_32KCLKOUT 26
425#define RES_RESET 27 520#define RES_RESET 27
426/* Power Reference */ 521/* Power Reference */
427#define RES_Main_Ref 28 522#define RES_MAIN_REF 28
428 523
429#define TOTAL_RESOURCES 28 524#define TOTAL_RESOURCES 28
430/* 525/*
@@ -516,6 +611,16 @@ enum twl4030_usb_mode {
516 611
517struct twl4030_usb_data { 612struct twl4030_usb_data {
518 enum twl4030_usb_mode usb_mode; 613 enum twl4030_usb_mode usb_mode;
614 unsigned long features;
615
616 int (*phy_init)(struct device *dev);
617 int (*phy_exit)(struct device *dev);
618 /* Power on/off the PHY */
619 int (*phy_power)(struct device *dev, int iD, int on);
620 /* enable/disable phy clocks */
621 int (*phy_set_clock)(struct device *dev, int on);
622 /* suspend/resume of phy */
623 int (*phy_suspend)(struct device *dev, int suspend);
519}; 624};
520 625
521struct twl4030_ins { 626struct twl4030_ins {
@@ -553,14 +658,16 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
553extern int twl4030_remove_script(u8 flags); 658extern int twl4030_remove_script(u8 flags);
554 659
555struct twl4030_codec_audio_data { 660struct twl4030_codec_audio_data {
556 unsigned int audio_mclk; 661 unsigned int digimic_delay; /* in ms */
557 unsigned int ramp_delay_value; 662 unsigned int ramp_delay_value;
663 unsigned int offset_cncl_path;
664 unsigned int check_defaults:1;
665 unsigned int reset_registers:1;
558 unsigned int hs_extmute:1; 666 unsigned int hs_extmute:1;
559 void (*set_hs_extmute)(int mute); 667 void (*set_hs_extmute)(int mute);
560}; 668};
561 669
562struct twl4030_codec_vibra_data { 670struct twl4030_codec_vibra_data {
563 unsigned int audio_mclk;
564 unsigned int coexist; 671 unsigned int coexist;
565}; 672};
566 673
@@ -610,6 +717,21 @@ struct twl4030_platform_data {
610 struct regulator_init_data *vana; 717 struct regulator_init_data *vana;
611 struct regulator_init_data *vcxio; 718 struct regulator_init_data *vcxio;
612 struct regulator_init_data *vusb; 719 struct regulator_init_data *vusb;
720 struct regulator_init_data *clk32kg;
721 /* TWL6025 LDO regulators */
722 struct regulator_init_data *ldo1;
723 struct regulator_init_data *ldo2;
724 struct regulator_init_data *ldo3;
725 struct regulator_init_data *ldo4;
726 struct regulator_init_data *ldo5;
727 struct regulator_init_data *ldo6;
728 struct regulator_init_data *ldo7;
729 struct regulator_init_data *ldoln;
730 struct regulator_init_data *ldousb;
731 /* TWL6025 DCDC regulators */
732 struct regulator_init_data *smps3;
733 struct regulator_init_data *smps4;
734 struct regulator_init_data *vio6025;
613}; 735};
614 736
615/*----------------------------------------------------------------------*/ 737/*----------------------------------------------------------------------*/
@@ -689,5 +811,23 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
689 811
690/* INTERNAL LDOs */ 812/* INTERNAL LDOs */
691#define TWL6030_REG_VRTC 47 813#define TWL6030_REG_VRTC 47
814#define TWL6030_REG_CLK32KG 48
815
816/* LDOs on 6025 have different names */
817#define TWL6025_REG_LDO2 49
818#define TWL6025_REG_LDO4 50
819#define TWL6025_REG_LDO3 51
820#define TWL6025_REG_LDO5 52
821#define TWL6025_REG_LDO1 53
822#define TWL6025_REG_LDO7 54
823#define TWL6025_REG_LDO6 55
824#define TWL6025_REG_LDOLN 56
825#define TWL6025_REG_LDOUSB 57
826
827/* 6025 DCDC supplies */
828#define TWL6025_REG_SMPS3 58
829#define TWL6025_REG_SMPS4 59
830#define TWL6025_REG_VIO 60
831
692 832
693#endif /* End of __TWL4030_H */ 833#endif /* End of __TWL4030_H */