command lists the device files.
How to know the associated drivers/major_numbers/minor_numbers with those device files?
crw-rw---- 1 root dialout 4, 64 Apr 4 07:54 /dev/ttyS0
has major number 4 and minor number 64.
Then you can look at
Character devices: ... 4 tty 4 ttyS
Allocation of minor numbers is device-dependent.
Some devices are driven from core kernel code (e.g.
0000000000000000 t tty_drivers_open 0000000000000000 t show_tty_range 0000000000000000 t show_tty_driver ...
0000000000000000 t rfcomm_apply_pn [rfcomm] 0000000000000000 t rfcomm_dlc_debugfs_open [rfcomm] 0000000000000000 t rfcomm_dlc_debugfs_show [rfcomm]
This method is not definitive but should give you some idea as to where the controlling code lives.