diff mbox series

ALSA: serial-generic: explicitly disable flow control

Message ID 20240926104404.3527124-1-jkeeping@inmusicbrands.com (mailing list archive)
State New, archived
Headers show
Series ALSA: serial-generic: explicitly disable flow control | expand

Commit Message

John Keeping Sept. 26, 2024, 10:44 a.m. UTC
The serdev subsystem does not specify the default state of flow control
when opening a device.  Surveying other drivers using serdev shows the
vast majority of these set flow control explicitly after opening the
device.

MIDI does not use flow control, so ensure it is disabled.

Fixes: 542350509499f ("ALSA: Add generic serial MIDI driver using serial bus API")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
---
 sound/drivers/serial-generic.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johan Hovold Sept. 27, 2024, 8:39 a.m. UTC | #1
On Thu, Sep 26, 2024 at 11:44:03AM +0100, John Keeping wrote:
> The serdev subsystem does not specify the default state of flow control
> when opening a device.

This bit isn't correct as serdev enables hardware flow control (CRTSCTS)
by default on open() (see ttyport_open()).

> Surveying other drivers using serdev shows the
> vast majority of these set flow control explicitly after opening the
> device.
> 
> MIDI does not use flow control, so ensure it is disabled.

Johan
diff mbox series

Patch

diff --git a/sound/drivers/serial-generic.c b/sound/drivers/serial-generic.c
index 36409a56c675e..322b5029ea49f 100644
--- a/sound/drivers/serial-generic.c
+++ b/sound/drivers/serial-generic.c
@@ -139,6 +139,8 @@  static int snd_serial_generic_ensure_serdev_open(struct snd_serial_generic *drvd
 			drvdata->baudrate, drvdata->card->shortname, actual_baud);
 	}
 
+	serdev_device_set_flow_control(drvdata->serdev, false);
+
 	return 0;
 }