From: Peter Chen <peter.chen@freescale.com>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: r58472@freescale.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, balbi@ti.com, kernel@pengutronix.de,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id
Date: Wed, 16 Jan 2013 09:48:25 +0800 [thread overview]
Message-ID: <20130116014824.GD16514@nchen-desktop> (raw)
In-Reply-To: <20130115140344.GB6574@S2101-09.ap.freescale.net>
On Tue, Jan 15, 2013 at 10:03:46PM +0800, Shawn Guo wrote:
> On Tue, Jan 15, 2013 at 10:29:33AM +0800, Peter Chen wrote:
> > As mach/hardware.h is deleted, we need to use platform_device_id to
> > differentiate SoCs. Besides, one cpu_is_mx35 is useless as it has
> > already used pdata to differentiate runtime
> >
> > Meanwhile we update the platform code accordingly.
> >
> > Signed-off-by: Peter Chen <peter.chen@freescale.com>
> > ---
> > arch/arm/mach-imx/devices/devices-common.h | 1 +
> > arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c | 15 ++++---
> > drivers/usb/gadget/fsl_mxc_udc.c | 24 +++++-------
> > drivers/usb/gadget/fsl_udc_core.c | 42 +++++++++++++--------
> > 4 files changed, 45 insertions(+), 37 deletions(-)
>
> Since we are splitting the original patch anyway, it's a bit strange
> to me that you are mixing arch/arm/mach-imx and drivers/usb/gadget
> in this patch. I'm fine with it, since I assume all the patches to
> go via USB tree anyway.
>
> >
> > diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
> > index 6277baf..9bd5777 100644
> > --- a/arch/arm/mach-imx/devices/devices-common.h
> > +++ b/arch/arm/mach-imx/devices/devices-common.h
> > @@ -63,6 +63,7 @@ struct platform_device *__init imx_add_flexcan(
> >
> > #include <linux/fsl_devices.h>
> > struct imx_fsl_usb2_udc_data {
> > + const char *devid;
> > resource_size_t iobase;
> > resource_size_t irq;
> > };
> > diff --git a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
> > index 37e4439..fb527c7 100644
> > --- a/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
> > +++ b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
> > @@ -11,35 +11,36 @@
> > #include "../hardware.h"
> > #include "devices-common.h"
> >
> > -#define imx_fsl_usb2_udc_data_entry_single(soc) \
> > +#define imx_fsl_usb2_udc_data_entry_single(soc, _devid) \
> > { \
> > + .devid = _devid, \
> > .iobase = soc ## _USB_OTG_BASE_ADDR, \
> > .irq = soc ## _INT_USB_OTG, \
> > }
> >
> > #ifdef CONFIG_SOC_IMX25
> > const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
> > - imx_fsl_usb2_udc_data_entry_single(MX25);
> > + imx_fsl_usb2_udc_data_entry_single(MX25, "imx-udc-mx25");
> > #endif /* ifdef CONFIG_SOC_IMX25 */
> >
> > #ifdef CONFIG_SOC_IMX27
> > const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
> > - imx_fsl_usb2_udc_data_entry_single(MX27);
> > + imx_fsl_usb2_udc_data_entry_single(MX27, "imx-udc-mx27");
> > #endif /* ifdef CONFIG_SOC_IMX27 */
> >
> > #ifdef CONFIG_SOC_IMX31
> > const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst =
> > - imx_fsl_usb2_udc_data_entry_single(MX31);
> > + imx_fsl_usb2_udc_data_entry_single(MX31, "imx-udc-mx31");
> > #endif /* ifdef CONFIG_SOC_IMX31 */
> >
> > #ifdef CONFIG_SOC_IMX35
> > const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data __initconst =
> > - imx_fsl_usb2_udc_data_entry_single(MX35);
> > + imx_fsl_usb2_udc_data_entry_single(MX35, "imx-udc-mx35");
> > #endif /* ifdef CONFIG_SOC_IMX35 */
> >
> > #ifdef CONFIG_SOC_IMX51
> > const struct imx_fsl_usb2_udc_data imx51_fsl_usb2_udc_data __initconst =
> > - imx_fsl_usb2_udc_data_entry_single(MX51);
> > + imx_fsl_usb2_udc_data_entry_single(MX51, "imx-udc-mx51");
> > #endif
> >
> > struct platform_device *__init imx_add_fsl_usb2_udc(
> > @@ -57,7 +58,7 @@ struct platform_device *__init imx_add_fsl_usb2_udc(
> > .flags = IORESOURCE_IRQ,
> > },
> > };
> > - return imx_add_platform_device_dmamask("fsl-usb2-udc", -1,
> > + return imx_add_platform_device_dmamask(data->devid, -1,
> > res, ARRAY_SIZE(res),
> > pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> > }
>
> <snip>
>
> > +static const struct platform_device_id fsl_udc_devtype[] = {
> > + {
> > + .name = "imx-udc-mx25",
> > + }, {
> > + .name = "imx-udc-mx27",
> > + }, {
> > + .name = "imx-udc-mx31",
> > + }, {
> > + .name = "imx-udc-mx35",
> > + }, {
> > + .name = "imx-udc-mx51",
> > + }
> > +};
>
> From what I understand balbi's comment, he dislikes this full list of
> device id. Instead, he prefers to something like below.
>
> static const struct platform_device_id fsl_udc_devtype[] = {
> {
> .name = "imx-udc-mx27",
> }, {
> .name = "imx-udc-mx51",
> }
> };
>
> It basically tells that we are handling two type of devices here, one
> is imx-udc-mx27 type and the other is imx-udc-mx51 type, with mx25/31/35
> completely compatible with mx27 type. We choose mx27 instead of mx25
> to define the type because mx27 Si came out earlier than mx25. That
> said, we generally choose the earlies SoC name to define a particular
> version of IP block, since hardware version is mostly unavailable or
> unreliable.
>
> But that also means in platform code which create the platform_device,
> you will need to use name "imx-udc-mx27" for even mx25/31/35.
>
> imx_fsl_usb2_udc_data_entry_single(MX25, "imx-udc-mx27");
> imx_fsl_usb2_udc_data_entry_single(MX31, "imx-udc-mx27");
> imx_fsl_usb2_udc_data_entry_single(MX35, "imx-udc-mx27");
>
> Considering this is a piece of code we will not use for any new
> hardware, I'm fine with either way.
>
> So, balbi, it's all your call to accept the series as it is or ask for
> another iteration.
Thanks Shawn. Let's see Felipe's comment, nevertheless, I will send v6 patch
due to a compile error at mx25
>
> Shawn
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2013-01-16 1:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 2:29 [PATCH v5 0/3] Fix the Build error for fsl_mxc_udc.c Peter Chen
2013-01-15 2:29 ` [PATCH v5 1/3] usb: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_id Peter Chen
2013-01-15 14:03 ` Shawn Guo
2013-01-16 1:48 ` Peter Chen [this message]
2013-01-17 9:14 ` Felipe Balbi
2013-01-17 9:28 ` Peter Chen
2013-01-17 9:32 ` Felipe Balbi
2013-01-15 2:29 ` [PATCH v5 2/3] usb: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremap Peter Chen
2013-01-15 2:29 ` [PATCH v5 3/3] ARM: i.MX clock: Change the connection-id for fsl-usb2-udc Peter Chen
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=20130116014824.GD16514@nchen-desktop \
--to=peter.chen@freescale.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=r58472@freescale.com \
--cc=shawn.guo@linaro.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 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).