Skip to content

Commit

Permalink
mikrobus driver update, serdev patches
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishnavachath authored and RobertCNelson committed Oct 21, 2020
1 parent 6945d1a commit 1b0087e
Show file tree
Hide file tree
Showing 11 changed files with 837 additions and 311 deletions.
2 changes: 2 additions & 0 deletions patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ drivers () {
dir 'drivers/ti/gpio'
dir 'drivers/greybus'
dir 'drivers/mikrobus'
dir 'drivers/serdev'
dir 'drivers/iio'
}

soc () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
From d06a613f485a380674645d2358ac6d189040a766 Mon Sep 17 00:00:00 2001
From: Vaishnav M A <vaishnav@beagleboard.org>
Date: Thu, 15 Oct 2020 16:12:05 +0530
Subject: [PATCH v4] iio:light:tsl2563 use generic fw accessors

Replace of_property_read_u32() with device_property_read_u32(),
when reading the amstaos,cover-comp-gain.This opens up the
possibility of passing the properties during platform instantiation
of the device by a suitable populated struct property_entry.
Additionally, a minor change in logic is added to remove the
of_node present check.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
---
v4:
-update commit message, fix punctuation.
-update to a shorter commit title, used for similar changes
within the subsystem, like in 00fa493b9989
("iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors")
v3:
-modify commit message for readability, mention minor logic change
-include mod_devicetable.h and property.h headers
v2:
-fix commit message
drivers/iio/light/tsl2563.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index abc8d7db8dc1..5bf2bfbc5379 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -12,6 +12,8 @@
*/

#include <linux/module.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -703,7 +705,6 @@ 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;

@@ -738,13 +739,14 @@ static int tsl2563_probe(struct i2c_client *client,
chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS);
chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS);

- if (pdata)
+ 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;
+ } else {
+ err = device_property_read_u32(&client->dev, "amstaos,cover-comp-gain",
+ &chip->cover_comp_gain);
+ if (err)
+ chip->cover_comp_gain = 1;
+ }

dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f);
indio_dev->name = client->name;
--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From dbbed44fe8fb51d0e9be598ff05825609df9f6ce Mon Sep 17 00:00:00 2001
From: Vaishnav M A <vaishnav@beagleboard.org>
Date: Thu, 15 Oct 2020 16:12:06 +0530
Subject: [PATCH v4] iio: light: vcnl4035 add i2c_device_id

Add i2c_device_id table for the vcnl4035 driver,
enabling device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c_adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
---
v4:
-update commit message, add punctuation.
v3:
-modify commit message for readability
as suggested by Jonathan Cameron
v2:
-fix commit message
drivers/iio/light/vcnl4035.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c
index 765c44adac57..73a28e30dddc 100644
--- a/drivers/iio/light/vcnl4035.c
+++ b/drivers/iio/light/vcnl4035.c
@@ -652,6 +652,12 @@ static const struct dev_pm_ops vcnl4035_pm_ops = {
vcnl4035_runtime_resume, NULL)
};

+static const struct i2c_device_id vcnl4035_id[] = {
+ { "vcnl4035", 0},
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, vcnl4035_id);
+
static const struct of_device_id vcnl4035_of_match[] = {
{ .compatible = "vishay,vcnl4035", },
{ }
@@ -666,6 +672,7 @@ static struct i2c_driver vcnl4035_driver = {
},
.probe = vcnl4035_probe,
.remove = vcnl4035_remove,
+ .id_table = vcnl4035_id,
};

module_i2c_driver(vcnl4035_driver);
--
2.25.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 8a6cba6d5c4ebfe53c18ae2b2ce534c4fc68c417 Mon Sep 17 00:00:00 2001
From: Vaishnav M A <vaishnav@beagleboard.org>
Date: Thu, 15 Oct 2020 16:12:06 +0530
Subject: [PATCH v4] iio: proximity: vl53l0x-i2c add i2c_device_id

Add i2c_device_id table for the vl53l0x-i2c driver,
helps in device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>

---
v4:
-update commit message, add punctuation
v3:
-modify commit message for readability
as suggested by Jonathan Cameron
v2:
-fix commit message
drivers/iio/proximity/vl53l0x-i2c.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c
index 5fbda9475ba9..7c29d4cae24a 100644
--- a/drivers/iio/proximity/vl53l0x-i2c.c
+++ b/drivers/iio/proximity/vl53l0x-i2c.c
@@ -143,6 +143,12 @@ static int vl53l0x_probe(struct i2c_client *client)
return devm_iio_device_register(&client->dev, indio_dev);
}

+static const struct i2c_device_id vl53l0x_id[] = {
+ { "vl53l0x", 0},
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, vl53l0x_id);
+
static const struct of_device_id st_vl53l0x_dt_match[] = {
{ .compatible = "st,vl53l0x", },
{ }
@@ -155,6 +161,7 @@ static struct i2c_driver vl53l0x_driver = {
.of_match_table = st_vl53l0x_dt_match,
},
.probe_new = vl53l0x_probe,
+ .id_table = vl53l0x_id,
};
module_i2c_driver(vl53l0x_driver);

--
2.25.1

Loading

0 comments on commit 1b0087e

Please sign in to comment.