aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_si3054.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_si3054.c')
-rw-r--r--sound/pci/hda/patch_si3054.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c
index 6d2ecc38905c..2a4b9609aa5c 100644
--- a/sound/pci/hda/patch_si3054.c
+++ b/sound/pci/hda/patch_si3054.c
@@ -78,6 +78,8 @@
78/* si3054 codec registers (nodes) access macros */ 78/* si3054 codec registers (nodes) access macros */
79#define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0)) 79#define GET_REG(codec,reg) (snd_hda_codec_read(codec,reg,0,SI3054_VERB_READ_NODE,0))
80#define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val)) 80#define SET_REG(codec,reg,val) (snd_hda_codec_write(codec,reg,0,SI3054_VERB_WRITE_NODE,val))
81#define SET_REG_CACHE(codec,reg,val) \
82 snd_hda_codec_write_cache(codec,reg,0,SI3054_VERB_WRITE_NODE,val)
81 83
82 84
83struct si3054_spec { 85struct si3054_spec {
@@ -94,15 +96,7 @@ struct si3054_spec {
94#define PRIVATE_REG(val) ((val>>16)&0xffff) 96#define PRIVATE_REG(val) ((val>>16)&0xffff)
95#define PRIVATE_MASK(val) (val&0xffff) 97#define PRIVATE_MASK(val) (val&0xffff)
96 98
97static int si3054_switch_info(struct snd_kcontrol *kcontrol, 99#define si3054_switch_info snd_ctl_boolean_mono_info
98 struct snd_ctl_elem_info *uinfo)
99{
100 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
101 uinfo->count = 1;
102 uinfo->value.integer.min = 0;
103 uinfo->value.integer.max = 1;
104 return 0;
105}
106 100
107static int si3054_switch_get(struct snd_kcontrol *kcontrol, 101static int si3054_switch_get(struct snd_kcontrol *kcontrol,
108 struct snd_ctl_elem_value *uvalue) 102 struct snd_ctl_elem_value *uvalue)
@@ -121,9 +115,9 @@ static int si3054_switch_put(struct snd_kcontrol *kcontrol,
121 u16 reg = PRIVATE_REG(kcontrol->private_value); 115 u16 reg = PRIVATE_REG(kcontrol->private_value);
122 u16 mask = PRIVATE_MASK(kcontrol->private_value); 116 u16 mask = PRIVATE_MASK(kcontrol->private_value);
123 if (uvalue->value.integer.value[0]) 117 if (uvalue->value.integer.value[0])
124 SET_REG(codec, reg, (GET_REG(codec, reg)) | mask); 118 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) | mask);
125 else 119 else
126 SET_REG(codec, reg, (GET_REG(codec, reg)) & ~mask); 120 SET_REG_CACHE(codec, reg, (GET_REG(codec, reg)) & ~mask);
127 return 0; 121 return 0;
128} 122}
129 123
@@ -275,10 +269,6 @@ static struct hda_codec_ops si3054_patch_ops = {
275 .build_pcms = si3054_build_pcms, 269 .build_pcms = si3054_build_pcms,
276 .init = si3054_init, 270 .init = si3054_init,
277 .free = si3054_free, 271 .free = si3054_free,
278#ifdef CONFIG_PM
279 //.suspend = si3054_suspend,
280 .resume = si3054_init,
281#endif
282}; 272};
283 273
284static int patch_si3054(struct hda_codec *codec) 274static int patch_si3054(struct hda_codec *codec)