Skip to content

Commit

Permalink
Merge branch 'reg-cache' into for-2.6.32
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Aug 7, 2009
2 parents b9b5cc2 + 27ded04 commit 06cddef
Show file tree
Hide file tree
Showing 19 changed files with 1,114 additions and 1,785 deletions.
11 changes: 10 additions & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,20 @@ typedef int (*hw_read_t)(void *,char* ,int);

extern struct snd_ac97_bus_ops soc_ac97_ops;

enum snd_soc_control_type {
SND_SOC_CUSTOM,
SND_SOC_I2C,
SND_SOC_SPI,
};

int snd_soc_register_platform(struct snd_soc_platform *platform);
void snd_soc_unregister_platform(struct snd_soc_platform *platform);
int snd_soc_register_codec(struct snd_soc_codec *codec);
void snd_soc_unregister_codec(struct snd_soc_codec *codec);
int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
int addr_bits, int data_bits,
enum snd_soc_control_type control);

#ifdef CONFIG_PM
int snd_soc_suspend_device(struct device *dev);
Expand Down Expand Up @@ -387,7 +396,7 @@ struct snd_soc_codec {
int (*volatile_register)(unsigned int);
int (*readable_register)(unsigned int);
hw_write_t hw_write;
hw_read_t hw_read;
unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
void *reg_cache;
short reg_cache_size;
short reg_cache_step;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o
snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o

obj-$(CONFIG_SND_SOC) += snd-soc-core.o
obj-$(CONFIG_SND_SOC) += codecs/
Expand Down
11 changes: 2 additions & 9 deletions sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg,
u8 *value)
{
*value = reg & 0xff;
if (codec->hw_read(codec->control_data, value, 1) != 1)
return -EIO;

value[0] = i2c_smbus_read_byte_data(codec->control_data, value[0]);

aic3x_write_reg_cache(codec, reg, *value);
return 0;
Expand Down Expand Up @@ -1325,12 +1325,6 @@ static struct i2c_driver aic3x_i2c_driver = {
.id_table = aic3x_i2c_id,
};

static int aic3x_i2c_read(struct i2c_client *client, u8 *value, int len)
{
value[0] = i2c_smbus_read_byte_data(client, value[0]);
return (len == 1);
}

static int aic3x_add_i2c_device(struct platform_device *pdev,
const struct aic3x_setup_data *setup)
{
Expand Down Expand Up @@ -1403,7 +1397,6 @@ static int aic3x_probe(struct platform_device *pdev)
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
if (setup->i2c_address) {
codec->hw_write = (hw_write_t) i2c_master_send;
codec->hw_read = (hw_read_t) aic3x_i2c_read;
ret = aic3x_add_i2c_device(pdev, setup);
}
#else
Expand Down
Loading

0 comments on commit 06cddef

Please sign in to comment.