aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/mcp3422.c9
-rw-r--r--drivers/iio/humidity/dht11.c6
-rw-r--r--drivers/iio/light/tsl4531.c7
3 files changed, 18 insertions, 4 deletions
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
index 50834fdcf738..e27813611a64 100644
--- a/drivers/iio/adc/mcp3422.c
+++ b/drivers/iio/adc/mcp3422.c
@@ -407,7 +407,14 @@ static const struct i2c_device_id mcp3422_id[] = {
MODULE_DEVICE_TABLE(i2c, mcp3422_id);
static const struct of_device_id mcp3422_of_match[] = {
- { .compatible = "mcp3422" },
+ { .compatible = "microchip,mcp3421" },
+ { .compatible = "microchip,mcp3422" },
+ { .compatible = "microchip,mcp3423" },
+ { .compatible = "microchip,mcp3424" },
+ { .compatible = "microchip,mcp3425" },
+ { .compatible = "microchip,mcp3426" },
+ { .compatible = "microchip,mcp3427" },
+ { .compatible = "microchip,mcp3428" },
{ }
};
MODULE_DEVICE_TABLE(of, mcp3422_of_match);
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index 980cb946bbf7..e6579719a512 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -151,9 +151,9 @@ static int dht11_decode(struct dht11 *dht11, int offset)
dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
((temp_int & 0x80) ? -100 : 100);
dht11->humidity = ((hum_int << 8) + hum_dec) * 100;
- } else if (temp_dec == 0 && hum_dec == 0) { /* DHT11 */
- dht11->temperature = temp_int * 1000;
- dht11->humidity = hum_int * 1000;
+ } else if (temp_dec < 10 && hum_dec < 10) { /* DHT11 */
+ dht11->temperature = temp_int * 1000 + temp_dec * 100;
+ dht11->humidity = hum_int * 1000 + hum_dec * 100;
} else {
dev_err(dht11->dev,
"Don't know how to decode data: %d %d %d %d\n",
diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
index a5788c09ad02..c918ebc930c3 100644
--- a/drivers/iio/light/tsl4531.c
+++ b/drivers/iio/light/tsl4531.c
@@ -232,9 +232,16 @@ static const struct i2c_device_id tsl4531_id[] = {
};
MODULE_DEVICE_TABLE(i2c, tsl4531_id);
+static const struct of_device_id tsl4531_of_id[] = {
+ { .compatible = "amstaos,tsl4531" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, tsl4531_of_id);
+
static struct i2c_driver tsl4531_driver = {
.driver = {
.name = TSL4531_DRV_NAME,
+ .of_match_table = tsl4531_of_id,
.pm = pm_sleep_ptr(&tsl4531_pm_ops),
},
.probe = tsl4531_probe,