From patchwork Fri Jul 20 14:39:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Prisk X-Patchwork-Id: 1221381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 75217E0038 for ; Fri, 20 Jul 2012 14:47:32 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SsEOm-0002S8-Pd; Fri, 20 Jul 2012 14:41:46 +0000 Received: from mta05.xtra.co.nz ([210.54.141.250] helo=mta02.xtra.co.nz) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SsEN3-0002Dj-Aa for linux-arm-kernel@lists.infradead.org; Fri, 20 Jul 2012 14:40:01 +0000 Received: from debian6.prisktech.co.nz ([115.188.14.127]) by mta02.xtra.co.nz with ESMTP id <20120720143945.ZQGE8118.mta02.xtra.co.nz@debian6.prisktech.co.nz>; Sat, 21 Jul 2012 02:39:45 +1200 From: Tony Prisk To: Arnd Bergmann Subject: [PATCH] ARM: vt8500: Minor updates to platform drivers for devicetree support Date: Sat, 21 Jul 2012 02:39:43 +1200 Message-Id: <1342795183-7942-1-git-send-email-linux@prisktech.co.nz> X-Mailer: git-send-email 1.7.2.5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.54.141.250 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tony Prisk , VT8500 mailing list , devicetree-discuss , linux-arm-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Updated the vt8500-rtc and vt8500-uart platform drivers for devicetree support. Signed-off-by: Tony Prisk Acked-by: Arnd Bergmann --- .../devicetree/bindings/rtc/vt8500-rtc.txt | 14 ++++++++++++++ .../devicetree/bindings/tty/serial/vt8500-uart.txt | 14 ++++++++++++++ drivers/rtc/rtc-vt8500.c | 8 ++++++++ drivers/tty/serial/vt8500_serial.c | 8 ++++++++ 4 files changed, 44 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/rtc/vt8500-rtc.txt create mode 100644 Documentation/devicetree/bindings/tty/serial/vt8500-uart.txt diff --git a/Documentation/devicetree/bindings/rtc/vt8500-rtc.txt b/Documentation/devicetree/bindings/rtc/vt8500-rtc.txt new file mode 100644 index 0000000..8cf6ce1 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/vt8500-rtc.txt @@ -0,0 +1,14 @@ +* SPEAr RTC + +Required properties: +- compatible : "via,vt8500-rtc" +- reg : Address range of the rtc registers +- interrupt: Should contain the rtc interrupt number + +Example: + + rtc@d8100000 { + compatible = "via,vt8500-rtc"; + reg = <0xd8100000 0x2c>; + interrupts = <48>; + }; diff --git a/Documentation/devicetree/bindings/tty/serial/vt8500-uart.txt b/Documentation/devicetree/bindings/tty/serial/vt8500-uart.txt new file mode 100644 index 0000000..745070a --- /dev/null +++ b/Documentation/devicetree/bindings/tty/serial/vt8500-uart.txt @@ -0,0 +1,14 @@ +* VIA/Wondermedia Universal Asynchronous Receiver/Transmitter (UART) + +Required properties: +- compatible: Should be "via,vt8500-uart" +- reg: Should contain registers location and length +- interrupts: Should contain interrupt + +Example: + uart0: serial@d8200000 { + compatible = "via,vt8500-uart"; + reg = <0xd8200000 0x1040>; + interrupts = <32>; + }; + diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c index 9e94fb1..2f155c2 100644 --- a/drivers/rtc/rtc-vt8500.c +++ b/drivers/rtc/rtc-vt8500.c @@ -23,6 +23,7 @@ #include #include #include +#include /* * Register definitions @@ -302,12 +303,18 @@ static int __devexit vt8500_rtc_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id vt8500_rtc_ids[] = { + { .compatible = "via,vt8500-rtc", }, + {} +}; + static struct platform_driver vt8500_rtc_driver = { .probe = vt8500_rtc_probe, .remove = __devexit_p(vt8500_rtc_remove), .driver = { .name = "vt8500-rtc", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(vt8500_rtc_ids), }, }; @@ -317,3 +324,4 @@ MODULE_AUTHOR("Alexey Charkov "); MODULE_DESCRIPTION("VIA VT8500 SoC Realtime Clock Driver (RTC)"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:vt8500-rtc"); +MODULE_DEVICE_TABLE(of, vt8500_rtc_ids); diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 2be006f..bd20b4e 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -34,6 +34,7 @@ #include #include #include +#include /* * UART Register offsets @@ -603,12 +604,18 @@ static int __devexit vt8500_serial_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id vt8500_uart_ids[] = { + { .compatible = "via,vt8500-uart", }, + {} +}; + static struct platform_driver vt8500_platform_driver = { .probe = vt8500_serial_probe, .remove = __devexit_p(vt8500_serial_remove), .driver = { .name = "vt8500_serial", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(vt8500_uart_ids), }, }; @@ -643,3 +650,4 @@ module_exit(vt8500_serial_exit); MODULE_AUTHOR("Alexey Charkov "); MODULE_DESCRIPTION("Driver for vt8500 serial device"); MODULE_LICENSE("GPL"); +MODULE_DEVICE_TABLE(of, vt8500_uart_ids);