diff options
author | Sebastian Reichel <sre@debian.org> | 2013-10-25 05:10:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-24 16:07:14 -0500 |
commit | 8175bff5b47eae171a393f5bd67673de50630973 (patch) | |
tree | 0e31f02926dccc950c3f2518cf5953143f28b9b9 | |
parent | cc26ad455f57b42dd40ca01c4c220516218390f6 (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.txt | 19 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/vendor-prefixes.txt | 1 | ||||
-rw-r--r-- | drivers/iio/light/tsl2563.c | 4 |
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 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "amstaos,tsl2563" | ||
6 | - reg : the I2C address of the sensor | ||
7 | |||
8 | Optional properties: | ||
9 | |||
10 | - amstaos,cover-comp-gain : integer used as multiplier for gain | ||
11 | compensation (default = 1) | ||
12 | |||
13 | Example: | ||
14 | |||
15 | tsl2563@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 | |||
9 | ak Asahi Kasei Corp. | 9 | ak Asahi Kasei Corp. |
10 | altr Altera Corp. | 10 | altr Altera Corp. |
11 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 11 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
12 | amstaos AMS-Taos Inc. | ||
12 | apm Applied Micro Circuits Corporation (APM) | 13 | apm Applied Micro Circuits Corporation (APM) |
13 | arm ARM Ltd. | 14 | arm ARM Ltd. |
14 | atmel Atmel Corporation | 15 | atmel 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 | ||