From: daniel@caiaq.de (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG port registration
Date: Tue, 13 Apr 2010 19:30:41 +0200 [thread overview]
Message-ID: <20100413173041.GP30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <1271175030-3635-4-git-send-email-Dinh.Nguyen@freescale.com>
On Tue, Apr 13, 2010 at 11:10:27AM -0500, Dinh.Nguyen at freescale.com wrote:
> 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 ++
> 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,
> +};
This is also board specific, and nothing you should assume for all
boards. Other implementations may do this differntly, which is why
this belongs to board code.
> +/* 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);
> +}
What's the reason for having the _ext variants that are just wrapers?
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Mack <daniel@caiaq.de>
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, bryan.wu@canonical.com,
valentin.longchamp@epfl.ch
Subject: Re: [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG port registration
Date: Tue, 13 Apr 2010 19:30:41 +0200 [thread overview]
Message-ID: <20100413173041.GP30801@buzzloop.caiaq.de> (raw)
In-Reply-To: <1271175030-3635-4-git-send-email-Dinh.Nguyen@freescale.com>
On Tue, Apr 13, 2010 at 11:10:27AM -0500, Dinh.Nguyen@freescale.com wrote:
> 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 ++
> 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,
> +};
This is also board specific, and nothing you should assume for all
boards. Other implementations may do this differntly, which is why
this belongs to board code.
> +/* 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);
> +}
What's the reason for having the _ext variants that are just wrapers?
next prev parent reply other threads:[~2010-04-13 17:30 UTC|newest]
Thread overview: 50+ 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 at freescale.com
2010-04-13 16:10 ` 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 at freescale.com
2010-04-13 16:10 ` 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 at freescale.com
2010-04-13 16:10 ` Dinh.Nguyen
2010-04-13 16:10 ` [PATCH 2.6.34-rc4 4/8] mx5: Add USB OTG port registration Dinh.Nguyen at freescale.com
2010-04-13 16:10 ` Dinh.Nguyen
2010-04-13 16:10 ` [PATCH 2.6.34-rc4 5/8] mx5: Add USB Host1 " Dinh.Nguyen at freescale.com
2010-04-13 16:10 ` Dinh.Nguyen
2010-04-13 16:10 ` [PATCH 2.6.34-rc4 6/8] mx5: Add USB support for Freescale MX51 Babbage Dinh.Nguyen at freescale.com
2010-04-13 16:10 ` Dinh.Nguyen
2010-04-13 16:10 ` [PATCH 2.6.34-rc4 7/8] mx5: Add USB to " Dinh.Nguyen at freescale.com
2010-04-13 16:10 ` Dinh.Nguyen
2010-04-14 6:33 ` Bryan Wu
2010-04-14 6:33 ` Bryan Wu
2010-04-15 4:33 ` Nguyen Dinh-R00091
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-13 17:40 ` Daniel Mack
2010-04-14 6:20 ` Bryan Wu
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:39 ` Daniel Mack
2010-04-13 17:30 ` Daniel Mack [this message]
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
2010-04-14 6:58 ` Bryan Wu
2010-04-14 7:30 ` Daniel Mack
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 17:27 ` 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-13 16:48 ` Daniel Mack
2010-04-14 6:34 ` Sascha Hauer
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 16:45 ` Daniel Mack
2010-04-13 19:36 ` Nguyen Dinh-R00091
2010-04-13 19:36 ` Nguyen Dinh-R00091
2010-04-14 6:51 ` Sascha Hauer
2010-04-14 6:51 ` Sascha Hauer
2010-04-14 7:31 ` Daniel Mack
2010-04-14 7:31 ` Daniel Mack
2010-04-14 7:37 ` Sascha Hauer
2010-04-14 7:37 ` Sascha Hauer
2010-04-13 17:20 ` Sascha Hauer
2010-04-13 17:20 ` Sascha Hauer
2010-04-13 19:44 ` Russell King - ARM Linux
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=20100413173041.GP30801@buzzloop.caiaq.de \
--to=daniel@caiaq.de \
--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.