Hello Radoslaw,
Simply add the following lines (shamelessly copied from prodigy.c) to your aureon.c


*****cut_here*****
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)
{
        static char *texts[2] = {
                "Off", "On"
        };

        uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
        uinfo->count = 1;
        uinfo->value.enumerated.items = 2;

if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1
;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]
);


        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]);
}
*****cut_here*****


and modify the wm_controls __devinitdata to include:

*****cut_here*****
{
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name =  "Headphone Amplifier",
        .info =  aureon_hpamp_info,
        .get =   aureon_hpamp_get,
        .put =   aureon_hpamp_put
}
*****cut_here*****

Seems like currently not every function of the WM8770 codec is implemented in the driver; see the datasheet (http://www.wolfsonmicro.com/uploads/documents/WM8770.pdf) for further information. For instance the standard driver does not support ADC-Muting - adding this feature took me only a few minutes.

Regards,
Christoph Haderer


------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ Alsa-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to