Skip to content

RFC pinctrl: mediatek: mt8516-mt8167: Convert to Paris driver

Luca Leonardo Scorcia linux-arm-kernel linux-devicetree linux-gpio linux-mediatek lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dt-bindings: pinctrl: mt8516/mt8167: Move compatibles from mt66xx to mt6795Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml Documentation/devicetree/bindings/pinctrl/mediatek,mt6795-pinctrl.yaml+4 -35 replies
2/3pinctrl: mediatek: mt8516/mt8167: Migrate driver to pinctrl-paris platformdrivers/pinctrl/mediatek/Kconfig drivers/pinctrl/mediatek/Makefile drivers/pinctrl/mediatek/pinctrl-mt8167.c +3 more+1006 -11950 replies
3/3arm64: dts: mt8516/mt8167: Update pinctrl nodes for the new paris driverarch/arm64/boot/dts/mediatek/mt8167.dtsi arch/arm64/boot/dts/mediatek/mt8516.dtsi+8 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] pinctrl: mediatek: mt8516-mt8167: Convert to Paris driver

The pinctrl registers of the mt8516 and mt8167 SoCs follow the layout of the Paris platform, but their pinctrl driver is currently modeled on the mt65xx legacy driver. As suggested in [1], it is possible to migrate them to the Paris driver.

In the process it is also possible to completely drop one of the two drivers as their register layout is identical, they only differ in some pin functions (mt8167 is basically mt8516 with added display blocks).

The Paris driver allows specifying two base registers, gpio and eint; this way it's no longer necessary to have a syscfg node in the device tree, referenced as a phandle in the pinctrl node. This also fixes the following long standing dtbs_check errors:

mt8167-pumpkin.dtb: syscfg-pctl@10005000 (syscon): compatible: ['syscon']
is too short
mt8516-pumpkin.dtb: syscfg-pctl@10005000 (syscon): compatible: ['syscon']
is too short

The new driver has been checked against the SoC data sheet and adds the capability to control pin driving strength and R1R0 pullup-pulldown resistors.

This series is sent as a RFC since the changes could theoretically impact existing devices. I am pretty sure that no device ever used upstream drivers though, not even the Pumpkin board that's present in Linux sources since this board lacks the associated mt6392 PMIC driver that is required for regulator management. If for compatibility reasons it is deemed better to keep both drivers in the kernel I would welcome any suggestion on how to name the new driver, and how to adjust the two bindings for coexistence.

These changes have been tested on the Xiaomi Mi Smart Clock X04G and on the Lenovo Smart Clock 2 CD-24502F.

[1] https://lore.kernel.org/linux-mediatek/[email protected]/

Luca Leonardo Scorcia (3):
dt-bindings: pinctrl: mt8516/mt8167: Move compatibles from mt66xx to

    mt6795

pinctrl: mediatek: mt8516/mt8167: Migrate driver to pinctrl-paris
platform
arm64: dts: mt8516/mt8167: Update pinctrl nodes for the new paris
driver

 .../pinctrl/mediatek,mt65xx-pinctrl.yaml      |   2 -
 .../pinctrl/mediatek,mt6795-pinctrl.yaml      |   5 +-
 arch/arm64/boot/dts/mediatek/mt8167.dtsi      |  15 +-
 arch/arm64/boot/dts/mediatek/mt8516.dtsi      |  12 +-
 drivers/pinctrl/mediatek/Kconfig              |  11 +-
 drivers/pinctrl/mediatek/Makefile             |   1 -
 drivers/pinctrl/mediatek/pinctrl-mt8167.c     | 345 --------
 drivers/pinctrl/mediatek/pinctrl-mt8516.c     | 770 +++++++++++-------
 drivers/pinctrl/mediatek/pinctrl-mtk-mt8167.h | 562 +++++++------
 drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h | 512 ++++++------
 10 files changed, 1018 insertions(+), 1217 deletions(-)
 delete mode 100644 drivers/pinctrl/mediatek/pinctrl-mt8167.c

base-commit: 4e5dfb7c84012007c3c7061126491bbc92d71bf1

Signature · 1 line
2.43.0