Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287330
b: refs/heads/master
c: db966f8
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Feb 6, 2012
1 parent c538299 commit d12dc24
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 344 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2492250e4412c6411324c14ab289629360640b0a
refs/heads/master: db966f8abb9ba74f7d5a7230f51572f52c31c4e5
2 changes: 0 additions & 2 deletions trunk/include/sound/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ static inline int __snd_bug_on(int cond)
#define gameport_get_port_data(gp) (gp)->port_data
#endif

#ifdef CONFIG_PCI
/* PCI quirk list helper */
struct snd_pci_quirk {
unsigned short subvendor; /* PCI subvendor ID */
Expand Down Expand Up @@ -457,6 +456,5 @@ snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list);
const struct snd_pci_quirk *
snd_pci_quirk_lookup_id(u16 vendor, u16 device,
const struct snd_pci_quirk *list);
#endif

#endif /* __SOUND_CORE_H */
13 changes: 5 additions & 8 deletions trunk/sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,22 +441,19 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
params = kmalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;
if (copy_from_user(params, (void __user *)arg, sizeof(*params))) {
retval = -EFAULT;
goto out;
}
if (copy_from_user(params, (void __user *)arg, sizeof(*params)))
return -EFAULT;
retval = snd_compr_allocate_buffer(stream, params);
if (retval) {
retval = -ENOMEM;
goto out;
kfree(params);
return -ENOMEM;
}
retval = stream->ops->set_params(stream, params);
if (retval)
goto out;
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
} else {
} else
return -EPERM;
}
out:
kfree(params);
return retval;
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/isa/sb/emu8000_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "emu8000_local.h"
#include <asm/uaccess.h>
#include <linux/moduleparam.h>
#include <linux/moduleparam.h>

static int emu8000_reset_addr;
module_param(emu8000_reset_addr, int, 0444);
Expand Down
17 changes: 5 additions & 12 deletions trunk/sound/pci/hda/alc880_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,22 +762,16 @@ static void alc880_uniwill_unsol_event(struct hda_codec *codec,
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
res >>= 28;
switch (res) {
switch (res >> 28) {
case ALC_MIC_EVENT:
alc88x_simple_mic_automute(codec);
break;
default:
alc_exec_unsol_event(codec, res);
alc_sku_unsol_event(codec, res);
break;
}
}

static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
{
alc_exec_unsol_event(codec, res >> 28);
}

static void alc880_uniwill_p53_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
Expand Down Expand Up @@ -806,11 +800,10 @@ static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
res >>= 28;
if (res == ALC_DCVOL_EVENT)
if ((res >> 28) == ALC_DCVOL_EVENT)
alc880_uniwill_p53_dcvol_automute(codec);
else
alc_exec_unsol_event(codec, res);
alc_sku_unsol_event(codec, res);
}

