aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-12 19:32:57 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-12 19:32:57 -0800
commitdbda961be73329e4fc4b1dbc7335ddb70a625c5d (patch)
treec6f4aae48ddac66b977c09f0be552ab37b2f54b3 /sound
parent717abc98fe8ba4fcb2c02eb1609c6a68fe7d9c4f (diff)
parent95e475c924efd3b429df1ca3af2accf8eeac90cf (diff)
downloadhistory-dbda961be73329e4fc4b1dbc7335ddb70a625c5d.tar.gz
Merge bk://kernel.bkbits.net/gregkh/linux/i2c-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'sound')
-rw-r--r--sound/ppc/daca.c24
-rw-r--r--sound/ppc/pmac.h2
-rw-r--r--sound/ppc/tumbler.c41
3 files changed, 36 insertions, 31 deletions
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index 6629b6bde12ef7..f24a91693616f6 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 */
diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h
index 9521a4106dc854..7b14906cef0e00 100644
--- a/sound/ppc/pmac.h
+++ b/sound/ppc/pmac.h
@@ -199,8 +199,6 @@ typedef struct snd_pmac_keywest {
int snd_pmac_keywest_init(pmac_keywest_t *i2c);
void snd_pmac_keywest_cleanup(pmac_keywest_t *i2c);
-#define snd_pmac_keywest_write(i2c,cmd,len,data) i2c_smbus_write_block_data((i2c)->client, cmd, len, data)
-#define snd_pmac_keywest_write_byte(i2c,cmd,data) i2c_smbus_write_byte_data((i2c)->client, cmd, data)
/* misc */
int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo);
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 8d985b0345070b..7d10385f0a7611 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -109,7 +109,8 @@ static int send_init_client(pmac_keywest_t *i2c, unsigned int *regs)
while (*regs > 0) {
int err, count = 10;
do {
- err = snd_pmac_keywest_write_byte(i2c, regs[0], regs[1]);
+ err = i2c_smbus_write_byte_data(i2c->client,
+ regs[0], regs[1]);
if (err >= 0)
break;
mdelay(10);
@@ -220,9 +221,10 @@ static int tumbler_set_master_volume(pmac_tumbler_t *mix)
block[4] = (right_vol >> 8) & 0xff;
block[5] = (right_vol >> 0) & 0xff;
- if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_VOL, 6, block) < 0) {
- snd_printk("failed to set volume \n");
- return -EINVAL;
+ if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL,
+ 6, block) < 0) {
+ snd_printk("failed to set volume \n");
+ return -EINVAL;
}
return 0;
}
@@ -320,9 +322,10 @@ static int tumbler_set_drc(pmac_tumbler_t *mix)
val[1] = 0;
}
- if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_DRC, 2, val) < 0) {
- snd_printk("failed to set DRC\n");
- return -EINVAL;
+ if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
+ 2, val) < 0) {
+ snd_printk("failed to set DRC\n");
+ return -EINVAL;
}
return 0;
}
@@ -355,9 +358,10 @@ static int snapper_set_drc(pmac_tumbler_t *mix)
val[4] = 0x60;
val[5] = 0xa0;
- if (snd_pmac_keywest_write(&mix->i2c, TAS_REG_DRC, 6, val) < 0) {
- snd_printk("failed to set DRC\n");
- return -EINVAL;
+ if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
+ 6, val) < 0) {
+ snd_printk("failed to set DRC\n");
+ return -EINVAL;
}
return 0;
}
@@ -459,9 +463,10 @@ static int tumbler_set_mono_volume(pmac_tumbler_t *mix, struct tumbler_mono_vol
vol = info->table[vol];
for (i = 0; i < info->bytes; i++)
block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff;
- if (snd_pmac_keywest_write(&mix->i2c, info->reg, info->bytes, block) < 0) {
- snd_printk("failed to set mono volume %d\n", info->index);
- return -EINVAL;
+ if (i2c_smbus_write_block_data(mix->i2c.client, info->reg,
+ info->bytes, block) < 0) {
+ snd_printk("failed to set mono volume %d\n", info->index);
+ return -EINVAL;
}
return 0;
}
@@ -588,9 +593,9 @@ static int snapper_set_mix_vol1(pmac_tumbler_t *mix, int idx, int ch, int reg)
for (j = 0; j < 3; j++)
block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff;
}
- if (snd_pmac_keywest_write(&mix->i2c, reg, 9, block) < 0) {
- snd_printk("failed to set mono volume %d\n", reg);
- return -EINVAL;
+ if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) {
+ snd_printk("failed to set mono volume %d\n", reg);
+ return -EINVAL;
}
return 0;
}
@@ -689,8 +694,8 @@ static int snapper_set_capture_source(pmac_tumbler_t *mix)
{
if (! mix->i2c.client)
return -ENODEV;
- return snd_pmac_keywest_write_byte(&mix->i2c, TAS_REG_ACS,
- mix->capture_source ? 2 : 0);
+ return i2c_smbus_write_byte_data(mix->i2c.client, TAS_REG_ACS,
+ mix->capture_source ? 2 : 0);
}
static int snapper_info_capture_source(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)