|
22 | 22 | #include <linux/i2c/twl.h> |
23 | 23 | #include <linux/gpio_keys.h> |
24 | 24 | #include <linux/regulator/machine.h> |
| 25 | +#include <linux/regulator/fixed.h> |
25 | 26 | #include <linux/leds.h> |
26 | 27 | #include <linux/leds_pwm.h> |
27 | 28 |
|
@@ -275,11 +276,40 @@ static struct platform_device sdp4430_lcd_device = { |
275 | 276 | .id = -1, |
276 | 277 | }; |
277 | 278 |
|
| 279 | +static struct regulator_consumer_supply sdp4430_vbat_supply[] = { |
| 280 | + REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), |
| 281 | + REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), |
| 282 | +}; |
| 283 | + |
| 284 | +static struct regulator_init_data sdp4430_vbat_data = { |
| 285 | + .constraints = { |
| 286 | + .always_on = 1, |
| 287 | + }, |
| 288 | + .num_consumer_supplies = ARRAY_SIZE(sdp4430_vbat_supply), |
| 289 | + .consumer_supplies = sdp4430_vbat_supply, |
| 290 | +}; |
| 291 | + |
| 292 | +static struct fixed_voltage_config sdp4430_vbat_pdata = { |
| 293 | + .supply_name = "VBAT", |
| 294 | + .microvolts = 3750000, |
| 295 | + .init_data = &sdp4430_vbat_data, |
| 296 | + .gpio = -EINVAL, |
| 297 | +}; |
| 298 | + |
| 299 | +static struct platform_device sdp4430_vbat = { |
| 300 | + .name = "reg-fixed-voltage", |
| 301 | + .id = -1, |
| 302 | + .dev = { |
| 303 | + .platform_data = &sdp4430_vbat_pdata, |
| 304 | + }, |
| 305 | +}; |
| 306 | + |
278 | 307 | static struct platform_device *sdp4430_devices[] __initdata = { |
279 | 308 | &sdp4430_lcd_device, |
280 | 309 | &sdp4430_gpio_keys_device, |
281 | 310 | &sdp4430_leds_gpio, |
282 | 311 | &sdp4430_leds_pwm, |
| 312 | + &sdp4430_vbat, |
283 | 313 | }; |
284 | 314 |
|
285 | 315 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { |
@@ -395,7 +425,33 @@ static struct regulator_init_data sdp4430_vusim = { |
395 | 425 | }, |
396 | 426 | }; |
397 | 427 |
|
| 428 | +static struct twl4030_codec_data twl6040_codec = { |
| 429 | + /* single-step ramp for headset and handsfree */ |
| 430 | + .hs_left_step = 0x0f, |
| 431 | + .hs_right_step = 0x0f, |
| 432 | + .hf_left_step = 0x1d, |
| 433 | + .hf_right_step = 0x1d, |
| 434 | +}; |
| 435 | + |
| 436 | +static struct twl4030_vibra_data twl6040_vibra = { |
| 437 | + .vibldrv_res = 8, |
| 438 | + .vibrdrv_res = 3, |
| 439 | + .viblmotor_res = 10, |
| 440 | + .vibrmotor_res = 10, |
| 441 | + .vddvibl_uV = 0, /* fixed volt supply - VBAT */ |
| 442 | + .vddvibr_uV = 0, /* fixed volt supply - VBAT */ |
| 443 | +}; |
| 444 | + |
| 445 | +static struct twl4030_audio_data twl6040_audio = { |
| 446 | + .codec = &twl6040_codec, |
| 447 | + .vibra = &twl6040_vibra, |
| 448 | + .audpwron_gpio = 127, |
| 449 | + .naudint_irq = OMAP44XX_IRQ_SYS_2N, |
| 450 | + .irq_base = TWL6040_CODEC_IRQ_BASE, |
| 451 | +}; |
| 452 | + |
398 | 453 | static struct twl4030_platform_data sdp4430_twldata = { |
| 454 | + .audio = &twl6040_audio, |
399 | 455 | /* Regulators */ |
400 | 456 | .vusim = &sdp4430_vusim, |
401 | 457 | .vaux1 = &sdp4430_vaux1, |
|
0 commit comments