[alsa-devel] [PATCH - usb: Headphone support for cm6206 1/2] usb: move snd_usb_cm106_write_int_reg to mixer_quirks.c
Takashi Iwai
tiwai at suse.de
Fri Jul 30 14:24:45 CEST 2010
At Tue, 20 Jul 2010 19:42:28 -0300,
Adrian Pardini wrote:
>
> Hi all, this series of patches adds another control to cm6206 based cards to
> let the user select wich ouput the "Headphone" jack mirrors. Please review.
You can just remove "static" instead of moving the whole function,
right?
thanks,
Takashi
>
> Thanks.
>
> Signed-off-by: Adrian Pardini <adrian.pardini at solar.org.ar>
>
> diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
> index e7df1e5..c4cbbc0 100644
> --- a/sound/usb/mixer_quirks.c
> +++ b/sound/usb/mixer_quirks.c
> @@ -354,6 +354,22 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
> }
> }
>
> +/*
> + * C-Media CM106/CM106+ have four 16-bit internal registers that are nicely
> + * documented in the device's data sheet.
> + */
> +int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value)
> +{
> + u8 buf[4];
> + buf[0] = 0x20;
> + buf[1] = value & 0xff;
> + buf[2] = (value >> 8) & 0xff;
> + buf[3] = reg;
> + return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
> + USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT,
> + 0, 0, &buf, 4, 1000);
> +}
> +
> int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
> {
> int err;
> diff --git a/sound/usb/mixer_quirks.h b/sound/usb/mixer_quirks.h
> index bdbfab0..bc5d577 100644
> --- a/sound/usb/mixer_quirks.h
> +++ b/sound/usb/mixer_quirks.h
> @@ -9,5 +9,7 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
> void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
> int unitid);
>
> +int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value);
> +
> #endif /* SND_USB_MIXER_QUIRKS_H */
>
> diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
> index 9a9da09..b8a5a18 100644
> --- a/sound/usb/quirks.c
> +++ b/sound/usb/quirks.c
> @@ -353,22 +353,6 @@ static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
> return 0;
> }
>
> -/*
> - * C-Media CM106/CM106+ have four 16-bit internal registers that are nicely
> - * documented in the device's data sheet.
> - */
> -static int snd_usb_cm106_write_int_reg(struct usb_device *dev, int reg, u16 value)
> -{
> - u8 buf[4];
> - buf[0] = 0x20;
> - buf[1] = value & 0xff;
> - buf[2] = (value >> 8) & 0xff;
> - buf[3] = reg;
> - return snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_CONFIGURATION,
> - USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT,
> - 0, 0, &buf, 4, 1000);
> -}
> -
> static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
> {
> /*
> --
> 1.5.4.3
>
>
>
> --
> Adrian.
> http://elesquinazotango.com.ar
> http://www.noalcodigodescioli.blogspot.com/
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
More information about the Alsa-devel
mailing list