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

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits)
  ALSA: hda - Fix jack-detection control of VT1708
  ALSA: hda - cut and paste typo in cs420x_models[]
  ALSA: hda/realtek - Minor cleanup
  ALSA: hda/realtek - Fix missing inits of item indices for auto-mic
  ALSA: hda - Fix invalid pin and GPIO for Apple laptops with CS codecs
  ALSA: hda - Check subdevice mask in snd_hda_check_board_codec_sid_config()
  ALSA: hda - fail ELD reading early
  ALSA: lx6464es - fix device communication via command bus
  ALSA: lx6464es - command buffer API cleanup
  ALSA: hda - repoll ELD content for multiple times
  ALSA: hdspm - Fix PCI ID for PCIe RME MADI cards
  ASoC: Ensure WM8731 register cache is synced when resuming from disabled
  ALSA: cs5535 - Fix an endianness conversion
  ASoC: cs4271: Fix wrong mask parameter in some snd_soc_update_bits calls
  ASoC: wm_hubs: fix DB_RANGE size
  ASoC: wm9090: fix DB_RANGE size
  ASoC: wm8993: fix DB_RANGE size
  ASoC: wm8962: fix DB_RANGE size
  ASoC: sgtl5000: fix DB_RANGE size
  ASoC: rt5631: fix DB_RANGE size
  ...
  • Loading branch information
Linus Torvalds committed Nov 28, 2011
2 parents c28800a + f339240 commit 3c512b1
Show file tree
Hide file tree
Showing 26 changed files with 229 additions and 103 deletions.
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5667,7 +5667,6 @@ F: drivers/media/video/*7146*
F: include/media/*7146*

SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassisinghbrar@gmail.com>
M: Sangbeom Kim <sbkim73@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs5535audio/cs5535audio_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
struct cs5535audio_dma_desc *desc =
&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
desc->addr = cpu_to_le32(addr);
desc->size = cpu_to_le32(period_bytes);
desc->size = cpu_to_le16(period_bytes);
desc->ctlreserved = cpu_to_le16(PRD_EOP);
desc_addr += sizeof(struct cs5535audio_dma_desc);
addr += period_bytes;
Expand Down
6 changes: 3 additions & 3 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,

/* Search for codec ID */
for (q = tbl; q->subvendor; q++) {
unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);

if (vendorid == codec->subsystem_id)
unsigned int mask = 0xffff0000 | q->subdevice_mask;
unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
if ((codec->subsystem_id & mask) == id)
break;
}

Expand Down
28 changes: 19 additions & 9 deletions sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,

for (i = 0; i < size; i++) {
unsigned int val = hdmi_get_eld_data(codec, nid, i);
/*
* Graphics driver might be writing to ELD buffer right now.
* Just abort. The caller will repoll after a while.
*/
if (!(val & AC_ELDD_ELD_VALID)) {
if (!i) {
snd_printd(KERN_INFO
"HDMI: invalid ELD data\n");
ret = -EINVAL;
goto error;
}
snd_printd(KERN_INFO
"HDMI: invalid ELD data byte %d\n", i);
val = 0;
} else
val &= AC_ELDD_ELD_DATA;
ret = -EINVAL;
goto error;
}
val &= AC_ELDD_ELD_DATA;
/*
* The first byte cannot be zero. This can happen on some DVI
* connections. Some Intel chips may also need some 250ms delay
* to return non-zero ELD data, even when the graphics driver
* correctly writes ELD content before setting ELD_valid bit.
*/
if (!val && !i) {
snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");
ret = -EINVAL;
goto error;
}
buf[i] = val;
}

Expand Down
32 changes: 23 additions & 9 deletions sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ struct cs_spec {
unsigned int gpio_mask;
unsigned int gpio_dir;
unsigned int gpio_data;
unsigned int gpio_eapd_hp; /* EAPD GPIO bit for headphones */
unsigned int gpio_eapd_speaker; /* EAPD GPIO bit for speakers */

struct hda_pcm pcm_rec[2]; /* PCM information */

Expand All @@ -76,6 +78,7 @@ enum {
CS420X_MBP53,
CS420X_MBP55,
CS420X_IMAC27,
CS420X_APPLE,
CS420X_AUTO,
CS420X_MODELS
};
Expand Down Expand Up @@ -928,10 +931,9 @@ static void cs_automute(struct hda_codec *codec)
spdif_present ? 0 : PIN_OUT);
}
}
if (spec->board_config == CS420X_MBP53 ||
spec->board_config == CS420X_MBP55 ||
spec->board_config == CS420X_IMAC27) {
unsigned int gpio = hp_present ? 0x02 : 0x08;
if (spec->gpio_eapd_hp) {
unsigned int gpio = hp_present ?
spec->gpio_eapd_hp : spec->gpio_eapd_speaker;
snd_hda_codec_write(codec, 0x01, 0,
AC_VERB_SET_GPIO_DATA, gpio);
}
Expand Down Expand Up @@ -1276,6 +1278,7 @@ static const char * const cs420x_models[CS420X_MODELS] = {
[CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27",
[CS420X_APPLE] = "apple",
[CS420X_AUTO] = "auto",
};

Expand All @@ -1285,7 +1288,13 @@ static const struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
/* this conflicts with too many other models */
/*SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),*/
{} /* terminator */
};

static const struct snd_pci_quirk cs420x_codec_cfg_tbl[] = {
SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
{} /* terminator */
};

Expand Down Expand Up @@ -1367,17 +1376,22 @@ static int patch_cs420x(struct hda_codec *codec)
spec->board_config =
snd_hda_check_board_config(codec, CS420X_MODELS,
cs420x_models, cs420x_cfg_tbl);
if (spec->board_config < 0)
spec->board_config =
snd_hda_check_board_codec_sid_config(codec,
CS420X_MODELS, NULL, cs420x_codec_cfg_tbl);
if (spec->board_config >= 0)
fix_pincfg(codec, spec->board_config, cs_pincfgs);

switch (spec->board_config) {
case CS420X_IMAC27:
case CS420X_MBP53:
case CS420X_MBP55:
/* GPIO1 = headphones */
/* GPIO3 = speakers */
spec->gpio_mask = 0x0a;
spec->gpio_dir = 0x0a;
case CS420X_APPLE:
spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */
spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */
spec->gpio_mask = spec->gpio_dir =
spec->gpio_eapd_hp | spec->gpio_eapd_speaker;
break;
}

Expand Down
16 changes: 10 additions & 6 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct hdmi_spec_per_pin {
struct hda_codec *codec;
struct hdmi_eld sink_eld;
struct delayed_work work;
int repoll_count;
};

struct hdmi_spec {
Expand Down Expand Up @@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx,
* Unsolicited events
*/

static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry);
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);

