[PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042

Inochi Amaoto posted 8 patches 10 months, 1 week ago
.../pinctrl/sophgo,sg2042-pinctrl.yaml        | 129 ++++
.../boot/dts/sophgo/sg2042-milkv-pioneer.dts  |  72 ++
arch/riscv/boot/dts/sophgo/sg2042.dtsi        |   6 +
drivers/pinctrl/sophgo/Kconfig                |  46 +-
drivers/pinctrl/sophgo/Makefile               |   8 +-
drivers/pinctrl/sophgo/pinctrl-cv1800b.c      |  27 +-
drivers/pinctrl/sophgo/pinctrl-cv1812h.c      |  27 +-
drivers/pinctrl/sophgo/pinctrl-cv18xx.c       | 602 ++++-----------
drivers/pinctrl/sophgo/pinctrl-cv18xx.h       |  66 +-
drivers/pinctrl/sophgo/pinctrl-sg2000.c       |  27 +-
drivers/pinctrl/sophgo/pinctrl-sg2002.c       |  27 +-
drivers/pinctrl/sophgo/pinctrl-sg2042-ops.c   | 296 ++++++++
drivers/pinctrl/sophgo/pinctrl-sg2042.c       | 655 ++++++++++++++++
drivers/pinctrl/sophgo/pinctrl-sg2042.h       |  49 ++
drivers/pinctrl/sophgo/pinctrl-sg2044.c       | 718 ++++++++++++++++++
.../pinctrl/sophgo/pinctrl-sophgo-common.c    | 451 +++++++++++
drivers/pinctrl/sophgo/pinctrl-sophgo.h       | 136 ++++
include/dt-bindings/pinctrl/pinctrl-sg2042.h  | 196 +++++
include/dt-bindings/pinctrl/pinctrl-sg2044.h  | 221 ++++++
19 files changed, 3217 insertions(+), 542 deletions(-)
create mode 100644 Documentation/devicetree/bindings/pinctrl/sophgo,sg2042-pinctrl.yaml
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042-ops.c
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042.c
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042.h
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2044.c
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sophgo-common.c
create mode 100644 drivers/pinctrl/sophgo/pinctrl-sophgo.h
create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2042.h
create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2044.h
[PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Inochi Amaoto 10 months, 1 week ago
SG2042 has a simple pinctrl device for all configurable pins.
It supports setting pull up/down, drive strength and input schmitt
trigger.

Add support for SG2042 and SG2044 pinctrl device.

Changed from v1:
- https://lore.kernel.org/all/20241024064356.865055-1-inochiama@gmail.com/
1. Fix the binding documentation error.
2. Refactor the cv18xx code so SG2042 can uses the same code.
3. Add SG2044 pinctrl support as it has the same layout.

Inochi Amaoto (8):
  pinctrl: sophgo: avoid to modify untouched bit when setting cv1800
    pinconf
  pinctrl: sophgo: introduce generic data structure for cv18xx pinctrl
    driver
  pinctrl: sophgo: generalize shareable code of cv18xx pinctrl driver
  pinctrl: sophgo: introduce generic probe function
  dt-bindings: pinctrl: Add pinctrl for Sophgo SG2042 series SoC
  pinctrl: sophgo: add support for SG2042 SoC
  pinctrl: sophgo: add support for SG2044 SoC
  riscv: dts: sophgo: sg2042: add pinctrl support

 .../pinctrl/sophgo,sg2042-pinctrl.yaml        | 129 ++++
 .../boot/dts/sophgo/sg2042-milkv-pioneer.dts  |  72 ++
 arch/riscv/boot/dts/sophgo/sg2042.dtsi        |   6 +
 drivers/pinctrl/sophgo/Kconfig                |  46 +-
 drivers/pinctrl/sophgo/Makefile               |   8 +-
 drivers/pinctrl/sophgo/pinctrl-cv1800b.c      |  27 +-
 drivers/pinctrl/sophgo/pinctrl-cv1812h.c      |  27 +-
 drivers/pinctrl/sophgo/pinctrl-cv18xx.c       | 602 ++++-----------
 drivers/pinctrl/sophgo/pinctrl-cv18xx.h       |  66 +-
 drivers/pinctrl/sophgo/pinctrl-sg2000.c       |  27 +-
 drivers/pinctrl/sophgo/pinctrl-sg2002.c       |  27 +-
 drivers/pinctrl/sophgo/pinctrl-sg2042-ops.c   | 296 ++++++++
 drivers/pinctrl/sophgo/pinctrl-sg2042.c       | 655 ++++++++++++++++
 drivers/pinctrl/sophgo/pinctrl-sg2042.h       |  49 ++
 drivers/pinctrl/sophgo/pinctrl-sg2044.c       | 718 ++++++++++++++++++
 .../pinctrl/sophgo/pinctrl-sophgo-common.c    | 451 +++++++++++
 drivers/pinctrl/sophgo/pinctrl-sophgo.h       | 136 ++++
 include/dt-bindings/pinctrl/pinctrl-sg2042.h  | 196 +++++
 include/dt-bindings/pinctrl/pinctrl-sg2044.h  | 221 ++++++
 19 files changed, 3217 insertions(+), 542 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/sophgo,sg2042-pinctrl.yaml
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042-ops.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2042.h
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sg2044.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sophgo-common.c
 create mode 100644 drivers/pinctrl/sophgo/pinctrl-sophgo.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2042.h
 create mode 100644 include/dt-bindings/pinctrl/pinctrl-sg2044.h

--
2.48.1
Re: [PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Linus Walleij 9 months, 3 weeks ago
On Tue, Feb 11, 2025 at 6:18 AM Inochi Amaoto <inochiama@gmail.com> wrote:

> SG2042 has a simple pinctrl device for all configurable pins.
> It supports setting pull up/down, drive strength and input schmitt
> trigger.
>
> Add support for SG2042 and SG2044 pinctrl device.
(...)
> Inochi Amaoto (8):
>   pinctrl: sophgo: avoid to modify untouched bit when setting cv1800
>     pinconf
>   pinctrl: sophgo: introduce generic data structure for cv18xx pinctrl
>     driver
>   pinctrl: sophgo: generalize shareable code of cv18xx pinctrl driver
>   pinctrl: sophgo: introduce generic probe function
>   dt-bindings: pinctrl: Add pinctrl for Sophgo SG2042 series SoC
>   pinctrl: sophgo: add support for SG2042 SoC
>   pinctrl: sophgo: add support for SG2044 SoC

I applied these patches 1-7 to the pinctrl tree and created an immutable
branch:
https://web.git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=ib-sophgo

>   riscv: dts: sophgo: sg2042: add pinctrl support

Apply this patch to the riscv/SoC tree.

If it is required, that tree can pull in my immutable branch, which
is based on v6.14-rc1.

Yours,
Linus Walleij
Re: [PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Inochi Amaoto 9 months, 3 weeks ago
On Fri, Feb 28, 2025 at 12:00:34AM +0100, Linus Walleij wrote:
> On Tue, Feb 11, 2025 at 6:18 AM Inochi Amaoto <inochiama@gmail.com> wrote:
> 
> > SG2042 has a simple pinctrl device for all configurable pins.
> > It supports setting pull up/down, drive strength and input schmitt
> > trigger.
> >
> > Add support for SG2042 and SG2044 pinctrl device.
> (...)
> > Inochi Amaoto (8):
> >   pinctrl: sophgo: avoid to modify untouched bit when setting cv1800
> >     pinconf
> >   pinctrl: sophgo: introduce generic data structure for cv18xx pinctrl
> >     driver
> >   pinctrl: sophgo: generalize shareable code of cv18xx pinctrl driver
> >   pinctrl: sophgo: introduce generic probe function
> >   dt-bindings: pinctrl: Add pinctrl for Sophgo SG2042 series SoC
> >   pinctrl: sophgo: add support for SG2042 SoC
> >   pinctrl: sophgo: add support for SG2044 SoC
> 
> I applied these patches 1-7 to the pinctrl tree and created an immutable
> branch:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=ib-sophgo
> 
> >   riscv: dts: sophgo: sg2042: add pinctrl support
> 
> Apply this patch to the riscv/SoC tree.
> 
> If it is required, that tree can pull in my immutable branch, which
> is based on v6.14-rc1.
> 
> Yours,
> Linus Walleij

Thanks, I will take care of the device tree.

Regards,
Inochi
Re: (subset) [PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Inochi Amaoto 9 months, 3 weeks ago
On Tue, 11 Feb 2025 13:17:48 +0800, Inochi Amaoto wrote:
> SG2042 has a simple pinctrl device for all configurable pins.
> It supports setting pull up/down, drive strength and input schmitt
> trigger.
> 
> Add support for SG2042 and SG2044 pinctrl device.
> 
> Changed from v1:
> - https://lore.kernel.org/all/20241024064356.865055-1-inochiama@gmail.com/
> 1. Fix the binding documentation error.
> 2. Refactor the cv18xx code so SG2042 can uses the same code.
> 3. Add SG2044 pinctrl support as it has the same layout.
> 
> [...]

Applied to for-next, thanks!

[8/8] riscv: dts: sophgo: sg2042: add pinctrl support
      https://github.com/sophgo/linux/commit/5277657d53834cfbdbb9444088c1448b29bdfe98

Thanks,
Inochi
Re: (subset) [PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Inochi Amaoto 9 months ago
On Fri, Feb 28, 2025 at 08:44:32AM +0800, Inochi Amaoto wrote:
> On Tue, 11 Feb 2025 13:17:48 +0800, Inochi Amaoto wrote:
> > SG2042 has a simple pinctrl device for all configurable pins.
> > It supports setting pull up/down, drive strength and input schmitt
> > trigger.
> > 
> > Add support for SG2042 and SG2044 pinctrl device.
> > 
> > Changed from v1:
> > - https://lore.kernel.org/all/20241024064356.865055-1-inochiama@gmail.com/
> > 1. Fix the binding documentation error.
> > 2. Refactor the cv18xx code so SG2042 can uses the same code.
> > 3. Add SG2044 pinctrl support as it has the same layout.
> > 
> > [...]
> 
> Applied to for-next, thanks!
> 
> [8/8] riscv: dts: sophgo: sg2042: add pinctrl support
>       https://github.com/sophgo/linux/commit/5277657d53834cfbdbb9444088c1448b29bdfe98
> 
> Thanks,
> Inochi
> 

This patch is unapplied temporarily for dependency issue.
I will repick it in the next cycle.

Regards,
Inochi
Re: (subset) [PATCH v2 0/8] riscv: sophgo: Add pinctrl support for SG2042
Posted by Inochi Amaoto 7 months, 3 weeks ago
On Tue, 11 Feb 2025 13:17:48 +0800, Inochi Amaoto wrote:
> SG2042 has a simple pinctrl device for all configurable pins.
> It supports setting pull up/down, drive strength and input schmitt
> trigger.
> 
> Add support for SG2042 and SG2044 pinctrl device.
> 
> Changed from v1:
> - https://lore.kernel.org/all/20241024064356.865055-1-inochiama@gmail.com/
> 1. Fix the binding documentation error.
> 2. Refactor the cv18xx code so SG2042 can uses the same code.
> 3. Add SG2044 pinctrl support as it has the same layout.
> 
> [...]

Reapply this to the sophgo/for-next.

[8/8] riscv: dts: sophgo: sg2042: add pinctrl support
      https://github.com/sophgo/linux/commit/a1d04b8461eced3c8933fc3f58ddcc4b44ca9073

Thanks,
Inochi