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: Sebastian Reichel <sre@debian.org> Acked-by: Kumar Gala <galak@codeaurora.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:

committed by
Jonathan Cameron

父節點
cc26ad455f
當前提交
8175bff5b4
@@ -714,6 +714,7 @@ static int tsl2563_probe(struct i2c_client *client,
|
||||
struct iio_dev *indio_dev;
|
||||
struct tsl2563_chip *chip;
|
||||
struct tsl2563_platform_data *pdata = client->dev.platform_data;
|
||||
struct device_node *np = client->dev.of_node;
|
||||
int err = 0;
|
||||
u8 id = 0;
|
||||
|
||||
@@ -750,6 +751,9 @@ static int tsl2563_probe(struct i2c_client *client,
|
||||
|
||||
if (pdata)
|
||||
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
|
||||
chip->cover_comp_gain = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user