X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fsoc%2Fcodecs%2Ftlv320aic23.c;h=44308dac9e18de9d268ccea819f5376c1ec24a92;hb=4aa02396f934b355a4002ea9bc524aa42d6b53d6;hp=bac7815e00fb4689241067527bf09dca3e2cfb8f;hpb=a7e54e6de3b01d9085202fdbf0110da425f4af38;p=linux-2.6-omap-h63xx.git diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index bac7815e00f..44308dac9e1 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c @@ -84,7 +84,7 @@ static int tlv320aic23_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { - u8 data; + u8 data[2]; /* TLV320AIC23 has 7 bit address and 9 bits of data * so we need to switch one data bit into reg and rest @@ -96,12 +96,12 @@ static int tlv320aic23_write(struct snd_soc_codec *codec, unsigned int reg, return -1; } - data = (reg << 1) | (value >> 8 & 0x01); + data[0] = (reg << 1) | (value >> 8 & 0x01); + data[1] = value & 0xff; tlv320aic23_write_reg_cache(codec, reg, value); - if (codec->hw_write(codec->control_data, data, - (value & 0xff)) == 0) + if (codec->hw_write(codec->control_data, data, 2) == 2) return 0; printk(KERN_ERR "%s cannot write %03x to register R%d\n", __func__, @@ -674,7 +674,7 @@ static int tlv320aic23_probe(struct platform_device *pdev) tlv320aic23_socdev = socdev; #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - codec->hw_write = (hw_write_t) i2c_smbus_write_byte_data; + codec->hw_write = (hw_write_t) i2c_master_send; codec->hw_read = NULL; ret = i2c_add_driver(&tlv320aic23_i2c_driver); if (ret != 0)