linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] mfd: arizona: Update device tree regulator bindings
@ 2013-09-25 17:47 Charles Keepax
  2013-09-25 18:32 ` Mark Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Charles Keepax @ 2013-09-25 17:47 UTC (permalink / raw)
  To: devicetree, broonie; +Cc: patches, linux-kernel, Charles Keepax

The current binding will not be able to locate the regulators DBVDD2,
DBVDD3, CPVDD, SPKVDDL and SPKVDDR as they are required to be present on
the CODEC driver of_node but presently are attached to the MFD of_node.

This patch creates a sub-node for the codec and attaches the required
regulators here using the of_compatible field on the mfd_cell.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
Hi,

Another issue with the Arizona bindings, I am not sure
exactly what the best approach is this patch seems like the
"correct" fix, but it does require a change to the binding,
although the current binding is non-functional.

Alternatively I could simply set the codec of_node to match
the mfd one manually in the codec driver which wouldn't need
the binding changing but feels a bit like a work around.

Any thoughts would be greatly appreciated?

Thanks,
Charles


 Documentation/devicetree/bindings/mfd/arizona.txt |   28 ++++++++++++++++++--
 drivers/mfd/arizona-core.c                        |   15 +++++++++--
 2 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index aa609a6..49592b2 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -3,7 +3,7 @@ Wolfson Arizona class audio SoCs
 These devices are audio SoCs with extensive digital capabilites and a range
 of analogue I/O.
 
-Required properties:
+Required properties, nodes:
 
   - compatible : one of the following chip-specific strings:
 	"wlf,wm5102"
@@ -26,10 +26,19 @@ Required properties:
   - #gpio-cells : Must be 2. The first cell is the pin number and the
     second cell is used to specify optional parameters (currently unused).
 
-  - AVDD1-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply,
-    SPKVDDL-supply, SPKVDDR-supply : power supplies for the device, as covered
+  - AVDD-supply, DBVDD1-supply : power supplies for the device, as covered
     in Documentation/devicetree/bindings/regulator/regulator.txt
 
+  - codec {} : Represents the audio part of the chip
+      - compatible : one of the following chip-specific strings:
+          "wlf,wm5102-codec"
+          "wlf,wm5110-codec"
+          "wlf,wm8997-codec"
+
+      - DBVDD2-supply, DBVDD3-supply, CPVDD-supply, SPKVDDL-supply,
+        SPKVDDR-supply : power supplies for the codec, as covered in
+        Documentation/devicetree/bindings/regulator/regulator.txt
+
 Optional properties:
 
   - wlf,reset : GPIO specifier for the GPIO controlling /RESET
@@ -60,4 +69,17 @@ codec: wm5102@1a {
 		0xffffffff,
 		0xffffffff,
 	>;
+
+	AVDD-supply = <&example_reg>;
+	DBVDD1-supply = <&example_reg>;
+
+	codec {
+		compatible = "wlf,wm5102-codec";
+
+		DBVDD2-supply = <&example_reg>;
+		DBVDD3-supply = <&example_reg>;
+		CPVDD-supply = <&example_reg>;
+		SPKVDDL-supply = <&example_reg>;
+		SPKVDDR-supply = <&example_reg>;
+	};
 };
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 5ac3aa4..10f8ab7 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -575,7 +575,10 @@ static struct mfd_cell wm5102_devs[] = {
 	{ .name = "arizona-gpio" },
 	{ .name = "arizona-haptics" },
 	{ .name = "arizona-pwm" },
-	{ .name = "wm5102-codec" },
+	{
+		.name = "wm5102-codec",
+		.of_compatible = "wlf,wm5102-codec",
+	},
 };
 
 static struct mfd_cell wm5110_devs[] = {
@@ -584,7 +587,10 @@ static struct mfd_cell wm5110_devs[] = {
 	{ .name = "arizona-gpio" },
 	{ .name = "arizona-haptics" },
 	{ .name = "arizona-pwm" },
-	{ .name = "wm5110-codec" },
+	{
+		.name = "wm5110-codec",
+		.of_compatible = "wlf,wm5110-codec",
+	};
 };
 
 static struct mfd_cell wm8997_devs[] = {
@@ -593,7 +599,10 @@ static struct mfd_cell wm8997_devs[] = {
 	{ .name = "arizona-gpio" },
 	{ .name = "arizona-haptics" },
 	{ .name = "arizona-pwm" },
-	{ .name = "wm8997-codec" },
+	{
+		.name = "wm8997-codec",
+		.of_compatible = "wlf,wm8997-codec",
+	},
 };
 
 int arizona_dev_init(struct arizona *arizona)
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-10-10 11:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25 17:47 [RFC PATCH] mfd: arizona: Update device tree regulator bindings Charles Keepax
2013-09-25 18:32 ` Mark Brown
2013-09-26 15:29   ` Charles Keepax
2013-09-26 17:58     ` Mark Brown
2013-09-28 15:53       ` Charles Keepax
2013-09-28 22:55         ` Mark Brown
2013-09-29 14:11           ` Charles Keepax
2013-09-29 17:52             ` Mark Brown
2013-09-29 18:09               ` Charles Keepax
2013-10-10 11:21                 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).