~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/i2c/twl.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
#define BCI_INTR_OFFSET         2
92
92
#define MADC_INTR_OFFSET        3
93
93
#define USB_INTR_OFFSET         4
 
94
#define CHARGERFAULT_INTR_OFFSET 5
94
95
#define BCI_PRES_INTR_OFFSET    9
95
96
#define USB_PRES_INTR_OFFSET    10
96
97
#define RTC_INTR_OFFSET         11
150
151
#define MMC_PU                          (0x1 << 3)
151
152
#define MMC_PD                          (0x1 << 2)
152
153
 
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
154
160
 
155
161
#define TWL4030_CLASS_ID                0x4030
156
162
#define TWL6030_CLASS_ID                0x6030
165
171
TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
166
172
TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
167
173
 
 
174
#define TWL6025_SUBCLASS        BIT(4)  /* TWL6025 has changed registers */
 
175
 
168
176
/*
169
177
 * Read and write single 8-bit registers
170
178
 */
180
188
int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
181
189
int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
182
190
 
 
191
int twl_get_type(void);
 
192
int twl_get_version(void);
 
193
 
183
194
int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
184
195
int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
185
196
 
279
290
 *(Use TWL_4030_MODULE_INTBR)
280
291
 */
281
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
282
297
#define REG_GPPUPDCTR1                  0x0F
 
298
#define REG_UNLOCK_TEST_REG             0x12
283
299
 
284
300
/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
285
301
 
288
304
#define SR_I2C_SCL_CTRL_PU              BIT(4)
289
305
#define SR_I2C_SDA_CTRL_PU              BIT(6)
290
306
 
 
307
#define TWL_EEPROM_R_UNLOCK             0x49
 
308
 
291
309
/*----------------------------------------------------------------------*/
292
310
 
293
311
/*
501
519
#define RES_32KCLKOUT           26
502
520
#define RES_RESET               27
503
521
/* Power Reference */
504
 
#define RES_Main_Ref            28
 
522
#define RES_MAIN_REF            28
505
523
 
506
524
#define TOTAL_RESOURCES         28
507
525
/*
593
611
 
594
612
struct twl4030_usb_data {
595
613
        enum twl4030_usb_mode   usb_mode;
 
614
        unsigned long           features;
596
615
 
597
616
        int             (*phy_init)(struct device *dev);
598
617
        int             (*phy_exit)(struct device *dev);
638
657
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
639
658
extern int twl4030_remove_script(u8 flags);
640
659
 
641
 
struct twl4030_codec_audio_data {
 
660
struct twl4030_codec_data {
642
661
        unsigned int digimic_delay; /* in ms */
643
662
        unsigned int ramp_delay_value;
644
663
        unsigned int offset_cncl_path;
645
664
        unsigned int check_defaults:1;
646
665
        unsigned int reset_registers:1;
647
666
        unsigned int hs_extmute:1;
648
 
        u16 left_step_hs;
649
 
        u16 right_step_hs;
650
 
        u16 left_step_hf;
651
 
        u16 right_step_hf;
 
667
        u16 hs_left_step;
 
668
        u16 hs_right_step;
 
669
        u16 hf_left_step;
 
670
        u16 hf_right_step;
652
671
        void (*set_hs_extmute)(int mute);
653
672
};
654
673
 
655
 
struct twl4030_codec_vibra_data {
 
674
struct twl4030_vibra_data {
656
675
        unsigned int    coexist;
657
676
 
 
677
        /* twl6040 */
 
678
        unsigned int vibldrv_res;       /* left driver resistance */
 
679
        unsigned int vibrdrv_res;       /* right driver resistance */
 
680
        unsigned int viblmotor_res;     /* left motor resistance */
 
681
        unsigned int vibrmotor_res;     /* right motor resistance */
 
682
        int vddvibl_uV;                 /* VDDVIBL volt, set 0 for fixed reg */
 
683
        int vddvibr_uV;                 /* VDDVIBR volt, set 0 for fixed reg */
 
684
 
658
685
        /* timed-output based implementations */
659
686
        int max_timeout;
660
687
        int initial_vibrate;
662
689
        void (*exit)(void);
663
690
};
664
691
 
665
 
struct twl4030_codec_data {
 
692
struct twl4030_audio_data {
666
693
        unsigned int    audio_mclk;
667
 
        struct twl4030_codec_audio_data         *audio;
668
 
        struct twl4030_codec_vibra_data         *vibra;
 
694
        struct twl4030_codec_data *codec;
 
695
        struct twl4030_vibra_data *vibra;
669
696
 
670
697
        /* twl6040 */
671
698
        int audpwron_gpio;      /* audio power-on gpio */
682
709
        struct twl4030_keypad_data              *keypad;
683
710
        struct twl4030_usb_data                 *usb;
684
711
        struct twl4030_power_data               *power;
685
 
        struct twl4030_codec_data               *codec;
 
712
        struct twl4030_audio_data               *audio;
686
713
 
687
714
        /* Common LDO regulators for TWL4030/TWL6030 */
688
715
        struct regulator_init_data              *vdac;
710
737
        struct regulator_init_data              *vcxio;
711
738
        struct regulator_init_data              *vusb;
712
739
        struct regulator_init_data              *clk32kg;
 
740
        /* TWL6025 LDO regulators */
 
741
        struct regulator_init_data              *ldo1;
 
742
        struct regulator_init_data              *ldo2;
 
743
        struct regulator_init_data              *ldo3;
 
744
        struct regulator_init_data              *ldo4;
 
745
        struct regulator_init_data              *ldo5;
 
746
        struct regulator_init_data              *ldo6;
 
747
        struct regulator_init_data              *ldo7;
 
748
        struct regulator_init_data              *ldoln;
 
749
        struct regulator_init_data              *ldousb;
 
750
        /* TWL6025 DCDC regulators */
 
751
        struct regulator_init_data              *smps3;
 
752
        struct regulator_init_data              *smps4;
 
753
        struct regulator_init_data              *vio6025;
713
754
};
714
755
 
715
756
/*----------------------------------------------------------------------*/
791
832
#define TWL6030_REG_VRTC        47
792
833
#define TWL6030_REG_CLK32KG     48
793
834
 
 
835
/* LDOs on 6025 have different names */
 
836
#define TWL6025_REG_LDO2        49
 
837
#define TWL6025_REG_LDO4        50
 
838
#define TWL6025_REG_LDO3        51
 
839
#define TWL6025_REG_LDO5        52
 
840
#define TWL6025_REG_LDO1        53
 
841
#define TWL6025_REG_LDO7        54
 
842
#define TWL6025_REG_LDO6        55
 
843
#define TWL6025_REG_LDOLN       56
 
844
#define TWL6025_REG_LDOUSB      57
 
845
 
 
846
/* 6025 DCDC supplies */
 
847
#define TWL6025_REG_SMPS3       58
 
848
#define TWL6025_REG_SMPS4       59
 
849
#define TWL6025_REG_VIO         60
 
850
 
 
851
 
794
852
#endif /* End of __TWL4030_H */