Skip to content

Commit ad05d4b

Browse files
committed
Merge tag 'sh-pfc-for-v5.9-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel
pinctrl: sh-pfc: Updates for v5.9 (take two) - Add support for the new RZ/G2H (R8A774E1) SoC, - One more conversion of DT bindings to json-schema, - Fix RZ/A1 kerneldoc.
2 parents 3e3f742 + 4d0e626 commit ad05d4b

File tree

9 files changed

+587
-514
lines changed

9 files changed

+587
-514
lines changed

Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Required Properties:
2121
- "renesas,pfc-r8a774a1": for R8A774A1 (RZ/G2M) compatible pin-controller.
2222
- "renesas,pfc-r8a774b1": for R8A774B1 (RZ/G2N) compatible pin-controller.
2323
- "renesas,pfc-r8a774c0": for R8A774C0 (RZ/G2E) compatible pin-controller.
24+
- "renesas,pfc-r8a774e1": for R8A774E1 (RZ/G2H) compatible pin-controller.
2425
- "renesas,pfc-r8a7778": for R8A7778 (R-Car M1) compatible pin-controller.
2526
- "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
2627
- "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.

Documentation/devicetree/bindings/pinctrl/renesas,rza2-pinctrl.txt

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pinctrl/renesas,rza2-pinctrl.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Renesas RZ/A2 combined Pin and GPIO controller
8+
9+
maintainers:
10+
- Chris Brandt <[email protected]>
11+
- Geert Uytterhoeven <[email protected]>
12+
13+
description:
14+
The Renesas SoCs of the RZ/A2 series feature a combined Pin and GPIO
15+
controller.
16+
Pin multiplexing and GPIO configuration is performed on a per-pin basis.
17+
Each port features up to 8 pins, each of them configurable for GPIO function
18+
(port mode) or in alternate function mode.
19+
Up to 8 different alternate function modes exist for each single pin.
20+
21+
properties:
22+
compatible:
23+
const: "renesas,r7s9210-pinctrl" # RZ/A2M
24+
25+
reg:
26+
maxItems: 1
27+
28+
gpio-controller: true
29+
30+
'#gpio-cells':
31+
const: 2
32+
description:
33+
The first cell contains the global GPIO port index, constructed using the
34+
RZA2_PIN() helper macro in r7s9210-pinctrl.h.
35+
E.g. "RZA2_PIN(PORT6, 0)" for P6_0.
36+
37+
gpio-ranges:
38+
maxItems: 1
39+
40+
patternProperties:
41+
"^.*$":
42+
if:
43+
type: object
44+
then:
45+
allOf:
46+
- $ref: pincfg-node.yaml#
47+
- $ref: pinmux-node.yaml#
48+
description:
49+
The child nodes of the pin controller designate pins to be used for
50+
specific peripheral functions or as GPIO.
51+
52+
A pin multiplexing sub-node describes how to configure a set of
53+
(or a single) pin in some desired alternate function mode.
54+
The values for the pinmux properties are a combination of port name,
55+
pin number and the desired function index. Use the RZA2_PINMUX macro
56+
located in include/dt-bindings/pinctrl/r7s9210-pinctrl.h to easily
57+
define these.
58+
For assigning GPIO pins, use the macro RZA2_PIN also in
59+
to express the desired port pin.
60+
61+
properties:
62+
phandle: true
63+
64+
pinmux:
65+
description:
66+
Values are constructed from GPIO port number, pin number, and
67+
alternate function configuration number using the RZA2_PINMUX()
68+
helper macro in r7s9210-pinctrl.h.
69+
70+
required:
71+
- pinmux
72+
73+
additionalProperties: false
74+
75+
required:
76+
- compatible
77+
- reg
78+
- gpio-controller
79+
- '#gpio-cells'
80+
- gpio-ranges
81+
82+
additionalProperties: false
83+
84+
examples:
85+
- |
86+
#include <dt-bindings/pinctrl/r7s9210-pinctrl.h>
87+
pinctrl: pin-controller@fcffe000 {
88+
compatible = "renesas,r7s9210-pinctrl";
89+
reg = <0xfcffe000 0x1000>;
90+
91+
gpio-controller;
92+
#gpio-cells = <2>;
93+
gpio-ranges = <&pinctrl 0 0 176>;
94+
95+
/* Serial Console */
96+
scif4_pins: serial4 {
97+
pinmux = <RZA2_PINMUX(PORT9, 0, 4)>, /* TxD4 */
98+
<RZA2_PINMUX(PORT9, 1, 4)>; /* RxD4 */
99+
};
100+
};

drivers/pinctrl/pinctrl-rza1.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@
7575
* RZ/A1 pinmux flags
7676
*/
7777

78-
/**
78+
/*
7979
* rza1_bidir_pin - describe a single pin that needs bidir flag applied.
8080
*/
8181
struct rza1_bidir_pin {
8282
u8 pin: 4;
8383
u8 func: 4;
8484
};
8585

86-
/**
86+
/*
8787
* rza1_bidir_entry - describe a list of pins that needs bidir flag applied.
8888
* Each struct rza1_bidir_entry describes a port.
8989
*/
@@ -92,7 +92,7 @@ struct rza1_bidir_entry {
9292
const struct rza1_bidir_pin *pins;
9393
};
9494

