Commit graph

6 commits

Author SHA1 Message Date
Chen Ni
1c116e5569 ALSA: usb: fcp: Use USB API functions rather than constants
Use the function usb_endpoint_num() rather than constants.

The Coccinelle semantic patch is as follows:

@@ struct usb_endpoint_descriptor *epd; @@

- (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\))
+ usb_endpoint_num(epd)

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20250516070938.12520-1-nichen@iscas.ac.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-16 09:57:00 +02:00
Takashi Iwai
0a8f5f4652 ALSA: usb: fcp: Fix return code from poll ops
Fix a sparse warning due to the invalid return type from poll ops,
which is __poll_t.

Fixes: 46757a3e7d ("ALSA: FCP: Add Focusrite Control Protocol driver")
Link: https://patch.msgid.link/20250121170032.7236-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-01-21 18:01:55 +01:00
Takashi Iwai
f08cc80f69 ALSA: usb: fcp: Fix incorrect resp->opcode retrieval
Fix a wrong conversion macro used for resp->opcode, which is __le32.

Fixes: 46757a3e7d ("ALSA: FCP: Add Focusrite Control Protocol driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501212331.SaePSmsA-lkp@intel.com/
Link: https://patch.msgid.link/20250121170032.7236-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-01-21 18:01:42 +01:00
Takashi Iwai
e7217011dd ALSA: usb: fcp: Fix meter_levels type to __le32
The cached level meter values are returned from the USB core as
__le32, hence declare properly.

Fixes: 46757a3e7d ("ALSA: FCP: Add Focusrite Control Protocol driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501212331.SaePSmsA-lkp@intel.com/
Link: https://patch.msgid.link/20250121170032.7236-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-01-21 18:01:26 +01:00
Stephen Rothwell
f95719b069 ALSA: usb: fcp: Fix hwdep read ops types
The FCP driver defined hwdep read function with ssize_t, but it should
be long due to historical reason.  This caused build errors on 32bit
archs.

Fixes: 46757a3e7d ("ALSA: FCP: Add Focusrite Control Protocol driver")
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://patch.msgid.link/20250120145617.07945574@canb.auug.org.au
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-01-20 08:37:51 +01:00
Geoffrey D. Bennett
46757a3e7d ALSA: FCP: Add Focusrite Control Protocol driver
Add a new kernel driver for the Focusrite Control Protocol (FCP),
which is used by Focusrite Scarlett 2nd Gen, 3rd Gen, 4th Gen, Clarett
USB, Clarett+, and Vocaster series audio interfaces. This driver
provides a user-space control interface via ALSA's hwdep subsystem.

Unlike the existing Scarlett2 driver which implements all ALSA
controls in kernel space, this new FCP driver takes a different
approach by providing a minimal kernel interface that allows a
user-space driver to send FCP commands and receive notifications. The
only control implemented in kernel space is the Level Meter, since it
requires frequent polling of volatile data.

While this driver supports all interfaces that the Scarlett2 driver
works with, it is initially enabled only for 4th Gen 16i16, 18i16,
and 18i20 interfaces that are not supported by the Scarlett2 driver.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/597741a9b1198b965561547511d3d345f91cba20.1737048528.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-01-18 12:00:38 +01:00