Re: [PATCH v6 14/16] iio: adc: xilinx-xadc: Split driver into core and platform files

From: Jonathan Cameron

Date: Fri Nov 27 2026 - 23:46:10 EST


On Wed, 25 Nov 2026 22:40:28 +0530
Dileep Kumar Nagavarapu <dileepkumar.nagavarapu@xxxxxxx> wrote:

> Split the xilinx-xadc-core.c into separate core and platform specific
> files to prepare for I2C interface support.
>
> xilinx-xadc-core.c is reorganized as follows:
> xilinx-xadc-core.c:
> - Platform-independent IIO/ADC operations
> - Channel definitions and management
> - Buffer and trigger management
> - Device tree parsing
>
> xilinx-xadc-platform.c:
> - ZYNQ platform (FIFO-based) register access and interrupt handling
> - AXI platform (memory-mapped) register access and interrupt handling
> - Platform-specific setup and configuration
> - Platform device probe function
>
> Update Kconfig to introduce XILINX_XADC_CORE as a helper module selected
> by XILINX_XADC and update Makefile to build the split modules:
> - xilinx-xadc-common.o (core + events)
> - xilinx-xadc-platform.o (platform-specific)
>
> Reorganize the code with no behavioral changes.
>
> Co-developed-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
> Signed-off-by: Dileep Kumar Nagavarapu <dileepkumar.nagavarapu@xxxxxxx>
Sashiko calls out that the module name changes and even if that is fine
for userspace on these devices, the help text in Kconfig need an update.

https://sashiko.dev/#/patchset/20261125171045.1246381-1-dileepkumar.nagavarapu%40amd.com
A few other comments apply to this patch.

There is stuff on patch 16 as well.

There is also something strange about the patch split up.
This should be moving code but a lot more is removed than added.
I think that's because this is treating xilinx-xadc-core.c in two
ways, both as the basis for itself (lots of code removed) and
as the base for xilinx-xadc-platform.c (lots of code removed there
as well). This has the odd result of seeing like lots of code
is being remove whereas it is just moving around. Probably easiest
solution to make this revieweable is to turn move detection off
for the git format-patch.



> ---
> drivers/iio/adc/Kconfig | 8 +-
> drivers/iio/adc/Makefile | 5 +-
> drivers/iio/adc/xilinx-xadc-core.c | 688 +--------------
> drivers/iio/adc/xilinx-xadc-events.c | 1 +
> ...inx-xadc-core.c => xilinx-xadc-platform.c} | 805 +-----------------
> drivers/iio/adc/xilinx-xadc.h | 28 +
> 6 files changed, 67 insertions(+), 1468 deletions(-)
> copy drivers/iio/adc/{xilinx-xadc-core.c => xilinx-xadc-platform.c} (44%)