From patchwork Thu Apr 4 22:59:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2395361 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2FE003FD1A for ; Thu, 4 Apr 2013 23:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763190Ab3DDXBH (ORCPT ); Thu, 4 Apr 2013 19:01:07 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:51834 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763052Ab3DDXBG (ORCPT ); Thu, 4 Apr 2013 19:01:06 -0400 Received: by mail-lb0-f181.google.com with SMTP id r11so3205093lbv.40 for ; Thu, 04 Apr 2013 16:01: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:from:organization:cc:date:mime-version :content-type:content-transfer-encoding:message-id :x-gm-message-state; bh=TQh43ruzsIMusGLqWyFkleJs0ayvXADHEbFYS7RR8jM=; b=KRyWyY8121W+MsysATp7V7VvkENvp7k0aIvba8DMlCPZlsnKcw2r/Sa247khOnII13 bofwFHYJF61hEEjSq3Ur7DcpTFCKQ3REeuMDSEm5gzn1KUEWfP9z5YEDhNJCFDPElfeG mhNpYyWNTMghDTuPJqGxPJMGoZe1Cd+cV65cH2g757Q/bxEoO7Q5bf4L88KvMW86Xk3K jJztReJzbTkRxtkaWki+TDI2+vqgc406+G2w9ooYGK43o/NXeTKJA0V29kX+UHFQf4Hd Yr9oL335ke2uAz8/NouF4xums+GoSU+hOYpidgE5K13+ObnE5aXyMc6gqaM3pKBelS0+ oJ8g== X-Received: by 10.112.199.104 with SMTP id jj8mr974379lbc.20.1365116463977; Thu, 04 Apr 2013 16:01:03 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-79-100-82.pppoe.mtu-net.ru. [91.79.100.82]) by mx.google.com with ESMTPS id t17sm4743712lam.9.2013.04.04.16.01.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Apr 2013 16:01:02 -0700 (PDT) To: linux-usb@vger.kernel.org, stern@rowland.harvard.edu, gregkh@linuxfoundation.org Subject: [PATCH 2/8] ehci-platform: add init() method to platform data From: Sergei Shtylyov Organization: Cogent Embedded Cc: linux-sh@vger.kernel.org Date: Fri, 5 Apr 2013 02:59:50 +0400 MIME-Version: 1.0 Message-Id: <201304050259.51025.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQnoV74nEsrTIwDmqqRg2UBcSofVrnMfR+zfxDGq89JF/4BVr3dYJYOGYLTT6vbaXSYnrFTI 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 the init() method to the 'ehci-platform' platform data for this purpose. Suggested-by: Kuninori Morimoto Signed-off-by: Sergei Shtylyov --- drivers/usb/host/ehci-platform.c | 7 +++++++ include/linux/usb/ehci_pdriver.h | 1 + 2 files changed, 8 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 @@ -110,6 +110,13 @@ static int ehci_platform_probe(struct pl err = PTR_ERR(hcd->regs); goto err_put_hcd; } + + if (pdata->init) { + err = pdata->init(dev, hcd->regs); + if (err < 0) + goto err_put_hcd; + } + err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) goto err_put_hcd; Index: renesas/include/linux/usb/ehci_pdriver.h =================================================================== --- renesas.orig/include/linux/usb/ehci_pdriver.h +++ renesas/include/linux/usb/ehci_pdriver.h @@ -50,6 +50,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 (*init)(struct platform_device *pdev, void __iomem *regs); }; #endif /* __USB_CORE_EHCI_PDRIVER_H */