Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/configs/zynq_m2k_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_ADI_AXI_DATA_OFFLOAD=y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I feel this is required because we "made" it that way

CONFIG_SRAM=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/zynq_pluto_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=16384
CONFIG_ADI_AXI_DATA_OFFLOAD=y
CONFIG_ADI_AXI_TDD=y
CONFIG_SRAM=y
# CONFIG_MATHWORKS_IP_CORE is not set
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/frequency/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ config CF_AXI_DDS
tristate "Analog Devices CoreFPGA AXI DDS driver"
depends on SPI
depends on COMMON_CLK
depends on ADI_AXI_DATA_OFFLOAD
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think this is only because we dropped the stubs for the methods you mention in the commit message. AFAIR, data offloading is an optional feature so I think depending on it is "too much".

We might need something better than #ifdef CONFIG_ADI_AXI_DATA_OFFLOAD though

Copy link
Contributor Author

@gastmaier gastmaier Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is only required because we made this way, we added the methods directly in the axi dds driver and used a define in the include of the offload to make it optional, but this approach doesn't work with tristates.
it needs to be done through ops, where the offload pointer is acquired during runtime.
the focus of the pr is to allow the offload to be compiled as a module

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I guess the original author indeed did not wanted it to be compiled as a module :).

but this approach doesn't work with tristates

Why not? Can't we use IS_REACHABLE() or something like that? And compromise that it won't be available if the DDS is builtin but OFFLOAD is a module?

Anyways, I'm not 100% happy that we now depend on an "optional" feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we can use IS_REACHABLE in this driver to fallback . making it only compatible with built-in offload for now, or discard this pr and keep built-in only
.

select IIO_BUFFER_DMAENGINE
help
Say yes here to build support for Analog Devices DDS chip
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ config AD525X_DPOT_SPI
module will be called ad525x_dpot-spi.

config ADI_AXI_DATA_OFFLOAD
bool "support Analog Devices Data Offload Engine"
tristate "support Analog Devices Data Offload Engine"
depends on HAS_IOMEM
depends on OF
help
Expand Down
22 changes: 0 additions & 22 deletions drivers/misc/adi-axi-data-offload.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,9 @@

struct axi_data_offload_state;

#ifdef CONFIG_ADI_AXI_DATA_OFFLOAD

int axi_data_offload_ctrl_bypass(struct axi_data_offload_state *st, bool en);
int axi_data_offload_ctrl_oneshot(struct axi_data_offload_state *st, bool en);

struct axi_data_offload_state *devm_axi_data_offload_get_optional(struct device *source);

#else

static inline int axi_data_offload_ctrl_bypass(struct axi_data_offload_state *st, bool en)
{
return -ENODEV;
}

static inline int axi_data_offload_ctrl_oneshot(struct axi_data_offload_state *st, bool en)
{
return -ENODEV;
}

static inline struct
axi_data_offload_state *devm_axi_data_offload_get_optional(struct device *source)
{
return NULL;
}

#endif /* CONFIG_ADI_AXI_DATA_OFFLOAD */

#endif /* ADI_AXI_DATA_OFFLOAD_H_ */
Loading