Re: [PATCH V9 02/10] USB/ppc4xx: Add Synopsys DWC OTG driver framework

2011-02-07 Thread Alexander Gordeev
В Mon,  7 Feb 2011 14:53:40 -0800
tma...@apm.com пишет:

> From: Tirumala Marri 
> 
> Platform probing is in dwc_otg_apmppc.c.
> Driver parameter and parameter checking are in dwc_otg_param.c.

You renamed all files but old names are still used here.

> Signed-off-by: Tirumala R Marri 
> Signed-off-by: Fushen Chen 
> Signed-off-by: Mark Miesfeld 
> ---
[snip]


-- 
  Alexander


signature.asc
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH V9 02/10] USB/ppc4xx: Add Synopsys DWC OTG driver framework

2011-02-07 Thread tmarri
From: Tirumala Marri 

Platform probing is in dwc_otg_apmppc.c.
Driver parameter and parameter checking are in dwc_otg_param.c.

Signed-off-by: Tirumala R Marri 
Signed-off-by: Fushen Chen 
Signed-off-by: Mark Miesfeld 
---
 drivers/usb/otg/dwc/apmppc.c |  414 ++
 drivers/usb/otg/dwc/driver.h |   76 
 drivers/usb/otg/dwc/param.c  |  180 ++
 3 files changed, 670 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/otg/dwc/apmppc.c b/drivers/usb/otg/dwc/apmppc.c
new file mode 100644
index 000..f5cfebd
--- /dev/null
+++ b/drivers/usb/otg/dwc/apmppc.c
@@ -0,0 +1,414 @@
+/*
+ * DesignWare HS OTG controller driver
+ * Copyright (C) 2006 Synopsys, Inc.
+ * Portions Copyright (C) 2010 Applied Micro Circuits Corporation.
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License version 2 for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see http://www.gnu.org/licenses
+ * or write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Suite 500, Boston, MA 02110-1335 USA.
+ *
+ * Based on Synopsys driver version 2.60a
+ * Modified by Mark Miesfeld 
+ * Modified by Stefan Roese , DENX Software Engineering
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL SYNOPSYS, INC. BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * The dwc_otg module provides the initialization and cleanup entry
+ * points for the dwcotg driver. This module will be dynamically installed
+ * after Linux is booted using the insmod command. When the module is
+ * installed, the dwc_otg_driver_init function is called. When the module is
+ * removed (using rmmod), the dwc_otg_driver_cleanup function is called.
+ *
+ * This module also defines a data structure for the dwc_otg driver, which is
+ * used in conjunction with the standard device structure. These
+ * structures allow the OTG driver to comply with the standard Linux driver
+ * model in which devices and drivers are registered with a bus driver. This
+ * has the benefit that Linux can expose attributes of the driver and device
+ * in its special sysfs file system. Users can then read or write files in
+ * this file system to perform diagnostics on the driver components or the
+ * device.
+ */
+
+#include 
+
+#include "driver.h"
+
+#define DWC_DRIVER_VERSION "1.05"
+#define DWC_DRIVER_DESC"HS OTG USB Controller driver"
+static const char dwc_driver_name[] = "dwc_otg";
+
+/**
+ * This function is the top level interrupt handler for the Common
+ * (Device and host modes) interrupts.
+ */
+static irqreturn_t dwc_otg_common_irq(int _irq, void *dev)
+{
+   struct dwc_otg_device *dwc_dev = dev;
+   int retval;
+
+   retval = dwc_otg_handle_common_intr(dwc_dev->core_if);
+   return IRQ_RETVAL(retval);
+}
+
+/**
+ * This function is the interrupt handler for the OverCurrent condition
+ * from the external charge pump (if enabled)
+ */
+static irqreturn_t dwc_otg_externalchgpump_irq(int _irq, void *dev)
+{
+   struct dwc_otg_device *dwc_dev = dev;
+
+   if (dwc_otg_is_host_mode(dwc_dev->core_if)) {
+   struct dwc_hcd *dwc_hcd;
+   u32 hprt0 = 0;
+
+   dwc_hcd = dwc_dev->hcd;
+   spin_lock(&dwc_hcd->lock);
+   dwc_hcd->flags.b.port_over_current_change = 1;
+
+   hprt0 = DWC_HPRT0_PRT_PWR_RW(hprt0, 0);
+   dwc_write32(dwc_dev->core_if->host_if->hprt0, hprt0);
+   spin_unlock(&dwc_hcd->lock);
+   } else {
+   /* Device mode - This int is n/a for device mode */
+   dev_dbg(dev, "DeviceMode: OTG OverCurrent Detected\n");
+   }
+
+   return IRQ_HANDLED;
+}
+
+/**
+ * This function is called when a device is unregistered with the
+ * dwc_otg_driver. This happens, for example, when the rmmod command is
+ * executed. The device may or may not