summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorGeoffrey D. Bennett <g@b4.vu>2021-06-23 02:32:09 +0930
committerTakashi Iwai <tiwai@suse.de>2021-06-22 21:42:24 +0200
commit8aea2e32a9e3c3a685dc6f3f7d58fbbd6263a857 (patch)
tree5294bbd935381ddbfe3f8fa35ac98c0036ff9a5f /sound/usb
parent303f204e83526d8f83220f41ba93b5af796bc323 (diff)
ALSA: usb-audio: scarlett2: Move get config above set config
Move scarlett2_usb_get() and scarlett2_usb_get_config() above the functions relating to updating the configuration so that scarlett2_usb_set_config() can call scarlett2_usb_get() in a subsequent patch. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/1549f8e44548be679119f0b1462f888f4a03812d.1624379707.git.g@b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer_scarlett_gen2.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index f35420369042..7a5346c68603 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -985,6 +985,34 @@ error:
return err;
}
+/* Send a USB message to get data; result placed in *buf */
+static int scarlett2_usb_get(
+ struct usb_mixer_interface *mixer,
+ int offset, void *buf, int size)
+{
+ struct {
+ __le32 offset;
+ __le32 size;
+ } __packed req;
+
+ req.offset = cpu_to_le32(offset);
+ req.size = cpu_to_le32(size);
+ return scarlett2_usb(mixer, SCARLETT2_USB_GET_DATA,
+ &req, sizeof(req), buf, size);
+}
+
+/* Send a USB message to get configuration parameters; result placed in *buf */
+static int scarlett2_usb_get_config(
+ struct usb_mixer_interface *mixer,
+ int config_item_num, int count, void *buf)
+{
+ const struct scarlett2_config *config_item =
+ &scarlett2_config_items[config_item_num];
+ int size = config_item->size * count;
+
+ return scarlett2_usb_get(mixer, config_item->offset, buf, size);
+}
+
/* Send SCARLETT2_USB_DATA_CMD SCARLETT2_USB_CONFIG_SAVE */
static void scarlett2_config_save(struct usb_mixer_interface *mixer)
{
@@ -1049,34 +1077,6 @@ static int scarlett2_usb_set_config(
return 0;
}
-/* Send a USB message to get data; result placed in *buf */
-static int scarlett2_usb_get(
- struct usb_mixer_interface *mixer,
- int offset, void *buf, int size)
-{
- struct {
- __le32 offset;
- __le32 size;
- } __packed req;
-
- req.offset = cpu_to_le32(offset);
- req.size = cpu_to_le32(size);
- return scarlett2_usb(mixer, SCARLETT2_USB_GET_DATA,
- &req, sizeof(req), buf, size);
-}
-
-/* Send a USB message to get configuration parameters; result placed in *buf */
-static int scarlett2_usb_get_config(
- struct usb_mixer_interface *mixer,
- int config_item_num, int count, void *buf)
-{
- const struct scarlett2_config *config_item =
- &scarlett2_config_items[config_item_num];
- int size = config_item->size * count;
-
- return scarlett2_usb_get(mixer, config_item->offset, buf, size);
-}
-
/* Send a USB message to get sync status; result placed in *sync */
static int scarlett2_usb_get_sync_status(
struct usb_mixer_interface *mixer,