From patchwork Fri Apr 12 23:28:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2439171 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 C1849DF2A1 for ; Fri, 12 Apr 2013 23:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754533Ab3DLX3e (ORCPT ); Fri, 12 Apr 2013 19:29:34 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:55487 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754456Ab3DLX3c (ORCPT ); Fri, 12 Apr 2013 19:29:32 -0400 Received: by mail-la0-f44.google.com with SMTP id fr10so2966169lab.3 for ; Fri, 12 Apr 2013 16:29:31 -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=OZS2BddwylFbTVvnKY9RUTuv6Kwo1S0MK+it8gesAxHrNNcL9T6caYAXbn13Mvu4Qy 22758UgdL4leYVc9leUrMZ7vlpLyOY+Ajclf9SqXXpDbM91PO8bO5m+oTto6gyESezBz 5xutgjhHw8YUOcw3WqPRJgQZlYeaIkNg+56JZlZqkATNkNx4lHU2HpfJVlnWAXZMlhRO StLjIbREkpwKDxw43dxZxJ7LtWARPbiGbSXb8b8z0g5zGHOyuDsEZCuZX7iFH1leBnLj LRGqzmzZVo08MW1cU3x7GEn01rtt6AWcdmOqlvUHRp9qCBnc5f8zQWcUatSwEzFkzWvd Mbrw== X-Received: by 10.112.150.101 with SMTP id uh5mr6373240lbb.92.1365809371162; Fri, 12 Apr 2013 16:29:31 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-80-224.pppoe.mtu-net.ru. [91.79.80.224]) by mx.google.com with ESMTPS id m9sm4046656lbm.3.2013.04.12.16.29.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Apr 2013 16:29:30 -0700 (PDT) To: linux-usb@vger.kernel.org, stern@rowland.harvard.edu, gregkh@linuxfoundation.org Subject: [PATCH v4 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, 13 Apr 2013 03:28:34 +0400 MIME-Version: 1.0 Message-Id: <201304130328.35284.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlpJczgFacCQhv5i6fiyqREJsv2aqcoyvARKlUVNP8yl9/PbcoLqWIqH7Dd4wTHX4jy7C23 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 */