aboutsummaryrefslogtreecommitdiff
path: root/Documentation/arm
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-05-24 11:23:53 +0900
committerBen Dooks <ben-linux@fluff.org>2010-05-28 19:31:31 +0900
commit0639b93d00812dc6a7c925a41ce3610d28f73d4e (patch)
tree98404517092f5b1959967d4d86c46d339d65d252 /Documentation/arm
parent70f5c9a4ddcbce3e6d7d54ec890a4bca19b4fc7a (diff)
downloadlinaro-lsk-0639b93d00812dc6a7c925a41ce3610d28f73d4e.tar.gz
ARM: S3C24XX: Documentation: add section on gpiolib changes
Add section to the S3C24XX GPIO documentation on the recent changes to move towards gpiolib integration. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'Documentation/arm')
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 9fe5feac212..228ecb61d2f 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -36,6 +36,50 @@ GPIOLIB
s3c2410_gpio_pullup() s3c_gpio_setpull()
+GPIOLIB conversion
+------------------
+
+If you need to convert your board or driver to use gpiolib from the exiting
+s3c2410 api, then here are some notes on the process.
+
+1) If your board is exclusively using an GPIO, say to control peripheral
+ power, then it will require to claim the gpio with gpio_request() before
+ it can use it.
+
+ It is recommended to check the return value, with at least WARN_ON()
+ during initialisation.
+
+2) The s3c2410_gpio_cfgpin() can be directly replaced with s3c_gpio_cfgpin()
+ as they have the same arguments, and can either take the pin specific
+ values, or the more generic special-function-number arguments.
+
+3) s3c2410_gpio_pullup() changs have the problem that whilst the
+ s3c2410_gpio_pullup(x, 1) can be easily translated to the
+ s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0)
+ are not so easy.
+
+ The s3c2410_gpio_pullup(x, 0) case enables the pull-up (or in the case
+ of some of the devices, a pull-down) and as such the new API distinguishes
+ between the UP and DOWN case. There is currently no 'just turn on' setting
+ which may be required if this becomes a problem.
+
+4) s3c2410_gpio_setpin() can be replaced by gpio_set_value(), the old call
+ does not implicitly configure the relevant gpio to output. The gpio
+ direction should be changed before using gpio_set_value().
+
+5) s3c2410_gpio_getpin() is replaceable by gpio_get_value() if the pin
+ has been set to input. It is currently unknown what the behaviour is
+ when using gpio_get_value() on an output pin (s3c2410_gpio_getpin
+ would return the value the pin is supposed to be outputting).
+
+6) s3c2410_gpio_getirq() should be directly replacable with the
+ gpio_to_irq() call.
+
+The s3c2410_gpio and gpio_ calls have always operated on the same gpio
+numberspace, so there is no problem with converting the gpio numbering
+between the calls.
+
+
Headers
-------