提交 8175bff5 编写于 作者: S Sebastian Reichel 提交者: Jonathan Cameron

iio:light:tsl2563: Add DT support

Add Device Tree support for the TSL2563 driver,
document the binding and add AMS-TAOS Inc. to the
list of vendor prefixes.
Signed-off-by: NSebastian Reichel <sre@debian.org>
Acked-by: NKumar Gala <galak@codeaurora.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 cc26ad45
* AMS TAOS TSL2563 ambient light sensor
Required properties:
- compatible : should be "amstaos,tsl2563"
- reg : the I2C address of the sensor
Optional properties:
- amstaos,cover-comp-gain : integer used as multiplier for gain
compensation (default = 1)
Example:
tsl2563@29 {
compatible = "amstaos,tsl2563";
reg = <0x29>;
amstaos,cover-comp-gain = <16>;
};
...@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB ...@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB
ak Asahi Kasei Corp. ak Asahi Kasei Corp.
altr Altera Corp. altr Altera Corp.
amcc Applied Micro Circuits Corporation (APM, formally AMCC) amcc Applied Micro Circuits Corporation (APM, formally AMCC)
amstaos AMS-Taos Inc.
apm Applied Micro Circuits Corporation (APM) apm Applied Micro Circuits Corporation (APM)
arm ARM Ltd. arm ARM Ltd.
atmel Atmel Corporation atmel Atmel Corporation
......
...@@ -714,6 +714,7 @@ static int tsl2563_probe(struct i2c_client *client, ...@@ -714,6 +714,7 @@ static int tsl2563_probe(struct i2c_client *client,
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
struct tsl2563_chip *chip; struct tsl2563_chip *chip;
struct tsl2563_platform_data *pdata = client->dev.platform_data; struct tsl2563_platform_data *pdata = client->dev.platform_data;
struct device_node *np = client->dev.of_node;
int err = 0; int err = 0;
u8 id = 0; u8 id = 0;
...@@ -750,6 +751,9 @@ static int tsl2563_probe(struct i2c_client *client, ...@@ -750,6 +751,9 @@ static int tsl2563_probe(struct i2c_client *client,
if (pdata) if (pdata)
chip->cover_comp_gain = pdata->cover_comp_gain; chip->cover_comp_gain = pdata->cover_comp_gain;
else if (np)
of_property_read_u32(np, "amstaos,cover-comp-gain",
&chip->cover_comp_gain);
else else
chip->cover_comp_gain = 1; chip->cover_comp_gain = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册