Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: samsung: Update documentation

Update Samsung GPIO API documentation to reflect removal of
the s3c24xx specific gpio API. While at it, fix some typos.

The notes on conversion from s3c2410_* functions to the gpiolib
API are left here just in case there is any out of tree code that
still needs to be converted.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

authored by

Sylwester Nawrocki and committed by
Kukjin Kim
98025c8c ef97fa65

+28 -62
+25 -57
Documentation/arm/Samsung-S3C24XX/GPIO.txt
··· 1 - S3C2410 GPIO Control 1 + S3C24XX GPIO Control 2 2 ==================== 3 3 4 4 Introduction ··· 12 12 of the s3c2410 GPIO system, please read the Samsung provided 13 13 data-sheet/users manual to find out the complete list. 14 14 15 - See Documentation/arm/Samsung/GPIO.txt for the core implemetation. 15 + See Documentation/arm/Samsung/GPIO.txt for the core implementation. 16 16 17 17 18 18 GPIOLIB ··· 41 41 GPIOLIB conversion 42 42 ------------------ 43 43 44 - If you need to convert your board or driver to use gpiolib from the exiting 45 - s3c2410 api, then here are some notes on the process. 44 + If you need to convert your board or driver to use gpiolib from the phased 45 + out s3c2410 API, then here are some notes on the process. 46 46 47 47 1) If your board is exclusively using an GPIO, say to control peripheral 48 48 power, then it will require to claim the gpio with gpio_request() before ··· 55 55 as they have the same arguments, and can either take the pin specific 56 56 values, or the more generic special-function-number arguments. 57 57 58 - 3) s3c2410_gpio_pullup() changs have the problem that whilst the 58 + 3) s3c2410_gpio_pullup() changes have the problem that whilst the 59 59 s3c2410_gpio_pullup(x, 1) can be easily translated to the 60 60 s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) 61 61 are not so easy. ··· 74 74 when using gpio_get_value() on an output pin (s3c2410_gpio_getpin 75 75 would return the value the pin is supposed to be outputting). 76 76 77 - 6) s3c2410_gpio_getirq() should be directly replacable with the 77 + 6) s3c2410_gpio_getirq() should be directly replaceable with the 78 78 gpio_to_irq() call. 79 79 80 80 The s3c2410_gpio and gpio_ calls have always operated on the same gpio ··· 105 105 ----------- 106 106 107 107 Each pin has an unique number associated with it in regs-gpio.h, 108 - eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell 108 + e.g. S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell 109 109 the GPIO functions which pin is to be used. 110 110 111 111 With the conversion to gpiolib, there is no longer a direct conversion ··· 120 120 The following function allows the configuration of a given pin to 121 121 be changed. 122 122 123 - void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); 123 + void s3c_gpio_cfgpin(unsigned int pin, unsigned int function); 124 124 125 - Eg: 125 + e.g.: 126 126 127 - s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); 128 - s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); 127 + s3c_gpio_cfgpin(S3C2410_GPA(0), S3C_GPIO_SFN(1)); 128 + s3c_gpio_cfgpin(S3C2410_GPE(8), S3C_GPIO_SFN(2)); 129 129 130 130 which would turn GPA(0) into the lowest Address line A0, and set 131 131 GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. 132 - 133 - The s3c_gpio_cfgpin() call is a functional replacement for this call. 134 132 135 133 136 134 Reading the current configuration 137 135 --------------------------------- 138 136 139 - The current configuration of a pin can be read by using: 137 + The current configuration of a pin can be read by using standard 138 + gpiolib function: 140 139 141 - s3c2410_gpio_getcfg(unsigned int pin); 140 + s3c_gpio_getcfg(unsigned int pin); 142 141 143 142 The return value will be from the same set of values which can be 144 - passed to s3c2410_gpio_cfgpin(). 145 - 146 - The s3c_gpio_getcfg() call should be a functional replacement for 147 - this call. 143 + passed to s3c_gpio_cfgpin(). 148 144 149 145 150 146 Configuring a pull-up resistor ··· 150 154 pull-up resistors enabled. This can be configured by the following 151 155 function: 152 156 153 - void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); 157 + void s3c_gpio_setpull(unsigned int pin, unsigned int to); 154 158 155 - Where the to value is zero to set the pull-up off, and 1 to enable 156 - the specified pull-up. Any other values are currently undefined. 157 - 158 - The s3c_gpio_setpull() offers similar functionality, but with the 159 - ability to encode whether the pull is up or down. Currently there 160 - is no 'just on' state, so up or down must be selected. 159 + Where the to value is S3C_GPIO_PULL_NONE to set the pull-up off, 160 + and S3C_GPIO_PULL_UP to enable the specified pull-up. Any other 161 + values are currently undefined. 161 162 162 163 163 - Getting the state of a PIN 164 - -------------------------- 164 + Getting and setting the state of a PIN 165 + -------------------------------------- 165 166 166 - The state of a pin can be read by using the function: 167 - 168 - unsigned int s3c2410_gpio_getpin(unsigned int pin); 169 - 170 - This will return either zero or non-zero. Do not count on this 171 - function returning 1 if the pin is set. 172 - 173 - This call is now implemented by the relevant gpiolib calls, convert 174 - your board or driver to use gpiolib. 175 - 176 - 177 - Setting the state of a PIN 178 - -------------------------- 179 - 180 - The value an pin is outputing can be modified by using the following: 181 - 182 - void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); 183 - 184 - Which sets the given pin to the value. Use 0 to write 0, and 1 to 185 - set the output to 1. 186 - 187 - This call is now implemented by the relevant gpiolib calls, convert 167 + These calls are now implemented by the relevant gpiolib calls, convert 188 168 your board or driver to use gpiolib. 189 169 190 170 191 171 Getting the IRQ number associated with a PIN 192 172 -------------------------------------------- 193 173 194 - The following function can map the given pin number to an IRQ 174 + A standard gpiolib function can map the given pin number to an IRQ 195 175 number to pass to the IRQ system. 196 176 197 - int s3c2410_gpio_getirq(unsigned int pin); 177 + int gpio_to_irq(unsigned int pin); 198 178 199 179 Note, not all pins have an IRQ. 200 180 201 - This call is now implemented by the relevant gpiolib calls, convert 202 - your board or driver to use gpiolib. 203 181 204 - 205 - Authour 182 + Author 206 183 ------- 207 - 208 184 209 185 Ben Dooks, 03 October 2004 210 186 Copyright 2004 Ben Dooks, Simtec Electronics
+3 -5
Documentation/arm/Samsung/GPIO.txt
··· 5 5 ------------ 6 6 7 7 This outlines the Samsung GPIO implementation and the architecture 8 - specific calls provided alongisde the drivers/gpio core. 8 + specific calls provided alongside the drivers/gpio core. 9 9 10 10 11 11 S3C24XX (Legacy) 12 12 ---------------- 13 13 14 14 See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information 15 - about these devices. Their implementation is being brought into line 15 + about these devices. Their implementation has been brought into line 16 16 with the core samsung implementation described in this document. 17 17 18 18 ··· 29 29 PIN configuration 30 30 ----------------- 31 31 32 - Pin configuration is specific to the Samsung architecutre, with each SoC 32 + Pin configuration is specific to the Samsung architecture, with each SoC 33 33 registering the necessary information for the core gpio configuration 34 34 implementation to configure pins as necessary. 35 35 ··· 38 38 39 39 See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information 40 40 on these functions. 41 - 42 -