[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <g7itkz3xnthnt6ipn6gtcommhwrabup3ttflhar5td27qvmfyb@nxa4x4eqtrrs>
Date: Mon, 13 Jan 2025 09:51:31 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Vasiliy Doylov <nekodevelopper@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v3 4/5] iio: accel: mc3230: add multiple devices support
On Sun, Jan 12, 2025 at 03:25:38PM +0300, Vasiliy Doylov wrote:
> This patch allows to add new devices to this driver.
>
> Signed-off-by: Vasiliy Doylov <nekodevelopper@...il.com>
> ---
> drivers/iio/accel/mc3230.c | 50 ++++++++++++++++++++++++++++++++++------------
> 1 file changed, 37 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/iio/accel/mc3230.c b/drivers/iio/accel/mc3230.c
> index ba30c904d3f67002deeb3ca5a7e12bfae312e05f..1b58f3ea50655b6563a78a2531b16a8088e8f8d5 100644
> --- a/drivers/iio/accel/mc3230.c
> +++ b/drivers/iio/accel/mc3230.c
> @@ -22,20 +22,29 @@
> #define MC3230_MODE_OPCON_STANDBY 0x03
>
> #define MC3230_REG_CHIP_ID 0x18
> -#define MC3230_CHIP_ID 0x01
> -
> #define MC3230_REG_PRODUCT_CODE 0x3b
> -#define MC3230_PRODUCT_CODE 0x19
>
> /*
> * The accelerometer has one measurement range:
> *
> * -1.5g - +1.5g (8-bit, signed)
> *
> - * scale = (1.5 + 1.5) * 9.81 / (2^8 - 1) = 0.115411765
> */
>
> -static const int mc3230_nscale = 115411765;
> +struct mc3230_chip_info {
> + const u8 chip_id;
> + const char *name;
> + const u8 product_code;
> + const int scale;
> +};
> +
> +static struct mc3230_chip_info mc3230_chip_info = {
Why this cannot be const?
Best regards,
Krzysztof
Powered by blists - more mailing lists