From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time
Date: Wed, 19 Jan 2011 16:36:46 +0100 [thread overview]
Message-ID: <4D37050E.6010009@eukrea.com> (raw)
In-Reply-To: <1295451164-3363-1-git-send-email-fabio.estevam@freescale.com>
Hi Fabio,
On 19/01/2011 16:32, Fabio Estevam wrote:
> Instead of checking the CPU type in build-time, do it in run-time.
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
> drivers/usb/gadget/fsl_mxc_udc.c | 23 ++++++++++++-----------
> 1 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
> index 77b1eb5..167abe0 100644
> --- a/drivers/usb/gadget/fsl_mxc_udc.c
> +++ b/drivers/usb/gadget/fsl_mxc_udc.c
> @@ -88,17 +88,18 @@ eenahb:
> 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));
> - }
> -#endif
> + 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));
> + }
> + }
>
are you sure this compiles when MX35 is not selected ?
Eric
next prev parent reply other threads:[~2011-01-19 15:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 15:32 [PATCH] usb: gadget/fsl_mxc_udc: Detect the CPU type in run-time Fabio Estevam
2011-01-19 15:36 ` Eric Bénard [this message]
2011-01-19 16:08 ` Fabio Estevam
2011-01-19 17:09 ` Fabio Estevam
2011-01-19 18:54 ` Uwe Kleine-König
2011-01-19 20:07 ` 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=4D37050E.6010009@eukrea.com \
--to=eric@eukrea.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox