diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 15:14:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 15:14:20 -0400 |
commit | 9f1912c48ce829d24789e3e5d499de0d44d3306a (patch) | |
tree | 056ca04727d478f74b20d8af5729e0776a942cca /include/linux | |
parent | 4c171acc20794af16a27da25e11ec4e9cad5d9fa (diff) | |
parent | 099691081df40d8863cb2fb01ee64039633892dd (diff) |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (57 commits)
regulator: Fix 88pm8607.c printk format warning
input: Add support for Qualcomm PMIC8XXX power key
input: Add Qualcomm pm8xxx keypad controller driver
mfd: Add omap-usbhs runtime PM support
mfd: Fix ASIC3 SD Host Controller Configuration size
mfd: Fix omap_usbhs_alloc_children error handling
mfd: Fix omap usbhs crash when rmmoding ehci or ohci
mfd: Add ASIC3 LED support
leds: Add ASIC3 LED support
mfd: Update twl4030-code maintainer e-mail address
mfd: Correct the name and bitmask for ab8500-gpadc BTempPullUp
mfd: Add manual ab8500-gpadc batt temp activation for AB8500 3.0
mfd: Provide ab8500-core enumerators for chip cuts
mfd: Check twl4030-power remove script error condition after i2cwrite
mfd: Fix twl6030 irq definitions
mfd: Add phoenix lite (twl6025) support to twl6030
mfd: Avoid to use constraint name in 88pm860x regulator driver
mfd: Remove checking on max8925 regulator[0]
mfd: Remove unused parameter from 88pm860x API
mfd: Avoid to allocate 88pm860x static platform data
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c/twl.h | 54 | ||||
-rw-r--r-- | include/linux/input/pmic8xxx-keypad.h | 52 | ||||
-rw-r--r-- | include/linux/input/pmic8xxx-pwrkey.h | 31 | ||||
-rw-r--r-- | include/linux/mfd/88pm860x.h | 6 | ||||
-rw-r--r-- | include/linux/mfd/abx500.h | 8 | ||||
-rw-r--r-- | include/linux/mfd/asic3.h | 23 | ||||
-rw-r--r-- | include/linux/mfd/core.h | 23 | ||||
-rw-r--r-- | include/linux/mfd/pm8xxx/core.h | 81 | ||||
-rw-r--r-- | include/linux/mfd/pm8xxx/irq.h | 59 | ||||
-rw-r--r-- | include/linux/mfd/pm8xxx/pm8921.h | 31 | ||||
-rw-r--r-- | include/linux/mfd/twl4030-codec.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/wm831x/core.h | 26 | ||||
-rw-r--r-- | include/linux/mfd/wm831x/pdata.h | 4 |
13 files changed, 348 insertions, 52 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 0c0d1ae7998..ba4f88624fc 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 |
@@ -150,7 +151,12 @@ | |||
150 | #define MMC_PU (0x1 << 3) | 151 | #define MMC_PU (0x1 << 3) |
151 | #define MMC_PD (0x1 << 2) | 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 | #define TWL4030_CLASS_ID 0x4030 | 161 | #define TWL4030_CLASS_ID 0x4030 |
156 | #define TWL6030_CLASS_ID 0x6030 | 162 | #define TWL6030_CLASS_ID 0x6030 |
@@ -165,6 +171,8 @@ static inline int twl_class_is_ ##class(void) \ | |||
165 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | 171 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) |
166 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 172 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
167 | 173 | ||
174 | #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ | ||
175 | |||
168 | /* | 176 | /* |
169 | * Read and write single 8-bit registers | 177 | * Read and write single 8-bit registers |
170 | */ | 178 | */ |
@@ -180,6 +188,9 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
180 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 188 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
181 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 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 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | 194 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); |
184 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | 195 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); |
185 | 196 | ||
@@ -279,7 +290,12 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
279 | *(Use TWL_4030_MODULE_INTBR) | 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 | #define REG_GPPUPDCTR1 0x0F | 297 | #define REG_GPPUPDCTR1 0x0F |
298 | #define REG_UNLOCK_TEST_REG 0x12 | ||
283 | 299 | ||
284 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ | 300 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ |
285 | 301 | ||
@@ -288,6 +304,8 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
288 | #define SR_I2C_SCL_CTRL_PU BIT(4) | 304 | #define SR_I2C_SCL_CTRL_PU BIT(4) |
289 | #define SR_I2C_SDA_CTRL_PU BIT(6) | 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,7 +519,7 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
501 | #define RES_32KCLKOUT 26 | 519 | #define RES_32KCLKOUT 26 |
502 | #define RES_RESET 27 | 520 | #define RES_RESET 27 |
503 | /* Power Reference */ | 521 | /* Power Reference */ |
504 | #define RES_Main_Ref 28 | 522 | #define RES_MAIN_REF 28 |
505 | 523 | ||
506 | #define TOTAL_RESOURCES 28 | 524 | #define TOTAL_RESOURCES 28 |
507 | /* | 525 | /* |
@@ -593,6 +611,7 @@ enum twl4030_usb_mode { | |||
593 | 611 | ||
594 | struct twl4030_usb_data { | 612 | struct twl4030_usb_data { |
595 | enum twl4030_usb_mode usb_mode; | 613 | enum twl4030_usb_mode usb_mode; |
614 | unsigned long features; | ||
596 | 615 | ||
597 | int (*phy_init)(struct device *dev); | 616 | int (*phy_init)(struct device *dev); |
598 | int (*phy_exit)(struct device *dev); | 617 | int (*phy_exit)(struct device *dev); |
@@ -699,6 +718,20 @@ struct twl4030_platform_data { | |||
699 | struct regulator_init_data *vcxio; | 718 | struct regulator_init_data *vcxio; |
700 | struct regulator_init_data *vusb; | 719 | struct regulator_init_data *vusb; |
701 | struct regulator_init_data *clk32kg; | 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; | ||
702 | }; | 735 | }; |
703 | 736 | ||
704 | /*----------------------------------------------------------------------*/ | 737 | /*----------------------------------------------------------------------*/ |
@@ -780,4 +813,21 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
780 | #define TWL6030_REG_VRTC 47 | 813 | #define TWL6030_REG_VRTC 47 |
781 | #define TWL6030_REG_CLK32KG 48 | 814 | #define TWL6030_REG_CLK32KG 48 |
782 | 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 | |||
832 | |||
783 | #endif /* End of __TWL4030_H */ | 833 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/input/pmic8xxx-keypad.h b/include/linux/input/pmic8xxx-keypad.h new file mode 100644 index 00000000000..5f1e2f9ad95 --- /dev/null +++ b/include/linux/input/pmic8xxx-keypad.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PMIC8XXX_KEYPAD_H__ | ||
14 | #define __PMIC8XXX_KEYPAD_H__ | ||
15 | |||
16 | #include <linux/input/matrix_keypad.h> | ||
17 | |||
18 | #define PM8XXX_KEYPAD_DEV_NAME "pm8xxx-keypad" | ||
19 | |||
20 | /** | ||
21 | * struct pm8xxx_keypad_platform_data - platform data for keypad | ||
22 | * @keymap_data - matrix keymap data | ||
23 | * @input_name - input device name | ||
24 | * @input_phys_device - input device name | ||
25 | * @num_cols - number of columns of keypad | ||
26 | * @num_rows - number of row of keypad | ||
27 | * @debounce_ms - debounce period in milliseconds | ||
28 | * @scan_delay_ms - scan delay in milliseconds | ||
29 | * @row_hold_ns - row hold period in nanoseconds | ||
30 | * @wakeup - configure keypad as wakeup | ||
31 | * @rep - enable or disable key repeat bit | ||
32 | */ | ||
33 | struct pm8xxx_keypad_platform_data { | ||
34 | const struct matrix_keymap_data *keymap_data; | ||
35 | |||
36 | const char *input_name; | ||
37 | const char *input_phys_device; | ||
38 | |||
39 | unsigned int num_cols; | ||
40 | unsigned int num_rows; | ||
41 | unsigned int rows_gpio_start; | ||
42 | unsigned int cols_gpio_start; | ||
43 | |||
44 | unsigned int debounce_ms; | ||
45 | unsigned int scan_delay_ms; | ||
46 | unsigned int row_hold_ns; | ||
47 | |||
48 | bool wakeup; | ||
49 | bool rep; | ||
50 | }; | ||
51 | |||
52 | #endif /*__PMIC8XXX_KEYPAD_H__ */ | ||
diff --git a/include/linux/input/pmic8xxx-pwrkey.h b/include/linux/input/pmic8xxx-pwrkey.h new file mode 100644 index 00000000000..6d2974e5710 --- /dev/null +++ b/include/linux/input/pmic8xxx-pwrkey.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PMIC8XXX_PWRKEY_H__ | ||
14 | #define __PMIC8XXX_PWRKEY_H__ | ||
15 | |||
16 | #define PM8XXX_PWRKEY_DEV_NAME "pm8xxx-pwrkey" | ||
17 | |||
18 | /** | ||
19 | * struct pm8xxx_pwrkey_platform_data - platform data for pwrkey driver | ||
20 | * @pull up: power on register control for pull up/down configuration | ||
21 | * @kpd_trigger_delay_us: time delay for power key state change interrupt | ||
22 | * trigger. | ||
23 | * @wakeup: configure power key as wakeup source | ||
24 | */ | ||
25 | struct pm8xxx_pwrkey_platform_data { | ||
26 | bool pull_up; | ||
27 | u32 kpd_trigger_delay_us; | ||
28 | u32 wakeup; | ||
29 | }; | ||
30 | |||
31 | #endif /* __PMIC8XXX_PWRKEY_H__ */ | ||
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index 8fba7972ff5..63b4fb8e3b6 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
@@ -330,6 +330,11 @@ struct pm860x_led_pdata { | |||
330 | unsigned long flags; | 330 | unsigned long flags; |
331 | }; | 331 | }; |
332 | 332 | ||
333 | struct pm860x_rtc_pdata { | ||
334 | int (*sync)(unsigned int ticks); | ||
335 | int vrtc; | ||
336 | }; | ||
337 | |||
333 | struct pm860x_touch_pdata { | 338 | struct pm860x_touch_pdata { |
334 | int gpadc_prebias; | 339 | int gpadc_prebias; |
335 | int slot_cycle; | 340 | int slot_cycle; |
@@ -349,6 +354,7 @@ struct pm860x_power_pdata { | |||
349 | struct pm860x_platform_data { | 354 | struct pm860x_platform_data { |
350 | struct pm860x_backlight_pdata *backlight; | 355 | struct pm860x_backlight_pdata *backlight; |
351 | struct pm860x_led_pdata *led; | 356 | struct pm860x_led_pdata *led; |
357 | struct pm860x_rtc_pdata *rtc; | ||
352 | struct pm860x_touch_pdata *touch; | 358 | struct pm860x_touch_pdata *touch; |
353 | struct pm860x_power_pdata *power; | 359 | struct pm860x_power_pdata *power; |
354 | struct regulator_init_data *regulator; | 360 | struct regulator_init_data *regulator; |
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 7d9b6ae1c20..896b5e47f16 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -34,6 +34,13 @@ | |||
34 | #define AB5500_2_0 0x21 | 34 | #define AB5500_2_0 0x21 |
35 | #define AB5500_2_1 0x22 | 35 | #define AB5500_2_1 0x22 |
36 | 36 | ||
37 | /* AB8500 CIDs*/ | ||
38 | #define AB8500_CUTEARLY 0x00 | ||
39 | #define AB8500_CUT1P0 0x10 | ||
40 | #define AB8500_CUT1P1 0x11 | ||
41 | #define AB8500_CUT2P0 0x20 | ||
42 | #define AB8500_CUT3P0 0x30 | ||
43 | |||
37 | /* | 44 | /* |
38 | * AB3100, EVENTA1, A2 and A3 event register flags | 45 | * AB3100, EVENTA1, A2 and A3 event register flags |
39 | * these are catenated into a single 32-bit flag in the code | 46 | * these are catenated into a single 32-bit flag in the code |
@@ -186,6 +193,7 @@ struct abx500_init_settings { | |||
186 | struct ab3550_platform_data { | 193 | struct ab3550_platform_data { |
187 | struct {unsigned int base; unsigned int count; } irq; | 194 | struct {unsigned int base; unsigned int count; } irq; |
188 | void *dev_data[AB3550_NUM_DEVICES]; | 195 | void *dev_data[AB3550_NUM_DEVICES]; |
196 | size_t dev_data_sz[AB3550_NUM_DEVICES]; | ||
189 | struct abx500_init_settings *init_settings; | 197 | struct abx500_init_settings *init_settings; |
190 | unsigned int init_settings_sz; | 198 | unsigned int init_settings_sz; |
191 | }; | 199 | }; |
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index de3c4ad19af..ed793b77a1c 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -16,6 +16,13 @@ | |||
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | struct led_classdev; | ||
20 | struct asic3_led { | ||
21 | const char *name; | ||
22 | const char *default_trigger; | ||
23 | struct led_classdev *cdev; | ||
24 | }; | ||
25 | |||
19 | struct asic3_platform_data { | 26 | struct asic3_platform_data { |
20 | u16 *gpio_config; | 27 | u16 *gpio_config; |
21 | unsigned int gpio_config_num; | 28 | unsigned int gpio_config_num; |
@@ -23,6 +30,8 @@ struct asic3_platform_data { | |||
23 | unsigned int irq_base; | 30 | unsigned int irq_base; |
24 | 31 | ||
25 | unsigned int gpio_base; | 32 | unsigned int gpio_base; |
33 | |||
34 | struct asic3_led *leds; | ||
26 | }; | 35 | }; |
27 | 36 | ||
28 | #define ASIC3_NUM_GPIO_BANKS 4 | 37 | #define ASIC3_NUM_GPIO_BANKS 4 |
@@ -111,9 +120,9 @@ struct asic3_platform_data { | |||
111 | #define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) | 120 | #define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) |
112 | #define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) | 121 | #define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) |
113 | #define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) | 122 | #define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) |
114 | #define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 1, 0) | 123 | #define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 0, 0) |
115 | #define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 1, 0) | 124 | #define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 0, 0) |
116 | #define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 1, 0) | 125 | #define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 0, 0) |
117 | #define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) | 126 | #define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) |
118 | #define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) | 127 | #define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) |
119 | #define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) | 128 | #define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) |
@@ -152,6 +161,7 @@ struct asic3_platform_data { | |||
152 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ | 161 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ |
153 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ | 162 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ |
154 | 163 | ||
164 | #define ASIC3_NUM_LEDS 3 | ||
155 | #define ASIC3_LED_0_Base 0x0700 | 165 | #define ASIC3_LED_0_Base 0x0700 |
156 | #define ASIC3_LED_1_Base 0x0800 | 166 | #define ASIC3_LED_1_Base 0x0800 |
157 | #define ASIC3_LED_2_Base 0x0900 | 167 | #define ASIC3_LED_2_Base 0x0900 |
@@ -287,10 +297,17 @@ struct asic3_platform_data { | |||
287 | * | 297 | * |
288 | *****************************************************************************/ | 298 | *****************************************************************************/ |
289 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ | 299 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ |
300 | #define ASIC3_SD_CONFIG_SIZE 0x0200 /* Assumes 32 bit addressing */ | ||
290 | #define ASIC3_SD_CTRL_BASE 0x1000 | 301 | #define ASIC3_SD_CTRL_BASE 0x1000 |
291 | #define ASIC3_SDIO_CTRL_BASE 0x1200 | 302 | #define ASIC3_SDIO_CTRL_BASE 0x1200 |
292 | 303 | ||
293 | #define ASIC3_MAP_SIZE_32BIT 0x2000 | 304 | #define ASIC3_MAP_SIZE_32BIT 0x2000 |
294 | #define ASIC3_MAP_SIZE_16BIT 0x1000 | 305 | #define ASIC3_MAP_SIZE_16BIT 0x1000 |
295 | 306 | ||
307 | /* Functions needed by leds-asic3 */ | ||
308 | |||
309 | struct asic3; | ||
310 | extern void asic3_write_register(struct asic3 *asic, unsigned int reg, u32 val); | ||
311 | extern u32 asic3_read_register(struct asic3 *asic, unsigned int reg); | ||
312 | |||
296 | #endif /* __ASIC3_H__ */ | 313 | #endif /* __ASIC3_H__ */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index aef23309a74..4e76163dd86 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -33,8 +33,9 @@ struct mfd_cell { | |||
33 | int (*suspend)(struct platform_device *dev); | 33 | int (*suspend)(struct platform_device *dev); |
34 | int (*resume)(struct platform_device *dev); | 34 | int (*resume)(struct platform_device *dev); |
35 | 35 | ||
36 | /* mfd_data can be used to pass data to client drivers */ | 36 | /* platform data passed to the sub devices drivers */ |
37 | void *mfd_data; | 37 | void *platform_data; |
38 | size_t pdata_size; | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * These resources can be specified relative to the parent device. | 41 | * These resources can be specified relative to the parent device. |
@@ -89,24 +90,6 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) | |||
89 | return pdev->mfd_cell; | 90 | return pdev->mfd_cell; |
90 | } | 91 | } |
91 | 92 | ||
92 | /* | ||
93 | * Given a platform device that's been created by mfd_add_devices(), fetch | ||
94 | * the .mfd_data entry from the mfd_cell that created it. | ||
95 | * Otherwise just return the platform_data pointer. | ||
96 | * This maintains compatibility with platform drivers whose devices aren't | ||
97 | * created by the mfd layer, and expect platform_data to contain what would've | ||
98 | * otherwise been in mfd_data. | ||
99 | */ | ||
100 | static inline void *mfd_get_data(struct platform_device *pdev) | ||
101 | { | ||
102 | const struct mfd_cell *cell = mfd_get_cell(pdev); | ||
103 | |||
104 | if (cell) | ||
105 | return cell->mfd_data; | ||
106 | else | ||
107 | return pdev->dev.platform_data; | ||
108 | } | ||
109 | |||
110 | extern int mfd_add_devices(struct device *parent, int id, | 93 | extern int mfd_add_devices(struct device *parent, int id, |
111 | struct mfd_cell *cells, int n_devs, | 94 | struct mfd_cell *cells, int n_devs, |
112 | struct resource *mem_base, | 95 | struct resource *mem_base, |
diff --git a/include/linux/mfd/pm8xxx/core.h b/include/linux/mfd/pm8xxx/core.h new file mode 100644 index 00000000000..bd2f4f64e93 --- /dev/null +++ b/include/linux/mfd/pm8xxx/core.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC 8xxx driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8XXX_CORE_H | ||
19 | #define __MFD_PM8XXX_CORE_H | ||
20 | |||
21 | #include <linux/mfd/core.h> | ||
22 | |||
23 | struct pm8xxx_drvdata { | ||
24 | int (*pmic_readb) (const struct device *dev, u16 addr, u8 *val); | ||
25 | int (*pmic_writeb) (const struct device *dev, u16 addr, u8 val); | ||
26 | int (*pmic_read_buf) (const struct device *dev, u16 addr, u8 *buf, | ||
27 | int n); | ||
28 | int (*pmic_write_buf) (const struct device *dev, u16 addr, u8 *buf, | ||
29 | int n); | ||
30 | int (*pmic_read_irq_stat) (const struct device *dev, int irq); | ||
31 | void *pm_chip_data; | ||
32 | }; | ||
33 | |||
34 | static inline int pm8xxx_readb(const struct device *dev, u16 addr, u8 *val) | ||
35 | { | ||
36 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
37 | |||
38 | if (!dd) | ||
39 | return -EINVAL; | ||
40 | return dd->pmic_readb(dev, addr, val); | ||
41 | } | ||
42 | |||
43 | static inline int pm8xxx_writeb(const struct device *dev, u16 addr, u8 val) | ||
44 | { | ||
45 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
46 | |||
47 | if (!dd) | ||
48 | return -EINVAL; | ||
49 | return dd->pmic_writeb(dev, addr, val); | ||
50 | } | ||
51 | |||
52 | static inline int pm8xxx_read_buf(const struct device *dev, u16 addr, u8 *buf, | ||
53 | int n) | ||
54 | { | ||
55 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
56 | |||
57 | if (!dd) | ||
58 | return -EINVAL; | ||
59 | return dd->pmic_read_buf(dev, addr, buf, n); | ||
60 | } | ||
61 | |||
62 | static inline int pm8xxx_write_buf(const struct device *dev, u16 addr, u8 *buf, | ||
63 | int n) | ||
64 | { | ||
65 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
66 | |||
67 | if (!dd) | ||
68 | return -EINVAL; | ||
69 | return dd->pmic_write_buf(dev, addr, buf, n); | ||
70 | } | ||
71 | |||
72 | static inline int pm8xxx_read_irq_stat(const struct device *dev, int irq) | ||
73 | { | ||
74 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
75 | |||
76 | if (!dd) | ||
77 | return -EINVAL; | ||
78 | return dd->pmic_read_irq_stat(dev, irq); | ||
79 | } | ||
80 | |||
81 | #endif | ||
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h new file mode 100644 index 00000000000..4b21769f448 --- /dev/null +++ b/include/linux/mfd/pm8xxx/irq.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC irq 8xxx driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8XXX_IRQ_H | ||
19 | #define __MFD_PM8XXX_IRQ_H | ||
20 | |||
21 | #include <linux/errno.h> | ||
22 | #include <linux/err.h> | ||
23 | |||
24 | struct pm8xxx_irq_core_data { | ||
25 | u32 rev; | ||
26 | int nirqs; | ||
27 | }; | ||
28 | |||
29 | struct pm8xxx_irq_platform_data { | ||
30 | int irq_base; | ||
31 | struct pm8xxx_irq_core_data irq_cdata; | ||
32 | int devirq; | ||
33 | int irq_trigger_flag; | ||
34 | }; | ||
35 | |||
36 | struct pm_irq_chip; | ||
37 | |||
38 | #ifdef CONFIG_MFD_PM8XXX_IRQ | ||
39 | int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); | ||
40 | struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev, | ||
41 | const struct pm8xxx_irq_platform_data *pdata); | ||
42 | int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip); | ||
43 | #else | ||
44 | static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) | ||
45 | { | ||
46 | return -ENXIO; | ||
47 | } | ||
48 | static inline struct pm_irq_chip * __devinit pm8xxx_irq_init( | ||
49 | const struct device *dev, | ||
50 | const struct pm8xxx_irq_platform_data *pdata) | ||
51 | { | ||
52 | return ERR_PTR(-ENXIO); | ||
53 | } | ||
54 | static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip) | ||
55 | { | ||
56 | return -ENXIO; | ||
57 | } | ||
58 | #endif /* CONFIG_MFD_PM8XXX_IRQ */ | ||
59 | #endif /* __MFD_PM8XXX_IRQ_H */ | ||
diff --git a/include/linux/mfd/pm8xxx/pm8921.h b/include/linux/mfd/pm8xxx/pm8921.h new file mode 100644 index 00000000000..d5517fd32d1 --- /dev/null +++ b/include/linux/mfd/pm8xxx/pm8921.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC 8921 driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8921_H | ||
19 | #define __MFD_PM8921_H | ||
20 | |||
21 | #include <linux/device.h> | ||
22 | #include <linux/mfd/pm8xxx/irq.h> | ||
23 | |||
24 | #define PM8921_NR_IRQS 256 | ||
25 | |||
26 | struct pm8921_platform_data { | ||
27 | int irq_base; | ||
28 | struct pm8xxx_irq_platform_data *irq_pdata; | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h index 2ec317c68e5..5cc16bbd1da 100644 --- a/include/linux/mfd/twl4030-codec.h +++ b/include/linux/mfd/twl4030-codec.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MFD driver for twl4030 codec submodule | 2 | * MFD driver for twl4030 codec submodule |
3 | * | 3 | * |
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | 4 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
5 | * | 5 | * |
6 | * Copyright: (C) 2009 Nokia Corporation | 6 | * Copyright: (C) 2009 Nokia Corporation |
7 | * | 7 | * |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 903280d2186..0d515ee1c24 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -301,30 +301,4 @@ int wm831x_device_suspend(struct wm831x *wm831x); | |||
301 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 301 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
302 | void wm831x_irq_exit(struct wm831x *wm831x); | 302 | void wm831x_irq_exit(struct wm831x *wm831x); |
303 | 303 | ||
304 | static inline int __must_check wm831x_request_irq(struct wm831x *wm831x, | ||
305 | unsigned int irq, | ||
306 | irq_handler_t handler, | ||
307 | unsigned long flags, | ||
308 | const char *name, | ||
309 | void *dev) | ||
310 | { | ||
311 | return request_threaded_irq(irq, NULL, handler, flags, name, dev); | ||
312 | } | ||
313 | |||
314 | static inline void wm831x_free_irq(struct wm831x *wm831x, | ||
315 | unsigned int irq, void *dev) | ||
316 | { | ||
317 | free_irq(irq, dev); | ||
318 | } | ||
319 | |||
320 | static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq) | ||
321 | { | ||
322 | disable_irq(irq); | ||
323 | } | ||
324 | |||
325 | static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq) | ||
326 | { | ||
327 | enable_irq(irq); | ||
328 | } | ||
329 | |||
330 | #endif | 304 | #endif |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 632d1567a1b..ff42d700293 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -105,6 +105,9 @@ struct wm831x_watchdog_pdata { | |||
105 | #define WM831X_MAX_LDO 11 | 105 | #define WM831X_MAX_LDO 11 |
106 | #define WM831X_MAX_ISINK 2 | 106 | #define WM831X_MAX_ISINK 2 |
107 | 107 | ||
108 | #define WM831X_GPIO_CONFIGURE 0x10000 | ||
109 | #define WM831X_GPIO_NUM 16 | ||
110 | |||
108 | struct wm831x_pdata { | 111 | struct wm831x_pdata { |
109 | /** Used to distinguish multiple WM831x chips */ | 112 | /** Used to distinguish multiple WM831x chips */ |
110 | int wm831x_num; | 113 | int wm831x_num; |
@@ -119,6 +122,7 @@ struct wm831x_pdata { | |||
119 | 122 | ||
120 | int irq_base; | 123 | int irq_base; |
121 | int gpio_base; | 124 | int gpio_base; |
125 | int gpio_defaults[WM831X_GPIO_NUM]; | ||
122 | struct wm831x_backlight_pdata *backlight; | 126 | struct wm831x_backlight_pdata *backlight; |
123 | struct wm831x_backup_pdata *backup; | 127 | struct wm831x_backup_pdata *backup; |
124 | struct wm831x_battery_pdata *battery; | 128 | struct wm831x_battery_pdata *battery; |