Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199218
b: refs/heads/master
c: 0639b93
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks committed May 28, 2010
1 parent 5e26b5c commit 9ecd0d7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70f5c9a4ddcbce3e6d7d54ec890a4bca19b4fc7a
refs/heads/master: 0639b93d00812dc6a7c925a41ce3610d28f73d4e
44 changes: 44 additions & 0 deletions trunk/Documentation/arm/Samsung-S3C24XX/GPIO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand Down

0 comments on commit 9ecd0d7

Please sign in to comment.