Skip to content

Commit 345e397

Browse files
committed
Merge branch 'peter/topic/for-tony' of git://gitorious.org/omap-audio/linux-audio into twl-asoc
2 parents 727e18b + 21385ee commit 345e397

26 files changed

Lines changed: 2230 additions & 904 deletions

‎arch/arm/mach-omap2/board-4430sdp.c‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/i2c/twl.h>
2323
#include <linux/gpio_keys.h>
2424
#include <linux/regulator/machine.h>
25+
#include <linux/regulator/fixed.h>
2526
#include <linux/leds.h>
2627
#include <linux/leds_pwm.h>
2728

@@ -275,11 +276,40 @@ static struct platform_device sdp4430_lcd_device = {
275276
.id = -1,
276277
};
277278

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+
278307
static struct platform_device *sdp4430_devices[] __initdata = {
279308
&sdp4430_lcd_device,
280309
&sdp4430_gpio_keys_device,
281310
&sdp4430_leds_gpio,
282311
&sdp4430_leds_pwm,
312+
&sdp4430_vbat,
283313
};
284314

285315
static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -395,7 +425,33 @@ static struct regulator_init_data sdp4430_vusim = {
395425
},
396426
};
397427

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+
398453
static struct twl4030_platform_data sdp4430_twldata = {
454+
.audio = &twl6040_audio,
399455
/* Regulators */
400456
.vusim = &sdp4430_vusim,
401457
.vaux1 = &sdp4430_vaux1,

‎arch/arm/mach-omap2/board-rx51-peripherals.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,11 +741,11 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
741741
.resource_config = twl4030_rconfig,
742742
};
743743

744-
struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
744+
struct twl4030_vibra_data rx51_vibra_data __initdata = {
745745
.coexist = 0,
746746
};
747747

748-
struct twl4030_codec_data rx51_codec_data __initdata = {
748+
struct twl4030_audio_data rx51_audio_data __initdata = {
749749
.audio_mclk = 26000000,
750750
.vibra = &rx51_vibra_data,
751751
};
@@ -755,7 +755,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
755755
.gpio = &rx51_gpio_data,
756756
.keypad = &rx51_kp_data,
757757
.power = &rx51_t2scripts_data,
758-
.codec = &rx51_codec_data,
758+
.audio = &rx51_audio_data,
759759

760760
.vaux1 = &rx51_vaux1,
761761
.vaux2 = &rx51_vaux2,

‎arch/arm/mach-omap2/board-zoom-peripherals.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ static int __init omap_i2c_init(void)
274274
TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
275275

276276
if (machine_is_omap_zoom2()) {
277-
struct twl4030_codec_audio_data *audio_data;
278-
audio_data = zoom_twldata.codec->audio;
277+
struct twl4030_codec_data *codec_data;
278+
codec_data = zoom_twldata.audio->codec;
279279

280-
audio_data->ramp_delay_value = 3; /* 161 ms */
281-
audio_data->hs_extmute = 1;
282-
audio_data->set_hs_extmute = zoom2_set_hs_extmute;
280+
codec_data->ramp_delay_value = 3; /* 161 ms */
281+
codec_data->hs_extmute = 1;
282+
codec_data->set_hs_extmute = zoom2_set_hs_extmute;
283283
}
284284
omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata);
285285
omap_register_i2c_bus(2, 400, NULL, 0);

‎arch/arm/mach-omap2/twl-common.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ static struct twl4030_madc_platform_data omap3_madc_pdata = {
8080
.irq_line = 1,
8181
};
8282

83-
static struct twl4030_codec_audio_data omap3_audio;
83+
static struct twl4030_codec_data omap3_codec;
8484

85-
static struct twl4030_codec_data omap3_codec_pdata = {
85+
static struct twl4030_audio_data omap3_audio_pdata = {
8686
.audio_mclk = 26000000,
87-
.audio = &omap3_audio,
87+
.codec = &omap3_codec,
8888
};
8989

9090
static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
@@ -292,8 +292,8 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
292292
if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc)
293293
pmic_data->madc = &omap3_madc_pdata;
294294

