From patchwork Sat Jun 1 21:33:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2648951 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5C876DFE76 for ; Sat, 1 Jun 2013 21:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755645Ab3FAVdv (ORCPT ); Sat, 1 Jun 2013 17:33:51 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:61008 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753465Ab3FAVdu (ORCPT ); Sat, 1 Jun 2013 17:33:50 -0400 Received: by mail-lb0-f179.google.com with SMTP id r11so2659702lbv.24 for ; Sat, 01 Jun 2013 14:33:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=GMAkl3OEuhbAAuOiH+4TZJGEsrPvdYLHZIYng3uiJ90=; b=FEtiZmtrBjxlaS9uEB+7hKDcF6JCLqGQlI9P2uMTN1NTyhPJGBfvS8YhaW1x1Bm7EV 1OR+VvHl+gN92h/KyIzbJ5idbWXcjq9FlEIwzwfzy86G9JC2WM/61D2kJWpVGgXXbOpP H0VNwY3XHMf+zLlqNewB4nQmV77yngMPiSVcQfvtsaWKvNMe1cbTmFaVDacdCx8ORs2k oS5jS9tby5G2N49EergRu4IHF7YYUMmF4vFQgR2t6wpjs947HSJ8R6N+q2O9j1FzCUVO ono0wfJCGMma2GDQeJnniY07V6REaZ/d/4EUCr/lAVs0ehD1yMB+qhOeAoA3DItKzEn9 C46A== X-Received: by 10.112.159.69 with SMTP id xa5mr3007703lbb.78.1370122428762; Sat, 01 Jun 2013 14:33:48 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-145-9.pppoe.mtu-net.ru. [91.76.145.9]) by mx.google.com with ESMTPSA id e3sm20945124lbf.17.2013.06.01.14.33.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Jun 2013 14:33:47 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: horms@verge.net.au, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, stern@rowland.harvard.edu Subject: [PATCH v8 2/9] ehci-platform: add pre_setup() method to platform data Date: Sun, 2 Jun 2013 01:33:56 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: gregkh@linuxfoundation.org References: <201306020128.05914.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306020128.05914.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306020133.57070.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnaslbKSezIf8tt04mspgWXLO/B8PZ0e0nEvJlDpFMwapXd19+s+WjhHgJr30kbtPvGv45h Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Sometimes there is a need to initialize some non-standard registers mapped to the EHCI region before accessing the standard EHCI registers. Add pre_setup() method with 'struct usb_hcd *' parameter to be called just before ehci_setup() to the 'ehci-platform' driver's platform data for this purpose... While at it, add the missing incomplete declaration of 'struct platform_device' to ... The patch has been tested on the Marzen and BOCK-W boards. Suggested-by: Alan Stern Signed-off-by: Sergei Shtylyov Acked-by: Kuninori Morimoto Acked-by: Simon Horman Acked-by: Alan Stern --- Changes since version 7: - refreshed the patch. Changes since version 3: - added ACK from Alan Stern. Changes since version 2: - replaced #include with incomplete declarations of 'struct platform_device' and 'struct usb_hcd'; - added a note about testing to the changelog; - added ACKs from Simon Horman and Kuninori Morimoto. Changes since the original posting: - changed init() method to pre_setup() with different parameters and call site. drivers/usb/host/ehci-platform.c | 6 ++++++ include/linux/usb/ehci_pdriver.h | 4 ++++ 2 files changed, 10 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/drivers/usb/host/ehci-platform.c =================================================================== --- renesas.orig/drivers/usb/host/ehci-platform.c +++ renesas/drivers/usb/host/ehci-platform.c @@ -48,6 +48,12 @@ static int ehci_platform_reset(struct us ehci->big_endian_desc = pdata->big_endian_desc; ehci->big_endian_mmio = pdata->big_endian_mmio; + if (pdata->pre_setup) { + retval = pdata->pre_setup(hcd); + if (retval < 0) + return retval; + } + ehci->caps = hcd->regs + pdata->caps_offset; retval = ehci_setup(hcd); if (retval) Index: renesas/include/linux/usb/ehci_pdriver.h =================================================================== --- renesas.orig/include/linux/usb/ehci_pdriver.h +++ renesas/include/linux/usb/ehci_pdriver.h @@ -19,6 +19,9 @@ #ifndef __USB_CORE_EHCI_PDRIVER_H #define __USB_CORE_EHCI_PDRIVER_H +struct platform_device; +struct usb_hcd; + /** * struct usb_ehci_pdata - platform_data for generic ehci driver * @@ -50,6 +53,7 @@ struct usb_ehci_pdata { /* Turn on only VBUS suspend power and hotplug detection, * turn off everything else */ void (*power_suspend)(struct platform_device *pdev); + int (*pre_setup)(struct usb_hcd *hcd); }; #endif /* __USB_CORE_EHCI_PDRIVER_H */