X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fppc%2Fdaca.c;h=46eebf5610e39386cd3fc72eb40ccba456380d80;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=f24a91693616f622925988adcf23f970651537e6;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index f24a91693..46eebf561 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -40,18 +39,18 @@ #define DACA_VOL_MAX 0x38 -typedef struct pmac_daca_t { - pmac_keywest_t i2c; +struct pmac_daca { + struct pmac_keywest i2c; int left_vol, right_vol; unsigned int deemphasis : 1; unsigned int amp_on : 1; -} pmac_daca_t; +}; /* * initialize / detect DACA */ -static int daca_init_client(pmac_keywest_t *i2c) +static int daca_init_client(struct pmac_keywest *i2c) { unsigned short wdata = 0x00; /* SR: no swap, 1bit delay, 32-48kHz */ @@ -66,7 +65,7 @@ static int daca_init_client(pmac_keywest_t *i2c) /* * update volume */ -static int daca_set_volume(pmac_daca_t *mix) +static int daca_set_volume(struct pmac_daca *mix) { unsigned char data[2]; @@ -92,7 +91,8 @@ static int daca_set_volume(pmac_daca_t *mix) /* deemphasis switch */ -static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int daca_info_deemphasis(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -101,20 +101,22 @@ static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u return 0; } -static int daca_get_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_get_deemphasis(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; if (! (mix = chip->mixer_data)) return -ENODEV; ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0; return 0; } -static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_put_deemphasis(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; int change; if (! (mix = chip->mixer_data)) @@ -128,7 +130,8 @@ static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u } /* output volume */ -static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int daca_info_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -137,10 +140,11 @@ static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo return 0; } -static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_get_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; if (! (mix = chip->mixer_data)) return -ENODEV; ucontrol->value.integer.value[0] = mix->left_vol; @@ -148,10 +152,11 @@ static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont return 0; } -static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_put_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; int change; if (! (mix = chip->mixer_data)) @@ -169,20 +174,22 @@ static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont /* amplifier switch */ #define daca_info_amp daca_info_deemphasis -static int daca_get_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_get_amp(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; if (! (mix = chip->mixer_data)) return -ENODEV; ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0; return 0; } -static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int daca_put_amp(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - pmac_t *chip = snd_kcontrol_chip(kcontrol); - pmac_daca_t *mix; + struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); + struct pmac_daca *mix; int change; if (! (mix = chip->mixer_data)) @@ -196,7 +203,7 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol return change; } -static snd_kcontrol_new_t daca_mixers[] = { +static struct snd_kcontrol_new daca_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Deemphasis Switch", .info = daca_info_deemphasis, @@ -218,21 +225,21 @@ static snd_kcontrol_new_t daca_mixers[] = { }; -#ifdef CONFIG_PMAC_PBOOK -static void daca_resume(pmac_t *chip) +#ifdef CONFIG_PM +static void daca_resume(struct snd_pmac *chip) { - pmac_daca_t *mix = chip->mixer_data; + struct pmac_daca *mix = chip->mixer_data; 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 */ +#endif /* CONFIG_PM */ -static void daca_cleanup(pmac_t *chip) +static void daca_cleanup(struct snd_pmac *chip) { - pmac_daca_t *mix = chip->mixer_data; + struct pmac_daca *mix = chip->mixer_data; if (! mix) return; snd_pmac_keywest_cleanup(&mix->i2c); @@ -241,14 +248,14 @@ static void daca_cleanup(pmac_t *chip) } /* exported */ -int __init snd_pmac_daca_init(pmac_t *chip) +int __init snd_pmac_daca_init(struct snd_pmac *chip) { int i, err; - pmac_daca_t *mix; + struct pmac_daca *mix; #ifdef CONFIG_KMOD if (current->fs->root) - request_module("i2c-keywest"); + request_module("i2c-powermac"); #endif /* CONFIG_KMOD */ mix = kmalloc(sizeof(*mix), GFP_KERNEL); @@ -275,7 +282,7 @@ int __init snd_pmac_daca_init(pmac_t *chip) return err; } -#ifdef CONFIG_PMAC_PBOOK +#ifdef CONFIG_PM chip->resume = daca_resume; #endif