diff options
-rw-r--r-- | arch/arm/mach-omap2/board-4430sdp.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 37 | ||||
-rw-r--r-- | arch/arm/mach-omap2/twl-common.h | 10 | ||||
-rw-r--r-- | drivers/input/misc/Kconfig | 3 | ||||
-rw-r--r-- | drivers/input/misc/twl6040-vibra.c | 4 | ||||
-rw-r--r-- | drivers/mfd/Kconfig | 11 | ||||
-rw-r--r-- | drivers/mfd/asic3.c | 4 | ||||
-rw-r--r-- | drivers/mfd/omap-usb-host.c | 44 | ||||
-rw-r--r-- | drivers/mfd/rc5t583.c | 39 | ||||
-rw-r--r-- | drivers/mfd/twl6040-core.c | 114 | ||||
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 39 | ||||
-rw-r--r-- | include/linux/i2c/twl.h | 12 | ||||
-rw-r--r-- | include/linux/mfd/db5500-prcmu.h | 88 | ||||
-rw-r--r-- | include/linux/mfd/rc5t583.h | 47 | ||||
-rw-r--r-- | include/linux/mfd/twl6040.h | 27 | ||||
-rw-r--r-- | sound/soc/codecs/Kconfig | 3 | ||||
-rw-r--r-- | sound/soc/codecs/twl6040.c | 3 | ||||
-rw-r--r-- | sound/soc/omap/Kconfig | 2 |
20 files changed, 276 insertions, 238 deletions
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index a39fc4bbd2b8..130ab00c09a2 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/usb/otg.h> | 20 | #include <linux/usb/otg.h> |
21 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
22 | #include <linux/i2c/twl.h> | 22 | #include <linux/i2c/twl.h> |
23 | #include <linux/mfd/twl6040.h> | ||
23 | #include <linux/gpio_keys.h> | 24 | #include <linux/gpio_keys.h> |
24 | #include <linux/regulator/machine.h> | 25 | #include <linux/regulator/machine.h> |
25 | #include <linux/regulator/fixed.h> | 26 | #include <linux/regulator/fixed.h> |
@@ -560,7 +561,7 @@ static struct regulator_init_data sdp4430_vusim = { | |||
560 | }, | 561 | }, |
561 | }; | 562 | }; |
562 | 563 | ||
563 | static struct twl4030_codec_data twl6040_codec = { | 564 | static struct twl6040_codec_data twl6040_codec = { |
564 | /* single-step ramp for headset and handsfree */ | 565 | /* single-step ramp for headset and handsfree */ |
565 | .hs_left_step = 0x0f, | 566 | .hs_left_step = 0x0f, |
566 | .hs_right_step = 0x0f, | 567 | .hs_right_step = 0x0f, |
@@ -568,7 +569,7 @@ static struct twl4030_codec_data twl6040_codec = { | |||
568 | .hf_right_step = 0x1d, | 569 | .hf_right_step = 0x1d, |
569 | }; | 570 | }; |
570 | 571 | ||
571 | static struct twl4030_vibra_data twl6040_vibra = { | 572 | static struct twl6040_vibra_data twl6040_vibra = { |
572 | .vibldrv_res = 8, | 573 | .vibldrv_res = 8, |
573 | .vibrdrv_res = 3, | 574 | .vibrdrv_res = 3, |
574 | .viblmotor_res = 10, | 575 | .viblmotor_res = 10, |
@@ -577,16 +578,14 @@ static struct twl4030_vibra_data twl6040_vibra = { | |||
577 | .vddvibr_uV = 0, /* fixed volt supply - VBAT */ | 578 | .vddvibr_uV = 0, /* fixed volt supply - VBAT */ |
578 | }; | 579 | }; |
579 | 580 | ||
580 | static struct twl4030_audio_data twl6040_audio = { | 581 | static struct twl6040_platform_data twl6040_data = { |
581 | .codec = &twl6040_codec, | 582 | .codec = &twl6040_codec, |
582 | .vibra = &twl6040_vibra, | 583 | .vibra = &twl6040_vibra, |
583 | .audpwron_gpio = 127, | 584 | .audpwron_gpio = 127, |
584 | .naudint_irq = OMAP44XX_IRQ_SYS_2N, | ||
585 | .irq_base = TWL6040_CODEC_IRQ_BASE, | 585 | .irq_base = TWL6040_CODEC_IRQ_BASE, |
586 | }; | 586 | }; |
587 | 587 | ||
588 | static struct twl4030_platform_data sdp4430_twldata = { | 588 | static struct twl4030_platform_data sdp4430_twldata = { |
589 | .audio = &twl6040_audio, | ||
590 | /* Regulators */ | 589 | /* Regulators */ |
591 | .vusim = &sdp4430_vusim, | 590 | .vusim = &sdp4430_vusim, |
592 | .vaux1 = &sdp4430_vaux1, | 591 | .vaux1 = &sdp4430_vaux1, |
@@ -617,7 +616,8 @@ static int __init omap4_i2c_init(void) | |||
617 | TWL_COMMON_REGULATOR_VCXIO | | 616 | TWL_COMMON_REGULATOR_VCXIO | |
618 | TWL_COMMON_REGULATOR_VUSB | | 617 | TWL_COMMON_REGULATOR_VUSB | |
619 | TWL_COMMON_REGULATOR_CLK32KG); | 618 | TWL_COMMON_REGULATOR_CLK32KG); |
620 | omap4_pmic_init("twl6030", &sdp4430_twldata); | 619 | omap4_pmic_init("twl6030", &sdp4430_twldata, |
620 | &twl6040_data, OMAP44XX_IRQ_SYS_2N); | ||
621 | omap_register_i2c_bus(2, 400, NULL, 0); | 621 | omap_register_i2c_bus(2, 400, NULL, 0); |
622 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, | 622 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
623 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); | 623 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 74e1687b5170..098d183a0086 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -137,7 +137,7 @@ static struct twl4030_platform_data sdp4430_twldata = { | |||
137 | 137 | ||
138 | static void __init omap4_i2c_init(void) | 138 | static void __init omap4_i2c_init(void) |
139 | { | 139 | { |
140 | omap4_pmic_init("twl6030", &sdp4430_twldata); | 140 | omap4_pmic_init("twl6030", &sdp4430_twldata, NULL, 0); |
141 | } | 141 | } |
142 | 142 | ||
143 | static void __init omap4_init(void) | 143 | static void __init omap4_init(void) |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index d8c0e89f0126..1b782ba53433 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/usb/otg.h> | 26 | #include <linux/usb/otg.h> |
27 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
28 | #include <linux/mfd/twl6040.h> | ||
28 | #include <linux/regulator/machine.h> | 29 | #include <linux/regulator/machine.h> |
29 | #include <linux/regulator/fixed.h> | 30 | #include <linux/regulator/fixed.h> |
30 | #include <linux/wl12xx.h> | 31 | #include <linux/wl12xx.h> |
@@ -284,7 +285,7 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | |||
284 | return 0; | 285 | return 0; |
285 | } | 286 | } |
286 | 287 | ||
287 | static struct twl4030_codec_data twl6040_codec = { | 288 | static struct twl6040_codec_data twl6040_codec = { |
288 | /* single-step ramp for headset and handsfree */ | 289 | /* single-step ramp for headset and handsfree */ |
289 | .hs_left_step = 0x0f, | 290 | .hs_left_step = 0x0f, |
290 | .hs_right_step = 0x0f, | 291 | .hs_right_step = 0x0f, |
@@ -292,17 +293,14 @@ static struct twl4030_codec_data twl6040_codec = { | |||
292 | .hf_right_step = 0x1d, | 293 | .hf_right_step = 0x1d, |
293 | }; | 294 | }; |
294 | 295 | ||
295 | static struct twl4030_audio_data twl6040_audio = { | 296 | static struct twl6040_platform_data twl6040_data = { |
296 | .codec = &twl6040_codec, | 297 | .codec = &twl6040_codec, |
297 | .audpwron_gpio = 127, | 298 | .audpwron_gpio = 127, |
298 | .naudint_irq = OMAP44XX_IRQ_SYS_2N, | ||
299 | .irq_base = TWL6040_CODEC_IRQ_BASE, | 299 | .irq_base = TWL6040_CODEC_IRQ_BASE, |
300 | }; | 300 | }; |
301 | 301 | ||
302 | /* Panda board uses the common PMIC configuration */ | 302 | /* Panda board uses the common PMIC configuration */ |
303 | static struct twl4030_platform_data omap4_panda_twldata = { | 303 | static struct twl4030_platform_data omap4_panda_twldata; |
304 | .audio = &twl6040_audio, | ||
305 | }; | ||
306 | 304 | ||
307 | /* | 305 | /* |
308 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM | 306 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM |
@@ -326,7 +324,8 @@ static int __init omap4_panda_i2c_init(void) | |||
326 | TWL_COMMON_REGULATOR_VCXIO | | 324 | TWL_COMMON_REGULATOR_VCXIO | |
327 | TWL_COMMON_REGULATOR_VUSB | | 325 | TWL_COMMON_REGULATOR_VUSB | |
328 | TWL_COMMON_REGULATOR_CLK32KG); | 326 | TWL_COMMON_REGULATOR_CLK32KG); |
329 | omap4_pmic_init("twl6030", &omap4_panda_twldata); | 327 | omap4_pmic_init("twl6030", &omap4_panda_twldata, |
328 | &twl6040_data, OMAP44XX_IRQ_SYS_2N); | ||
330 | omap_register_i2c_bus(2, 400, NULL, 0); | 329 | omap_register_i2c_bus(2, 400, NULL, 0); |
331 | /* | 330 | /* |
332 | * Bus 3 is attached to the DVI port where devices like the pico DLP | 331 | * Bus 3 is attached to the DVI port where devices like the pico DLP |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 4b57757bf9d1..7a7b89304c48 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -37,6 +37,16 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = { | |||
37 | .flags = I2C_CLIENT_WAKE, | 37 | .flags = I2C_CLIENT_WAKE, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static struct i2c_board_info __initdata omap4_i2c1_board_info[] = { | ||
41 | { | ||
42 | .addr = 0x48, | ||
43 | .flags = I2C_CLIENT_WAKE, | ||
44 | }, | ||
45 | { | ||
46 | I2C_BOARD_INFO("twl6040", 0x4b), | ||
47 | }, | ||
48 | }; | ||
49 | |||
40 | void __init omap_pmic_init(int bus, u32 clkrate, | 50 | void __init omap_pmic_init(int bus, u32 clkrate, |
41 | const char *pmic_type, int pmic_irq, | 51 | const char *pmic_type, int pmic_irq, |
42 | struct twl4030_platform_data *pmic_data) | 52 | struct twl4030_platform_data *pmic_data) |
@@ -49,14 +59,31 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
49 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); | 59 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); |
50 | } | 60 | } |
51 | 61 | ||
62 | void __init omap4_pmic_init(const char *pmic_type, | ||
63 | struct twl4030_platform_data *pmic_data, | ||
64 | struct twl6040_platform_data *twl6040_data, int twl6040_irq) | ||
65 | { | ||
66 | /* PMIC part*/ | ||
67 | strncpy(omap4_i2c1_board_info[0].type, pmic_type, | ||
68 | sizeof(omap4_i2c1_board_info[0].type)); | ||
69 | omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N; | ||
70 | omap4_i2c1_board_info[0].platform_data = pmic_data; | ||
71 | |||
72 | /* TWL6040 audio IC part */ | ||
73 | omap4_i2c1_board_info[1].irq = twl6040_irq; | ||
74 | omap4_i2c1_board_info[1].platform_data = twl6040_data; | ||
75 | |||
76 | omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2); | ||
77 | |||
78 | } | ||
79 | |||
52 | void __init omap_pmic_late_init(void) | 80 | void __init omap_pmic_late_init(void) |
53 | { | 81 | { |
54 | /* Init the OMAP TWL parameters (if PMIC has been registerd) */ | 82 | /* Init the OMAP TWL parameters (if PMIC has been registerd) */ |
55 | if (!pmic_i2c_board_info.irq) | 83 | if (pmic_i2c_board_info.irq) |
56 | return; | 84 | omap3_twl_init(); |
57 | 85 | if (omap4_i2c1_board_info[0].irq) | |
58 | omap3_twl_init(); | 86 | omap4_twl_init(); |
59 | omap4_twl_init(); | ||
60 | } | 87 | } |
61 | 88 | ||
62 | #if defined(CONFIG_ARCH_OMAP3) | 89 | #if defined(CONFIG_ARCH_OMAP3) |
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h index 275dde8cb27a..09627483a57f 100644 --- a/arch/arm/mach-omap2/twl-common.h +++ b/arch/arm/mach-omap2/twl-common.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | 30 | ||
31 | struct twl4030_platform_data; | 31 | struct twl4030_platform_data; |
32 | struct twl6040_platform_data; | ||
32 | 33 | ||
33 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, | 34 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, |
34 | struct twl4030_platform_data *pmic_data); | 35 | struct twl4030_platform_data *pmic_data); |
@@ -46,12 +47,9 @@ static inline void omap3_pmic_init(const char *pmic_type, | |||
46 | omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); | 47 | omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); |
47 | } | 48 | } |
48 | 49 | ||
49 | static inline void omap4_pmic_init(const char *pmic_type, | 50 | void omap4_pmic_init(const char *pmic_type, |
50 | struct twl4030_platform_data *pmic_data) | 51 | struct twl4030_platform_data *pmic_data, |
51 | { | 52 | struct twl6040_platform_data *audio_data, int twl6040_irq); |
52 | /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */ | ||
53 | omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data); | ||
54 | } | ||
55 | 53 | ||
56 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | 54 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, |
57 | u32 pdata_flags, u32 regulators_flags); | 55 | u32 pdata_flags, u32 regulators_flags); |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 2d787796bf50..7faf4a7fcaa9 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -380,8 +380,7 @@ config INPUT_TWL4030_VIBRA | |||
380 | 380 | ||
381 | config INPUT_TWL6040_VIBRA | 381 | config INPUT_TWL6040_VIBRA |
382 | tristate "Support for TWL6040 Vibrator" | 382 | tristate "Support for TWL6040 Vibrator" |
383 | depends on TWL4030_CORE | 383 | depends on TWL6040_CORE |
384 | select TWL6040_CORE | ||
385 | select INPUT_FF_MEMLESS | 384 | select INPUT_FF_MEMLESS |
386 | help | 385 | help |
387 | This option enables support for TWL6040 Vibrator Driver. | 386 | This option enables support for TWL6040 Vibrator Driver. |
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 45874fed523a..14e94f56cb7d 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/i2c/twl.h> | 31 | #include <linux/input.h> |
32 | #include <linux/mfd/twl6040.h> | 32 | #include <linux/mfd/twl6040.h> |
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
@@ -257,7 +257,7 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); | |||
257 | 257 | ||
258 | static int __devinit twl6040_vibra_probe(struct platform_device *pdev) | 258 | static int __devinit twl6040_vibra_probe(struct platform_device *pdev) |
259 | { | 259 | { |
260 | struct twl4030_vibra_data *pdata = pdev->dev.platform_data; | 260 | struct twl6040_vibra_data *pdata = pdev->dev.platform_data; |
261 | struct vibra_info *info; | 261 | struct vibra_info *info; |
262 | int ret; | 262 | int ret; |
263 | 263 | ||
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 29f463cc09cb..11e44386fa9b 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -268,10 +268,17 @@ config TWL6030_PWM | |||
268 | This is used to control charging LED brightness. | 268 | This is used to control charging LED brightness. |
269 | 269 | ||
270 | config TWL6040_CORE | 270 | config TWL6040_CORE |
271 | bool | 271 | bool "Support for TWL6040 audio codec" |
272 | depends on TWL4030_CORE && GENERIC_HARDIRQS | 272 | depends on I2C=y && GENERIC_HARDIRQS |
273 | select MFD_CORE | 273 | select MFD_CORE |
274 | select REGMAP_I2C | ||
274 | default n | 275 | default n |
276 | help | ||
277 | Say yes here if you want support for Texas Instruments TWL6040 audio | ||
278 | codec. | ||
279 | This driver provides common support for accessing the device, | ||
280 | additional drivers must be enabled in order to use the | ||
281 | functionality of the device (audio, vibra). | ||
275 | 282 | ||
276 | config MFD_STMPE | 283 | config MFD_STMPE |
277 | bool "Support STMicroelectronics STMPE" | 284 | bool "Support STMicroelectronics STMPE" |
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 1895cf9fab8c..1582c3d95257 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -527,7 +527,9 @@ static void asic3_gpio_set(struct gpio_chip *chip, | |||
527 | 527 | ||
528 | static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 528 | static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
529 | { | 529 | { |
530 | return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO; | 530 | struct asic3 *asic = container_of(chip, struct asic3, gpio); |
531 | |||
532 | return (offset < ASIC3_NUM_GPIOS) ? asic->irq_base + offset : -ENXIO; | ||
531 | } | 533 | } |
532 | 534 | ||
533 | static __init int asic3_gpio_probe(struct platform_device *pdev, | 535 | static __init int asic3_gpio_probe(struct platform_device *pdev, |
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 95a2e546a489..c8aae6640e64 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/gpio.h> | ||
29 | #include <plat/usb.h> | 28 | #include <plat/usb.h> |
30 | #include <linux/pm_runtime.h> | 29 | #include <linux/pm_runtime.h> |
31 | 30 | ||
@@ -502,19 +501,6 @@ static void omap_usbhs_init(struct device *dev) | |||
502 | pm_runtime_get_sync(dev); | 501 | pm_runtime_get_sync(dev); |
503 | spin_lock_irqsave(&omap->lock, flags); | 502 | spin_lock_irqsave(&omap->lock, flags); |
504 | 503 | ||
505 | if (pdata->ehci_data->phy_reset) { | ||
506 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
507 | gpio_request_one(pdata->ehci_data->reset_gpio_port[0], | ||
508 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
509 | |||
510 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
511 | gpio_request_one(pdata->ehci_data->reset_gpio_port[1], | ||
512 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
513 | |||
514 | /* Hold the PHY in RESET for enough time till DIR is high */ | ||
515 | udelay(10); | ||
516 | } | ||
517 | |||
518 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); | 504 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); |
519 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); | 505 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); |
520 | 506 | ||
@@ -593,39 +579,10 @@ static void omap_usbhs_init(struct device *dev) | |||
593 | usbhs_omap_tll_init(dev, OMAP_TLL_CHANNEL_COUNT); | 579 | usbhs_omap_tll_init(dev, OMAP_TLL_CHANNEL_COUNT); |
594 | } | 580 | } |
595 | 581 | ||
596 | if (pdata->ehci_data->phy_reset) { | ||
597 | /* Hold the PHY in RESET for enough time till | ||
598 | * PHY is settled and ready | ||
599 | */ | ||
600 | udelay(10); | ||
601 | |||
602 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
603 | gpio_set_value | ||
604 | (pdata->ehci_data->reset_gpio_port[0], 1); | ||
605 | |||
606 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
607 | gpio_set_value | ||
608 | (pdata->ehci_data->reset_gpio_port[1], 1); | ||
609 | } | ||
610 | |||
611 | spin_unlock_irqrestore(&omap->lock, flags); | 582 | spin_unlock_irqrestore(&omap->lock, flags); |
612 | pm_runtime_put_sync(dev); | 583 | pm_runtime_put_sync(dev); |
613 | } | 584 | } |
614 | 585 | ||
615 | static void omap_usbhs_deinit(struct device *dev) | ||
616 | { | ||
617 | struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); | ||
618 | struct usbhs_omap_platform_data *pdata = &omap->platdata; | ||
619 | |||
620 | if (pdata->ehci_data->phy_reset) { | ||
621 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
622 | gpio_free(pdata->ehci_data->reset_gpio_port[0]); | ||
623 | |||
624 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
625 | gpio_free(pdata->ehci_data->reset_gpio_port[1]); | ||
626 | } | ||
627 | } | ||
628 | |||
629 | 586 | ||
630 | /** | 587 | /** |
631 | * usbhs_omap_probe - initialize TI-based HCDs | 588 | * usbhs_omap_probe - initialize TI-based HCDs |
@@ -860,7 +817,6 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev) | |||
860 | { | 817 | { |
861 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); | 818 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); |
862 | 819 | ||
863 | omap_usbhs_deinit(&pdev->dev); | ||
864 | iounmap(omap->tll_base); | 820 | iounmap(omap->tll_base); |
865 | iounmap(omap->uhh_base); | 821 | iounmap(omap->uhh_base); |
866 | clk_put(omap->init_60m_fclk); | 822 | clk_put(omap->init_60m_fclk); |
diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c index 99ef944c621d..44afae0a69ce 100644 --- a/drivers/mfd/rc5t583.c +++ b/drivers/mfd/rc5t583.c | |||
@@ -80,44 +80,6 @@ static struct mfd_cell rc5t583_subdevs[] = { | |||
80 | {.name = "rc5t583-key", } | 80 | {.name = "rc5t583-key", } |
81 | }; | 81 | }; |
82 | 82 | ||
83 | int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val) | ||
84 | { | ||
85 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
86 | return regmap_write(rc5t583->regmap, reg, val); | ||
87 | } | ||
88 | |||
89 | int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val) | ||
90 | { | ||
91 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
92 | unsigned int ival; | ||
93 | int ret; | ||
94 | ret = regmap_read(rc5t583->regmap, reg, &ival); | ||
95 | if (!ret) | ||
96 | *val = (uint8_t)ival; | ||
97 | return ret; | ||
98 | } | ||
99 | |||
100 | int rc5t583_set_bits(struct device *dev, unsigned int reg, | ||
101 | unsigned int bit_mask) | ||
102 | { | ||
103 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
104 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask); | ||
105 | } | ||
106 | |||
107 | int rc5t583_clear_bits(struct device *dev, unsigned int reg, | ||
108 | unsigned int bit_mask) | ||
109 | { | ||
110 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
111 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0); | ||
112 | } | ||
113 | |||
114 | int rc5t583_update(struct device *dev, unsigned int reg, | ||
115 | unsigned int val, unsigned int mask) | ||
116 | { | ||
117 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
118 | return regmap_update_bits(rc5t583->regmap, reg, mask, val); | ||
119 | } | ||
120 | |||
121 | static int __rc5t583_set_ext_pwrreq1_control(struct device *dev, | 83 | static int __rc5t583_set_ext_pwrreq1_control(struct device *dev, |
122 | int id, int ext_pwr, int slots) | 84 | int id, int ext_pwr, int slots) |
123 | { | 85 | { |
@@ -197,6 +159,7 @@ int rc5t583_ext_power_req_config(struct device *dev, int ds_id, | |||
197 | ds_id, ext_pwr_req); | 159 | ds_id, ext_pwr_req); |
198 | return 0; | 160 | return 0; |
199 | } | 161 | } |
162 | EXPORT_SYMBOL(rc5t583_ext_power_req_config); | ||
200 | 163 | ||
201 | static int rc5t583_clear_ext_power_req(struct rc5t583 *rc5t583, | 164 | static int rc5t583_clear_ext_power_req(struct rc5t583 *rc5t583, |
202 | struct rc5t583_platform_data *pdata) | 165 | struct rc5t583_platform_data *pdata) |
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c index b2d8e512d3cb..2d6bedadca09 100644 --- a/drivers/mfd/twl6040-core.c +++ b/drivers/mfd/twl6040-core.c | |||
@@ -30,7 +30,9 @@ | |||
30 | #include <linux/platform_device.h> | 30 | #include <linux/platform_device.h> |
31 | #include <linux/gpio.h> | 31 | #include <linux/gpio.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/i2c/twl.h> | 33 | #include <linux/i2c.h> |
34 | #include <linux/regmap.h> | ||
35 | #include <linux/err.h> | ||
34 | #include <linux/mfd/core.h> | 36 | #include <linux/mfd/core.h> |
35 | #include <linux/mfd/twl6040.h> | 37 | #include <linux/mfd/twl6040.h> |
36 | 38 | ||
@@ -39,7 +41,7 @@ | |||
39 | int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) | 41 | int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) |
40 | { | 42 | { |
41 | int ret; | 43 | int ret; |
42 | u8 val = 0; | 44 | unsigned int val; |
43 | 45 | ||
44 | mutex_lock(&twl6040->io_mutex); | 46 | mutex_lock(&twl6040->io_mutex); |
45 | /* Vibra control registers from cache */ | 47 | /* Vibra control registers from cache */ |
@@ -47,7 +49,7 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) | |||
47 | reg == TWL6040_REG_VIBCTLR)) { | 49 | reg == TWL6040_REG_VIBCTLR)) { |
48 | val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)]; | 50 | val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)]; |
49 | } else { | 51 | } else { |
50 | ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | 52 | ret = regmap_read(twl6040->regmap, reg, &val); |
51 | if (ret < 0) { | 53 | if (ret < 0) { |
52 | mutex_unlock(&twl6040->io_mutex); | 54 | mutex_unlock(&twl6040->io_mutex); |
53 | return ret; | 55 | return ret; |
@@ -64,7 +66,7 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val) | |||
64 | int ret; | 66 | int ret; |
65 | 67 | ||
66 | mutex_lock(&twl6040->io_mutex); | 68 | mutex_lock(&twl6040->io_mutex); |
67 | ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | 69 | ret = regmap_write(twl6040->regmap, reg, val); |
68 | /* Cache the vibra control registers */ | 70 | /* Cache the vibra control registers */ |
69 | if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR) | 71 | if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR) |
70 | twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val; | 72 | twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val; |
@@ -77,16 +79,9 @@ EXPORT_SYMBOL(twl6040_reg_write); | |||
77 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) | 79 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
78 | { | 80 | { |
79 | int ret; | 81 | int ret; |
80 | u8 val; | ||
81 | 82 | ||
82 | mutex_lock(&twl6040->io_mutex); | 83 | mutex_lock(&twl6040->io_mutex); |
83 | ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | 84 | ret = regmap_update_bits(twl6040->regmap, reg, mask, mask); |
84 | if (ret) | ||
85 | goto out; | ||
86 | |||
87 | val |= mask; | ||
88 | ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | ||
89 | out: | ||
90 | mutex_unlock(&twl6040->io_mutex); | 85 | mutex_unlock(&twl6040->io_mutex); |
91 | return ret; | 86 | return ret; |
92 | } | 87 | } |
@@ -95,16 +90,9 @@ EXPORT_SYMBOL(twl6040_set_bits); | |||
95 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) | 90 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
96 | { | 91 | { |
97 | int ret; | 92 | int ret; |
98 | u8 val; | ||
99 | 93 | ||
100 | mutex_lock(&twl6040->io_mutex); | 94 | mutex_lock(&twl6040->io_mutex); |
101 | ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | 95 | ret = regmap_update_bits(twl6040->regmap, reg, mask, 0); |
102 | if (ret) | ||
103 | goto out; | ||
104 | |||
105 | val &= ~mask; | ||
106 | ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | ||
107 | out: | ||
108 | mutex_unlock(&twl6040->io_mutex); | 96 | mutex_unlock(&twl6040->io_mutex); |
109 | return ret; | 97 | return ret; |
110 | } | 98 | } |
@@ -494,32 +482,58 @@ static struct resource twl6040_codec_rsrc[] = { | |||
494 | }, | 482 | }, |
495 | }; | 483 | }; |
496 | 484 | ||
497 | static int __devinit twl6040_probe(struct platform_device *pdev) | 485 | static bool twl6040_readable_reg(struct device *dev, unsigned int reg) |
498 | { | 486 | { |
499 | struct twl4030_audio_data *pdata = pdev->dev.platform_data; | 487 | /* Register 0 is not readable */ |
488 | if (!reg) | ||
489 | return false; | ||
490 | return true; | ||
491 | } | ||
492 | |||
493 | static struct regmap_config twl6040_regmap_config = { | ||
494 | .reg_bits = 8, | ||
495 | .val_bits = 8, | ||
496 | .max_register = TWL6040_REG_STATUS, /* 0x2e */ | ||
497 | |||
498 | .readable_reg = twl6040_readable_reg, | ||
499 | }; | ||
500 | |||
501 | static int __devinit twl6040_probe(struct i2c_client *client, | ||
502 | const struct i2c_device_id *id) | ||
503 | { | ||
504 | struct twl6040_platform_data *pdata = client->dev.platform_data; | ||
500 | struct twl6040 *twl6040; | 505 | struct twl6040 *twl6040; |
501 | struct mfd_cell *cell = NULL; | 506 | struct mfd_cell *cell = NULL; |
502 | int ret, children = 0; | 507 | int ret, children = 0; |
503 | 508 | ||
504 | if (!pdata) { | 509 | if (!pdata) { |
505 | dev_err(&pdev->dev, "Platform data is missing\n"); | 510 | dev_err(&client->dev, "Platform data is missing\n"); |
506 | return -EINVAL; | 511 | return -EINVAL; |
507 | } | 512 | } |
508 | 513 | ||
509 | /* In order to operate correctly we need valid interrupt config */ | 514 | /* In order to operate correctly we need valid interrupt config */ |
510 | if (!pdata->naudint_irq || !pdata->irq_base) { | 515 | if (!client->irq || !pdata->irq_base) { |
511 | dev_err(&pdev->dev, "Invalid IRQ configuration\n"); | 516 | dev_err(&client->dev, "Invalid IRQ configuration\n"); |
512 | return -EINVAL; | 517 | return -EINVAL; |
513 | } | 518 | } |
514 | 519 | ||
515 | twl6040 = kzalloc(sizeof(struct twl6040), GFP_KERNEL); | 520 | twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040), |
516 | if (!twl6040) | 521 | GFP_KERNEL); |
517 | return -ENOMEM; | 522 | if (!twl6040) { |
523 | ret = -ENOMEM; | ||
524 | goto err; | ||
525 | } | ||
526 | |||
527 | twl6040->regmap = regmap_init_i2c(client, &twl6040_regmap_config); | ||
528 | if (IS_ERR(twl6040->regmap)) { | ||
529 | ret = PTR_ERR(twl6040->regmap); | ||
530 | goto err; | ||
531 | } | ||
518 | 532 | ||
519 | platform_set_drvdata(pdev, twl6040); | 533 | i2c_set_clientdata(client, twl6040); |
520 | 534 | ||
521 | twl6040->dev = &pdev->dev; | 535 | twl6040->dev = &client->dev; |
522 | twl6040->irq = pdata->naudint_irq; | 536 | twl6040->irq = client->irq; |
523 | twl6040->irq_base = pdata->irq_base; | 537 | twl6040->irq_base = pdata->irq_base; |
524 | 538 | ||
525 | mutex_init(&twl6040->mutex); | 539 | mutex_init(&twl6040->mutex); |
@@ -588,12 +602,12 @@ static int __devinit twl6040_probe(struct platform_device *pdev) | |||
588 | } | 602 | } |
589 | 603 | ||
590 | if (children) { | 604 | if (children) { |
591 | ret = mfd_add_devices(&pdev->dev, pdev->id, twl6040->cells, | 605 | ret = mfd_add_devices(&client->dev, -1, twl6040->cells, |
592 | children, NULL, 0); | 606 | children, NULL, 0); |
593 | if (ret) | 607 | if (ret) |
594 | goto mfd_err; | 608 | goto mfd_err; |
595 | } else { | 609 | } else { |
596 | dev_err(&pdev->dev, "No platform data found for children\n"); | 610 | dev_err(&client->dev, "No platform data found for children\n"); |
597 | ret = -ENODEV; | 611 | ret = -ENODEV; |
598 | goto mfd_err; | 612 | goto mfd_err; |
599 | } | 613 | } |
@@ -608,14 +622,15 @@ gpio2_err: | |||
608 | if (gpio_is_valid(twl6040->audpwron)) | 622 | if (gpio_is_valid(twl6040->audpwron)) |
609 | gpio_free(twl6040->audpwron); | 623 | gpio_free(twl6040->audpwron); |
610 | gpio1_err: | 624 | gpio1_err: |
611 | platform_set_drvdata(pdev, NULL); | 625 | i2c_set_clientdata(client, NULL); |
612 | kfree(twl6040); | 626 | regmap_exit(twl6040->regmap); |
627 | err: | ||
613 | return ret; | 628 | return ret; |
614 | } | 629 | } |
615 | 630 | ||
616 | static int __devexit twl6040_remove(struct platform_device *pdev) | 631 | static int __devexit twl6040_remove(struct i2c_client *client) |
617 | { | 632 | { |
618 | struct twl6040 *twl6040 = platform_get_drvdata(pdev); | 633 | struct twl6040 *twl6040 = i2c_get_clientdata(client); |
619 | 634 | ||
620 | if (twl6040->power_count) | 635 | if (twl6040->power_count) |
621 | twl6040_power(twl6040, 0); | 636 | twl6040_power(twl6040, 0); |
@@ -626,23 +641,30 @@ static int __devexit twl6040_remove(struct platform_device *pdev) | |||
626 | free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040); | 641 | free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040); |
627 | twl6040_irq_exit(twl6040); | 642 | twl6040_irq_exit(twl6040); |
628 | 643 | ||
629 | mfd_remove_devices(&pdev->dev); | 644 | mfd_remove_devices(&client->dev); |
630 | platform_set_drvdata(pdev, NULL); | 645 | i2c_set_clientdata(client, NULL); |
631 | kfree(twl6040); | 646 | regmap_exit(twl6040->regmap); |
632 | 647 | ||
633 | return 0; | 648 | return 0; |
634 | } | 649 | } |
635 | 650 | ||
636 | static struct platform_driver twl6040_driver = { | 651 | static const struct i2c_device_id twl6040_i2c_id[] = { |
652 | { "twl6040", 0, }, | ||
653 | { }, | ||
654 | }; | ||
655 | MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id); | ||
656 | |||
657 | static struct i2c_driver twl6040_driver = { | ||
658 | .driver = { | ||
659 | .name = "twl6040", | ||
660 | .owner = THIS_MODULE, | ||
661 | }, | ||
637 | .probe = twl6040_probe, | 662 | .probe = twl6040_probe, |
638 | .remove = __devexit_p(twl6040_remove), | 663 | .remove = __devexit_p(twl6040_remove), |
639 | .driver = { | 664 | .id_table = twl6040_i2c_id, |
640 | .owner = THIS_MODULE, | ||
641 | .name = "twl6040", | ||
642 | }, | ||
643 | }; | 665 | }; |
644 | 666 | ||
645 | module_platform_driver(twl6040_driver); | 667 | module_i2c_driver(twl6040_driver); |
646 | 668 | ||
647 | MODULE_DESCRIPTION("TWL6040 MFD"); | 669 | MODULE_DESCRIPTION("TWL6040 MFD"); |
648 | MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>"); | 670 | MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>"); |
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index bba9850f32f0..5c78f9e71466 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
43 | #include <linux/regulator/consumer.h> | 43 | #include <linux/regulator/consumer.h> |
44 | #include <linux/pm_runtime.h> | 44 | #include <linux/pm_runtime.h> |
45 | #include <linux/gpio.h> | ||
45 | 46 | ||
46 | /* EHCI Register Set */ | 47 | /* EHCI Register Set */ |
47 | #define EHCI_INSNREG04 (0xA0) | 48 | #define EHCI_INSNREG04 (0xA0) |
@@ -191,6 +192,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
191 | } | 192 | } |
192 | } | 193 | } |
193 | 194 | ||
195 | if (pdata->phy_reset) { | ||
196 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | ||
197 | gpio_request_one(pdata->reset_gpio_port[0], | ||
198 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | ||
199 | |||
200 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | ||
201 | gpio_request_one(pdata->reset_gpio_port[1], | ||
202 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | ||
203 | |||
204 | /* Hold the PHY in RESET for enough time till DIR is high */ | ||
205 | udelay(10); | ||
206 | } | ||
207 | |||
194 | pm_runtime_enable(dev); | 208 | pm_runtime_enable(dev); |
195 | pm_runtime_get_sync(dev); | 209 | pm_runtime_get_sync(dev); |
196 | 210 | ||
@@ -237,6 +251,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
237 | /* root ports should always stay powered */ | 251 | /* root ports should always stay powered */ |
238 | ehci_port_power(omap_ehci, 1); | 252 | ehci_port_power(omap_ehci, 1); |
239 | 253 | ||
254 | if (pdata->phy_reset) { | ||
255 | /* Hold the PHY in RESET for enough time till | ||
256 | * PHY is settled and ready | ||
257 | */ | ||
258 | udelay(10); | ||
259 | |||
260 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | ||
261 | gpio_set_value(pdata->reset_gpio_port[0], 1); | ||
262 | |||
263 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | ||
264 | gpio_set_value(pdata->reset_gpio_port[1], 1); | ||
265 | } | ||
266 | |||
240 | return 0; | 267 | return 0; |
241 | 268 | ||
242 | err_add_hcd: | 269 | err_add_hcd: |
@@ -259,8 +286,9 @@ err_io: | |||
259 | */ | 286 | */ |
260 | static int ehci_hcd_omap_remove(struct platform_device *pdev) | 287 | static int ehci_hcd_omap_remove(struct platform_device *pdev) |
261 | { | 288 | { |
262 | struct device *dev = &pdev->dev; | 289 | struct device *dev = &pdev->dev; |
263 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 290 | struct usb_hcd *hcd = dev_get_drvdata(dev); |
291 | struct ehci_hcd_omap_platform_data *pdata = dev->platform_data; | ||
264 | 292 | ||
265 | usb_remove_hcd(hcd); | 293 | usb_remove_hcd(hcd); |
266 | disable_put_regulator(dev->platform_data); | 294 | disable_put_regulator(dev->platform_data); |
@@ -269,6 +297,13 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
269 | pm_runtime_put_sync(dev); | 297 | pm_runtime_put_sync(dev); |
270 | pm_runtime_disable(dev); | 298 | pm_runtime_disable(dev); |
271 | 299 | ||
300 | if (pdata->phy_reset) { | ||
301 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | ||
302 | gpio_free(pdata->reset_gpio_port[0]); | ||
303 | |||
304 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | ||
305 | gpio_free(pdata->reset_gpio_port[1]); | ||
306 | } | ||
272 | return 0; | 307 | return 0; |
273 | } | 308 | } |
274 | 309 | ||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 2463b6100333..1f90de0cfdbe 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -666,23 +666,11 @@ struct twl4030_codec_data { | |||
666 | unsigned int check_defaults:1; | 666 | unsigned int check_defaults:1; |
667 | unsigned int reset_registers:1; | 667 | unsigned int reset_registers:1; |
668 | unsigned int hs_extmute:1; | 668 | unsigned int hs_extmute:1; |
669 | u16 hs_left_step; | ||
670 | u16 hs_right_step; | ||
671 | u16 hf_left_step; | ||
672 | u16 hf_right_step; | ||
673 | void (*set_hs_extmute)(int mute); | 669 | void (*set_hs_extmute)(int mute); |
674 | }; | 670 | }; |
675 | 671 | ||
676 | struct twl4030_vibra_data { | 672 | struct twl4030_vibra_data { |
677 | unsigned int coexist; | 673 | unsigned int coexist; |
678 | |||
679 | /* twl6040 */ | ||
680 | unsigned int vibldrv_res; /* left driver resistance */ | ||
681 | unsigned int vibrdrv_res; /* right driver resistance */ | ||
682 | unsigned int viblmotor_res; /* left motor resistance */ | ||
683 | unsigned int vibrmotor_res; /* right motor resistance */ | ||
684 | int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | ||
685 | int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | ||
686 | }; | 674 | }; |
687 | 675 | ||
688 | struct twl4030_audio_data { | 676 | struct twl4030_audio_data { |
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h index 9890687f582d..5a049dfaf153 100644 --- a/include/linux/mfd/db5500-prcmu.h +++ b/include/linux/mfd/db5500-prcmu.h | |||
@@ -8,41 +8,14 @@ | |||
8 | #ifndef __MFD_DB5500_PRCMU_H | 8 | #ifndef __MFD_DB5500_PRCMU_H |
9 | #define __MFD_DB5500_PRCMU_H | 9 | #define __MFD_DB5500_PRCMU_H |
10 | 10 | ||
11 | #ifdef CONFIG_MFD_DB5500_PRCMU | 11 | static inline int prcmu_resetout(u8 resoutn, u8 state) |
12 | |||
13 | void db5500_prcmu_early_init(void); | ||
14 | int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
15 | int db5500_prcmu_set_display_clocks(void); | ||
16 | int db5500_prcmu_disable_dsipll(void); | ||
17 | int db5500_prcmu_enable_dsipll(void); | ||
18 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
19 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
20 | void db5500_prcmu_enable_wakeups(u32 wakeups); | ||
21 | int db5500_prcmu_request_clock(u8 clock, bool enable); | ||
22 | void db5500_prcmu_config_abb_event_readout(u32 abb_events); | ||
23 | void db5500_prcmu_get_abb_event_buffer(void __iomem **buf); | ||
24 | int prcmu_resetout(u8 resoutn, u8 state); | ||
25 | int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
26 | bool keep_ap_pll); | ||
27 | int db5500_prcmu_config_esram0_deep_sleep(u8 state); | ||
28 | void db5500_prcmu_system_reset(u16 reset_code); | ||
29 | u16 db5500_prcmu_get_reset_code(void); | ||
30 | bool db5500_prcmu_is_ac_wake_requested(void); | ||
31 | int db5500_prcmu_set_arm_opp(u8 opp); | ||
32 | int db5500_prcmu_get_arm_opp(void); | ||
33 | |||
34 | #else /* !CONFIG_UX500_SOC_DB5500 */ | ||
35 | |||
36 | static inline void db5500_prcmu_early_init(void) {} | ||
37 | |||
38 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
39 | { | 12 | { |
40 | return -ENOSYS; | 13 | return 0; |
41 | } | 14 | } |
42 | 15 | ||
43 | static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | 16 | static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) |
44 | { | 17 | { |
45 | return -ENOSYS; | 18 | return 0; |
46 | } | 19 | } |
47 | 20 | ||
48 | static inline int db5500_prcmu_request_clock(u8 clock, bool enable) | 21 | static inline int db5500_prcmu_request_clock(u8 clock, bool enable) |
@@ -50,69 +23,82 @@ static inline int db5500_prcmu_request_clock(u8 clock, bool enable) | |||
50 | return 0; | 23 | return 0; |
51 | } | 24 | } |
52 | 25 | ||
53 | static inline int db5500_prcmu_set_display_clocks(void) | 26 | static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, |
27 | bool keep_ap_pll) | ||
54 | { | 28 | { |
55 | return 0; | 29 | return 0; |
56 | } | 30 | } |
57 | 31 | ||
58 | static inline int db5500_prcmu_disable_dsipll(void) | 32 | static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) |
59 | { | 33 | { |
60 | return 0; | 34 | return 0; |
61 | } | 35 | } |
62 | 36 | ||
63 | static inline int db5500_prcmu_enable_dsipll(void) | 37 | static inline u16 db5500_prcmu_get_reset_code(void) |
64 | { | 38 | { |
65 | return 0; | 39 | return 0; |
66 | } | 40 | } |
67 | 41 | ||
68 | static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) | 42 | static inline bool db5500_prcmu_is_ac_wake_requested(void) |
69 | { | 43 | { |
70 | return 0; | 44 | return 0; |
71 | } | 45 | } |
72 | 46 | ||
73 | static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} | 47 | static inline int db5500_prcmu_set_arm_opp(u8 opp) |
74 | |||
75 | static inline int prcmu_resetout(u8 resoutn, u8 state) | ||
76 | { | 48 | { |
77 | return 0; | 49 | return 0; |
78 | } | 50 | } |
79 | 51 | ||
80 | static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) | 52 | static inline int db5500_prcmu_get_arm_opp(void) |
81 | { | 53 | { |
82 | return 0; | 54 | return 0; |
83 | } | 55 | } |
84 | 56 | ||
85 | static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} | ||
86 | static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {} | 57 | static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {} |
87 | 58 | ||
88 | static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | 59 | static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} |
89 | bool keep_ap_pll) | ||
90 | { | ||
91 | return 0; | ||
92 | } | ||
93 | 60 | ||
94 | static inline void db5500_prcmu_system_reset(u16 reset_code) {} | 61 | static inline void db5500_prcmu_system_reset(u16 reset_code) {} |
95 | 62 | ||
96 | static inline u16 db5500_prcmu_get_reset_code(void) | 63 | static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} |
64 | |||
65 | #ifdef CONFIG_MFD_DB5500_PRCMU | ||
66 | |||
67 | void db5500_prcmu_early_init(void); | ||
68 | int db5500_prcmu_set_display_clocks(void); | ||
69 | int db5500_prcmu_disable_dsipll(void); | ||
70 | int db5500_prcmu_enable_dsipll(void); | ||
71 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
72 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
73 | |||
74 | #else /* !CONFIG_UX500_SOC_DB5500 */ | ||
75 | |||
76 | static inline void db5500_prcmu_early_init(void) {} | ||
77 | |||
78 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
97 | { | 79 | { |
98 | return 0; | 80 | return -ENOSYS; |
99 | } | 81 | } |
100 | 82 | ||
101 | static inline bool db5500_prcmu_is_ac_wake_requested(void) | 83 | static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) |
102 | { | 84 | { |
103 | return 0; | 85 | return -ENOSYS; |
104 | } | 86 | } |
105 | 87 | ||
106 | static inline int db5500_prcmu_set_arm_opp(u8 opp) | 88 | static inline int db5500_prcmu_set_display_clocks(void) |
107 | { | 89 | { |
108 | return 0; | 90 | return 0; |
109 | } | 91 | } |
110 | 92 | ||
111 | static inline int db5500_prcmu_get_arm_opp(void) | 93 | static inline int db5500_prcmu_disable_dsipll(void) |
112 | { | 94 | { |
113 | return 0; | 95 | return 0; |
114 | } | 96 | } |
115 | 97 | ||
98 | static inline int db5500_prcmu_enable_dsipll(void) | ||
99 | { | ||
100 | return 0; | ||
101 | } | ||
116 | 102 | ||
117 | #endif /* CONFIG_MFD_DB5500_PRCMU */ | 103 | #endif /* CONFIG_MFD_DB5500_PRCMU */ |
118 | 104 | ||
diff --git a/include/linux/mfd/rc5t583.h b/include/linux/mfd/rc5t583.h index a2c61609d21d..0b64b19d81ab 100644 --- a/include/linux/mfd/rc5t583.h +++ b/include/linux/mfd/rc5t583.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/regmap.h> | ||
29 | 30 | ||
30 | #define RC5T583_MAX_REGS 0xF8 | 31 | #define RC5T583_MAX_REGS 0xF8 |
31 | 32 | ||
@@ -279,14 +280,44 @@ struct rc5t583_platform_data { | |||
279 | bool enable_shutdown; | 280 | bool enable_shutdown; |
280 | }; | 281 | }; |
281 | 282 | ||
282 | int rc5t583_write(struct device *dev, u8 reg, uint8_t val); | 283 | static inline int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val) |
283 | int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val); | 284 | { |
284 | int rc5t583_set_bits(struct device *dev, unsigned int reg, | 285 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); |
285 | unsigned int bit_mask); | 286 | return regmap_write(rc5t583->regmap, reg, val); |
286 | int rc5t583_clear_bits(struct device *dev, unsigned int reg, | 287 | } |
287 | unsigned int bit_mask); | 288 | |
288 | int rc5t583_update(struct device *dev, unsigned int reg, | 289 | static inline int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val) |
289 | unsigned int val, unsigned int mask); | 290 | { |
291 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
292 | unsigned int ival; | ||
293 | int ret; | ||
294 | ret = regmap_read(rc5t583->regmap, reg, &ival); | ||
295 | if (!ret) | ||
296 | *val = (uint8_t)ival; | ||
297 | return ret; | ||
298 | } | ||
299 | |||
300 | static inline int rc5t583_set_bits(struct device *dev, unsigned int reg, | ||
301 | unsigned int bit_mask) | ||
302 | { | ||
303 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
304 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask); | ||
305 | } | ||
306 | |||
307 | static inline int rc5t583_clear_bits(struct device *dev, unsigned int reg, | ||
308 | unsigned int bit_mask) | ||
309 | { | ||
310 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
311 | return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0); | ||
312 | } | ||
313 | |||
314 | static inline int rc5t583_update(struct device *dev, unsigned int reg, | ||
315 | unsigned int val, unsigned int mask) | ||
316 | { | ||
317 | struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | ||
318 | return regmap_update_bits(rc5t583->regmap, reg, mask, val); | ||
319 | } | ||
320 | |||
290 | int rc5t583_ext_power_req_config(struct device *dev, int deepsleep_id, | 321 | int rc5t583_ext_power_req_config(struct device *dev, int deepsleep_id, |
291 | int ext_pwr_req, int deepsleep_slot_nr); | 322 | int ext_pwr_req, int deepsleep_slot_nr); |
292 | int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base); | 323 | int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base); |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index 9bc9ac651dad..b15b5f03f5c4 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -174,8 +174,35 @@ | |||
174 | #define TWL6040_SYSCLK_SEL_LPPLL 0 | 174 | #define TWL6040_SYSCLK_SEL_LPPLL 0 |
175 | #define TWL6040_SYSCLK_SEL_HPPLL 1 | 175 | #define TWL6040_SYSCLK_SEL_HPPLL 1 |
176 | 176 | ||
177 | struct twl6040_codec_data { | ||
178 | u16 hs_left_step; | ||
179 | u16 hs_right_step; | ||
180 | u16 hf_left_step; | ||
181 | u16 hf_right_step; | ||
182 | }; | ||
183 | |||
184 | struct twl6040_vibra_data { | ||
185 | unsigned int vibldrv_res; /* left driver resistance */ | ||
186 | unsigned int vibrdrv_res; /* right driver resistance */ | ||
187 | unsigned int viblmotor_res; /* left motor resistance */ | ||
188 | unsigned int vibrmotor_res; /* right motor resistance */ | ||
189 | int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | ||
190 | int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | ||
191 | }; | ||
192 | |||
193 | struct twl6040_platform_data { | ||
194 | int audpwron_gpio; /* audio power-on gpio */ | ||
195 | unsigned int irq_base; | ||
196 | |||
197 | struct twl6040_codec_data *codec; | ||
198 | struct twl6040_vibra_data *vibra; | ||
199 | }; | ||
200 | |||
201 | struct regmap; | ||
202 | |||
177 | struct twl6040 { | 203 | struct twl6040 { |
178 | struct device *dev; | 204 | struct device *dev; |
205 | struct regmap *regmap; | ||
179 | struct mutex mutex; | 206 | struct mutex mutex; |
180 | struct mutex io_mutex; | 207 | struct mutex io_mutex; |
181 | struct mutex irq_mutex; | 208 | struct mutex irq_mutex; |
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 6508e8b790bb..59d8efaa17e9 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -57,7 +57,7 @@ config SND_SOC_ALL_CODECS | |||
57 | select SND_SOC_TPA6130A2 if I2C | 57 | select SND_SOC_TPA6130A2 if I2C |
58 | select SND_SOC_TLV320DAC33 if I2C | 58 | select SND_SOC_TLV320DAC33 if I2C |
59 | select SND_SOC_TWL4030 if TWL4030_CORE | 59 | select SND_SOC_TWL4030 if TWL4030_CORE |
60 | select SND_SOC_TWL6040 if TWL4030_CORE | 60 | select SND_SOC_TWL6040 if TWL6040_CORE |
61 | select SND_SOC_UDA134X | 61 | select SND_SOC_UDA134X |
62 | select SND_SOC_UDA1380 if I2C | 62 | select SND_SOC_UDA1380 if I2C |
63 | select SND_SOC_WL1273 if MFD_WL1273_CORE | 63 | select SND_SOC_WL1273 if MFD_WL1273_CORE |
@@ -276,7 +276,6 @@ config SND_SOC_TWL4030 | |||
276 | tristate | 276 | tristate |
277 | 277 | ||
278 | config SND_SOC_TWL6040 | 278 | config SND_SOC_TWL6040 |
279 | select TWL6040_CORE | ||
280 | tristate | 279 | tristate |
281 | 280 | ||
282 | config SND_SOC_UDA134X | 281 | config SND_SOC_UDA134X |
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 2d8c6b825e57..dc7509b9d53a 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/pm.h> | 26 | #include <linux/pm.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/i2c/twl.h> | ||
30 | #include <linux/mfd/twl6040.h> | 29 | #include <linux/mfd/twl6040.h> |
31 | 30 | ||
32 | #include <sound/core.h> | 31 | #include <sound/core.h> |
@@ -1528,7 +1527,7 @@ static int twl6040_resume(struct snd_soc_codec *codec) | |||
1528 | static int twl6040_probe(struct snd_soc_codec *codec) | 1527 | static int twl6040_probe(struct snd_soc_codec *codec) |
1529 | { | 1528 | { |
1530 | struct twl6040_data *priv; | 1529 | struct twl6040_data *priv; |
1531 | struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); | 1530 | struct twl6040_codec_data *pdata = dev_get_platdata(codec->dev); |
1532 | struct platform_device *pdev = container_of(codec->dev, | 1531 | struct platform_device *pdev = container_of(codec->dev, |
1533 | struct platform_device, dev); | 1532 | struct platform_device, dev); |
1534 | int ret = 0; | 1533 | int ret = 0; |
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index e00dd0b1139c..deafbfaacdbf 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig | |||
@@ -97,7 +97,7 @@ config SND_OMAP_SOC_SDP3430 | |||
97 | 97 | ||
98 | config SND_OMAP_SOC_OMAP_ABE_TWL6040 | 98 | config SND_OMAP_SOC_OMAP_ABE_TWL6040 |
99 | tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" | 99 | tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" |
100 | depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4 | 100 | depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4 |
101 | select SND_OMAP_SOC_DMIC | 101 | select SND_OMAP_SOC_DMIC |
102 | select SND_OMAP_SOC_MCPDM | 102 | select SND_OMAP_SOC_MCPDM |
103 | select SND_SOC_TWL6040 | 103 | select SND_SOC_TWL6040 |