Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rodrigo Alencar" <rodrigo.alencar@analog.com>,
	devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 08/12] iio: frequency: ad9910: add axi backend driver
Date: Mon, 16 Nov 2026 16:59:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-217402@kernel.org> (raw)
In-Reply-To: <20261116-ad9910-backend-support-v4-8-fcf1ad364ed5@analog.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] iio: frequency: ad9910-axi-backend: unused macros and header
  mismatches
--

commit 5ec2dabb89fd1341c316c4a5ab1227cec04b62b8
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>

iio: frequency: ad9910: add axi backend driver

This commit adds the IIO backend and PWM driver for the Analog Devices
AD9910 AXI IP core to control the parallel data port, profile pins, and
DRCTL pin.

> diff --git a/drivers/iio/frequency/ad9910-axi-backend.c b/drivers/iio/frequency/ad9910-axi-backend.c
> new file mode 100644
> index 0000000000000..57ab10c039072
> --- /dev/null
> +++ b/drivers/iio/frequency/ad9910-axi-backend.c
> @@ -0,0 +1,555 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * AD9910 AXI Backend driver
> + *
> + * Copyright 2026 Analog Devices Inc.
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/cleanup.h>
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/kstrtox.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/pwm.h>
> +#include <linux/regmap.h>
> +#include <linux/units.h>
> +
> +#include <linux/iio/backend.h>
> +#include <linux/iio/buffer-dmaengine.h>
> +#include <linux/iio/buffer.h>
> +#include <linux/iio/iio.h>
> +
> +#include "ad9910.h"
> +
> +/* Register addresses */
> +#define AD9910_AXI_REG_RESET		0x040
> +#define AD9910_AXI_REG_DRG		0x084
> +#define AD9910_AXI_REG_PROFILE		0x088
> +#define AD9910_AXI_REG_DRCTL_PERIOD	0x08C
> +#define AD9910_AXI_REG_DRCTL_WIDTH	0x090
> +#define AD9910_AXI_REG_DRCTL_DELAY	0x094
> +#define AD9910_AXI_REG_BURST_COUNT	0x098
> +#define AD9910_AXI_REG_BURST_DELAY	0x09C
> +#define AD9910_AXI_REG_RAMP_CFG		0x0A0
> +
> +#define AD9910_AXI_REG_UPDATE_CTRL	0x104
> +#define AD9910_AXI_REG_PAR_RATE		0x108
> +#define AD9910_AXI_REG_F_CFG		0x10C
> +
> +#define AD9910_AXI_REG_RESET_CORE_MSK		BIT(0)
> +
> +#define AD9910_AXI_REG_DRG_DRCTL_MSK		BIT(2)
> +#define AD9910_AXI_REG_DRG_TOGGLE_EN_MSK	BIT(3)
> +
> +#define AD9910_AXI_REG_RAMP_CFG_ONE_SHOT_MSK	GENMASK(1, 0)
> +#define AD9910_AXI_REG_BURST_COUNT_MSK		GENMASK(19, 0)
> +
> +#define AD9910_AXI_REG_UPDATE_RATE_MSK		BIT(0)
> +#define AD9910_AXI_REG_UPDATE_PAR_IF_EN_MSK	BIT(1)
> +#define AD9910_AXI_REG_UPDATE_EXT_TRIG_MSK	BIT(2)
> +
> +#define AD9910_AXI_REG_PROFILE_MSK		GENMASK(2, 0)
> +#define AD9910_AXI_REG_IO_UPDATE_MSK		BIT(0)
> +#define AD9910_AXI_REG_F_CFG_MSK		GENMASK(1, 0)
> +
> +#define AD9910_AXI_F_CFG_AMP			0
> +#define AD9910_AXI_F_CFG_PHASE			1
> +#define AD9910_AXI_F_CFG_FREQ			2
> +#define AD9910_AXI_F_CFG_POLAR			3
> +
> +#define AD9910_AXI_PD_CLK_MAX_FREQ_HZ		(250ULL * HZ_PER_MHZ)
> +#define AD9910_AXI_PAR_RATE_MAX			U16_MAX
> +#define AD9910_AXI_ONE_SHOT_BURST		1

[Severity: Low]
This isn't a bug, but several macros here are unused:
AD9910_AXI_REG_BURST_COUNT, AD9910_AXI_REG_BURST_DELAY,
AD9910_AXI_REG_RAMP_CFG, AD9910_AXI_REG_DRG_DRCTL_MSK,
AD9910_AXI_REG_RAMP_CFG_ONE_SHOT_MSK, AD9910_AXI_REG_BURST_COUNT_MSK,
AD9910_AXI_REG_UPDATE_EXT_TRIG_MSK, AD9910_AXI_REG_IO_UPDATE_MSK, and
AD9910_AXI_ONE_SHOT_BURST.

Also, linux/kstrtox.h is included without being used, while linux/math64.h
(for mul_u64_u64_div_u64(), mul_u64_u64_div_u64_roundup(),
DIV64_U64_ROUND_CLOSEST(), and div64_u64()) and linux/minmax.h (for min()
and clamp()) are relied on transitively instead of being included directly.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-ad9910-backend-support-v4-0-fcf1ad364ed5@analog.com?part=8

  reply	other threads:[~2026-11-16 16:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:39 [PATCH v4 00/12] iio: frequency: ad9910: add IIO backend support Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 01/12] iio: frequency: ad9910: powerdown fix Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 02/12] iio: frequency: ad9910: round up FM gain scale Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 03/12] iio: backend: use the consumer fwnode for named lookups Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 04/12] iio: backend: add devm_iio_backend_get_optional() Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 05/12] dt-bindings: iio: frequency: add adi,ad9910-axi-backend Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 06/12] dt-bindings: iio: frequency: ad9910: add io-backends property Rodrigo Alencar via B4 Relay
2026-11-16 16:39 ` [PATCH v4 07/12] iio: frequency: ad9910: move channel indexes into a shared header Rodrigo Alencar via B4 Relay
2026-11-16 16:40 ` [PATCH v4 08/12] iio: frequency: ad9910: add axi backend driver Rodrigo Alencar via B4 Relay
2026-11-16 16:59   ` sashiko-bot [this message]
2026-11-16 16:40 ` [PATCH v4 09/12] iio: frequency: ad9910: support drctl control Rodrigo Alencar via B4 Relay
2026-11-16 16:40 ` [PATCH v4 10/12] iio: frequency: ad9910: support iio backend Rodrigo Alencar via B4 Relay
2026-11-16 16:40 ` [PATCH v4 11/12] iio: ABI: add integration_time for output channels Rodrigo Alencar via B4 Relay
2026-11-16 16:40 ` [PATCH v4 12/12] docs: iio: ad9910: document DRCTL pin control Rodrigo Alencar via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-217402@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rodrigo.alencar@analog.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox