All of lore.kernel.org
 help / color / mirror / Atom feed
From: grinberg@compulab.co.il (Igor Grinberg)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: mx3/mx35_3ds: Add USB OTG Host mode
Date: Wed, 22 Dec 2010 09:03:06 +0200	[thread overview]
Message-ID: <4D11A2AA.80300@compulab.co.il> (raw)
In-Reply-To: <1292961521-31539-1-git-send-email-fabio.estevam@freescale.com>

Hi Fabio,

On 12/21/10 21:58, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  arch/arm/mach-mx3/Kconfig         |    1 +
>  arch/arm/mach-mx3/mach-mx35_3ds.c |   34 ++++++++++++++++++++++++++++++++--
>  2 files changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
> index 9037c4e..f474e2e 100644
> --- a/arch/arm/mach-mx3/Kconfig
> +++ b/arch/arm/mach-mx3/Kconfig
> @@ -185,6 +185,7 @@ config MACH_MX35_3DS
>  	select IMX_HAVE_PLATFORM_MXC_EHCI
>  	select IMX_HAVE_PLATFORM_MXC_NAND
>  	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
> +	select MXC_ULPI if USB_ULPI
>  	help
>  	  Include support for MX35PDK platform. This includes specific
>  	  configurations for the board and its peripherals.
> diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c
> index 8bd8992..3cb4f5c 100644
> --- a/arch/arm/mach-mx3/mach-mx35_3ds.c
> +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c
> @@ -26,6 +26,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/memory.h>
>  #include <linux/gpio.h>
> +#include <linux/usb/otg.h>
> +#include <linux/usb/ulpi.h>
>  
>  #include <linux/mtd/physmap.h>
>  
> @@ -39,6 +41,7 @@
>  #include <mach/iomux-mx35.h>
>  #include <mach/irqs.h>
>  #include <mach/3ds_debugboard.h>
> +#include <mach/ulpi.h>
>  
>  #include "devices-imx35.h"
>  #include "devices.h"
> @@ -125,12 +128,34 @@ static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = {
>  	.phy_mode	= FSL_USB2_PHY_UTMI_WIDE,
>  };
>  
> +#if defined(CONFIG_USB_ULPI)
> +static struct mxc_usbh_platform_data otg_pdata __initdata = {
> +	.portsc	= MXC_EHCI_MODE_UTMI,
> +	.flags	= MXC_EHCI_INTERNAL_PHY,
> +};
> +

I don't know much about mx3, but the above looks confusing. A typo?

>  /* USB HOST config */
>  static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
>  	.portsc		= MXC_EHCI_MODE_SERIAL,
>  	.flags		= MXC_EHCI_INTERFACE_SINGLE_UNI |
>  			  MXC_EHCI_INTERNAL_PHY,
>  };
> +#endif
> +
> +static int otg_mode_host;
> +
> +static int __init mx35_3ds_otg_mode(char *options)
> +{
> +	if (!strcmp(options, "host"))
> +		otg_mode_host = 1;
> +	else if (!strcmp(options, "device"))
> +		otg_mode_host = 0;
> +	else
> +		pr_info("otg_mode neither \"host\" nor \"device\". "
> +			"Defaulting to device\n");
> +	return 0;
> +}
> +__setup("otg_mode=", mx35_3ds_otg_mode);
>  
>  /*
>   * Board specific initialization.
> @@ -144,10 +169,15 @@ static void __init mxc_board_init(void)
>  	platform_add_devices(devices, ARRAY_SIZE(devices));
>  
>  	imx35_add_imx_uart0(&uart_pdata);
> -
> -	imx35_add_fsl_usb2_udc(&usb_otg_pdata);
> +
> +#if defined(CONFIG_USB_ULPI)
> +	if (otg_mode_host)
> +		imx35_add_mxc_ehci_otg(&otg_pdata);
>  
>  	imx35_add_mxc_ehci_hs(&usb_host_pdata);
> +#endif
> +	if (!otg_mode_host)
> +		imx35_add_fsl_usb2_udc(&usb_otg_pdata);
>  
>  	imx35_add_mxc_nand(&mx35pdk_nand_board_info);
>  	imx35_add_sdhci_esdhc_imx(0, NULL);

-- 
Regards,
Igor.

  parent reply	other threads:[~2010-12-22  7:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 19:58 [PATCH 1/3] ARM: mx3/mx35_3ds: Add USB OTG Host mode Fabio Estevam
2010-12-21 19:58 ` [PATCH 2/3] ARM: imx/mx27_3ds: Add USB OTG support Fabio Estevam
2010-12-21 19:58   ` [PATCH 3/3] ARM: imx/mx25_3ds: Add USB support Fabio Estevam
2010-12-22  7:06     ` Igor Grinberg
2010-12-22  7:03 ` Igor Grinberg [this message]
2010-12-22 13:25   ` [PATCH 1/3] ARM: mx3/mx35_3ds: Add USB OTG Host mode Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D11A2AA.80300@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.