iio: light: tsl2591: fix lux calculation and precision, add I2C ID table, report saturation
Subsystems (2)
v2 cover iio: light: tsl2591: fix lux calculation and precision, add I2C ID table, report saturation
From: Jan Remes <[email protected]>
This series fixes several issues found while using the TSL2591 in company products (Raspberry Pi CM5) and when testing (x86_64 laptops with MCP2221 USB-I2C bridge).
The original field report found that the illumination value has always been 0.0 (caused by division by zero on ARM).
Patch 1 fixes divisions by zero in the lux calculation, which occur with LOW gain and short integration times, or in darkness when CH0 = 0.
Patch 2 adds an i2c_device_id table so the driver can be probed on systems without CONFIG_OF.
Patch 3 makes the driver return an error instead of a bogus value when the sensor is saturated.
Patch 4 improves the formula for calculating lux values to make the returned value more accurate.
Patches 3 and 4 change existing behavior, I am OK with splitting the series into two, if that makes things better.
AI assistance: Claude Code (Claude Opus 5.5) was used for research on sensor behavior, datasheets and Adafruit library, to compare results produced by old and new formula, to draft some code for patches 1 and 4. I reviewed all of it and tested it on x86_64.
Changes in v2 (thanks to Andy Shevchenko for review):
- Patch 2: Use C99 initializers
- Patch 4: Keep variables in reversed xmas tree order
- Link to v1: https://lore.kernel.org/r/[email protected]/
Jan Remes (4):
iio: light: tsl2591: don't divide by zero
iio: light: tsl2591: add I2C device ID table
iio: light: tsl2591: report saturation
iio: light: tsl2591: improve lux calculation precision
drivers/iio/light/tsl2591.c | 58 +++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 16 deletions(-)
base-commit: a22dc7ebb21a6bd4c8b63bc2c1dd46a24945aae7
Signature · 1 line
2.53.0
PATCH v2 1/4 iio: light: tsl2591: don't divide by zero
From: Jan Remes <[email protected]>
The TSL2591 has two raw light channels - CH0 and CH1. The algorithm for calculating illumination from the raw channels requires division by CH0 (which can be zero) and by "counts per lux" (CPL) value which is also zero for (gain = LOW, integration time <= 400 ms).
Furthermore, the algorithm assumes CH0 > CH1, which can be violated in almost complete darkness.
As a result, reading from 'in_illuminance_input' results in division-by-zero whenever CH0 is 0 (complete darkness) or whenever the parameters result in CPL being zero. This results in kernel oops on x86_64 and in reading the value as 0 on arm64.
Fix that by:
- reporting CH0 <= CH1 as zero (catches also CH0 = 0)
- updating the lux algorithm to only do the division at the end
--- drivers/iio/light/tsl2591.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
drivers/iio/light/tsl2591.c +22 -10
@@ -16,6 +16,7 @@#include <linux/interrupt.h> #include <linux/iopoll.h> #include <linux/kernel.h> +#include <linux/math64.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/pm_runtime.h>
@@ -362,6 +363,10 @@ static int tsl2591_wait_adc_complete(struct tsl2591_chip *chip)* Scale values to get more representative value of lux i.e. * lux = ((C0DATA - C1DATA) * (1000 - ((C1DATA * 1000) / C0DATA))) / CPL * +* CPL is not computed on its own: at 1x gain it is below 1 for integration +* times under 500 ms, so the division by LUX DF is folded into the final +* division instead. +* * Channel 0 = IR + Visible * Channel 1 = IR only */
@@ -373,8 +378,10 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev,struct tsl2591_als_settings *settings = &chip->als_settings;struct i2c_client *client = chip->client;u8 als_data[TSL2591_NUM_DATA_REGISTERS ]; -int counts_per_lux, int_time_fval, gain_multi, lux; +int int_time_fval, gain_multi;u16 als_ch0, als_ch1; +u64 lux; +u32 rem;int ret; ret =tsl2591_wait_adc_complete (chip);
@@ -410,23 +417,28 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev,return gain_multi; } - int_time_fval =TSL2591_FVAL_TO_MSEC (settings->als_int_time); -/* Calculate counts per lux value */ - counts_per_lux = (int_time_fval * gain_multi) /TSL2591_LUX_COEFFICIENT ; +/* No visible light, this also catches C0DATA == 0 */ +if (als_ch0 <= als_ch1) { + *val =0 ; + *val2 =0 ; +break ; + } -dev_dbg (&client->dev,"Counts Per Lux: %d\n" , counts_per_lux); + int_time_fval =TSL2591_FVAL_TO_MSEC (settings->als_int_time);/* Calculate lux value */ - lux = ((als_ch0 - als_ch1) * - (1000 - ((als_ch1 *1000 ) / als_ch0))) / counts_per_lux; + lux = (u64)(als_ch0 - als_ch1) * + (1000 - ((als_ch1 *1000 ) / als_ch0)) * +TSL2591_LUX_COEFFICIENT ; + lux =div_u64 (lux, int_time_fval * gain_multi); -dev_dbg (&client->dev,"Raw lux calculation: %d\n" , lux); +dev_dbg (&client->dev,"Raw lux calculation: %llu\n" , lux);/* Divide by 1000 to get real lux value before scaling */ - *val = lux /1000 ; + *val =div_u64_rem (lux,1000 , &rem);/* Get the decimal part of lux reading */ - *val2 = (lux - (*val *1000 )) *1000 ; + *val2 = rem *1000 ;break ;default :
Signature · 1 line
2.53.0
PATCH v2 2/4 iio: light: tsl2591: add I2C device ID table
In reply to Jan RemesFrom: Jan Remes <[email protected]>
The TSL2591 has only the device-tree matching table, so it cannot be probed on a kernel with CONFIG_OF disabled.
Add I2C device ID table so that the sensor can be probed.
--- drivers/iio/light/tsl2591.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/iio/light/tsl2591.c +7 -0
@@ -1149,7 +1149,14 @@ static const struct of_device_id tsl2591_of_match[] = { };MODULE_DEVICE_TABLE (of, tsl2591_of_match); +static const struct i2c_device_id tsl2591_id[] = { + { .name ="tsl2591" }, + { } +}; +MODULE_DEVICE_TABLE (i2c, tsl2591_id); +static struct i2c_driver tsl2591_driver = { + .id_table = tsl2591_id, .driver = { .name ="tsl2591" , .pm =pm_ptr (&tsl2591_pm_ops),
Signature · 1 line
2.53.0
PATCH v2 3/4 iio: light: tsl2591: report saturation
In reply to Jan RemesFrom: Jan Remes <[email protected]>
When the TSL2591 sensors is saturated, it reports its maximum value (specific one for 100ms integration time, UINT16_MAX otherwise).
When either raw channel becomes saturated, return -EOVERFLOW (like as73211 and si1133 do) instead of calculating an invalid number when reading 'in_illuminance_input'. Keep existing behavior on raw channels.
Note: Datasheet versions differ in the saturation number for 100ms. Old 2013 datasheet lists it as 37888, newer versions say 36863. Use the new value although the hardware can report up to 37888.
--- drivers/iio/light/tsl2591.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/iio/light/tsl2591.c +11 -1
@@ -139,7 +139,9 @@/* TSL2591 maximum values */ #define TSL2591_MAX_ALS_INT_TIME_MS 600 +/* Maximal values per datasheet [v3-00] 2023-Feb-08 */ #define TSL2591_ALS_MAX_VALUE (BIT(16) - 1) +#define TSL2591_ALS_MAX_VALUE_100MS 36863/* * LUX calculations;
@@ -379,7 +381,7 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev,struct i2c_client *client = chip->client;u8 als_data[TSL2591_NUM_DATA_REGISTERS ];int int_time_fval, gain_multi; -u16 als_ch0, als_ch1; +u16 als_ch0, als_ch1, als_max;u64 lux;u32 rem;int ret;
@@ -417,6 +419,14 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev,return gain_multi; } +/* Check for overflow; special case for 100ms integration time */ + als_max =TSL2591_ALS_MAX_VALUE ; +if (settings->als_int_time ==TSL2591_CTRL_ALS_INTEGRATION_100MS ) + als_max =TSL2591_ALS_MAX_VALUE_100MS ; + +if (als_ch0 >= als_max || als_ch1 >= als_max) +return -EOVERFLOW ; +/* No visible light, this also catches C0DATA == 0 */ if (als_ch0 <= als_ch1) { *val =0 ;
Signature · 1 line
2.53.0
PATCH v2 4/4 iio: light: tsl2591: improve lux calculation precision
In reply to Jan RemesFrom: Jan Remes <[email protected]>
The lux calculation computes the ratio CH1 / CH0 as a truncated integer (CH1 * 1000 / CH0) before using it. When CH1 is close to CH0, the truncation makes the result off by up to ~35%, e.g. CH0 = 56097, CH1 = 55973 at LOW gain and 100ms gives 1.517 lux instead of 1.118 lux.
The formula (CH0 - CH1) * (1 - CH1 / CH0) / CPL is equal to
(CH0 - CH1)^2 * DF / (CH0 * ATIME_ms * AGAIN)
which needs no intermediate ratio. Compute it like that, with a single division at the end.
Also report the result in micro-lux instead of milli-lux. At MAX gain and 600ms one count is well below 1 mlx, so the milli-lux resolution throws away information. The numerator still fits into u64.
--- drivers/iio/light/tsl2591.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
drivers/iio/light/tsl2591.c +12 -15
@@ -21,6 +21,7 @@#include <linux/mutex.h> #include <linux/pm_runtime.h> #include <linux/sysfs.h> +#include <linux/units.h> #include <linux/unaligned.h>
@@ -362,12 +363,12 @@ static int tsl2591_wait_adc_complete(struct tsl2591_chip *chip)* Counts Per Lux (CPL) = (ATIME_ms * AGAIN) / LUX DF * lux = ((C0DATA - C1DATA) * (1 - (C1DATA / C0DATA))) / CPL * -* Scale values to get more representative value of lux i.e. -* lux = ((C0DATA - C1DATA) * (1000 - ((C1DATA * 1000) / C0DATA))) / CPL +* Since (C0DATA - C1DATA) * (1 - (C1DATA / C0DATA)) equals +* (C0DATA - C1DATA)^2 / C0DATA, this is computed in micro-lux as +* lux = ((C0DATA - C1DATA)^2 * LUX DF * 10^6) / (C0DATA * ATIME_ms * AGAIN) * * CPL is not computed on its own: at 1x gain it is below 1 for integration -* times under 500 ms, so the division by LUX DF is folded into the final -* division instead. +* times under 500 ms, so all divisions are done at the end. * * Channel 0 = IR + Visible * Channel 1 = IR only
@@ -382,8 +383,8 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev,u8 als_data[TSL2591_NUM_DATA_REGISTERS ];int int_time_fval, gain_multi;u16 als_ch0, als_ch1, als_max; +u32 diff, rem;u64 lux; -u32 rem;int ret; ret =tsl2591_wait_adc_complete (chip);
@@ -436,19 +437,15 @@ static int tsl2591_read_channel_data(struct iio_dev *indio_dev, int_time_fval =TSL2591_FVAL_TO_MSEC (settings->als_int_time); -/* Calculate lux value */ - lux = (u64)(als_ch0 - als_ch1) * - (1000 - ((als_ch1 *1000 ) / als_ch0)) * -TSL2591_LUX_COEFFICIENT ; - lux =div_u64 (lux, int_time_fval * gain_multi); +/* Calculate lux value in micro-lux */ + diff = als_ch0 - als_ch1; + lux = (u64 )diff * diff *TSL2591_LUX_COEFFICIENT *MICRO ; + lux =div64_u64 (lux, (u64 )als_ch0 * int_time_fval * gain_multi);dev_dbg (&client->dev,"Raw lux calculation: %llu\n" , lux); -/* Divide by 1000 to get real lux value before scaling */ - *val =div_u64_rem (lux,1000 , &rem); - -/* Get the decimal part of lux reading */ - *val2 = rem *1000 ; + *val =div_u64_rem (lux,MICRO , &rem); + *val2 = rem;break ;default :
Signature · 1 line
2.53.0
Quoted 19 lines · Jan Remes
This series fixes several issues found while using the TSL2591 in company products (Raspberry Pi CM5) and when testing (
x86_64laptops with MCP2221 USB-I2C bridge).The original field report found that the illumination value has always been 0.0 (caused by division by zero on ARM).
Patch 1 fixes divisions by zero in the lux calculation, which occur with LOW gain and short integration times, or in darkness when CH0 = 0.
Patch 2 adds an
i2c_device_idtable so the driver can be probed on systems withoutCONFIG_OF.Patch 3 makes the driver return an error instead of a bogus value when the sensor is saturated.
Patch 4 improves the formula for calculating lux values to make the returned value more accurate.
Quoted 7 lines
Patches 3 and 4 change existing behavior, I am OK with splitting the series into two, if that makes things better.
AI assistance: Claude Code (Claude Opus 5.5) was used for research on sensor behavior, datasheets and Adafruit library, to compare results produced by old and new formula, to draft some code for patches 1 and 4. I reviewed all of it and tested it on
x86_64.
From my view (haven't checked the calculations, though) this looks good,
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 24 lines · On Thu, 15 Oct 2026 21:36:35 +0300 Andy Shevchenko…
Quoted 22 lines · Jan Remes
This series fixes several issues found while using the TSL2591 in company products (Raspberry Pi CM5) and when testing (
x86_64laptops with MCP2221 USB-I2C bridge).The original field report found that the illumination value has always been 0.0 (caused by division by zero on ARM).
Patch 1 fixes divisions by zero in the lux calculation, which occur with LOW gain and short integration times, or in darkness when CH0 = 0.
Patch 2 adds an
i2c_device_idtable so the driver can be probed on systems withoutCONFIG_OF.Patch 3 makes the driver return an error instead of a bogus value when the sensor is saturated.
Patch 4 improves the formula for calculating lux values to make the returned value more accurate.
Patches 3 and 4 change existing behavior, I am OK with splitting the series into two, if that makes things better.
Quoted 8 lines
Quoted 4 lines
AI assistance: Claude Code (Claude Opus 5.5) was used for research on sensor behavior, datasheets and Adafruit library, to compare results produced by old and new formula, to draft some code for patches 1 and 4. I reviewed all of it and tested it on
x86_64.From my view (haven't checked the calculations, though) this looks good,
Reviewed-by Andy Shevchenko <[email protected]>
I'm guessing not huge urgency on patch 1, so to keep things simple I've applied the lot to the testing branch of iio.git. That will get rebased on rc1 once available in a couple of weeks.
If you want the fix to go in faster, shout and I'll do that at risk of slowing down the rest.
Thanks,
Jonathan
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Thu, 15 Oct 2026 21:36:35 +0300 Andy Shevchenko…
From my view (haven't checked the calculations, though) this looks good,
Reviewed-by Andy Shevchenko <[email protected]>
Quoted 7 lines
I'm guessing not huge urgency on patch 1, so to keep things simple I've applied the lot to the testing branch of iio.git. That will get rebased on rc1 once available in a couple of weeks.
If you want the fix to go in faster, shout and I'll do that at risk of slowing down the rest.
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
And on Arm, the net result is getting false illumination reading of 0.0, which isn't great, but isn't terrible either.
Thanks for applying the series to iio/testing.
Kind regards,
Jan
Quoted 11 lines · Jan Remes
Quoted 10 lines · Jonathan Cameron
Quoted 3 lines · On Thu, 15 Oct 2026 21:36:35 +0300 Andy Shevchenko…
From my view (haven't checked the calculations, though) this looks good,
Reviewed-by Andy Shevchenko <[email protected]>I'm guessing not huge urgency on patch 1, so to keep things simple I've applied the lot to the testing branch of iio.git. That will get rebased on rc1 once available in a couple of weeks.
Quoted 6 lines
Quoted 3 lines
If you want the fix to go in faster, shout and I'll do that at risk of slowing down the rest.
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
Quoted 2 lines
And on Arm, the net result is getting false illumination reading of 0.0, which isn't great, but isn't terrible either.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 14 lines · Jan Remes
Quoted 13 lines · Jonathan Cameron
Quoted 3 lines · On Thu, 15 Oct 2026 21:36:35 +0300 Andy Shevchenko…
From my view (haven't checked the calculations, though) this looks good,
Reviewed-by Andy Shevchenko <[email protected]>I'm guessing not huge urgency on patch 1, so to keep things simple I've applied the lot to the testing branch of iio.git. That will get rebased on rc1 once available in a couple of weeks.
If you want the fix to go in faster, shout and I'll do that at risk of slowing down the rest.
Quoted 8 lines
Quoted 3 lines
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
[ Sorry for the delay and potential malformed e-mail, I was trying to interface mutt with my $DAYJOB Outlook e-mail until I got the idea to just export this one e-mail into mbox. ]
I did not know about the PRP0001 (thanks), so please disregard that argument. Still, I believe x86 users to be few if any, since the oops is quite easy to trigger and AFAIK most x86 distro kernels ship without CONFIG_OF.
Best regards,
Jan Remes
Quoted 3 lines · Jan Remes
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Jan Remes
On Sat, 17 Oct 2026 03:14:11 +0100, Jonathan Cameron wrote:
...
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
Quoted 8 lines
Quoted 4 lines
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
I did not know about the PRP0001 (thanks), so please disregard that argument. Still, I believe x86 users to be few if any, since the oops is quite easy to trigger
True.
Quoted 1 line
and AFAIK most x86 distro kernels ship without
CONFIG_OF.
How is this relevant? This driver doesn't use any #ifdef CONFIG_OF or alike, so most likely the driver is available for x86 as well.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 21 lines · Andy Shevchenko
Quoted 3 lines · Jan Remes
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Jan Remes
On Sat, 17 Oct 2026 03:14:11 +0100, Jonathan Cameron wrote:
...
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
Quoted 8 lines
Quoted 4 lines
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
I did not know about the PRP0001 (thanks), so please disregard that argument. Still, I believe x86 users to be few if any, since the oops is quite easy to trigger
Quoted 6 lines
True.
Quoted 1 line
and AFAIK most x86 distro kernels ship without
CONFIG_OF.How is this relevant? This driver doesn't use any #ifdef
CONFIG_OFor alike, so most likely the driver is available for x86 as well.
I thought that CONFIG_OF was needed in order to be able to probe a device using the driver's OF table. TIL that missing CONFIG_OF prevents only manual probing (echo "tsl2519 0x29" > .../new_device) but not the ACPI mechanism.
So:
1. Please ignore that argument
2. The wording of my Patch 2 commit message is not correct ("cannot be probed on a kernel with CONFIG_OF disabled"), I can send a v3 if that's preferable.
Thanks for getting me to learn a bit more.
Best regards,
Jan Remes
Quoted 5 lines · Jan Remes
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Jan Remes
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Jan Remes
On Sat, 17 Oct 2026 03:14:11 +0100, Jonathan Cameron wrote:
...
Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
Quoted 8 lines
Quoted 4 lines
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
I did not know about the PRP0001 (thanks), so please disregard that argument. Still, I believe x86 users to be few if any, since the oops is quite easy to trigger
True.
Quoted 1 line
and AFAIK most x86 distro kernels ship without
CONFIG_OF.
Quoted 7 lines
Quoted 2 lines
How is this relevant? This driver doesn't use any #ifdef
CONFIG_OFor alike, so most likely the driver is available for x86 as well.I thought that
CONFIG_OFwas needed in order to be able to probe a device using the driver's OF table. TIL that missingCONFIG_OFprevents only manual probing (echo "tsl2519 0x29" > .../new_device) but not the ACPI mechanism.
Actually not really. The manual binding relies on i2c ID table and the OF ID table is a fallback.
Quoted 5 lines
So:
1. Please ignore that argument
2. The wording of my Patch 2 commit message is not correct ("cannot be probed on a kernel withCONFIG_OFdisabled"), I can send a v3 if that's preferable.
Yes, better to send a new version with better wording in the commit message.
Quoted 1 line
Thanks for getting me to learn a bit more.
You're welcome!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 37 lines · On Wed, 21 Oct 2026 16:23:07 +0300 Andy Shevchenko…
Quoted 5 lines · Jan Remes
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Jan Remes
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Jan Remes
On Sat, 17 Oct 2026 03:14:11 +0100, Jonathan Cameron wrote:
...
Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
FWIW, I don't think it to be very urgent, as people probably don't use it on x86-64 (seeing both as it had only DT probe support and that impacted users are likely to have noticed the oops).
Quoted 8 lines
Quoted 4 lines
What do you mean by the second part of the sentence? It's as easy to use on ACPI platforms as on DT, we have so nice trick called PRP0001, which allows to enumerate "OF-only" drivers on ACPI platforms via SSDT overlays (or other means of DSDT/SSDT provisioning).
I did not know about the PRP0001 (thanks), so please disregard that argument. Still, I believe x86 users to be few if any, since the oops is quite easy to trigger
True.
Quoted 1 line
and AFAIK most x86 distro kernels ship without
CONFIG_OF.Quoted 7 lines
Quoted 2 lines
How is this relevant? This driver doesn't use any #ifdef
CONFIG_OFor alike, so most likely the driver is available for x86 as well.I thought that
CONFIG_OFwas needed in order to be able to probe a device using the driver's OF table. TIL that missingCONFIG_OFprevents only manual probing (echo "tsl2519 0x29" > .../new_device) but not the ACPI mechanism.Actually not really. The manual binding relies on i2c ID table and the OF ID table is a fallback.
Quoted 7 lines
Quoted 5 lines
So:
1. Please ignore that argument
2. The wording of my Patch 2 commit message is not correct ("cannot be probed on a kernel withCONFIG_OFdisabled"), I can send a v3 if that's preferable.Yes, better to send a new version with better wording in the commit message.
Given we are in merge window and my base tree will be rebased shortly anyway I don't mind the noise of dropping these.
Hence done so and will wait for v3.
Thanks,
Jonathan
Quoted 5 lines
Quoted 2 lines
Thanks for getting me to learn a bit more.
You're welcome!