[alsa-devel] [PATCH 2/2] Rename internal xonar_u1_* names to just xonar_u_*

Denis Washington denisw at online.de
Tue Dec 11 19:26:42 CET 2012


Now that the code applies both to the U1 and the U3,
xonar_u1 is not a good name anymore.

Signed-off-by: Denis Washington <denisw at online.de>
---
   sound/usb/mixer.h        |  2 +-
   sound/usb/mixer_quirks.c | 24 ++++++++++++------------
   2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index a7f3d45..9e7ec0e 100644
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -22,7 +22,7 @@ struct usb_mixer_interface {
   	u8 rc_buffer[6];

   	u8 audigy2nx_leds[3];
-	u8 xonar_u1_status;
+	u8 xonar_u_status;
   };

   #define MAX_CHANNELS	16	/* max logical channels */
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 2223089..de6db70 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -416,23 +416,23 @@ static void snd_audigy2nx_proc_read(struct 
snd_info_entry *entry,
   	}
   }

-static int snd_xonar_u1_switch_get(struct snd_kcontrol *kcontrol,
+static int snd_xonar_u_switch_get(struct snd_kcontrol *kcontrol,
   				   struct snd_ctl_elem_value *ucontrol)
   {
   	struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);

-	ucontrol->value.integer.value[0] = !!(mixer->xonar_u1_status & 0x02);
+	ucontrol->value.integer.value[0] = !!(mixer->xonar_u_status & 0x02);
   	return 0;
   }

-static int snd_xonar_u1_switch_put(struct snd_kcontrol *kcontrol,
+static int snd_xonar_u_switch_put(struct snd_kcontrol *kcontrol,
   				   struct snd_ctl_elem_value *ucontrol)
   {
   	struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
   	u8 old_status, new_status;
   	int err, changed;

-	old_status = mixer->xonar_u1_status;
+	old_status = mixer->xonar_u_status;
   	if (ucontrol->value.integer.value[0])
   		new_status = old_status | 0x02;
   	else
@@ -449,27 +449,27 @@ static int snd_xonar_u1_switch_put(struct 
snd_kcontrol *kcontrol,
   	up_read(&mixer->chip->shutdown_rwsem);
   	if (err < 0)
   		return err;
-	mixer->xonar_u1_status = new_status;
+	mixer->xonar_u_status = new_status;
   	return changed;
   }

-static struct snd_kcontrol_new snd_xonar_u1_output_switch = {
+static struct snd_kcontrol_new snd_xonar_u_output_switch = {
   	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
   	.name = "Digital Playback Switch",
   	.info = snd_ctl_boolean_mono_info,
-	.get = snd_xonar_u1_switch_get,
-	.put = snd_xonar_u1_switch_put,
+	.get = snd_xonar_u_switch_get,
+	.put = snd_xonar_u_switch_put,
   };

-static int snd_xonar_u1_controls_create(struct usb_mixer_interface *mixer)
+static int snd_xonar_u_controls_create(struct usb_mixer_interface *mixer)
   {
   	int err;

   	err = snd_ctl_add(mixer->chip->card,
-			  snd_ctl_new1(&snd_xonar_u1_output_switch, mixer));
+			  snd_ctl_new1(&snd_xonar_u_output_switch, mixer));
   	if (err < 0)
   		return err;
-	mixer->xonar_u1_status = 0x05;
+	mixer->xonar_u_status = 0x05;
   	return 0;
   }

@@ -1110,7 +1110,7 @@ int snd_usb_mixer_apply_create_quirk(struct 
usb_mixer_interface *mixer)
   	case USB_ID(0x0b05, 0x1739): /* ASUS Xonar U1 */
   	case USB_ID(0x0b05, 0x1743): /* ASUS Xonar U1 (2) */
   	case USB_ID(0x0b05, 0x17a0): /* ASUS Xonar U3 */
-		err = snd_xonar_u1_controls_create(mixer);
+		err = snd_xonar_u_controls_create(mixer);
   		break;

   	case USB_ID(0x17cc, 0x1011): /* Traktor Audio 6 */
-- 
1.8.0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4453 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20121211/9de7e5b7/attachment.p7s>


More information about the Alsa-devel mailing list