Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293227
b: refs/heads/master
c: 22f0d90
h: refs/heads/master
i:
  293225: 3bd059d
  293223: 8ce853c
v: v3
  • Loading branch information
Mark Brown committed Jan 23, 2012
1 parent 3c3d2c0 commit b35f9eb
Show file tree
Hide file tree
Showing 59 changed files with 2,991 additions and 2,827 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e8770dd878970140b7ef486ec0fe86d43eb50265
refs/heads/master: 22f0d90a34827812413bb3fbeda6a2a79bb58423
19 changes: 15 additions & 4 deletions trunk/arch/arm/mach-ep93xx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,23 @@ void __init ep93xx_register_i2s(void)
#define EP93XX_I2SCLKDIV_MASK (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \
EP93XX_SYSCON_I2SCLKDIV_SPOL)

int ep93xx_i2s_acquire(void)
int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
{
unsigned val;

ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_I2SONAC97,
EP93XX_SYSCON_DEVCFG_I2S_MASK);
/* Sanity check */
if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK)
return -EINVAL;
if (i2s_config & ~EP93XX_I2SCLKDIV_MASK)
return -EINVAL;

/* Must have only one of I2SONSSP/I2SONAC97 set */
if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) ==
(i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97))
return -EINVAL;

ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK);
ep93xx_devcfg_set_bits(i2s_pins);

/*
* This is potentially racy with the clock api for i2s_mclk, sclk and
Expand All @@ -832,7 +843,7 @@ int ep93xx_i2s_acquire(void)
*/
val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV);
val &= ~EP93XX_I2SCLKDIV_MASK;
val |= EP93XX_SYSCON_I2SCLKDIV_ORIDE | EP93XX_SYSCON_I2SCLKDIV_SPOL;
val |= i2s_config;
ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-ep93xx/include/mach/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);
int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
void ep93xx_keypad_release_gpio(struct platform_device *pdev);
void ep93xx_register_i2s(void);
int ep93xx_i2s_acquire(void);
int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config);
void ep93xx_i2s_release(void);
void ep93xx_register_ac97(void);

Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/mips/jz4740/board-qi_lb60.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,6 @@ static struct platform_device qi_lb60_charger_device = {
},
};

/* audio */
static struct platform_device qi_lb60_audio_device = {
.name = "qi-lb60-audio",
.id = -1,
};

static struct platform_device *jz_platform_devices[] __initdata = {
&jz4740_udc_device,
Expand All @@ -439,7 +434,6 @@ static struct platform_device *jz_platform_devices[] __initdata = {
&qi_lb60_gpio_keys,
&qi_lb60_pwm_beeper,
&qi_lb60_charger_device,
&qi_lb60_audio_device,
};

static void __init board_gpio_setup(void)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ struct regmap {
const void *reg_defaults_raw;
void *cache;
bool cache_dirty;

struct reg_default *patch;
int patch_regs;
};

struct regcache_ops {
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@ int regcache_sync(struct regmap *map)
map->cache_ops->name);
name = map->cache_ops->name;
trace_regcache_sync(map->dev, name, "start");

/* Apply any patch first */
for (i = 0; i < map->patch_regs; i++) {
ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def);
if (ret != 0) {
dev_err(map->dev, "Failed to write %x = %x: %d\n",
map->patch[i].reg, map->patch[i].def, ret);
goto out;
}
}

if (!map->cache_dirty)
goto out;
if (map->cache_ops->sync) {
Expand Down
58 changes: 58 additions & 0 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,64 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,
}
EXPORT_SYMBOL_GPL(regmap_update_bits_check);

