[U-Boot] [u-boot V4] spi/arm-pl022: Add support for ARM PL022 spi controller

Jagan Teki jagannadh.teki at gmail.com
Wed Jun 12 14:34:39 CEST 2013


On Wed, Jun 12, 2013 at 5:48 PM, Armando Visconti
<armando.visconti at st.com> wrote:
> Hello Jagan,
>
>
>>>>
>>>>> +
>>>>> +/*
>>>>> + * ARM PL022 exists in different 'flavors'.
>>>>> + * This drivers currently support the standard variant (0x00041022),
>>>>> that has a
>>>>> + * 16bit wide and 8 locations deep TX/RX FIFO.
>>>>> + */
>>>>> +static int pl022_is_supported(struct pl022_spi_slave *ps)
>>>>> +{
>>>>> +       struct pl022 *pl022 = (struct pl022 *)ps->regs;
>>>>> +
>>>>> +       /* PL022 version is 0x00041022 */
>>>>> +       if ((readl(&pl022->ssp_pid0) == 0x22) &&
>>>>> +           (readl(&pl022->ssp_pid1) == 0x10) &&
>>>>> +           ((readl(&pl022->ssp_pid2) & 0xf) == 0x04) &&
>>>>> +           (readl(&pl022->ssp_pid3) == 0x00))
>>>>
>>>>
>>>>
>>>> Tab space is required, for this if statement i guess, please check.
>>>>
>>>
>>> If I do then checkpatch reports a warning, saying that I need to keep
>>> all lines of a 'if' statement aligned properly...
>>>
>>> So, I guess that this way is more proper.
>>
>>
>> Agree, but it should be easy to interpret where should the if block
>> end and where should the code block starts.
>> I always use tab space like
>>
>>
>> +static int pl022_is_supported(struct pl022_spi_slave *ps)
>> +{
>> +       struct pl022 *pl022 = (struct pl022 *)ps->regs;
>> +
>> +       /* PL022 version is 0x00041022 */
>> +       if ((readl(&pl022->ssp_pid0) == 0x22) &&
>> +                       (readl(&pl022->ssp_pid1) == 0x10) &&
>> +                       ((readl(&pl022->ssp_pid2) & 0xf) == 0x04) &&
>> +                       (readl(&pl022->ssp_pid3) == 0x00))
>> +               return 1;
>> +
>> +       return 0;
>> +}
>>
>> If you see return 1 is code block, so prior to this if ends.
>>
>
> OK, I'll do it in this way even if it may generate warnings.
> Give me few mins and I'll send a v6 patch!
>
> Thx,
> Arm
>
>
> --
> -- "Every step appears to be the unavoidable consequence of the
> -- preceding one." (A. Einstein)
> --
> Armando Visconti                  Mobile: (+39) 346 8879146
> Senior SW Engineer                Fax:    (+39) 02 93519290
> CPG                               Work:   (+39) 02 93519683
> Computer System Division          e-mail: armando.visconti at st.com
> ST Microelectronics               TINA:   051  4683
>
>

Please use the commit header as "spi: pl022_spi: "
as you haven't use the same on v5 i guess, please check.

--
Thanks,
Jagan.


More information about the U-Boot mailing list