Amlogic Meson8b pinctrl driver support
Subsystems (4)
v4 cover Amlogic Meson8b pinctrl driver support
From: Carlo Caione <[email protected]>
This patchset extends the pinctrl driver to support AmLogic Meson8b. The driver for Meson8 has been revised to make it shorter.
Changelog:
v4: * Add ACKs
* Fix overlapping GPIO numbers for the DIF_* pins
v3: * shorten the meson8/meson8b support files
* document GPIO banks for meson8b
v2: * fix holes in GPIOs numbering
v1: * initial version
Carlo Caione (3):
pinctrl: Cleanup Meson8 driver
documentation: Extend pinctrl docs for Meson8b
pinctrl: Add support for Meson8b
.../devicetree/bindings/pinctrl/meson,pinctrl.txt | 2 +- drivers/pinctrl/meson/Makefile | 2 +- drivers/pinctrl/meson/pinctrl-meson.c | 9 +- drivers/pinctrl/meson/pinctrl-meson.h | 9 +- drivers/pinctrl/meson/pinctrl-meson8.c | 1050 +++++++++----------- drivers/pinctrl/meson/pinctrl-meson8b.c | 899 +++++++++++++++++ include/dt-bindings/gpio/meson8b-gpio.h | 32 + 7 files changed, 1402 insertions(+), 601 deletions(-) create mode 100644 drivers/pinctrl/meson/pinctrl-meson8b.c create mode 100644 include/dt-bindings/gpio/meson8b-gpio.h
Signature · 1 line
1.9.1
PATCH v4 1/3 pinctrl: Cleanup Meson8 driver
From: Carlo Caione <[email protected]>
This patch introduces a new PIN macro and few small modifications to simplify and shorten the Meson pinctrl drivers and cleanup the support file for the AmLogic Meson8 SoC.
--- drivers/pinctrl/meson/pinctrl-meson.h | 8 +- drivers/pinctrl/meson/pinctrl-meson8.c | 1050 ++++++++++++++------------------ 2 files changed, 461 insertions(+), 597 deletions(-)
drivers/pinctrl/meson/pinctrl-meson.h +5 -3
@@ -155,6 +155,8 @@ struct meson_pinctrl {struct meson_domain *domains; }; +#define PIN (x, b) (b + x) +#define GROUP (grp, r, b) \ { \ .name = #grp, \
@@ -165,10 +167,10 @@ struct meson_pinctrl { .domain = 0, \ } -#define GPIO_GROUP (gpio) \ +#define GPIO_GROUP (gpio, b) \ { \ .name = #gpio, \ - .pins = (const unsigned int[]){ PIN_ ## gpio}, \ + .pins = (const unsigned int[]){ PIN(gpio, b) }, \ .num_pins = 1, \ .is_gpio = true, \ }
@@ -204,6 +206,6 @@ struct meson_pinctrl { }, \ } -#define MESON_PIN (x) PINCTRL_PIN(PIN_ ## x, #x) +#define MESON_PIN (x, b) PINCTRL_PIN(PIN(x, b), #x)extern struct meson_pinctrl_data meson8_pinctrl_data;
drivers/pinctrl/meson/pinctrl-meson8.c +456 -594
1,095 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 2/3 documentation: Extend pinctrl docs for Meson8b
In reply to Carlo CaioneFrom: Carlo Caione <[email protected]>
Add the compatible string for Meson8b in Meson pinctrl documentation and add new information for Meson8b in source code comments.
--- Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt | 2 +- drivers/pinctrl/meson/pinctrl-meson.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt +1 -1
@@ -1,7 +1,7 @@ == Amlogic Meson pinmux controller == Required properties for the root node: - - compatible: "amlogic,meson8-pinctrl" + - compatible: "amlogic,meson8-pinctrl" or "amlogic,meson8b-pinctrl" - reg: address and size of registers controlling irq functionality === GPIO sub-nodes ===
drivers/pinctrl/meson/pinctrl-meson.c +3 -2
@@ -13,8 +13,9 @@/* * The available pins are organized in banks (A,B,C,D,E,X,Y,Z,AO, -* BOOT,CARD for meson6 and X,Y,DV,H,Z,AO,BOOT,CARD for meson8) and -* each bank has a variable number of pins. +* BOOT,CARD for meson6, X,Y,DV,H,Z,AO,BOOT,CARD for meson8 and +* X,Y,DV,H,AO,BOOT,CARD,DIF for meson8b) and each bank has a +* variable number of pins. * * The AO bank is special because it belongs to the Always-On power * domain which can't be powered off; the bank also uses a set of
Signature · 1 line
1.9.1
PATCH v4 3/3 pinctrl: Add support for Meson8b
In reply to Carlo CaioneFrom: Carlo Caione <[email protected]>
This patch adds support for the AmLogic Meson8b SoC.
--- drivers/pinctrl/meson/Makefile | 2 +- drivers/pinctrl/meson/pinctrl-meson.c | 4 + drivers/pinctrl/meson/pinctrl-meson.h | 1 + drivers/pinctrl/meson/pinctrl-meson8b.c | 899 ++++++++++++++++++++++++++++++++ include/dt-bindings/gpio/meson8b-gpio.h | 32 ++ 5 files changed, 937 insertions(+), 1 deletion(-) create mode 100644 drivers/pinctrl/meson/pinctrl-meson8b.c create mode 100644 include/dt-bindings/gpio/meson8b-gpio.h
drivers/pinctrl/meson/Makefile +1 -1
@@ -1,2 +1,2 @@ -obj-y += pinctrl-meson8.o +obj-y += pinctrl-meson8.o pinctrl-meson8b.o obj-y += pinctrl-meson.o
drivers/pinctrl/meson/pinctrl-meson.c +4 -0
@@ -545,6 +545,10 @@ static const struct of_device_id meson_pinctrl_dt_match[] = { .compatible = "amlogic,meson8-pinctrl", .data = &meson8_pinctrl_data, }, + { + .compatible = "amlogic,meson8b-pinctrl", + .data = &meson8b_pinctrl_data, + }, { }, };MODULE_DEVICE_TABLE (of, meson_pinctrl_dt_match);
drivers/pinctrl/meson/pinctrl-meson.h +1 -0
@@ -209,3 +209,4 @@ struct meson_pinctrl {#define MESON_PIN (x, b) PINCTRL_PIN(PIN(x, b), #x)extern struct meson_pinctrl_data meson8_pinctrl_data; +extern struct meson_pinctrl_data meson8b_pinctrl_data;
drivers/pinctrl/meson/pinctrl-meson8b.c new file +899 -0
899 lines not on this page · raw message
include/dt-bindings/gpio/meson8b-gpio.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* GPIO definitions for Amlogic Meson8b SoCs +* +* Copyright (C) 2015 Endless Mobile, Inc. +* Author: Carlo Caione <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* version 2 as published by the Free Software Foundation. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _DT_BINDINGS_MESON8B_GPIO_H +#define _DT_BINDINGS_MESON8B_GPIO_H + +#include <dt-bindings/gpio/meson8-gpio.h> + +/* GPIO Bank DIF */ +#define DIF_0_P 120 +#define DIF_0_N 121 +#define DIF_1_P 122 +#define DIF_1_N 123 +#define DIF_2_P 124 +#define DIF_2_N 125 +#define DIF_3_P 126 +#define DIF_3_N 127 +#define DIF_4_P 128 +#define DIF_4_N 129 + +#endif /* _DT_BINDINGS_MESON8B_GPIO_H */
Signature · 1 line
1.9.1
PATCH v4 3/3 pinctrl: Add support for Meson8b
Quoted 3 lines · Carlo Caione
From: Carlo Caione <[email protected]>
This patch adds support for the AmLogic Meson8b SoC.
Hi,
looks good to me.
PATCH v4 3/3 pinctrl: Add support for Meson8b
In reply to Carlo CaioneQuoted 5 lines · Carlo Caione
From: Carlo Caione <[email protected]>
This patch adds support for the AmLogic Meson8b SoC.
Signed-off-by Carlo Caione <[email protected]>
Patch applied with Beniamino's ACK.
Yours,
Linus Walleij