From: "Nuno Sá" <noname.nuno@gmail.com>
To: Angelo Dureghello <adureghello@baylibre.com>,
jic23@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org
Cc: nuno.sa@analog.com, lars@metafoo.de,
Michael.Hennerich@analog.com, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] iio: dac: ad3552r: add model data structure
Date: Thu, 23 May 2024 14:43:23 +0200 [thread overview]
Message-ID: <6cf8a292252aafce6ecb787c0e28e30c35b98fa3.camel@gmail.com> (raw)
In-Reply-To: <20240522150141.1776196-4-adureghello@baylibre.org>
On Wed, 2024-05-22 at 17:01 +0200, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
>
> Add a "model data" structure to keep useful hardware-related
> information as from datasheet, avoiding id-based conditional
> choices later on.
>
> Removed id-based checks and filled model-specific structures
> with device specific features, In particular, num_hw_channels
> is introduced to keep the number of hardware implemented
> channels, since 1-channel versions of the DACs are added
> in this same patchset.
>
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---
> Changes for v2:
> - patch added in v2
> ---
> drivers/iio/dac/ad3552r.c | 98 +++++++++++++++++++++++----------------
> 1 file changed, 59 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> index a492e8f2fc0f..6a40c7eece1f 100644
> --- a/drivers/iio/dac/ad3552r.c
> +++ b/drivers/iio/dac/ad3552r.c
> @@ -261,7 +261,17 @@ struct ad3552r_ch_data {
> bool range_override;
> };
>
> +struct ad3552r_model_data {
> + const char *model_name;
> + enum ad3542r_id chip_id;
> + unsigned int num_hw_channels;
> + const s32 (*ranges_table)[2];
> + int num_ranges;
> + bool requires_output_range;
> +};
> +
nit: we often would call this (in IIO) ad3552r_chip_info. Then...
> struct ad3552r_desc {
> + const struct ad3552r_model_data *model_data;
*chip_info;
Anyways, not really something worth a re-spin. But if you need one, something to
consider :)
- Nuno Sá
next prev parent reply other threads:[~2024-05-23 12:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 15:01 [PATCH v2 0/6] minor fixes and improvements Angelo Dureghello
2024-05-22 15:01 ` [PATCH v2 1/6] dt-bindings: iio: dac: fix ad3552r gain parameter names Angelo Dureghello
2024-05-23 7:18 ` Krzysztof Kozlowski
2024-05-22 15:01 ` [PATCH v2 2/6] dt-bindings: iio: dac: add ad35xxr single output variants Angelo Dureghello
2024-05-23 7:19 ` Krzysztof Kozlowski
2024-05-22 15:01 ` [PATCH v2 3/6] iio: dac: ad3552r: add model data structure Angelo Dureghello
2024-05-23 12:43 ` Nuno Sá [this message]
2024-05-22 15:01 ` [PATCH v2 4/6] iio: dac: ad3552r: add support for ad3541r and ad3551r Angelo Dureghello
2024-05-22 15:01 ` [PATCH v2 5/6] iio: dac: ad3552r: change AD3552R_NUM_CH define name Angelo Dureghello
2024-05-22 15:01 ` [PATCH v2 6/6] iio: dac: ad3552r: uniform structure names Angelo Dureghello
2024-05-23 12:45 ` [PATCH v2 0/6] minor fixes and improvements Nuno Sá
2024-05-25 17:06 ` Jonathan Cameron
2024-05-27 8:05 ` Angelo Dureghello
2024-05-28 19:16 ` Angelo Dureghello
2024-06-12 16:35 ` Angelo Dureghello
2024-06-13 16:58 ` Jonathan Cameron
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=6cf8a292252aafce6ecb787c0e28e30c35b98fa3.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=adureghello@baylibre.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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