Skip to content

Commit 55b1cb1

Browse files
committed
pinctrl: sh-pfc: sh7264: Fix CAN function GPIOs
pinmux_func_gpios[] contains a hole due to the missing function GPIO definition for the "CTX0&CTX1" signal, which is the logical "AND" of the two CAN outputs. Fix this by: - Renaming CRX0_CRX1_MARK to CTX0_CTX1_MARK, as PJ2MD[2:0]=010 configures the combined "CTX0&CTX1" output signal, - Renaming CRX0X1_MARK to CRX0_CRX1_MARK, as PJ3MD[1:0]=10 configures the shared "CRX0/CRX1" input signal, which is fed to both CAN inputs, - Adding the missing function GPIO definition for "CTX0&CTX1" to pinmux_func_gpios[], - Moving all CAN enums next to each other. See SH7262 Group, SH7264 Group User's Manual: Hardware, Rev. 4.00: [1] Figure 1.2 (3) (Pin Assignment for the SH7264 Group (1-Mbyte Version), [2] Figure 1.2 (4) Pin Assignment for the SH7264 Group (640-Kbyte Version, [3] Table 1.4 List of Pins, [4] Figure 20.29 Connection Example when Using This Module as 1-Channel Module (64 Mailboxes x 1 Channel), [5] Table 32.10 Multiplexed Pins (Port J), [6] Section 32.2.30 (3) Port J Control Register 0 (PJCR0). Note that the last 2 disagree about PJ2MD[2:0], which is probably the root cause of this bug. But considering [4], "CTx0&CTx1" in [5] must be correct, and "CRx0&CRx1" in [6] must be wrong. Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2a069a9 commit 55b1cb1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/pinctrl/sh-pfc/pfc-sh7264.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,17 +497,15 @@ enum {
497497
SD_WP_MARK, SD_CLK_MARK, SD_CMD_MARK,
498498
CRX0_MARK, CRX1_MARK,
499499
CTX0_MARK, CTX1_MARK,
500+
CRX0_CRX1_MARK, CTX0_CTX1_MARK,
500501

501502
PWM1A_MARK, PWM1B_MARK, PWM1C_MARK, PWM1D_MARK,
502503
PWM1E_MARK, PWM1F_MARK, PWM1G_MARK, PWM1H_MARK,
503504
PWM2A_MARK, PWM2B_MARK, PWM2C_MARK, PWM2D_MARK,
504505
PWM2E_MARK, PWM2F_MARK, PWM2G_MARK, PWM2H_MARK,
505506
IERXD_MARK, IETXD_MARK,
506-
CRX0_CRX1_MARK,
507507
WDTOVF_MARK,
508508

509-
CRX0X1_MARK,
510-
511509
/* DMAC */
512510
TEND0_MARK, DACK0_MARK, DREQ0_MARK,
513511
TEND1_MARK, DACK1_MARK, DREQ1_MARK,
@@ -995,12 +993,12 @@ static const u16 pinmux_data[] = {
995993

996994
PINMUX_DATA(PJ3_DATA, PJ3MD_00),
997995
PINMUX_DATA(CRX1_MARK, PJ3MD_01),
998-
PINMUX_DATA(CRX0X1_MARK, PJ3MD_10),
996+
PINMUX_DATA(CRX0_CRX1_MARK, PJ3MD_10),
999997
PINMUX_DATA(IRQ1_PJ_MARK, PJ3MD_11),
1000998

1001999
PINMUX_DATA(PJ2_DATA, PJ2MD_000),
10021000
PINMUX_DATA(CTX1_MARK, PJ2MD_001),
1003-
PINMUX_DATA(CRX0_CRX1_MARK, PJ2MD_010),
1001+
PINMUX_DATA(CTX0_CTX1_MARK, PJ2MD_010),
10041002
PINMUX_DATA(CS2_MARK, PJ2MD_011),
10051003
PINMUX_DATA(SCK0_MARK, PJ2MD_100),
10061004
PINMUX_DATA(LCD_M_DISP_MARK, PJ2MD_101),
@@ -1245,6 +1243,7 @@ static const struct pinmux_func pinmux_func_gpios[] = {
12451243
GPIO_FN(CTX1),
12461244
GPIO_FN(CRX1),
12471245
GPIO_FN(CTX0),
1246+
GPIO_FN(CTX0_CTX1),
12481247
GPIO_FN(CRX0),
12491248
GPIO_FN(CRX0_CRX1),
12501249

0 commit comments

Comments
 (0)