Lines Matching +full:gpio +full:- +full:cfg
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),
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
623 .configs = cfg, \
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
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
728 #define PIN_NOGP_CFG(pin, name, fn, cfg) fn(pin, name, cfg) argument
731 /* NOGP_ALL - Expand to a list of PIN_id */
732 #define _NOGP_ALL(pin, name, cfg) PIN_##pin argument
735 /* PINMUX_NOGP_ALL - Expand to a list of sh_pfc_pin entries */
736 #define _NOGP_PINMUX(_pin, _name, cfg) { \ argument
739 .configs = SH_PFC_PIN_CFG_NO_GPIO | cfg, \
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