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:
  sound: oss: rename local change_bits to avoid powerpc bitsops.h definition
  ALSA: hda - Fix duplicated DAC assignments for Realtek
  ALSA: asihpi - off by one in asihpi_hpi_ioctl()
  ALSA: hda - Fix Oops with Realtek quirks with NULL adc_nids
  ALSA: asihpi - bug fix pa use before init.
  ALSA: hda - Add support for vref-out based mute LED control on IDT codecs
  • Loading branch information
Linus Torvalds committed Jul 28, 2011
2 parents 95b6886 + 8d34e6d commit 6f56c21
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 70 deletions.
6 changes: 3 additions & 3 deletions sound/oss/ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ static int ad1848_set_recmask(ad1848_info * devc, int mask)
return mask;
}

static void change_bits(ad1848_info * devc, unsigned char *regval,
static void oss_change_bits(ad1848_info *devc, unsigned char *regval,
unsigned char *muteval, int dev, int chn, int newval)
{
unsigned char mask;
Expand Down Expand Up @@ -516,10 +516,10 @@ static void ad1848_mixer_set_channel(ad1848_info *devc, int dev, int value, int

if (muteregoffs != regoffs) {
muteval = ad_read(devc, muteregoffs);
change_bits(devc, &val, &muteval, dev, channel, value);
oss_change_bits(devc, &val, &muteval, dev, channel, value);
}
else
change_bits(devc, &val, &val, dev, channel, value);
oss_change_bits(devc, &val, &val, dev, channel, value);

spin_lock_irqsave(&devc->lock,flags);
ad_write(devc, regoffs, val);
Expand Down
6 changes: 3 additions & 3 deletions sound/oss/sb_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static int detect_mixer(sb_devc * devc)
return 1;
}

static void change_bits(sb_devc * devc, unsigned char *regval, int dev, int chn, int newval)
static void oss_change_bits(sb_devc *devc, unsigned char *regval, int dev, int chn, int newval)
{
unsigned char mask;
int shift;
Expand Down Expand Up @@ -284,7 +284,7 @@ int sb_common_mixer_set(sb_devc * devc, int dev, int left, int right)
return -EINVAL;

val = sb_getmixer(devc, regoffs);
change_bits(devc, &val, dev, LEFT_CHN, left);
oss_change_bits(devc, &val, dev, LEFT_CHN, left);

if ((*devc->iomap)[dev][RIGHT_CHN].regno != regoffs) /*
* Change register
Expand All @@ -304,7 +304,7 @@ int sb_common_mixer_set(sb_devc * devc, int dev, int left, int right)
* Read the new one
*/
}
change_bits(devc, &val, dev, RIGHT_CHN, right);
oss_change_bits(devc, &val, dev, RIGHT_CHN, right);

sb_setmixer(devc, regoffs, val);

Expand Down
13 changes: 5 additions & 8 deletions sound/pci/asihpi/hpioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
union hpi_response_buffer_v1 *hr;
u16 res_max_size;
u32 uncopied_bytes;
struct hpi_adapter *pa = NULL;
int err = 0;

if (cmd != HPI_IOCTL_LINUX)
Expand Down Expand Up @@ -182,8 +181,9 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* -1=no data 0=read from user mem, 1=write to user mem */
int wrflag = -1;
u32 adapter = hm->h.adapter_index;
struct hpi_adapter *pa = &adapters[adapter];

if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) {
if ((adapter >= HPI_MAX_ADAPTERS) || (!pa->type)) {
hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER,
HPI_ADAPTER_OPEN,
HPI_ERROR_BAD_ADAPTER_NUMBER);
Expand All @@ -197,9 +197,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out;
}

pa = &adapters[adapter];

if (mutex_lock_interruptible(&adapters[adapter].mutex)) {
if (mutex_lock_interruptible(&pa->mutex)) {
err = -EINTR;
goto out;
}
Expand Down Expand Up @@ -235,8 +233,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
"stream buffer size %d\n",
size);

mutex_unlock(&adapters
[adapter].mutex);
mutex_unlock(&pa->mutex);
err = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -277,7 +274,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
uncopied_bytes, size);
}

mutex_unlock(&adapters[adapter].mutex);
mutex_unlock(&pa->mutex);
}

/* on return response size must be set */
Expand Down
29 changes: 16 additions & 13 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,13 +895,15 @@ static void alc_init_auto_hp(struct hda_codec *codec)
if (present == 3)
spec->automute_hp_lo = 1; /* both HP and LO automute */

if (!cfg->speaker_pins[0]) {
if (!cfg->speaker_pins[0] &&
cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
memcpy(cfg->speaker_pins, cfg->line_out_pins,
sizeof(cfg->speaker_pins));
cfg->speaker_outs = cfg->line_outs;
}

if (!cfg->hp_pins[0]) {
if (!cfg->hp_pins[0] &&
cfg->line_out_type == AUTO_PIN_HP_OUT) {
memcpy(cfg->hp_pins, cfg->line_out_pins,
sizeof(cfg->hp_pins));
cfg->hp_outs = cfg->line_outs;
Expand All @@ -920,6 +922,7 @@ static void alc_init_auto_hp(struct hda_codec *codec)
spec->automute_mode = ALC_AUTOMUTE_PIN;
}
if (spec->automute && cfg->line_out_pins[0] &&
cfg->speaker_pins[0] &&
cfg->line_out_pins[0] != cfg->hp_pins[0] &&
cfg->line_out_pins[0] != cfg->speaker_pins[0]) {
for (i = 0; i < cfg->line_outs; i++) {
Expand Down Expand Up @@ -1911,7 +1914,7 @@ static int alc_build_controls(struct hda_codec *codec)
return err;
}
}
if (spec->cap_mixer) {
if (spec->cap_mixer && spec->adc_nids) {
const char *kname = kctl ? kctl->id.name : NULL;
for (knew = spec->cap_mixer; knew->name; knew++) {
if (kname && strcmp(knew->name, kname) == 0)
Expand Down Expand Up @@ -3677,7 +3680,7 @@ static int patch_alc880(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc880_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -3804,7 +3807,7 @@ static int patch_alc260(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc260_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -3983,7 +3986,7 @@ static int patch_alc882(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc882_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -4137,7 +4140,7 @@ static int patch_alc262(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc262_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -4293,7 +4296,7 @@ static int patch_alc268(struct hda_codec *codec)
(0 << AC_AMPCAP_MUTE_SHIFT));
}

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -4705,7 +4708,7 @@ static int patch_alc269(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc269_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -4843,7 +4846,7 @@ static int patch_alc861(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc861_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -4984,7 +4987,7 @@ static int patch_alc861vd(struct hda_codec *codec)
add_verb(spec, alc660vd_eapd_verbs);
}

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -5200,7 +5203,7 @@ static int patch_alc662(struct hda_codec *codec)
if (board_config != ALC_MODEL_AUTO)
setup_preset(codec, &alc662_presets[board_config]);

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down Expand Up @@ -5336,7 +5339,7 @@ static int patch_alc680(struct hda_codec *codec)
#endif
}

if (!spec->no_analog && !spec->adc_nids && spec->input_mux) {
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
alc_rebuild_imux_for_auto_mic(codec);
alc_remove_invalid_adc_nids(codec);
Expand Down
Loading

0 comments on commit 6f56c21

Please sign in to comment.