i3c: switch to use switch to use i3c_xfer from i3c_priv_xfer
Subsystems (7)
Frank Li
reviewercover i3c: switch to use switch to use i3c_xfer from i3c_priv_xfer
This depend on the serise
https://lore.kernel.org/linux-i3c/[email protected]/T/#t
Convert all existed i3c consumer to new API.
The below patch need be applied after other patch applied to avoid build break.
i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()
---
Frank Li (4):
hwmon: (lm75): switch to use i3c_xfer from i3c_priv_xfer
net: mctp i3c: switch to use i3c_xfer from i3c_priv_xfer
regmap: i3c: switch to use i3c_xfer from i3c_priv_xfer
i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()
drivers/base/regmap/regmap-i3c.c | 8 ++++---- drivers/hwmon/lm75.c | 8 ++++---- drivers/net/mctp/mctp-i3c.c | 8 ++++---- include/linux/i3c/device.h | 12 +----------- 4 files changed, 13 insertions(+), 23 deletions(-)
---
base-commit: 689aa5c47412a17e4c71d63c35b263da10fa2184
change-id: 20251027-lm75-cbbff8014818
Best regards,
--
Frank Li <[email protected]>
Frank Li
reviewerPATCH 1/4 hwmon: (lm75): switch to use i3c_xfer from i3c_priv_xfer
Switch to use i3c_xfer instead of i3c_priv_xfer because framework will update to support HDR mode. i3c_priv_xfer is now an alias of i3c_xfer.
Replace i3c_device_do_priv_xfers() with i3c_device_do_xfers(..., I3C_SDR) to align with the new API.
Prepare for removal of i3c_priv_xfer and i3c_device_do_priv_xfers().
---
this patch depend on
https://lore.kernel.org/linux-i3c/[email protected]/T/#t
--- drivers/hwmon/lm75.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/lm75.c +4 -4
@@ -621,7 +621,7 @@ static int lm75_i3c_reg_read(void *context, unsigned int reg, unsigned int *val) {struct i3c_device *i3cdev = context;struct lm75_data *data =i3cdev_get_drvdata (i3cdev); -struct i3c_priv_xfer xfers[] = { +struct i3c_xfer xfers[] = { { .rnw = false, .len =1 ,
@@ -640,7 +640,7 @@ static int lm75_i3c_reg_read(void *context, unsigned int reg, unsigned int *val)if (reg ==LM75_REG_CONF && !data->params->config_reg_16bits) xfers[1 ].len--; - ret =i3c_device_do_priv_xfers (i3cdev, xfers,2 ); + ret =i3c_device_do_xfers (i3cdev, xfers,2 ,I3C_SDR );if (ret <0 )return ret;
@@ -658,7 +658,7 @@ static int lm75_i3c_reg_write(void *context, unsigned int reg, unsigned int val) {struct i3c_device *i3cdev = context;struct lm75_data *data =i3cdev_get_drvdata (i3cdev); -struct i3c_priv_xfer xfers[] = { +struct i3c_xfer xfers[] = { { .rnw = false, .len =3 ,
@@ -680,7 +680,7 @@ static int lm75_i3c_reg_write(void *context, unsigned int reg, unsigned int val) data->val_buf[2 ] = val &0xff ; } -return i3c_device_do_priv_xfers (i3cdev, xfers,1 ); +return i3c_device_do_xfers (i3cdev, xfers,1 ,I3C_SDR ); }static const struct regmap_bus lm75_i3c_regmap_bus = {
Signature · 1 line
2.34.1
Re: [PATCH 1/4] hwmon: (lm75): switch to use i3c_xfer from i3c_priv_xfer
Quoted 9 lines · Frank Li
Switch to use
i3c_xferinstead ofi3c_priv_xferbecause framework will update to support HDR mode.i3c_priv_xferis now an alias ofi3c_xfer.Replace
i3c_device_do_priv_xfers()withi3c_device_do_xfers(..., I3C_SDR)to align with the new API.Prepare for removal of
i3c_priv_xferandi3c_device_do_priv_xfers().Signed-off-by Frank Li <[email protected]>
I assume this will be submitted through the i2c/i3c tree when ready.
Frank Li
reviewerPATCH 2/4 net: mctp i3c: switch to use i3c_xfer from i3c_priv_xfer
In reply to Frank LiSwitch to use i3c_xfer instead of i3c_priv_xfer because framework will update to support HDR mode. i3c_priv_xfer is now an alias of i3c_xfer.
Replace i3c_device_do_priv_xfers() with i3c_device_do_xfers(..., I3C_SDR) to align with the new API.
Prepare for removal of i3c_priv_xfer and i3c_device_do_priv_xfers().
--- drivers/net/mctp/mctp-i3c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/mctp/mctp-i3c.c +4 -4
@@ -99,7 +99,7 @@ struct mctp_i3c_internal_hdr {static int mctp_i3c_read (struct mctp_i3c_device *mi) { -struct i3c_priv_xfer xfer = { .rnw =1 , .len = mi->mrl }; +struct i3c_xfer xfer = { .rnw =1 , .len = mi->mrl };struct net_device_stats *stats = &mi->mbus->ndev->stats;struct mctp_i3c_internal_hdr *ihdr =NULL ;struct sk_buff *skb =NULL ;
@@ -127,7 +127,7 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)/* Make sure netif_rx() is read in the same order as i3c. */ mutex_lock (&mi->lock); - rc =i3c_device_do_priv_xfers (mi->i3c, &xfer,1 ); + rc =i3c_device_do_xfers (mi->i3c, &xfer,1 ,I3C_SDR );if (rc <0 ) goto err;
@@ -360,7 +360,7 @@ mctp_i3c_lookup(struct mctp_i3c_bus *mbus, u64 pid)static void mctp_i3c_xmit (struct mctp_i3c_bus *mbus,struct sk_buff *skb) {struct net_device_stats *stats = &mbus->ndev->stats; -struct i3c_priv_xfer xfer = { .rnw = false }; +struct i3c_xfer xfer = { .rnw = false };struct mctp_i3c_internal_hdr *ihdr =NULL ;struct mctp_i3c_device *mi =NULL ;unsigned int data_len;
@@ -409,7 +409,7 @@ static void mctp_i3c_xmit(struct mctp_i3c_bus *mbus, struct sk_buff *skb) data[data_len] = pec; xfer.data.out = data; - rc =i3c_device_do_priv_xfers (mi->i3c, &xfer,1 ); + rc =i3c_device_do_xfers (mi->i3c, &xfer,1 ,I3C_SDR );if (rc ==0 ) { stats->tx_bytes += data_len; stats->tx_packets++;
Signature · 1 line
2.34.1
Re: [PATCH 2/4] net: mctp i3c: switch to use i3c_xfer from i3c_priv_xfer
Quoted 7 lines · Frank Li
Switch to use
i3c_xferinstead ofi3c_priv_xferbecause framework will update to support HDR mode.i3c_priv_xferis now an alias ofi3c_xfer.Replace
i3c_device_do_priv_xfers()withi3c_device_do_xfers(..., I3C_SDR)to align with the new API.Prepare for removal of
i3c_priv_xferandi3c_device_do_priv_xfers().
Frank Li
reviewerPATCH 3/4 regmap: i3c: switch to use i3c_xfer from i3c_priv_xfer
In reply to Frank LiSwitch to use i3c_xfer instead of i3c_priv_xfer because framework will update to support HDR mode. i3c_priv_xfer is now an alias of i3c_xfer.
Replace i3c_device_do_priv_xfers() with i3c_device_do_xfers(..., I3C_SDR) to align with the new API.
Prepare for removal of i3c_priv_xfer and i3c_device_do_priv_xfers().
--- drivers/base/regmap/regmap-i3c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/base/regmap/regmap-i3c.c +4 -4
@@ -10,7 +10,7 @@ static int regmap_i3c_write(void *context, const void *data, size_t count) {struct device *dev = context;struct i3c_device *i3c =dev_to_i3cdev (dev); -struct i3c_priv_xfer xfers[] = { +struct i3c_xfer xfers[] = { { .rnw = false, .len = count,
@@ -18,7 +18,7 @@ static int regmap_i3c_write(void *context, const void *data, size_t count) }, }; -return i3c_device_do_priv_xfers (i3c, xfers,1 ); +return i3c_device_do_xfers (i3c, xfers,1 ,I3C_SDR ); } static int regmap_i3c_read(void *context,
@@ -27,7 +27,7 @@ static int regmap_i3c_read(void *context, {struct device *dev = context;struct i3c_device *i3c =dev_to_i3cdev (dev); -struct i3c_priv_xfer xfers[2 ]; +struct i3c_xfer xfers[2 ]; xfers[0 ].rnw = false; xfers[0 ].len = reg_size;
@@ -37,7 +37,7 @@ static int regmap_i3c_read(void *context, xfers[1 ].len = val_size; xfers[1 ].data.in = val; -return i3c_device_do_priv_xfers (i3c, xfers,2 ); +return i3c_device_do_xfers (i3c, xfers,2 ,I3C_SDR ); }static const struct regmap_bus regmap_i3c = {
Signature · 1 line
2.34.1
Re: [PATCH 3/4] regmap: i3c: switch to use i3c_xfer from i3c_priv_xfer
Quoted 7 lines · Frank Li
Switch to use
i3c_xferinstead ofi3c_priv_xferbecause framework will update to support HDR mode.i3c_priv_xferis now an alias ofi3c_xfer.Replace
i3c_device_do_priv_xfers()withi3c_device_do_xfers(..., I3C_SDR)to align with the new API.Prepare for removal of
i3c_priv_xferandi3c_device_do_priv_xfers().
Frank Li
reviewerPATCH 4/4 i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()
In reply to Frank LiDrop i3c_priv_xfer and i3c_device_do_priv_xfers() after all driver switch to use new API.
---
This patch need be applied after all other patches applied.
--- include/linux/i3c/device.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
include/linux/i3c/device.h +1 -11
@@ -25,7 +25,7 @@* @I3C_ERROR_M2: M2 error * * These are the standard error codes as defined by the I3C specification. -* When -EIO is returned by the i3c_device_do_priv_xfers() or +* When -EIO is returned by the i3c_device_do_i3c_xfers() or * i3c_device_send_hdr_cmds() one can check the error code in * &struct_i3c_xfer.err or &struct i3c_hdr_cmd.err to get a better idea of * what went wrong.
@@ -79,9 +79,6 @@ struct i3c_xfer {enum i3c_error_code err; }; -/* keep back compatible */ -#define i3c_priv_xfer i3c_xfer -/** * enum i3c_dcr - I3C DCR values * @I3C_DCR_GENERIC_DEVICE: generic I3C device
@@ -311,13 +308,6 @@ static __always_inline void i3c_i2c_driver_unregister(struct i3c_driver *i3cdrv,int i3c_device_do_xfers (struct i3c_device *dev,struct i3c_xfer *xfers,int nxfers,enum i3c_xfer_mode mode); -static inline int i3c_device_do_priv_xfers (struct i3c_device *dev, -struct i3c_xfer *xfers, -int nxfers) -{ -return i3c_device_do_xfers (dev, xfers, nxfers,I3C_SDR ); -} -int i3c_device_do_setdasa (struct i3c_device *dev);void i3c_device_get_info (const struct i3c_device *dev,struct i3c_device_info *info);
Signature · 1 line
2.34.1
Alexandre Belloni
maintainerRe: [PATCH 4/4] i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()
Hello Frank,
You'll have to rebase this patch.
Quoted 51 lines · Frank Li
Drop
i3c_priv_xferandi3c_device_do_priv_xfers()after all driver switch to use new API.Signed-off-by Frank Li <[email protected]>---
This patch need be applied after all other patches applied.--- include/linux/i3c/device.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)include/linux/i3c/device.h +1
-11@@ -25,7 +25,7 @@* @I3C_ERROR_M2: M2 error * * These are the standard error codes as defined by the I3C specification. -* When -EIO is returned by the i3c_device_do_priv_xfers() or +* When -EIO is returned by the i3c_device_do_i3c_xfers() or * i3c_device_send_hdr_cmds() one can check the error code in * &struct_i3c_xfer.err or &struct i3c_hdr_cmd.err to get a better idea of * what went wrong. @@ -79,9 +79,6 @@ struct i3c_xfer {enum i3c_error_code err; }; -/* keep back compatible */ -#define i3c_priv_xfer i3c_xfer -/** * enum i3c_dcr - I3C DCR values * @I3C_DCR_GENERIC_DEVICE: generic I3C device @@ -311,13 +308,6 @@ static __always_inline void i3c_i2c_driver_unregister(struct i3c_driver *i3cdrv,int i3c_device_do_xfers (struct i3c_device *dev,struct i3c_xfer *xfers,int nxfers,enum i3c_xfer_mode mode); -static inline int i3c_device_do_priv_xfers (struct i3c_device *dev, -struct i3c_xfer *xfers, -int nxfers) -{ -return i3c_device_do_xfers (dev, xfers, nxfers,I3C_SDR ); -} -int i3c_device_do_setdasa (struct i3c_device *dev);void i3c_device_get_info (const struct i3c_device *dev,struct i3c_device_info *info);Signature · 2 lines
-- 2.34.1
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 10 lines · Frank Li
This depend on the serise
https://lore.kernel.org/linux-i3c/[email protected]/T/#tConvert all existed i3c consumer to new API.
The below patch need be applied after other patch applied to avoid build break.
i3c: dropi3c_priv_xferandi3c_device_do_priv_xfers()[...]
Applied, thanks!
[1/4] hwmon: (lm75): switch to use i3c_xfer from i3c_priv_xfer
https://git.kernel.org/abelloni/c/1f08a91cec5f [2/4] net: mctp i3c: switch to use i3c_xfer from i3c_priv_xfer https://git.kernel.org/abelloni/c/57c4011d3637 [3/4] regmap: i3c: switch to use i3c_xfer from i3c_priv_xfer https://git.kernel.org/abelloni/c/79c3ae7ada05
Best regards,
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com