linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Tomas Melin <tomas.melin@vaisala.com>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH V3 3/5] iio: accel: sca3300: modified to support multi chips
Date: Wed, 4 May 2022 16:20:11 +0200	[thread overview]
Message-ID: <CAHp75VeseZ2ChtbafmbgVavS4KvCvrQ4+XSRkeiJSyqr8__dSw@mail.gmail.com> (raw)
In-Reply-To: <20220504133612.604304-4-Qing-wu.Li@leica-geosystems.com.cn>

On Wed, May 4, 2022 at 3:36 PM LI Qingwu
<Qing-wu.Li@leica-geosystems.com.cn> wrote:
>
> The drive support sca3300 only.

driver supports

> There are some other similar chips, for instance, SCL3300.
> Prepare the way for multiple chips and additional channels.
> Modify the driver to read the device id.
> Add the tables for the corresponding id to support multiple chips.
> Add prepares for the addition of extra channels.
> Add prepares for handling the operation modes for multiple chips.

It seems you need to work more on the commit messages in all patches.

...

> +struct sca3300_chip_info {
> +       const struct iio_chan_spec *channels;
> +       const int (*accel_scale_table)[2];
> +       const int *accel_scale_modes_map;
> +       const unsigned long *scan_masks;
> +       const int *avail_modes_table;
> +       const int *freq_modes_map;
> +       const int *freq_table;
> +       const u8 num_accel_scales;
> +       const u8 num_avail_modes;
> +       const u8 num_channels;
> +       const u8 num_freqs;
> +       const u8 chip_id;

Why do you have const qualifier on all members?  The last one is
understandable, but the rest, esp. pointers should be justified.

> +       const char *name;
> +};

...

> +static int sca3300_set_op_mode(struct sca3300_data *sca_data, int index)
> +{
> +       int mode;
> +
> +       if ((index < 0) || (index >= sca_data->chip->num_avail_modes))

Too many parentheses.

> +               return -EINVAL;
> +
> +       mode = sca_data->chip->avail_modes_table[index];
> +
> +       return sca3300_write_reg(sca_data, SCA3300_REG_MODE, mode);
> +}

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-05-04 14:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 13:36 [PATCH V3 0/5] iio: accel: sca3300: add compitible for scl3300 LI Qingwu
2022-05-04 13:36 ` [PATCH V3 1/5] dt-bindings: iio: accel: sca3300: Document murata,scl3300 LI Qingwu
2022-05-04 13:36 ` [PATCH V3 2/5] iio: accel: sca3300: add define for temp channel for reuse LI Qingwu
2022-05-04 13:36 ` [PATCH V3 3/5] iio: accel: sca3300: modified to support multi chips LI Qingwu
2022-05-04 14:20   ` Andy Shevchenko [this message]
2022-05-04 14:35     ` LI Qingwu
2022-05-04 14:38       ` Andy Shevchenko
2022-05-05 14:12         ` LI Qingwu
2022-05-05 18:01           ` Andy Shevchenko
2022-05-07 14:42             ` Jonathan Cameron
2022-05-06 20:12   ` Melin Tomas
2022-05-07  3:48     ` LI Qingwu
2022-05-06 20:12   ` Melin Tomas
2022-05-07 14:54   ` Jonathan Cameron
2022-05-04 13:36 ` [PATCH V3 4/5] iio: accel: sca3300: Add support for SCL3300 LI Qingwu
2022-05-04 13:36 ` [PATCH V3 5/5] iio: accel: sca3300: Add inclination channels LI Qingwu
2022-05-04 17:23   ` kernel test robot
2022-05-07 14:46   ` 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=CAHp75VeseZ2ChtbafmbgVavS4KvCvrQ4+XSRkeiJSyqr8__dSw@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=Qing-wu.Li@leica-geosystems.com.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=tomas.melin@vaisala.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;
as well as URLs for NNTP newsgroup(s).