static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
{
Expand All @@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
if (pin_idx < 0)
return;

hdmi_present_sense(&spec->pins[pin_idx], true);
hdmi_present_sense(&spec->pins[pin_idx], 1);
}

static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
Expand Down Expand Up @@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
return 0;
}

static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)
static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
{
struct hda_codec *codec = per_pin->codec;
struct hdmi_eld *eld = &per_pin->sink_eld;
Expand Down Expand Up @@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry)
if (eld_valid) {
if (!snd_hdmi_get_eld(eld, codec, pin_nid))
snd_hdmi_show_eld(eld);
else if (retry) {
else if (repoll) {
queue_delayed_work(codec->bus->workq,
&per_pin->work,
msecs_to_jiffies(300));
Expand All @@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work)
struct hdmi_spec_per_pin *per_pin =
container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);

hdmi_present_sense(per_pin, false);
if (per_pin->repoll_count++ > 6)
per_pin->repoll_count = 0;

hdmi_present_sense(per_pin, per_pin->repoll_count);
}

static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
Expand Down Expand Up @@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx)
if (err < 0)
return err;

hdmi_present_sense(per_pin, false);
hdmi_present_sense(per_pin, 0);
return 0;
}

Expand Down
34 changes: 23 additions & 11 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ static bool alc_dyn_adc_pcm_resetup(struct hda_codec *codec, int cur)
return false;
}

static inline hda_nid_t get_capsrc(struct alc_spec *spec, int idx)
{
return spec->capsrc_nids ?
spec->capsrc_nids[idx] : spec->adc_nids[idx];
}

/* select the given imux item; either unmute exclusively or select the route */
static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
unsigned int idx, bool force)
Expand All @@ -303,8 +309,7 @@ static int alc_mux_select(struct hda_codec *codec, unsigned int adc_idx,
adc_idx = spec->dyn_adc_idx[idx];
}

nid = spec->capsrc_nids ?
spec->capsrc_nids[adc_idx] : spec->adc_nids[adc_idx];
nid = get_capsrc(spec, adc_idx);

/* no selection? */
num_conns = snd_hda_get_conn_list(codec, nid, NULL);
Expand Down Expand Up @@ -1054,8 +1059,19 @@ static bool alc_rebuild_imux_for_auto_mic(struct hda_codec *codec)
spec->imux_pins[2] = spec->dock_mic_pin;
for (i = 0; i < 3; i++) {
strcpy(imux->items[i].label, texts[i]);
if (spec->imux_pins[i])
if (spec->imux_pins[i]) {
hda_nid_t pin = spec->imux_pins[i];
int c;
for (c = 0; c < spec->num_adc_nids; c++) {
hda_nid_t cap = get_capsrc(spec, c);
int idx = get_connection_index(codec, cap, pin);
if (idx >= 0) {
imux->items[i].index = idx;
break;
}
}
imux->num_items = i + 1;
}
}
spec->num_mux_defs = 1;
spec->input_mux = imux;
Expand Down Expand Up @@ -1957,10 +1973,8 @@ static int alc_build_controls(struct hda_codec *codec)
if (!kctl)
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
const hda_nid_t *nids = spec->capsrc_nids;
if (!nids)
nids = spec->adc_nids;
err = snd_hda_add_nid(codec, kctl, i, nids[i]);
err = snd_hda_add_nid(codec, kctl, i,
get_capsrc(spec, i));
if (err < 0)
return err;
}
Expand Down Expand Up @@ -2747,8 +2761,7 @@ static int alc_auto_create_input_ctls(struct hda_codec *codec)
}

for (c = 0; c < num_adcs; c++) {
hda_nid_t cap = spec->capsrc_nids ?
spec->capsrc_nids[c] : spec->adc_nids[c];
hda_nid_t cap = get_capsrc(spec, c);
idx = get_connection_index(codec, cap, pin);
if (idx >= 0) {
spec->imux_pins[imux->num_items] = pin;
Expand Down Expand Up @@ -3694,8 +3707,7 @@ static int init_capsrc_for_pin(struct hda_codec *codec, hda_nid_t pin)
if (!pin)
return 0;
for (i = 0; i < spec->num_adc_nids; i++) {
hda_nid_t cap = spec->capsrc_nids ?
spec->capsrc_nids[i] : spec->adc_nids[i];
hda_nid_t cap = get_capsrc(spec, i);
int idx;

idx = get_connection_index(codec, cap, pin);
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,8 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = {
"Alienware M17x", STAC_ALIENWARE_M17X),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
"Alienware M17x", STAC_ALIENWARE_M17X),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
"Alienware M17x", STAC_ALIENWARE_M17X),
{} /* terminator */
};

Expand Down
Loading

0 comments on commit 3c512b1

Please sign in to comment.