Skip to content

Add HMCAD15XX support and Sharkbyte board support#3269

Open
PopPaul2021 wants to merge 9 commits into
mainfrom
sharkbyte_pr
Open

Add HMCAD15XX support and Sharkbyte board support#3269
PopPaul2021 wants to merge 9 commits into
mainfrom
sharkbyte_pr

Conversation

@PopPaul2021
Copy link
Copy Markdown
Contributor

PR Description

Add support for the HMCAD1511 and HMCAD1520 high-speed ADCs
with LVDS outputs, along with board support for the Sharkbyte dual-ADC data acquisition platform.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

Add device tree binding documentation for Analog Devices
HMCAD1511 and HMCAD1520 high-speed ADCs with LVDS outputs.

Signed-off-by: Paul Pop <paul.pop@analog.com>
Add ADI_REG_ADC_CONFIG_WR and ADI_REG_ADC_CONFIG_RD register
definitions for custom ADC configuration in the AXI ADC core.

Signed-off-by: Paul Pop <paul.pop@analog.com>
Add support for Analog Devices HMCAD1511 and
HMCAD1520 high-speed ADCs with LVDS outputs.

Features:
- Flexible 1/2/4 channel configurations
- 8-bit, 12-bit, and 14-bit resolution modes
- Input multiplexer control per channel
- Integration with ADI AXI ADC core

Signed-off-by: Paul Pop <paul.pop@analog.com>
The ADF5355 is a programmable PLL whose output frequency can change
at runtime. Set CLK_GET_RATE_NOCACHE to ensure the clock framework
queries the actual rate instead of returning a cached value.

Signed-off-by: Paul Pop <paul.pop@analog.com>
Add devicetree support for the Sharkbyte
dual HMCAD1520 ADC data acquisition platform.

Signed-off-by: Paul Pop <paul.pop@analog.com>
Add default kernel configuration for the Sharkbyte platform.

Signed-off-by: Paul Pop <paul.pop@analog.com>
Copy link
Copy Markdown
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

Given that this requires much more changes, stopping the review with that one comment

#include <linux/iio/buffer-dma.h>
#include <linux/iio/buffer-dmaengine.h>

#include "cf_axi_adc.h"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AFAICT, There's no reason to support new high speed converters using the old framework! These days we should iio backends which is also upstream and therefore makes possible to upstream this part.

@gastmaier gastmaier added the llm review Request a review from a LLM Reviewer label Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

LLM review

This series adds the HMCAD1511/HMCAD1520 high-speed ADC driver and Zynq Sharkbyte platform support, plus an ADF5355 clock-flag fix.

run: 24855823681


a291d2b83a - iio: adc: add support for HMCAD15xx high-speed ADC

HMCAD1520 14-bit precision mode register bug:

The HMCAD1511 and HMCAD1520 have different register layouts for 0x31 (OPERATION_MODE). On the HMCAD1520, bit D[3] is precision_mode — it must be set to 1 to enable 14-bit operation. The driver sends HMCAD15XX_OP_MODE_QUAD_CH = 0x0204 for all 14-bit paths, which leaves precision_mode=0, putting the HMCAD1520 into 12-bit high-speed quad mode instead of 14-bit precision mode.

Per the HMCAD1520 datasheet (Table 17, p. 17; Table 57, p. 35), the correct value for 14-bit precision mode is 0x0308 (precision_mode=1, high_speed_mode=0, clk_divide=8).

The zynq-sharkbyte_14b.dts overlay is directly affected.

Fixup patch: 0003-fixup-iio-adc-add-support-for-HMCAD15xx-high-speed-A.patch


0fb61f6f5f - iio: frequency: adf5355: set CLK_GET_RATE_NOCACHE for clock output

Double-free of devm-allocated memory (coccicheck):

clk_priv is allocated with devm_kzalloc() (line 975) but kfree(clk_priv) is called manually on clk_register() failure (line 1006). The devm framework will attempt to free the same pointer again on device removal, causing a double-free.

Fix: remove the kfree(clk_priv) call; devm manages the lifetime unconditionally.

Fixup patch: 0001-fixup-iio-frequency-adf5355-set-CLK_GET_RATE_NOCACHE.patch

The CLK_GET_RATE_NOCACHE flag change itself is correct.


f399f54493 - dt-bindings: iio: adc: add adi,hmcad15xx

HMCAD1511 resolution is 8-bit, not 12-bit:

The binding description and Kconfig both claim "The HMCAD1511 is a 12-bit ADC". Per the HMCAD1511 datasheet the device is 8-bit (ENOB ~7.9 bits, SNR ~49 dBFS). The 12-bit variant in this family is the HMCAD1512. Also, product URLs pointed to ti.com instead of analog.com.

Fixup patch: 0002-fixup-dt-bindings-iio-adc-add-adi-hmcad15xx.patch


CI warnings

  • checkpatch _idx macro argument reuse: _idx is used in .address, .channel, and .scan_index in HMCAD15XX_CHAN(). All call sites pass compile-time constants so there are no actual side-effects; this is a false positive.
  • smatch warnings at adf5355.c lines 604 and 953: pre-existing issues in the base driver, not introduced by this series.
  • DTS unit_address_vs_reg and unique_unit_address warnings for zynq-sharkbyte.dts: consistent with other ADI platform device-trees; lint-level only.

Verification data

HMCAD1511.pdf and HMCAD1520.pdf were downloaded from analog.com and register maps extracted with camelot-py. HMCAD1512.pdf was also fetched for cross-reference of the 8-bit vs 12-bit distinction. The full kernel was compiled for ARM with zynq_sharkbyte_defconfig both before and after the fixups; no errors.

Suggested patches

Apply the suggested patches with:

cd path/to/repository
export GITHUB_TOKEN=ghp_***
apply-patches --repo=analogdevicesinc/linux 24855823681
Install instructions

The following one-liner installs the script if not present already:

grep "/apply-patches.sh" ~/.bashrc ||  { curl "https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/main/ci/scripts/apply-patches.sh"    -o ~/.local/bin/apply-patches.sh &&  echo "source ~/.local/bin/apply-patches.sh" >> ~/.bashrc ; source ~/.bashrc ; }

More information at AI Usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm review Request a review from a LLM Reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants