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