]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: Add GPIO support and tests
authorSimon Glass <sjg@chromium.org>
Wed, 26 Feb 2014 22:59:24 +0000 (15:59 -0700)
committerTom Rini <trini@ti.com>
Tue, 4 Mar 2014 17:15:30 +0000 (12:15 -0500)
commit96495d90fe0165cf0cc721083e5a0b83771e3509
treef1d93e0352da249c7822c3291e3b02a33ba438a7
parent39f7611fecc55cbde02c8a84f7c12861abe31b53
dm: Add GPIO support and tests

Add driver model support for GPIOs. Since existing GPIO drivers do not use
driver model, this feature must be enabled by CONFIG_DM_GPIO. After all
GPO drivers are converted over we can perhaps remove this config.

Tests are provided for the sandbox implementation, and are a sufficient
sanity check for basic operation.

The GPIO uclass understands the concept of named banks of GPIOs, with each
GPIO device providing a single bank. Within each bank the GPIOs are numbered
using an offset from 0 to n-1. For example a bank named 'b' with 20
offsets will provide GPIOs named b0 to b19.

Anonymous GPIO banks are also supported, and are just numbered without any
prefix.

Each time a GPIO driver is added to the uclass, the GPIOs are renumbered
accordinging, so there is always a global GPIO numbering order.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
drivers/gpio/Makefile
drivers/gpio/gpio-uclass.c [new file with mode: 0644]
include/asm-generic/gpio.h
test/dm/gpio.c [new file with mode: 0644]