Update of /cvsroot/alsa/alsa-kernel/pci/ice1712
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28876

Modified Files:
        aureon.c 
Log Message:
added headphone amplifier switch.
initial patch by Radoslaw "AstralStorm" Szkodzinski.


Index: aureon.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ice1712/aureon.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- aureon.c    7 May 2004 10:18:59 -0000       1.6
+++ aureon.c    14 May 2004 10:49:26 -0000      1.7
@@ -291,6 +291,57 @@
 }
 
 /*
+ * Taken from prodigy.c
+ */
+static int aureon_set_headphone_amp(ice1712_t *ice, int enable)
+{
+       unsigned int tmp, tmp2;
+
+       tmp2 = tmp = snd_ice1712_gpio_read(ice);
+       if (enable)
+               tmp |= AUREON_HP_SEL;
+       else
+               tmp &= ~ AUREON_HP_SEL;
+       if (tmp != tmp2) {
+               snd_ice1712_gpio_write(ice, tmp);
+               return 1;
+       }
+       return 0;
+}
+
+static int aureon_get_headphone_amp(ice1712_t *ice)
+{
+       unsigned int tmp = snd_ice1712_gpio_read(ice);
+
+       return ( tmp & AUREON_HP_SEL )!= 0;
+}
+
+static int aureon_hpamp_info(snd_kcontrol_t *k, snd_ctl_elem_info_t *uinfo)
+{
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
+       uinfo->count = 1;
+       uinfo->value.integer.min = 0;
+       uinfo->value.integer.max = 1;
+       return 0;
+}
+
+static int aureon_hpamp_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+       ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+       ucontrol->value.integer.value[0] = aureon_get_headphone_amp(ice);
+       return 0;
+}
+
+
+static int aureon_hpamp_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
+{
+       ice1712_t *ice = snd_kcontrol_chip(kcontrol);
+
+       return aureon_set_headphone_amp(ice,ucontrol->value.integer.value[0]);
+}
+
+/*
  * mixers
  */
 
@@ -336,6 +387,13 @@
                .get = wm_adc_mux_get,
                .put = wm_adc_mux_put,
        },
+       {
+               .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+               .name = "Headphone Amplifier Switch",
+               .info = aureon_hpamp_info,
+               .get = aureon_hpamp_get,
+               .put = aureon_hpamp_put
+       },
 };
 
 



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to