aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@debian.org>2013-10-25 05:10:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-11-24 16:07:14 -0500
commit8175bff5b47eae171a393f5bd67673de50630973 (patch)
tree0e31f02926dccc950c3f2518cf5953143f28b9b9
parentcc26ad455f57b42dd40ca01c4c220516218390f6 (diff)
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>
-rw-r--r--Documentation/devicetree/bindings/iio/light/tsl2563.txt19
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt1
-rw-r--r--drivers/iio/light/tsl2563.c4
3 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/iio/light/tsl2563.txt b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
new file mode 100644
index 000000000000..f91e809e736e
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/tsl2563.txt
@@ -0,0 +1,19 @@
1* AMS TAOS TSL2563 ambient light sensor
2
3Required properties:
4
5 - compatible : should be "amstaos,tsl2563"
6 - reg : the I2C address of the sensor
7
8Optional properties:
9
10 - amstaos,cover-comp-gain : integer used as multiplier for gain
11 compensation (default = 1)
12
13Example:
14
15tsl2563@29 {
16 compatible = "amstaos,tsl2563";
17 reg = <0x29>;
18 amstaos,cover-comp-gain = <16>;
19};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 04eab45dd148..b65a44041ec1 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -9,6 +9,7 @@ aeroflexgaisler Aeroflex Gaisler AB
9ak Asahi Kasei Corp. 9ak Asahi Kasei Corp.
10altr Altera Corp. 10altr Altera Corp.
11amcc Applied Micro Circuits Corporation (APM, formally AMCC) 11amcc Applied Micro Circuits Corporation (APM, formally AMCC)
12amstaos AMS-Taos Inc.
12apm Applied Micro Circuits Corporation (APM) 13apm Applied Micro Circuits Corporation (APM)
13arm ARM Ltd. 14arm ARM Ltd.
14atmel Atmel Corporation 15atmel Atmel Corporation
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index 5e5d9dea22c5..0c6e459c86b1 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -714,6 +714,7 @@ static int tsl2563_probe(struct i2c_client *client,
714 struct iio_dev *indio_dev; 714 struct iio_dev *indio_dev;
715 struct tsl2563_chip *chip; 715 struct tsl2563_chip *chip;
716 struct tsl2563_platform_data *pdata = client->dev.platform_data; 716 struct tsl2563_platform_data *pdata = client->dev.platform_data;
717 struct device_node *np = client->dev.of_node;
717 int err = 0; 718 int err = 0;
718 u8 id = 0; 719 u8 id = 0;
719 720
@@ -750,6 +751,9 @@ static int tsl2563_probe(struct i2c_client *client,
750 751
751 if (pdata) 752 if (pdata)
752 chip->cover_comp_gain = pdata->cover_comp_gain; 753 chip->cover_comp_gain = pdata->cover_comp_gain;
754 else if (np)
755 of_property_read_u32(np, "amstaos,cover-comp-gain",
756 &chip->cover_comp_gain);
753 else 757 else
754 chip->cover_comp_gain = 1; 758 chip->cover_comp_gain = 1;
755 759