]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/hda/patch_si3054.c
[ARM] S3C24XX: Fix redefine of DEFINE_TIMER() in s3c24xx pwm-clock.c
[linux-2.6-omap-h63xx.git] / sound / pci / hda / patch_si3054.c
index 6d2ecc38905cebf17e34db6e7081135f1b215df8..9332b63e406cc963dfab355011b254493808db2f 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <sound/core.h>
 #include "hda_codec.h"
 #include "hda_local.h"
-
+#include "hda_patch.h"
 
 /* si3054 verbs */
 #define SI3054_VERB_READ_NODE  0x900
@@ -78,6 +77,8 @@
 /* si3054 codec registers (nodes) access macros */
 #define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0))
 #define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val))
+#define SET_REG_CACHE(codec,reg,val) \
+       snd_hda_codec_write_cache(codec,reg,0,SI3054_VERB_WRITE_NODE,val)
 
 
 struct si3054_spec {
@@ -94,15 +95,7 @@ struct si3054_spec {
 #define PRIVATE_REG(val) ((val>>16)&0xffff)
 #define PRIVATE_MASK(val) (val&0xffff)
 
-static int si3054_switch_info(struct snd_kcontrol *kcontrol,
-                              struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 1;
-       return 0;
-}
+#define si3054_switch_info     snd_ctl_boolean_mono_info
 
 static int si3054_switch_get(struct snd_kcontrol *kcontrol,
                               struct snd_ctl_elem_value *uvalue)
@@ -121,9 +114,9 @@ static int si3054_switch_put(struct snd_kcontrol *kcontrol,
        u16 reg  = PRIVATE_REG(kcontrol->private_value);
        u16 mask = PRIVATE_MASK(kcontrol->private_value);
        if (uvalue->value.integer.value[0])
-               SET_REG(codec, reg, (GET_REG(codec, reg)) | mask);
+               SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) | mask);
        else
-               SET_REG(codec, reg, (GET_REG(codec, reg)) & ~mask);
+               SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) & ~mask);
        return 0;
 }
 
@@ -213,7 +206,7 @@ static int si3054_build_pcms(struct hda_codec *codec)
        info->name = "Si3054 Modem";
        info->stream[SNDRV_PCM_STREAM_PLAYBACK] = si3054_pcm;
        info->stream[SNDRV_PCM_STREAM_CAPTURE]  = si3054_pcm;
-       info->is_modem = 1;
+       info->pcm_type = HDA_PCM_TYPE_MODEM;
        return 0;
 }
 
@@ -275,10 +268,6 @@ static struct hda_codec_ops si3054_patch_ops = {
        .build_pcms = si3054_build_pcms,
        .init = si3054_init,
        .free = si3054_free,
-#ifdef CONFIG_PM
-       //.suspend = si3054_suspend,
-       .resume = si3054_init,
-#endif
 };
 
 static int patch_si3054(struct hda_codec *codec)
@@ -297,7 +286,6 @@ static int patch_si3054(struct hda_codec *codec)
 struct hda_codec_preset snd_hda_preset_si3054[] = {
        { .id = 0x163c3055, .name = "Si3054", .patch = patch_si3054 },
        { .id = 0x163c3155, .name = "Si3054", .patch = patch_si3054 },
-       { .id = 0x11c11040, .name = "Si3054", .patch = patch_si3054 },
        { .id = 0x11c13026, .name = "Si3054", .patch = patch_si3054 },
        { .id = 0x11c13055, .name = "Si3054", .patch = patch_si3054 },
        { .id = 0x11c13155, .name = "Si3054", .patch = patch_si3054 },