From: Jaime Lopez <jsollano@gmail.com>
To: alsa-devel@lists.sourceforge.net
Subject: Re: [PATCH] Add mixer controls to intel8x0m
Date: Tue, 22 Feb 2005 17:14:01 -0600 [thread overview]
Message-ID: <977226cd05022215142133ecc4@mail.gmail.com> (raw)
In-Reply-To: <977226cd05022215084074718@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 354 bytes --]
oops. forgot to include the diff:
On Tue, 22 Feb 2005 17:08:26 -0600, Jaime Lopez <jsollano@gmail.com> wrote:
> This patch adds a mixer switch to the intel8x0m driver, so that the
> hook state can be controlled from userspace, instead of bringing the
> line off hook on capture start. Please someone test, and merge into
> cvs. Comments are welcome
>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: intel8x0m.patch --]
[-- Type: text/x-patch; name="intel8x0m.patch", Size: 3444 bytes --]
Index: intel8x0m.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/intel8x0m.c,v
retrieving revision 1.28
diff -r1.28 intel8x0m.c
36a37
> #include <sound/core.h>
37a39
> #include <sound/control.h>
283a286,300
> static int snd_intel8x0m_switch_default_get(snd_kcontrol_t *kcontrol,
> snd_ctl_elem_value_t *ucontrol);
> static int snd_intel8x0m_switch_default_put(snd_kcontrol_t *kcontrol,
> snd_ctl_elem_value_t *ucontrol);
> static int snd_intel8x0m_switch_default_info(snd_kcontrol_t *kcontrol,
> snd_ctl_elem_info_t *uinfo);
>
> static snd_kcontrol_new_t snd_intel8x0m_mixer_switches[] __devinitdata = {
> { .name = "Off-hook Switch",
> .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
> .info = snd_intel8x0m_switch_default_info,
> .get = snd_intel8x0m_switch_default_get,
> .put = snd_intel8x0m_switch_default_put
> }
> };
286a304,339
> static int snd_intel8x0m_switch_default_info(snd_kcontrol_t *kcontrol,
> 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 snd_intel8x0m_switch_default_get(snd_kcontrol_t *kcontrol,
> snd_ctl_elem_value_t *ucontrol)
> {
> intel8x0_t *chip = snd_kcontrol_chip(kcontrol);
> unsigned int status;
> spin_lock_irq(&chip->reg_lock);
> status = snd_ac97_read(chip->ac97,AC97_GPIO_STATUS)&AC97_GPIO_LINE1_OH?1:0;
> spin_unlock_irq(&chip->reg_lock);
> ucontrol->value.integer.value[0] = status;
> return 0;
> }
> static int snd_intel8x0m_switch_default_put(snd_kcontrol_t *kcontrol,
> snd_ctl_elem_value_t *ucontrol)
> {
> intel8x0_t *chip = snd_kcontrol_chip(kcontrol);
> unsigned short new_status = ucontrol->value.integer.value[0]?AC97_GPIO_LINE1_OH:~AC97_GPIO_LINE1_OH;
> int ret;
> //unsigned short status = snd_ac97_read(chip->ac97,AC97_GPIO_STATUS)&AC97_GPIO_LINE1_OH;
> spin_lock_irq(&chip->reg_lock);
> snd_printk("Writing status: %04x\n",new_status);
> ret = snd_ac97_update_bits(chip->ac97,AC97_GPIO_STATUS,
> AC97_GPIO_LINE1_OH, new_status);
> spin_unlock_irq(&chip->reg_lock);
> return ret;
> //return 0;
> }
544a598
> unsigned int ring = 0;
566a621,624
>
> //status = igetdword(chip,ICHREG(GLOB_STA));
> //ring = ((status=snd_ac97_read(chip->ac97,AC97_GPIO_STATUS))&(1<<5))?1:0;
> //if(status != 0xffff) snd_printk("s: %08x\n",status);
640a699
> unsigned short regv;
646,647c705,707
< snd_ac97_update_bits(ichdev->ac97, AC97_GPIO_STATUS,
< AC97_GPIO_LINE1_OH, AC97_GPIO_LINE1_OH);
---
> //snd_ac97_update_bits(ichdev->ac97, AC97_GPIO_STATUS,
> // AC97_GPIO_LINE1_OH, AC97_GPIO_LINE1_OH);
> //snd_ac97_update_bits(ichdev->ac97,AC97_GPIO_STATUS,0x40,0x40);
650,651c710,712
< snd_ac97_update_bits(ichdev->ac97, AC97_GPIO_STATUS,
< AC97_GPIO_LINE1_OH, ~AC97_GPIO_LINE1_OH);
---
> //snd_ac97_update_bits(ichdev->ac97, AC97_GPIO_STATUS,
> // AC97_GPIO_LINE1_OH, ~AC97_GPIO_LINE1_OH);
> //snd_ac97_update_bits(ichdev->ac97,AC97_GPIO_STATUS,0x40,~0x40);
892a954
> unsigned int idx;
927a990,993
> for(idx = 0; idx < ARRAY_SIZE(snd_intel8x0m_mixer_switches); idx++) {
> if((err = snd_ctl_add(chip->card,snd_ctl_new1(&snd_intel8x0m_mixer_switches[idx],chip))) <0 )
> goto __err;
> }
next prev parent reply other threads:[~2005-02-22 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-22 23:08 [PATCH] Add mixer controls to intel8x0m Jaime Lopez
2005-02-22 23:14 ` Jaime Lopez [this message]
2005-02-23 10:20 ` Takashi Iwai
2005-02-23 15:41 ` Jaime Lopez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=977226cd05022215142133ecc4@mail.gmail.com \
--to=jsollano@gmail.com \
--cc=alsa-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox