[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251221191316.7c3aa128@jic23-huawei>
Date: Sun, 21 Dec 2025 19:13:16 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Frank Li <Frank.Li@....com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>, Miquel Raynal
<miquel.raynal@...tlin.com>, David Lechner <dlechner@...libre.com>, Nuno
Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, linux-i3c@...ts.infradead.org,
linux-kernel@...r.kernel.org, imx@...ts.linux.dev,
linux-iio@...r.kernel.org, joshua.yeong@...rfivetech.com,
devicetree@...r.kernel.org, linux@...ck-us.net, Carlos Song
<carlos.song@....com>, Adrian Fluturel <fluturel.adrian@...il.com>, Andy
Shevchenko <andriy.shevchenko@...el.com>
Subject: Re: [PATCH v12 2/2] iio: magnetometer: Add mmc5633 sensor
On Mon, 15 Dec 2025 11:51:11 -0500
Frank Li <Frank.Li@....com> wrote:
> Add mmc5633 sensor basic support.
> - Support read 20 bits X/Y/Z magnetic.
> - Support I3C HDR mode to send start measurememt command.
> - Support I3C HDR mode to read all sensors data by one command.
>
> Co-developed-by: Carlos Song <carlos.song@....com>
> Signed-off-by: Carlos Song <carlos.song@....com>
> Co-developed-by: Adrian Fluturel <fluturel.adrian@...il.com>
> Signed-off-by: Adrian Fluturel <fluturel.adrian@...il.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
> Signed-off-by: Frank Li <Frank.Li@....com>
drivers/iio/magnetometer/mmc5633.c:87:5: warning: symbol 'mmc5633_samp_freq' was not declared. Should it be static?
(I fixed up)
With that and the trivial stuff below tidied up whilst applying, applied to the togreg
branch of iio.git. I'll initially push out as testing however to let the
bots take a first look before I annoy linux-next
Jonathan
> diff --git a/drivers/iio/magnetometer/mmc5633.c b/drivers/iio/magnetometer/mmc5633.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..7b20ff3b063b026ab2ae0170fd8c021973428dea
> --- /dev/null
> +++ b/drivers/iio/magnetometer/mmc5633.c
> +static int mmc5633_write_raw(struct iio_dev *indio_dev,
> + struct iio_chan_spec const *chan, int val,
> + int val2, long mask)
> +{
> + struct mmc5633_data *data = iio_priv(indio_dev);
> + int ret;
> +
> + switch (mask) {
> + case IIO_CHAN_INFO_SAMP_FREQ:
This is the missing scope thing from the bot report. {}
needed in a switch to define scope for local variables like the one guard()
is using under the hood.
> + ret = mmc5633_get_samp_freq_index(data, val, val2);
> + if (ret < 0)
> + return ret;
> +
> + guard(mutex)(&data->mutex);
> +
> + return regmap_update_bits(data->regmap, MMC5633_REG_CTRL1,
> + MMC5633_CTRL1_BW_MASK,
> + FIELD_PREP(MMC5633_CTRL1_BW_MASK, ret));
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static struct i2c_driver mmc5633_i2c_driver = {
> + .driver = {
> + .name = "mmc5633_i2c",
> + .of_match_table = mmc5633_of_match,
> + .pm = pm_sleep_ptr(&mmc5633_pm_ops),
> + },
> + .probe = mmc5633_i2c_probe,
> + .id_table = mmc5633_i2c_id,
Bonus space after =
> +};
Powered by blists - more mailing lists