1Chinese translated version of Documentation/gpio.txt 2 3If you have any comment or update to the content, please contact the 4original document maintainer directly. However, if you have a problem 5communicating in English you can also ask the Chinese maintainer for 6help. Contact the Chinese maintainer if this translation is outdated 7or if there is a problem with the translation. 8 9Maintainer: Grant Likely <grant.likely@secretlab.ca> 10 Linus Walleij <linus.walleij@linaro.org> 11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> 12--------------------------------------------------------------------- 13Documentation/gpio.txt ��������������� 14 15������������������������������������������������������������������������������������������������������ 16������������������������������������������������������������������������������������������������������ 17������������������������������������������������ 18��������������������� Grant Likely <grant.likely@secretlab.ca> 19 Linus Walleij <linus.walleij@linaro.org> 20��������������������� ������ Fu Wei <tekkamanninja@gmail.com> 21��������������������� ������ Fu Wei <tekkamanninja@gmail.com> 22��������������������� ������ Fu Wei <tekkamanninja@gmail.com> 23 24 25��������������� 26--------------------------------------------------------------------- 27GPIO ������ 28 29���������������������������Linux���������GPIO������������������ 30 31��������������� gpio_* ������������������������������������������������������������������������ 32__gpio_* ��������� 33 34 35���������GPIO? 36========== 37"������������/���������"(GPIO)������������������������������������������������������������ 38���������������������,������������������������������������������ Linux ������������������ 39���������������������GPIO ���������������������������������������������������(BGA)��������� 40������������������������������������������������������ GPIO ��������������������������������� 41��������������������������������������������������������������������������������������������������� 42 43������������ (SOC) ������������ GPIO ���������������������������������������,������ 44������������������������������ GPIO,������������������������������������ GPIO��� 45���������������������(������ FPGA) ��������������������� GPIO��������������������� 46������������������������������������������������������������������������������������������������ 47��������� SOC��������������������� I2C ��� SPI ������������������������GPIO������������ 48������������������ PC ������������������������ GPIO ��������������� (������BIOS 49���������������������������������)��� 50 51GPIO ������������������������������������������������: 52 53 - ��������������� (���������=1������������=0)���������������������������������������������������, 54 ���������������������������������������������������������������������������������(������������������ 55 ������������������) 56 57 - ���������������(1���0)������������������������������������������������������������������������������ 58 ���������������������(���������������������)���������������������GPIO ������������������������ 59 ���������/������������,������������������������������ 60 61 - ��������������������� IRQ ������,������������������,������������������������������������ IRQ 62 ���������������������������������,������������������������������������������ 63 64 - ������������ GPIO ������������������������������������,������������������������������,��������� 65 ������������������ 66 67 - ��������� GPIO ���������������������������������,������������������������������������ GPIO 68 ������������������������������������������������������������������ 69 70������������������������,������ GPIO ������������������������������,��������� MMC/SD ������ 71������/��������������������������������������������� LED������������������������������������������ 72��������������������������������������������������� 73 74 75GPIO ������ 76========= 77������,��������������������������������������������������������������������������������������������������� 78���������������������������������������GPIO ������������������������������������,������������ 79������������������������������������������������������������������������������������������������������ 80��������������������������������������������������������������������������������������������������������������� 81 82��������������������������������������������������������������������������������������������������������� 83���������������������������������������������������������������������������������������������������GPIO 84���������������������������������������(������������������������������������������������������,��������� 85��������������������������� GPIO ������������������������������������������������������������) 86 87������������,������������������������������������������������������������������������������������������������ 88��������� Kconfig ��������� ARCH_REQUIRE_GPIOLIB ������ ARCH_WANT_OPTIONAL_GPIOLIB 89��������������������������� GPIO ������������������������ Kconfig ���������������������GENERIC_GPIO��� 90���������������������: 91 92 #include <linux/gpio.h> 93 94��� GPIO ���������������,������������������������������������������������������������������������ 95��������������������������������������������������������������������������������������������������� 96 97������������������������������������������ I/O ��������������������������������������������������� 98 99 100������ GPIO 101--------- 102GPIO ������������������������������������,��������� 0 ��� MAX_INT��������������������� 103������������������,������������������������������������������������������������������������������������ 104��������������������������������������� 105 106������������������������������������,��������������� #define ��������� GPIO��������� 107������������������������������������������������������������������������������������������������������ 108��������������������������� GPIO ��������������� platform_data ������������������ 109������������������ (���������������������������������������������)��������������������������������� 110 111������������������������������ 32-159 ��������� GPIO,���������������������������������0-63 112������������ GPIO ���������,64-79��������������� GPIO ���������,������������������ 113FPGA ������������������������ 80-95���������������������������,��������������������������� 114������������2000-2063��������������� I2C ��������� GPIO ��������������� GPIO��� 115 116��������������������������������������� GPIO ������������������,��������������������������� 117(���"-EINVAL")��������������������������������������������������������������������������������� 118������������������ GPIO���������������������������: 119 120 int gpio_is_valid(int number); 121 122������������������������������������������ GPIO ������������������������������������(���������)��� 123������������������������������,��������������������������������������������������������������������������� 124 125������������������������������ GPIO ������������������������������������������������������������ 126��� GPIO ��������������������������������������������������������������������������������������� 127��������������������������������������������������� GPIO ������������������������ 128 129������ GPIO 130--------- 131������������ GPIO������������������������������������������������ gpio_request() 132������������������������������ 133 134������������������I/O������������������������������������������������������������ GPIO ������ 135platform_device ������������ 136 137 /* ������������������������, ������ 0 ��������������������� */ 138 int gpio_direction_input(unsigned gpio); 139 int gpio_direction_output(unsigned gpio, int value); 140 141��������������������������������������������������������������������������������������������������������� 142get/set(������/������)������������������������������,��������������������������������������� 143���������������������������������������������������������,������������������������ GPIO������������ 144��������������������������������������������������������������� 145 146��������������������� GPIO������������������������������������������������������������������������ 147��������������������������������� 148 149������������������ GPIO ������������, ��������������� GPIO ��������������������������������������� 150������������������������ GPIO ���������(���������)������������������������������������ gpiolib 151������������������ 152 153������������ GPIO ��������������������������������� GPIO ������������������������������������ 154��������������������������������������������������������������������������������������������������������� 155������������Linux���������������������������������������(������, ��������������������������������� 156��������������������������������� GPIO���������������������������/���������������) 157 158 159������������������������ GPIO 160------------------- 161��������� GPIO ������������������������������/���������������������������������������������,������ 162���������������(���������)��������������������������������������������� 163 164��������������� gpio_cansleep()��������������������������� GPIO(���������)��������� 165���������������������: 166 167 /* GPIO ������:������������������ */ 168 int gpio_get_value(unsigned gpio); 169 170 /* GPIO ������ */ 171 void gpio_set_value(unsigned gpio, int value); 172 173GPIO������������������������������������������������������������������������������������������������������ 174������������������������������������������������������������������������������������������������������������ 175��������������������� 176 177��������� get/set ��������������������������������������� gpio_direction_*()��������������� 178���������������������GPIO��������������������������������������������������������������������������������� 179������������������������������������������������������������������������������������������������������������ 180��������������� GPIO (������������������������������������������)��������������������������������� 181(���������)��� 182 183��� GPIO ������(������������������)���������������������,������������������������������������������ 184������������������������ GPIO ������������������(���������������������������)������������������������ 185���������������,��������������������������������������������������������������������������������������� 186������������������������������(���������:������ GPIO ������ I2C���1-wire ��� SPI)��� 187������(������������������������)��������������� 188 189 190��������������������� GPIO 191----------------- 192������ GPIO ���������������������������������(��� I2C ��� SPI)��������������������������������� 193GPIO ������������������������������������������������������������������������������������������������ 194��������������������� IRQ ������(���������������)������������ 195 196������������ GPIO ������������������������������������������������������������ GPIO���(��������������� 197������������������ gpio_request ������������������ GPIO ������): 198 199 int gpio_cansleep(unsigned gpio); 200 201������������������ GPIO,������������������������������������: 202 203 /* GPIO ������:������������������ ,��������������� */ 204 int gpio_get_value_cansleep(unsigned gpio); 205 206 /* GPIO ������,��������������� */ 207 void gpio_set_value_cansleep(unsigned gpio, int value); 208 209 210��������������� GPIO ��������������������������������������������������� IRQ ������������������������������ 211������������������������������ cansleep()��������������������������������������� 212 213��������������������������������������������������������� GPIO ��������������� IRQ ������������������������ 214������������������������������������������������������������������������������ 215 216** ������������ ** ��������������������������� GPIO ��������������������������������������������������� 217��������������������������������� GPIO ���������������: (��������������������������������������������������� 218������������/������������������������������������������������������������������) 219 220 gpio_direction_input() 221 gpio_direction_output() 222 gpio_request() 223 224## gpio_request_one() 225## gpio_request_array() 226## gpio_free_array() 227 228 gpio_free() 229 gpio_set_debounce() 230 231 232 233��������������� GPIO 234---------------------------- 235���������������������������������������,������������������������ 236 237 /* ������ GPIO, ������ 0 ���������������������. 238 * ���������������������������������. 239 */ 240 int gpio_request(unsigned gpio, const char *label); 241 242 /* ��������������������� GPIO */ 243 void gpio_free(unsigned gpio); 244 245������������ GPIO ��������������� gpio_request()��������������������������������������������� 246������������������ GPIO ���������������gpio_request()��������������������������������������� 247���������������������������������������������,������������������������ GPIO,��������������������������� 248��������������������������������������� 249 250������������������������������������������������������������������������������ GPIO ��������������������� 251���������������������������;������������������������������������������ GPIO��������������������������� 252���������������������������������������������������������������������������������������������:������������ 253���������������������������������������������������������������,������������������������������������������ 254������������������������������������������������������������������ GPIO ��������������������������������� 255 256��������������������������� GPIO ������������������������������(��������������������������������������� 257������������������������������)��� 258 259������ GPIO ������ pinctrl ��������������������������������������������������������������������� 260������ gpiolib ��������� .request()��������������� pinctrl_request_gpio()��� 261��� gpiolib ��������� .free()��������������� pinctrl_free_gpio()���pinctrl 262��������������� pinctrl_request_gpio()������������������������������������������������������ 263��������������������������������� 264 265������������ GPIO ��������������������������������������������������������������������� GPIO 266��������� .direction_input()��� .direction_output()������������������ 267������������ GPIO ��������������������������������������������������������� GPIO ��������� 268������������������������������������������������������ GPIO ������������������������������ GPIO 269��������������������������������������������������������� 270 271��������������������������������� GPIO ������������������������������������������GPIO ������������ 272���������������������������������������/��������������������������������������� GPIO ������ 273gpio_request()������������������������������������������ pinctrl ������������������������ 274������ GPIO ������������������������������������ 275 276��������������������������������������� GPIO ��������������������������������� 277 278 279������:������������ GPIO ��������������������������������������������������������� GPIO ������������ 280������������������������������������������������������(��������� GPIO ������������������������/������)��� 281��������������������������������� GPIO ������������������������������,���������������������������������������: 282 283 /* ������������ GPIO ������, ���������������������'flags'���������������, 284 * ��������� gpio_request()��������������������������� 285 * 286 */ 287 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); 288 289 /* ������������������������������ GPIO 290 */ 291 int gpio_request_array(struct gpio *array, size_t num); 292 293 /* ������������������������������ GPIO 294 */ 295 void gpio_free_array(struct gpio *array, size_t num); 296 297������ 'flags' ���������������������������������: 298 299 * GPIOF_DIR_IN - ��������������������� 300 * GPIOF_DIR_OUT - ��������������������� 301 302 * GPIOF_INIT_LOW - ������������������,��������������������� 303 * GPIOF_INIT_HIGH - ������������������,��������������������� 304 * GPIOF_OPEN_DRAIN - gpio��������������������� 305 * GPIOF_OPEN_SOURCE - gpio��������������������������� 306 307 * GPIOF_EXPORT_DIR_FIXED - ��� gpio ��������� sysfs������������������ 308 * GPIOF_EXPORT_DIR_CHANGEABLE - ���������������, ��������������������� 309 310������ GPIOF_INIT_* ������������������������������������������,������������������������: 311 312 * GPIOF_IN - ��������������� 313 * GPIOF_OUT_INIT_LOW - ���������������,������������������������ 314 * GPIOF_OUT_INIT_HIGH - ���������������,������������������������ 315 316��������� flag ��� GPIOF_OPEN_DRAIN ������������������������������������������������������ 317������������������������������1������������������������������������������������������������������������gpio��� 318������������������������������������1��������������������������������������������������������������������������� 319���������0������������������������ 320 321��������� flag ��� GPIOF_OPEN_SOURCE ������������������������������������������������������������ 322������������������������������0������������������������������������������������������������������������gpio��� 323������������������������������������0��������������������������������������������������������������������������� 324���������1������������������������ 325 326��������������������������������������������������������� 327 328������������,������������������������/������������ GPIO,'struct gpio'������������������������ 329���������������: 330 331 struct gpio { 332 unsigned gpio; 333 unsigned long flags; 334 const char *label; 335 }; 336 337���������������������: 338 339 static struct gpio leds_gpios[] = { 340 { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* ������������ */ 341 { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* ������������ */ 342 { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* ������������ */ 343 { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* ������������ */ 344 { ... }, 345 }; 346 347 err = gpio_request_one(31, GPIOF_IN, "Reset Button"); 348 if (err) 349 ... 350 351 err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); 352 if (err) 353 ... 354 355 gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); 356 357 358GPIO ��������� IRQ 359-------------------- 360GPIO ������������������������;IRQ ������������������������������������������������������������������ 361(GPIO 0 ��������������� IRQ 0)���������������������������������������������������������: 362 363 /* ������ GPIO ��������� IRQ ������ */ 364 int gpio_to_irq(unsigned gpio); 365 366 /* ������ IRQ ��������� GPIO ������ (������������������) */ 367 int irq_to_gpio(unsigned irq); 368 369���������������������������������������������������������������������������������(������������������)��� 370(������,������ GPIO ������������ IRQ ���������)���������������������������������������:������������ 371��������� gpio_direction_input()������������������ GPIO ��������������������������� 372���������������gpio_to_irq()��� IRQ ��������� 373 374��������������������������������������������������������������������������������������������������������� 375 376gpio_to_irq()������������������������������������ request_irq()������ free_irq()��� 377������������������������������������������������������������������������ IRQ ������������������:IRQ 378��������������� IRQ ������������������������ IRQF_TRIGGER_FALLING��������������������� 379��������������� 380 381irq_to_gpio()��������������������������������������������� gpio_get_value()������������ 382��������� IRQ ������������������������������������������������������������������������������������,������ 383��������������������������������� 384 385 386������������������ 387---------------------------- 388������������������������������������������������������(���������:������������������������������������������ 389���������������������������������)���������,���������������������������������������������������(��������� 390��������� CMOS ��������� TTL ���������������������������)��������������������������������������������� 391������������������������������������������������������(���������������)��������������������������������������������� 392 393������������������������������������������������������������ IRQ ������������������,������������������������ 394������������������������������������ 395 396������ GPIO ������������������������������������������������������������������������������������������ 397������������������������������������������������������������������������������������������������������ GPIO 398���������������: 399 400 LOW: gpio_direction_output(gpio, 0) ... ������������������������������ 401 ��������������� 402 403 HIGH: gpio_direction_input(gpio) ... ���������������������,������������������ 404 (������������������������)������������������ 405 406������������������������������������������������������ gpio_get_value(gpio)��������������� 407���������(���������������������������)��������������������������������������������������������������������������� 408������������������������������������������������������ I2C ��������������������������������������������� 409��������������� SCK ������������������ I2C ������������������������������������������������ 410 411 412���������������������������? 413================ 414������������������������������������������������������������������������������������������������������ 415��������������������������������������������������������������������������������������������������������� 416������������������������������������������������������������������������������������������������������ 417��������������������������������������������� GPIO���(��������������������������������������������� 418Linux ������������) 419 420������������������,��������������������������������������������������������������������������������������� 421���������������������������,��������������������������������������������������������������������������������� 422���������������������������(���������)������,���������������������������������������(��������������������� 4235kOhm ���������������,������������ 100 kOhm ������������������������)������������������������ 424(2 mA vs 20 mA)���������(1.8V vs 3.3V)���������������������,��������������������� 425������������������ GPIO ������(���)��������������������������� 426 427������������������������������������������������������������������������������������������������������������ 428������������������������������������������ GPIO��������������������������������������������������������� 429������(bank)���GPIO���(GPIO ��������� 16 ��� 32 ��������������������������������������� 430���������������������������������������������)������������������������������ GPIO ������ IRQ��� 431������������������ GPIO ������������������������������������������������������������������������������������ 432 433��������������������� GPIO ��������������������������������������������������������� GPIO ������������ 434������������������������������ 435 436GPIO ������������������ (������) 437===================== 438��������������������������������������������������������������������������������������������������������������� 439��������������� GPIO ������������������������������"gpiolib"��� 440 441��������������������������������������� debugfs ������������������������ /sys/kernel/debug/gpio 442���������������������������������������������������������������������,������������������������������ GPIO 443������������ 444 445 446���������������: gpio_chip 447------------------- 448������������������ GPIO ��������������������������� "struct gpio_chip"��������������� 449������������������������������������������: 450 451 - ������ GPIO ��������������� 452 - ������������ GPIO ������������ 453 - ������������������������������������������������ 454 - ��������� debugfs ������������������ (���������������������������������������������) 455 - ������������ 456 457������������������ device.platform_data ��������������������������������������� GPIO ��� 458��������������������� GPIO ������������ 459 460������ gpio_chip ������������������������������������������������������������������������������������ 461������������ gpio_chip������������gpiochip_add()��������������� GPIO ��������������������� 462��������������������������������� gpiochip_remove()��� 463 464��������� gpio_chip ��������������������������������������������������������� GPIO ������������ 465������������,������������������������������������������������������������������������������������ GPIO 466��������� 467 468������������ debugfs ������������������������������������������������������ GPIO ��������������� 469������������������ gpiochip_is_requested()������������������ GPIO ������������������ 470��������������������������������������� NULL��� 471 472 473������������ 474------- 475������������������������������������������ Kconfig ������������ "select"(������) 476ARCH_REQUIRE_GPIOLIB ��� ARCH_WANT_OPTIONAL_GPIOLIB��������������� 477<asm/gpio.h> ������ <asm-generic/gpio.h>���������������������������: 478gpio_get_value()���gpio_set_value()��� gpio_cansleep()��� 479 480��������������������� ARCH_NR_GPIOS ��������������������������������������������������� GPIO 481���������������,���������������������������(��������������������������������������������� GPIO ��� 482GPIO ������������������������) 483 484ARCH_REQUIRE_GPIOLIB ��������� gpiolib ��������������������������������������������������� 485 486ARCH_WANT_OPTIONAL_GPIOLIB ��������� gpiolib ������������������,��������������� 487���������,������������������������(������)��� 488 489���������������������������������,��������������������� GPIO-lib ������ GPIO,������������������ 490������������������ 491 492���������������������������������������������������������,��������������� gpio_chip ������: 493 494 #define gpio_get_value __gpio_get_value 495 #define gpio_set_value __gpio_set_value 496 #define gpio_cansleep __gpio_cansleep 497 498��������������������������������������������������������������������������������������������������������������� 499��������������������������� GPIO���������,������������ GPIO (������������������)������������12������ 500��������������������������������������������������������������������������������������������������������������� 501��������������������������������������������������������������������������������������������������������� GPIO 502��������� I/O ������, ��������������������������������������� 503 504������������������������������������������������ GPIO ���������(bank)��������������� gpio_chip 505��������������� GPIO ���������������������������������������������/������,������������������������������ 506��������������������������������������������������������������������������� GPIO(������)��������� 507arch_initcall()��������������������������������������������������������������� GPIO ��������������� 508��������������������������� IRQ ��������� 509 510������������ 511------- 512������������ GPIO ���������(������ I2C ��� SPI ���������������������������������������������FPGA 513��� CPLD)��������������������������������������������������������������������������������������������������� 514gpiochip_add()������������ GPIO ��������������������������������������������������������� GPIO 515��������������� 516 517������������������������������������������������������������������ GPIO ������������������ platform_data 518��������������������� GPIO ������������������������������������������ probe()��������������������� 519��������������� gpiochip_add()��� 520 521������������������������������������������������������������������ I2C ���(������)GPIO��������������� 522probe()������������������������ GPIO ������������������������������������������������������������ 523GPIO ������������������������������������������������������������������������������������ gpio_chip 524������������������������������������ setup()��� teardown()������������������������������������ 525��������������������������������������������������������������������������������������������� GPIO ��������� 526������������������������������������ 527 528 529��������������� Sysfs ������(������) 530======================== 531���������gpiolib������������������������������������������������ GPIO ��� sysfs ��������������� 532������������ debugfs ��������������������������������� GPIO��������������������������������������� 533������GPIO ������������������������,������������������������������������������������������������ 534 535��������������������������������������������������������������������� GIOP #23 ������ Flash 536���������������������(������������������ Bootloader ������)������������������������������������ 537��������������������������������������������� GPIO��������������������������������������������������������� 538���������������������������������,GPIO #23 ������������������������������������������������������������ 539 540��������������������������������������������������������� GPIO ��������������������������������������� 541������������������������������������������������������������������������������������ GPIO ��������������� 542������������������������ 543 544������������������������������������������������������LED ������������GPIO ������������������: 545"leds-gpio" ��� "gpio_keys"��������������������������������������� GPIO������������������ 546��������������������������������������������������������������������� 547 548 549Sysfs ������������ 550-------------- 551���/sys/class/gpio ������ 3 ���������: 552 553 - ��������������������������� GPIO ���������������; 554 555 - GPIOs ������;������ 556 557 - GPIO ��������� ("gpio_chip" ������)��� 558 559���������������������������,������������device������������������ 560 561������������������������: 562 563 /sys/class/gpio/ 564 565 "export" ... ������������������������������������������������������������������������ 566 ������ GPIO ��������������������������� 567 568 ������: ������������������������������ GPIO #19,"echo 19 > export" 569 ��������� GPIO #19 ������������ "gpio19" ��������� 570 571 "unexport" ... ������������������������������������ 572 573 ������: "echo 19 > unexport" ������������������"export"��������������� 574 "gpio19" ��������� 575 576GPIO ��������������������� /sys/class/gpio/gpio42/ (������ GPIO #42 ������)��� 577������������������/���������: 578 579 /sys/class/gpio/gpioN/ 580 581 "direction" ... ������������ "in" ��� "out"��������������������������������� 582 ������"out" ���,��������������������������������������������������������������������� 583 "low" ��� "high" ������������������������ GPIO ������������������������������������ 584 585 ������:��������������������������� GPIO ������������������������������������������������ 586 ������������������������������������������ GPIO ������������������������������������������ 587 588 "value" ... ������������ 0 (���������) ��� 1 (���������)��������� GPIO ��������� 589 ������,������������������������������������������������������������������ 590 591 ��������������������������������������������������������������������������������������� 592 ������"edge"���������������������������������������������������������(poll(2))��� 593 ������������������������������������������������������������������������������(poll(2))��� 594 ������ events ��������� POLLPRI ��� POLLERR������������������������������ 595 (select(2))��������� exceptfds ��������������������������������������� 596 ������������(poll(2))������������������������������ lseek(2)������������ 597 sysfs ��������������������������������������������������������������������������������������� 598 599 "edge" ... ���������������none���������rising���������falling������������both������ 600 ��������������������������������������������������������������������������������������� 601 (select(2))���"value"������������������ 602 603 ��������������������������������������������������������������������������������������������� 604 605 "active_low" ... ������������ 0 (���) ��� 1 (���)������������������������������ 606 ���������������������(������)������������������������������"edge"���������������"rising" 607 ��� "falling" ������������������������������(poll(2))��������������������������� 608 609GPIO ������������������������ /sys/class/gpio/gpiochip42/ (���������#42 GPIO 610������������������������������),���������������������������: 611 612 /sys/class/gpio/gpiochipN/ 613 614 "base" ... ������������ N ������,��������������������������������� GPIO ��������� 615 616 "label" ... ������������ (���������������������������) 617 618 "ngpio" ... ������������������������ GPIO ������(��� GPIO ��������� N ��� 619 N + ngpio - 1) 620 621������������������,������������������������������������ GPIO ������������������������������������������������ 622���������,������������������������ GPIO��������������������������������������������������������������������� 623���������������������������������,��������������������� gpiochip ������(���������������������������)��� 624��������������������������� GPIO ��������� 625 626 627������������������������ 628------------- 629������������������������������������������������ gpio_request()��������� GPIO ���������: 630 631 /* ������ GPIO ��������������� */ 632 int gpio_export(unsigned gpio, bool direction_may_change); 633 634 /* gpio_export()������������ */ 635 void gpio_unexport(); 636 637 /* ������������ sysfs ��������������������� GPIO ������ */ 638 int gpio_export_link(struct device *dev, const char *name, 639 unsigned gpio) 640 641��������������������������������� GPIO ������������������������ gpio_export()��������� sysfs 642������������������������������������������������������������������������������������������������������������������ 643������������������������������ 644 645������������������������������(���������������������������������)������������������������������������������������������ 646��������������������������������������������������� 647 648��� GPIO ������������������gpio_export_link()��������� sysfs ��������������������������� 649��������������������� GPIO sysfs ��������������������������������������������������������������������� 650������������ sysfs ������������������������������������������(��������� GPIO sysfs ���������)��������� 651