/*
Expand Down Expand Up @@ -1684,7 +1677,7 @@ static const struct alc_config_preset alc880_presets[] = {
.channel_mode = alc880_lg_ch_modes,
.need_dac_fix = 1,
.input_mux = &alc880_lg_capture_source,
.unsol_event = alc880_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc880_lg_setup,
.init_hook = alc_hp_automute,
#ifdef CONFIG_SND_HDA_POWER_SAVE
Expand Down
15 changes: 5 additions & 10 deletions trunk/sound/pci/hda/alc882_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
alc889A_mb31_automute(codec);
}

static void alc882_unsol_event(struct hda_codec *codec, unsigned int res)
{
alc_exec_unsol_event(codec, res >> 26);
}

/*
* configuration and preset
*/
Expand Down Expand Up @@ -780,7 +775,7 @@ static const struct alc_config_preset alc882_presets[] = {
.channel_mode = alc885_mba21_ch_modes,
.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
.input_mux = &alc882_capture_source,
.unsol_event = alc882_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc885_mba21_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -796,7 +791,7 @@ static const struct alc_config_preset alc882_presets[] = {
.input_mux = &alc882_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc882_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc885_mbp3_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -811,7 +806,7 @@ static const struct alc_config_preset alc882_presets[] = {
.input_mux = &mb5_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc882_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc885_mb5_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -826,7 +821,7 @@ static const struct alc_config_preset alc882_presets[] = {
.input_mux = &macmini3_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc882_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc885_macmini3_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -841,7 +836,7 @@ static const struct alc_config_preset alc882_presets[] = {
.input_mux = &alc889A_imac91_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc882_unsol_event,
.unsol_event = alc_sku_unsol_event,
.setup = alc885_imac91_setup,
.init_hook = alc_hp_automute,
},
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
for (i = 0; i < c->cvt_setups.used; i++) {
p = snd_array_elem(&c->cvt_setups, i);
if (!p->active && p->stream_tag == stream_tag &&
get_wcaps_type(get_wcaps(c, p->nid)) == type)
get_wcaps_type(get_wcaps(codec, p->nid)) == type)
p->dirty = 1;
}
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ struct azx {
unsigned int irq_pending_warned :1;
unsigned int probing :1; /* codec probing phase */
unsigned int snoop:1;
unsigned int align_buffer_size:1;

/* for debugging */
unsigned int last_cmd[AZX_MAX_CODECS];
Expand Down Expand Up @@ -1691,7 +1690,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
runtime->hw.rates = hinfo->rates;
snd_pcm_limit_hw_rates(runtime);
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
if (chip->align_buffer_size)
if (align_buffer_size)
/* constrain buffer sizes to be multiple of 128
bytes. This is more efficient in terms of memory
access but isn't required by the HDA spec and
Expand Down Expand Up @@ -2774,9 +2773,8 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
}

/* disable buffer size rounding to 128-byte multiples if supported */
chip->align_buffer_size = align_buffer_size;
if (chip->driver_caps & AZX_DCAPS_BUFSIZE)
chip->align_buffer_size = 0;
align_buffer_size = 0;

/* allow 64bit DMA address if supported by H/W */
if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
Expand Down
24 changes: 9 additions & 15 deletions trunk/sound/pci/hda/hda_jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
EXPORT_SYMBOL_HDA(snd_hda_jack_add_kctl);

static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
const struct auto_pin_cfg *cfg,
char *lastname, int *lastidx)
const struct auto_pin_cfg *cfg)
{
unsigned int def_conf, conn;
char name[44];
Expand All @@ -299,10 +298,6 @@ static int add_jack_kctl(struct hda_codec *codec, hda_nid_t nid,
return 0;

snd_hda_get_pin_label(codec, nid, cfg, name, sizeof(name), &idx);
if (!strcmp(name, lastname) && idx == *lastidx)
idx++;
strncpy(lastname, name, 44);
*lastidx = idx;
err = snd_hda_jack_add_kctl(codec, nid, name, idx);
if (err < 0)
return err;
Expand All @@ -316,42 +311,41 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec,
const struct auto_pin_cfg *cfg)
{
const hda_nid_t *p;
int i, err, lastidx = 0;
char lastname[44] = "";
int i, err;

for (i = 0, p = cfg->line_out_pins; i < cfg->line_outs; i++, p++) {
err = add_jack_kctl(codec, *p, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, *p, cfg);
if (err < 0)
return err;
}
for (i = 0, p = cfg->hp_pins; i < cfg->hp_outs; i++, p++) {
if (*p == *cfg->line_out_pins) /* might be duplicated */
break;
err = add_jack_kctl(codec, *p, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, *p, cfg);
if (err < 0)
return err;
}
for (i = 0, p = cfg->speaker_pins; i < cfg->speaker_outs; i++, p++) {
if (*p == *cfg->line_out_pins) /* might be duplicated */
break;
err = add_jack_kctl(codec, *p, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, *p, cfg);
if (err < 0)
return err;
}
for (i = 0; i < cfg->num_inputs; i++) {
err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg);
if (err < 0)
return err;
}
for (i = 0, p = cfg->dig_out_pins; i < cfg->dig_outs; i++, p++) {
err = add_jack_kctl(codec, *p, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, *p, cfg);
if (err < 0)
return err;
}
err = add_jack_kctl(codec, cfg->dig_in_pin, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, cfg->dig_in_pin, cfg);
if (err < 0)
return err;
err = add_jack_kctl(codec, cfg->mono_out_pin, cfg, lastname, &lastidx);
err = add_jack_kctl(codec, cfg->mono_out_pin, cfg);
if (err < 0)
return err;
return 0;
Expand Down
33 changes: 14 additions & 19 deletions trunk/sound/pci/hda/patch_ca0132.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,19 +728,18 @@ static int ca0132_hp_switch_put(struct snd_kcontrol *kcontrol,

err = chipio_read(codec, REG_CODEC_MUTE, &data);
if (err < 0)
goto exit;
return err;

/* *valp 0 is mute, 1 is unmute */
data = (data & 0x7f) | (*valp ? 0 : 0x80);
err = chipio_write(codec, REG_CODEC_MUTE, data);
chipio_write(codec, REG_CODEC_MUTE, data);
if (err < 0)
goto exit;
return err;

spec->curr_hp_switch = *valp;

exit:
snd_hda_power_down(codec);
return err < 0 ? err : 1;
return 1;
}

static int ca0132_speaker_switch_get(struct snd_kcontrol *kcontrol,
Expand Down Expand Up @@ -771,19 +770,18 @@ static int ca0132_speaker_switch_put(struct snd_kcontrol *kcontrol,

err = chipio_read(codec, REG_CODEC_MUTE, &data);
if (err < 0)
goto exit;
return err;

/* *valp 0 is mute, 1 is unmute */
data = (data & 0xef) | (*valp ? 0 : 0x10);
err = chipio_write(codec, REG_CODEC_MUTE, data);
chipio_write(codec, REG_CODEC_MUTE, data);
if (err < 0)
goto exit;
return err;

spec->curr_speaker_switch = *valp;

exit:
snd_hda_power_down(codec);
return err < 0 ? err : 1;
return 1;
}

static int ca0132_hp_volume_get(struct snd_kcontrol *kcontrol,
Expand Down Expand Up @@ -821,26 +819,25 @@ static int ca0132_hp_volume_put(struct snd_kcontrol *kcontrol,

err = chipio_read(codec, REG_CODEC_HP_VOL_L, &data);
if (err < 0)
goto exit;
return err;

val = 31 - left_vol;
data = (data & 0xe0) | val;
err = chipio_write(codec, REG_CODEC_HP_VOL_L, data);
chipio_write(codec, REG_CODEC_HP_VOL_L, data);
if (err < 0)
goto exit;
return err;

val = 31 - right_vol;
data = (data & 0xe0) | val;
err = chipio_write(codec, REG_CODEC_HP_VOL_R, data);
chipio_write(codec, REG_CODEC_HP_VOL_R, data);
if (err < 0)
goto exit;
return err;

spec->curr_hp_volume[0] = left_vol;
spec->curr_hp_volume[1] = right_vol;

exit:
snd_hda_power_down(codec);
return err < 0 ? err : 1;
return 1;
}

static int add_hp_switch(struct hda_codec *codec, hda_nid_t nid)
Expand Down Expand Up @@ -939,8 +936,6 @@ static int ca0132_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
err = add_in_volume(codec, spec->dig_in, "IEC958");
if (err < 0)
return err;
}
return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,8 @@ static void cs_automic(struct hda_codec *codec)
change_cur_input(codec, !spec->automic_idx, 0);
} else {
if (present) {
if (spec->cur_input != spec->automic_idx) {
spec->last_input = spec->cur_input;
spec->cur_input = spec->automic_idx;
}
spec->last_input = spec->cur_input;
spec->cur_input = spec->automic_idx;
} else {
spec->cur_input = spec->last_input;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T510", CXT5066_AUTO),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520 & W520", CXT5066_AUTO),
SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
Expand Down
Loading

0 comments on commit d12dc24

Please sign in to comment.