1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2%YAML 1.2 3--- 4$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: Qualcomm PMIC GPIO block 8 9maintainers: 10 - Bjorn Andersson <bjorn.andersson@linaro.org> 11 12description: 13 This binding describes the GPIO block(s) found in the 8xxx series of 14 PMIC's from Qualcomm. 15 16properties: 17 compatible: 18 items: 19 - enum: 20 - qcom,pm2250-gpio 21 - qcom,pm660-gpio 22 - qcom,pm660l-gpio 23 - qcom,pm6125-gpio 24 - qcom,pm6150-gpio 25 - qcom,pm6150l-gpio 26 - qcom,pm6350-gpio 27 - qcom,pm6450-gpio 28 - qcom,pm7250b-gpio 29 - qcom,pm7325-gpio 30 - qcom,pm7550-gpio 31 - qcom,pm7550ba-gpio 32 - qcom,pm8005-gpio 33 - qcom,pm8010-gpio 34 - qcom,pm8018-gpio 35 - qcom,pm8019-gpio 36 - qcom,pm8038-gpio 37 - qcom,pm8058-gpio 38 - qcom,pm8150-gpio 39 - qcom,pm8150b-gpio 40 - qcom,pm8150l-gpio 41 - qcom,pm8226-gpio 42 - qcom,pm8350-gpio 43 - qcom,pm8350b-gpio 44 - qcom,pm8350c-gpio 45 - qcom,pm8450-gpio 46 - qcom,pm8550-gpio 47 - qcom,pm8550b-gpio 48 - qcom,pm8550ve-gpio 49 - qcom,pm8550vs-gpio 50 - qcom,pm8916-gpio 51 - qcom,pm8917-gpio 52 - qcom,pm8921-gpio 53 - qcom,pm8937-gpio 54 - qcom,pm8941-gpio 55 - qcom,pm8950-gpio 56 - qcom,pm8953-gpio 57 - qcom,pm8994-gpio 58 - qcom,pm8998-gpio 59 - qcom,pma8084-gpio 60 - qcom,pmc8180-gpio 61 - qcom,pmc8180c-gpio 62 - qcom,pmc8380-gpio 63 - qcom,pmcx0102-gpio 64 - qcom,pmd8028-gpio 65 - qcom,pmg1110-gpio 66 - qcom,pmh0101-gpio 67 - qcom,pmh0104-gpio 68 - qcom,pmh0110-gpio 69 - qcom,pmi632-gpio 70 - qcom,pmi8950-gpio 71 - qcom,pmi8994-gpio 72 - qcom,pmi8998-gpio 73 - qcom,pmih0108-gpio 74 - qcom,pmiv0104-gpio 75 - qcom,pmk8350-gpio 76 - qcom,pmk8550-gpio 77 - qcom,pmk8850-gpio 78 - qcom,pmm8155au-gpio 79 - qcom,pmm8654au-gpio 80 - qcom,pmp8074-gpio 81 - qcom,pmr735a-gpio 82 - qcom,pmr735b-gpio 83 - qcom,pmr735d-gpio 84 - qcom,pms405-gpio 85 - qcom,pmx55-gpio 86 - qcom,pmx65-gpio 87 - qcom,pmx75-gpio 88 - qcom,pmxr2230-gpio 89 90 - enum: 91 - qcom,spmi-gpio 92 - qcom,ssbi-gpio 93 94 reg: 95 maxItems: 1 96 97 interrupt-controller: true 98 99 '#interrupt-cells': 100 const: 2 101 102 gpio-controller: true 103 104 gpio-ranges: 105 maxItems: 1 106 107 gpio-line-names: 108 minItems: 2 109 maxItems: 44 110 111 gpio-reserved-ranges: 112 minItems: 1 113 # maxItems as half of total number of GPIOs, as there has to be at 114 # least one usable GPIO between each reserved range. 115 maxItems: 22 116 117 '#gpio-cells': 118 const: 2 119 description: 120 The first cell will be used to define gpio number and the 121 second denotes the flags for this gpio 122 123additionalProperties: false 124 125required: 126 - compatible 127 - reg 128 - gpio-controller 129 - '#gpio-cells' 130 - gpio-ranges 131 - interrupt-controller 132 133allOf: 134 - if: 135 properties: 136 compatible: 137 contains: 138 enum: 139 - qcom,pm8010-gpio 140 - qcom,pmi8950-gpio 141 - qcom,pmr735d-gpio 142 then: 143 properties: 144 gpio-line-names: 145 minItems: 2 146 maxItems: 2 147 gpio-reserved-ranges: 148 maxItems: 1 149 150 - if: 151 properties: 152 compatible: 153 contains: 154 enum: 155 - qcom,pm8005-gpio 156 - qcom,pm8450-gpio 157 - qcom,pm8916-gpio 158 - qcom,pmd8028-gpio 159 - qcom,pmg1110-gpio 160 - qcom,pmk8350-gpio 161 - qcom,pmr735a-gpio 162 - qcom,pmr735b-gpio 163 then: 164 properties: 165 gpio-line-names: 166 minItems: 4 167 maxItems: 4 168 gpio-reserved-ranges: 169 minItems: 1 170 maxItems: 2 171 172 - if: 173 properties: 174 compatible: 175 contains: 176 enum: 177 - qcom,pm8018-gpio 178 - qcom,pm8019-gpio 179 - qcom,pm8550vs-gpio 180 - qcom,pmk8550-gpio 181 then: 182 properties: 183 gpio-line-names: 184 minItems: 6 185 maxItems: 6 186 gpio-reserved-ranges: 187 minItems: 1 188 maxItems: 3 189 190 - if: 191 properties: 192 compatible: 193 contains: 194 enum: 195 - qcom,pm7550ba-gpio 196 - qcom,pm8226-gpio 197 - qcom,pm8350b-gpio 198 - qcom,pm8550ve-gpio 199 - qcom,pm8937-gpio 200 - qcom,pm8950-gpio 201 - qcom,pm8953-gpio 202 - qcom,pmi632-gpio 203 - qcom,pmh0104-gpio 204 - qcom,pmk8850-gpio 205 then: 206 properties: 207 gpio-line-names: 208 minItems: 8 209 maxItems: 8 210 gpio-reserved-ranges: 211 minItems: 1 212 maxItems: 4 213 214 - if: 215 properties: 216 compatible: 217 contains: 218 enum: 219 - qcom,pm6350-gpio 220 - qcom,pm6450-gpio 221 - qcom,pm8350c-gpio 222 then: 223 properties: 224 gpio-line-names: 225 minItems: 9 226 maxItems: 9 227 gpio-reserved-ranges: 228 minItems: 1 229 maxItems: 5 230 231 - if: 232 properties: 233 compatible: 234 contains: 235 enum: 236 - qcom,pm2250-gpio 237 - qcom,pm6150-gpio 238 - qcom,pm7325-gpio 239 - qcom,pm8150-gpio 240 - qcom,pm8350-gpio 241 - qcom,pmc8180-gpio 242 - qcom,pmc8380-gpio 243 - qcom,pmi8994-gpio 244 - qcom,pmiv0104-gpio 245 - qcom,pmm8155au-gpio 246 then: 247 properties: 248 gpio-line-names: 249 minItems: 10 250 maxItems: 10 251 gpio-reserved-ranges: 252 minItems: 1 253 maxItems: 5 254 255 - if: 256 properties: 257 compatible: 258 contains: 259 enum: 260 - qcom,pmx55-gpio 261 then: 262 properties: 263 gpio-line-names: 264 minItems: 11 265 maxItems: 11 266 gpio-reserved-ranges: 267 minItems: 1 268 maxItems: 6 269 270 - if: 271 properties: 272 compatible: 273 contains: 274 enum: 275 - qcom,pm660l-gpio 276 - qcom,pm6150l-gpio 277 - qcom,pm7250b-gpio 278 - qcom,pm7550-gpio 279 - qcom,pm8038-gpio 280 - qcom,pm8150b-gpio 281 - qcom,pm8150l-gpio 282 - qcom,pm8550-gpio 283 - qcom,pm8550b-gpio 284 - qcom,pmc8180c-gpio 285 - qcom,pmp8074-gpio 286 - qcom,pms405-gpio 287 - qcom,pmxr2230-gpio 288 then: 289 properties: 290 gpio-line-names: 291 minItems: 12 292 maxItems: 12 293 gpio-reserved-ranges: 294 minItems: 1 295 maxItems: 6 296 297 - if: 298 properties: 299 compatible: 300 contains: 301 enum: 302 - qcom,pm660-gpio 303 then: 304 properties: 305 gpio-line-names: 306 minItems: 13 307 maxItems: 13 308 gpio-reserved-ranges: 309 minItems: 1 310 maxItems: 7 311 312 - if: 313 properties: 314 compatible: 315 contains: 316 enum: 317 - qcom,pmcx0102-gpio 318 - qcom,pmh0110-gpio 319 - qcom,pmi8998-gpio 320 then: 321 properties: 322 gpio-line-names: 323 minItems: 14 324 maxItems: 14 325 gpio-reserved-ranges: 326 minItems: 1 327 maxItems: 7 328 329 - if: 330 properties: 331 compatible: 332 contains: 333 enum: 334 - qcom,pmh0101-gpio 335 - qcom,pmih0108-gpio 336 then: 337 properties: 338 gpio-line-names: 339 minItems: 18 340 maxItems: 18 341 gpio-reserved-ranges: 342 minItems: 1 343 maxItems: 9 344 345 - if: 346 properties: 347 compatible: 348 contains: 349 enum: 350 - qcom,pmx65-gpio 351 - qcom,pmx75-gpio 352 then: 353 properties: 354 gpio-line-names: 355 minItems: 16 356 maxItems: 16 357 gpio-reserved-ranges: 358 minItems: 1 359 maxItems: 8 360 361 - if: 362 properties: 363 compatible: 364 contains: 365 enum: 366 - qcom,pm8994-gpio 367 - qcom,pma8084-gpio 368 then: 369 properties: 370 gpio-line-names: 371 minItems: 22 372 maxItems: 22 373 gpio-reserved-ranges: 374 minItems: 1 375 maxItems: 11 376 377 - if: 378 properties: 379 compatible: 380 contains: 381 enum: 382 - qcom,pm8998-gpio 383 then: 384 properties: 385 gpio-line-names: 386 minItems: 26 387 maxItems: 26 388 gpio-reserved-ranges: 389 minItems: 1 390 maxItems: 13 391 392 - if: 393 properties: 394 compatible: 395 contains: 396 enum: 397 - qcom,pm8941-gpio 398 then: 399 properties: 400 gpio-line-names: 401 minItems: 36 402 maxItems: 36 403 gpio-reserved-ranges: 404 minItems: 1 405 maxItems: 18 406 407 - if: 408 properties: 409 compatible: 410 contains: 411 enum: 412 - qcom,pm8917-gpio 413 then: 414 properties: 415 gpio-line-names: 416 minItems: 38 417 maxItems: 38 418 gpio-reserved-ranges: 419 minItems: 1 420 maxItems: 19 421 422 - if: 423 properties: 424 compatible: 425 contains: 426 enum: 427 - qcom,pm8058-gpio 428 - qcom,pm8921-gpio 429 then: 430 properties: 431 gpio-line-names: 432 minItems: 44 433 maxItems: 44 434 gpio-reserved-ranges: 435 minItems: 1 436 maxItems: 22 437 438patternProperties: 439 '-state$': 440 oneOf: 441 - $ref: '#/$defs/qcom-pmic-gpio-state' 442 - patternProperties: 443 '(pinconf|-pins)$': 444 $ref: '#/$defs/qcom-pmic-gpio-state' 445 additionalProperties: false 446 447 '-hog(-[0-9]+)?$': 448 type: object 449 required: 450 - gpio-hog 451 452$defs: 453 qcom-pmic-gpio-state: 454 type: object 455 allOf: 456 - $ref: pinmux-node.yaml 457 - $ref: pincfg-node.yaml 458 properties: 459 pins: 460 description: 461 List of gpio pins affected by the properties specified in 462 this subnode. Valid pins are 463 - gpio1-gpio9 for pm6125 464 - gpio1-gpio10 for pm6150 465 - gpio1-gpio12 for pm6150l 466 - gpio1-gpio9 for pm6350 467 - gpio1-gpio9 for pm6450 468 - gpio1-gpio12 for pm7250b 469 - gpio1-gpio10 for pm7325 470 - gpio1-gpio8 for pm7550ba 471 - gpio1-gpio4 for pm8005 472 - gpio1-gpio2 for pm8010 473 - gpio1-gpio6 for pm8018 474 - gpio1-gpio12 for pm8038 475 - gpio1-gpio40 for pm8058 476 - gpio1-gpio10 for pm8150 (holes on gpio2, gpio5, 477 gpio7 and gpio8) 478 - gpio1-gpio12 for pm8150b (holes on gpio3, gpio4 479 and gpio7) 480 - gpio1-gpio12 for pm8150l (hole on gpio7) 481 - gpio1-gpio4 for pm8916 482 - gpio1-gpio10 for pm8350 483 - gpio1-gpio8 for pm8350b 484 - gpio1-gpio9 for pm8350c 485 - gpio1-gpio4 for pm8450 486 - gpio1-gpio12 for pm8550 487 - gpio1-gpio12 for pm8550b 488 - gpio1-gpio8 for pm8550ve 489 - gpio1-gpio6 for pm8550vs 490 - gpio1-gpio38 for pm8917 491 - gpio1-gpio44 for pm8921 492 - gpio1-gpio8 for pm8937 (hole on gpio3, gpio4 and gpio6) 493 - gpio1-gpio36 for pm8941 494 - gpio1-gpio8 for pm8950 (hole on gpio3) 495 - gpio1-gpio8 for pm8953 (hole on gpio3 and gpio6) 496 - gpio1-gpio22 for pm8994 497 - gpio1-gpio26 for pm8998 498 - gpio1-gpio22 for pma8084 499 - gpio1-gpio14 for pmcx0102 500 - gpio1-gpio4 for pmd8028 501 - gpio1-gpio4 for pmg1110 502 - gpio1-gpio18 for pmh0101 503 - gpio1-gpio8 for pmh0104 504 - gpio1-gpio14 for pmh0110 505 - gpio1-gpio8 for pmi632 506 - gpio1-gpio2 for pmi8950 507 - gpio1-gpio10 for pmi8994 508 - gpio1-gpio18 for pmih0108 509 - gpio1-gpio4 for pmk8350 510 - gpio1-gpio6 for pmk8550 511 - gpio1-gpio8 for pmk8850 512 - gpio1-gpio10 for pmm8155au 513 - gpio1-gpio12 for pmm8654au 514 - gpio1-gpio12 for pmp8074 (holes on gpio1 and gpio12) 515 - gpio1-gpio4 for pmr735a 516 - gpio1-gpio4 for pmr735b 517 - gpio1-gpio2 for pmr735d 518 - gpio1-gpio12 for pms405 (holes on gpio1, gpio9 519 and gpio10) 520 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10 521 and gpio11) 522 - gpio1-gpio16 for pmx65 523 - gpio1-gpio16 for pmx75 524 - gpio1-gpio12 for pmxr2230 525 526 items: 527 pattern: '^gpio([0-9]+)$' 528 529 function: 530 items: 531 - enum: 532 - normal 533 - paired 534 - func1 535 - func2 536 - dtest1 537 - dtest2 538 - dtest3 539 - dtest4 540 - func3 # supported by LV/MV GPIO subtypes 541 - func4 # supported by LV/MV GPIO subtypes 542 543 bias-disable: true 544 bias-pull-down: true 545 bias-pull-up: true 546 547 qcom,pull-up-strength: 548 $ref: /schemas/types.yaml#/definitions/uint32 549 description: 550 Specifies the strength to use for pull up, if selected. 551 Valid values are defined in 552 <dt-bindings/pinctrl/qcom,pmic-gpio.h> 553 If this property is omitted 30uA strength will be used 554 if pull up is selected 555 enum: [0, 1, 2, 3] 556 557 bias-high-impedance: true 558 input-enable: true 559 input-disable: true 560 output-high: true 561 output-low: true 562 output-enable: true 563 output-disable: true 564 power-source: true 565 566 qcom,drive-strength: 567 $ref: /schemas/types.yaml#/definitions/uint32 568 description: 569 Selects the drive strength for the specified pins 570 Valid drive strength values are defined in 571 <dt-bindings/pinctrl/qcom,pmic-gpio.h> 572 enum: [0, 1, 2, 3] 573 574 drive-push-pull: true 575 drive-open-drain: true 576 drive-open-source: true 577 578 qcom,analog-pass: 579 $ref: /schemas/types.yaml#/definitions/flag 580 description: 581 The specified pins are configured in 582 analog-pass-through mode. 583 584 qcom,atest: 585 $ref: /schemas/types.yaml#/definitions/uint32 586 description: 587 Selects ATEST rail to route to GPIO when it's 588 configured in analog-pass-through mode. 589 enum: [1, 2, 3, 4] 590 591 qcom,dtest-buffer: 592 $ref: /schemas/types.yaml#/definitions/uint32 593 description: 594 Selects DTEST rail to route to GPIO when it's 595 configured as digital input. 596 enum: [1, 2, 3, 4] 597 598 required: 599 - pins 600 - function 601 602 additionalProperties: false 603 604examples: 605 - | 606 #include <dt-bindings/gpio/gpio.h> 607 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> 608 609 pm8921_gpio: gpio@150 { 610 compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio"; 611 reg = <0x150 0x160>; 612 interrupt-controller; 613 #interrupt-cells = <2>; 614 gpio-controller; 615 gpio-ranges = <&pm8921_gpio 0 0 44>; 616 #gpio-cells = <2>; 617 618 pm8921_gpio_keys: gpio-keys-state { 619 volume-keys-pins { 620 pins = "gpio20", "gpio21"; 621 function = "normal"; 622 623 input-enable; 624 bias-pull-up; 625 drive-push-pull; 626 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>; 627 power-source = <PM8921_GPIO_S4>; 628 }; 629 }; 630 631 otg-hog { 632 gpio-hog; 633 gpios = <35 GPIO_ACTIVE_HIGH>; 634 output-high; 635 line-name = "otg-gpio"; 636 }; 637 }; 638... 639