From: Krzysztof Kozlowski <krzk@kernel.org>
To: Jianping.Shen@de.bosch.com, jic23@kernel.org, lars@metafoo.de,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
dima.fedrau@gmail.com, marcelo.schmitt1@gmail.com,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Christian.Lorenz3@de.bosch.com,
Ulrike.Frauendorf@de.bosch.com, Kai.Dolde@de.bosch.com
Subject: Re: [PATCH] drivers: Bosch SMI240 IMU Driver
Date: Thu, 18 Jul 2024 14:47:27 +0200 [thread overview]
Message-ID: <5aec49af-0a24-464b-b24c-cb23c7b1ae95@kernel.org> (raw)
In-Reply-To: <20240718122449.7607-1-Jianping.Shen@de.bosch.com>
On 18/07/2024 14:24, Jianping.Shen@de.bosch.com wrote:
> From: "Shen Jianping (ME-SE/EAD2)" <she2rt@LR-C-0008DVM.rt.de.bosch.com>
>
> Add Bosch SMI240 IMU IIO Driver to iio-for-6.10b
What is "iio-for-6.10b"? How is it relevant to git history? This is
supposed to say something about the driver and hardware.
>
> Signed-off-by: Shen Jianping (ME-SE/EAD2) <she2rt@LR-C-0008DVM.rt.de.bosch.com>
> ---
> .../bindings/iio/imu/bosch,smi240.yaml | 45 +
> drivers/iio/imu/Kconfig | 2 +
> drivers/iio/imu/Makefile | 1 +
> drivers/iio/imu/smi240/Kconfig | 30 +
> drivers/iio/imu/smi240/Makefile | 8 +
> drivers/iio/imu/smi240/smi240.h | 31 +
> drivers/iio/imu/smi240/smi240_core.c | 814 ++++++++++++++++++
> drivers/iio/imu/smi240/smi240_spi.c | 153 ++++
> 8 files changed, 1084 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml
> create mode 100644 drivers/iio/imu/smi240/Kconfig
> create mode 100644 drivers/iio/imu/smi240/Makefile
> create mode 100644 drivers/iio/imu/smi240/smi240.h
> create mode 100644 drivers/iio/imu/smi240/smi240_core.c
> create mode 100644 drivers/iio/imu/smi240/smi240_spi.c
>
> diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml
> new file mode 100644
> index 00000000000..972819cacff
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/imu/bosch,smi240.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BOSCH SMI240
Also: BOSCH or Bosch?
> +
> +maintainers:
> + - unknown
> +
> +description: |
> + Inertial Measurement Unit with Accelerometer, Gyroscope
> + https://www.bosch-semiconductors.com/mems-sensors/highly-automated-driving/smi240/
> +
> +properties:
> + compatible:
> + const: BOSCH,SMI240
> +
> + reg:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - spi-max-frequency
> + - reg
> +
> +allOf:
> + - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + // Example
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + smi240@0 {
> + compatible = "BOSCH,SMI240";
> + spi-max-frequency = <10000000>;
> + reg = <0>;
> + };
> + };
> diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig
> index 52a155ff325..2c348ad686a 100644
> --- a/drivers/iio/imu/Kconfig
> +++ b/drivers/iio/imu/Kconfig
> @@ -96,6 +96,8 @@ config KMX61
>
> source "drivers/iio/imu/inv_icm42600/Kconfig"
> source "drivers/iio/imu/inv_mpu6050/Kconfig"
> +source "/home/she2rt/dev/smi240-linux-driver-iio/drivers/iio/imu/smi240/Kconfig"
Yeah... this won't work, obviously.
> +source "drivers/iio/imu/smi240/Kconfig"
> source "drivers/iio/imu/st_lsm6dsx/Kconfig"
> source "drivers/iio/imu/st_lsm9ds0/Kconfig"
>
> diff --git a/drivers/iio/imu/Makefile b/drivers/iio/imu/Makefile
> index 7e2d7d5c3b7..b6f162ae4ed 100644
> --- a/drivers/iio/imu/Makefile
> +++ b/drivers/iio/imu/Makefile
> @@ -27,5 +27,6 @@ obj-y += inv_mpu6050/
>
> obj-$(CONFIG_KMX61) += kmx61.o
>
> +obj-y += smi240/
> obj-y += st_lsm6dsx/
> obj-y += st_lsm9ds0/
> diff --git a/drivers/iio/imu/smi240/Kconfig b/drivers/iio/imu/smi240/Kconfig
> new file mode 100644
> index 00000000000..7114c941cc3
> --- /dev/null
> +++ b/drivers/iio/imu/smi240/Kconfig
> @@ -0,0 +1,30 @@
Missing SPDX
> +config SMI240
> + tristate "Bosch Sensor SMI240 Inertial Measurement Unit"
> + depends on SPI_MASTER
> + select IIO_BUFFER
> + select IIO_TRIGGERED_BUFFER
> + help
> + Build driver
> + for Bosch
> + SMI240 6-axis IMU
> + sensor.
Ooh my... what's this style?
Read coding style for Kconfig.
> +
> +config SMI240_MAX_BUFFER_LEN
Drop, dead code.
> + depends on SMI240
> + int "configue read buffer size"
> + default "1024"
> + help
> + 1024 bytes are big
> + enough for most cases.
> + Do not change this value
> + if not sure.
> +
> +config SMI240_UNIT_TEST
Drop, dead code.
> + tristate "Unit Test for SMI240"
> + depends on KUNIT=y
> + help
> + Build Unit Test
> + for Bosch
> + SMI240 6-axis
> + IMU sensor.
> +
> diff --git a/drivers/iio/imu/smi240/Makefile b/drivers/iio/imu/smi240/Makefile
> new file mode 100644
> index 00000000000..394eaecf5f3
> --- /dev/null
> +++ b/drivers/iio/imu/smi240/Makefile
> @@ -0,0 +1,8 @@
> +#
> +# Makefile for Bosch SMI240
Drop. It cannot be anything else. Do not say that "x" is a "x".
You miss SPDX on the other hand.
> +#
> +
> +obj-$(CONFIG_SMI240) += smi240.o
> +smi240-objs := smi240_core.o
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-07-18 12:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 12:24 [PATCH] drivers: Bosch SMI240 IMU Driver Jianping.Shen
2024-07-18 12:35 ` Krzysztof Kozlowski
2024-07-18 12:47 ` Krzysztof Kozlowski [this message]
2024-07-18 13:10 ` Shen Jianping (ME-SE/EAD2)
2024-07-20 15:34 ` 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=5aec49af-0a24-464b-b24c-cb23c7b1ae95@kernel.org \
--to=krzk@kernel.org \
--cc=Christian.Lorenz3@de.bosch.com \
--cc=Jianping.Shen@de.bosch.com \
--cc=Kai.Dolde@de.bosch.com \
--cc=Ulrike.Frauendorf@de.bosch.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dima.fedrau@gmail.com \
--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=marcelo.schmitt1@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.