Skip to content

Commit

Permalink
Merge tag 'renesas-pinctrl-for-v5.20-tag2' of git://git.kernel.org/pu…
Browse files Browse the repository at this point in the history
…b/scm/linux/kernel/git/geert/renesas-drivers into devel

pinctrl: renesas: Updates for v5.20 (take two)

  - Add support for the RZ/V2M and R-Car V4H SoCs,
  - Miscellaneous fixes and improvements.
  • Loading branch information
Linus Walleij committed Jul 9, 2022
2 parents 6011c7e + 36611d2 commit 04131ae
Show file tree
Hide file tree
Showing 12 changed files with 5,610 additions and 6 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/pinctrl/renesas,pfc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ properties:
- renesas,pfc-r8a77995 # R-Car D3
- renesas,pfc-r8a779a0 # R-Car V3U
- renesas,pfc-r8a779f0 # R-Car S4-8
- renesas,pfc-r8a779g0 # R-Car V4H
- renesas,pfc-sh73a0 # SH-Mobile AG5

reg:
Expand Down
170 changes: 170 additions & 0 deletions Documentation/devicetree/bindings/pinctrl/renesas,rzv2m-pinctrl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/renesas,rzv2m-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas RZ/V2M combined Pin and GPIO controller

maintainers:
- Geert Uytterhoeven <geert+renesas@glider.be>
- Phil Edworthy <phil.edworthy@renesas.com>

description:
The Renesas RZ/V2M SoC features a combined Pin and GPIO controller.
Pin multiplexing and GPIO configuration is performed on a per-pin basis.
Each port features up to 16 pins, each of them configurable for GPIO function
(port mode) or in alternate function mode.
Up to 8 different alternate function modes exist for each single pin.

properties:
compatible:
const: renesas,r9a09g011-pinctrl # RZ/V2M

reg:
maxItems: 1

gpio-controller: true

'#gpio-cells':
const: 2
description:
The first cell contains the global GPIO port index, constructed using the
RZV2M_GPIO() helper macro in <dt-bindings/pinctrl/rzv2m-pinctrl.h> and the
second cell represents consumer flag as mentioned in ../gpio/gpio.txt
E.g. "RZV2M_GPIO(8, 1)" for P8_1.

gpio-ranges:
maxItems: 1

interrupts:
description: INEXINT[0..38] corresponding to individual pin inputs.
maxItems: 39

clocks:
maxItems: 1

power-domains:
maxItems: 1

resets:
maxItems: 1

additionalProperties:
anyOf:
- type: object
allOf:
- $ref: pincfg-node.yaml#
- $ref: pinmux-node.yaml#

description:
Pin controller client devices use pin configuration subnodes (children
and grandchildren) for desired pin configuration.
Client device subnodes use below standard properties.

properties:
phandle: true
pinmux:
description:
Values are constructed from GPIO port number, pin number, and
alternate function configuration number using the RZV2M_PORT_PINMUX()
helper macro in <dt-bindings/pinctrl/rzv2m-pinctrl.h>.
pins: true
bias-disable: true
bias-pull-down: true
bias-pull-up: true
drive-strength-microamp:
# Superset of supported values
enum: [ 1600, 1800, 2000, 3200, 3800, 4000, 6400, 7800, 8000,
9000, 9600, 11000, 12000, 13000, 18000 ]
slew-rate:
description: 0 is slow slew rate, 1 is fast slew rate
enum: [ 0, 1 ]
gpio-hog: true
gpios: true
output-high: true
output-low: true
line-name: true

- type: object
properties:
phandle: true

additionalProperties:
$ref: "#/additionalProperties/anyOf/0"

allOf:
- $ref: "pinctrl.yaml#"

required:
- compatible
- reg
- gpio-controller
- '#gpio-cells'
- gpio-ranges
- interrupts
- clocks
- power-domains
- resets

