aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/light
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/hid-sensor-als.c11
-rw-r--r--drivers/iio/light/tsl2563.c4
-rw-r--r--drivers/iio/light/vcnl4000.c9
3 files changed, 16 insertions, 8 deletions
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 8e8b9d722853..621541fb10a9 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -229,6 +229,17 @@ static int als_parse_report(struct platform_device *pdev,
229 dev_dbg(&pdev->dev, "als %x:%x\n", st->als_illum.index, 229 dev_dbg(&pdev->dev, "als %x:%x\n", st->als_illum.index,
230 st->als_illum.report_id); 230 st->als_illum.report_id);
231 231
232 /* Set Sensitivity field ids, when there is no individual modifier */
233 if (st->common_attributes.sensitivity.index < 0) {
234 sensor_hub_input_get_attribute_info(hsdev,
235 HID_FEATURE_REPORT, usage_id,
236 HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS |
237 HID_USAGE_SENSOR_DATA_LIGHT,
238 &st->common_attributes.sensitivity);
239 dev_dbg(&pdev->dev, "Sensitivity index:report %d:%d\n",
240 st->common_attributes.sensitivity.index,
241 st->common_attributes.sensitivity.report_id);
242 }
232 return ret; 243 return ret;
233} 244}
234 245
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
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index ecb3341ef9c0..384ac23f576f 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -179,13 +179,7 @@ static int vcnl4000_probe(struct i2c_client *client,
179 indio_dev->name = VCNL4000_DRV_NAME; 179 indio_dev->name = VCNL4000_DRV_NAME;
180 indio_dev->modes = INDIO_DIRECT_MODE; 180 indio_dev->modes = INDIO_DIRECT_MODE;
181 181
182 return iio_device_register(indio_dev); 182 return devm_iio_device_register(&client->dev, indio_dev);
183}
184
185static int vcnl4000_remove(struct i2c_client *client)
186{
187 iio_device_unregister(i2c_get_clientdata(client));
188 return 0;
189} 183}
190 184
191static struct i2c_driver vcnl4000_driver = { 185static struct i2c_driver vcnl4000_driver = {
@@ -194,7 +188,6 @@ static struct i2c_driver vcnl4000_driver = {
194 .owner = THIS_MODULE, 188 .owner = THIS_MODULE,
195 }, 189 },
196 .probe = vcnl4000_probe, 190 .probe = vcnl4000_probe,
197 .remove = vcnl4000_remove,
198 .id_table = vcnl4000_id, 191 .id_table = vcnl4000_id,
199}; 192};
200 193