Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: stk3310: add support for stk3013

Add support for Sensortek's STK3013 in the driver. The part bears the
product ID 0x31.

As seen in [1], Sensortek lists STK3013 as a proximity sensor. But it
has been experimentally observed that they do have ambient light sensing
capabilities. Furthermore, [2] implements a proximity and ambient light
sensor driver for STK3x1x devices, which is also indicative of the fact
that these parts are also ambient light sensors.

[1] https://www.sensortek.com.tw/index.php/en/products/optical-sensor/
[2] https://android.googlesource.com/kernel/msm.git/+/e6dfa4641d88201e8019be19ff557e5d2cf4572f

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://patch.msgid.link/20240727-stk3310-v4-2-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Kaustabh Chakraborty and committed by
Jonathan Cameron
a50f5370 b3508a2b

+5
+5
drivers/iio/light/stk3310.c
··· 35 35 #define STK3310_STATE_EN_ALS BIT(1) 36 36 #define STK3310_STATE_STANDBY 0x00 37 37 38 + #define STK3013_CHIP_ID_VAL 0x31 38 39 #define STK3310_CHIP_ID_VAL 0x13 39 40 #define STK3311_CHIP_ID_VAL 0x1D 40 41 #define STK3311A_CHIP_ID_VAL 0x15 ··· 85 84 REG_FIELD(STK3310_REG_FLAG, 0, 0); 86 85 87 86 static const u8 stk3310_chip_ids[] = { 87 + STK3013_CHIP_ID_VAL, 88 88 STK3310_CHIP_ID_VAL, 89 89 STK3311A_CHIP_ID_VAL, 90 90 STK3311S34_CHIP_ID_VAL, ··· 702 700 stk3310_resume); 703 701 704 702 static const struct i2c_device_id stk3310_i2c_id[] = { 703 + { "STK3013" }, 705 704 { "STK3310" }, 706 705 { "STK3311" }, 707 706 { "STK3335" }, ··· 711 708 MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id); 712 709 713 710 static const struct acpi_device_id stk3310_acpi_id[] = { 711 + {"STK3013", 0}, 714 712 {"STK3310", 0}, 715 713 {"STK3311", 0}, 716 714 {} ··· 720 716 MODULE_DEVICE_TABLE(acpi, stk3310_acpi_id); 721 717 722 718 static const struct of_device_id stk3310_of_match[] = { 719 + { .compatible = "sensortek,stk3013", }, 723 720 { .compatible = "sensortek,stk3310", }, 724 721 { .compatible = "sensortek,stk3311", }, 725 722 { .compatible = "sensortek,stk3335", },