From patchwork Fri Apr 19 21:57:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2467061 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 E1AF1DF25A for ; Fri, 19 Apr 2013 21:57:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934609Ab3DSV57 (ORCPT ); Fri, 19 Apr 2013 17:57:59 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:38056 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934585Ab3DSV56 (ORCPT ); Fri, 19 Apr 2013 17:57:58 -0400 Received: by mail-la0-f48.google.com with SMTP id eo20so131678lab.35 for ; Fri, 19 Apr 2013 14:57:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:to:subject:cc:from:organization:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=NO1zsgVlJmf5ig9sotGu2xX9CiQeR3Npsqhkg9yTnRc=; b=ntgOfHXHsGro5NMOgP1dagVjS/SUqSpnJo+O2sgWMjh671stVP1/WatAqrnx5HEyIA GEOZagc/MjhwRKjE4+ovLB/EL1JF76BLCxSSMjYusCrcNb7U5OKMi6bJSN1UOyzDlH2y xm/25EO0QEsaTkGQqnoFUonJLJQFSLpTCZyU/L2B7DN6SOBhniWR1MMHG7B9Dg4VahAk MC4feTQtg7JosP79m3XvAFUgtgbKFueRnqLIILObPBDHORB7UHC2GDgmoQPJCi54RvgL wSvT69CqKbFt69CrHg6SjW1ylavxPg+G8witF/01TzgO4O9taE16FvGjsFosRVyBEvhQ 5M9w== X-Received: by 10.112.198.227 with SMTP id jf3mr8898829lbc.69.1366408677050; Fri, 19 Apr 2013 14:57:57 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-86-130.pppoe.mtu-net.ru. [91.79.86.130]) by mx.google.com with ESMTPS id l20sm6509386lbv.9.2013.04.19.14.57.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Apr 2013 14:57:56 -0700 (PDT) To: linux-usb@vger.kernel.org, stern@rowland.harvard.edu, gregkh@linuxfoundation.org Subject: [PATCH v5 2/9] ehci-platform: add pre_setup() method to platform data Cc: linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 20 Apr 2013 01:57:07 +0400 MIME-Version: 1.0 Message-Id: <201304200157.07752.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmmLJ6cVHpRfCy1430KpDWgKo5R0Wqg5T1sLcTAQrvVqAw7nJwbbrHnhiME9OaY3kLtPuiV 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 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 @@ -46,6 +46,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 */