[PATCH 3/9] iio: adc: rzt2h: store the physical address in private state
From: Cosmin Tanislav
Date: Fri Aug 28 2026 - 11:10:05 EST
To prepare for adding support for DMA-based transfers, store the
physical address of the device in struct rzt2h_adc::phys_base.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
---
drivers/iio/adc/rzt2h_adc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/rzt2h_adc.c b/drivers/iio/adc/rzt2h_adc.c
index 470b16b5b9c8..995308a419f1 100644
--- a/drivers/iio/adc/rzt2h_adc.c
+++ b/drivers/iio/adc/rzt2h_adc.c
@@ -36,6 +36,7 @@ struct rzt2h_adc {
void __iomem *base;
struct device *dev;
+ phys_addr_t phys_base;
struct completion completion;
/* lock to protect against multiple access to the device */
struct mutex lock;
@@ -211,6 +212,7 @@ static int rzt2h_adc_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct iio_dev *indio_dev;
struct rzt2h_adc *adc;
+ struct resource *res;
int ret;
indio_dev = devm_iio_device_alloc(dev, sizeof(*adc));
@@ -231,10 +233,12 @@ static int rzt2h_adc_probe(struct platform_device *pdev)
if (ret)
return ret;
- adc->base = devm_platform_ioremap_resource(pdev, 0);
+ adc->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(adc->base))
return PTR_ERR(adc->base);
+ adc->phys_base = res->start;
+
pm_runtime_set_autosuspend_delay(dev, 300);
pm_runtime_use_autosuspend(dev);
ret = devm_pm_runtime_enable(dev);
--
2.55.0