* [PATCH v3 0/3] iio: light: add al3000a als support
@ 2025-02-16 16:27 Svyatoslav Ryhel
2025-02-16 16:27 ` [PATCH v3 1/3] dt-bindings: iio: light: al3010: add al3000a support Svyatoslav Ryhel
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2025-02-16 16:27 UTC (permalink / raw)
To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Thierry Reding,
Jonathan Hunter, Svyatoslav Ryhel, Javier Carrasco,
Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker,
Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov,
David Heidelberg
Cc: linux-iio, devicetree, linux-kernel, linux-tegra
AL3000a is an illuminance sensor found in ASUS TF101 tablet.
---
Changes on switching from v2 to v3:
- droped linux/iio/sysfs.h
- set driver name directly
- switched to IIO_CHAN_INFO_PROCESSED
- split al3000a_set_pwr into 2 functions
- added i2c_device_id
- improved code formatting
Changes on switching from v1 to v2:
- sort compatible alphabetically in schema
- clarify commit descriptions
- convert to use regmap
- arrangle lux conversion table in rows of 8
- add more used headers
- improve code formatting
---
Svyatoslav Ryhel (3):
dt-bindings: iio: light: al3010: add al3000a support
iio: light: Add support for AL3000a illuminance sensor
ARM: tegra: tf101: Add al3000a illuminance sensor node
.../bindings/iio/light/dynaimage,al3010.yaml | 6 +-
.../boot/dts/nvidia/tegra20-asus-tf101.dts | 11 +
drivers/iio/light/Kconfig | 10 +
drivers/iio/light/Makefile | 1 +
drivers/iio/light/al3000a.c | 223 ++++++++++++++++++
5 files changed, 249 insertions(+), 2 deletions(-)
create mode 100644 drivers/iio/light/al3000a.c
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v3 1/3] dt-bindings: iio: light: al3010: add al3000a support 2025-02-16 16:27 [PATCH v3 0/3] iio: light: add al3000a als support Svyatoslav Ryhel @ 2025-02-16 16:27 ` Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 3/3] ARM: tegra: tf101: Add al3000a illuminance sensor node Svyatoslav Ryhel 2 siblings, 0 replies; 8+ messages in thread From: Svyatoslav Ryhel @ 2025-02-16 16:27 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Svyatoslav Ryhel, Javier Carrasco, Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg Cc: linux-iio, devicetree, linux-kernel, linux-tegra AL3000a is an ambient light sensor quite closely related to exising AL3010 and can reuse exising schema for AL3010. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: David Heidelberg <david@ixit.cz> --- .../devicetree/bindings/iio/light/dynaimage,al3010.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/light/dynaimage,al3010.yaml b/Documentation/devicetree/bindings/iio/light/dynaimage,al3010.yaml index a3a979553e32..f1048c30e73e 100644 --- a/Documentation/devicetree/bindings/iio/light/dynaimage,al3010.yaml +++ b/Documentation/devicetree/bindings/iio/light/dynaimage,al3010.yaml @@ -4,14 +4,16 @@ $id: http://devicetree.org/schemas/iio/light/dynaimage,al3010.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Dyna-Image AL3010 sensor +title: Dyna-Image AL3000a/AL3010 sensor maintainers: - David Heidelberg <david@ixit.cz> properties: compatible: - const: dynaimage,al3010 + enum: + - dynaimage,al3000a + - dynaimage,al3010 reg: maxItems: 1 -- 2.43.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor 2025-02-16 16:27 [PATCH v3 0/3] iio: light: add al3000a als support Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 1/3] dt-bindings: iio: light: al3010: add al3000a support Svyatoslav Ryhel @ 2025-02-16 16:27 ` Svyatoslav Ryhel 2025-02-16 19:09 ` kernel test robot ` (3 more replies) 2025-02-16 16:27 ` [PATCH v3 3/3] ARM: tegra: tf101: Add al3000a illuminance sensor node Svyatoslav Ryhel 2 siblings, 4 replies; 8+ messages in thread From: Svyatoslav Ryhel @ 2025-02-16 16:27 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Svyatoslav Ryhel, Javier Carrasco, Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg Cc: linux-iio, devicetree, linux-kernel, linux-tegra AL3000a is a simple I2C-based ambient light sensor, which is closely related to AL3010 and AL3320a, but has significantly different way of processing data generated by the sensor. Tested-by: Robert Eckelmann <longnoserob@gmail.com> Tested-by: Antoni Aloy Torrens <aaloytorrens@gmail.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: David Heidelberg <david@ixit.cz> --- drivers/iio/light/Kconfig | 10 ++ drivers/iio/light/Makefile | 1 + drivers/iio/light/al3000a.c | 223 ++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 drivers/iio/light/al3000a.c diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index 29ffa8491927..37f83e1d8893 100644 --- a/drivers/iio/light/Kconfig +++ b/drivers/iio/light/Kconfig @@ -43,6 +43,16 @@ config ADUX1020 To compile this driver as a module, choose M here: the module will be called adux1020. +config AL3000A + tristate "AL3000a ambient light sensor" + depends on I2C + help + Say Y here if you want to build a driver for the Dyna Image AL3000a + ambient light sensor. + + To compile this driver as a module, choose M here: the + module will be called al3000a. + config AL3010 tristate "AL3010 ambient light sensor" depends on I2C diff --git a/drivers/iio/light/Makefile b/drivers/iio/light/Makefile index f14a37442712..03f10786273a 100644 --- a/drivers/iio/light/Makefile +++ b/drivers/iio/light/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_ACPI_ALS) += acpi-als.o obj-$(CONFIG_ADJD_S311) += adjd_s311.o obj-$(CONFIG_ADUX1020) += adux1020.o +obj-$(CONFIG_AL3000A) += al3000a.o obj-$(CONFIG_AL3010) += al3010.o obj-$(CONFIG_AL3320A) += al3320a.o obj-$(CONFIG_APDS9300) += apds9300.o diff --git a/drivers/iio/light/al3000a.c b/drivers/iio/light/al3000a.c new file mode 100644 index 000000000000..bc7fd122b218 --- /dev/null +++ b/drivers/iio/light/al3000a.c @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/array_size.h> +#include <linux/bitfield.h> +#include <linux/device.h> +#include <linux/err.h> +#include <linux/i2c.h> +#include <linux/mod_devicetable.h> +#include <linux/module.h> +#include <linux/pm.h> +#include <linux/regmap.h> +#include <linux/regulator/consumer.h> +#include <linux/types.h> + +#include <linux/iio/iio.h> + +#define AL3000A_REG_SYSTEM 0x00 +#define AL3000A_REG_DATA 0x05 + +#define AL3000A_CONFIG_ENABLE 0x00 +#define AL3000A_CONFIG_DISABLE 0x0b +#define AL3000A_CONFIG_RESET 0x0f +#define AL3000A_GAIN_MASK GENMASK(5, 0) + +/* + * This are pre-calculated lux values based on possible output of sensor + * (range 0x00 - 0x3F) + */ +static const u32 lux_table[] = { + 1, 1, 1, 2, 2, 2, 3, 4, /* 0 - 7 */ + 4, 5, 6, 7, 9, 11, 13, 16, /* 8 - 15 */ + 19, 22, 27, 32, 39, 46, 56, 67, /* 16 - 23 */ + 80, 96, 116, 139, 167, 200, 240, 289, /* 24 - 31 */ + 347, 416, 499, 600, 720, 864, 1037, 1245, /* 32 - 39 */ + 1495, 1795, 2155, 2587, 3105, 3728, 4475, 5373, /* 40 - 47 */ + 6450, 7743, 9296, 11160, 13397, 16084, 19309, 23180, /* 48 - 55 */ + 27828, 33408, 40107, 48148, 57803, 69393, 83306, 100000 /* 56 - 63 */ +}; + +static const struct regmap_config al3000a_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = AL3000A_REG_DATA, +}; + +struct al3000a_data { + struct regmap *regmap; + struct regulator *vdd_supply; +}; + +static const struct iio_chan_spec al3000a_channels[] = { + { + .type = IIO_LIGHT, + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), + }, +}; + +static int al3000a_set_pwr_on(struct al3000a_data *data) +{ + struct device *dev = regmap_get_device(data->regmap); + int ret; + + ret = regulator_enable(data->vdd_supply); + if (ret) { + dev_err(dev, "failed to enable vdd power supply\n"); + return ret; + } + + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_ENABLE); + if (ret) { + dev_err(dev, "failed to write system register\n"); + return ret; + } + + return 0; +} + +static void al3000a_set_pwr_off(void *_data) +{ + struct al3000a_data *data = _data; + struct device *dev = regmap_get_device(data->regmap); + int ret; + + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_DISABLE); + if (ret) { + dev_err(dev, "failed to write system register\n"); + return; + } + + ret = regulator_disable(data->vdd_supply); + if (ret) { + dev_err(dev, "failed to disable vdd power supply\n"); + return; + } +} + +static int al3000a_init(struct al3000a_data *data) +{ + int ret; + + ret = al3000a_set_pwr_on(data); + if (ret) + return ret; + + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_RESET); + if (ret) + return ret; + + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_ENABLE); + if (ret) + return ret; + + return 0; +} + +static int al3000a_read_raw(struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, int *val, + int *val2, long mask) +{ + struct al3000a_data *data = iio_priv(indio_dev); + int ret, gain; + + switch (mask) { + case IIO_CHAN_INFO_PROCESSED: + ret = regmap_read(data->regmap, AL3000A_REG_DATA, &gain); + if (ret < 0) + return ret; + + *val = lux_table[gain & AL3000A_GAIN_MASK]; + + return IIO_VAL_INT; + default: + return -EINVAL; + } +} + +static const struct iio_info al3000a_info = { + .read_raw = al3000a_read_raw, +}; + +static int al3000a_probe(struct i2c_client *client) +{ + struct al3000a_data *data; + struct device *dev = &client->dev; + struct iio_dev *indio_dev; + int ret; + + indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); + if (!indio_dev) + return -ENOMEM; + + data = iio_priv(indio_dev); + i2c_set_clientdata(client, indio_dev); + + data->regmap = devm_regmap_init_i2c(client, &al3000a_regmap_config); + if (IS_ERR(data->regmap)) + return dev_err_probe(dev, PTR_ERR(data->regmap), + "cannot allocate regmap\n"); + + data->vdd_supply = devm_regulator_get(dev, "vdd"); + if (IS_ERR(data->vdd_supply)) + return dev_err_probe(dev, PTR_ERR(data->vdd_supply), + "failed to get vdd regulator\n"); + + indio_dev->info = &al3000a_info; + indio_dev->name = "al3000a"; + indio_dev->channels = al3000a_channels; + indio_dev->num_channels = ARRAY_SIZE(al3000a_channels); + indio_dev->modes = INDIO_DIRECT_MODE; + + ret = al3000a_init(data); + if (ret < 0) + return dev_err_probe(dev, ret, "failed to init ALS\n"); + + ret = devm_add_action_or_reset(dev, al3000a_set_pwr_off, data); + if (ret < 0) + return dev_err_probe(dev, ret, "failed to add action\n"); + + return devm_iio_device_register(dev, indio_dev); +} + +static int al3000a_suspend(struct device *dev) +{ + struct al3000a_data *data = iio_priv(dev_get_drvdata(dev)); + + al3000a_set_pwr_off(data); + return 0; +} + +static int al3000a_resume(struct device *dev) +{ + struct al3000a_data *data = iio_priv(dev_get_drvdata(dev)); + + return al3000a_set_pwr_on(data); +} + +static DEFINE_SIMPLE_DEV_PM_OPS(al3000a_pm_ops, al3000a_suspend, al3000a_resume); + +static const struct i2c_device_id al3000a_id[] = { + {"al3000a", }, + {} +}; +MODULE_DEVICE_TABLE(i2c, al3010_id); + +static const struct of_device_id al3000a_of_match[] = { + { .compatible = "dynaimage,al3000a" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, al3000a_of_match); + +static struct i2c_driver al3000a_driver = { + .driver = { + .name = "al3000a", + .of_match_table = al3000a_of_match, + .pm = pm_sleep_ptr(&al3000a_pm_ops), + }, + .probe = al3000a_probe, + .id_table = al3000a_id, +}; +module_i2c_driver(al3000a_driver); + +MODULE_AUTHOR("Svyatolsav Ryhel <clamor95@gmail.com>"); +MODULE_DESCRIPTION("al3000a Ambient Light Sensor driver"); +MODULE_LICENSE("GPL"); -- 2.43.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel @ 2025-02-16 19:09 ` kernel test robot 2025-02-16 20:57 ` Andy Shevchenko ` (2 subsequent siblings) 3 siblings, 0 replies; 8+ messages in thread From: kernel test robot @ 2025-02-16 19:09 UTC (permalink / raw) To: Svyatoslav Ryhel, Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Javier Carrasco, Matti Vaittinen, Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg Cc: oe-kbuild-all, linux-iio, devicetree, linux-kernel, linux-tegra Hi Svyatoslav, kernel test robot noticed the following build errors: [auto build test ERROR on robh/for-next] [also build test ERROR on linus/master v6.14-rc2 next-20250214] [cannot apply to jic23-iio/togreg] [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/Svyatoslav-Ryhel/dt-bindings-iio-light-al3010-add-al3000a-support/20250217-002927 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20250216162721.124834-3-clamor95%40gmail.com patch subject: [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20250217/202502170243.eNwe0AL0-lkp@intel.com/config) compiler: sh4-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250217/202502170243.eNwe0AL0-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/202502170243.eNwe0AL0-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/device/driver.h:21, from include/linux/device.h:32, from drivers/iio/light/al3000a.c:4: >> drivers/iio/light/al3000a.c:202:26: error: 'al3010_id' undeclared here (not in a function); did you mean 'al3000a_id'? 202 | MODULE_DEVICE_TABLE(i2c, al3010_id); | ^~~~~~~~~ include/linux/module.h:250:15: note: in definition of macro 'MODULE_DEVICE_TABLE' 250 | extern typeof(name) __mod_device_table__##type##__##name \ | ^~~~ >> include/linux/module.h:250:21: error: '__mod_device_table__i2c__al3010_id' aliased to undefined symbol 'al3010_id' 250 | extern typeof(name) __mod_device_table__##type##__##name \ | ^~~~~~~~~~~~~~~~~~~~ drivers/iio/light/al3000a.c:202:1: note: in expansion of macro 'MODULE_DEVICE_TABLE' 202 | MODULE_DEVICE_TABLE(i2c, al3010_id); | ^~~~~~~~~~~~~~~~~~~ -- In file included from include/linux/device/driver.h:21, from include/linux/device.h:32, from al3000a.c:4: al3000a.c:202:26: error: 'al3010_id' undeclared here (not in a function); did you mean 'al3000a_id'? 202 | MODULE_DEVICE_TABLE(i2c, al3010_id); | ^~~~~~~~~ include/linux/module.h:250:15: note: in definition of macro 'MODULE_DEVICE_TABLE' 250 | extern typeof(name) __mod_device_table__##type##__##name \ | ^~~~ >> include/linux/module.h:250:21: error: '__mod_device_table__i2c__al3010_id' aliased to undefined symbol 'al3010_id' 250 | extern typeof(name) __mod_device_table__##type##__##name \ | ^~~~~~~~~~~~~~~~~~~~ al3000a.c:202:1: note: in expansion of macro 'MODULE_DEVICE_TABLE' 202 | MODULE_DEVICE_TABLE(i2c, al3010_id); | ^~~~~~~~~~~~~~~~~~~ vim +202 drivers/iio/light/al3000a.c 197 198 static const struct i2c_device_id al3000a_id[] = { 199 {"al3000a", }, 200 {} 201 }; > 202 MODULE_DEVICE_TABLE(i2c, al3010_id); 203 -- 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 2/3] iio: light: Add support for AL3000a illuminance sensor 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel 2025-02-16 19:09 ` kernel test robot @ 2025-02-16 20:57 ` Andy Shevchenko 2025-02-16 20:57 ` kernel test robot 2025-02-16 21:24 ` Christophe JAILLET 3 siblings, 0 replies; 8+ messages in thread From: Andy Shevchenko @ 2025-02-16 20:57 UTC (permalink / raw) To: Svyatoslav Ryhel Cc: Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Javier Carrasco, Matti Vaittinen, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg, linux-iio, devicetree, linux-kernel, linux-tegra On Sun, Feb 16, 2025 at 06:27:20PM +0200, Svyatoslav Ryhel wrote: > AL3000a is a simple I2C-based ambient light sensor, which is > closely related to AL3010 and AL3320a, but has significantly > different way of processing data generated by the sensor. ... > +static int al3000a_set_pwr_on(struct al3000a_data *data) > +{ > + struct device *dev = regmap_get_device(data->regmap); > + int ret; > + > + ret = regulator_enable(data->vdd_supply); > + if (ret) { > + dev_err(dev, "failed to enable vdd power supply\n"); > + return ret; > + } > + > + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_ENABLE); > + if (ret) { > + dev_err(dev, "failed to write system register\n"); > + return ret; > + } > + > + return 0; return ret; > +} ... > +static void al3000a_set_pwr_off(void *_data) > +{ > + struct al3000a_data *data = _data; > + struct device *dev = regmap_get_device(data->regmap); > + int ret; > + > + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_DISABLE); > + if (ret) { > + dev_err(dev, "failed to write system register\n"); > + return; > + } > + > + ret = regulator_disable(data->vdd_supply); > + if (ret) { > + dev_err(dev, "failed to disable vdd power supply\n"); > + return; This is not needed, but I understand the intention. To me, nevertheless, seems better to return an error to upper layer. > + } > +} > + > +static int al3000a_init(struct al3000a_data *data) > +{ > + int ret; > + > + ret = al3000a_set_pwr_on(data); > + if (ret) > + return ret; > + > + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_RESET); > + if (ret) > + return ret; > + > + ret = regmap_write(data->regmap, AL3000A_REG_SYSTEM, AL3000A_CONFIG_ENABLE); > + if (ret) > + return ret; > + > + return 0; return regmap_write(...); > +} ... > +static const struct i2c_device_id al3000a_id[] = { > + {"al3000a", }, Remove redundant inner comma. And make style consistent with OF, i.e. surround string with spaces. > + {} > +}; > +MODULE_DEVICE_TABLE(i2c, al3010_id); Copy'n'paste error, obviously. Please, test every version before sending. > + > +static const struct of_device_id al3000a_of_match[] = { > + { .compatible = "dynaimage,al3000a" }, > + { /* sentinel */ } > +}; -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel 2025-02-16 19:09 ` kernel test robot 2025-02-16 20:57 ` Andy Shevchenko @ 2025-02-16 20:57 ` kernel test robot 2025-02-16 21:24 ` Christophe JAILLET 3 siblings, 0 replies; 8+ messages in thread From: kernel test robot @ 2025-02-16 20:57 UTC (permalink / raw) To: Svyatoslav Ryhel, Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Javier Carrasco, Matti Vaittinen, Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg Cc: llvm, oe-kbuild-all, linux-iio, devicetree, linux-kernel, linux-tegra Hi Svyatoslav, kernel test robot noticed the following build errors: [auto build test ERROR on robh/for-next] [also build test ERROR on linus/master v6.14-rc2 next-20250214] [cannot apply to jic23-iio/togreg] [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/Svyatoslav-Ryhel/dt-bindings-iio-light-al3010-add-al3000a-support/20250217-002927 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20250216162721.124834-3-clamor95%40gmail.com patch subject: [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250217/202502170433.E6JuboR5-lkp@intel.com/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250217/202502170433.E6JuboR5-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/202502170433.E6JuboR5-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from drivers/iio/light/al3000a.c:4: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:181: In file included from arch/s390/include/asm/mmu_context.h:11: In file included from arch/s390/include/asm/pgalloc.h:18: In file included from include/linux/mm.h:2224: include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 505 | item]; | ~~~~ include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 512 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 525 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ >> drivers/iio/light/al3000a.c:202:26: error: use of undeclared identifier 'al3010_id'; did you mean 'al3000a_id'? 202 | MODULE_DEVICE_TABLE(i2c, al3010_id); | ^~~~~~~~~ | al3000a_id include/linux/module.h:250:15: note: expanded from macro 'MODULE_DEVICE_TABLE' 250 | extern typeof(name) __mod_device_table__##type##__##name \ | ^ drivers/iio/light/al3000a.c:198:35: note: 'al3000a_id' declared here 198 | static const struct i2c_device_id al3000a_id[] = { | ^ 3 warnings and 1 error generated. vim +202 drivers/iio/light/al3000a.c 197 198 static const struct i2c_device_id al3000a_id[] = { 199 {"al3000a", }, 200 {} 201 }; > 202 MODULE_DEVICE_TABLE(i2c, al3010_id); 203 -- 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 2/3] iio: light: Add support for AL3000a illuminance sensor 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel ` (2 preceding siblings ...) 2025-02-16 20:57 ` kernel test robot @ 2025-02-16 21:24 ` Christophe JAILLET 3 siblings, 0 replies; 8+ messages in thread From: Christophe JAILLET @ 2025-02-16 21:24 UTC (permalink / raw) To: clamor95 Cc: andriy.shevchenko, arthur.becker, conor+dt, david, devicetree, emil.gedenryd, ivan.orlov0322, javier.carrasco.cruz, jic23, jonathanh, krzk+dt, lars, linux-iio, linux-kernel, linux-tegra, mazziesaccount, muditsharma.info, perdaniel.olsson, robh, subhajit.ghosh, thierry.reding Le 16/02/2025 à 17:27, Svyatoslav Ryhel a écrit : > AL3000a is a simple I2C-based ambient light sensor, which is > closely related to AL3010 and AL3320a, but has significantly > different way of processing data generated by the sensor. ... > +static int al3000a_resume(struct device *dev) > +{ > + struct al3000a_data *data = iio_priv(dev_get_drvdata(dev)); > + > + return al3000a_set_pwr_on(data); > +} > + > +static DEFINE_SIMPLE_DEV_PM_OPS(al3000a_pm_ops, al3000a_suspend, al3000a_resume); > + > +static const struct i2c_device_id al3000a_id[] = { > + {"al3000a", }, Nitpick: missing leading space after { > + {} > +}; > +MODULE_DEVICE_TABLE(i2c, al3010_id); ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] ARM: tegra: tf101: Add al3000a illuminance sensor node 2025-02-16 16:27 [PATCH v3 0/3] iio: light: add al3000a als support Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 1/3] dt-bindings: iio: light: al3010: add al3000a support Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel @ 2025-02-16 16:27 ` Svyatoslav Ryhel 2 siblings, 0 replies; 8+ messages in thread From: Svyatoslav Ryhel @ 2025-02-16 16:27 UTC (permalink / raw) To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding, Jonathan Hunter, Svyatoslav Ryhel, Javier Carrasco, Matti Vaittinen, Andy Shevchenko, Emil Gedenryd, Arthur Becker, Mudit Sharma, Per-Daniel Olsson, Subhajit Ghosh, Ivan Orlov, David Heidelberg Cc: linux-iio, devicetree, linux-kernel, linux-tegra Bind al3000a illuminance sensor found in ASUS TF101 Tested-by: Robert Eckelmann <longnoserob@gmail.com> Tested-by: Antoni Aloy Torrens <aaloytorrens@gmail.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> --- arch/arm/boot/dts/nvidia/tegra20-asus-tf101.dts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/nvidia/tegra20-asus-tf101.dts b/arch/arm/boot/dts/nvidia/tegra20-asus-tf101.dts index 975ec24195ca..fcf3d6dd64a2 100644 --- a/arch/arm/boot/dts/nvidia/tegra20-asus-tf101.dts +++ b/arch/arm/boot/dts/nvidia/tegra20-asus-tf101.dts @@ -1123,6 +1123,17 @@ smart-battery@b { sbs,poll-retry-count = <10>; power-supplies = <&mains>; }; + + /* Dynaimage ambient light sensor */ + light-sensor@1c { + compatible = "dynaimage,al3000a"; + reg = <0x1c>; + + interrupt-parent = <&gpio>; + interrupts = <TEGRA_GPIO(Z, 2) IRQ_TYPE_LEVEL_HIGH>; + + vdd-supply = <&vdd_1v8_sys>; + }; }; }; -- 2.43.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-02-16 21:33 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-02-16 16:27 [PATCH v3 0/3] iio: light: add al3000a als support Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 1/3] dt-bindings: iio: light: al3010: add al3000a support Svyatoslav Ryhel 2025-02-16 16:27 ` [PATCH v3 2/3] iio: light: Add support for AL3000a illuminance sensor Svyatoslav Ryhel 2025-02-16 19:09 ` kernel test robot 2025-02-16 20:57 ` Andy Shevchenko 2025-02-16 20:57 ` kernel test robot 2025-02-16 21:24 ` Christophe JAILLET 2025-02-16 16:27 ` [PATCH v3 3/3] ARM: tegra: tf101: Add al3000a illuminance sensor node Svyatoslav Ryhel
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.