From patchwork Mon Apr 8 21:20:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2411621 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 75627DFB78 for ; Mon, 8 Apr 2013 21:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935961Ab3DHVVH (ORCPT ); Mon, 8 Apr 2013 17:21:07 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:45629 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936100Ab3DHVVG (ORCPT ); Mon, 8 Apr 2013 17:21:06 -0400 Received: by mail-lb0-f179.google.com with SMTP id t1so6085287lbd.24 for ; Mon, 08 Apr 2013 14:21:04 -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=mloXGjyUjaRnta5pXTPMK1a7xnpPFeiMfS+zg8o3nlA=; b=Fr6Fv7gCs8hljnjBi7mj3fLTMbDTDOp8PYKTBA4/BZPsEzYHElu8V6yzEgnOi/u9Hb DxLlFF76bfLhMqep4DGBMICe5jW+WtoetIFrQhOYrjHVw0Q282O8mihCQE6Wp+i63gFk u4xq4Omd0hu2quzmNkgEgCC6Crrq5ct8GE8YcRFDvZej7AjaIxqWCsYe6Ooz+dwl65VU 2qGvF5EmAuLb6L3htnFGwrFZ7jqtp4RybOA0dpKVgwL4vjczr6UFuZiIEU1MeTAWMfOr WbSa8iiy2FWrx/f3S+0IEMY2S2HHUc05TsjWD51Rm1adc8GALSuNZSJ8aq5FSGLoaCfB dGRw== X-Received: by 10.112.173.70 with SMTP id bi6mr4014508lbc.116.1365456063981; Mon, 08 Apr 2013 14:21:03 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-99-249.pppoe.mtu-net.ru. [91.79.99.249]) by mx.google.com with ESMTPS id c7sm11365947lbe.6.2013.04.08.14.21.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 08 Apr 2013 14:21:03 -0700 (PDT) To: linux-usb@vger.kernel.org, stern@rowland.harvard.edu, gregkh@linuxfoundation.org Subject: [PATCH v2 2/9] ehci-platform: add pre_setup() method to platform data Cc: linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Tue, 9 Apr 2013 01:20:00 +0400 MIME-Version: 1.0 Message-Id: <201304090120.00626.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQkDnkHZ03Pb3tpkjW39tTjbOfTbj2PkE/4o7GjJeCPtVe7uqxvrcCC2KrDtsjI/HEM3mVBm 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... Suggested-by: Alan Stern Signed-off-by: Sergei Shtylyov --- Changes since the original posting: - changed init() method to pre_setup() with different parameters abd call site. drivers/usb/host/ehci-platform.c | 6 ++++++ include/linux/usb/ehci_pdriver.h | 3 +++ 2 files changed, 9 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,8 @@ #ifndef __USB_CORE_EHCI_PDRIVER_H #define __USB_CORE_EHCI_PDRIVER_H +#include + /** * struct usb_ehci_pdata - platform_data for generic ehci driver * @@ -50,6 +52,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 */