aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-23 17:47:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-23 17:47:11 -0400
commitffd4341d6af49ad899144b5a02f2eba65be03f6c (patch)
tree3ba885c1dbf688c18b226f05b9d7a4964ac113c2
parent31f9bf46a5bb5773b3b3cb4719a7f91f64f540e8 (diff)
parente76bf634870e3c5e3a767ad575f1d404c9f1cab8 (diff)
Merge tag 'sound-3.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "One fix is about a buggy computation in PCM API function Clemens spotted out, but the impact must be really small as no one really uses it in user-space side. The rest are a trivial fix for a HD-audio model and a USB-audio device-specific regression fix, so all look fairly safe to apply" * tag 'sound-3.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: snd-usb-caiaq: Fix LED commands for Kore controller ALSA: pcm: fix fifo_size frame calculation ALSA: hda - Add fixup model name lookup for Lemote A1205
-rw-r--r--sound/core/pcm_lib.c8
-rw-r--r--sound/pci/hda/patch_conexant.c1
-rw-r--r--sound/usb/caiaq/control.c18
3 files changed, 17 insertions, 10 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 9acc77eae487..0032278567ad 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1782,14 +1782,16 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
1782{ 1782{
1783 struct snd_pcm_hw_params *params = arg; 1783 struct snd_pcm_hw_params *params = arg;
1784 snd_pcm_format_t format; 1784 snd_pcm_format_t format;
1785 int channels, width; 1785 int channels;
1786 ssize_t frame_size;
1786 1787
1787 params->fifo_size = substream->runtime->hw.fifo_size; 1788 params->fifo_size = substream->runtime->hw.fifo_size;
1788 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) { 1789 if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) {
1789 format = params_format(params); 1790 format = params_format(params);
1790 channels = params_channels(params); 1791 channels = params_channels(params);
1791 width = snd_pcm_format_physical_width(format); 1792 frame_size = snd_pcm_format_size(format, channels);
1792 params->fifo_size /= width * channels; 1793 if (frame_size > 0)
1794 params->fifo_size /= (unsigned)frame_size;
1793 } 1795 }
1794 return 0; 1796 return 0;
1795} 1797}
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 6e5d0cb4e3d7..47ccb8f44adb 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -777,6 +777,7 @@ static const struct hda_model_fixup cxt5066_fixup_models[] = {
777 { .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" }, 777 { .id = CXT_PINCFG_LENOVO_TP410, .name = "tp410" },
778 { .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" }, 778 { .id = CXT_FIXUP_THINKPAD_ACPI, .name = "thinkpad" },
779 { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" }, 779 { .id = CXT_PINCFG_LEMOTE_A1004, .name = "lemote-a1004" },
780 { .id = CXT_PINCFG_LEMOTE_A1205, .name = "lemote-a1205" },
780 { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" }, 781 { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" },
781 {} 782 {}
782}; 783};
diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c
index f65fc0987cfb..b7a7c805d63f 100644
--- a/sound/usb/caiaq/control.c
+++ b/sound/usb/caiaq/control.c
@@ -100,15 +100,19 @@ static int control_put(struct snd_kcontrol *kcontrol,
100 struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); 100 struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card);
101 int pos = kcontrol->private_value; 101 int pos = kcontrol->private_value;
102 int v = ucontrol->value.integer.value[0]; 102 int v = ucontrol->value.integer.value[0];
103 unsigned char cmd = EP1_CMD_WRITE_IO; 103 unsigned char cmd;
104 104
105 if (cdev->chip.usb_id == 105 switch (cdev->chip.usb_id) {
106 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1)) 106 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER):
107 cmd = EP1_CMD_DIMM_LEDS; 107 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
108 108 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
109 if (cdev->chip.usb_id == 109 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
110 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER))
111 cmd = EP1_CMD_DIMM_LEDS; 110 cmd = EP1_CMD_DIMM_LEDS;
111 break;
112 default:
113 cmd = EP1_CMD_WRITE_IO;
114 break;
115 }
112 116
113 if (pos & CNT_INTVAL) { 117 if (pos & CNT_INTVAL) {
114 int i = pos & ~CNT_INTVAL; 118 int i = pos & ~CNT_INTVAL;