diff options
Diffstat (limited to 'Documentation/arm')
-rw-r--r-- | Documentation/arm/Samsung-S3C24XX/GPIO.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 9fe5feac212d..228ecb61d2fd 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -36,6 +36,50 @@ GPIOLIB | |||
36 | s3c2410_gpio_pullup() s3c_gpio_setpull() | 36 | s3c2410_gpio_pullup() s3c_gpio_setpull() |
37 | 37 | ||
38 | 38 | ||
39 | GPIOLIB conversion | ||
40 | ------------------ | ||
41 | |||
42 | If you need to convert your board or driver to use gpiolib from the exiting | ||
43 | s3c2410 api, then here are some notes on the process. | ||
44 | |||
45 | 1) If your board is exclusively using an GPIO, say to control peripheral | ||
46 | power, then it will require to claim the gpio with gpio_request() before | ||
47 | it can use it. | ||
48 | |||
49 | It is recommended to check the return value, with at least WARN_ON() | ||
50 | during initialisation. | ||
51 | |||
52 | 2) The s3c2410_gpio_cfgpin() can be directly replaced with s3c_gpio_cfgpin() | ||
53 | as they have the same arguments, and can either take the pin specific | ||
54 | values, or the more generic special-function-number arguments. | ||
55 | |||
56 | 3) s3c2410_gpio_pullup() changs have the problem that whilst the | ||
57 | s3c2410_gpio_pullup(x, 1) can be easily translated to the | ||
58 | s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) | ||
59 | are not so easy. | ||
60 | |||
61 | The s3c2410_gpio_pullup(x, 0) case enables the pull-up (or in the case | ||
62 | of some of the devices, a pull-down) and as such the new API distinguishes | ||
63 | between the UP and DOWN case. There is currently no 'just turn on' setting | ||
64 | which may be required if this becomes a problem. | ||
65 | |||
66 | 4) s3c2410_gpio_setpin() can be replaced by gpio_set_value(), the old call | ||
67 | does not implicitly configure the relevant gpio to output. The gpio | ||
68 | direction should be changed before using gpio_set_value(). | ||
69 | |||
70 | 5) s3c2410_gpio_getpin() is replaceable by gpio_get_value() if the pin | ||
71 | has been set to input. It is currently unknown what the behaviour is | ||
72 | when using gpio_get_value() on an output pin (s3c2410_gpio_getpin | ||
73 | would return the value the pin is supposed to be outputting). | ||
74 | |||
75 | 6) s3c2410_gpio_getirq() should be directly replacable with the | ||
76 | gpio_to_irq() call. | ||
77 | |||
78 | The s3c2410_gpio and gpio_ calls have always operated on the same gpio | ||
79 | numberspace, so there is no problem with converting the gpio numbering | ||
80 | between the calls. | ||
81 | |||
82 | |||
39 | Headers | 83 | Headers |
40 | ------- | 84 | ------- |
41 | 85 | ||