]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - sound/ppc/daca.c
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
[linux-2.6.git] / sound / ppc / daca.c
index a737f298e77da31228d766e8676d65454590ee63..46eebf5610e39386cd3fc72eb40ccba456380d80 100644 (file)
@@ -22,7 +22,6 @@
 #include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
-#include <linux/i2c-dev.h>
 #include <linux/kmod.h>
 #include <linux/slab.h>
 #include <sound/core.h>
 #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,
@@ -219,9 +226,9 @@ static snd_kcontrol_new_t daca_mixers[] = {
 
 
 #ifdef CONFIG_PM
-static void daca_resume(pmac_t *chip)
+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);
@@ -230,9 +237,9 @@ static void daca_resume(pmac_t *chip)
 #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);