linux4sam/linux-at91 — pull request #6 by marekr (2014-01-07 07:02:01+00:00)
Title: pinctrl: at91: add drive strength config options

The SAMA5 and SAMA92x5, SAM9G25 and SAM9G35 and others implement the ability to select the output drive strength for pins. But the pinctrl driver is currently missing the option to set it.

This patch only reserves 3 bits in the pinctrl config(bits 5,6 and 7) for drive strength. The first bit enables setting the drive strength, the other two bits(6,7) set the drive strength to the specified level which is dependent on the chip.

i.e. A9s:
00 = high
01 = medium
10 = low
11 = reserved/undefined

the A5 does
00 = low
01 = low
10 = medium
11 = high

Notes:
1. Only tested on SAMA5 because I don't have the eval boards for the others :(
2. The SAMA5 datasheet incorrectly states the default value for drivestrength config is 0x00000000. The real default value is 0xAAAAAAAA or medium strength for all pins. This can be confirmed with the JLINK on the SAMA5EK.
3. For some reason the Atmel engineers relocated the addresses of the drivestrength registers between the SAMA5 and the SAMA9s based on datasheets. The #if defined in at91_pio.h is a quick attempt to workaround that change depending on cpu