public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: fabio.estevam@freescale.com (Fabio Estevam)
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 15:09:15 -0200	[thread overview]
Message-ID: <4D371ABB.7000608@freescale.com> (raw)
In-Reply-To: <4D37050E.6010009@eukrea.com>

On 1/19/2011 1:36 PM, Eric B?nard wrote:
> 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 ?

Including #include <mach/mx35.h> fixes the build for a non- mx35 kernel.

Would this be acceptable? If so, I can send v2.

Regards,

Fabio Estevam

  parent reply	other threads:[~2011-01-19 17:09 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
2011-01-19 16:08   ` Fabio Estevam
2011-01-19 17:09   ` Fabio Estevam [this message]
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=4D371ABB.7000608@freescale.com \
    --to=fabio.estevam@freescale.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