311-add-i2c-mux-rtl9300-support.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From f4bdb7fdccdfe3fa382abe77f72a16c2f2e6add0 Mon Sep 17 00:00:00 2001
  2. From: Birger Koblitz <[email protected]>
  3. Date: Sat, 11 Dec 2021 20:25:37 +0100
  4. Subject: [PATCH] realtek: Add support for RTL9300/RTL9310 I2C multiplexing
  5. The RTL9300/RTL9310 I2C controllers have support for 2 independent I2C
  6. masters, each with a fixed SCL pin, that cannot be changed. Each of these
  7. masters can use 8 (RTL9300) or 16 (RTL9310) different pins for SDA.
  8. This multiplexer directly controls the two masters and their shared
  9. IO configuration registers to allow multiplexing between any of these
  10. busses. The two masters cannot be used in parallel as the multiplex
  11. is protected by a standard multiplex lock.
  12. Submitted-by: Birger Koblitz <[email protected]>
  13. ---
  14. drivers/i2c/muxes/Kconfig | 9 +++++++
  15. drivers/i2c/muxes/Makefile | 1 +
  16. 2 files changed, 10 insertions(+)
  17. --- a/drivers/i2c/muxes/Kconfig
  18. +++ b/drivers/i2c/muxes/Kconfig
  19. @@ -99,6 +99,15 @@ config I2C_MUX_REG
  20. This driver can also be built as a module. If so, the module
  21. will be called i2c-mux-reg.
  22. +config I2C_MUX_RTL9300
  23. + tristate "RTL9300 based I2C multiplexer"
  24. + help
  25. + If you say yes to this option, support will be included for a
  26. + RTL9300 based I2C multiplexer.
  27. +
  28. + This driver can also be built as a module. If so, the module
  29. + will be called i2c-mux-reg.
  30. +
  31. config I2C_DEMUX_PINCTRL
  32. tristate "pinctrl-based I2C demultiplexer"
  33. depends on PINCTRL && OF
  34. --- a/drivers/i2c/muxes/Makefile
  35. +++ b/drivers/i2c/muxes/Makefile
  36. @@ -14,5 +14,6 @@ obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux
  37. obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o
  38. obj-$(CONFIG_I2C_MUX_PINCTRL) += i2c-mux-pinctrl.o
  39. obj-$(CONFIG_I2C_MUX_REG) += i2c-mux-reg.o
  40. +obj-$(CONFIG_I2C_MUX_RTL9300) += i2c-mux-rtl9300.o
  41. ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG