public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu@canonical.com>
To: Dinh.Nguyen@freescale.com
Cc: linux-kernel@vger.kernel.org, amit.kucheria@canonical.com,
	linux@arm.linux.org.uk, s.hauer@pengutronix.de,
	grant.likely@secretlab.ca, r.herring@freescale.com,
	linux-arm-kernel@lists.infradead.org, daniel@caiaq.de,
	valentin.longchamp@epfl.ch
Subject: Re: [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG port registration
Date: Tue, 13 Apr 2010 23:58:04 -0700	[thread overview]
Message-ID: <4BC5677C.6010507@canonical.com> (raw)
In-Reply-To: <1271175030-3635-4-git-send-email-Dinh.Nguyen@freescale.com>

On 04/13/2010 09:10 AM, Dinh.Nguyen@freescale.com wrote:
> From: Dinh Nguyen<Dinh.Nguyen@freescale.com>
>
> This patch adds the device platform registration for enabling USB
> host functionality on the OTG port on Freescale MX51 Babbage HW. This
> file makes platform specific calls to initialize the USB HW.
>
> This patch applies to 2.6.34-rc4.
>
> Signed-off-by: Dinh Nguyen<Dinh.Nguyen@freescale.com>
> ---
>   arch/arm/mach-mx5/Makefile             |    2 +-
>   arch/arm/mach-mx5/board-mx51_babbage.c |    4 ++

Agree with Daniel here, this patch should be split into 2 parts, a) for usb_dr.c 
and Makefile, b) for board-mx51_babbage.c change.

And one more suggestion is merge usb_dr.c and usb_h1.c as one file usb.c. It is 
more simple to maintain and review.

-Bryan

>   arch/arm/mach-mx5/usb_dr.c             |   57 ++++++++++++++++++++++++++++++++
>   3 files changed, 62 insertions(+), 1 deletions(-)
>   create mode 100644 arch/arm/mach-mx5/usb_dr.c
>
> diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
> index bf23f86..3fca1f1 100644
> --- a/arch/arm/mach-mx5/Makefile
> +++ b/arch/arm/mach-mx5/Makefile
> @@ -3,7 +3,7 @@
>   #
>
>   # Object file lists.
> -obj-y   := cpu.o mm.o clock-mx51.o devices.o
> +obj-y   := cpu.o mm.o clock-mx51.o devices.o usb_dr.o
>
>   obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
>
> diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
> index afbe400..4e196d7 100644
> --- a/arch/arm/mach-mx5/board-mx51_babbage.c
> +++ b/arch/arm/mach-mx5/board-mx51_babbage.c
> @@ -27,6 +27,8 @@
>
>   #include "devices.h"
>
> +extern void __init mx5_usb_dr_init(void);
> +
>   static struct platform_device *devices[] __initdata = {
>   	&mxc_fec_device,
>   };
> @@ -78,6 +80,8 @@ static void __init mxc_board_init(void)
>   	platform_add_devices(devices, ARRAY_SIZE(devices));
>
>   	mxc_register_gpios();
> +
> +	mx5_usb_dr_init();
>   }
>
>   static void __init mx51_babbage_timer_init(void)
> diff --git a/arch/arm/mach-mx5/usb_dr.c b/arch/arm/mach-mx5/usb_dr.c
> new file mode 100644
> index 0000000..52273ea
> --- /dev/null
> +++ b/arch/arm/mach-mx5/usb_dr.c
> @@ -0,0 +1,57 @@
> +/*
> + * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * 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 for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301, USA.
> + */
> +
> +#include<linux/platform_device.h>
> +#include<mach/mxc_ehci.h>
> +#include<mach/common.h>
> +#include "devices.h"
> +
> +extern int usbotg_init(struct platform_device *pdev);
> +extern int usbotg_uninit(struct platform_device *pdev);
> +
> +static int usbotg_init_ext(struct platform_device *pdev);
> +static int usbotg_uninit_ext(struct platform_device *pdev);
> +
> +/*
> + * platform data structs
> + * 	- Which one to use is determined by CONFIG options in usb.h
> + * 	- operating_mode plugged at run time
> + */
> +static struct mxc_usbh_platform_data dr_utmi_config = {
> +	.init	= usbotg_init_ext,
> +	.exit	= usbotg_uninit_ext,
> +	.portsc	= MXC_EHCI_UTMI_16BIT,
> +	.flags	= MXC_EHCI_INTERNAL_PHY,
> +};
> +
> +/* Notes: configure USB clock*/
> +static int usbotg_init_ext(struct platform_device *pdev)
> +{
> +	return usbotg_init(pdev);
> +}
> +
> +static int usbotg_uninit_ext(struct platform_device *pdev)
> +{
> +	return usbotg_uninit(pdev);
> +}
> +
> +void __init mx5_usb_dr_init(void)
> +{
> +	mxc_register_device(&mxc_usbdr_host_device,&dr_utmi_config);
> +}


  parent reply	other threads:[~2010-04-14  6:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 16:10 [PATCH 2.6.34-rc4 1/8] mx5: Add registration of GPIOs for MX51 Babbage board Dinh.Nguyen
2010-04-13 16:10 ` [PATCH 2.6.34-rc4 2/8] mxc: Update GPIO for USB support on Freescale MX51 Babbage HW Dinh.Nguyen
2010-04-13 16:10   ` [PATCH 2.6.34-rc4 3/8] mxc: Add platform specific USB functions for Freescale MX51 HW Dinh.Nguyen
2010-04-13 16:10     ` [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG port registration Dinh.Nguyen
2010-04-13 16:10       ` [PATCH 2.6.34-rc4 5/8] mx5: Add USB Host1 " Dinh.Nguyen
2010-04-13 16:10         ` [PATCH 2.6.34-rc4 6/8] mx5: Add USB support for Freescale MX51 Babbage Dinh.Nguyen
2010-04-13 16:10           ` [PATCH 2.6.34-rc4 7/8] mx5: Add USB to " Dinh.Nguyen
2010-04-14  6:33             ` Bryan Wu
2010-04-15  4:33               ` Nguyen Dinh-R00091
2010-04-13 17:40           ` [PATCH 2.6.34-rc4 6/8] mx5: Add USB support for " Daniel Mack
2010-04-14  6:20           ` Bryan Wu
2010-04-13 17:39         ` [PATCH 2.6.34-rc4 5/8] mx5: Add USB Host1 port registration Daniel Mack
2010-04-13 17:30       ` [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG " Daniel Mack
2010-04-14  6:58       ` Bryan Wu [this message]
2010-04-14  7:30         ` Daniel Mack
2010-04-13 17:27     ` [PATCH 2.6.34-rc4 3/8] mxc: Add platform specific USB functions for Freescale MX51 HW Daniel Mack
2010-04-13 16:48   ` [PATCH 2.6.34-rc4 2/8] mxc: Update GPIO for USB support on Freescale MX51 Babbage HW Daniel Mack
2010-04-14  6:34   ` Sascha Hauer
2010-04-13 16:45 ` [PATCH 2.6.34-rc4 1/8] mx5: Add registration of GPIOs for MX51 Babbage board Daniel Mack
2010-04-13 19:36   ` Nguyen Dinh-R00091
2010-04-14  6:51     ` Sascha Hauer
2010-04-14  7:31       ` Daniel Mack
2010-04-14  7:37         ` Sascha Hauer
2010-04-13 17:20 ` Sascha Hauer
2010-04-13 19:44 ` Russell King - ARM Linux

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=4BC5677C.6010507@canonical.com \
    --to=bryan.wu@canonical.com \
    --cc=Dinh.Nguyen@freescale.com \
    --cc=amit.kucheria@canonical.com \
    --cc=daniel@caiaq.de \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=r.herring@freescale.com \
    --cc=s.hauer@pengutronix.de \
    --cc=valentin.longchamp@epfl.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox