emumixer.c (511cbe8f59e30cd09a04c1dbafe6337d9111e88a) emumixer.c (cc766807a208bfa06c204be784ec099fb25c87a4)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
4 * Takashi Iwai <tiwai@suse.de>
5 * Creative Labs, Inc.
6 * Routines for control of EMU10K1 chips / mixer routines
7 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com>
8 *

--- 545 unchanged lines hidden (view full) ---

554 return 0;
555}
556
557static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
558{
559 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
560 unsigned int mask = snd_emu1010_dac_regs[kcontrol->private_value];
561 unsigned int val, cache;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
4 * Takashi Iwai <tiwai@suse.de>
5 * Creative Labs, Inc.
6 * Routines for control of EMU10K1 chips / mixer routines
7 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com>
8 *

--- 545 unchanged lines hidden (view full) ---

554 return 0;
555}
556
557static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
558{
559 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
560 unsigned int mask = snd_emu1010_dac_regs[kcontrol->private_value];
561 unsigned int val, cache;
562 int change;
563
562 val = ucontrol->value.integer.value[0];
563 cache = emu->emu1010.dac_pads;
564 if (val == 1)
565 cache = cache | mask;
566 else
567 cache = cache & ~mask;
564 val = ucontrol->value.integer.value[0];
565 cache = emu->emu1010.dac_pads;
566 if (val == 1)
567 cache = cache | mask;
568 else
569 cache = cache & ~mask;
568 if (cache != emu->emu1010.dac_pads) {
570 change = (cache != emu->emu1010.dac_pads);
571 if (change) {
569 snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
570 emu->emu1010.dac_pads = cache;
571 }
572
572 snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
573 emu->emu1010.dac_pads = cache;
574 }
575
573 return 0;
576 return change;
574}
575
576static const struct snd_kcontrol_new emu1010_dac_pads_ctl = {
577 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
578 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
579 .info = snd_emu1010_dac_pads_info,
580 .get = snd_emu1010_dac_pads_get,
581 .put = snd_emu1010_dac_pads_put

--- 1489 unchanged lines hidden ---
577}
578
579static const struct snd_kcontrol_new emu1010_dac_pads_ctl = {
580 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
581 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
582 .info = snd_emu1010_dac_pads_info,
583 .get = snd_emu1010_dac_pads_get,
584 .put = snd_emu1010_dac_pads_put

--- 1489 unchanged lines hidden ---