295-
if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->codec)
296-
pmic_data->codec = &omap3_codec_pdata;
295+
if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio)
296+
pmic_data->audio = &omap3_audio_pdata;
297297

298298
/* Common regulator configurations */
299299
if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)

‎arch/arm/plat-omap/include/plat/irqs.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,19 @@
407407
#endif
408408
#define TWL6030_IRQ_END (TWL6030_IRQ_BASE + TWL6030_BASE_NR_IRQS)
409409

410+
#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
411+
#ifdef CONFIG_TWL6040_CODEC
412+
#define TWL6040_CODEC_NR_IRQS 6
413+
#else
414+
#define TWL6040_CODEC_NR_IRQS 0
415+
#endif
416+
#define TWL6040_CODEC_IRQ_END (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
417+
410418
/* Total number of interrupts depends on the enabled blocks above */
411-
#if (TWL4030_GPIO_IRQ_END > TWL6030_IRQ_END)
419+
#if (TWL4030_GPIO_IRQ_END > TWL6040_CODEC_IRQ_END)
412420
#define TWL_IRQ_END TWL4030_GPIO_IRQ_END
413421
#else
414-
#define TWL_IRQ_END TWL6030_IRQ_END
422+
#define TWL_IRQ_END TWL6040_CODEC_IRQ_END
415423
#endif
416424

417425
/* GPMC related */

‎drivers/input/misc/Kconfig‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,25 @@ config INPUT_TWL4030_PWRBUTTON
267267
config INPUT_TWL4030_VIBRA
268268
tristate "Support for TWL4030 Vibrator"
269269
depends on TWL4030_CORE
270-
select TWL4030_CODEC
270+
select MFD_TWL4030_AUDIO
271271
select INPUT_FF_MEMLESS
272272
help
273273
This option enables support for TWL4030 Vibrator Driver.
274274

275275
To compile this driver as a module, choose M here. The module will
276276
be called twl4030_vibra.
277277

278+
config INPUT_TWL6040_VIBRA
279+
tristate "Support for TWL6040 Vibrator"
280+
depends on TWL4030_CORE
281+
select TWL6040_CORE
282+
select INPUT_FF_MEMLESS
283+
help
284+
This option enables support for TWL6040 Vibrator Driver.
285+
286+
To compile this driver as a module, choose M here. The module will
287+
be called twl6040_vibra.
288+
278289
config INPUT_UINPUT
279290
tristate "User level driver support"
280291
help

‎drivers/input/misc/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
4040
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
4141
obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o
4242
obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o
43+
obj-$(CONFIG_INPUT_TWL6040_VIBRA) += twl6040-vibra.o
4344
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
4445
obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
4546
obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o

‎drivers/input/misc/twl4030-vibra.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <linux/platform_device.h>
2929
#include <linux/workqueue.h>
3030
#include <linux/i2c/twl.h>
31-
#include <linux/mfd/twl4030-codec.h>
31+
#include <linux/mfd/twl4030-audio.h>
3232
#include <linux/input.h>
3333
#include <linux/slab.h>
3434

@@ -67,15 +67,15 @@ static void vibra_enable(struct vibra_info *info)
6767
{
6868
u8 reg;
6969

70-
twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER);
70+
twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
7171

7272
/* turn H-Bridge on */
7373
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
7474
&reg, TWL4030_REG_VIBRA_CTL);
7575
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
7676
(reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
7777

78-
twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
78+
twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL);
7979

8080
info->enabled = true;
8181
}
@@ -90,8 +90,8 @@ static void vibra_disable(struct vibra_info *info)
9090
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
9191
(reg & ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
9292

93-
twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
94-
twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER);
93+
twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL);
94+
twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
9595

9696
info->enabled = false;
9797
}
@@ -196,7 +196,7 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
196196

197197
static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
198198
{
199-
struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data;
199+
struct twl4030_vibra_data *pdata = pdev->dev.platform_data;
200200
struct vibra_info *info;
201201
int ret;
202202

0 commit comments

Comments
 (0)