Generic serial MIDI driver

modulename: snd-serial-generic.ko

configname: CONFIG_SND_SERIAL_GENERIC

Linux Kernel Configuration
└─>Device Drivers
└─>Sound card support
└─>Advanced Linux Sound Architecture
└─>Generic sound devices
└─>Serial device bus
└─>Device Tree and Open Firmware support
└─>Generic serial MIDI driver
In linux kernel since version 4.14.326 (release Date: 2023-09-23)  
To include support for mapping generic serial devices as raw
ALSA MIDI devices, say Y here. The driver only supports setting
the serial port to standard baudrates. To attain the standard MIDI
baudrate of 31.25 kBaud, configure the clock of the underlying serial
device so that a requested 38.4 kBaud will result in the standard speed.

Use this devicetree binding to configure serial port mapping
Documentation/devicetree/bindings/sound/serial-midi.yaml

To compile this driver as a module, choose M here: the module
will be called snd-serial-generic.

source code: