summaryrefslogtreecommitdiff
path: root/sound/usb/mixer_scarlett.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-11-18 11:47:04 +0100
committerTakashi Iwai <tiwai@suse.de>2014-11-21 11:56:58 +0100
commit3360b84b8ed1f08bfb39743465b858a04492fcc3 (patch)
treefc05e8cf624adf9cd9e25fdca04793c830ff9365 /sound/usb/mixer_scarlett.c
parent5aeee3424fa5926a53885b9defb593971e446d77 (diff)
ALSA: usb-audio: Allow quirks to handle own resume and proc dump
So far, we blindly assumed that the all usb-audio mixer elements follow the standard and apply the standard resume method for the registered elements in the id_elems[] list. However, some quirks really need the own resume and it's incomplete for now. This patch enhances the resume handling in two folds: - split some fields in struct usb_mixer_elem_info into a smaller header struct (usb_mixer_elem_list) for keeping the minimal information in the linked-list; the usb_mixer_elem_info embeds this header struct instead - add resume and dump callbacks to usb_mixer_elem_list struct to allow quirks providing the own methods For the standard mixer elements, these new callbacks are set to the standard ones as default, thus there is no functional change by this patch yet. The dump and resume callbacks are typedef'ed for ease of later patches using arrays of such function pointers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer_scarlett.c')
-rw-r--r--sound/usb/mixer_scarlett.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c
index a0a874507de5..92dba35660b3 100644
--- a/sound/usb/mixer_scarlett.c
+++ b/sound/usb/mixer_scarlett.c
@@ -436,10 +436,10 @@ static int scarlett_ctl_meter_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{
struct usb_mixer_elem_info *elem = kctl->private_data;
- struct snd_usb_audio *chip = elem->mixer->chip;
+ struct snd_usb_audio *chip = elem->head.mixer->chip;
unsigned char buf[2 * MAX_CHANNELS] = {0, };
int wValue = (elem->control << 8) | elem->idx_off;
- int idx = snd_usb_ctrl_intf(chip) | (elem->id << 8);
+ int idx = snd_usb_ctrl_intf(chip) | (elem->head.id << 8);
int err;
err = snd_usb_ctl_msg(chip->dev,
@@ -528,10 +528,10 @@ static int add_new_ctl(struct usb_mixer_interface *mixer,
if (!elem)
return -ENOMEM;
- elem->mixer = mixer;
+ elem->head.mixer = mixer;
elem->control = offset;
elem->idx_off = num;
- elem->id = index;
+ elem->head.id = index;
elem->val_type = val_type;
elem->channels = channels;