Skip to contentSkip to conversation

iio: light: apds9306: fix default sampling frequency definition

PATCH Superseded Tsz Shan Chan 2 participants 3 messages Sep 3 – Sep 4

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: light: apds9306: fix default sampling frequency definition

APDS9306_SAMP_FREQ_10HZ is defined as 0.

According to the datasheet (Broadcom AV02-4755EN,
https://docs.broadcom.com/doc/AV02-4755EN, page 11, ALS_MEAS_RATE), bits[2:0] set the measurement rate:
- 000: 25ms (40Hz)
- 001: 20ms (20Hz)
- 010: 100ms (10Hz)

Change APDS9306_SAMP_FREQ_10HZ from 0 to 2 to write the correct value for 10Hz.

Fixes 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")

---
Changes in v2:
- Add datasheet link to commit message
- Remove blank line in the tag block
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/iio/light/apds9306.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/apds9306.c +1 -1
index f681b02e4922..7dd41136734f 100644
@@ -61,7 +61,7 @@
 #define APDS9306_NUM_REPEAT_RATES	7
 #define APDS9306_INT_SRC_CLEAR	0
 #define APDS9306_INT_SRC_ALS	1
-#define APDS9306_SAMP_FREQ_10HZ	0
+#define APDS9306_SAMP_FREQ_10HZ	2
 
 /**
  * struct part_id_gts_multiplier - Part no. and corresponding gts multiplier

---
base-commit: 940de590b839f71d6dc846160534bf202401b8b7
change-id: 20260903-apds9306-bedba7b74e59

Best regards,

Signature · 1 line
Tsz Shan Chan <[email protected]>
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Tsz Shan Chan

APDS9306_SAMP_FREQ_10HZ is defined as 0.

According to the datasheet (Broadcom AV02-4755EN,
https://docs.broadcom.com/doc/AV02-4755EN, page 11, ALS_MEAS_RATE),

Make it a tag

Quoted 7 lines

bits[2:0] set the measurement rate:
- 000: 25ms (40Hz)
- 001: 20ms (20Hz)
- 010: 100ms (10Hz)

Change APDS9306_SAMP_FREQ_10HZ from 0 to 2 to write the correct value for 10Hz.

Datasheet: $URL

Quoted 2 lines
Fixes 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")

With that being addressed,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 16 lines · Andy Shevchenko
Quoted 4 lines · Tsz Shan Chan

APDS9306_SAMP_FREQ_10HZ is defined as 0.

According to the datasheet (Broadcom AV02-4755EN,
https://docs.broadcom.com/doc/AV02-4755EN, page 11, ALS_MEAS_RATE),

Make it a tag

Quoted 7 lines

bits[2:0] set the measurement rate:
- 000: 25ms (40Hz)
- 001: 20ms (20Hz)
- 010: 100ms (10Hz)

Change APDS9306_SAMP_FREQ_10HZ from 0 to 2 to write the correct value for 10Hz.

Quoted 7 lines

Datasheet: $URL

Quoted 2 lines
Fixes 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")

With that being addressed,

Will fix it in v3. Thanks