Skip to content

Commit

Permalink
Merge branch 'topic/asoc' into for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Iwai committed Oct 27, 2011
2 parents 9430148 + 5927f94 commit bb14eb0
Show file tree
Hide file tree
Showing 186 changed files with 15,232 additions and 3,462 deletions.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ S: Maintained
F: drivers/infiniband/hw/amso1100/

ANALOG DEVICES INC ASOC CODEC DRIVERS
M: Lars-Peter Clausen <lars@metafoo.de>
L: device-drivers-devel@blackfin.uclinux.org
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
W: http://wiki.analog.com/
Expand Down Expand Up @@ -7199,6 +7200,7 @@ T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
S: Supported
F: Documentation/hwmon/wm83??
F: arch/arm/mach-s3c64xx/mach-crag6410*
F: drivers/leds/leds-wm83*.c
F: drivers/input/misc/wm831x-on.c
F: drivers/input/touchscreen/wm831x-ts.c
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-omap2/board-rx51-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
};

static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = {
.id = TPA6130A2,
.power_gpio = 98,
};

Expand Down
33 changes: 33 additions & 0 deletions arch/arm/mach-omap2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,38 @@ static void omap_init_audio(void)
static inline void omap_init_audio(void) {}
#endif

#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)

static struct omap_device_pm_latency omap_mcpdm_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};

static void omap_init_mcpdm(void)
{
struct omap_hwmod *oh;
struct omap_device *od;

oh = omap_hwmod_lookup("mcpdm");
if (!oh) {
printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
return;
}

od = omap_device_build("omap-mcpdm", -1, oh, NULL, 0,
omap_mcpdm_latency,
ARRAY_SIZE(omap_mcpdm_latency), 0);
if (IS_ERR(od))
printk(KERN_ERR "Could not build omap_device for omap-mcpdm-dai\n");
}
#else
static inline void omap_init_mcpdm(void) {}
#endif

#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)

#include <plat/mcspi.h>
Expand Down Expand Up @@ -683,6 +715,7 @@ static int __init omap2_init_devices(void)
* in alphabetical order so they're easier to sort through.
*/
omap_init_audio();
omap_init_mcpdm();
omap_init_camera();
omap_init_mbox();
omap_init_mcspi();
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -5430,7 +5430,7 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
&omap44xx_mcbsp4_hwmod,

/* mcpdm class */
/* &omap44xx_mcpdm_hwmod, */
&omap44xx_mcpdm_hwmod,

/* mcspi class */
&omap44xx_mcspi1_hwmod,
Expand Down
36 changes: 0 additions & 36 deletions arch/arm/plat-omap/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,6 @@ void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,

/*-------------------------------------------------------------------------*/

#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)

static struct resource mcpdm_resources[] = {
{
.name = "mcpdm_mem",
.start = OMAP44XX_MCPDM_BASE,
.end = OMAP44XX_MCPDM_BASE + SZ_4K,
.flags = IORESOURCE_MEM,
},
{
.name = "mcpdm_irq",
.start = OMAP44XX_IRQ_MCPDM,
.end = OMAP44XX_IRQ_MCPDM,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device omap_mcpdm_device = {
.name = "omap-mcpdm",
.id = -1,
.num_resources = ARRAY_SIZE(mcpdm_resources),
.resource = mcpdm_resources,
};

static void omap_init_mcpdm(void)
{
(void) platform_device_register(&omap_mcpdm_device);
}
#else
static inline void omap_init_mcpdm(void) {}
#endif

/*-------------------------------------------------------------------------*/

#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)

Expand Down Expand Up @@ -291,7 +256,6 @@ static int __init omap_init_devices(void)
* in alphabetical order so they're easier to sort through.
*/
omap_init_rng();
omap_init_mcpdm();
omap_init_uwire();
return 0;
}
Expand Down
19 changes: 13 additions & 6 deletions drivers/input/misc/twl6040-vibra.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
if (status & TWL6040_VIBLOCDET) {
dev_warn(info->dev, "Left Vibrator overcurrent detected\n");
twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL);
TWL6040_VIBENA);
}
if (status & TWL6040_VIBROCDET) {
dev_warn(info->dev, "Right Vibrator overcurrent detected\n");
twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR);
TWL6040_VIBENA);
}

return IRQ_HANDLED;
Expand All @@ -104,16 +104,16 @@ static void twl6040_vibra_enable(struct vibra_info *info)
* overcurrent detection
*/
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL | TWL6040_VIBCTRLL);
TWL6040_VIBENA | TWL6040_VIBCTRL);
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR | TWL6040_VIBCTRLR);
TWL6040_VIBENA | TWL6040_VIBCTRL);
usleep_range(3000, 3500);
}

twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLL,
TWL6040_VIBENAL);
TWL6040_VIBENA);
twl6040_reg_write(twl6040, TWL6040_REG_VIBCTLR,
TWL6040_VIBENAR);
TWL6040_VIBENA);

