2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 06:34:11 +08:00
linux-next/arch/arm/mach-s3c24xx
Linus Walleij 9b00bc7b90
spi: spi-gpio: Rewrite to use GPIO descriptors
This converts the bit-banged GPIO SPI driver to looking up and
using GPIO descriptors to get a handle on GPIO lines for SCK,
MOSI, MISO and all CS lines.

All existing board files are converted in one go to keep it all
consistent. With these conversions I rarely find any interrim
steps that makes any sense.

Device tree probing and GPIO handling should work like before
also after this patch.

For board files, we stop using controller data to pass the GPIO
line for chip select, instead we pass this as a GPIO descriptor
lookup like everything else.

In some s3c24xx machines the names of the SPI devices were set to
"spi-gpio" rather than "spi_gpio" which can never have worked, I
fixed it working (I guess) as part of this patch set. Sometimes
I wonder how this code got upstream in the first place, it
obviously is not tested.

mach-s3c64xx/mach-smartq.c has the same problem and additionally
defines the *same* GPIO line for MOSI and MISO which is not going
to be accepted by gpiolib. As the lines were number 1,2,2 I assumed
it was a typo and use lines 1,2,3. A comment gives awat that line 0
is chip select though no actual SPI device is provided for the LCD
supposed to be on this bit-banged SPI bus. I left it intact instead
of just deleting the bus though.

Kill off board file code that try to initialize the SPI lines
to the same values that they will later be set by the spi_gpio
driver anyways. Given the huge number of weird things in these
board files I do not think this code is very tested or put in
with much afterthought anyways.

In order to assert that we do not get performance regressions on
this crucial bing-banged driver, a ran a script like this dumping the
Ilitek ILI9322 regmap 10000 times (it has no caching obviously) on
an otherwise idle system in two iterations before and after the
patches:

 #!/bin/sh
 for run in `seq 10000`
 do
     cat /debug/regmap/spi0.0/registers > /dev/null
 done

Before the patch:

time test.sh
real    3m 41.03s
user    0m 29.41s
sys     3m 7.22s

time test.sh
real    3m 44.24s
user    0m 32.31s
sys     3m 7.60s

After the patch:

time test.sh
real    3m 41.32s
user    0m 28.92s
sys     3m 8.08s

time test.sh
real    3m 39.92s
user    0m 30.20s
sys     3m 5.56s

So any performance differences seems to be in the error margin.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-14 16:02:41 +00:00
..
include/mach ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
anubis.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
bast-ide.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
bast-irq.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
bast.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
common-smdk.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
common-smdk.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
common.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
common.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
cpufreq-utils.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
fb-core.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
gta02.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
h1940-bluetooth.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
h1940.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
iotiming-s3c2410.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
iotiming-s3c2412.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
irq-pm.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
Kconfig ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-amlm5900.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-anubis.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-at2440evb.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-bast.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-gta02.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-h1940.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-jive.c spi: spi-gpio: Rewrite to use GPIO descriptors 2018-02-14 16:02:41 +00:00
mach-mini2440.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-n30.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-nexcoder.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-osiris-dvs.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-osiris.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-otom.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-qt2410.c spi: spi-gpio: Rewrite to use GPIO descriptors 2018-02-14 16:02:41 +00:00
mach-rx1950.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-rx3715.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-s3c2416-dt.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-smdk2410.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-smdk2413.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-smdk2416.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-smdk2440.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-smdk2443.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-tct_hammer.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-vr1000.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
mach-vstms.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
Makefile ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
Makefile.boot ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
nand-core.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
osiris.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
otom.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pll-s3c2410.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pll-s3c2440-12000000.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pll-s3c2440-16934400.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pm-h1940.S ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pm-s3c2410.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pm-s3c2412.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pm-s3c2416.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
pm.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
regs-dsc.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
regs-mem.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c244x.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2410.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2412-power.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2412.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2416.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2440.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2442.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
s3c2443.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
setup-camif.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
setup-i2c.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
setup-sdhci-gpio.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
setup-spi.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
setup-ts.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
simtec-audio.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
simtec-nor.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
simtec-pm.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
simtec-usb.c ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
simtec.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
sleep-s3c2410.S ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
sleep-s3c2412.S ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
sleep.S ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
spi-core.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00
vr1000.h ARM: S3C24XX: Add SPDX license identifiers 2018-01-03 18:36:43 +01:00