Skip to contentSkip to conversation

sound/usb: add dB range mapping for some devices.

PATCH Applied Yao-Wen Mao 2 participants 3 messages Jul 29, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/usb: add dB range mapping for some devices.

Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2.

---
 sound/usb/mixer_maps.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
sound/usb/mixer_maps.c +23 -0
index e5000da..f0c9e49 100644
@@ -339,6 +339,19 @@ static struct usbmix_name_map gamecom780_map[] = {
 static const struct usbmix_name_map scms_usb3318_map[] = {
 	{ 10, NULL },
 	{ 0 }
+
+/* Bose companion 5, the dB conversion factor is 16 instead of 256 */
+static struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
+static struct usbmix_name_map bose_companion5_map[] = {
+	{ 3, NULL, .dB = &bose_companion5_dB },
+	{ 0 }	/* terminator */
+};
+
+/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
+static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
+static struct usbmix_name_map dragonfly_1_2_map[] = {
+	{ 7, NULL, .dB = &dragonfly_1_2_dB },
+	{ 0 }	/* terminator */
 };
 
 /*
@@ -451,6 +464,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
 		.id = USB_ID(0x25c4, 0x0003),
 		.map = scms_usb3318_map,
 	},
+	{
+		/* Bose Companion 5 */
+		.id = USB_ID(0x05a7, 0x1020),
+		.map = bose_companion5_map,
+	},
+	{
+		/* Dragonfly DAC 1.2 */
+		.id = USB_ID(0x21b4, 0x0081),
+		.map = dragonfly_1_2_map,
+	},
 	{ 0 } /* terminator */
 };
 
Signature · 1 line
2.5.0.rc2.392.g76e840b
Applied
#1 lore raw
Quoted 13 lines · Yao-Wen Mao

Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2.

---
 sound/usb/mixer_maps.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
sound/usb/mixer_maps.c +0 -0
index e5000da..f0c9e49 100644

sound/usb/mixer_maps.c static struct usbmix_name_map gamecom780_map[] = { · line 341

Quoted 3 lines
sound/usb/mixer_maps.c +0 -0
@@ -339,6 +339,19 @@ static struct usbmix_name_map gamecom780_map[] = {
 static const struct usbmix_name_map scms_usb3318_map[] = {
 	{ 10, NULL },
 	{ 0 }

You seem to have dropped some lines here.
At the next time, please at least do a build-test before submitting the patch.

I applied it now with manual correction. Thanks.

Takashi

Quoted 37 lines
sound/usb/mixer_maps.c +23 -0
+
+/* Bose companion 5, the dB conversion factor is 16 instead of 256 */
+static struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
+static struct usbmix_name_map bose_companion5_map[] = {
+	{ 3, NULL, .dB = &bose_companion5_dB },
+	{ 0 }	/* terminator */
+};
+
+/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
+static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
+static struct usbmix_name_map dragonfly_1_2_map[] = {
+	{ 7, NULL, .dB = &dragonfly_1_2_dB },
+	{ 0 }	/* terminator */
 };
 
 /*
@@ -451,6 +464,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
 		.id = USB_ID(0x25c4, 0x0003),
 		.map = scms_usb3318_map,
 	},
+	{
+		/* Bose Companion 5 */
+		.id = USB_ID(0x05a7, 0x1020),
+		.map = bose_companion5_map,
+	},
+	{
+		/* Dragonfly DAC 1.2 */
+		.id = USB_ID(0x21b4, 0x0081),
+		.map = dragonfly_1_2_map,
+	},
 	{ 0 } /* terminator */
 };
 
Signature · 1 line
2.5.0.rc2.392.g76e840b
#2 lore raw
Quoted 23 lines · Takashi Iwai
Quoted 13 lines · Yao-Wen Mao

Add the correct dB ranges of Bose Companion 5 and Drangonfly DAC 1.2.

---
 sound/usb/mixer_maps.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
sound/usb/mixer_maps.c +0 -0
index e5000da..f0c9e49 100644

sound/usb/mixer_maps.c static struct usbmix_name_map gamecom780_map[] = { · line 341

Quoted 3 lines
sound/usb/mixer_maps.c +0 -0
@@ -339,6 +339,19 @@ static struct usbmix_name_map gamecom780_map[] = {
 static const struct usbmix_name_map scms_usb3318_map[] = {
      { 10, NULL },
      { 0 }

You seem to have dropped some lines here.
At the next time, please at least do a build-test before submitting the patch.

Quoted 1 line

I applied it now with manual correction. Thanks.

Sorry for that.
Thanks for applying this patch!

Yao-Wen

Quoted 40 lines

Takashi

Quoted 37 lines
sound/usb/mixer_maps.c +23 -1
+
+/* Bose companion 5, the dB conversion factor is 16 instead of 256 */
+static struct usbmix_dB_map bose_companion5_dB = {-5006, -6};
+static struct usbmix_name_map bose_companion5_map[] = {
+     { 3, NULL, .dB = &bose_companion5_dB },
+     { 0 }   /* terminator */
+};
+
+/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
+static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
+static struct usbmix_name_map dragonfly_1_2_map[] = {
+     { 7, NULL, .dB = &dragonfly_1_2_dB },
+     { 0 }   /* terminator */
 };
 
 /*
@@ -451,6 +464,16 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
              .id = USB_ID(0x25c4, 0x0003),
              .map = scms_usb3318_map,
      },
+     {
+             /* Bose Companion 5 */
+             .id = USB_ID(0x05a7, 0x1020),
+             .map = bose_companion5_map,
+     },
+     {
+             /* Dragonfly DAC 1.2 */
+             .id = USB_ID(0x21b4, 0x0081),
+             .map = dragonfly_1_2_map,
+     },
      { 0 } /* terminator */
 };
 
--

2.5.0.rc2.392.g76e840b