mirror of
https://git.openwrt.org/openwrt/openwrt.git/
synced 2025-10-06 03:12:40 +02:00
realtek: Refresh kernel patches
I just ran: make target/{clean,refresh} V=99
Fixes: 272a392fe1
("realtek: rtl93xx: replace pending I2C patches with upstreamed patches")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
@@ -23,11 +23,9 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-1-cd9dca0db722@narfation.org
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index e064e8a4a1f0..568495720810 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -281,6 +281,10 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -281,6 +281,10 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
ret = rtl9300_i2c_reg_addr_set(i2c, command, 1);
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
@@ -38,6 +36,3 @@ index e064e8a4a1f0..568495720810 100644
|
||||
ret = rtl9300_i2c_config_xfer(i2c, chan, addr, data->block[0]);
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -56,11 +56,9 @@ Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-2-cd9dca0db722@narfation.org
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 568495720810..4a538b266080 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -143,10 +143,10 @@ static int rtl9300_i2c_write(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -143,10 +143,10 @@ static int rtl9300_i2c_write(struct rtl9
|
||||
return -EIO;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
@@ -75,6 +73,3 @@ index 568495720810..4a538b266080 100644
|
||||
}
|
||||
|
||||
return regmap_bulk_write(i2c->regmap, i2c->reg_base + RTL9300_I2C_MST_DATA_WORD0,
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -24,11 +24,9 @@ Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-3-cd9dca0db722@narfation.org
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 4a538b266080..4a282d57e2c1 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -175,7 +175,7 @@ static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
|
||||
@@ -175,7 +175,7 @@ static int rtl9300_i2c_execute_xfer(stru
|
||||
return ret;
|
||||
|
||||
ret = regmap_read_poll_timeout(i2c->regmap, i2c->reg_base + RTL9300_I2C_MST_CTRL1,
|
||||
@@ -37,6 +35,3 @@ index 4a538b266080..4a282d57e2c1 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -30,11 +30,9 @@ Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250810-i2c-rtl9300-multi-byte-v5-4-cd9dca0db722@narfation.org
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 4a282d57e2c1..cfafe089102a 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -285,15 +285,15 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -285,15 +285,15 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
ret = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
@@ -53,6 +51,3 @@ index 4a282d57e2c1..cfafe089102a 100644
|
||||
break;
|
||||
|
||||
default:
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -27,11 +27,9 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250831100457.3114-2-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index cfafe089102a..1a63790f1957 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -353,7 +353,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -353,7 +353,7 @@ static int rtl9300_i2c_probe(struct plat
|
||||
|
||||
platform_set_drvdata(pdev, i2c);
|
||||
|
||||
@@ -40,6 +38,3 @@ index cfafe089102a..1a63790f1957 100644
|
||||
return dev_err_probe(dev, -EINVAL, "Too many channels\n");
|
||||
|
||||
device_for_each_child_node(dev, child) {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -38,11 +38,9 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250831100457.3114-3-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 1a63790f1957..2b3e80aa1bdf 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -99,6 +99,9 @@ static int rtl9300_i2c_config_xfer(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
|
||||
@@ -99,6 +99,9 @@ static int rtl9300_i2c_config_xfer(struc
|
||||
{
|
||||
u32 val, mask;
|
||||
|
||||
@@ -52,7 +50,7 @@ index 1a63790f1957..2b3e80aa1bdf 100644
|
||||
val = chan->bus_freq << RTL9300_I2C_MST_CTRL2_SCL_FREQ_OFS;
|
||||
mask = RTL9300_I2C_MST_CTRL2_SCL_FREQ_MASK;
|
||||
|
||||
@@ -323,7 +326,7 @@ static const struct i2c_algorithm rtl9300_i2c_algo = {
|
||||
@@ -323,7 +326,7 @@ static const struct i2c_algorithm rtl930
|
||||
};
|
||||
|
||||
static struct i2c_adapter_quirks rtl9300_i2c_quirks = {
|
||||
@@ -61,6 +59,3 @@ index 1a63790f1957..2b3e80aa1bdf 100644
|
||||
.max_read_len = 16,
|
||||
.max_write_len = 16,
|
||||
};
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -44,11 +44,9 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250831100457.3114-4-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 2b3e80aa1bdf..9e1f71fed0fe 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -225,15 +225,6 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -225,15 +225,6 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
}
|
||||
|
||||
switch (size) {
|
||||
@@ -64,7 +62,7 @@ index 2b3e80aa1bdf..9e1f71fed0fe 100644
|
||||
case I2C_SMBUS_BYTE:
|
||||
if (read_write == I2C_SMBUS_WRITE) {
|
||||
ret = rtl9300_i2c_config_xfer(i2c, chan, addr, 0);
|
||||
@@ -315,9 +306,9 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -315,9 +306,9 @@ out_unlock:
|
||||
|
||||
static u32 rtl9300_i2c_func(struct i2c_adapter *a)
|
||||
{
|
||||
@@ -77,6 +75,3 @@ index 2b3e80aa1bdf..9e1f71fed0fe 100644
|
||||
}
|
||||
|
||||
static const struct i2c_algorithm rtl9300_i2c_algo = {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -12,11 +12,9 @@ Fixes: ede965fd555a ("i2c: rtl9300: remove broken SMBus Quick operation support"
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 9e1f71fed0fe..af991b28e4f8 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -307,8 +307,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -307,8 +307,7 @@ out_unlock:
|
||||
static u32 rtl9300_i2c_func(struct i2c_adapter *a)
|
||||
{
|
||||
return I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA |
|
||||
@@ -26,6 +24,3 @@ index 9e1f71fed0fe..af991b28e4f8 100644
|
||||
}
|
||||
|
||||
static const struct i2c_algorithm rtl9300_i2c_algo = {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -43,11 +43,9 @@ Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
|
||||
Reviewed-by: Jonas Jelonek <jelonek.jonas@gmail.com>
|
||||
Tested-by: Jonas Jelonek <jelonek.jonas@gmail.com>
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index af991b28e4f8..9e6232075137 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -186,22 +186,32 @@ static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
|
||||
@@ -186,22 +186,32 @@ static int rtl9300_i2c_execute_xfer(stru
|
||||
return -EIO;
|
||||
|
||||
if (read_write == I2C_SMBUS_READ) {
|
||||
@@ -83,7 +81,7 @@ index af991b28e4f8..9e6232075137 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,6 +300,25 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -290,6 +300,25 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
len = data->block[0] + 1;
|
||||
break;
|
||||
|
||||
@@ -109,7 +107,7 @@ index af991b28e4f8..9e6232075137 100644
|
||||
default:
|
||||
dev_err(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
ret = -EOPNOTSUPP;
|
||||
@@ -307,7 +336,8 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -307,7 +336,8 @@ out_unlock:
|
||||
static u32 rtl9300_i2c_func(struct i2c_adapter *a)
|
||||
{
|
||||
return I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA |
|
||||
@@ -119,6 +117,3 @@ index af991b28e4f8..9e6232075137 100644
|
||||
}
|
||||
|
||||
static const struct i2c_algorithm rtl9300_i2c_algo = {
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -26,8 +26,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-2-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 9e6232075137..8483bab72146 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -23,97 +23,117 @@ struct rtl9300_i2c_chan {
|
||||
@@ -190,7 +188,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
}
|
||||
|
||||
static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -124,8 +144,7 @@ static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -124,8 +144,7 @@ static int rtl9300_i2c_read(struct rtl93
|
||||
if (len > 16)
|
||||
return -EIO;
|
||||
|
||||
@@ -200,7 +198,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -152,52 +171,49 @@ static int rtl9300_i2c_write(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -152,52 +171,49 @@ static int rtl9300_i2c_write(struct rtl9
|
||||
vals[reg] |= buf[i] << shift;
|
||||
}
|
||||
|
||||
@@ -267,7 +265,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
data->word = val & 0xffff;
|
||||
@@ -355,9 +371,11 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -355,9 +371,11 @@ static int rtl9300_i2c_probe(struct plat
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct rtl9300_i2c *i2c;
|
||||
@@ -280,7 +278,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
|
||||
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
|
||||
if (!i2c)
|
||||
@@ -376,9 +394,22 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -376,9 +394,22 @@ static int rtl9300_i2c_probe(struct plat
|
||||
|
||||
platform_set_drvdata(pdev, i2c);
|
||||
|
||||
@@ -304,7 +302,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
device_for_each_child_node(dev, child) {
|
||||
struct rtl9300_i2c_chan *chan = &i2c->chans[i];
|
||||
struct i2c_adapter *adap = &chan->adap;
|
||||
@@ -395,7 +426,6 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -395,7 +426,6 @@ static int rtl9300_i2c_probe(struct plat
|
||||
case I2C_MAX_STANDARD_MODE_FREQ:
|
||||
chan->bus_freq = RTL9300_I2C_STD_FREQ;
|
||||
break;
|
||||
@@ -312,7 +310,7 @@ index 9e6232075137..8483bab72146 100644
|
||||
case I2C_MAX_FAST_MODE_FREQ:
|
||||
chan->bus_freq = RTL9300_I2C_FAST_FREQ;
|
||||
break;
|
||||
@@ -427,11 +457,37 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -427,11 +457,37 @@ static int rtl9300_i2c_probe(struct plat
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -354,6 +352,3 @@ index 9e6232075137..8483bab72146 100644
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, i2c_rtl9300_dt_ids);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -20,8 +20,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-3-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
index 69ac5db8b914..274e2ab8b612 100644
|
||||
--- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
+++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
@@ -10,7 +10,7 @@ maintainers:
|
||||
@@ -51,6 +49,3 @@ index 69ac5db8b914..274e2ab8b612 100644
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -19,8 +19,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-4-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 8483bab72146..f9b5ac7670c2 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -20,7 +20,7 @@ struct rtl9300_i2c_chan {
|
||||
@@ -41,7 +39,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
struct mutex lock;
|
||||
};
|
||||
|
||||
@@ -102,11 +102,11 @@ static int rtl9300_i2c_config_io(struct rtl9300_i2c *i2c, u8 sda_pin)
|
||||
@@ -102,11 +102,11 @@ static int rtl9300_i2c_config_io(struct
|
||||
|
||||
drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev);
|
||||
|
||||
@@ -55,7 +53,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -243,11 +243,11 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -243,11 +243,11 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
int len = 0, ret;
|
||||
|
||||
mutex_lock(&i2c->lock);
|
||||
@@ -69,7 +67,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
}
|
||||
|
||||
switch (size) {
|
||||
@@ -374,7 +374,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -374,7 +374,7 @@ static int rtl9300_i2c_probe(struct plat
|
||||
struct fwnode_handle *child;
|
||||
struct rtl9300_i2c_drv_data *drv_data;
|
||||
struct reg_field fields[F_NUM_FIELDS];
|
||||
@@ -78,7 +76,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
int ret, i = 0;
|
||||
|
||||
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
|
||||
@@ -414,7 +414,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -414,7 +414,7 @@ static int rtl9300_i2c_probe(struct plat
|
||||
struct rtl9300_i2c_chan *chan = &i2c->chans[i];
|
||||
struct i2c_adapter *adap = &chan->adap;
|
||||
|
||||
@@ -87,7 +85,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -431,11 +431,11 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -431,11 +431,11 @@ static int rtl9300_i2c_probe(struct plat
|
||||
break;
|
||||
default:
|
||||
dev_warn(i2c->dev, "SDA%d clock-frequency %d not supported using default\n",
|
||||
@@ -101,7 +99,7 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
chan->i2c = i2c;
|
||||
adap = &i2c->chans[i].adap;
|
||||
adap->owner = THIS_MODULE;
|
||||
@@ -445,14 +445,14 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -445,14 +445,14 @@ static int rtl9300_i2c_probe(struct plat
|
||||
adap->dev.parent = dev;
|
||||
i2c_set_adapdata(adap, chan);
|
||||
adap->dev.of_node = to_of_node(child);
|
||||
@@ -118,6 +116,3 @@ index 8483bab72146..f9b5ac7670c2 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -16,11 +16,9 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-5-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index f9b5ac7670c2..4177cfb77094 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -95,18 +95,23 @@ static int rtl9300_i2c_select_scl(struct rtl9300_i2c *i2c, u8 scl)
|
||||
@@ -95,18 +95,23 @@ static int rtl9300_i2c_select_scl(struct
|
||||
return regmap_field_write(i2c->fields[F_SCL_SEL], 1);
|
||||
}
|
||||
|
||||
@@ -47,7 +45,7 @@ index f9b5ac7670c2..4177cfb77094 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -121,10 +126,6 @@ static int rtl9300_i2c_config_xfer(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
|
||||
@@ -121,10 +126,6 @@ static int rtl9300_i2c_config_xfer(struc
|
||||
if (len < 1 || len > 16)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -58,7 +56,7 @@ index f9b5ac7670c2..4177cfb77094 100644
|
||||
ret = regmap_field_write(i2c->fields[F_DEV_ADDR], addr);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -244,7 +245,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -244,7 +245,7 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
|
||||
mutex_lock(&i2c->lock);
|
||||
if (chan->sda_num != i2c->sda_num) {
|
||||
@@ -67,6 +65,3 @@ index f9b5ac7670c2..4177cfb77094 100644
|
||||
if (ret)
|
||||
goto out_unlock;
|
||||
i2c->sda_num = chan->sda_num;
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -20,11 +20,9 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-6-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 4177cfb77094..9e3517b09b3d 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -130,11 +130,7 @@ static int rtl9300_i2c_config_xfer(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
|
||||
@@ -130,11 +130,7 @@ static int rtl9300_i2c_config_xfer(struc
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -37,7 +35,7 @@ index 4177cfb77094..9e3517b09b3d 100644
|
||||
}
|
||||
|
||||
static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -455,6 +451,11 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -455,6 +451,11 @@ static int rtl9300_i2c_probe(struct plat
|
||||
}
|
||||
i2c->sda_num = 0xff;
|
||||
|
||||
@@ -49,6 +47,3 @@ index 4177cfb77094..9e3517b09b3d 100644
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -41,8 +41,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-7-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -8,6 +8,7 @@
|
||||
@@ -76,7 +74,7 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
#define RTL9300_I2C_MST_CTRL1 0x0
|
||||
#define RTL9300_I2C_MST_CTRL2 0x4
|
||||
#define RTL9300_I2C_MST_DATA_WORD0 0x8
|
||||
@@ -95,45 +112,37 @@ static int rtl9300_i2c_select_scl(struct rtl9300_i2c *i2c, u8 scl)
|
||||
@@ -95,45 +112,37 @@ static int rtl9300_i2c_select_scl(struct
|
||||
return regmap_field_write(i2c->fields[F_SCL_SEL], 1);
|
||||
}
|
||||
|
||||
@@ -134,7 +132,7 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
{
|
||||
u32 vals[4] = {};
|
||||
int i, ret;
|
||||
@@ -153,7 +162,7 @@ static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, int len)
|
||||
@@ -153,7 +162,7 @@ static int rtl9300_i2c_read(struct rtl93
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -143,7 +141,7 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
{
|
||||
u32 vals[4] = {};
|
||||
int i;
|
||||
@@ -176,16 +185,51 @@ static int rtl9300_i2c_writel(struct rtl9300_i2c *i2c, u32 data)
|
||||
@@ -176,16 +185,51 @@ static int rtl9300_i2c_writel(struct rtl
|
||||
return regmap_write(i2c->regmap, i2c->data_reg, data);
|
||||
}
|
||||
|
||||
@@ -159,9 +157,9 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ ret = regmap_field_write(i2c->fields[F_DEV_ADDR], xfer->dev_addr);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ ret = rtl9300_i2c_reg_addr_set(i2c, xfer->reg_addr, xfer->reg_addr_len);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
@@ -171,9 +169,9 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = regmap_field_write(i2c->fields[F_DATA_WIDTH], (xfer->data_len - 1) & 0xf);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (xfer->write) {
|
||||
+ switch (xfer->type) {
|
||||
+ case RTL9300_I2C_XFER_BYTE:
|
||||
@@ -199,7 +197,7 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
ret = regmap_field_write(i2c->fields[F_I2C_TRIG], 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -200,28 +244,24 @@ static int rtl9300_i2c_execute_xfer(struct rtl9300_i2c *i2c, char read_write,
|
||||
@@ -200,28 +244,24 @@ static int rtl9300_i2c_execute_xfer(stru
|
||||
if (val)
|
||||
return -EIO;
|
||||
|
||||
@@ -237,7 +235,7 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
@@ -237,108 +277,62 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -237,108 +277,62 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
{
|
||||
struct rtl9300_i2c_chan *chan = i2c_get_adapdata(adap);
|
||||
struct rtl9300_i2c *i2c = chan->i2c;
|
||||
@@ -382,6 +380,3 @@ index 9e3517b09b3d..fb3ebbd46a18 100644
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&i2c->lock);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -17,8 +17,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-8-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index fb3ebbd46a18..c67463228604 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -72,6 +72,8 @@ struct rtl9300_i2c {
|
||||
@@ -30,7 +28,7 @@ index fb3ebbd46a18..c67463228604 100644
|
||||
enum rtl9300_i2c_xfer_type {
|
||||
RTL9300_I2C_XFER_BYTE,
|
||||
RTL9300_I2C_XFER_WORD,
|
||||
@@ -283,11 +285,11 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -283,11 +285,11 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
if (addr > 0x7f)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -44,7 +42,7 @@ index fb3ebbd46a18..c67463228604 100644
|
||||
|
||||
xfer.dev_addr = addr & 0x7f;
|
||||
xfer.write = (read_write == I2C_SMBUS_WRITE);
|
||||
@@ -324,20 +326,14 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s
|
||||
@@ -324,20 +326,14 @@ static int rtl9300_i2c_smbus_xfer(struct
|
||||
break;
|
||||
default:
|
||||
dev_err(&adap->dev, "Unsupported transaction %d\n", size);
|
||||
@@ -68,6 +66,3 @@ index fb3ebbd46a18..c67463228604 100644
|
||||
}
|
||||
|
||||
static u32 rtl9300_i2c_func(struct i2c_adapter *a)
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -22,8 +22,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-9-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
index 274e2ab8b612..17ce39c19ab1 100644
|
||||
--- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
+++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
|
||||
@@ -13,6 +13,8 @@ description:
|
||||
@@ -94,6 +92,3 @@ index 274e2ab8b612..17ce39c19ab1 100644
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
@@ -21,8 +21,6 @@ Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
|
||||
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20250927101931.71575-10-jelonek.jonas@gmail.com
|
||||
|
||||
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
index c67463228604..4723e48cfe18 100644
|
||||
--- a/drivers/i2c/busses/i2c-rtl9300.c
|
||||
+++ b/drivers/i2c/busses/i2c-rtl9300.c
|
||||
@@ -60,14 +60,16 @@ struct rtl9300_i2c_drv_data {
|
||||
@@ -56,7 +54,7 @@ index c67463228604..4723e48cfe18 100644
|
||||
static int rtl9300_i2c_reg_addr_set(struct rtl9300_i2c *i2c, u32 reg, u16 len)
|
||||
{
|
||||
int ret;
|
||||
@@ -114,6 +122,11 @@ static int rtl9300_i2c_select_scl(struct rtl9300_i2c *i2c, u8 scl)
|
||||
@@ -114,6 +122,11 @@ static int rtl9300_i2c_select_scl(struct
|
||||
return regmap_field_write(i2c->fields[F_SCL_SEL], 1);
|
||||
}
|
||||
|
||||
@@ -68,7 +66,7 @@ index c67463228604..4723e48cfe18 100644
|
||||
static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan)
|
||||
{
|
||||
struct rtl9300_i2c_drv_data *drv_data;
|
||||
@@ -127,7 +140,7 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
|
||||
@@ -127,7 +140,7 @@ static int rtl9300_i2c_config_chan(struc
|
||||
return ret;
|
||||
|
||||
drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev);
|
||||
@@ -77,7 +75,7 @@ index c67463228604..4723e48cfe18 100644
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -361,7 +374,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -361,7 +374,7 @@ static int rtl9300_i2c_probe(struct plat
|
||||
struct fwnode_handle *child;
|
||||
struct rtl9300_i2c_drv_data *drv_data;
|
||||
struct reg_field fields[F_NUM_FIELDS];
|
||||
@@ -86,7 +84,7 @@ index c67463228604..4723e48cfe18 100644
|
||||
int ret, i = 0;
|
||||
|
||||
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
|
||||
@@ -379,6 +392,11 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
|
||||
@@ -379,6 +392,11 @@ static int rtl9300_i2c_probe(struct plat
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -98,7 +96,7 @@ index c67463228604..4723e48cfe18 100644
|
||||
platform_set_drvdata(pdev, i2c);
|
||||
|
||||
drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev);
|
||||
@@ -474,12 +492,35 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_drv_data = {
|
||||
@@ -474,12 +492,35 @@ static const struct rtl9300_i2c_drv_data
|
||||
.max_nchan = RTL9300_I2C_MUX_NCHAN,
|
||||
};
|
||||
|
||||
@@ -134,6 +132,3 @@ index c67463228604..4723e48cfe18 100644
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, i2c_rtl9300_dt_ids);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
Reference in New Issue
Block a user