* [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong
@ 2023-11-21 9:57 Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma Anshul Dalal
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Anshul Dalal @ 2023-11-21 9:57 UTC (permalink / raw)
To: linux-kernel, linux-iio, devicetree
Cc: Anshul Dalal, Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20
temperature and humidity sensor under the brand name Asair
Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
---
Changes for v3:
- no updates
v2: https://lore.kernel.org/lkml/20231115125810.1394854-1-anshulusr@gmail.com/
Changes for v2:
- Changed vendor prefix from asair to aosong
v1: https://lore.kernel.org/lkml/20231107173100.62715-1-anshulusr@gmail.com/
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 573578db9509..48d4ff635562 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -117,6 +117,8 @@ patternProperties:
description: Andes Technology Corporation
"^anvo,.*":
description: Anvo-Systems Dresden GmbH
+ "^aosong,.*":
+ description: Guangzhou Aosong Electronic Co., Ltd.
"^apm,.*":
description: Applied Micro Circuits Corporation (APM)
"^apple,.*":
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma
2023-11-21 9:57 [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Anshul Dalal
@ 2023-11-21 9:57 ` Anshul Dalal
2023-11-21 10:03 ` Krzysztof Kozlowski
2023-11-21 9:57 ` [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA Anshul Dalal
2023-11-21 10:02 ` [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Krzysztof Kozlowski
2 siblings, 1 reply; 8+ messages in thread
From: Anshul Dalal @ 2023-11-21 9:57 UTC (permalink / raw)
To: linux-kernel, linux-iio, devicetree
Cc: Anshul Dalal, Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
Add bindings for Aosong AGS02MA TVOC sensor.
The sensor communicates over i2c with the default address 0x1a.
TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.
Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html
Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
---
Changes for v3:
- Fixed commit message
- Removed "asair,ags02ma" compatible
v2: https://lore.kernel.org/lkml/20231115125810.1394854-2-anshulusr@gmail.com/
Changes for v2:
- Removed device from trivial-devices
- Added standalone binding with vdd-supply property
v1: https://lore.kernel.org/lkml/20231107173100.62715-2-anshulusr@gmail.com/
---
.../bindings/iio/chemical/aosong,ags02ma.yaml | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
diff --git a/Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml b/Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
new file mode 100644
index 000000000000..38ba3614ae8a
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aosong AGS02MA VOC Sensor
+
+description: |
+ AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
+ address of 0x1a.
+
+ Datasheet:
+ https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+
+maintainers:
+ - Anshul Dalal <anshulusr@gmail.com>
+
+properties:
+ compatible:
+ enum:
+ - aosong,ags02ma
+
+ reg:
+ maxItems: 1
+
+ vdd-supply: true
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ light-sensor@1a {
+ compatible = "aosong,ags02ma";
+ reg = <0x1a>;
+ vdd-supply = <&vdd_regulator>;
+ };
+ };
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
2023-11-21 9:57 [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma Anshul Dalal
@ 2023-11-21 9:57 ` Anshul Dalal
2023-11-24 7:56 ` kernel test robot
2023-11-25 9:10 ` kernel test robot
2023-11-21 10:02 ` [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Krzysztof Kozlowski
2 siblings, 2 replies; 8+ messages in thread
From: Anshul Dalal @ 2023-11-21 9:57 UTC (permalink / raw)
To: linux-kernel, linux-iio, devicetree
Cc: Anshul Dalal, Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
A simple driver for the TVOC (Total Volatile Organic Compounds)
sensor from Aosong: AGS02MA
Steps in reading the VOC sensor value over i2c:
1. Read 5 bytes from the register `AGS02MA_TVOC_READ_REG` [0x00]
2. The first 4 bytes are taken as the big endian sensor data with final
byte being the CRC
3. The CRC is verified and the value is returned over an
`IIO_CHAN_INFO_RAW` channel as percents
Tested on Raspberry Pi Zero 2W
Datasheet:
https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
Product-Page:
http://www.aosong.com/m/en/products-33.html
Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
---
Changes for v3:
- Added of_device_id
v2: https://lore.kernel.org/lkml/20231115125810.1394854-3-anshulusr@gmail.com/
Changes for v2:
- Fixed Kconfig not selecting CRC8 (used to be `select crc8`)
- Changed instances of asair to aosong
- Report raw readings in percents instead of ppb
- Added myself as maintainer for the device binding
v1: https://lore.kernel.org/lkml/20231107173100.62715-3-anshulusr@gmail.com/
---
MAINTAINERS | 7 ++
drivers/iio/chemical/Kconfig | 11 +++
drivers/iio/chemical/Makefile | 1 +
drivers/iio/chemical/ags02ma.c | 168 +++++++++++++++++++++++++++++++++
4 files changed, 187 insertions(+)
create mode 100644 drivers/iio/chemical/ags02ma.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 81d5fc0bba68..ba3c950aca1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3028,6 +3028,13 @@ S: Supported
W: http://www.akm.com/
F: drivers/iio/magnetometer/ak8974.c
+AOSONG AGS02MA TVOC SENSOR DRIVER
+M: Anshul Dalal <anshulusr@gmail.com>
+L: linux-iio@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/iio/chemical/aosong,ags02ma.yaml
+F: drivers/iio/chemical/ags02ma.c
+
ASC7621 HARDWARE MONITOR DRIVER
M: George Joseph <george.joseph@fairview5.com>
L: linux-hwmon@vger.kernel.org
diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig
index c30657e10ee1..02649ab81b3c 100644
--- a/drivers/iio/chemical/Kconfig
+++ b/drivers/iio/chemical/Kconfig
@@ -5,6 +5,17 @@
menu "Chemical Sensors"
+config AOSONG_AGS02MA
+ tristate "Aosong AGS02MA TVOC sensor driver"
+ depends on I2C
+ select CRC8
+ help
+ Say Y here to build support for Aosong AGS02MA TVOC (Total Volatile
+ Organic Compounds) sensor.
+
+ To compile this driver as module, choose M here: the module will be
+ called ags02ma.
+
config ATLAS_PH_SENSOR
tristate "Atlas Scientific OEM SM sensors"
depends on I2C
diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile
index a11e777a7a00..2f3dee8bb779 100644
--- a/drivers/iio/chemical/Makefile
+++ b/drivers/iio/chemical/Makefile
@@ -4,6 +4,7 @@
#
# When adding new entries keep the list in alphabetical order
+obj-$(CONFIG_AOSONG_AGS02MA) += ags02ma.o
obj-$(CONFIG_ATLAS_PH_SENSOR) += atlas-sensor.o
obj-$(CONFIG_ATLAS_EZO_SENSOR) += atlas-ezo-sensor.o
obj-$(CONFIG_BME680) += bme680_core.o
diff --git a/drivers/iio/chemical/ags02ma.c b/drivers/iio/chemical/ags02ma.c
new file mode 100644
index 000000000000..04a07307caa9
--- /dev/null
+++ b/drivers/iio/chemical/ags02ma.c
@@ -0,0 +1,168 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2023 Anshul Dalal <anshulusr@gmail.com>
+ *
+ * Driver for Aosong AGS02MA
+ *
+ * Datasheet:
+ * https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
+ * Product Page:
+ * http://www.aosong.com/m/en/products-33.html
+ *
+ * TODO:
+ * - Add support for ug/m^3 units of measurement
+ * - Add support for modifying i2c address
+ */
+
+#include <linux/crc8.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/iio/iio.h>
+#include <linux/module.h>
+
+#define AGS02MA_DEVICE_NAME "ags02ma"
+
+#define AGS02MA_TVOC_READ_REG 0x00
+#define AGS02MA_VERSION_REG 0x11
+
+#define AGS02MA_VERSION_PROCESSING_DELAY 30
+#define AGS02MA_TVOC_READ_PROCESSING_DELAY 1500
+
+#define AGS02MA_CRC8_INIT 0xff
+#define AGS02MA_CRC8_POLYNOMIAL 0x31
+#define AGS02MA_PPB_PERCENT_CONVERSION 10000000
+
+DECLARE_CRC8_TABLE(ags02ma_crc8_table);
+
+struct ags02ma_data {
+ struct i2c_client *client;
+};
+
+struct ags02ma_reading {
+ __be32 data;
+ u8 crc;
+} __packed;
+
+static u32 ags02ma_register_read(struct i2c_client *client, u8 reg, u16 delay)
+{
+ u32 ret;
+ u8 crc;
+ struct ags02ma_reading read_buffer;
+
+ ret = i2c_master_send(client, ®, sizeof(reg));
+ if (ret < 0) {
+ dev_err(&client->dev,
+ "Failed to send data to register 0x%x: %d", reg, ret);
+ return ret;
+ }
+
+ /* Processing Delay, Check Table 7.7 in the datasheet */
+ msleep_interruptible(delay);
+
+ ret = i2c_master_recv(client, (u8 *)&read_buffer, sizeof(read_buffer));
+ if (ret < 0) {
+ dev_err(&client->dev,
+ "Failed to receive from register 0x%x: %d", reg, ret);
+ return ret;
+ }
+ ret = be32_to_cpu(read_buffer.data);
+
+ crc = crc8(ags02ma_crc8_table, (u8 *)&read_buffer.data,
+ sizeof(read_buffer.data), AGS02MA_CRC8_INIT);
+ if (crc != read_buffer.crc) {
+ dev_err(&client->dev, "CRC error\n");
+ return -EIO;
+ }
+
+ return ret;
+}
+
+static int ags02ma_read_raw(struct iio_dev *iio_device,
+ struct iio_chan_spec const *chan, int *val,
+ int *val2, long mask)
+{
+ int ret;
+ struct ags02ma_data *data = iio_priv(iio_device);
+
+ if (mask == IIO_CHAN_INFO_RAW) {
+ /* The sensor reads data as ppb */
+ ret = ags02ma_register_read(data->client, AGS02MA_TVOC_READ_REG,
+ AGS02MA_TVOC_READ_PROCESSING_DELAY);
+ if (ret < 0)
+ return ret;
+ *val = ret;
+ *val2 = AGS02MA_PPB_PERCENT_CONVERSION;
+ return IIO_VAL_FRACTIONAL;
+ } else {
+ return -EINVAL;
+ }
+}
+
+static const struct iio_info ags02ma_info = {
+ .read_raw = ags02ma_read_raw,
+};
+
+static const struct iio_chan_spec ags02ma_channels[] = {
+ { .type = IIO_CONCENTRATION,
+ .channel2 = IIO_MOD_VOC,
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) }
+};
+
+static int ags02ma_probe(struct i2c_client *client)
+{
+ int ret;
+ struct ags02ma_data *data;
+ struct iio_dev *indio_dev;
+ u32 version;
+
+ indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
+ if (!indio_dev)
+ return -ENOMEM;
+
+ crc8_populate_msb(ags02ma_crc8_table, AGS02MA_CRC8_POLYNOMIAL);
+
+ ret = ags02ma_register_read(client, AGS02MA_VERSION_REG,
+ AGS02MA_VERSION_PROCESSING_DELAY);
+ if (ret < 0) {
+ dev_err(&client->dev, "Failed to read device version: %d", ret);
+ return ret;
+ }
+ version = ret;
+ dev_dbg(&client->dev, "Aosong AGS02MA, Version: 0x%x", version);
+
+ data = iio_priv(indio_dev);
+ i2c_set_clientdata(client, indio_dev);
+ data->client = client;
+ indio_dev->info = &ags02ma_info;
+ indio_dev->channels = ags02ma_channels;
+ indio_dev->num_channels = ARRAY_SIZE(ags02ma_channels);
+ indio_dev->name = AGS02MA_DEVICE_NAME;
+
+ return devm_iio_device_register(&client->dev, indio_dev);
+}
+
+static const struct i2c_device_id ags02ma_id_table[] = {
+ { AGS02MA_DEVICE_NAME, 0 },
+ { /* Sentinel */ }
+};
+MODULE_DEVICE_TABLE(i2c, ags02ma_id_table);
+
+static const struct of_device_id ags02ma_of_table[] = {
+ { .compatible = "aosong,ags02ma"},
+ { /* Sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ags02ma_of_table);
+
+static struct i2c_driver ags02ma_driver = {
+ .driver = {
+ .name = AGS02MA_DEVICE_NAME,
+ .of_match_table = of_match_ptr(ags02ma_of_table),
+ },
+ .id_table = ags02ma_id_table,
+ .probe = ags02ma_probe,
+};
+module_i2c_driver(ags02ma_driver);
+
+MODULE_AUTHOR("Anshul Dalal <anshulusr@gmail.com>");
+MODULE_DESCRIPTION("Aosong AGS02MA TVOC Driver");
+MODULE_LICENSE("GPL");
--
2.42.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong
2023-11-21 9:57 [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA Anshul Dalal
@ 2023-11-21 10:02 ` Krzysztof Kozlowski
2 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-21 10:02 UTC (permalink / raw)
To: Anshul Dalal, linux-kernel, linux-iio, devicetree
Cc: Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
On 21/11/2023 10:57, Anshul Dalal wrote:
> Aosong Electronic Co., LTD. is a supplier for MEMS sensors such as AHT20
> temperature and humidity sensor under the brand name Asair
>
> Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
> ---
>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma
2023-11-21 9:57 ` [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma Anshul Dalal
@ 2023-11-21 10:03 ` Krzysztof Kozlowski
2023-11-21 10:12 ` Anshul Dalal
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-21 10:03 UTC (permalink / raw)
To: Anshul Dalal, linux-kernel, linux-iio, devicetree
Cc: Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
On 21/11/2023 10:57, Anshul Dalal wrote:
> Add bindings for Aosong AGS02MA TVOC sensor.
>
> The sensor communicates over i2c with the default address 0x1a.
> TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.
>
> Datasheet:
> https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
> Product-Page:
> http://www.aosong.com/m/en/products-33.html
>
> +---
> +$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Aosong AGS02MA VOC Sensor
> +
> +description: |
> + AGS02MA is an TVOC (Total Volatile Organic Compounds) i2c sensor with default
> + address of 0x1a.
What does it measure? Light?
> +
> + Datasheet:
> + https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
> +
> +maintainers:
> + - Anshul Dalal <anshulusr@gmail.com>
> +
> +properties:
> + compatible:
> + enum:
> + - aosong,ags02ma
> +
> + reg:
> + maxItems: 1
> +
> + vdd-supply: true
> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + light-sensor@1a {
You called it chemical, so why this is here light-sensor?
> + compatible = "aosong,ags02ma";
> + reg = <0x1a>;
> + vdd-supply = <&vdd_regulator>;
> + };
> + };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma
2023-11-21 10:03 ` Krzysztof Kozlowski
@ 2023-11-21 10:12 ` Anshul Dalal
0 siblings, 0 replies; 8+ messages in thread
From: Anshul Dalal @ 2023-11-21 10:12 UTC (permalink / raw)
To: Krzysztof Kozlowski, linux-kernel, linux-iio, devicetree
Cc: Conor Dooley, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, linux-kernel-mentees, Jonathan Cameron
On 11/21/23 15:33, Krzysztof Kozlowski wrote:
> On 21/11/2023 10:57, Anshul Dalal wrote:
>> Add bindings for Aosong AGS02MA TVOC sensor.
>>
>> The sensor communicates over i2c with the default address 0x1a.
>> TVOC values can be read in the units of ppb and ug/m^3 at register 0x00.
>>
>> Datasheet:
>> https://asairsensors.com/wp-content/uploads/2021/09/AGS02MA.pdf
>> Product-Page:
>> http://www.aosong.com/m/en/products-33.html
>>
>
>
>> +---
>> +$id: http://devicetree.org/schemas/iio/chemical/aosong,ags02ma.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Aosong AGS02MA VOC Sensor
>> [..]
>> +examples:
>> + - |
>> + #include <dt-bindings/interrupt-controller/irq.h>
>> + i2c {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + light-sensor@1a {
>
>
> You called it chemical, so why this is here light-sensor?
I was working on a binding for a light sensor in parallel at that time,
I probably forgot to change this when copying the example from the light
sensor.
Would be replaced by "voc-sensor" in the next revision, apologies for
any inconvenience.
Thanks for the review.
Best Regards,
Anshul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
2023-11-21 9:57 ` [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA Anshul Dalal
@ 2023-11-24 7:56 ` kernel test robot
2023-11-25 9:10 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-11-24 7:56 UTC (permalink / raw)
To: Anshul Dalal, linux-kernel, linux-iio, devicetree
Cc: oe-kbuild-all, Anshul Dalal, Conor Dooley, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, linux-kernel-mentees,
Jonathan Cameron
Hi Anshul,
kernel test robot noticed the following build warnings:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.7-rc2 next-20231124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Anshul-Dalal/dt-bindings-iio-chemical-add-aosong-ags02ma/20231121-180435
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20231121095800.2180870-3-anshulusr%40gmail.com
patch subject: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
config: s390-randconfig-r081-20231123 (https://download.01.org/0day-ci/archive/20231124/202311241129.HrMrED0B-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231124/202311241129.HrMrED0B-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311241129.HrMrED0B-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/iio/chemical/ags02ma.c:150:34: warning: unused variable 'ags02ma_of_table' [-Wunused-const-variable]
150 | static const struct of_device_id ags02ma_of_table[] = {
| ^
1 warning generated.
vim +/ags02ma_of_table +150 drivers/iio/chemical/ags02ma.c
149
> 150 static const struct of_device_id ags02ma_of_table[] = {
151 { .compatible = "aosong,ags02ma"},
152 { /* Sentinel */ }
153 };
154 MODULE_DEVICE_TABLE(of, ags02ma_of_table);
155
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
2023-11-21 9:57 ` [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA Anshul Dalal
2023-11-24 7:56 ` kernel test robot
@ 2023-11-25 9:10 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-11-25 9:10 UTC (permalink / raw)
To: Anshul Dalal, linux-kernel, linux-iio, devicetree
Cc: oe-kbuild-all, Anshul Dalal, Conor Dooley, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, linux-kernel-mentees,
Jonathan Cameron
Hi Anshul,
kernel test robot noticed the following build warnings:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.7-rc2 next-20231124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Anshul-Dalal/dt-bindings-iio-chemical-add-aosong-ags02ma/20231121-180435
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20231121095800.2180870-3-anshulusr%40gmail.com
patch subject: [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA
config: arm-randconfig-r081-20231123 (https://download.01.org/0day-ci/archive/20231125/202311251636.m0yt3fIb-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231125/202311251636.m0yt3fIb-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311251636.m0yt3fIb-lkp@intel.com/
New smatch warnings:
drivers/iio/chemical/ags02ma.c:53 ags02ma_register_read() warn: unsigned 'ret' is never less than zero.
Old smatch warnings:
drivers/iio/chemical/ags02ma.c:63 ags02ma_register_read() warn: unsigned 'ret' is never less than zero.
vim +/ret +53 drivers/iio/chemical/ags02ma.c
45
46 static u32 ags02ma_register_read(struct i2c_client *client, u8 reg, u16 delay)
47 {
48 u32 ret;
49 u8 crc;
50 struct ags02ma_reading read_buffer;
51
52 ret = i2c_master_send(client, ®, sizeof(reg));
> 53 if (ret < 0) {
54 dev_err(&client->dev,
55 "Failed to send data to register 0x%x: %d", reg, ret);
56 return ret;
57 }
58
59 /* Processing Delay, Check Table 7.7 in the datasheet */
60 msleep_interruptible(delay);
61
62 ret = i2c_master_recv(client, (u8 *)&read_buffer, sizeof(read_buffer));
63 if (ret < 0) {
64 dev_err(&client->dev,
65 "Failed to receive from register 0x%x: %d", reg, ret);
66 return ret;
67 }
68 ret = be32_to_cpu(read_buffer.data);
69
70 crc = crc8(ags02ma_crc8_table, (u8 *)&read_buffer.data,
71 sizeof(read_buffer.data), AGS02MA_CRC8_INIT);
72 if (crc != read_buffer.crc) {
73 dev_err(&client->dev, "CRC error\n");
74 return -EIO;
75 }
76
77 return ret;
78 }
79
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-11-25 9:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 9:57 [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 2/3] dt-bindings: iio: chemical: add aosong,ags02ma Anshul Dalal
2023-11-21 10:03 ` Krzysztof Kozlowski
2023-11-21 10:12 ` Anshul Dalal
2023-11-21 9:57 ` [PATCH v3 3/3] iio: chemical: add support for Aosong AGS02MA Anshul Dalal
2023-11-24 7:56 ` kernel test robot
2023-11-25 9:10 ` kernel test robot
2023-11-21 10:02 ` [PATCH v3 1/3] dt-bindings: vendor-prefixes: add aosong Krzysztof Kozlowski
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).