Subject: [PATCH] pinctrl: Add SPEAr pinctrl drivers

From: [email-masked] (Stephen Warren)
Date: Tue, 03 Apr 2012 10:19:48 -0600

On 04/03/2012 07:47 AM, Arnd Bergmann wrote:
> On Tuesday 03 April 2012, Viresh Kumar wrote:
>> This adds pinctrl driver for SPEAr family. Currently it contains machine/SoC
>> drivers for SPEAr3xx family only. SPEAr13xx family drivers will follow.
>>
>> Signed-off-by: Viresh Kumar <[email-masked]>
> 
> Hi Viresh,
> 
> This is quite a lot of data, especially for the spear320. Have you
> tried moving some or all of the data into device tree properties?
> 
> I can only guess that the spear13xx file would be even larger than
> these.

Didn't we decide (at Linaro Connect) that is was perfectly acceptable to
put this data into the pinctrl drivers; it's just going to get parsed
out into exactly the same tables, and the data is presumably static for
each SoC, and hence there's little point putting it into DT.

>> +/* pingroups */
>> +static struct spear_pingroup *spear310_pingroups[] = {
>> +	SPEAR3XX_COMMON_PINGROUPS,
>> +	&emi_cs_0_to_5_pingroup,
>> +	&uart1_pingroup,
>> +	&uart2_pingroup,
>> +	&uart3_pingroup,
>> +	&uart4_pingroup,
>> +	&uart5_pingroup,
>> +	&fsmc_pingroup,
>> +	&rs485_0_pingroup,
>> +	&rs485_1_pingroup,
>> +	&tdm_pingroup,
>> +};
>> +
>> +/* functions */
>> +static struct spear_function *spear310_functions[] = {
>> +	SPEAR3XX_COMMON_FUNCTIONS,
>> +	&emi_cs_0_to_5_function,
>> +	&uart1_function,
>> +	&uart2_function,
>> +	&uart3_function,
>> +	&uart4_function,
>> +	&uart5_function,
>> +	&fsmc_function,
>> +	&rs485_0_function,
>> +	&rs485_1_function,
>> +	&tdm_function,
>> +};
> 
> I believe the macros like SPEAR3XX_COMMON_FUNCTIONS are not
> needed any more, you can simply register multiple sets of pingroups
> and functions.

For a given pin controller, there's a single set of pins, groups, and
functions; no incremental registration. You can register multiple pin
controllers, but that only makes sense if there really are multiple
physically separate pin controller modules in hardware.