]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: power: max77686: Add basic device tree binding
authorSimon Glass <sjg@chromium.org>
Sun, 3 Feb 2013 22:17:35 +0000 (14:17 -0800)
committerChromeBot <chrome-bot@google.com>
Sun, 10 Feb 2013 14:55:31 +0000 (06:55 -0800)
This chip has an RTC within it, so define an "rtc" subnode. So far there
are no properties, but the existence of the node is enough to make it
accessible via a phandle.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
With later commits, see that we can find this node in the rtc driver.

Change-Id: Ia6d3fdb22b77b17bc4887ff3671b711f2969a251
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42575

Documentation/devicetree/bindings/rtc/max77686-rtc.txt [new file with mode: 0644]
drivers/rtc/rtc-max77686.c

diff --git a/Documentation/devicetree/bindings/rtc/max77686-rtc.txt b/Documentation/devicetree/bindings/rtc/max77686-rtc.txt
new file mode 100644 (file)
index 0000000..6471807
--- /dev/null
@@ -0,0 +1,19 @@
+* MAX77686 Real Time Clock controller
+
+This RTC is part of the MAX77686 MFD, which also includes a PMIC device.
+The RTC part is in a subnode:
+
+Required properties:
+- name: "rtc"
+
+(no other properties are defined at present)
+
+Example:
+
+       max77686 {
+               voltage-regulators {
+                       ...
+               };
+               rtc {
+               };
+       };
index dc717726943059607c82950d5ea75a60c0404881..1049d74eb9ef1891fa0a58a52a45cf20300de99e 100644 (file)
@@ -447,6 +447,10 @@ static int __devinit max77686_rtc_probe(struct platform_device *pdev)
        info->virq = IRQ_GPIO_END + 1 + MAX77686_RTCIRQ_RTCA1;
        platform_set_drvdata(pdev, info);
 
+       /* Find OF node if available, no decoding of anything yet */
+       pdev->dev.of_node = of_find_node_by_name(max77686->dev->of_node,
+                                                "rtc");
+
        ret = max77686_rtc_init_reg(info);
 
        if (ret < 0) {