mbox series

[v4,0/2] Add Realtek Otto GPIO support

Message ID cover.1616760183.git.sander@svanheule.net
Headers show
Series Add Realtek Otto GPIO support | expand

Message

Sander Vanheule March 26, 2021, 12:03 p.m. UTC
Add support for the GPIO controller employed by Realtek in multiple series of
MIPS SoCs. These include the supported RTL838x and RTL839x. The register layout
also matches the one found in the GPIO controller of other (Lexra-based) SoCs
such as RTL8196E, RTL8197D, and RTL8197F.

For the platform name 'otto', I am not aware of any official resources as to
what hardware this specifically applies to. However, in all of the GPL archives
we've received, from vendors using compatible SoCs in their design, the
platform under the MIPS architecture is referred to by this name.

The GPIO ports have been tested on a Zyxel GS1900-8 (RTL8380), and Zyxel
GS1900-48 (RTL8393). Furthermore, the GPIO ports and interrupt controller have
been tested on a Netgear GS110TPPv1 (RTL8381).

Changes in v4:
- Fix pointer notation style
- Drop unused read_u16_reg() function
- Drop 'inline' specifier from functions

Changes in v3:
- Remove OF dependencies in driver probe
- Don't accept IRQ_TYPE_NONE as a valid interrupt type
- Remove (now unused) dev property from control structure
- Use u8/u16 port registers, instead of raw u32 registers
- Use 'line' name for gpiochip, 'port' and 'pin' names for hardware
- Renamed DT bindings file
- Dropped fallback-only DT compatible
- Various code style clean-ups

Changes in v2:
- Clarify structure and usage of IMR registers
- Added Linus' Reviewed-by tags

Sander Vanheule (2):
  dt-bindings: gpio: Binding for Realtek Otto GPIO
  gpio: Add Realtek Otto GPIO support

 .../bindings/gpio/realtek,otto-gpio.yaml      |  78 +++++
 drivers/gpio/Kconfig                          |  11 +
 drivers/gpio/Makefile                         |   1 +
 drivers/gpio/gpio-realtek-otto.c              | 330 ++++++++++++++++++
 4 files changed, 420 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
 create mode 100644 drivers/gpio/gpio-realtek-otto.c

Comments

Rob Herring (Arm) March 27, 2021, 6:16 p.m. UTC | #1
On Fri, 26 Mar 2021 13:03:46 +0100, Sander Vanheule wrote:
> Add a binding description for Realtek's GPIO controller found on several

> of their MIPS-based SoCs (codenamed Otto), such as the RTL838x and

> RTL839x series of switch SoCs.

> 

> A fallback binding 'realtek,otto-gpio' is provided for cases where the

> actual port ordering is not known yet, and enabling the interrupt

> controller may result in uncaught interrupts.

> 

> Signed-off-by: Sander Vanheule <sander@svanheule.net>

> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

> ---

>  .../bindings/gpio/realtek,otto-gpio.yaml      | 78 +++++++++++++++++++

>  1 file changed, 78 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml

> 


Reviewed-by: Rob Herring <robh@kernel.org>