Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ice1724 - aureon - modify WM8770 Master & DAC volume
  ALSA: hda/realtek: quirk for D945GCLF2 mainboard
  ALSA: hda - Terradici HDA controllers does not support 64-bit mode
  ALSA: document: Add direct git link to grub hda-analyzer
  ALSA: radio/sound/miro: fix build, cleanup depends/selects
  ALSA: hda - Generalize EAPD inversion check in patch_analog.c
  ASoC: Wrong variable returned on error
  ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII
  ALSA: hda - Exclude unusable ADCs for ALC88x
  ALSA: hda - Add missing Line-Out and PCM switches as slave
  ALSA: hda - iMac 9,1 sound patch.
  ALSA: opti93x: set MC indirect registers base from PnP data
  • Loading branch information
Linus Torvalds committed Dec 10, 2009
2 parents fa395aa + 8419488 commit 78f1ae1
Show file tree
Hide file tree
Showing 11 changed files with 248 additions and 90 deletions.
1 change: 1 addition & 0 deletions Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ ALC882/883/885/888/889
mb5 Macbook 5,1
mbp3 Macbook Pro rev3
imac24 iMac 24'' with jack detection
imac91 iMac 9,1
w2jc ASUS W2JC
3stack-2ch-dig 3-jack with SPDIF I/O (ALC883)
alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883)
Expand Down
6 changes: 4 additions & 2 deletions Documentation/sound/alsa/HD-Audio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,13 @@ hda-verb. The program gives you an easy-to-use GUI stuff for showing
the widget information and adjusting the amp values, as well as the
proc-compatible output.

The hda-analyzer is a part of alsa.git repository in
alsa-project.org:
The hda-analyzer:

- http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer

is a part of alsa.git repository in alsa-project.org:

- git://git.alsa-project.org/alsa.git

Codecgraph
~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/radio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ config RADIO_MAESTRO

config RADIO_MIROPCM20
tristate "miroSOUND PCM20 radio"
depends on ISA && VIDEO_V4L2
depends on ISA && VIDEO_V4L2 && SND
select SND_ISA
select SND_MIRO
---help---
Choose Y here if you have this FM radio card. You also need to enable
Expand Down
112 changes: 67 additions & 45 deletions sound/isa/opti9xx/opti92x-ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ struct snd_opti9xx {
unsigned long mc_base_size;
#ifdef OPTi93X
unsigned long mc_indir_index;
unsigned long mc_indir_size;
struct resource *res_mc_indir;
struct snd_wss *codec;
#endif /* OPTi93X */
unsigned long pwd_reg;
Expand Down Expand Up @@ -231,7 +233,10 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip,
case OPTi9XX_HW_82C931:
case OPTi9XX_HW_82C933:
chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d;
chip->mc_indir_index = 0xe0e;
if (!chip->mc_indir_index) {
chip->mc_indir_index = 0xe0e;
chip->mc_indir_size = 2;
}
chip->password = 0xe4;
chip->pwd_reg = 0;
break;
Expand Down Expand Up @@ -560,57 +565,69 @@ static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id)

#endif /* OPTi93X */

static int __devinit snd_card_opti9xx_detect(struct snd_card *card,
struct snd_opti9xx *chip)
static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip)
{
int i, err;
unsigned char value;
#ifdef OPTi93X
unsigned long flags;
#endif

chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size,
"OPTi9xx MC");
if (chip->res_mc_base == NULL)
return -EBUSY;
#ifndef OPTi93X
for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) {
unsigned char value;
value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(1));
if (value != 0xff && value != inb(chip->mc_base + OPTi9XX_MC_REG(1)))
if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
return 0;
#else /* OPTi93X */
chip->res_mc_indir = request_region(chip->mc_indir_index,
chip->mc_indir_size,
"OPTi93x MC");
if (chip->res_mc_indir == NULL)
return -EBUSY;

if ((err = snd_opti9xx_init(chip, i)) < 0)
return err;
spin_lock_irqsave(&chip->lock, flags);
outb(chip->password, chip->mc_base + chip->pwd_reg);
outb(((chip->mc_indir_index & 0x1f0) >> 4), chip->mc_base);
spin_unlock_irqrestore(&chip->lock, flags);

if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL)
continue;
value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(7));
snd_opti9xx_write(chip, OPTi9XX_MC_REG(7), 0xff - value);
if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value)
return 0;

value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(1));
if ((value != 0xff) && (value != inb(chip->mc_base + 1)))
if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
return 1;
release_and_free_resource(chip->res_mc_indir);
chip->res_mc_indir = NULL;
#endif /* OPTi93X */
release_and_free_resource(chip->res_mc_base);
chip->res_mc_base = NULL;

release_and_free_resource(chip->res_mc_base);
chip->res_mc_base = NULL;
return -ENODEV;
}

}
#else /* OPTi93X */
for (i = OPTi9XX_HW_82C931; i >= OPTi9XX_HW_82C930; i--) {
unsigned long flags;
unsigned char value;
static int __devinit snd_card_opti9xx_detect(struct snd_card *card,
struct snd_opti9xx *chip)
{
int i, err;

if ((err = snd_opti9xx_init(chip, i)) < 0)
#ifndef OPTi93X
for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) {
#else
for (i = OPTi9XX_HW_82C931; i >= OPTi9XX_HW_82C930; i--) {
#endif
err = snd_opti9xx_init(chip, i);
if (err < 0)
return err;

if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL)
continue;

spin_lock_irqsave(&chip->lock, flags);
outb(chip->password, chip->mc_base + chip->pwd_reg);
outb(((chip->mc_indir_index & (1 << 8)) >> 4) |
((chip->mc_indir_index & 0xf0) >> 4), chip->mc_base);
spin_unlock_irqrestore(&chip->lock, flags);

value = snd_opti9xx_read(chip, OPTi9XX_MC_REG(7));
snd_opti9xx_write(chip, OPTi9XX_MC_REG(7), 0xff - value);
if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value)
err = snd_opti9xx_read_check(chip);
if (err == 0)
return 1;

release_and_free_resource(chip->res_mc_base);
chip->res_mc_base = NULL;
#ifdef OPTi93X
chip->mc_indir_index = 0;
#endif
}
#endif /* OPTi93X */