info->enabled = true;
}
Expand Down Expand Up @@ -201,6 +201,13 @@ static int vibra_play(struct input_dev *input, void *data,
struct vibra_info *info = input_get_drvdata(input);
int ret;

/* Do not allow effect, while the routing is set to use audio */
ret = twl6040_get_vibralr_status(info->twl6040);
if (ret & TWL6040_VIBSEL) {
dev_info(&input->dev, "Vibra is configured for audio\n");
return -EBUSY;
}

info->weak_speed = effect->u.rumble.weak_magnitude;
info->strong_speed = effect->u.rumble.strong_magnitude;
info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
Expand Down
31 changes: 27 additions & 4 deletions drivers/mfd/twl6040-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,24 @@
#include <linux/mfd/core.h>
#include <linux/mfd/twl6040.h>

#define VIBRACTRL_MEMBER(reg) ((reg == TWL6040_REG_VIBCTLL) ? 0 : 1)

int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
{
int ret;
u8 val = 0;

mutex_lock(&twl6040->io_mutex);
ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
if (ret < 0) {
mutex_unlock(&twl6040->io_mutex);
return ret;
/* Vibra control registers from cache */
if (unlikely(reg == TWL6040_REG_VIBCTLL ||
reg == TWL6040_REG_VIBCTLR)) {
val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)];
} else {
ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
if (ret < 0) {
mutex_unlock(&twl6040->io_mutex);
return ret;
}
}
mutex_unlock(&twl6040->io_mutex);

Expand All @@ -57,6 +65,9 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val)

mutex_lock(&twl6040->io_mutex);
ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
/* Cache the vibra control registers */
if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR)
twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val;
mutex_unlock(&twl6040->io_mutex);

return ret;
Expand Down Expand Up @@ -433,6 +444,18 @@ unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
}
EXPORT_SYMBOL(twl6040_get_sysclk);

/* Get the combined status of the vibra control register */
int twl6040_get_vibralr_status(struct twl6040 *twl6040)
{
u8 status;

status = twl6040->vibra_ctrl_cache[0] | twl6040->vibra_ctrl_cache[1];
status &= (TWL6040_VIBENA | TWL6040_VIBSEL);

return status;
}
EXPORT_SYMBOL(twl6040_get_vibralr_status);

static struct resource twl6040_vibra_rsrc[] = {
{
.flags = IORESOURCE_IRQ,
Expand Down
27 changes: 27 additions & 0 deletions drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,18 @@ static struct mfd_cell wm8994_devs[] = {
* and should be handled via the standard regulator API supply
* management.
*/
static const char *wm1811_main_supplies[] = {
"DBVDD1",
"DBVDD2",
"DBVDD3",
"DCVDD",
"AVDD1",
"AVDD2",
"CPVDD",
"SPKVDD1",
"SPKVDD2",
};

static const char *wm8994_main_supplies[] = {
"DBVDD",
"DCVDD",
Expand Down Expand Up @@ -401,6 +413,9 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
}

switch (wm8994->type) {
case WM1811:
wm8994->num_supplies = ARRAY_SIZE(wm1811_main_supplies);
break;
case WM8994:
wm8994->num_supplies = ARRAY_SIZE(wm8994_main_supplies);
break;
Expand All @@ -421,6 +436,10 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
}

switch (wm8994->type) {
case WM1811:
for (i = 0; i < ARRAY_SIZE(wm1811_main_supplies); i++)
wm8994->supplies[i].supply = wm1811_main_supplies[i];
break;
case WM8994:
for (i = 0; i < ARRAY_SIZE(wm8994_main_supplies); i++)
wm8994->supplies[i].supply = wm8994_main_supplies[i];
Expand Down Expand Up @@ -454,6 +473,13 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
goto err_enable;
}
switch (ret) {
case 0x1811:
devname = "WM1811";
if (wm8994->type != WM1811)
dev_warn(wm8994->dev, "Device registered as type %d\n",
wm8994->type);
wm8994->type = WM1811;
break;
case 0x8994:
devname = "WM8994";
if (wm8994->type != WM8994)
Expand Down Expand Up @@ -651,6 +677,7 @@ static int wm8994_i2c_remove(struct i2c_client *i2c)
}

static const struct i2c_device_id wm8994_i2c_id[] = {
{ "wm1811", WM1811 },
{ "wm8994", WM8994 },
{ "wm8958", WM8958 },
{ }
Expand Down
9 changes: 7 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,13 +1599,18 @@ static void regulator_disable_work(struct work_struct *work)
int regulator_disable_deferred(struct regulator *regulator, int ms)
{
struct regulator_dev *rdev = regulator->rdev;
int ret;

mutex_lock(&rdev->mutex);
rdev->deferred_disables++;
mutex_unlock(&rdev->mutex);

return schedule_delayed_work(&rdev->disable_work,
msecs_to_jiffies(ms));
ret = schedule_delayed_work(&rdev->disable_work,
msecs_to_jiffies(ms));
if (ret < 0)
return ret;
else
return 0;
}
EXPORT_SYMBOL_GPL(regulator_disable_deferred);

Expand Down
13 changes: 13 additions & 0 deletions drivers/regulator/wm8994-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev,
return (selector * 100000) + 900000;
case WM8958:
return (selector * 100000) + 1000000;
case WM1811:
switch (selector) {
case 0:
return -EINVAL;
default:
return (selector * 100000) + 950000;
}
break;
default:
return -EINVAL;
}
Expand Down Expand Up @@ -170,6 +178,11 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev,
case WM8958:
selector = (min_uV - 1000000) / 100000;
break;
case WM1811:
selector = (min_uV - 950000) / 100000;
if (selector == 0)
selector = 1;
break;
default:
return -EINVAL;
}
Expand Down
Loading

0 comments on commit bb14eb0

Please sign in to comment.