diff options
Diffstat (limited to 'include/linux/i2c')
-rw-r--r-- | include/linux/i2c/atmel_mxt_ts.h | 16 | ||||
-rw-r--r-- | include/linux/i2c/panjit_ts.h | 30 | ||||
-rw-r--r-- | include/linux/i2c/twl.h | 83 | ||||
-rw-r--r-- | include/linux/i2c/twl4030-madc.h | 4 |
4 files changed, 126 insertions, 7 deletions
diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h index f027f7a6351..29550c11f6d 100644 --- a/include/linux/i2c/atmel_mxt_ts.h +++ b/include/linux/i2c/atmel_mxt_ts.h | |||
@@ -2,6 +2,8 @@ | |||
2 | * Atmel maXTouch Touchscreen driver | 2 | * Atmel maXTouch Touchscreen driver |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd | 4 | * Copyright (C) 2010 Samsung Electronics Co.Ltd |
5 | * Copyright (C) 2011 Atmel Corporation | ||
6 | * Copyright (C) 2011 NVIDIA Corporation | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | 7 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> |
6 | * | 8 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 9 | * This program is free software; you can redistribute it and/or modify it |
@@ -15,6 +17,16 @@ | |||
15 | 17 | ||
16 | #include <linux/types.h> | 18 | #include <linux/types.h> |
17 | 19 | ||
20 | /* | ||
21 | * Atmel I2C addresses | ||
22 | */ | ||
23 | #define MXT224_I2C_ADDR1 0x4A | ||
24 | #define MXT224_I2C_ADDR2 0x4B | ||
25 | #define MXT1386_I2C_ADDR1 0x4C | ||
26 | #define MXT1386_I2C_ADDR2 0x4D | ||
27 | #define MXT1386_I2C_ADDR3 0x5A | ||
28 | #define MXT1386_I2C_ADDR4 0x5B | ||
29 | |||
18 | /* Orient */ | 30 | /* Orient */ |
19 | #define MXT_NORMAL 0x0 | 31 | #define MXT_NORMAL 0x0 |
20 | #define MXT_DIAGONAL 0x1 | 32 | #define MXT_DIAGONAL 0x1 |
@@ -39,6 +51,10 @@ struct mxt_platform_data { | |||
39 | unsigned int voltage; | 51 | unsigned int voltage; |
40 | unsigned char orient; | 52 | unsigned char orient; |
41 | unsigned long irqflags; | 53 | unsigned long irqflags; |
54 | u8(*read_chg) (void); | ||
55 | unsigned long config_crc; | ||
56 | unsigned int actv_cycle_time; | ||
57 | unsigned int idle_cycle_time; | ||
42 | }; | 58 | }; |
43 | 59 | ||
44 | #endif /* __LINUX_ATMEL_MXT_TS_H */ | 60 | #endif /* __LINUX_ATMEL_MXT_TS_H */ |
diff --git a/include/linux/i2c/panjit_ts.h b/include/linux/i2c/panjit_ts.h new file mode 100644 index 00000000000..1dd51e1ecae --- /dev/null +++ b/include/linux/i2c/panjit_ts.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * include/linux/i2c/panjit_ts.h | ||
3 | * | ||
4 | * Copyright (c) 2010, NVIDIA Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _LINUX_I2C_PANJIT_TS_H | ||
22 | #define _LINUX_I2C_PANJIT_TS_H | ||
23 | |||
24 | struct device; | ||
25 | |||
26 | struct panjit_i2c_ts_platform_data { | ||
27 | int gpio_reset; | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index ba4f88624fc..bb92f0b1328 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -82,6 +82,10 @@ | |||
82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 82 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC |
83 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | 83 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 |
84 | 84 | ||
85 | #define TWL6030_MODULE_CHARGER TWL4030_MODULE_MAIN_CHARGE | ||
86 | #define TWL6025_MODULE_CHARGER 0x18 | ||
87 | |||
88 | #define TWL6030_MODULE_GASGAUGE 0x0B | ||
85 | #define TWL6030_MODULE_ID0 0x0D | 89 | #define TWL6030_MODULE_ID0 0x0D |
86 | #define TWL6030_MODULE_ID1 0x0E | 90 | #define TWL6030_MODULE_ID1 0x0E |
87 | #define TWL6030_MODULE_ID2 0x0F | 91 | #define TWL6030_MODULE_ID2 0x0F |
@@ -108,6 +112,7 @@ | |||
108 | #define GASGAUGE_INTR_OFFSET 17 | 112 | #define GASGAUGE_INTR_OFFSET 17 |
109 | #define USBOTG_INTR_OFFSET 4 | 113 | #define USBOTG_INTR_OFFSET 4 |
110 | #define CHARGER_INTR_OFFSET 2 | 114 | #define CHARGER_INTR_OFFSET 2 |
115 | #define GPADCSW_INTR_OFFSET 1 | ||
111 | #define RSV_INTR_OFFSET 0 | 116 | #define RSV_INTR_OFFSET 0 |
112 | 117 | ||
113 | /* INT register offsets */ | 118 | /* INT register offsets */ |
@@ -172,6 +177,14 @@ TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | |||
172 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 177 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
173 | 178 | ||
174 | #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ | 179 | #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ |
180 | #define MPU80031_SUBCLASS BIT(5) /* MPU80031 has changed registers */ | ||
181 | |||
182 | /* So we can recover the features in other parts of twl stack */ | ||
183 | unsigned int twl_features(void); | ||
184 | |||
185 | /* so we can get at the EPROM SMPS OFFSET/MULT stuff */ | ||
186 | u8 twl_get_smps_offset(void); | ||
187 | u8 twl_get_smps_mult(void); | ||
175 | 188 | ||
176 | /* | 189 | /* |
177 | * Read and write single 8-bit registers | 190 | * Read and write single 8-bit registers |
@@ -179,6 +192,8 @@ TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | |||
179 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | 192 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); |
180 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | 193 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); |
181 | 194 | ||
195 | void twl_reg_dump(int module, int start, int end); | ||
196 | |||
182 | /* | 197 | /* |
183 | * Read and write several 8-bit registers at once. | 198 | * Read and write several 8-bit registers at once. |
184 | * | 199 | * |
@@ -215,6 +230,10 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
215 | return -EIO; | 230 | return -EIO; |
216 | } | 231 | } |
217 | #endif | 232 | #endif |
233 | |||
234 | int twl6030_set_usb_charge_enable(int enable); | ||
235 | int twl6030_set_usb_in_current(int currentmA); | ||
236 | |||
218 | /*----------------------------------------------------------------------*/ | 237 | /*----------------------------------------------------------------------*/ |
219 | 238 | ||
220 | /* | 239 | /* |
@@ -552,11 +571,27 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
552 | 571 | ||
553 | struct twl4030_clock_init_data { | 572 | struct twl4030_clock_init_data { |
554 | bool ck32k_lowpwr_enable; | 573 | bool ck32k_lowpwr_enable; |
574 | bool clk32_active_state_on; | ||
555 | }; | 575 | }; |
556 | 576 | ||
557 | struct twl4030_bci_platform_data { | 577 | struct twl4030_bci_platform_data { |
558 | int *battery_tmp_tbl; | 578 | int *battery_tmp_tbl; |
559 | unsigned int tblsize; | 579 | unsigned int battery_tmp_tblsize; |
580 | int *battery_volt_tbl; | ||
581 | unsigned int battery_volt_tblsize; | ||
582 | unsigned int monitoring_interval; | ||
583 | |||
584 | unsigned int max_charger_currentmA; | ||
585 | unsigned int max_charger_voltagemV; | ||
586 | unsigned int termination_currentmA; | ||
587 | |||
588 | unsigned int max_bat_voltagemV; | ||
589 | unsigned int low_bat_voltagemV; | ||
590 | |||
591 | /* twl6025 */ | ||
592 | unsigned int use_hw_charger; | ||
593 | unsigned int use_eeprom_config; | ||
594 | unsigned int power_path; | ||
560 | }; | 595 | }; |
561 | 596 | ||
562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | 597 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ |
@@ -621,6 +656,7 @@ struct twl4030_usb_data { | |||
621 | int (*phy_set_clock)(struct device *dev, int on); | 656 | int (*phy_set_clock)(struct device *dev, int on); |
622 | /* suspend/resume of phy */ | 657 | /* suspend/resume of phy */ |
623 | int (*phy_suspend)(struct device *dev, int suspend); | 658 | int (*phy_suspend)(struct device *dev, int suspend); |
659 | int (*board_control_power)(struct device *dev, int on); | ||
624 | }; | 660 | }; |
625 | 661 | ||
626 | struct twl4030_ins { | 662 | struct twl4030_ins { |
@@ -657,32 +693,49 @@ struct twl4030_power_data { | |||
657 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 693 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
658 | extern int twl4030_remove_script(u8 flags); | 694 | extern int twl4030_remove_script(u8 flags); |
659 | 695 | ||
660 | struct twl4030_codec_audio_data { | 696 | struct twl4030_codec_data { |
661 | unsigned int digimic_delay; /* in ms */ | 697 | unsigned int digimic_delay; /* in ms */ |
662 | unsigned int ramp_delay_value; | 698 | unsigned int ramp_delay_value; |
663 | unsigned int offset_cncl_path; | 699 | unsigned int offset_cncl_path; |
664 | unsigned int check_defaults:1; | 700 | unsigned int check_defaults:1; |
665 | unsigned int reset_registers:1; | 701 | unsigned int reset_registers:1; |
666 | unsigned int hs_extmute:1; | 702 | unsigned int hs_extmute:1; |
703 | u16 hs_left_step; | ||
704 | u16 hs_right_step; | ||
705 | u16 hf_left_step; | ||
706 | u16 hf_right_step; | ||
667 | void (*set_hs_extmute)(int mute); | 707 | void (*set_hs_extmute)(int mute); |
668 | }; | 708 | }; |
669 | 709 | ||
670 | struct twl4030_codec_vibra_data { | 710 | struct twl4030_vibra_data { |
671 | unsigned int coexist; | 711 | unsigned int coexist; |
712 | |||
713 | /* twl6040 */ | ||
714 | unsigned int vibldrv_res; /* left driver resistance */ | ||
715 | unsigned int vibrdrv_res; /* right driver resistance */ | ||
716 | unsigned int viblmotor_res; /* left motor resistance */ | ||
717 | unsigned int vibrmotor_res; /* right motor resistance */ | ||
718 | int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | ||
719 | int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | ||
672 | }; | 720 | }; |
673 | 721 | ||
674 | struct twl4030_codec_data { | 722 | struct twl4030_audio_data { |
675 | unsigned int audio_mclk; | 723 | unsigned int audio_mclk; |
676 | struct twl4030_codec_audio_data *audio; | 724 | struct twl4030_codec_data *codec; |
677 | struct twl4030_codec_vibra_data *vibra; | 725 | struct twl4030_vibra_data *vibra; |
678 | 726 | ||
679 | /* twl6040 */ | 727 | /* twl6040 */ |
680 | int audpwron_gpio; /* audio power-on gpio */ | 728 | int audpwron_gpio; /* audio power-on gpio */ |
681 | int naudint_irq; /* audio interrupt */ | 729 | int naudint_irq; /* audio interrupt */ |
730 | unsigned int irq_base; | ||
682 | }; | 731 | }; |
683 | 732 | ||
684 | struct twl4030_platform_data { | 733 | struct twl4030_platform_data { |
685 | unsigned irq_base, irq_end; | 734 | unsigned irq_base, irq_end; |
735 | |||
736 | /* Callback for boar regulator initialisation */ | ||
737 | int (*init)(void); | ||
738 | |||
686 | struct twl4030_clock_init_data *clock; | 739 | struct twl4030_clock_init_data *clock; |
687 | struct twl4030_bci_platform_data *bci; | 740 | struct twl4030_bci_platform_data *bci; |
688 | struct twl4030_gpio_platform_data *gpio; | 741 | struct twl4030_gpio_platform_data *gpio; |
@@ -690,7 +743,7 @@ struct twl4030_platform_data { | |||
690 | struct twl4030_keypad_data *keypad; | 743 | struct twl4030_keypad_data *keypad; |
691 | struct twl4030_usb_data *usb; | 744 | struct twl4030_usb_data *usb; |
692 | struct twl4030_power_data *power; | 745 | struct twl4030_power_data *power; |
693 | struct twl4030_codec_data *codec; | 746 | struct twl4030_audio_data *audio; |
694 | 747 | ||
695 | /* Common LDO regulators for TWL4030/TWL6030 */ | 748 | /* Common LDO regulators for TWL4030/TWL6030 */ |
696 | struct regulator_init_data *vdac; | 749 | struct regulator_init_data *vdac; |
@@ -809,6 +862,22 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
809 | #define TWL6030_REG_VDAC 45 | 862 | #define TWL6030_REG_VDAC 45 |
810 | #define TWL6030_REG_VUSB 46 | 863 | #define TWL6030_REG_VUSB 46 |
811 | 864 | ||
865 | /* These are renamed in 6025 but same registers */ | ||
866 | #define TWL6025_REG_LDO2 48 | ||
867 | #define TWL6025_REG_LDO4 49 | ||
868 | #define TWL6025_REG_LDO3 50 | ||
869 | #define TWL6025_REG_LDO5 51 | ||
870 | #define TWL6025_REG_LDO1 52 | ||
871 | #define TWL6025_REG_LDO7 53 | ||
872 | #define TWL6025_REG_LDO6 54 | ||
873 | #define TWL6025_REG_LDOLN 55 | ||
874 | #define TWL6025_REG_LDOUSB 56 | ||
875 | |||
876 | /* 6025 DCDC supplies */ | ||
877 | #define TWL6025_REG_SMPS3 57 | ||
878 | #define TWL6025_REG_SMPS4 58 | ||
879 | #define TWL6025_REG_VIO 59 | ||
880 | |||
812 | /* INTERNAL LDOs */ | 881 | /* INTERNAL LDOs */ |
813 | #define TWL6030_REG_VRTC 47 | 882 | #define TWL6030_REG_VRTC 47 |
814 | #define TWL6030_REG_CLK32KG 48 | 883 | #define TWL6030_REG_CLK32KG 48 |
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h index 6427d298fbf..530e11ba073 100644 --- a/include/linux/i2c/twl4030-madc.h +++ b/include/linux/i2c/twl4030-madc.h | |||
@@ -129,6 +129,10 @@ enum sample_type { | |||
129 | #define REG_BCICTL2 0x024 | 129 | #define REG_BCICTL2 0x024 |
130 | #define TWL4030_BCI_ITHSENS 0x007 | 130 | #define TWL4030_BCI_ITHSENS 0x007 |
131 | 131 | ||
132 | /* Register and bits for GPBR1 register */ | ||
133 | #define TWL4030_REG_GPBR1 0x0c | ||
134 | #define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7) | ||
135 | |||
132 | struct twl4030_madc_user_parms { | 136 | struct twl4030_madc_user_parms { |
133 | int channel; | 137 | int channel; |
134 | int average; | 138 | int average; |