Skip to contentSkip to conversation

iio: adc: ad4062: Switch from struct i3c_priv_xfer to struct i3c_xfer

PATCH In review Jonathan Cameron 5 participants 7 messages Jan 19 – Jan 20

Subsystems (3)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio: adc: ad4062: Switch from struct i3c_priv_xfer to struct i3c_xfer

From: Jonathan Cameron <[email protected]>

commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()") currently in the i3c/for-next tree removes the deprecated
struct i3c_priv_xfer and i3c_device_do_priv_xfers().

Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR) now rather causing a build issue when both trees are merged.

---
I'm already carrying this on my tree to resolve the issue in next but feedback still welcome!

---
 drivers/iio/adc/ad4062.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/iio/adc/ad4062.c +13 -13
index a6b3ccc98acf..dd4ad32aa6f5 100644
@@ -468,13 +468,13 @@ static int ad4062_set_operation_mode(struct ad4062_state *st,
 
 	if (mode == AD4062_MONITOR_MODE) {
 		/* Change address pointer to enter monitor mode */
-		struct i3c_priv_xfer xfer_trigger = {
+		struct i3c_xfer xfer_trigger = {
 			.data.out = &st->conv_addr,
 			.len = sizeof(st->conv_addr),
 			.rnw = false,
 		};
 		st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
-		return i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
+		return i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
 	}
 
 	return regmap_write(st->regmap, AD4062_REG_MODE_SET,
@@ -607,18 +607,18 @@ static void ad4062_trigger_work(struct work_struct *work)
 	 * Read current conversion, if at reg CONV_READ, stop bit triggers
 	 * next sample and does not need writing the address.
 	 */
-	struct i3c_priv_xfer xfer_sample = {
+	struct i3c_xfer xfer_sample = {
 		.data.in = &st->buf.be32,
 		.len = st->conv_sizeof,
 		.rnw = true,
 	};
-	struct i3c_priv_xfer xfer_trigger = {
+	struct i3c_xfer xfer_trigger = {
 		.data.out = &st->conv_addr,
 		.len = sizeof(st->conv_addr),
 		.rnw = false,
 	};
 
-	ret = i3c_device_do_priv_xfers(st->i3cdev, &xfer_sample, 1);
+	ret = i3c_device_do_xfers(st->i3cdev, &xfer_sample, 1, I3C_SDR);
 	if (ret)
 		return;
 
@@ -627,7 +627,7 @@ static void ad4062_trigger_work(struct work_struct *work)
 	if (st->gpo_irq[1])
 		return;
 
-	i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
+	i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
 }
 
 static irqreturn_t ad4062_poll_handler(int irq, void *p)
@@ -852,12 +852,12 @@ static int ad4062_set_chan_calibscale(struct ad4062_state *st, int gain_int,
 static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 {
 	struct i3c_device *i3cdev = st->i3cdev;
-	struct i3c_priv_xfer xfer_trigger = {
+	struct i3c_xfer xfer_trigger = {
 		.data.out = &st->conv_addr,
 		.len = sizeof(st->conv_addr),
 		.rnw = false,
 	};
-	struct i3c_priv_xfer xfer_sample = {
+	struct i3c_xfer xfer_sample = {
 		.data.in = &st->buf.be32,
 		.len = sizeof(st->buf.be32),
 		.rnw = true,
@@ -876,7 +876,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 	reinit_completion(&st->completion);
 	/* Change address pointer to trigger conversion */
 	st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
-	ret = i3c_device_do_priv_xfers(i3cdev, &xfer_trigger, 1);
+	ret = i3c_device_do_xfers(i3cdev, &xfer_trigger, 1, I3C_SDR);
 	if (ret)
 		return ret;
 	/*
@@ -888,7 +888,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 	if (!ret)
 		return -ETIMEDOUT;
 
-	ret = i3c_device_do_priv_xfers(i3cdev, &xfer_sample, 1);
+	ret = i3c_device_do_xfers(i3cdev, &xfer_sample, 1, I3C_SDR);
 	if (ret)
 		return ret;
 	*val = be32_to_cpu(st->buf.be32);
@@ -1236,7 +1236,7 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
 	st->conv_sizeof = ad4062_sizeof_storagebits(st);
 	st->conv_addr = ad4062_get_conv_addr(st, st->conv_sizeof);
 	/* CONV_READ requires read to trigger first sample. */
-	struct i3c_priv_xfer xfer_sample[2] = {
+	struct i3c_xfer xfer_sample[2] = {
 		{
 			.data.out = &st->conv_addr,
 			.len = sizeof(st->conv_addr),
@@ -1249,8 +1249,8 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
 		}
 	};
 
-	return i3c_device_do_priv_xfers(st->i3cdev, xfer_sample,
-					st->gpo_irq[1] ? 2 : 1);
+	return i3c_device_do_xfers(st->i3cdev, xfer_sample,
+				   st->gpo_irq[1] ? 2 : 1, I3C_SDR);
 }
 
 static int ad4062_triggered_buffer_postenable(struct iio_dev *indio_dev)
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Jonathan Cameron

commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()")

Commit ?
The commit ?

Quoted 5 lines

currently in the i3c/for-next tree removes the deprecated struct i3c_priv_xfer and i3c_device_do_priv_xfers().

Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR) now rather causing a build issue when both trees are merged.

Not sure if we need a Fixes tag.

Quoted 4 lines

Can we move this to be after the '---' cutter line?

Quoted 3 lines

---
I'm already carrying this on my tree to resolve the issue in next but feedback still welcome!

The rest is fine to me.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 7 lines · On Tue, 20 Jan 2026 09:19:47 +0200 Andy Shevchenko…
Quoted 1 line · Jonathan Cameron

commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()")

Commit ?
The commit ?

Quoted 7 lines
Quoted 5 lines

currently in the i3c/for-next tree removes the deprecated struct i3c_priv_xfer and i3c_device_do_priv_xfers().

Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR) now rather causing a build issue when both trees are merged.

Not sure if we need a Fixes tag.

I was lazy. Both this and the original patch will go in together so low risk, but indeed it should have a fixes tag.

Quoted 7 lines
Quoted 5 lines

Can we move this to be after the '---' cutter line?

When I really want someone to review / test I tend to put them above the --- so that I remember to poke them if they don't and I want them to be included in any follow on threads.

More FYI type +CC below the line. Mostly I just add them to the send list however rather than having a Cc at all.

Quoted 7 lines
Quoted 4 lines

---
I'm already carrying this on my tree to resolve the issue in next but feedback still welcome!

The rest is fine to me.

Thanks for the quick response!

J

Quoted 1 line
#3 lore raw
Quoted 3 lines · Jonathan Cameron
Quoted 1 line · On Tue, 20 Jan 2026 09:19:47 +0200 Andy Shevchenko…

On Mon, Jan 19, 2026 at 09:36:17PM +0000, Jonathan Cameron wrote:

...

Quoted 10 lines
Quoted 3 lines
Quoted 1 line

Can we move this to be after the '---' cutter line?

When I really want someone to review / test I tend to put them above the --- so that I remember to poke them if they don't and I want them to be included in any follow on threads.

More FYI type +CC below the line. Mostly I just add them to the send list however rather than having a Cc at all.

The trick is that you can add

---
Cc: ...
Cc: ...

to the commit message in your local tree. It will be kept and represented in git format-patch.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#4 lore raw
Quoted 19 lines · On Tue, 20 Jan 2026 12:03:57 +0200 Andy Shevchenko <[email protected]>…
Quoted 3 lines · Jonathan Cameron
Quoted 1 line · On Tue, 20 Jan 2026 09:19:47 +0200 Andy Shevchenko…

On Mon, Jan 19, 2026 at 09:36:17PM +0000, Jonathan Cameron wrote:

...

Quoted 10 lines
Quoted 3 lines
Quoted 1 line

Can we move this to be after the '---' cutter line?

When I really want someone to review / test I tend to put them above the --- so that I remember to poke them if they don't and I want them to be included in any follow on threads.

More FYI type +CC below the line. Mostly I just add them to the send list however rather than having a Cc at all.

Quoted 9 lines

The trick is that you can add

---
Cc: ...
Cc: ...

to the commit message in your local tree. It will be kept and represented in git format-patch.

I do. This is more pointed because I see it when I use b4 to pick my own patches up from this list ;)

Anyhow, for one or two I don't think the commit log mess matters much.

J

author maintainer
#5 lore raw
Quoted 28 lines · On Tue, 20 Jan 2026 21:44:30 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 25 lines · On Tue, 20 Jan 2026 12:03:57 +0200 Andy Shevchenko <[email protected]>…
Quoted 3 lines · Jonathan Cameron
Quoted 1 line · On Tue, 20 Jan 2026 09:19:47 +0200 Andy Shevchenko…

On Mon, Jan 19, 2026 at 09:36:17PM +0000, Jonathan Cameron wrote:

...

Quoted 10 lines
Quoted 3 lines
Quoted 1 line

Can we move this to be after the '---' cutter line?

When I really want someone to review / test I tend to put them above the --- so that I remember to poke them if they don't and I want them to be included in any follow on threads.

More FYI type +CC below the line. Mostly I just add them to the send list however rather than having a Cc at all.

The trick is that you can add

---
Cc: ...
Cc: ...

Quoted 8 lines
Quoted 3 lines

to the commit message in your local tree. It will be kept and represented in git format-patch.

I do. This is more pointed because I see it when I use b4 to pick my own patches up from this list ;)

Anyhow, for one or two I don't think the commit log mess matters much.

Doh. What I forgot was that for once, I pushed this directly without going via the list. Oops. All the stuff under the --- is there. Cleaned up now.

Quoted 3 lines

J

#6 lore raw
In reply to Jonathan Cameron
Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()") currently in the i3c/for-next tree removes the deprecated
struct i3c_priv_xfer and i3c_device_do_priv_xfers().

Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR) now rather causing a build issue when both trees are merged.

Quoted 6 lines

---
I'm already carrying this on my tree to resolve the issue in next but feedback still welcome!

This looks fine to me, I'm sorry this patch is causing you so much troubles, I was pretty sure every drivers where converted so I took me a while to understand that this is actually a new driver, I didn't expect this!

Quoted 111 lines
---
 drivers/iio/adc/ad4062.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/iio/adc/ad4062.c +13 -13
index a6b3ccc98acf..dd4ad32aa6f5 100644
@@ -468,13 +468,13 @@ static int ad4062_set_operation_mode(struct ad4062_state *st,
 
 	if (mode == AD4062_MONITOR_MODE) {
 		/* Change address pointer to enter monitor mode */
-		struct i3c_priv_xfer xfer_trigger = {
+		struct i3c_xfer xfer_trigger = {
 			.data.out = &st->conv_addr,
 			.len = sizeof(st->conv_addr),
 			.rnw = false,
 		};
 		st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
-		return i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
+		return i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
 	}
 
 	return regmap_write(st->regmap, AD4062_REG_MODE_SET,
@@ -607,18 +607,18 @@ static void ad4062_trigger_work(struct work_struct *work)
 	 * Read current conversion, if at reg CONV_READ, stop bit triggers
 	 * next sample and does not need writing the address.
 	 */
-	struct i3c_priv_xfer xfer_sample = {
+	struct i3c_xfer xfer_sample = {
 		.data.in = &st->buf.be32,
 		.len = st->conv_sizeof,
 		.rnw = true,
 	};
-	struct i3c_priv_xfer xfer_trigger = {
+	struct i3c_xfer xfer_trigger = {
 		.data.out = &st->conv_addr,
 		.len = sizeof(st->conv_addr),
 		.rnw = false,
 	};
 
-	ret = i3c_device_do_priv_xfers(st->i3cdev, &xfer_sample, 1);
+	ret = i3c_device_do_xfers(st->i3cdev, &xfer_sample, 1, I3C_SDR);
 	if (ret)
 		return;
 
@@ -627,7 +627,7 @@ static void ad4062_trigger_work(struct work_struct *work)
 	if (st->gpo_irq[1])
 		return;
 
-	i3c_device_do_priv_xfers(st->i3cdev, &xfer_trigger, 1);
+	i3c_device_do_xfers(st->i3cdev, &xfer_trigger, 1, I3C_SDR);
 }
 
 static irqreturn_t ad4062_poll_handler(int irq, void *p)
@@ -852,12 +852,12 @@ static int ad4062_set_chan_calibscale(struct ad4062_state *st, int gain_int,
 static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 {
 	struct i3c_device *i3cdev = st->i3cdev;
-	struct i3c_priv_xfer xfer_trigger = {
+	struct i3c_xfer xfer_trigger = {
 		.data.out = &st->conv_addr,
 		.len = sizeof(st->conv_addr),
 		.rnw = false,
 	};
-	struct i3c_priv_xfer xfer_sample = {
+	struct i3c_xfer xfer_sample = {
 		.data.in = &st->buf.be32,
 		.len = sizeof(st->buf.be32),
 		.rnw = true,
@@ -876,7 +876,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 	reinit_completion(&st->completion);
 	/* Change address pointer to trigger conversion */
 	st->conv_addr = AD4062_REG_CONV_TRIGGER_32BITS;
-	ret = i3c_device_do_priv_xfers(i3cdev, &xfer_trigger, 1);
+	ret = i3c_device_do_xfers(i3cdev, &xfer_trigger, 1, I3C_SDR);
 	if (ret)
 		return ret;
 	/*
@@ -888,7 +888,7 @@ static int ad4062_read_chan_raw(struct ad4062_state *st, int *val)
 	if (!ret)
 		return -ETIMEDOUT;
 
-	ret = i3c_device_do_priv_xfers(i3cdev, &xfer_sample, 1);
+	ret = i3c_device_do_xfers(i3cdev, &xfer_sample, 1, I3C_SDR);
 	if (ret)
 		return ret;
 	*val = be32_to_cpu(st->buf.be32);
@@ -1236,7 +1236,7 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
 	st->conv_sizeof = ad4062_sizeof_storagebits(st);
 	st->conv_addr = ad4062_get_conv_addr(st, st->conv_sizeof);
 	/* CONV_READ requires read to trigger first sample. */
-	struct i3c_priv_xfer xfer_sample[2] = {
+	struct i3c_xfer xfer_sample[2] = {
 		{
 			.data.out = &st->conv_addr,
 			.len = sizeof(st->conv_addr),
@@ -1249,8 +1249,8 @@ static int pm_ad4062_triggered_buffer_postenable(struct ad4062_state *st)
 		}
 	};
 
-	return i3c_device_do_priv_xfers(st->i3cdev, xfer_sample,
-					st->gpo_irq[1] ? 2 : 1);
+	return i3c_device_do_xfers(st->i3cdev, xfer_sample,
+				   st->gpo_irq[1] ? 2 : 1, I3C_SDR);
 }
 
 static int ad4062_triggered_buffer_postenable(struct iio_dev *indio_dev)
Signature · 1 line
2.52.0
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com