[PATCH] ALSA: serial-generic: explicitly disable flow control

John Keeping posted 1 patch 2 months ago
sound/drivers/serial-generic.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] ALSA: serial-generic: explicitly disable flow control
Posted by John Keeping 2 months ago
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(+)

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;
 }
 
-- 
2.46.2
Re: [PATCH] ALSA: serial-generic: explicitly disable flow control
Posted by Johan Hovold 2 months ago
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