From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Clouter Subject: [PATCH 6/6] rtc: rtc-m48t86: add devicetree bindings Date: Tue, 2 Apr 2013 00:22:45 +0100 Message-ID: <1364858565-17192-7-git-send-email-alex@digriz.org.uk> References: <1364858565-17192-1-git-send-email-alex@digriz.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1364858565-17192-1-git-send-email-alex-L4GPcECwBoDe9xe1eoZjHA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Alessandro Zummo , Hartley Sweeten , Grant Likely , Jason Cooper , Ryan Mallon , Rob Herring , Andrew Lunn Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Alexander Clouter List-Id: devicetree@vger.kernel.org Add devicetree bindings (and documentation) for rtc-m48t86. Signed-off-by: Alexander Clouter --- Documentation/devicetree/bindings/rtc/rtc-m48t86.txt | 17 +++++++++++++++++ drivers/rtc/rtc-m48t86.c | 12 ++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-m48t86.txt diff --git a/Documentation/devicetree/bindings/rtc/rtc-m48t86.txt b/Documentation/devicetree/bindings/rtc/rtc-m48t86.txt new file mode 100644 index 0000000..375ea56 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/rtc-m48t86.txt @@ -0,0 +1,17 @@ +RTC support for the rtc-m48t86 driver + +Required properties: +- compatible : "rtc-m48t86" +- reg : Array of base physical addresses for the RTC control and data +- reg-names : must have "rtc_index" and "rtc_data" + +Example: + +rtc@808 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "rtc-m48t86"; + reg = <0x808 0x04>, + <0x80c 0x04>; + reg-names = "rtc_index", "rtc_data"; +}; diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index b8edf73..9395126 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c @@ -20,6 +20,7 @@ #include #include #include +#include #define M48T86_REG_SEC 0x00 #define M48T86_REG_SECALRM 0x01 @@ -335,10 +336,17 @@ static int m48t86_rtc_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id m48t86_rtc_match[] = { + { .compatible = "rtc-m48t86" }, + {}, +}; +MODULE_DEVICE_TABLE(of, m48t86_rtc_match); + static struct platform_driver m48t86_rtc_platform_driver = { .driver = { - .name = "rtc-m48t86", - .owner = THIS_MODULE, + .name = "rtc-m48t86", + .owner = THIS_MODULE, + .of_match_table = m48t86_rtc_match, }, .probe = m48t86_rtc_probe, .remove = m48t86_rtc_remove, -- 1.7.10.4