Skip to contentSkip to conversation

DW9714 DT support

PATCH In review Sakari Ailus 4 participants 6 messages Aug 17, 2017 – Aug 23, 2017 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

cover DW9714 DT support

Hi all,

This patchset adds DT bindings as well as DT support for DW9714. The unused ACPI match table is removed.

Sakari Ailus (3):
dt-bindings: Add bindings for Dongwoon DW9714 voice coil
dw9714: Add Devicetree support
dw9714: Remove ACPI match tables, convert to use probe_new

 .../bindings/media/i2c/dongwoon,dw9714.txt         |  9 ++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 drivers/media/i2c/dw9714.c                         | 26 +++++++++-------------
 3 files changed, 21 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt
Signature · 1 line
2.7.4

A message that is not in the archive (sent off-list or not yet received): 1502977376-22836-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/[email protected]

#2 lore raw

PATCH 1/3 dt-bindings: Add bindings for Dongwoon DW9714 voice coil

Dongwoon DW9714 is a voice coil lens driver.

Also add a vendor prefix for Dongwoon for one did not exist previously.

---
 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt | 9 +++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt           | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt
Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt new file +9 -0
new file mode 100644
index 0000000..b88dcdd
@@ -0,0 +1,9 @@
+Dongwoon Anatech DW9714 camera voice coil lens driver
+
+DW9174 is a 10-bit DAC with current sink capability. It is intended
+for driving voice coil lenses in camera modules.
+
+Mandatory properties:
+
+- compatible: "dongwoon,dw9714"
+- reg: I²C slave address
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index daf465be..6b6e683 100644
@@ -88,6 +88,7 @@ dlg	Dialog Semiconductor
 dlink	D-Link Corporation
 dmo	Data Modul AG
 domintech	Domintech Co., Ltd.
+dongwoon	Dongwoon Anatech
 dptechnics	DPTechnics
 dragino	Dragino Technology Co., Limited
 ea	Embedded Artists AB
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1502977376-22836-2-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/[email protected]

Acked-by
#4 lore raw

Re: [PATCH 1/3] dt-bindings: Add bindings for Dongwoon DW9714 voice coil

Quoted 10 lines · Sakari Ailus

Dongwoon DW9714 is a voice coil lens driver.

Also add a vendor prefix for Dongwoon for one did not exist previously.

---
 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt | 9 +++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt           | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Tested-by
#5 lore raw
In reply to a message not in the archive

Hi Sakari,

Thanks for the patches.

I have verified that the dw9714 driver gets probed via DT bindings, with these patches on 4.13-rc6 kernel.

Feel free to add

Raj

Quoted 18 lines

-----Original Message-----
From: Sakari Ailus [mailto:sakari.ailus-VuQAYsv1563Yd54FQh9/[email protected]]
Sent: Thursday, August 17, 2017 6:43 AM
To: [email protected]
Cc: [email protected]; Mani, Rajmohan <[email protected]>
Subject: [PATCH 0/3] DW9714 DT support

Hi all,

This patchset adds DT bindings as well as DT support for DW9714. The unused ACPI match table is removed.

Sakari Ailus (3):
dt-bindings: Add bindings for Dongwoon DW9714 voice coil
dw9714: Add Devicetree support
dw9714: Remove ACPI match tables, convert to use probe_new

Quoted 8 lines
 .../bindings/media/i2c/dongwoon,dw9714.txt         |  9 ++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 drivers/media/i2c/dw9714.c                         | 26 +++++++++-------------
 3 files changed, 21 insertions(+), 15 deletions(-)  create mode 100644

Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt

--
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#6 lore raw

PATCH 2/3 dw9714: Add Devicetree support

In reply to Sakari Ailus
---
 drivers/media/i2c/dw9714.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/media/i2c/dw9714.c +7 -0
index 6a607d7..bcf64ef 100644
@@ -264,6 +264,12 @@ static const struct i2c_device_id dw9714_id_table[] = {
 
 MODULE_DEVICE_TABLE(i2c, dw9714_id_table);
 
+static const struct of_device_id dw9714_of_table[] = {
+	{ .compatible = "dongwoon,dw9714" },
+	{ { 0 } }
+};
+MODULE_DEVICE_TABLE(of, dw9714_of_table);
+
 static const struct dev_pm_ops dw9714_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(dw9714_vcm_suspend, dw9714_vcm_resume)
 	SET_RUNTIME_PM_OPS(dw9714_vcm_suspend, dw9714_vcm_resume, NULL)
@@ -274,6 +280,7 @@ static struct i2c_driver dw9714_i2c_driver = {
 		.name = DW9714_NAME,
 		.pm = &dw9714_pm_ops,
 		.acpi_match_table = ACPI_PTR(dw9714_acpi_match),
+		.of_match_table = dw9714_of_table,
 	},
 	.probe = dw9714_probe,
 	.remove = dw9714_remove,
Signature · 1 line
2.7.4
author maintainer
#7 lore raw

PATCH 3/3 dw9714: Remove ACPI match tables, convert to use probe_new

In reply to Sakari Ailus

The ACPI match table is empty. Remove it.

Also convert the drive to use probe_new callback in struct i2c_driver.

---
 drivers/media/i2c/dw9714.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/media/i2c/dw9714.c +4 -15
index bcf64ef..95af4fc 100644
@@ -11,7 +11,6 @@
  * GNU General Public License for more details.
  */
 
-#include <linux/acpi.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
@@ -147,8 +146,7 @@ static int dw9714_init_controls(struct dw9714_device *dev_vcm)
 	return hdl->error;
 }
 
-static int dw9714_probe(struct i2c_client *client,
-			const struct i2c_device_id *devid)
+static int dw9714_probe(struct i2c_client *client)
 {
 	struct dw9714_device *dw9714_dev;
 	int rval;
@@ -250,18 +248,10 @@ static int  __maybe_unused dw9714_vcm_resume(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_ACPI
-static const struct acpi_device_id dw9714_acpi_match[] = {
-	{},
-};
-MODULE_DEVICE_TABLE(acpi, dw9714_acpi_match);
-#endif
-
 static const struct i2c_device_id dw9714_id_table[] = {
-	{DW9714_NAME, 0},
-	{}
+	{ DW9714_NAME, 0 },
+	{ { 0 } }
 };
-
 MODULE_DEVICE_TABLE(i2c, dw9714_id_table);
 
 static const struct of_device_id dw9714_of_table[] = {
@@ -279,10 +269,9 @@ static struct i2c_driver dw9714_i2c_driver = {
 	.driver = {
 		.name = DW9714_NAME,
 		.pm = &dw9714_pm_ops,
-		.acpi_match_table = ACPI_PTR(dw9714_acpi_match),
 		.of_match_table = dw9714_of_table,
 	},
-	.probe = dw9714_probe,
+	.probe_new = dw9714_probe,
 	.remove = dw9714_remove,
 	.id_table = dw9714_id_table,
 };
Signature · 1 line
2.7.4