From patchwork Tue Jun 25 15:38:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2777671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B604C0AB1 for ; Tue, 25 Jun 2013 15:41:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19C4720316 for ; Tue, 25 Jun 2013 15:41:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C88A0202F0 for ; Tue, 25 Jun 2013 15:41:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UrVLg-0002sT-6q; Tue, 25 Jun 2013 15:40:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UrVLI-00044a-3C; Tue, 25 Jun 2013 15:39:40 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UrVL6-00040x-4b for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2013 15:39:28 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOY00L8WGSP2540@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2013 16:39:01 +0100 (BST) X-AuditID: cbfec7f5-b7f376d000001ec6-b6-51c9b995dac5 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 33.DB.07878.599B9C15; Tue, 25 Jun 2013 16:39:01 +0100 (BST) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MOY005E3GSWNNC0@eusync3.samsung.com>; Tue, 25 Jun 2013 16:39:01 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/4] usb: gadget: s3c-hsotg: Allow driver instantiation using device tree Date: Tue, 25 Jun 2013 17:38:23 +0200 Message-id: <1372174706-5459-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.2.1 In-reply-to: <1372174706-5459-1-git-send-email-t.figa@samsung.com> References: <1372174706-5459-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsVy+t/xq7pTd54MNDj7StLi4P16iwOzH7Ja HPizg9GiefF6NoveBVfZLM42vWG3ePNwM6PFlD/LmSw2Pb7GajHj/D4mi0XLWpkt1h65y25x eMUBJovDb9pZLdbPeM1icWzGEkYHAY8Fn6+we9y5tofNY//cNewem5fUe5yfsZDRo2/LKkaP 4ze2M3l83iQXwBHFZZOSmpNZllqkb5fAlfFw8XS2gsfiFRsW/WJvYLwh3MXIySEhYCKxeOUK FghbTOLCvfVsXYxcHEICSxklpp97ApYQEuhjkug5yg5iswmoSXxueMQGYosIqEp8blvADtLA LLCXReJT1z5mkISwQLREV/M+VhCbBajoy6F2RhCbV8BRYunze6wQ2xQkjm/fBhTn4OAUcJL4 PtMWYpejRPPOoywTGHkXMDKsYhRNLU0uKE5KzzXSK07MLS7NS9dLzs/dxAgJ5K87GJceszrE KMDBqMTDq7j1ZKAQa2JZcWXuIUYJDmYlEd5DWUAh3pTEyqrUovz4otKc1OJDjEwcnFINjDx7 tEIWTVn88NBJ/85IK95HT0JOc9a9TPiiskd4qs+eB0p2ThET3RbpvpvlMCNR9/2a7Z4/xd0f pwhnFX1VP/5S8XHn/qOhr526L9SX62ksP6kms3WH8dIUT62UWYVCmn4LGX9o9v2r0py97w3b Qu71u3lcn8/5cvxfzaet6cWvRKb3MV0SX6rEUpyRaKjFXFScCACMZ1TAQgIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130625_113928_321350_29A704CE X-CRM114-Status: GOOD ( 13.31 ) X-Spam-Score: -8.2 (--------) Cc: l.majewski@samsung.com, Kukjin Kim , Greg Kroah-Hartman , devicetree-discuss@lists.ozlabs.org, linux-usb@vger.kernel.org, Felipe Balbi , Tomasz Figa , Kyungmin Park , Thomas Abraham , Rob Herring , Sylwester Nawrocki , Grant Likely , Linus Walleij , linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds OF match table to the driver to allow instantiating it using device tree. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- .../devicetree/bindings/usb/samsung-hsotg.txt | 40 ++++++++++++++++++++++ drivers/usb/gadget/s3c-hsotg.c | 10 ++++++ 2 files changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/samsung-hsotg.txt diff --git a/Documentation/devicetree/bindings/usb/samsung-hsotg.txt b/Documentation/devicetree/bindings/usb/samsung-hsotg.txt new file mode 100644 index 0000000..b83d428 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-hsotg.txt @@ -0,0 +1,40 @@ +Samsung High Speed USB OTG controller +----------------------------- + +The Samsung HSOTG IP can be found on Samsung SoCs, from S3C6400 onwards. +It gives functionality of OTG-compliant USB 2.0 host and device with +support for USB 2.0 high-speed (480Mbps) and full-speed (12 Mbps) +operation. + +Currently only device mode is supported. + +Binding details +----- + +Required properties: +- compatible: "samsung,s3c6400-hsotg" should be used for all currently + supported SoC, +- interrupt-parent: phandle for the interrupt controller to which the + interrupt signal of the HSOTG block is routed, +- interrupts: specifier of interrupt signal of interrupt controller, + according to bindings of interrupt controller, +- clocks: contains an array of clock specifiers: + - first entry: OTG clock +- clock-names: contains array of clock names: + - first entry: must be "otg" +- vusb_d-supply: phandle to voltage regulator of digital section, +- vusb_a-supply: phandle to voltage regulator of analog section. + +Example +----- + + hsotg@12480000 { + compatible = "samsung,s3c6400-hsotg"; + reg = <0x12480000 0x20000>; + interrupts = <0 71 0>; + clocks = <&clock 305>; + clock-names = "otg"; + vusb_d-supply = <&vusb_reg>; + vusb_a-supply = <&vusbdac_reg>; + }; + diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index af22f24..616ed51 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -3648,10 +3649,19 @@ static int s3c_hsotg_remove(struct platform_device *pdev) #define s3c_hsotg_resume NULL #endif +#ifdef CONFIG_OF +static const struct of_device_id s3c_hsotg_of_ids[] = { + { .compatible = "samsung,s3c6400-hsotg", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, s3c_hsotg_of_ids); +#endif + static struct platform_driver s3c_hsotg_driver = { .driver = { .name = "s3c-hsotg", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(s3c_hsotg_of_ids), }, .probe = s3c_hsotg_probe, .remove = s3c_hsotg_remove,