linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time
@ 2011-01-19 20:17 Fabio Estevam
  2011-01-19 20:41 ` Eric Bénard
  2011-01-19 21:32 ` Uwe Kleine-König
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2011-01-19 20:17 UTC (permalink / raw)
  To: linux-arm-kernel

Make sure we are running on a MX35 processor.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/usb/gadget/fsl_mxc_udc.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
index 77b1eb5..c1a65cd 100644
--- a/drivers/usb/gadget/fsl_mxc_udc.c
+++ b/drivers/usb/gadget/fsl_mxc_udc.c
@@ -89,14 +89,17 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
 {
 	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
 #if defined(CONFIG_ARCH_MX35)
-	unsigned int v;
-
-	/* workaround ENGcm09152 for i.MX35 */
-	if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
-		v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
-				USBPHYCTRL_OTGBASE_OFFSET));
-		writel(v | USBPHYCTRL_EVDO, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
-				USBPHYCTRL_OTGBASE_OFFSET));
+	if (cpu_is_mx35()) {
+		unsigned int v;
+
+		/* workaround ENGcm09152 for i.MX35 */
+		if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
+			v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
+					USBPHYCTRL_OTGBASE_OFFSET));
+			writel(v | USBPHYCTRL_EVDO,
+				MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
+					USBPHYCTRL_OTGBASE_OFFSET));
+		}
 	}
 #endif
 
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time
  2011-01-19 20:17 [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time Fabio Estevam
@ 2011-01-19 20:41 ` Eric Bénard
  2011-01-19 21:32 ` Uwe Kleine-König
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Bénard @ 2011-01-19 20:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 19/01/2011 21:17, Fabio Estevam wrote:
> Make sure we are running on a MX35 processor.
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
Acked-by: Eric B?nard <eric@eukrea.com>

> ---
>   drivers/usb/gadget/fsl_mxc_udc.c |   19 +++++++++++--------
>   1 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
> index 77b1eb5..c1a65cd 100644
> --- a/drivers/usb/gadget/fsl_mxc_udc.c
> +++ b/drivers/usb/gadget/fsl_mxc_udc.c
> @@ -89,14 +89,17 @@ void fsl_udc_clk_finalize(struct platform_device *pdev)
>   {
>   	struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
>   #if defined(CONFIG_ARCH_MX35)
> -	unsigned int v;
> -
> -	/* workaround ENGcm09152 for i.MX35 */
> -	if (pdata->workaround&  FLS_USB2_WORKAROUND_ENGCM09152) {
> -		v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
> -				USBPHYCTRL_OTGBASE_OFFSET));
> -		writel(v | USBPHYCTRL_EVDO, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
> -				USBPHYCTRL_OTGBASE_OFFSET));
> +	if (cpu_is_mx35()) {
> +		unsigned int v;
> +
> +		/* workaround ENGcm09152 for i.MX35 */
> +		if (pdata->workaround&  FLS_USB2_WORKAROUND_ENGCM09152) {
> +			v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
> +					USBPHYCTRL_OTGBASE_OFFSET));
> +			writel(v | USBPHYCTRL_EVDO,
> +				MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
> +					USBPHYCTRL_OTGBASE_OFFSET));
> +		}
>   	}
>   #endif
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time
  2011-01-19 20:17 [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time Fabio Estevam
  2011-01-19 20:41 ` Eric Bénard
@ 2011-01-19 21:32 ` Uwe Kleine-König
  2011-01-20  8:20   ` Uwe Kleine-König
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2011-01-19 21:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 19, 2011 at 06:17:03PM -0200, Fabio Estevam wrote:
> Make sure we are running on a MX35 processor.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Looks good, Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time
  2011-01-19 21:32 ` Uwe Kleine-König
@ 2011-01-20  8:20   ` Uwe Kleine-König
  0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2011-01-20  8:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 19, 2011 at 10:32:51PM +0100, Uwe Kleine-K?nig wrote:
> On Wed, Jan 19, 2011 at 06:17:03PM -0200, Fabio Estevam wrote:
> > Make sure we are running on a MX35 processor.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> Looks good, Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
looking again s/CONFIG_ARCH_MX35/CONFIG_SOC_IMX35/ would be nice.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-20  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 20:17 [PATCH v2] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time Fabio Estevam
2011-01-19 20:41 ` Eric Bénard
2011-01-19 21:32 ` Uwe Kleine-König
2011-01-20  8:20   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).