return -ENODEV;
}

Expand Down Expand Up @@ -639,6 +656,8 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip,
#ifdef OPTi93X
port = pnp_port_start(pdev, 0) - 4;
fm_port = pnp_port_start(pdev, 1) + 8;
chip->mc_indir_index = pnp_port_start(pdev, 3) + 2;
chip->mc_indir_size = pnp_port_len(pdev, 3) - 2;
#else
if (pid->driver_data != 0x0924)
port = pnp_port_start(pdev, 1);
Expand Down Expand Up @@ -669,14 +688,15 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip,
static void snd_card_opti9xx_free(struct snd_card *card)
{
struct snd_opti9xx *chip = card->private_data;

if (chip) {
#ifdef OPTi93X
struct snd_wss *codec = chip->codec;
if (codec && codec->irq > 0) {
disable_irq(codec->irq);
free_irq(codec->irq, codec);
}
release_and_free_resource(chip->res_mc_indir);
#endif
release_and_free_resource(chip->res_mc_base);
}
Expand All @@ -696,11 +716,6 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
struct snd_rawmidi *rmidi;
struct snd_hwdep *synth;

if (! chip->res_mc_base &&
(chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size,
"OPTi9xx MC")) == NULL)
return -ENOMEM;

#if defined(CS4231) || defined(OPTi93X)
xdma2 = dma2;
#else
Expand Down Expand Up @@ -954,6 +969,13 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
}
if (hw <= OPTi9XX_HW_82C930)
chip->mc_base -= 0x80;

error = snd_opti9xx_read_check(chip);
if (error) {
snd_printk(KERN_ERR "OPTI chip not found\n");
snd_card_free(card);
return error;
}
snd_card_set_dev(card, &pcard->card->dev);
if ((error = snd_opti9xx_probe(card)) < 0) {
snd_card_free(card);
Expand Down
5 changes: 5 additions & 0 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
}
}

/* disable 64bit DMA address for Teradici */
/* it does not work with device 6549:1200 subsys e4a2:040b */
if (chip->driver_type == AZX_DRIVER_TERA)
gcap &= ~ICH6_GCAP_64OK;

/* allow 64bit DMA address if supported by H/W */
if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
Expand Down
17 changes: 9 additions & 8 deletions sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ struct ad198x_spec {
hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];

unsigned int jack_present :1;
unsigned int inv_jack_detect:1;
unsigned int inv_jack_detect:1; /* inverted jack-detection */
unsigned int inv_eapd:1; /* inverted EAPD implementation */

#ifdef CONFIG_SND_HDA_POWER_SAVE
struct hda_loopback_check loopback;
Expand Down Expand Up @@ -458,7 +459,7 @@ static struct hda_codec_ops ad198x_patch_ops = {

/*
* EAPD control
* the private value = nid | (invert << 8)
* the private value = nid
*/
#define ad198x_eapd_info snd_ctl_boolean_mono_info

Expand All @@ -467,8 +468,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *spec = codec->spec;
int invert = (kcontrol->private_value >> 8) & 1;
if (invert)
if (spec->inv_eapd)
ucontrol->value.integer.value[0] = ! spec->cur_eapd;
else
ucontrol->value.integer.value[0] = spec->cur_eapd;
Expand All @@ -480,11 +480,10 @@ static int ad198x_eapd_put(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *spec = codec->spec;
int invert = (kcontrol->private_value >> 8) & 1;
hda_nid_t nid = kcontrol->private_value & 0xff;
unsigned int eapd;
eapd = !!ucontrol->value.integer.value[0];
if (invert)
if (spec->inv_eapd)
eapd = !eapd;
if (eapd == spec->cur_eapd)
return 0;
Expand Down Expand Up @@ -705,7 +704,7 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
.info = ad198x_eapd_info,
.get = ad198x_eapd_get,
.put = ad198x_eapd_put,
.private_value = 0x1b | (1 << 8), /* port-D, inversed */
.private_value = 0x1b, /* port-D */
},
{ } /* end */
};
Expand Down Expand Up @@ -1074,6 +1073,7 @@ static int patch_ad1986a(struct hda_codec *codec)
spec->loopback.amplist = ad1986a_loopbacks;
#endif
spec->vmaster_nid = 0x1b;
spec->inv_eapd = 1; /* AD1986A has the inverted EAPD implementation */

codec->patch_ops = ad198x_patch_ops;

Expand Down Expand Up @@ -2124,7 +2124,7 @@ static struct snd_kcontrol_new ad1988_laptop_mixers[] = {
.info = ad198x_eapd_info,
.get = ad198x_eapd_get,
.put = ad198x_eapd_put,
.private_value = 0x12 | (1 << 8), /* port-D, inversed */
.private_value = 0x12, /* port-D */
},

{ } /* end */
Expand Down Expand Up @@ -3065,6 +3065,7 @@ static int patch_ad1988(struct hda_codec *codec)
spec->input_mux = &ad1988_laptop_capture_source;
spec->num_mixers = 1;
spec->mixers[0] = ad1988_laptop_mixers;
spec->inv_eapd = 1; /* inverted EAPD */
spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1988_laptop_init_verbs;
if (board_config == AD1988_LAPTOP_DIG)
Expand Down
Loading

0 comments on commit 78f1ae1

Please sign in to comment.