public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v2 14/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for gain-ranges
Date: Thu, 30 Apr 2026 10:32:57 +0900	[thread overview]
Message-ID: <afKxSWnQeQheAd3x@sirena.co.uk> (raw)
In-Reply-To: <20260429074356.118420-15-herve.codina@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

On Wed, Apr 29, 2026 at 09:43:50AM +0200, Herve Codina wrote:

> +static int *simple_amp_alloc_tlv_ranges(const struct simple_amp_ranges *ranges)
> +{
> +	unsigned int index;
> +	unsigned int *tlv;

> +	return tlv;
> +}

The function returns a pointer to int but everything else is pointer to
unsigned int.

> +static int simple_amp_check_new_range(const struct simple_amp_range *new_range,
> +				      const struct simple_amp_range *tab_ranges,
> +				      unsigned int nb_ranges)
> +{
> +	unsigned int i;
> +
> +	for (i = 0; i < nb_ranges; i++) {
> +		/* Check for range overlaps */
> +		if (new_range->min.gain_db >= tab_ranges[i].min.gain_db &&
> +		    new_range->min.gain_db <= tab_ranges[i].max.gain_db)
> +			return -EINVAL;
> +
> +		if (new_range->max.gain_db >= tab_ranges[i].min.gain_db &&
> +		    new_range->max.gain_db <= tab_ranges[i].max.gain_db)
> +			return -EINVAL;
> +	}
> +	return 0;
> +}

This checks if the new range is inside an existing range but won't
notice if the existing range is entirely inside the new one.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-04-30  1:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  7:43 [PATCH v2 00/17] ASoC: Add support for GPIOs driven amplifiers Herve Codina
2026-04-29  7:43 ` [PATCH v2 01/17] of: Introduce of_property_read_s32_index() Herve Codina
2026-04-29  7:43 ` [PATCH v2 02/17] ASoC: dt-bindings: Add support for the GPIOs driven amplifier Herve Codina
2026-04-29  7:43 ` [PATCH v2 03/17] ASoC: simple-amplifier: Remove DRV_NAME defined value Herve Codina
2026-04-29  7:43 ` [PATCH v2 04/17] ASoC: simple-amplifier: Add missing headers Herve Codina
2026-04-29  7:43 ` [PATCH v2 05/17] ASoC: simple-amplifier: Remove CONFIG_OF flag and of_match_ptr() Herve Codina
2026-04-29  7:43 ` [PATCH v2 06/17] ASoC: simple-amplifier: Rename drv_event() function Herve Codina
2026-04-29  7:43 ` [PATCH v2 07/17] ASoC: simple-amplifier: Use 'simple_amp' variable name instead of 'priv' Herve Codina
2026-04-29  7:43 ` [PATCH v2 08/17] ASoC: simple-amplifier: Remove DAPM widgets and routes from the ASoC component driver Herve Codina
2026-04-30  1:15   ` Mark Brown
2026-04-29  7:43 ` [PATCH v2 09/17] ASoC: simple-amplifier: Introduce support for gpio-audio-amp Herve Codina
2026-04-29  7:43 ` [PATCH v2 10/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for extra power supplies Herve Codina
2026-04-29  7:43 ` [PATCH v2 11/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for mute gpio Herve Codina
2026-04-29  7:43 ` [PATCH v2 12/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for bypass gpio Herve Codina
2026-04-29  7:43 ` [PATCH v2 13/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for basic gain Herve Codina
2026-04-29  7:43 ` [PATCH v2 14/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for gain-ranges Herve Codina
2026-04-30  1:32   ` Mark Brown [this message]
2026-04-29  7:43 ` [PATCH v2 15/17] ASoC: simple-amplifier: gpio-audio-amp: Add support for gain-labels Herve Codina
2026-04-29  7:43 ` [PATCH v2 16/17] ASoC: simple-amplifier: Update author and copyright Herve Codina
2026-04-29  7:43 ` [PATCH v2 17/17] MAINTAINERS: Add the ASoC gpio audio amplifier entry Herve Codina

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=afKxSWnQeQheAd3x@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=brgl@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tiwai@suse.com \
    /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