[v2,0/3] Add support for DEVNAME:0.0 style hardware based addressing

Message ID 20230912110350.14482-1-tony@atomide.com
Headers
Series Add support for DEVNAME:0.0 style hardware based addressing |

Message

Tony Lindgren Sept. 12, 2023, 11:03 a.m. UTC
  Hi all,

With the recent serial core changes in v6.5, we can now add DEVNAME:0.0
style addressing for the serial ports. When using DEVNAME:0.0 naming, we
don't need to care which ttyS instance number is allocated depending on
HSUART settings or if the devicetree has added aliases for all the ports.

With these changes the port mapping is visible for usespace in sysfs with:

$ grep DEVNAME /sys/bus/serial-base/devices/*/tty/uevent

Regards,

Tony

Changes since v1:

- Constify printk add_preferred_console() as suggested by Jiri

- Use proper kernel command line helpers for parsing console as
  suggested by Jiri

- Update description for HSUART based on Andy's comments

- Standardize on DEVNAME:0.0 style naming as suggested by Andy

- Added missing put_device() calls paired with device_find_child()

Tony Lindgren (3):
  printk: Constify name for add_preferred_console()
  serial: core: Add support for DEVNAME:0.0 style naming for kernel
    console
  serial: core: Add sysfs links for serial core port instances for ttys

 drivers/tty/serial/Makefile          |   3 +
 drivers/tty/serial/serial_base.h     |  11 +++
 drivers/tty/serial/serial_base_con.c | 133 +++++++++++++++++++++++++++
 drivers/tty/serial/serial_core.c     |  26 ++++++
 include/linux/console.h              |   2 +-
 kernel/printk/printk.c               |   4 +-
 6 files changed, 176 insertions(+), 3 deletions(-)
 create mode 100644 drivers/tty/serial/serial_base_con.c


base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c