95-
/**
95+
/*
9696
* rza1_swio_pin - describe a single pin that needs swio flag applied.
9797
*/
9898
struct rza1_swio_pin {
@@ -102,15 +102,15 @@ struct rza1_swio_pin {
102102
u16 input: 1;
103103
};
104104

105-
/**
105+
/*
106106
* rza1_swio_entry - describe a list of pins that needs swio flag applied
107107
*/
108108
struct rza1_swio_entry {
109109
const unsigned int npins;
110110
const struct rza1_swio_pin *pins;
111111
};
112112

113-
/**
113+
/*
114114
* rza1_pinmux_conf - group together bidir and swio pinmux flag tables
115115
*/
116116
struct rza1_pinmux_conf {
@@ -431,7 +431,7 @@ static const struct rza1_pinmux_conf rza1l_pmx_conf = {
431431
* RZ/A1 types
432432
*/
433433
/**
434-
* rza1_mux_conf - describes a pin multiplexing operation
434+
* struct rza1_mux_conf - describes a pin multiplexing operation
435435
*
436436
* @id: the pin identifier from 0 to RZA1_NPINS
437437
* @port: the port where pin sits on
@@ -450,7 +450,7 @@ struct rza1_mux_conf {
450450
};
451451

452452
/**
453-
* rza1_port - describes a pin port
453+
* struct rza1_port - describes a pin port
454454
*
455455
* This is mostly useful to lock register writes per-bank and not globally.
456456
*
@@ -467,12 +467,12 @@ struct rza1_port {
467467
};
468468

469469
/**
470-
* rza1_pinctrl - RZ pincontroller device
470+
* struct rza1_pinctrl - RZ pincontroller device
471471
*
472472
* @dev: parent device structure
473473
* @mutex: protect [pinctrl|pinmux]_generic functions
474474
* @base: logical address base
475-
* @nports: number of pin controller ports
475+
* @nport: number of pin controller ports
476476
* @ports: pin controller banks
477477
* @pins: pin array for pinctrl core
478478
* @desc: pincontroller desc for pinctrl core
@@ -536,7 +536,7 @@ static inline int rza1_pinmux_get_swio(unsigned int port,
536536
return -ENOENT;
537537
}
538538

539-
/**
539+
/*
540540
* rza1_pinmux_get_flags() - return pinmux flags associated to a pin
541541
*/
542542
static unsigned int rza1_pinmux_get_flags(unsigned int port, unsigned int pin,
@@ -566,7 +566,7 @@ static unsigned int rza1_pinmux_get_flags(unsigned int port, unsigned int pin,
566566
* RZ/A1 SoC operations
567567
*/
568568

569-
/**
569+
/*
570570
* rza1_set_bit() - un-locked set/clear a single bit in pin configuration
571571
* registers
572572
*/
@@ -664,7 +664,7 @@ static inline int rza1_pin_get(struct rza1_port *port, unsigned int pin)
664664
/**
665665
* rza1_pin_mux_single() - configure pin multiplexing on a single pin
666666
*
667-
* @pinctrl: RZ/A1 pin controller device
667+
* @rza1_pctl: RZ/A1 pin controller device
668668
* @mux_conf: pin multiplexing descriptor
669669
*/
670670
static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,

drivers/pinctrl/sh-pfc/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config PINCTRL_SH_PFC
2020
select PINCTRL_PFC_R8A774A1 if ARCH_R8A774A1
2121
select PINCTRL_PFC_R8A774B1 if ARCH_R8A774B1
2222
select PINCTRL_PFC_R8A774C0 if ARCH_R8A774C0
23+
select PINCTRL_PFC_R8A774E1 if ARCH_R8A774E1
2324
select PINCTRL_PFC_R8A7778 if ARCH_R8A7778
2425
select PINCTRL_PFC_R8A7779 if ARCH_R8A7779
2526
select PINCTRL_PFC_R8A7790 if ARCH_R8A7790
@@ -99,6 +100,9 @@ config PINCTRL_PFC_R8A774B1
99100
config PINCTRL_PFC_R8A774C0
100101
bool "RZ/G2E pin control support" if COMPILE_TEST
101102

103+
config PINCTRL_PFC_R8A774E1
104+
bool "RZ/G2H pin control support" if COMPILE_TEST
105+
102106
config PINCTRL_PFC_R8A7778
103107
bool "R-Car M1A pin control support" if COMPILE_TEST
104108

drivers/pinctrl/sh-pfc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A77470) += pfc-r8a77470.o
1212
obj-$(CONFIG_PINCTRL_PFC_R8A774A1) += pfc-r8a7796.o
1313
obj-$(CONFIG_PINCTRL_PFC_R8A774B1) += pfc-r8a77965.o
1414
obj-$(CONFIG_PINCTRL_PFC_R8A774C0) += pfc-r8a77990.o
15+
obj-$(CONFIG_PINCTRL_PFC_R8A774E1) += pfc-r8a77951.o
1516
obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o
1617
obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o
1718
obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o

drivers/pinctrl/sh-pfc/core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
533533
.data = &r8a774c0_pinmux_info,
534534
},
535535
#endif
536+
#ifdef CONFIG_PINCTRL_PFC_R8A774E1
537+
{
538+
.compatible = "renesas,pfc-r8a774e1",
539+
.data = &r8a774e1_pinmux_info,
540+
},
541+
#endif
536542
#ifdef CONFIG_PINCTRL_PFC_R8A7778
537543
{
538544
.compatible = "renesas,pfc-r8a7778",

0 commit comments

Comments
 (0)