vserver 1.9.5.x5
[linux-2.6.git] / sound / ppc / daca.c
index 6629b6b..f24a916 100644 (file)
@@ -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 */