Commit 677f1681 authored by Martijn Braam's avatar Martijn Braam Committed by Jonathan Cameron

iio: light: stk3310: Add support for stk3335

The stk3335 light/proximity sensor is similar to the stk3310 and stk3311
sensors and works with the stk3310 driver.
Signed-off-by: default avatarMartijn Braam <martijn@brixit.nl>
Signed-off-by: default avatarLuca Weiss <luca@z3ntu.xyz>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 936d3e53
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define STK3310_CHIP_ID_VAL 0x13 #define STK3310_CHIP_ID_VAL 0x13
#define STK3311_CHIP_ID_VAL 0x1D #define STK3311_CHIP_ID_VAL 0x1D
#define STK3335_CHIP_ID_VAL 0x51
#define STK3310_PSINT_EN 0x01 #define STK3310_PSINT_EN 0x01
#define STK3310_PS_MAX_VAL 0xFFFF #define STK3310_PS_MAX_VAL 0xFFFF
...@@ -454,7 +455,8 @@ static int stk3310_init(struct iio_dev *indio_dev) ...@@ -454,7 +455,8 @@ static int stk3310_init(struct iio_dev *indio_dev)
return ret; return ret;
if (chipid != STK3310_CHIP_ID_VAL && if (chipid != STK3310_CHIP_ID_VAL &&
chipid != STK3311_CHIP_ID_VAL) { chipid != STK3311_CHIP_ID_VAL &&
chipid != STK3335_CHIP_ID_VAL) {
dev_err(&client->dev, "invalid chip id: 0x%x\n", chipid); dev_err(&client->dev, "invalid chip id: 0x%x\n", chipid);
return -ENODEV; return -ENODEV;
} }
...@@ -666,6 +668,7 @@ static SIMPLE_DEV_PM_OPS(stk3310_pm_ops, stk3310_suspend, stk3310_resume); ...@@ -666,6 +668,7 @@ static SIMPLE_DEV_PM_OPS(stk3310_pm_ops, stk3310_suspend, stk3310_resume);
static const struct i2c_device_id stk3310_i2c_id[] = { static const struct i2c_device_id stk3310_i2c_id[] = {
{"STK3310", 0}, {"STK3310", 0},
{"STK3311", 0}, {"STK3311", 0},
{"STK3335", 0},
{} {}
}; };
MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id); MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id);
...@@ -673,6 +676,7 @@ MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id); ...@@ -673,6 +676,7 @@ MODULE_DEVICE_TABLE(i2c, stk3310_i2c_id);
static const struct acpi_device_id stk3310_acpi_id[] = { static const struct acpi_device_id stk3310_acpi_id[] = {
{"STK3310", 0}, {"STK3310", 0},
{"STK3311", 0}, {"STK3311", 0},
{"STK3335", 0},
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment