Lines Matching +full:gpio +full:- +full:bank +full:- +full:widths
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),
136 * Describe a config register consisting of several fields of different widths
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
339 /* -----------------------------------------------------------------------------
349 * - data_or_mark: *_DATA or *_MARK enum ID
350 * - ids...: List of enum IDs to associate with data_or_mark
355 * Describe a pinmux configuration without GPIO function that needs
357 * - ipsr: IPSR field (unused, for documentation purposes only)
358 * - fn: Function name, referring to a field in the IPSR
364 * Describe a pinmux configuration with GPIO function that needs configuration
366 * GPIO/Peripheral Function Select Register (GPSR)
367 * - ipsr: IPSR field
368 * - fn: Function name, also referring to the IPSR field
374 * Describe a pinmux configuration without GPIO function that needs
377 * - ipsr: IPSR field (unused, for documentation purposes only)
378 * - fn: Function name, also referring to the IPSR field
379 * - msel: Module selector
385 * Describe a pinmux configuration with GPIO function where the pinmux function
388 * - gpsr: GPSR field
389 * - fn: Function name, also referring to the GPSR field
390 * - gsel: Group selector
396 * Describe a pinmux configuration with GPIO function that needs configuration
397 * in both a Peripheral Function Select Register (IPSR) and a GPIO/Peripheral
400 * - ipsr: IPSR field
401 * - fn: Function name, also referring to the IPSR field
402 * - msel: Module selector
411 * - ipsr: IPSR field
412 * - fn: Function name, also referring to the IPSR field
413 * - psel: Physical multiplexing selector
414 * - msel: Module selector
422 * - ipsr: IPSR field
423 * - fn: Function name
424 * - psel: Physical multiplexing selector
430 * Describe a pinmux configuration for a single-function pin with GPIO
432 * - fn: Function name
441 #define PORT_GP_CFG_1(bank, pin, fn, sfx, cfg) \ argument
442 fn(bank, pin, GP_##bank##_##pin, sfx, cfg)
443 #define PORT_GP_1(bank, pin, fn, sfx) PORT_GP_CFG_1(bank, pin, fn, sfx, 0) argument
445 #define PORT_GP_CFG_2(bank, fn, sfx, cfg) \ argument
446 PORT_GP_CFG_1(bank, 0, fn, sfx, cfg), \
447 PORT_GP_CFG_1(bank, 1, fn, sfx, cfg)
448 #define PORT_GP_2(bank, fn, sfx) PORT_GP_CFG_2(bank, fn, sfx, 0) argument
450 #define PORT_GP_CFG_4(bank, fn, sfx, cfg) \ argument
451 PORT_GP_CFG_2(bank, fn, sfx, cfg), \
452 PORT_GP_CFG_1(bank, 2, fn, sfx, cfg), \
453 PORT_GP_CFG_1(bank, 3, fn, sfx, cfg)
454 #define PORT_GP_4(bank, fn, sfx) PORT_GP_CFG_4(bank, fn, sfx, 0) argument
456 #define PORT_GP_CFG_6(bank, fn, sfx, cfg) \ argument
457 PORT_GP_CFG_4(bank, fn, sfx, cfg), \
458 PORT_GP_CFG_1(bank, 4, fn, sfx, cfg), \
459 PORT_GP_CFG_1(bank, 5, fn, sfx, cfg)
460 #define PORT_GP_6(bank, fn, sfx) PORT_GP_CFG_6(bank, fn, sfx, 0) argument
462 #define PORT_GP_CFG_7(bank, fn, sfx, cfg) \ argument
463 PORT_GP_CFG_6(bank, fn, sfx, cfg), \
464 PORT_GP_CFG_1(bank, 6, fn, sfx, cfg)
465 #define PORT_GP_7(bank, fn, sfx) PORT_GP_CFG_7(bank, fn, sfx, 0) argument
467 #define PORT_GP_CFG_8(bank, fn, sfx, cfg) \ argument
468 PORT_GP_CFG_7(bank, fn, sfx, cfg), \
469 PORT_GP_CFG_1(bank, 7, fn, sfx, cfg)
470 #define PORT_GP_8(bank, fn, sfx) PORT_GP_CFG_8(bank, fn, sfx, 0) argument
472 #define PORT_GP_CFG_9(bank, fn, sfx, cfg) \ argument
473 PORT_GP_CFG_8(bank, fn, sfx, cfg), \
474 PORT_GP_CFG_1(bank, 8, fn, sfx, cfg)
475 #define PORT_GP_9(bank, fn, sfx) PORT_GP_CFG_9(bank, fn, sfx, 0) argument
477 #define PORT_GP_CFG_10(bank, fn, sfx, cfg) \ argument
478 PORT_GP_CFG_9(bank, fn, sfx, cfg), \
479 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg)
480 #define PORT_GP_10(bank, fn, sfx) PORT_GP_CFG_10(bank, fn, sfx, 0) argument
482 #define PORT_GP_CFG_11(bank, fn, sfx, cfg) \ argument
483 PORT_GP_CFG_10(bank, fn, sfx, cfg), \
484 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg)
485 #define PORT_GP_11(bank, fn, sfx) PORT_GP_CFG_11(bank, fn, sfx, 0) argument
487 #define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ argument
488 PORT_GP_CFG_11(bank, fn, sfx, cfg), \
489 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
490 #define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0) argument
492 #define PORT_GP_CFG_13(bank, fn, sfx, cfg) \ argument
493 PORT_GP_CFG_12(bank, fn, sfx, cfg), \
494 PORT_GP_CFG_1(bank, 12, fn, sfx, cfg)
495 #define PORT_GP_13(bank, fn, sfx) PORT_GP_CFG_13(bank, fn, sfx, 0) argument
497 #define PORT_GP_CFG_14(bank, fn, sfx, cfg) \ argument
498 PORT_GP_CFG_13(bank, fn, sfx, cfg), \
499 PORT_GP_CFG_1(bank, 13, fn, sfx, cfg)
500 #define PORT_GP_14(bank, fn, sfx) PORT_GP_CFG_14(bank, fn, sfx, 0) argument
502 #define PORT_GP_CFG_15(bank, fn, sfx, cfg) \ argument
503 PORT_GP_CFG_14(bank, fn, sfx, cfg), \
504 PORT_GP_CFG_1(bank, 14, fn, sfx, cfg)
505 #define PORT_GP_15(bank, fn, sfx) PORT_GP_CFG_15(bank, fn, sfx, 0) argument
507 #define PORT_GP_CFG_16(bank, fn, sfx, cfg) \ argument
508 PORT_GP_CFG_15(bank, fn, sfx, cfg), \
509 PORT_GP_CFG_1(bank, 15, fn, sfx, cfg)
510 #define PORT_GP_16(bank, fn, sfx) PORT_GP_CFG_16(bank, fn, sfx, 0) argument
512 #define PORT_GP_CFG_17(bank, fn, sfx, cfg) \ argument
513 PORT_GP_CFG_16(bank, fn, sfx, cfg), \
514 PORT_GP_CFG_1(bank, 16, fn, sfx, cfg)
515 #define PORT_GP_17(bank, fn, sfx) PORT_GP_CFG_17(bank, fn, sfx, 0) argument
517 #define PORT_GP_CFG_18(bank, fn, sfx, cfg) \ argument
518 PORT_GP_CFG_17(bank, fn, sfx, cfg), \
519 PORT_GP_CFG_1(bank, 17, fn, sfx, cfg)
520 #define PORT_GP_18(bank, fn, sfx) PORT_GP_CFG_18(bank, fn, sfx, 0) argument
522 #define PORT_GP_CFG_19(bank, fn, sfx, cfg) \ argument
523 PORT_GP_CFG_18(bank, fn, sfx, cfg), \
524 PORT_GP_CFG_1(bank, 18, fn, sfx, cfg)
525 #define PORT_GP_19(bank, fn, sfx) PORT_GP_CFG_19(bank, fn, sfx, 0) argument
527 #define PORT_GP_CFG_20(bank, fn, sfx, cfg) \ argument
528 PORT_GP_CFG_19(bank, fn, sfx, cfg), \
529 PORT_GP_CFG_1(bank, 19, fn, sfx, cfg)
530 #define PORT_GP_20(bank, fn, sfx) PORT_GP_CFG_20(bank, fn, sfx, 0) argument
532 #define PORT_GP_CFG_21(bank, fn, sfx, cfg) \ argument
533 PORT_GP_CFG_20(bank, fn, sfx, cfg), \
534 PORT_GP_CFG_1(bank, 20, fn, sfx, cfg)
535 #define PORT_GP_21(bank, fn, sfx) PORT_GP_CFG_21(bank, fn, sfx, 0) argument
537 #define PORT_GP_CFG_22(bank, fn, sfx, cfg) \ argument
538 PORT_GP_CFG_21(bank, fn, sfx, cfg), \
539 PORT_GP_CFG_1(bank, 21, fn, sfx, cfg)
540 #define PORT_GP_22(bank, fn, sfx) PORT_GP_CFG_22(bank, fn, sfx, 0) argument
542 #define PORT_GP_CFG_23(bank, fn, sfx, cfg) \ argument
543 PORT_GP_CFG_22(bank, fn, sfx, cfg), \
544 PORT_GP_CFG_1(bank, 22, fn, sfx, cfg)
545 #define PORT_GP_23(bank, fn, sfx) PORT_GP_CFG_23(bank, fn, sfx, 0) argument
547 #define PORT_GP_CFG_24(bank, fn, sfx, cfg) \ argument
548 PORT_GP_CFG_23(bank, fn, sfx, cfg), \
549 PORT_GP_CFG_1(bank, 23, fn, sfx, cfg)
550 #define PORT_GP_24(bank, fn, sfx) PORT_GP_CFG_24(bank, fn, sfx, 0) argument
552 #define PORT_GP_CFG_25(bank, fn, sfx, cfg) \ argument
553 PORT_GP_CFG_24(bank, fn, sfx, cfg), \
554 PORT_GP_CFG_1(bank, 24, fn, sfx, cfg)
555 #define PORT_GP_25(bank, fn, sfx) PORT_GP_CFG_25(bank, fn, sfx, 0) argument
557 #define PORT_GP_CFG_26(bank, fn, sfx, cfg) \ argument
558 PORT_GP_CFG_25(bank, fn, sfx, cfg), \
559 PORT_GP_CFG_1(bank, 25, fn, sfx, cfg)
560 #define PORT_GP_26(bank, fn, sfx) PORT_GP_CFG_26(bank, fn, sfx, 0) argument
562 #define PORT_GP_CFG_27(bank, fn, sfx, cfg) \ argument
563 PORT_GP_CFG_26(bank, fn, sfx, cfg), \
564 PORT_GP_CFG_1(bank, 26, fn, sfx, cfg)
565 #define PORT_GP_27(bank, fn, sfx) PORT_GP_CFG_27(bank, fn, sfx, 0) argument
567 #define PORT_GP_CFG_28(bank, fn, sfx, cfg) \ argument
568 PORT_GP_CFG_27(bank, fn, sfx, cfg), \
569 PORT_GP_CFG_1(bank, 27, fn, sfx, cfg)
570 #define PORT_GP_28(bank, fn, sfx) PORT_GP_CFG_28(bank, fn, sfx, 0) argument
572 #define PORT_GP_CFG_29(bank, fn, sfx, cfg) \ argument
573 PORT_GP_CFG_28(bank, fn, sfx, cfg), \
574 PORT_GP_CFG_1(bank, 28, fn, sfx, cfg)
575 #define PORT_GP_29(bank, fn, sfx) PORT_GP_CFG_29(bank, fn, sfx, 0) argument
577 #define PORT_GP_CFG_30(bank, fn, sfx, cfg) \ argument
578 PORT_GP_CFG_29(bank, fn, sfx, cfg), \
579 PORT_GP_CFG_1(bank, 29, fn, sfx, cfg)
580 #define PORT_GP_30(bank, fn, sfx) PORT_GP_CFG_30(bank, fn, sfx, 0) argument
582 #define PORT_GP_CFG_31(bank, fn, sfx, cfg) \ argument
583 PORT_GP_CFG_30(bank, fn, sfx, cfg), \
584 PORT_GP_CFG_1(bank, 30, fn, sfx, cfg)
585 #define PORT_GP_31(bank, fn, sfx) PORT_GP_CFG_31(bank, fn, sfx, 0) argument
587 #define PORT_GP_CFG_32(bank, fn, sfx, cfg) \ argument
588 PORT_GP_CFG_31(bank, fn, sfx, cfg), \
589 PORT_GP_CFG_1(bank, 31, fn, sfx, cfg)
590 #define PORT_GP_32(bank, fn, sfx) PORT_GP_CFG_32(bank, fn, sfx, 0) argument
592 #define PORT_GP_32_REV(bank, fn, sfx) \ argument
593 PORT_GP_1(bank, 31, fn, sfx), PORT_GP_1(bank, 30, fn, sfx), \
594 PORT_GP_1(bank, 29, fn, sfx), PORT_GP_1(bank, 28, fn, sfx), \
595 PORT_GP_1(bank, 27, fn, sfx), PORT_GP_1(bank, 26, fn, sfx), \
596 PORT_GP_1(bank, 25, fn, sfx), PORT_GP_1(bank, 24, fn, sfx), \
597 PORT_GP_1(bank, 23, fn, sfx), PORT_GP_1(bank, 22, fn, sfx), \
598 PORT_GP_1(bank, 21, fn, sfx), PORT_GP_1(bank, 20, fn, sfx), \
599 PORT_GP_1(bank, 19, fn, sfx), PORT_GP_1(bank, 18, fn, sfx), \
600 PORT_GP_1(bank, 17, fn, sfx), PORT_GP_1(bank, 16, fn, sfx), \
601 PORT_GP_1(bank, 15, fn, sfx), PORT_GP_1(bank, 14, fn, sfx), \
602 PORT_GP_1(bank, 13, fn, sfx), PORT_GP_1(bank, 12, fn, sfx), \
603 PORT_GP_1(bank, 11, fn, sfx), PORT_GP_1(bank, 10, fn, sfx), \
604 PORT_GP_1(bank, 9, fn, sfx), PORT_GP_1(bank, 8, fn, sfx), \
605 PORT_GP_1(bank, 7, fn, sfx), PORT_GP_1(bank, 6, fn, sfx), \
606 PORT_GP_1(bank, 5, fn, sfx), PORT_GP_1(bank, 4, fn, sfx), \
607 PORT_GP_1(bank, 3, fn, sfx), PORT_GP_1(bank, 2, fn, sfx), \
608 PORT_GP_1(bank, 1, fn, sfx), PORT_GP_1(bank, 0, fn, sfx)
610 /* GP_ALL(suffix) - Expand to a list of GP_#_#_suffix */
611 #define _GP_ALL(bank, pin, name, sfx, cfg) name##_##sfx argument
614 /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
615 #define _GP_GPIO(bank, _pin, _name, sfx, cfg) { \ argument
616 .pin = (bank * 32) + _pin, \
623 /* PINMUX_DATA_GP_ALL - Expand to a list of name_DATA, name_FN marks */
624 #define _GP_DATA(bank, pin, name, sfx, cfg) PINMUX_DATA(name##_DATA, name##_FN) argument
628 * GP_ASSIGN_LAST() - Expand to an enum definition for the last GP pin
636 #define _GP_ENTRY(bank, pin, name, sfx, cfg) \ argument
637 deprecated)); char name[(bank * 32) + pin] __attribute__((deprecated
665 /* PORT_ALL(suffix) - Expand to a list of PORT_#_suffix */
669 /* PINMUX_GPIO - Expand to a sh_pfc_pin entry */
672 .pin = (u16)-1, \
677 /* SH_PFC_PIN_CFG - Expand to a sh_pfc_pin entry (named PORT#) with config */
685 /* PINMUX_DATA_ALL - Expand to a list of PORT_name_DATA, PORT_name_FN0,
694 * PORT_ASSIGN_LAST() - Expand to an enum definition for the last PORT pin
711 /* GPIO_FN(name) - Expand to a sh_pfc_pin entry for a function GPIO */
712 #define PINMUX_GPIO_FN(gpio, base, data_or_mark) \ argument
713 [gpio - (base)] = { \
714 .name = __stringify(gpio), \
721 * Pins not associated with a GPIO port
727 /* NOGP_ALL - Expand to a list of PIN_id */
731 /* PINMUX_NOGP_ALL - Expand to a list of sh_pfc_pin entries */
740 * PORTnCR helper macro for SH-Mobile/R-Mobile
743 PINMUX_CFG_REG_VAR("PORT" nr "CR", reg, 8, GROUP(-2, 2, -1, 3), \
758 * GPIO number helper macro for R-Car
760 #define RCAR_GP_PIN(bank, pin) (((bank) * 32) + (pin)) argument