From patchwork Sun Feb 10 18:58:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 14719 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 801D723DEA for ; Sun, 10 Feb 2013 18:59:25 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id 242ECA19547 for ; Sun, 10 Feb 2013 18:59:25 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so4517911veb.19 for ; Sun, 10 Feb 2013 10:59:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=TpXiBPZmSY2qQOi5qb3ge1f1+HdUECrD+cQkknIr+tQ=; b=cXj3w1jsnFvFw9SRK3nQ/UFIqZITtw9i1JgFFYceH9Eec3k/dmN/ahj9vcrYEIqn+X mi3ZssU3NGmiAWJ1Kwb+jdTGI+B+B0CurQQYR4tcEpeW/eLD9LJi1Vs7YoJTzRJnlXuZ vGmuqmUE4U14y2xHMV3MJKjqRfkaOVpPc7EtRBkS8WXn6X/K/hHtpUP3kQg8MoiCbzO0 udmxzS2YPWa6taTgIYCDRMRNk7Bi3Xd2WwtXU3QpV5k/a6GzrxgIR/VFPprcBbbUejLx DdRgr31KpHj9bcMKLqNj3W1wTnyc4K0ZT6OnAnERdJ7g/dT+aOvVfS7eq81pNPA/C0bP O75Q== X-Received: by 10.220.151.141 with SMTP id c13mr15986175vcw.64.1360522764586; Sun, 10 Feb 2013 10:59:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp63544vec; Sun, 10 Feb 2013 10:59:23 -0800 (PST) X-Received: by 10.68.116.197 with SMTP id jy5mr12890307pbb.1.1360522763584; Sun, 10 Feb 2013 10:59:23 -0800 (PST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id bf6si47953540pab.228.2013.02.10.10.59.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Feb 2013 10:59:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) smtp.mail=manjunath.goudar@linaro.org Received: by mail-pa0-f48.google.com with SMTP id hz10so2730881pad.35 for ; Sun, 10 Feb 2013 10:59:23 -0800 (PST) X-Received: by 10.68.135.137 with SMTP id ps9mr13008629pbb.153.1360522763187; Sun, 10 Feb 2013 10:59:23 -0800 (PST) Received: from localhost.localdomain ([223.239.146.70]) by mx.google.com with ESMTPS id p6sm5157070pbc.39.2013.02.10.10.59.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Feb 2013 10:59:22 -0800 (PST) From: manjunath.goudar@linaro.org To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, gregkh@linuxfoundation.org, Manjunath Goudar , Greg KH , Tony Prisk , Alexey Charkov , linux-kernel@vger.kernel.org Subject: [PATCH 5/8] USB: EHCI: make ehci-vt8500 a separate driver Date: Mon, 11 Feb 2013 00:28:14 +0530 Message-Id: <5117ee0a.860e440a.097c.351c@mx.google.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360522697-22902-1-git-send-email-y> References: <1360522697-22902-1-git-send-email-y> X-Gm-Message-State: ALoCoQlAJKY+5vAQL+GGRCQWSO72O3mbm1uuij2DrQjNh5bS63iQpSbHYDPEMwvTJT21fvV7QTfo From: Manjunath Goudar Separate the vt8500 host controller driver from ehci-hcd host code into its own driver module. Signed-off-by: Manjunath Goudar Cc: Greg KH Cc: Alan Stern Cc: Tony Prisk Cc: Alexey Charkov Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/host/Kconfig | 8 +++++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 5 --- drivers/usb/host/ehci-vt8500.c | 73 ++++++++++++++++++---------------------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 2aa4ece..4e15b87 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP Enables support for the on-chip EHCI controller on OMAP3 and later chips. +config USB_EHCI_HCD_VT8500 + tristate "Support for VT8500 on-chip EHCI USB controller" + depends on USB_EHCI_HCD && ARCH_VT8500 + default y + ---help--- + Enables support for the on-chip EHCI controller on + VT8500 chips. + config USB_EHCI_HCD_SPEAR tristate "Support for ST SPEAr on-chip EHCI USB controller" depends on USB_EHCI_HCD && PLAT_SPEAR diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index d593017..1fe0579 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o +obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index d133f6d..3dacac0 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1287,11 +1287,6 @@ MODULE_LICENSE ("GPL"); #define PLATFORM_DRIVER ehci_octeon_driver #endif -#ifdef CONFIG_ARCH_VT8500 -#include "ehci-vt8500.c" -#define PLATFORM_DRIVER vt8500_ehci_driver -#endif - #ifdef CONFIG_USB_EHCI_MSM #include "ehci-msm.c" #define PLATFORM_DRIVER ehci_msm_driver diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c index 11695d5..98d65bd 100644 --- a/drivers/usb/host/ehci-vt8500.c +++ b/drivers/usb/host/ehci-vt8500.c @@ -16,52 +16,25 @@ * */ +#include +#include +#include +#include +#include +#include #include #include -static const struct hc_driver vt8500_ehci_hc_driver = { - .description = hcd_name, - .product_desc = "VT8500 EHCI", - .hcd_priv_size = sizeof(struct ehci_hcd), +#include "ehci.h" - /* - * generic hardware linkage - */ - .irq = ehci_irq, - .flags = HCD_MEMORY | HCD_USB2, - - /* - * basic lifecycle operations - */ - .reset = ehci_setup, - .start = ehci_run, - .stop = ehci_stop, - .shutdown = ehci_shutdown, +#define DRIVER_DESC "vt8500 On-Chip EHCI Host driver" - /* - * managing i/o requests and associated device resources - */ - .urb_enqueue = ehci_urb_enqueue, - .urb_dequeue = ehci_urb_dequeue, - .endpoint_disable = ehci_endpoint_disable, - .endpoint_reset = ehci_endpoint_reset, +static const char hcd_name[] = "ehci-vt8500"; - /* - * scheduling support - */ - .get_frame_number = ehci_get_frame, +static struct hc_driver __read_mostly vt8500_ehci_hc_driver; - /* - * root hub support - */ - .hub_status_data = ehci_hub_status_data, - .hub_control = ehci_hub_control, - .bus_suspend = ehci_bus_suspend, - .bus_resume = ehci_bus_resume, - .relinquish_port = ehci_relinquish_port, - .port_handed_over = ehci_port_handed_over, - - .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, +static const struct ehci_driver_overrides ehci_vt8500_overrides __initdata = { + .reset = ehci_setup, }; static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32); @@ -140,11 +113,31 @@ static struct platform_driver vt8500_ehci_driver = { .remove = vt8500_ehci_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { - .name = "vt8500-ehci", + .name = hcd_name, .owner = THIS_MODULE, .of_match_table = of_match_ptr(vt8500_ehci_ids), } }; +static int __init ehci_vt8500_init(void) +{ + if (usb_disabled()) + return -ENODEV; + + pr_info("%s: " DRIVER_DESC "\n", hcd_name); + ehci_init_driver(&vt8500_ehci_hc_driver, &ehci_vt8500_overrides); + return platform_driver_register(&vt8500_ehci_driver); +} +module_init(ehci_vt8500_init); + +static void __exit ehci_vt8500_cleanup(void) +{ + platform_driver_unregister(&vt8500_ehci_driver); +} +module_exit(ehci_vt8500_cleanup); + +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_AUTHOR("Alexey Charkov"); +MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:vt8500-ehci"); MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);