Skip to contentSkip to conversation

add I2C device and compatible ID

PATCH In review Seven Lee 2 participants 3 messages May 25, 2020

Subsystems (3)
lore
Share & tools
lore

Seven Lee

author
#0 lore raw

PATCH 1/1 add I2C device and compatible ID

The nau8810 driver can also compatible with nau8812 and nau8814.

---
 .../devicetree/bindings/sound/nau8812.txt        | 16 ++++++++++++++++
 .../devicetree/bindings/sound/nau8814.txt        | 16 ++++++++++++++++
 sound/soc/codecs/nau8810.c                       |  4 ++++
 3 files changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nau8812.txt
 create mode 100644 Documentation/devicetree/bindings/sound/nau8814.txt
Documentation/devicetree/bindings/sound/nau8812.txt new file +16 -0
new file mode 100644
index 000000000000..7aab29586a1f
@@ -0,0 +1,16 @@
+NAU8812 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+  - compatible : "nuvoton,nau8812"
+
+  - reg : the I2C address of the device.
+
+Example:
+
+codec: nau8812@1a {
+	compatible = "nuvoton,nau8812";
+	reg = <0x1a>;
+};
Documentation/devicetree/bindings/sound/nau8814.txt new file +16 -0
new file mode 100644
index 000000000000..24bf2ba3d23b
@@ -0,0 +1,16 @@
+NAU8814 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+  - compatible : "nuvoton,nau8814"
+
+  - reg : the I2C address of the device.
+
+Example:
+
+codec: nau8814@1a {
+	compatible = "nuvoton,nau8814";
+	reg = <0x1a>;
+};
sound/soc/codecs/nau8810.c +4 -0
index efe9fb3fb225..33ebc6398426 100644
@@ -895,6 +895,8 @@ static int nau8810_i2c_probe(struct i2c_client *i2c,
 
 static const struct i2c_device_id nau8810_i2c_id[] = {
 	{ "nau8810", 0 },
+	{ "nau8812", 0 },
+	{ "nau8814", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id);
@@ -902,6 +904,8 @@ MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id);
 #ifdef CONFIG_OF
 static const struct of_device_id nau8810_of_match[] = {
 	{ .compatible = "nuvoton,nau8810", },
+	{ .compatible = "nuvoton,nau8812", },
+	{ .compatible = "nuvoton,nau8814", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, nau8810_of_match);
Signature · 1 line
2.26.2
author
#1 lore raw

PATCH 1/1 add I2C device and compatible ID

The nau8810 driver can also compatible with nau8812 and nau8814.

---
 .../devicetree/bindings/sound/nau8812.txt        | 16 ++++++++++++++++
 .../devicetree/bindings/sound/nau8814.txt        | 16 ++++++++++++++++
 sound/soc/codecs/nau8810.c                       |  4 ++++
 3 files changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nau8812.txt
 create mode 100644 Documentation/devicetree/bindings/sound/nau8814.txt
Documentation/devicetree/bindings/sound/nau8812.txt new file +16 -0
new file mode 100644
index 000000000000..7aab29586a1f
@@ -0,0 +1,16 @@
+NAU8812 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+  - compatible : "nuvoton,nau8812"
+
+  - reg : the I2C address of the device.
+
+Example:
+
+codec: nau8812@1a {
+	compatible = "nuvoton,nau8812";
+	reg = <0x1a>;
+};
Documentation/devicetree/bindings/sound/nau8814.txt new file +16 -0
new file mode 100644
index 000000000000..24bf2ba3d23b
@@ -0,0 +1,16 @@
+NAU8814 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+  - compatible : "nuvoton,nau8814"
+
+  - reg : the I2C address of the device.
+
+Example:
+
+codec: nau8814@1a {
+	compatible = "nuvoton,nau8814";
+	reg = <0x1a>;
+};
sound/soc/codecs/nau8810.c +4 -0
index efe9fb3fb225..33ebc6398426 100644
@@ -895,6 +895,8 @@ static int nau8810_i2c_probe(struct i2c_client *i2c,
 
 static const struct i2c_device_id nau8810_i2c_id[] = {
 	{ "nau8810", 0 },
+	{ "nau8812", 0 },
+	{ "nau8814", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id);
@@ -902,6 +904,8 @@ MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id);
 #ifdef CONFIG_OF
 static const struct of_device_id nau8810_of_match[] = {
 	{ .compatible = "nuvoton,nau8810", },
+	{ .compatible = "nuvoton,nau8812", },
+	{ .compatible = "nuvoton,nau8814", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, nau8810_of_match);
Signature · 1 line
2.26.2
maintainer
#2 lore raw
In reply to Seven Lee
Quoted 7 lines · Seven Lee

The nau8810 driver can also compatible with nau8812 and nau8814.

---
 .../devicetree/bindings/sound/nau8812.txt        | 16 ++++++++++++++++
 .../devicetree/bindings/sound/nau8814.txt        | 16 ++++++++++++++++
 sound/soc/codecs/nau8810.c                       |  4 ++++

If they're compatible you should add the additional IDs to the same binding document rather than adding additional binding documents.