/**
* regmap_register_patch: Register and apply register updates to be applied
* on device initialistion
*
* @map: Register map to apply updates to.
* @regs: Values to update.
* @num_regs: Number of entries in regs.
*
* Register a set of register updates to be applied to the device
* whenever the device registers are synchronised with the cache and
* apply them immediately. Typically this is used to apply
* corrections to be applied to the device defaults on startup, such
* as the updates some vendors provide to undocumented registers.
*/
int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
int num_regs)
{
int i, ret;
bool bypass;

/* If needed the implementation can be extended to support this */
if (map->patch)
return -EBUSY;

mutex_lock(&map->lock);

bypass = map->cache_bypass;

map->cache_bypass = true;

/* Write out first; it's useful to apply even if we fail later. */
for (i = 0; i < num_regs; i++) {
ret = _regmap_write(map, regs[i].reg, regs[i].def);
if (ret != 0) {
dev_err(map->dev, "Failed to write %x = %x: %d\n",
regs[i].reg, regs[i].def, ret);
goto out;
}
}

map->patch = kcalloc(sizeof(struct reg_default), num_regs, GFP_KERNEL);
if (map->patch != NULL) {
memcpy(map->patch, regs,
num_regs * sizeof(struct reg_default));
map->patch_regs = num_regs;
} else {
ret = -ENOMEM;
}

out:
map->cache_bypass = bypass;

mutex_unlock(&map->lock);

return ret;
}
EXPORT_SYMBOL_GPL(regmap_register_patch);

static int __init regmap_initcall(void)
{
regmap_debugfs_initcall();
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ void regcache_cache_only(struct regmap *map, bool enable);
void regcache_cache_bypass(struct regmap *map, bool enable);
void regcache_mark_dirty(struct regmap *map);

int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
int num_regs);

/**
* Description of an IRQ for the generic regmap irq_chip.
*
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ struct snd_soc_pcm_stream {
unsigned int rate_max; /* max rate */
unsigned int channels_min; /* min channels */
unsigned int channels_max; /* max channels */
unsigned int sig_bits; /* number of bits of content */
};

