Lines Matching +full:gpio +full:- +full:cfg
1 /* SPDX-License-Identifier: GPL-2.0
12 #include <linux/pinctrl/pinconf-generic.h>
119 * - name: Register name (unused, for documentation purposes only)
120 * - r: Physical register address
121 * - r_width: Width of the register (in bits)
122 * - f_width: Width of the fixed-width register fields (in bits)
123 * - ids: For each register field (from left to right, i.e. MSB to LSB),
137 * - name: Register name (unused, for documentation purposes only)
138 * - r: Physical register address
139 * - r_width: Width of the register (in bits)
140 * - f_widths: List of widths of the register fields (in bits), from left
143 * - ids: For each non-reserved register field (from left to right, i.e. MSB
170 u32 puen; /* Pull-enable or pull-up control register */
171 u32 pud; /* Pull-up/down or pull-down control register */
192 * - name: Register name (unused, for documentation purposes only)
193 * - r: Physical register address
194 * - r_width: Width of the register (in bits)
195 * - ids: For each register bit (from left to right, i.e. MSB to LSB), one
210 * - ids...: List of GPIOs that are mapped to the same IRQ
213 .gpios = (const short []) { ids, -1 } \
245 struct sh_pfc_chip *gpio; member
340 /* -----------------------------------------------------------------------------
350 * - data_or_mark: *_DATA or *_MARK enum ID
351 * - ids...: List of enum IDs to associate with data_or_mark
356 * Describe a pinmux configuration without GPIO function that needs
358 * - ipsr: IPSR field (unused, for documentation purposes only)
359 * - fn: Function name, referring to a field in the IPSR
365 * Describe a pinmux configuration with GPIO function that needs configuration
367 * GPIO/Peripheral Function Select Register (GPSR)
368 * - ipsr: IPSR field
369 * - fn: Function name, also referring to the IPSR field
375 * Describe a pinmux configuration without GPIO function that needs
378 * - ipsr: IPSR field (unused, for documentation purposes only)
379 * - fn: Function name, also referring to the IPSR field
380 * - msel: Module selector
386 * Describe a pinmux configuration with GPIO function where the pinmux function
389 * - gpsr: GPSR field
390 * - fn: Function name, also referring to the GPSR field
391 * - gsel: Group selector
397 * Describe a pinmux configuration with GPIO function that needs configuration
398 * in both a Peripheral Function Select Register (IPSR) and a GPIO/Peripheral
401 * - ipsr: IPSR field
402 * - fn: Function name, also referring to the IPSR field
403 * - msel: Module selector
412 * - ipsr: IPSR field
413 * - fn: Function name, also referring to the IPSR field
414 * - psel: Physical multiplexing selector
415 * - msel: Module selector
423 * - ipsr: IPSR field
424 * - fn: Function name
425 * - psel: Physical multiplexing selector
431 * Describe a pinmux configuration for a single-function pin with GPIO
433 * - fn: Function name
442 #define PORT_GP_CFG_1(bank, pin, fn, sfx, cfg) \ argument
443 fn(bank, pin, GP_##bank##_##pin, sfx, cfg)
446 #define PORT_GP_CFG_2(bank, fn, sfx, cfg) \ argument
447 PORT_GP_CFG_1(bank, 0, fn, sfx, cfg), \
448 PORT_GP_CFG_1(bank, 1, fn, sfx, cfg)
451 #define PORT_GP_CFG_4(bank, fn, sfx, cfg) \ argument
452 PORT_GP_CFG_2(bank, fn, sfx, cfg), \
453 PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), \
454 PORT_GP_CFG_1(bank, 3, fn, sfx, cfg)
457 #define PORT_GP_CFG_6(bank, fn, sfx, cfg) \ argument
458 PORT_GP_CFG_4(bank, fn, sfx, cfg), \
459 PORT_GP_CFG_1(bank, 4, fn, sfx, cfg), \
460 PORT_GP_CFG_1(bank, 5, fn, sfx, cfg)
463 #define PORT_GP_CFG_7(bank, fn, sfx, cfg) \ argument
464 PORT_GP_CFG_6(bank, fn, sfx, cfg), \
465 PORT_GP_CFG_1(bank, 6, fn, sfx, cfg)
468 #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ argument
469 PORT_GP_CFG_7(bank, fn, sfx, cfg), \
470 PORT_GP_CFG_1(bank, 7, fn, sfx, cfg)
473 #define PORT_GP_CFG_9(bank, fn, sfx, cfg) \ argument
474 PORT_GP_CFG_8(bank, fn, sfx, cfg), \
475 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg)
478 #define PORT_GP_CFG_10(bank, fn, sfx, cfg) \ argument
479 PORT_GP_CFG_9(bank, fn, sfx, cfg), \
480 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg)
483 #define PORT_GP_CFG_11(bank, fn, sfx, cfg) \ argument
484 PORT_GP_CFG_10(bank, fn, sfx, cfg), \
485 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg)
488 #define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ argument
489 PORT_GP_CFG_11(bank, fn, sfx, cfg), \
490 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
493 #define PORT_GP_CFG_13(bank, fn, sfx, cfg) \ argument
494 PORT_GP_CFG_12(bank, fn, sfx, cfg), \
495 PORT_GP_CFG_1(bank, 12, fn, sfx, cfg)
498 #define PORT_GP_CFG_14(bank, fn, sfx, cfg) \ argument
499 PORT_GP_CFG_13(bank, fn, sfx, cfg), \
500 PORT_GP_CFG_1(bank, 13, fn, sfx, cfg)
503 #define PORT_GP_CFG_15(bank, fn, sfx, cfg) \ argument
504 PORT_GP_CFG_14(bank, fn, sfx, cfg), \
505 PORT_GP_CFG_1(bank, 14, fn, sfx, cfg)
508 #define PORT_GP_CFG_16(bank, fn, sfx, cfg) \ argument
509 PORT_GP_CFG_15(bank, fn, sfx, cfg), \
510 PORT_GP_CFG_1(bank, 15, fn, sfx, cfg)
513 #define PORT_GP_CFG_17(bank, fn, sfx, cfg) \ argument
514 PORT_GP_CFG_16(bank, fn, sfx, cfg), \
515 PORT_GP_CFG_1(bank, 16, fn, sfx, cfg)
518 #define PORT_GP_CFG_18(bank, fn, sfx, cfg) \ argument
519 PORT_GP_CFG_17(bank, fn, sfx, cfg), \
520 PORT_GP_CFG_1(bank, 17, fn, sfx, cfg)
523 #define PORT_GP_CFG_19(bank, fn, sfx, cfg) \ argument
524 PORT_GP_CFG_18(bank, fn, sfx, cfg), \
525 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg)
528 #define PORT_GP_CFG_20(bank, fn, sfx, cfg) \ argument
529 PORT_GP_CFG_19(bank, fn, sfx, cfg), \
530 PORT_GP_CFG_1(bank, 19, fn, sfx, cfg)
533 #define PORT_GP_CFG_21(bank, fn, sfx, cfg) \ argument
534 PORT_GP_CFG_20(bank, fn, sfx, cfg), \
535 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg)
538 #define PORT_GP_CFG_22(bank, fn, sfx, cfg) \ argument
539 PORT_GP_CFG_21(bank, fn, sfx, cfg), \
540 PORT_GP_CFG_1(bank, 21, fn, sfx, cfg)
543 #define PORT_GP_CFG_23(bank, fn, sfx, cfg) \ argument
544 PORT_GP_CFG_22(bank, fn, sfx, cfg), \
545 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg)
548 #define PORT_GP_CFG_24(bank, fn, sfx, cfg) \ argument
549 PORT_GP_CFG_23(bank, fn, sfx, cfg), \
550 PORT_GP_CFG_1(bank, 23, fn, sfx, cfg)
553 #define PORT_GP_CFG_25(bank, fn, sfx, cfg) \ argument
554 PORT_GP_CFG_24(bank, fn, sfx, cfg), \
555 PORT_GP_CFG_1(bank, 24, fn, sfx, cfg)
558 #define PORT_GP_CFG_26(bank, fn, sfx, cfg) \ argument
559 PORT_GP_CFG_25(bank, fn, sfx, cfg), \
560 PORT_GP_CFG_1(bank, 25, fn, sfx, cfg)
563 #define PORT_GP_CFG_27(bank, fn, sfx, cfg) \ argument
564 PORT_GP_CFG_26(bank, fn, sfx, cfg), \
565 PORT_GP_CFG_1(bank, 26, fn, sfx, cfg)
568 #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ argument
569 PORT_GP_CFG_27(bank, fn, sfx, cfg), \
570 PORT_GP_CFG_1(bank, 27, fn, sfx, cfg)
573 #define PORT_GP_CFG_29(bank, fn, sfx, cfg) \ argument
574 PORT_GP_CFG_28(bank, fn, sfx, cfg), \
575 PORT_GP_CFG_1(bank, 28, fn, sfx, cfg)
578 #define PORT_GP_CFG_30(bank, fn, sfx, cfg) \ argument
579 PORT_GP_CFG_29(bank, fn, sfx, cfg), \
580 PORT_GP_CFG_1(bank, 29, fn, sfx, cfg)
583 #define PORT_GP_CFG_31(bank, fn, sfx, cfg) \ argument
584 PORT_GP_CFG_30(bank, fn, sfx, cfg), \
585 PORT_GP_CFG_1(bank, 30, fn, sfx, cfg)
588 #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ argument
589 PORT_GP_CFG_31(bank, fn, sfx, cfg), \
590 PORT_GP_CFG_1(bank, 31, fn, sfx, cfg)
611 /* GP_ALL(suffix) - Expand to a list of GP_#_#_suffix */
612 #define _GP_ALL(bank, pin, name, sfx, cfg) name##_##sfx argument
615 /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
616 #define _GP_GPIO(bank, _pin, _name, sfx, cfg) { \ argument
620 .configs = cfg, \
624 /* PINMUX_DATA_GP_ALL - Expand to a list of name_DATA, name_FN marks */
625 #define _GP_DATA(bank, pin, name, sfx, cfg) PINMUX_DATA(name##_DATA, name##_FN) argument
629 * GP_ASSIGN_LAST() - Expand to an enum definition for the last GP pin
637 #define _GP_ENTRY(bank, pin, name, sfx, cfg) \ argument
666 /* PORT_ALL(suffix) - Expand to a list of PORT_#_suffix */
670 /* PINMUX_GPIO - Expand to a sh_pfc_pin entry */
673 .pin = (u16)-1, \
678 /* SH_PFC_PIN_CFG - Expand to a sh_pfc_pin entry (named PORT#) with config */
686 /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0,
695 * PORT_ASSIGN_LAST() - Expand to an enum definition for the last PORT pin
712 /* GPIO_FN(name) - Expand to a sh_pfc_pin entry for a function GPIO */
713 #define PINMUX_GPIO_FN(gpio, base, data_or_mark) \ argument
714 [gpio - (base)] = { \
715 .name = __stringify(gpio), \
722 * Pins not associated with a GPIO port
725 #define PIN_NOGP_CFG(pin, name, fn, cfg) fn(pin, name, cfg) argument
728 /* NOGP_ALL - Expand to a list of PIN_id */
729 #define _NOGP_ALL(pin, name, cfg) PIN_##pin argument
732 /* PINMUX_NOGP_ALL - Expand to a list of sh_pfc_pin entries */
733 #define _NOGP_PINMUX(_pin, _name, cfg) { \ argument
736 .configs = SH_PFC_PIN_CFG_NO_GPIO | cfg, \
741 * PORTnCR helper macro for SH-Mobile/R-Mobile
744 PINMUX_CFG_REG_VAR("PORT" nr "CR", reg, 8, GROUP(-2, 2, -1, 3), \
759 * GPIO number helper macro for R-Car