Skip to content

RFC pinctrl: ralink: fix ABI, improve driver, move to mediatek, improve dt-bindings

[email protected] linux-arm-kernel linux-devicetree linux-gpio linux-mediatek linux-mips lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest16 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible stringdrivers/pinctrl/ralink/pinctrl-mt7620.c drivers/pinctrl/ralink/pinctrl-mt7621.c drivers/pinctrl/ralink/pinctrl-rt2880.c +2 more+5 -00 replies
2/16pinctrl: ralink: add mediatek compatible stringsdrivers/pinctrl/ralink/pinctrl-mt7620.c drivers/pinctrl/ralink/pinctrl-mt7621.c drivers/pinctrl/ralink/pinctrl-rt2880.c +2 more+5 -00 replies
3/16pinctrl: ralink: rt305x: add compatible string for every SoCdrivers/pinctrl/ralink/pinctrl-rt305x.c+2 -00 replies
4/16pinctrl: ralink: mt7620: split out to mt76x8drivers/pinctrl/ralink/Kconfig drivers/pinctrl/ralink/Makefile drivers/pinctrl/ralink/pinctrl-mt7620.c +1 more+290 -2560 replies
5/16pinctrl: ralink: move to mediatek as mtmipsdrivers/pinctrl/Kconfig drivers/pinctrl/Makefile drivers/pinctrl/mediatek/Kconfig +11 more+246 -2410 replies
6/16pinctrl: mediatek: remove OF_GPIO as reverse dependencydrivers/pinctrl/mediatek/Kconfig+0 -30 replies
7/16dt-bindings: pinctrl: ralink: add new compatible stringsDocumentation/devicetree/bindings/pinctrl/ralink,mt7620-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/ralink,mt7621-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinctrl.yaml +2 more+25 -1017 replies
8/16dt-bindings: pinctrl: ralink: rename to mediatekDocumentation/devicetree/bindings/pinctrl/mediatek,mt7620-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,mt7621-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,rt2880-pinctrl.yaml +2 more+15 -150 replies
9/16dt-bindings: pinctrl: mediatek: rt305x: split bindingDocumentation/devicetree/bindings/pinctrl/mediatek,rt305x-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,rt3352-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,rt5350-pinctrl.yaml+462 -732 replies
10/16dt-bindings: pinctrl: mediatek: mt7620: split bindingDocumentation/devicetree/bindings/pinctrl/mediatek,mt7620-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,mt76x8-pinctrl.yaml+462 -3672 replies
11/16MAINTAINERS: move ralink pinctrl to mediatek mips pinctrlMAINTAINERS+22 -70 replies
12/16dt-bindings: pinctrl: mediatek: mt6795: rename to mediatek,mt6795-pinctrlDocumentation/devicetree/bindings/pinctrl/mediatek,mt6795-pinctrl.yaml+1 -11 reply
13/16dt-bindings: pinctrl: mediatek: mt8186: rename to mediatek,mt8186-pinctrlDocumentation/devicetree/bindings/pinctrl/mediatek,mt8186-pinctrl.yaml+1 -11 reply
14/16dt-bindings: pinctrl: mediatek: mt8192: rename to mediatek,mt8192-pinctrlDocumentation/devicetree/bindings/pinctrl/mediatek,mt8192-pinctrl.yaml+1 -11 reply
15/16dt-bindings: pinctrl: mediatek: mt8195: rename to mediatek,mt8195-pinctrlDocumentation/devicetree/bindings/pinctrl/mediatek,mt8195-pinctrl.yaml+1 -11 reply
16/16dt-bindings: pinctrl: mediatek: improve schemasDocumentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,mt6795-pinctrl.yaml +17 more+256 -2351 reply

Reviews trailers per patch

4 of 16 patches have a Reviewed-by or Acked-by.

PatchRob Herring
1/16
2/16
3/16
4/16
5/16
6/16
7/16
8/16
9/16
10/16
11/16
12/16A-b
13/16A-b
14/16A-b
15/16A-b
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/16] pinctrl: ralink: fix ABI, improve driver, move to mediatek, improve dt-bindings

This is an ambitious effort I've been wanting to do for months.

Straight off the bat, I'm fixing the ABI that I broke a while back, by reintroducing the ralink,rt2880-pinmux compatible string.

If you take a look at the schema for mt7620 and rt305x, some functions got multiple lists for groups. Like refclk on mt7620. Because mt7620 and mt7628/mt7688 SoCs use the same compatible string, it's impossible to differentiate on the binding which SoC a devicetree is actually for. Therefore, the binding will allow all groups listed for that function. For example, if the SoC is mt7620, only the refclk function for the mdio group can be used. If one were to put "spi cs1" as the function there, there wouldn't be a warning.

I address this by introducing new compatible strings for these SoCs, then split the schemas. I also separate mt7628/mt7688 from mt7620 pinctrl subdriver in the process.

I wanted to split the rt305x driver too but too much code would be reused so I backed down from that.

Ralink was acquired by MediaTek in 2011. These SoCs have been rebranded as MediaTek. We're moving the Ralink pinctrl driver to MediaTek, and rename the schemas to mediatek.

I've renamed the ralink core driver to mtmips. I decided to call the core mtmips as I've seen folks from MediaTek use the same name when they added support for MT7621 pinctrl on U-Boot. Feel free to comment on this.

The MTMIPS pinctrl driver requires rt_sysc_membase from arch/mips/ralink/of.c, so, for COMPILE_TEST to be useful, RALINK must be selected. These headers, asm/mach-ralink/ralink_regs.h and asm/mach-ralink/mt7620.h, from arch/mips/include are also required but they can easily be included:

ifeq ($(CONFIG_COMPILE_TEST),y)
CFLAGS_pinctrl-mtmips.o += -I$(srctree)/arch/mips/include
endif

Sergio, do you see a way to make the pinctrl driver independent of architecture code? At least avoid using rt_sysc_membase.

dtbs_check will print warnings for DTs with the old strings as it will match multiple bindings. I assume that's acceptable in order to have the things properly documented without breaking the ABI. The bindings will work fine with the new compatible strings.

I could define the checks under $defs:, then refer to it if the compatible string is the one which would work fine. Or I could put only the new compatible strings on the documentation. What are your thoughts Krzysztof, Rob?

Arınç