From patchwork Fri Aug 16 13:09:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 2845667 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 EAE7DBF546 for ; Fri, 16 Aug 2013 13:12:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0551201D5 for ; Fri, 16 Aug 2013 13:12:29 +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 5C5762027F for ; Fri, 16 Aug 2013 13:12:28 +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 1VAJoD-0000jD-Qe; Fri, 16 Aug 2013 13:11:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VAJnq-0001ch-Il; Fri, 16 Aug 2013 13:10:54 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VAJnE-0001Wy-6P for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2013 13:10:19 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7GD9o8k017985; Fri, 16 Aug 2013 08:09:50 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7GD9ocn015025; Fri, 16 Aug 2013 08:09:50 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Fri, 16 Aug 2013 08:09:49 -0500 Received: from localhost.localdomain (h113-233.vpn.ti.com [172.24.113.233]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r7GD9WcZ026886; Fri, 16 Aug 2013 08:09:47 -0500 From: Roger Quadros To: , Subject: [PATCH v3 5/8] usb: musb: omap2430: Don't use omap_get_control_dev() Date: Fri, 16 Aug 2013 16:09:28 +0300 Message-ID: <1376658571-20992-6-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1376658571-20992-1-git-send-email-rogerq@ti.com> References: <1376658571-20992-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130816_091016_530515_71777030 X-CRM114-Status: GOOD ( 13.18 ) X-Spam-Score: -9.6 (---------) Cc: devicetree@vger.kernel.org, george.cherian@ti.com, tony@atomide.com, bigeasy@linutronix.de, linux-usb@vger.kernel.org, kishon@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Roger Quadros 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.9 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 omap_get_control_dev() is being deprecated as it doesn't support multiple instances. As control device is present only from OMAP4 onwards which supports DT only, we use phandles to get the reference to the control device. Also get rid of "ti,has-mailbox" property as it is redundant and we can determine that from whether "ctrl-module" property is present or not. Get rid of has_mailbox from musb_hdrc_platform_data as well. Signed-off-by: Roger Quadros --- Documentation/devicetree/bindings/usb/omap-usb.txt | 3 -- drivers/usb/musb/omap2430.c | 25 +++++++++++-------- include/linux/usb/musb.h | 2 - 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt index e24078f..2567b6b 100644 --- a/Documentation/devicetree/bindings/usb/omap-usb.txt +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt @@ -3,9 +3,6 @@ OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS OMAP MUSB GLUE - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" - ti,hwmods : must be "usb_otg_hs" - - ti,has-mailbox : to specify that omap uses an external mailbox - (in control module) to communicate with the musb core during device connect - and disconnect. - multipoint : Should be "1" indicating the musb controller supports multipoint. This is a MUSB configuration-specific setting. - num-eps : Specifies the number of endpoints. This is also a diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index ebb46ec..516795b 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "musb_core.h" #include "omap2430.h" @@ -509,8 +510,12 @@ static int omap2430_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; glue->status = OMAP_MUSB_UNKNOWN; + glue->control_otghs = ERR_PTR(-ENODEV); if (np) { + struct device_node *control_node; + struct platform_device *control_pdev; + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) { dev_err(&pdev->dev, @@ -539,22 +544,20 @@ static int omap2430_probe(struct platform_device *pdev) of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); of_property_read_u32(np, "power", (u32 *)&pdata->power); config->multipoint = of_property_read_bool(np, "multipoint"); - pdata->has_mailbox = of_property_read_bool(np, - "ti,has-mailbox"); pdata->board_data = data; pdata->config = config; - } - if (pdata->has_mailbox) { - glue->control_otghs = omap_get_control_dev(); - if (IS_ERR(glue->control_otghs)) { - dev_vdbg(&pdev->dev, "Failed to get control device\n"); - ret = PTR_ERR(glue->control_otghs); - goto err2; + control_node = of_parse_phandle(np, "ctrl-module", 0); + if (control_node) { + control_pdev = of_find_device_by_node(control_node); + if (!control_pdev) { + dev_err(&pdev->dev, "Failed to get control device\n"); + ret = -EINVAL; + goto err2; + } + glue->control_otghs = &control_pdev->dev; } - } else { - glue->control_otghs = ERR_PTR(-ENODEV); } pdata->platform_ops = &omap2430_ops; diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 053c268..eb50525 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -99,8 +99,6 @@ struct musb_hdrc_platform_data { /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ u8 mode; - u8 has_mailbox:1; - /* for clk_get() */ const char *clock;