Lines Matching +full:gpio +full:- +full:bank +full:- +full:widths

1 /* SPDX-License-Identifier: GPL-2.0
12 #include <linux/pinctrl/pinconf-generic.h>
122 * - name: Register name (unused, for documentation purposes only)
123 * - r: Physical register address
124 * - r_width: Width of the register (in bits)
125 * - f_width: Width of the fixed-width register fields (in bits)
126 * - ids: For each register field (from left to right, i.e. MSB to LSB),
139 * Describe a config register consisting of several fields of different widths
140 * - name: Register name (unused, for documentation purposes only)
141 * - r: Physical register address
142 * - r_width: Width of the register (in bits)
143 * - f_widths: List of widths of the register fields (in bits), from left
146 * - ids: For each non-reserved register field (from left to right, i.e. MSB
173 u32 puen; /* Pull-enable or pull-up control register */
174 u32 pud; /* Pull-up/down or pull-down control register */
195 * - name: Register name (unused, for documentation purposes only)
196 * - r: Physical register address
197 * - r_width: Width of the register (in bits)
198 * - ids: For each register bit (from left to right, i.e. MSB to LSB), one
213 * - ids...: List of GPIOs that are mapped to the same IRQ
216 .gpios = (const short []) { ids, -1 } \
248 struct sh_pfc_chip *gpio; member
343 /* -----------------------------------------------------------------------------
353 * - data_or_mark: *_DATA or *_MARK enum ID
354 * - ids...: List of enum IDs to associate with data_or_mark
359 * Describe a pinmux configuration without GPIO function that needs
361 * - ipsr: IPSR field (unused, for documentation purposes only)
362 * - fn: Function name, referring to a field in the IPSR
368 * Describe a pinmux configuration with GPIO function that needs configuration
370 * GPIO/Peripheral Function Select Register (GPSR)
371 * - ipsr: IPSR field
372 * - fn: Function name, also referring to the IPSR field
378 * Describe a pinmux configuration without GPIO function that needs
381 * - ipsr: IPSR field (unused, for documentation purposes only)
382 * - fn: Function name, also referring to the IPSR field
383 * - msel: Module selector
389 * Describe a pinmux configuration with GPIO function where the pinmux function
392 * - gpsr: GPSR field
393 * - fn: Function name, also referring to the GPSR field
394 * - gsel: Group selector
400 * Describe a pinmux configuration with GPIO function that needs configuration
401 * in both a Peripheral Function Select Register (IPSR) and a GPIO/Peripheral
404 * - ipsr: IPSR field
405 * - fn: Function name, also referring to the IPSR field
406 * - msel: Module selector
415 * - ipsr: IPSR field
416 * - fn: Function name, also referring to the IPSR field
417 * - psel: Physical multiplexing selector
418 * - msel: Module selector
426 * - ipsr: IPSR field
427 * - fn: Function name
428 * - psel: Physical multiplexing selector
434 * Describe a pinmux configuration for a single-function pin with GPIO
436 * - fn: Function name
445 #define PORT_GP_CFG_1(bank, pin, fn, sfx, cfg) \ argument
446 fn(bank, pin, GP_##bank##_##pin, sfx, cfg)
447 #define PORT_GP_1(bank, pin, fn, sfx) PORT_GP_CFG_1(bank, pin, fn, sfx, 0) argument
449 #define PORT_GP_CFG_2(bank, fn, sfx, cfg) \ argument
450 PORT_GP_CFG_1(bank, 0, fn, sfx, cfg), \
451 PORT_GP_CFG_1(bank, 1, fn, sfx, cfg)
452 #define PORT_GP_2(bank, fn, sfx) PORT_GP_CFG_2(bank, fn, sfx, 0) argument
454 #define PORT_GP_CFG_4(bank, fn, sfx, cfg) \ argument
455 PORT_GP_CFG_2(bank, fn, sfx, cfg), \
456 PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), \
457 PORT_GP_CFG_1(bank, 3, fn, sfx, cfg)
458 #define PORT_GP_4(bank, fn, sfx) PORT_GP_CFG_4(bank, fn, sfx, 0) argument
460 #define PORT_GP_CFG_6(bank, fn, sfx, cfg) \ argument
461 PORT_GP_CFG_4(bank, fn, sfx, cfg), \
462 PORT_GP_CFG_1(bank, 4, fn, sfx, cfg), \
463 PORT_GP_CFG_1(bank, 5, fn, sfx, cfg)
464 #define PORT_GP_6(bank, fn, sfx) PORT_GP_CFG_6(bank, fn, sfx, 0) argument
466 #define PORT_GP_CFG_7(bank, fn, sfx, cfg) \ argument
467 PORT_GP_CFG_6(bank, fn, sfx, cfg), \
468 PORT_GP_CFG_1(bank, 6, fn, sfx, cfg)
469 #define PORT_GP_7(bank, fn, sfx) PORT_GP_CFG_7(bank, fn, sfx, 0) argument
471 #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ argument
472 PORT_GP_CFG_7(bank, fn, sfx, cfg), \
473 PORT_GP_CFG_1(bank, 7, fn, sfx, cfg)
474 #define PORT_GP_8(bank, fn, sfx) PORT_GP_CFG_8(bank, fn, sfx, 0) argument
476 #define PORT_GP_CFG_9(bank, fn, sfx, cfg) \ argument
477 PORT_GP_CFG_8(bank, fn, sfx, cfg), \
478 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg)
479 #define PORT_GP_9(bank, fn, sfx) PORT_GP_CFG_9(bank, fn, sfx, 0) argument
481 #define PORT_GP_CFG_10(bank, fn, sfx, cfg) \ argument
482 PORT_GP_CFG_9(bank, fn, sfx, cfg), \
483 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg)
484 #define PORT_GP_10(bank, fn, sfx) PORT_GP_CFG_10(bank, fn, sfx, 0) argument
486 #define PORT_GP_CFG_11(bank, fn, sfx, cfg) \ argument
487 PORT_GP_CFG_10(bank, fn, sfx, cfg), \
488 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg)
489 #define PORT_GP_11(bank, fn, sfx) PORT_GP_CFG_11(bank, fn, sfx, 0) argument
491 #define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ argument
492 PORT_GP_CFG_11(bank, fn, sfx, cfg), \
493 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
494 #define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0) argument
496 #define PORT_GP_CFG_13(bank, fn, sfx, cfg) \ argument
497 PORT_GP_CFG_12(bank, fn, sfx, cfg), \
498 PORT_GP_CFG_1(bank, 12, fn, sfx, cfg)
499 #define PORT_GP_13(bank, fn, sfx) PORT_GP_CFG_13(bank, fn, sfx, 0) argument
501 #define PORT_GP_CFG_14(bank, fn, sfx, cfg) \ argument
502 PORT_GP_CFG_13(bank, fn, sfx, cfg), \
503 PORT_GP_CFG_1(bank, 13, fn, sfx, cfg)
504 #define PORT_GP_14(bank, fn, sfx) PORT_GP_CFG_14(bank, fn, sfx, 0) argument
506 #define PORT_GP_CFG_15(bank, fn, sfx, cfg) \ argument
507 PORT_GP_CFG_14(bank, fn, sfx, cfg), \
508 PORT_GP_CFG_1(bank, 14, fn, sfx, cfg)
509 #define PORT_GP_15(bank, fn, sfx) PORT_GP_CFG_15(bank, fn, sfx, 0) argument
511 #define PORT_GP_CFG_16(bank, fn, sfx, cfg) \ argument
512 PORT_GP_CFG_15(bank, fn, sfx, cfg), \
513 PORT_GP_CFG_1(bank, 15, fn, sfx, cfg)
514 #define PORT_GP_16(bank, fn, sfx) PORT_GP_CFG_16(bank, fn, sfx, 0) argument
516 #define PORT_GP_CFG_17(bank, fn, sfx, cfg) \ argument
517 PORT_GP_CFG_16(bank, fn, sfx, cfg), \
518 PORT_GP_CFG_1(bank, 16, fn, sfx, cfg)
519 #define PORT_GP_17(bank, fn, sfx) PORT_GP_CFG_17(bank, fn, sfx, 0) argument
521 #define PORT_GP_CFG_18(bank, fn, sfx, cfg) \ argument
522 PORT_GP_CFG_17(bank, fn, sfx, cfg), \
523 PORT_GP_CFG_1(bank, 17, fn, sfx, cfg)
524 #define PORT_GP_18(bank, fn, sfx) PORT_GP_CFG_18(bank, fn, sfx, 0) argument
526 #define PORT_GP_CFG_19(bank, fn, sfx, cfg) \ argument
527 PORT_GP_CFG_18(bank, fn, sfx, cfg), \
528 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg)
529 #define PORT_GP_19(bank, fn, sfx) PORT_GP_CFG_19(bank, fn, sfx, 0) argument
531 #define PORT_GP_CFG_20(bank, fn, sfx, cfg) \ argument
532 PORT_GP_CFG_19(bank, fn, sfx, cfg), \
533 PORT_GP_CFG_1(bank, 19, fn, sfx, cfg)
534 #define PORT_GP_20(bank, fn, sfx) PORT_GP_CFG_20(bank, fn, sfx, 0) argument
536 #define PORT_GP_CFG_21(bank, fn, sfx, cfg) \ argument
537 PORT_GP_CFG_20(bank, fn, sfx, cfg), \
538 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg)
539 #define PORT_GP_21(bank, fn, sfx) PORT_GP_CFG_21(bank, fn, sfx, 0) argument
541 #define PORT_GP_CFG_22(bank, fn, sfx, cfg) \ argument
542 PORT_GP_CFG_21(bank, fn, sfx, cfg), \
543 PORT_GP_CFG_1(bank, 21, fn, sfx, cfg)
544 #define PORT_GP_22(bank, fn, sfx) PORT_GP_CFG_22(bank, fn, sfx, 0) argument
546 #define PORT_GP_CFG_23(bank, fn, sfx, cfg) \ argument
547 PORT_GP_CFG_22(bank, fn, sfx, cfg), \
548 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg)
549 #define PORT_GP_23(bank, fn, sfx) PORT_GP_CFG_23(bank, fn, sfx, 0) argument
551 #define PORT_GP_CFG_24(bank, fn, sfx, cfg) \ argument
552 PORT_GP_CFG_23(bank, fn, sfx, cfg), \
553 PORT_GP_CFG_1(bank, 23, fn, sfx, cfg)
554 #define PORT_GP_24(bank, fn, sfx) PORT_GP_CFG_24(bank, fn, sfx, 0) argument
556 #define PORT_GP_CFG_25(bank, fn, sfx, cfg) \ argument
557 PORT_GP_CFG_24(bank, fn, sfx, cfg), \
558 PORT_GP_CFG_1(bank, 24, fn, sfx, cfg)
559 #define PORT_GP_25(bank, fn, sfx) PORT_GP_CFG_25(bank, fn, sfx, 0) argument
561 #define PORT_GP_CFG_26(bank, fn, sfx, cfg) \ argument
562 PORT_GP_CFG_25(bank, fn, sfx, cfg), \
563 PORT_GP_CFG_1(bank, 25, fn, sfx, cfg)
564 #define PORT_GP_26(bank, fn, sfx) PORT_GP_CFG_26(bank, fn, sfx, 0) argument
566 #define PORT_GP_CFG_27(bank, fn, sfx, cfg) \ argument
567 PORT_GP_CFG_26(bank, fn, sfx, cfg), \
568 PORT_GP_CFG_1(bank, 26, fn, sfx, cfg)
569 #define PORT_GP_27(bank, fn, sfx) PORT_GP_CFG_27(bank, fn, sfx, 0) argument
571 #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ argument
572 PORT_GP_CFG_27(bank, fn, sfx, cfg), \
573 PORT_GP_CFG_1(bank, 27, fn, sfx, cfg)
574 #define PORT_GP_28(bank, fn, sfx) PORT_GP_CFG_28(bank, fn, sfx, 0) argument
576 #define PORT_GP_CFG_29(bank, fn, sfx, cfg) \ argument
577 PORT_GP_CFG_28(bank, fn, sfx, cfg), \
578 PORT_GP_CFG_1(bank, 28, fn, sfx, cfg)
579 #define PORT_GP_29(bank, fn, sfx) PORT_GP_CFG_29(bank, fn, sfx, 0) argument
581 #define PORT_GP_CFG_30(bank, fn, sfx, cfg) \ argument
582 PORT_GP_CFG_29(bank, fn, sfx, cfg), \
583 PORT_GP_CFG_1(bank, 29, fn, sfx, cfg)
584 #define PORT_GP_30(bank, fn, sfx) PORT_GP_CFG_30(bank, fn, sfx, 0) argument
586 #define PORT_GP_CFG_31(bank, fn, sfx, cfg) \ argument
587 PORT_GP_CFG_30(bank, fn, sfx, cfg), \
588 PORT_GP_CFG_1(bank, 30, fn, sfx, cfg)
589 #define PORT_GP_31(bank, fn, sfx) PORT_GP_CFG_31(bank, fn, sfx, 0) argument
591 #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ argument
592 PORT_GP_CFG_31(bank, fn, sfx, cfg), \
593 PORT_GP_CFG_1(bank, 31, fn, sfx, cfg)
594 #define PORT_GP_32(bank, fn, sfx) PORT_GP_CFG_32(bank, fn, sfx, 0) argument
596 #define PORT_GP_32_REV(bank, fn, sfx) \ argument
597 PORT_GP_1(bank, 31, fn, sfx), PORT_GP_1(bank, 30, fn, sfx), \
598 PORT_GP_1(bank, 29, fn, sfx), PORT_GP_1(bank, 28, fn, sfx), \
599 PORT_GP_1(bank, 27, fn, sfx), PORT_GP_1(bank, 26, fn, sfx), \
600 PORT_GP_1(bank, 25, fn, sfx), PORT_GP_1(bank, 24, fn, sfx), \
601 PORT_GP_1(bank, 23, fn, sfx), PORT_GP_1(bank, 22, fn, sfx), \
602 PORT_GP_1(bank, 21, fn, sfx), PORT_GP_1(bank, 20, fn, sfx), \
603 PORT_GP_1(bank, 19, fn, sfx), PORT_GP_1(bank, 18, fn, sfx), \
604 PORT_GP_1(bank, 17, fn, sfx), PORT_GP_1(bank, 16, fn, sfx), \
605 PORT_GP_1(bank, 15, fn, sfx), PORT_GP_1(bank, 14, fn, sfx), \
606 PORT_GP_1(bank, 13, fn, sfx), PORT_GP_1(bank, 12, fn, sfx), \
607 PORT_GP_1(bank, 11, fn, sfx), PORT_GP_1(bank, 10, fn, sfx), \
608 PORT_GP_1(bank, 9, fn, sfx), PORT_GP_1(bank, 8, fn, sfx), \
609 PORT_GP_1(bank, 7, fn, sfx), PORT_GP_1(bank, 6, fn, sfx), \
610 PORT_GP_1(bank, 5, fn, sfx), PORT_GP_1(bank, 4, fn, sfx), \
611 PORT_GP_1(bank, 3, fn, sfx), PORT_GP_1(bank, 2, fn, sfx), \
612 PORT_GP_1(bank, 1, fn, sfx), PORT_GP_1(bank, 0, fn, sfx)
614 /* GP_ALL(suffix) - Expand to a list of GP_#_#_suffix */
615 #define _GP_ALL(bank, pin, name, sfx, cfg) name##_##sfx argument
618 /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
619 #define _GP_GPIO(bank, _pin, _name, sfx, cfg) { \ argument
620 .pin = (bank * 32) + _pin, \
627 /* PINMUX_DATA_GP_ALL - Expand to a list of name_DATA, name_FN marks */
628 #define _GP_DATA(bank, pin, name, sfx, cfg) PINMUX_DATA(name##_DATA, name##_FN) argument
632 * GP_ASSIGN_LAST() - Expand to an enum definition for the last GP pin
640 #define _GP_ENTRY(bank, pin, name, sfx, cfg) \ argument
641 deprecated)); char name[(bank * 32) + pin] __attribute__((deprecated
669 /* PORT_ALL(suffix) - Expand to a list of PORT_#_suffix */
673 /* PINMUX_GPIO - Expand to a sh_pfc_pin entry */
676 .pin = (u16)-1, \
681 /* SH_PFC_PIN_CFG - Expand to a sh_pfc_pin entry (named PORT#) with config */
689 /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0,
698 * PORT_ASSIGN_LAST() - Expand to an enum definition for the last PORT pin
715 /* GPIO_FN(name) - Expand to a sh_pfc_pin entry for a function GPIO */
716 #define PINMUX_GPIO_FN(gpio, base, data_or_mark) \ argument
717 [gpio - (base)] = { \
718 .name = __stringify(gpio), \
725 * Pins not associated with a GPIO port
731 /* NOGP_ALL - Expand to a list of PIN_id */
735 /* PINMUX_NOGP_ALL - Expand to a list of sh_pfc_pin entries */
744 * PORTnCR helper macro for SH-Mobile/R-Mobile
747 PINMUX_CFG_REG_VAR("PORT" nr "CR", reg, 8, GROUP(-2, 2, -1, 3), \
762 * GPIO number helper macro for R-Car
764 #define RCAR_GP_PIN(bank, pin) (((bank) * 32) + (pin)) argument