examples:
- |
#include <dt-bindings/pinctrl/rzv2m-pinctrl.h>
#include <dt-bindings/clock/r9a09g011-cpg.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
pinctrl: pinctrl@b6250000 {
compatible = "renesas,r9a09g011-pinctrl";
reg = <0xb6250000 0x800>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&pinctrl 0 0 352>;
interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
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_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD R9A09G011_PFC_PCLK>;
resets = <&cpg R9A09G011_PFC_PRESETN>;
power-domains = <&cpg>;
i2c2_pins: i2c2 {
pinmux = <RZV2M_PORT_PINMUX(3, 8, 2)>, /* SDA */
<RZV2M_PORT_PINMUX(3, 9, 2)>; /* SCL */
};
};
18 changes: 18 additions & 0 deletions drivers/pinctrl/renesas/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ config PINCTRL_RENESAS
select PINCTRL_PFC_R8A77995 if ARCH_R8A77995
select PINCTRL_PFC_R8A779A0 if ARCH_R8A779A0
select PINCTRL_PFC_R8A779F0 if ARCH_R8A779F0
select PINCTRL_PFC_R8A779G0 if ARCH_R8A779G0
select PINCTRL_RZG2L if ARCH_RZG2L
select PINCTRL_RZV2M if ARCH_R9A09G011
select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH7203
select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH7264
select PINCTRL_PFC_SH7269 if CPU_SUBTYPE_SH7269
Expand Down Expand Up @@ -153,6 +155,10 @@ config PINCTRL_PFC_R8A779A0
bool "pin control support for R-Car V3U" if COMPILE_TEST
select PINCTRL_SH_PFC

config PINCTRL_PFC_R8A779G0
bool "pin control support for R-Car V4H" if COMPILE_TEST
select PINCTRL_SH_PFC

config PINCTRL_PFC_R8A7740
bool "pin control support for R-Mobile A1" if COMPILE_TEST
select PINCTRL_SH_PFC_GPIO
Expand Down Expand Up @@ -237,6 +243,18 @@ config PINCTRL_RZN1
help
This selects pinctrl driver for Renesas RZ/N1 devices.

config PINCTRL_RZV2M
bool "pin control support for RZ/V2M"
depends on OF
depends on ARCH_R9A09G011 || COMPILE_TEST
select GPIOLIB
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF
help
This selects GPIO and pinctrl driver for Renesas RZ/V2M
platforms.

config PINCTRL_PFC_SH7203
bool "pin control support for SH7203" if COMPILE_TEST
select PINCTRL_SH_FUNC_GPIO
Expand Down
2 changes: 2 additions & 0 deletions drivers/pinctrl/renesas/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A77990) += pfc-r8a77990.o
obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o
obj-$(CONFIG_PINCTRL_PFC_R8A779A0) += pfc-r8a779a0.o
obj-$(CONFIG_PINCTRL_PFC_R8A779F0) += pfc-r8a779f0.o
obj-$(CONFIG_PINCTRL_PFC_R8A779G0) += pfc-r8a779g0.o
obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o
obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o
obj-$(CONFIG_PINCTRL_PFC_SH7269) += pfc-sh7269.o
Expand All @@ -49,6 +50,7 @@ obj-$(CONFIG_PINCTRL_RZA1) += pinctrl-rza1.o
obj-$(CONFIG_PINCTRL_RZA2) += pinctrl-rza2.o
obj-$(CONFIG_PINCTRL_RZG2L) += pinctrl-rzg2l.o
obj-$(CONFIG_PINCTRL_RZN1) += pinctrl-rzn1.o
obj-$(CONFIG_PINCTRL_RZV2M) += pinctrl-rzv2m.o

ifeq ($(CONFIG_COMPILE_TEST),y)
CFLAGS_pfc-sh7203.o += -I$(srctree)/arch/sh/include/cpu-sh2a
Expand Down
6 changes: 6 additions & 0 deletions drivers/pinctrl/renesas/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
.data = &r8a779f0_pinmux_info,
},
#endif
#ifdef CONFIG_PINCTRL_PFC_R8A779G0
{
.compatible = "renesas,pfc-r8a779g0",
.data = &r8a779g0_pinmux_info,
},
#endif
#ifdef CONFIG_PINCTRL_PFC_SH73A0
{
.compatible = "renesas,pfc-sh73a0",
Expand Down
2 changes: 0 additions & 2 deletions drivers/pinctrl/renesas/pfc-r8a779f0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1902,15 +1902,13 @@ static const struct pinmux_drive_reg pinmux_drive_regs[] = {
enum ioctrl_regs {
POC0,
POC1,
POC2,
POC3,
TD0SEL1,
};

static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
[POC0] = { 0xe60500a0, },
[POC1] = { 0xe60508a0, },
[POC2] = { 0xe60510a0, },
[POC3] = { 0xe60518a0, },
[TD0SEL1] = { 0xe6050920, },
{ /* sentinel */ },
Expand Down
Loading

0 comments on commit 04131ae

Please sign in to comment.