X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fppc%2Fdaca.c;h=f24a91693616f622925988adcf23f970651537e6;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=6629b6bde12ef7eac957a5ac1d2ad49494a77715;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index 6629b6bde..f24a91693 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -56,10 +56,11 @@ static int daca_init_client(pmac_keywest_t *i2c) unsigned short wdata = 0x00; /* SR: no swap, 1bit delay, 32-48kHz */ /* GCFG: power amp inverted, DAC on */ - if (snd_pmac_keywest_write_byte(i2c, DACA_REG_SR, 0x08) < 0 || - snd_pmac_keywest_write_byte(i2c, DACA_REG_GCFG, 0x05) < 0) + if (i2c_smbus_write_byte_data(i2c->client, DACA_REG_SR, 0x08) < 0 || + i2c_smbus_write_byte_data(i2c->client, DACA_REG_GCFG, 0x05) < 0) return -EINVAL; - return snd_pmac_keywest_write(i2c, DACA_REG_AVOL, 2, (unsigned char*)&wdata); + return i2c_smbus_write_block_data(i2c->client, DACA_REG_AVOL, + 2, (unsigned char*)&wdata); } /* @@ -81,9 +82,10 @@ static int daca_set_volume(pmac_daca_t *mix) else data[1] = mix->right_vol; data[1] |= mix->deemphasis ? 0x40 : 0; - if (snd_pmac_keywest_write(&mix->i2c, DACA_REG_AVOL, 2, data) < 0) { - snd_printk("failed to set volume \n"); - return -EINVAL; + if (i2c_smbus_write_block_data(mix->i2c.client, DACA_REG_AVOL, + 2, data) < 0) { + snd_printk("failed to set volume \n"); + return -EINVAL; } return 0; } @@ -188,8 +190,8 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol change = mix->amp_on != ucontrol->value.integer.value[0]; if (change) { mix->amp_on = ucontrol->value.integer.value[0]; - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_GCFG, - mix->amp_on ? 0x05 : 0x04); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, + mix->amp_on ? 0x05 : 0x04); } return change; } @@ -220,9 +222,9 @@ static snd_kcontrol_new_t daca_mixers[] = { static void daca_resume(pmac_t *chip) { pmac_daca_t *mix = chip->mixer_data; - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_SR, 0x08); - snd_pmac_keywest_write_byte(&mix->i2c, DACA_REG_GCFG, - mix->amp_on ? 0x05 : 0x04); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); + i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, + mix->amp_on ? 0x05 : 0x04); daca_set_volume(mix); } #endif /* CONFIG_PMAC_PBOOK */