/* SoC audio ops */
Expand Down Expand Up @@ -560,7 +559,6 @@ struct snd_soc_codec {
unsigned int ac97_created:1; /* Codec has been created by SoC */
unsigned int sysfs_registered:1; /* codec has been sysfs registered */
unsigned int cache_init:1; /* codec cache has been initialized */
unsigned int using_regmap:1; /* using regmap access */
u32 cache_only; /* Suppress writes to hardware */
u32 cache_sync; /* Cache needs to be synced to hardware */

Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/atmel/atmel-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static struct snd_pcm_ops atmel_pcm_ops = {
/*--------------------------------------------------------------------------*\
* ASoC platform driver
\*--------------------------------------------------------------------------*/
static u64 atmel_pcm_dmamask = DMA_BIT_MASK(32);
static u64 atmel_pcm_dmamask = 0xffffffff;

static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
{
Expand All @@ -373,7 +373,7 @@ static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
if (!card->dev->dma_mask)
card->dev->dma_mask = &atmel_pcm_dmamask;
if (!card->dev->coherent_dma_mask)
card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
card->dev->coherent_dma_mask = 0xffffffff;

if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
ret = atmel_pcm_preallocate_dma_buffer(pcm,
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/soc/codecs/alc5623.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ static struct snd_soc_codec_driver soc_codec_device_alc5623 = {
* low = 0x1a
* high = 0x1b
*/
static __devinit int alc5623_i2c_probe(struct i2c_client *client,
static int alc5623_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct alc5623_platform_data *pdata;
Expand Down Expand Up @@ -1059,7 +1059,7 @@ static __devinit int alc5623_i2c_probe(struct i2c_client *client,
return ret;
}

static __devexit int alc5623_i2c_remove(struct i2c_client *client)
static int alc5623_i2c_remove(struct i2c_client *client)
{
snd_soc_unregister_codec(&client->dev);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/codecs/alc5632.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
return ret;
}

static __devexit int alc5632_i2c_remove(struct i2c_client *client)
static int alc5632_i2c_remove(struct i2c_client *client)
{
struct alc5632_priv *alc5632 = i2c_get_clientdata(client);
snd_soc_unregister_codec(&client->dev);
Expand Down
2 changes: 2 additions & 0 deletions trunk/sound/soc/codecs/cq93vc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include <sound/soc.h>
#include <sound/initval.h>

#include <mach/dm365.h>

static inline unsigned int cq93vc_read(struct snd_soc_codec *codec,
unsigned int reg)
{
Expand Down
36 changes: 15 additions & 21 deletions trunk/sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
};

/* routes for sgtl5000 */
static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
static const struct snd_soc_dapm_route audio_map[] = {
{"Capture Mux", "LINE_IN", "LINE_IN"}, /* line_in --> adc_mux */
{"Capture Mux", "MIC_IN", "MIC_IN"}, /* mic_in --> adc_mux */

Expand Down Expand Up @@ -987,12 +987,12 @@ static int sgtl5000_restore_regs(struct snd_soc_codec *codec)
/* restore regular registers */
for (reg = 0; reg <= SGTL5000_CHIP_SHORT_CTRL; reg += 2) {

/* These regs should restore in particular order */
/* this regs depends on the others */
if (reg == SGTL5000_CHIP_ANA_POWER ||
reg == SGTL5000_CHIP_CLK_CTRL ||
reg == SGTL5000_CHIP_LINREG_CTRL ||
reg == SGTL5000_CHIP_LINE_OUT_CTRL ||
reg == SGTL5000_CHIP_REF_CTRL)
reg == SGTL5000_CHIP_CLK_CTRL)
continue;

snd_soc_write(codec, reg, cache[reg]);
Expand All @@ -1003,17 +1003,8 @@ static int sgtl5000_restore_regs(struct snd_soc_codec *codec)
snd_soc_write(codec, reg, cache[reg]);

/*
* restore these regs according to the power setting sequence in
* sgtl5000_set_power_regs() and clock setting sequence in
* sgtl5000_set_clock().
*
* The order of restore is:
* 1. SGTL5000_CHIP_CLK_CTRL MCLK_FREQ bits (1:0) should be restore after
* SGTL5000_CHIP_ANA_POWER PLL bits set
* 2. SGTL5000_CHIP_LINREG_CTRL should be set before
* SGTL5000_CHIP_ANA_POWER LINREG_D restored
* 3. SGTL5000_CHIP_REF_CTRL controls Analog Ground Voltage,
* prefer to resotre it after SGTL5000_CHIP_ANA_POWER restored
* restore power and other regs according
* to set_power() and set_clock()
*/
snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL,
cache[SGTL5000_CHIP_LINREG_CTRL]);
Expand Down Expand Up @@ -1248,7 +1239,7 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
}

rev = (reg & SGTL5000_REVID_MASK) >> SGTL5000_REVID_SHIFT;
dev_info(codec->dev, "sgtl5000 revision 0x%x\n", rev);
dev_info(codec->dev, "sgtl5000 revision %d\n", rev);

/*
* workaround for revision 0x11 and later,
Expand Down Expand Up @@ -1353,6 +1344,15 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
if (ret)
goto err;

snd_soc_add_controls(codec, sgtl5000_snd_controls,
ARRAY_SIZE(sgtl5000_snd_controls));

snd_soc_dapm_new_controls(&codec->dapm, sgtl5000_dapm_widgets,
ARRAY_SIZE(sgtl5000_dapm_widgets));

snd_soc_dapm_add_routes(&codec->dapm, audio_map,
ARRAY_SIZE(audio_map));

snd_soc_dapm_new_widgets(&codec->dapm);

return 0;
Expand Down Expand Up @@ -1393,12 +1393,6 @@ static struct snd_soc_codec_driver sgtl5000_driver = {
.reg_cache_step = 2,
.reg_cache_default = sgtl5000_regs,
.volatile_register = sgtl5000_volatile_register,
.controls = sgtl5000_snd_controls,
.num_controls = ARRAY_SIZE(sgtl5000_snd_controls),
.dapm_widgets = sgtl5000_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(sgtl5000_dapm_widgets),
.dapm_routes = sgtl5000_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(sgtl5000_dapm_routes),
};

static __devinit int sgtl5000_i2c_probe(struct i2c_client *client,
Expand Down
Loading

0 comments on commit b35f9eb

Please sign in to comment.