All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 20:59 ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND

Hi Linus,

This patch series allows making use of the pinctrl-bcm2835 driver on
ARCH_BRCMSTB where it is also used. Binding document is updated, and
then the Kconfig language is updated to allow selecting this driver with
ARCH_BRCMSTB, finally, Al updates the logic to account for the
additional registers that were added on 7211.

Thanks!

Al Cooper (1):
  pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality

Doug Berger (1):
  pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB

Florian Fainelli (1):
  dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible

 .../bindings/pinctrl/brcm,bcm2835-gpio.txt    |  3 +
 drivers/pinctrl/bcm/Kconfig                   |  6 +-
 drivers/pinctrl/bcm/pinctrl-bcm2835.c         | 85 +++++++++++++++++--
 3 files changed, 88 insertions(+), 6 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 20:59 ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

Hi Linus,

This patch series allows making use of the pinctrl-bcm2835 driver on
ARCH_BRCMSTB where it is also used. Binding document is updated, and
then the Kconfig language is updated to allow selecting this driver with
ARCH_BRCMSTB, finally, Al updates the logic to account for the
additional registers that were added on 7211.

Thanks!

Al Cooper (1):
  pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality

Doug Berger (1):
  pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB

Florian Fainelli (1):
  dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible

 .../bindings/pinctrl/brcm,bcm2835-gpio.txt    |  3 +
 drivers/pinctrl/bcm/Kconfig                   |  6 +-
 drivers/pinctrl/bcm/pinctrl-bcm2835.c         | 85 +++++++++++++++++--
 3 files changed, 88 insertions(+), 6 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 20:59 ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mark Rutland, Stefan Wahren, Florian Fainelli, Scott Branden,
	Matheus Castello, Ray Jui, Linus Walleij, Al Cooper,
	Lukas Wunner, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Doug Berger, Nathan Chancellor

Hi Linus,

This patch series allows making use of the pinctrl-bcm2835 driver on
ARCH_BRCMSTB where it is also used. Binding document is updated, and
then the Kconfig language is updated to allow selecting this driver with
ARCH_BRCMSTB, finally, Al updates the logic to account for the
additional registers that were added on 7211.

Thanks!

Al Cooper (1):
  pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality

Doug Berger (1):
  pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB

Florian Fainelli (1):
  dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible

 .../bindings/pinctrl/brcm,bcm2835-gpio.txt    |  3 +
 drivers/pinctrl/bcm/Kconfig                   |  6 +-
 drivers/pinctrl/bcm/pinctrl-bcm2835.c         | 85 +++++++++++++++++--
 3 files changed, 88 insertions(+), 6 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
  2019-05-09 20:59 ` Florian Fainelli
  (?)
@ 2019-05-09 20:59   ` Florian Fainelli
  -1 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND

BCM7211 has a slightly different block layout and some additional GPIO
registers that were added, document the compatible string.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
index 3fac0a061bcc..ac6d614d74e0 100644
--- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
@@ -5,6 +5,9 @@ controller, and pinmux/control device.
 
 Required properties:
 - compatible: "brcm,bcm2835-gpio"
+- compatible: should be one of:
+  "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
+  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
 - reg: Should contain the physical address of the GPIO module's registers.
 - gpio-controller: Marks the device node as a GPIO controller.
 - #gpio-cells : Should be two. The first cell is the pin number and the
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

BCM7211 has a slightly different block layout and some additional GPIO
registers that were added, document the compatible string.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
index 3fac0a061bcc..ac6d614d74e0 100644
--- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
@@ -5,6 +5,9 @@ controller, and pinmux/control device.
 
 Required properties:
 - compatible: "brcm,bcm2835-gpio"
+- compatible: should be one of:
+  "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
+  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
 - reg: Should contain the physical address of the GPIO module's registers.
 - gpio-controller: Marks the device node as a GPIO controller.
 - #gpio-cells : Should be two. The first cell is the pin number and the
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mark Rutland, Stefan Wahren, Florian Fainelli, Scott Branden,
	Matheus Castello, Ray Jui, Linus Walleij, Al Cooper,
	Lukas Wunner, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Doug Berger, Nathan Chancellor

BCM7211 has a slightly different block layout and some additional GPIO
registers that were added, document the compatible string.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
index 3fac0a061bcc..ac6d614d74e0 100644
--- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
@@ -5,6 +5,9 @@ controller, and pinmux/control device.
 
 Required properties:
 - compatible: "brcm,bcm2835-gpio"
+- compatible: should be one of:
+  "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
+  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
 - reg: Should contain the physical address of the GPIO module's registers.
 - gpio-controller: Marks the device node as a GPIO controller.
 - #gpio-cells : Should be two. The first cell is the pin number and the
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
  2019-05-09 20:59 ` Florian Fainelli
  (?)
@ 2019-05-09 20:59   ` Florian Fainelli
  -1 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Doug Berger, Florian Fainelli, Linus Walleij, Rob Herring,
	Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND

From: Doug Berger <opendmb@gmail.com>

ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
like BCM7211 which adopted that pin controller for GPIO. This
commit makes the option menu configurable with default enabled
for ARCH_BRCMSTB and ARCH_BCM2835.

Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/Kconfig b/drivers/pinctrl/bcm/Kconfig
index c8575399d6f7..c57f1d9259d8 100644
--- a/drivers/pinctrl/bcm/Kconfig
+++ b/drivers/pinctrl/bcm/Kconfig
@@ -17,11 +17,15 @@ config PINCTRL_BCM281XX
 	  framework.  GPIO is provided by a separate GPIO driver.
 
 config PINCTRL_BCM2835
-	bool
+	bool "Broadcom BCM2835 GPIO (with PINCONF) driver"
+	depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
 	select PINMUX
 	select PINCONF
 	select GENERIC_PINCONF
 	select GPIOLIB_IRQCHIP
+	default ARCH_BCM2835 || ARCH_BRCMSTB
+	help
+	   Say Y here to enable the Broadcom BCM2835 GPIO driver.
 
 config PINCTRL_IPROC_GPIO
 	bool "Broadcom iProc GPIO (with PINCONF) driver"
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Doug Berger, Florian Fainelli, Linus Walleij, Rob Herring,
	Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

From: Doug Berger <opendmb@gmail.com>

ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
like BCM7211 which adopted that pin controller for GPIO. This
commit makes the option menu configurable with default enabled
for ARCH_BRCMSTB and ARCH_BCM2835.

Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/Kconfig b/drivers/pinctrl/bcm/Kconfig
index c8575399d6f7..c57f1d9259d8 100644
--- a/drivers/pinctrl/bcm/Kconfig
+++ b/drivers/pinctrl/bcm/Kconfig
@@ -17,11 +17,15 @@ config PINCTRL_BCM281XX
 	  framework.  GPIO is provided by a separate GPIO driver.
 
 config PINCTRL_BCM2835
-	bool
+	bool "Broadcom BCM2835 GPIO (with PINCONF) driver"
+	depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
 	select PINMUX
 	select PINCONF
 	select GENERIC_PINCONF
 	select GPIOLIB_IRQCHIP
+	default ARCH_BCM2835 || ARCH_BRCMSTB
+	help
+	   Say Y here to enable the Broadcom BCM2835 GPIO driver.
 
 config PINCTRL_IPROC_GPIO
 	bool "Broadcom iProc GPIO (with PINCONF) driver"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mark Rutland, Stefan Wahren, Florian Fainelli, Scott Branden,
	Matheus Castello, Ray Jui, Linus Walleij, Al Cooper, open list,
	Rob Herring, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Doug Berger,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Lukas Wunner, Nathan Chancellor

From: Doug Berger <opendmb@gmail.com>

ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
like BCM7211 which adopted that pin controller for GPIO. This
commit makes the option menu configurable with default enabled
for ARCH_BRCMSTB and ARCH_BCM2835.

Signed-off-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/Kconfig b/drivers/pinctrl/bcm/Kconfig
index c8575399d6f7..c57f1d9259d8 100644
--- a/drivers/pinctrl/bcm/Kconfig
+++ b/drivers/pinctrl/bcm/Kconfig
@@ -17,11 +17,15 @@ config PINCTRL_BCM281XX
 	  framework.  GPIO is provided by a separate GPIO driver.
 
 config PINCTRL_BCM2835
-	bool
+	bool "Broadcom BCM2835 GPIO (with PINCONF) driver"
+	depends on ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST
 	select PINMUX
 	select PINCONF
 	select GENERIC_PINCONF
 	select GPIOLIB_IRQCHIP
+	default ARCH_BCM2835 || ARCH_BRCMSTB
+	help
+	   Say Y here to enable the Broadcom BCM2835 GPIO driver.
 
 config PINCTRL_IPROC_GPIO
 	bool "Broadcom iProc GPIO (with PINCONF) driver"
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
  2019-05-09 20:59 ` Florian Fainelli
  (?)
@ 2019-05-09 20:59   ` Florian Fainelli
  -1 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Al Cooper, Florian Fainelli, Linus Walleij, Rob Herring,
	Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM, open list:OPEN FIRMWARE AND

From: Al Cooper <alcooperx@gmail.com>

The 7211 has a new way of selecting the pull-up/pull-down setting
for a GPIO pin. The registers used for the bcm2837, GP_PUD and
GP_PUDCLKn0, are no longer connected. A new set of registers,
GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
a new compatible string "brcm,bcm7211-gpio" and the kernel
driver will use it to select which method is used to select
pull-up/pull-down.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
 1 file changed, 80 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 183d1ffe6a75..35d9f9593000 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -57,15 +57,26 @@
 #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
 #define GPPUD		0x94	/* Pin Pull-up/down Enable */
 #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
+#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
 
 #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
 #define FSEL_SHIFT(p)		(((p) % 10) * 3)
 #define GPIO_REG_OFFSET(p)	((p) / 32)
 #define GPIO_REG_SHIFT(p)	((p) % 32)
 
+#define PUD_7211_MASK		0x3
+#define PUD_7211_REG_OFFSET(p)	((p) / 16)
+#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
+
 /* argument: bcm2835_pinconf_pull */
 #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
 
+enum bcm7211_pinconf_pull {
+	BCM7211_PINCONFIG_PULL_NONE,
+	BCM7211_PINCONFIG_PULL_UP,
+	BCM7211_PINCONFIG_PULL_DOWN,
+};
+
 struct bcm2835_pinctrl {
 	struct device *dev;
 	void __iomem *base;
@@ -975,6 +986,55 @@ static const struct pinconf_ops bcm2835_pinconf_ops = {
 	.pin_config_set = bcm2835_pinconf_set,
 };
 
+static int bcm7211_pinconf_set(struct pinctrl_dev *pctldev,
+			       unsigned int pin, unsigned long *configs,
+			       unsigned int num_configs)
+{
+	struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
+	u32 param, arg;
+	u32 shifter;
+	u32 value;
+	u32 off;
+	int i;
+
+	for (i = 0; i < num_configs; i++) {
+		param = pinconf_to_config_param(configs[i]);
+		if (param != BCM2835_PINCONF_PARAM_PULL)
+			return -EINVAL;
+		arg = pinconf_to_config_argument(configs[i]);
+
+		/* convert to 7211 value */
+		switch (arg) {
+		case PIN_CONFIG_BIAS_DISABLE:
+			arg = BCM7211_PINCONFIG_PULL_NONE;
+			break;
+		case PIN_CONFIG_BIAS_PULL_DOWN:
+			arg = BCM7211_PINCONFIG_PULL_DOWN;
+			break;
+		case PIN_CONFIG_BIAS_PULL_UP:
+			arg = BCM7211_PINCONFIG_PULL_UP;
+			break;
+		}
+
+		off = PUD_7211_REG_OFFSET(pin);
+		shifter = PUD_7211_REG_SHIFT(pin);
+
+		value = bcm2835_gpio_rd(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 +
+					(off * 4));
+		value &= ~(PUD_7211_MASK << shifter);
+		value |= (arg << shifter);
+		bcm2835_gpio_wr(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4),
+				value);
+	} /* for each config */
+
+	return 0;
+}
+
+static const struct pinconf_ops bcm7211_pinconf_ops = {
+	.pin_config_get = bcm2835_pinconf_get,
+	.pin_config_set = bcm7211_pinconf_set,
+};
+
 static struct pinctrl_desc bcm2835_pinctrl_desc = {
 	.name = MODULE_NAME,
 	.pins = bcm2835_gpio_pins,
@@ -990,6 +1050,18 @@ static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
 	.npins = BCM2835_NUM_GPIOS,
 };
 
+static const struct of_device_id bcm2835_pinctrl_match[] = {
+	{
+		.compatible = "brcm,bcm2835-gpio",
+		.data = &bcm2835_pinconf_ops,
+	},
+	{
+		.compatible = "brcm,bcm7211-gpio",
+		.data = &bcm7211_pinconf_ops,
+	},
+	{}
+};
+
 static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -997,6 +1069,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	struct bcm2835_pinctrl *pc;
 	struct resource iomem;
 	int err, i;
+	const struct of_device_id *match;
+
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS);
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS);
 
@@ -1073,6 +1147,12 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 					     bcm2835_gpio_irq_handler);
 	}
 
+	match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
+	if (match) {
+		bcm2835_pinctrl_desc.confops =
+			(const struct pinconf_ops *)match->data;
+	}
+
 	pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
 	if (IS_ERR(pc->pctl_dev)) {
 		gpiochip_remove(&pc->gpio_chip);
@@ -1087,11 +1167,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id bcm2835_pinctrl_match[] = {
-	{ .compatible = "brcm,bcm2835-gpio" },
-	{}
-};
-
 static struct platform_driver bcm2835_pinctrl_driver = {
 	.probe = bcm2835_pinctrl_probe,
 	.driver = {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Al Cooper, Florian Fainelli, Linus Walleij, Rob Herring,
	Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

From: Al Cooper <alcooperx@gmail.com>

The 7211 has a new way of selecting the pull-up/pull-down setting
for a GPIO pin. The registers used for the bcm2837, GP_PUD and
GP_PUDCLKn0, are no longer connected. A new set of registers,
GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
a new compatible string "brcm,bcm7211-gpio" and the kernel
driver will use it to select which method is used to select
pull-up/pull-down.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
 1 file changed, 80 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 183d1ffe6a75..35d9f9593000 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -57,15 +57,26 @@
 #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
 #define GPPUD		0x94	/* Pin Pull-up/down Enable */
 #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
+#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
 
 #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
 #define FSEL_SHIFT(p)		(((p) % 10) * 3)
 #define GPIO_REG_OFFSET(p)	((p) / 32)
 #define GPIO_REG_SHIFT(p)	((p) % 32)
 
+#define PUD_7211_MASK		0x3
+#define PUD_7211_REG_OFFSET(p)	((p) / 16)
+#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
+
 /* argument: bcm2835_pinconf_pull */
 #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
 
+enum bcm7211_pinconf_pull {
+	BCM7211_PINCONFIG_PULL_NONE,
+	BCM7211_PINCONFIG_PULL_UP,
+	BCM7211_PINCONFIG_PULL_DOWN,
+};
+
 struct bcm2835_pinctrl {
 	struct device *dev;
 	void __iomem *base;
@@ -975,6 +986,55 @@ static const struct pinconf_ops bcm2835_pinconf_ops = {
 	.pin_config_set = bcm2835_pinconf_set,
 };
 
+static int bcm7211_pinconf_set(struct pinctrl_dev *pctldev,
+			       unsigned int pin, unsigned long *configs,
+			       unsigned int num_configs)
+{
+	struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
+	u32 param, arg;
+	u32 shifter;
+	u32 value;
+	u32 off;
+	int i;
+
+	for (i = 0; i < num_configs; i++) {
+		param = pinconf_to_config_param(configs[i]);
+		if (param != BCM2835_PINCONF_PARAM_PULL)
+			return -EINVAL;
+		arg = pinconf_to_config_argument(configs[i]);
+
+		/* convert to 7211 value */
+		switch (arg) {
+		case PIN_CONFIG_BIAS_DISABLE:
+			arg = BCM7211_PINCONFIG_PULL_NONE;
+			break;
+		case PIN_CONFIG_BIAS_PULL_DOWN:
+			arg = BCM7211_PINCONFIG_PULL_DOWN;
+			break;
+		case PIN_CONFIG_BIAS_PULL_UP:
+			arg = BCM7211_PINCONFIG_PULL_UP;
+			break;
+		}
+
+		off = PUD_7211_REG_OFFSET(pin);
+		shifter = PUD_7211_REG_SHIFT(pin);
+
+		value = bcm2835_gpio_rd(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 +
+					(off * 4));
+		value &= ~(PUD_7211_MASK << shifter);
+		value |= (arg << shifter);
+		bcm2835_gpio_wr(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4),
+				value);
+	} /* for each config */
+
+	return 0;
+}
+
+static const struct pinconf_ops bcm7211_pinconf_ops = {
+	.pin_config_get = bcm2835_pinconf_get,
+	.pin_config_set = bcm7211_pinconf_set,
+};
+
 static struct pinctrl_desc bcm2835_pinctrl_desc = {
 	.name = MODULE_NAME,
 	.pins = bcm2835_gpio_pins,
@@ -990,6 +1050,18 @@ static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
 	.npins = BCM2835_NUM_GPIOS,
 };
 
+static const struct of_device_id bcm2835_pinctrl_match[] = {
+	{
+		.compatible = "brcm,bcm2835-gpio",
+		.data = &bcm2835_pinconf_ops,
+	},
+	{
+		.compatible = "brcm,bcm7211-gpio",
+		.data = &bcm7211_pinconf_ops,
+	},
+	{}
+};
+
 static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -997,6 +1069,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	struct bcm2835_pinctrl *pc;
 	struct resource iomem;
 	int err, i;
+	const struct of_device_id *match;
+
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS);
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS);
 
@@ -1073,6 +1147,12 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 					     bcm2835_gpio_irq_handler);
 	}
 
+	match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
+	if (match) {
+		bcm2835_pinctrl_desc.confops =
+			(const struct pinconf_ops *)match->data;
+	}
+
 	pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
 	if (IS_ERR(pc->pctl_dev)) {
 		gpiochip_remove(&pc->gpio_chip);
@@ -1087,11 +1167,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id bcm2835_pinctrl_match[] = {
-	{ .compatible = "brcm,bcm2835-gpio" },
-	{}
-};
-
 static struct platform_driver bcm2835_pinctrl_driver = {
 	.probe = bcm2835_pinctrl_probe,
 	.driver = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-09 20:59   ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-09 20:59 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mark Rutland, Stefan Wahren, Florian Fainelli, Scott Branden,
	Matheus Castello, Ray Jui, Linus Walleij, Al Cooper,
	Lukas Wunner, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Doug Berger, Nathan Chancellor

From: Al Cooper <alcooperx@gmail.com>

The 7211 has a new way of selecting the pull-up/pull-down setting
for a GPIO pin. The registers used for the bcm2837, GP_PUD and
GP_PUDCLKn0, are no longer connected. A new set of registers,
GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
a new compatible string "brcm,bcm7211-gpio" and the kernel
driver will use it to select which method is used to select
pull-up/pull-down.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
 1 file changed, 80 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 183d1ffe6a75..35d9f9593000 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -57,15 +57,26 @@
 #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
 #define GPPUD		0x94	/* Pin Pull-up/down Enable */
 #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
+#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
 
 #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
 #define FSEL_SHIFT(p)		(((p) % 10) * 3)
 #define GPIO_REG_OFFSET(p)	((p) / 32)
 #define GPIO_REG_SHIFT(p)	((p) % 32)
 
+#define PUD_7211_MASK		0x3
+#define PUD_7211_REG_OFFSET(p)	((p) / 16)
+#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
+
 /* argument: bcm2835_pinconf_pull */
 #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
 
+enum bcm7211_pinconf_pull {
+	BCM7211_PINCONFIG_PULL_NONE,
+	BCM7211_PINCONFIG_PULL_UP,
+	BCM7211_PINCONFIG_PULL_DOWN,
+};
+
 struct bcm2835_pinctrl {
 	struct device *dev;
 	void __iomem *base;
@@ -975,6 +986,55 @@ static const struct pinconf_ops bcm2835_pinconf_ops = {
 	.pin_config_set = bcm2835_pinconf_set,
 };
 
+static int bcm7211_pinconf_set(struct pinctrl_dev *pctldev,
+			       unsigned int pin, unsigned long *configs,
+			       unsigned int num_configs)
+{
+	struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
+	u32 param, arg;
+	u32 shifter;
+	u32 value;
+	u32 off;
+	int i;
+
+	for (i = 0; i < num_configs; i++) {
+		param = pinconf_to_config_param(configs[i]);
+		if (param != BCM2835_PINCONF_PARAM_PULL)
+			return -EINVAL;
+		arg = pinconf_to_config_argument(configs[i]);
+
+		/* convert to 7211 value */
+		switch (arg) {
+		case PIN_CONFIG_BIAS_DISABLE:
+			arg = BCM7211_PINCONFIG_PULL_NONE;
+			break;
+		case PIN_CONFIG_BIAS_PULL_DOWN:
+			arg = BCM7211_PINCONFIG_PULL_DOWN;
+			break;
+		case PIN_CONFIG_BIAS_PULL_UP:
+			arg = BCM7211_PINCONFIG_PULL_UP;
+			break;
+		}
+
+		off = PUD_7211_REG_OFFSET(pin);
+		shifter = PUD_7211_REG_SHIFT(pin);
+
+		value = bcm2835_gpio_rd(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 +
+					(off * 4));
+		value &= ~(PUD_7211_MASK << shifter);
+		value |= (arg << shifter);
+		bcm2835_gpio_wr(pc, GP_GPIO_PUP_PDN_CNTRL_REG0 + (off * 4),
+				value);
+	} /* for each config */
+
+	return 0;
+}
+
+static const struct pinconf_ops bcm7211_pinconf_ops = {
+	.pin_config_get = bcm2835_pinconf_get,
+	.pin_config_set = bcm7211_pinconf_set,
+};
+
 static struct pinctrl_desc bcm2835_pinctrl_desc = {
 	.name = MODULE_NAME,
 	.pins = bcm2835_gpio_pins,
@@ -990,6 +1050,18 @@ static struct pinctrl_gpio_range bcm2835_pinctrl_gpio_range = {
 	.npins = BCM2835_NUM_GPIOS,
 };
 
+static const struct of_device_id bcm2835_pinctrl_match[] = {
+	{
+		.compatible = "brcm,bcm2835-gpio",
+		.data = &bcm2835_pinconf_ops,
+	},
+	{
+		.compatible = "brcm,bcm7211-gpio",
+		.data = &bcm7211_pinconf_ops,
+	},
+	{}
+};
+
 static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -997,6 +1069,8 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	struct bcm2835_pinctrl *pc;
 	struct resource iomem;
 	int err, i;
+	const struct of_device_id *match;
+
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_pins) != BCM2835_NUM_GPIOS);
 	BUILD_BUG_ON(ARRAY_SIZE(bcm2835_gpio_groups) != BCM2835_NUM_GPIOS);
 
@@ -1073,6 +1147,12 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 					     bcm2835_gpio_irq_handler);
 	}
 
+	match = of_match_node(bcm2835_pinctrl_match, pdev->dev.of_node);
+	if (match) {
+		bcm2835_pinctrl_desc.confops =
+			(const struct pinconf_ops *)match->data;
+	}
+
 	pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
 	if (IS_ERR(pc->pctl_dev)) {
 		gpiochip_remove(&pc->gpio_chip);
@@ -1087,11 +1167,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id bcm2835_pinctrl_match[] = {
-	{ .compatible = "brcm,bcm2835-gpio" },
-	{}
-};
-
 static struct platform_driver bcm2835_pinctrl_driver = {
 	.probe = bcm2835_pinctrl_probe,
 	.driver = {
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
  2019-05-09 20:59 ` Florian Fainelli
  (?)
@ 2019-05-09 22:53   ` Eric Anholt
  -1 siblings, 0 replies; 30+ messages in thread
From: Eric Anholt @ 2019-05-09 22:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Florian Fainelli <f.fainelli@gmail.com> writes:

> Hi Linus,
>
> This patch series allows making use of the pinctrl-bcm2835 driver on
> ARCH_BRCMSTB where it is also used. Binding document is updated, and
> then the Kconfig language is updated to allow selecting this driver with
> ARCH_BRCMSTB, finally, Al updates the logic to account for the
> additional registers that were added on 7211.

As far as platform maintainer goes, patch 1-2 are:

Reviewed-by: Eric Anholt <eric@anholt.net>

and patch 3 is:

Acked-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 22:53   ` Eric Anholt
  0 siblings, 0 replies; 30+ messages in thread
From: Eric Anholt @ 2019-05-09 22:53 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: Florian Fainelli, Linus Walleij, Rob Herring, Mark Rutland,
	Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Florian Fainelli <f.fainelli@gmail.com> writes:

> Hi Linus,
>
> This patch series allows making use of the pinctrl-bcm2835 driver on
> ARCH_BRCMSTB where it is also used. Binding document is updated, and
> then the Kconfig language is updated to allow selecting this driver with
> ARCH_BRCMSTB, finally, Al updates the logic to account for the
> additional registers that were added on 7211.

As far as platform maintainer goes, patch 1-2 are:

Reviewed-by: Eric Anholt <eric@anholt.net>

and patch 3 is:

Acked-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-09 22:53   ` Eric Anholt
  0 siblings, 0 replies; 30+ messages in thread
From: Eric Anholt @ 2019-05-09 22:53 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: Mark Rutland, Stefan Wahren, Florian Fainelli, Scott Branden,
	Matheus Castello, Ray Jui, Linus Walleij, Al Cooper,
	Lukas Wunner, open list, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	Rafał Miłecki, Doug Berger, Nathan Chancellor


[-- Attachment #1.1: Type: text/plain, Size: 547 bytes --]

Florian Fainelli <f.fainelli@gmail.com> writes:

> Hi Linus,
>
> This patch series allows making use of the pinctrl-bcm2835 driver on
> ARCH_BRCMSTB where it is also used. Binding document is updated, and
> then the Kconfig language is updated to allow selecting this driver with
> ARCH_BRCMSTB, finally, Al updates the logic to account for the
> additional registers that were added on 7211.

As far as platform maintainer goes, patch 1-2 are:

Reviewed-by: Eric Anholt <eric@anholt.net>

and patch 3 is:

Acked-by: Eric Anholt <eric@anholt.net>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
  2019-05-09 20:59   ` Florian Fainelli
  (?)
@ 2019-05-13  8:14     ` Stefan Wahren
  -1 siblings, 0 replies; 30+ messages in thread
From: Stefan Wahren @ 2019-05-13  8:14 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: Al Cooper, Linus Walleij, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Florian,

On 09.05.19 22:59, Florian Fainelli wrote:
> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>  1 file changed, 80 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> index 183d1ffe6a75..35d9f9593000 100644
> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> @@ -57,15 +57,26 @@
>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>  
>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>  
> +#define PUD_7211_MASK		0x3
> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
> +
>  /* argument: bcm2835_pinconf_pull */
>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>  
> +enum bcm7211_pinconf_pull {
> +	BCM7211_PINCONFIG_PULL_NONE,
> +	BCM7211_PINCONFIG_PULL_UP,
> +	BCM7211_PINCONFIG_PULL_DOWN,
> +};

unfortunately this not usable for DTS files.

Please look at:
include/dt-bindings/pinctrl/bcm2835.h

Btw the meaning between BCM2835 and BCM7211 of pull down and up is
different :(

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-13  8:14     ` Stefan Wahren
  0 siblings, 0 replies; 30+ messages in thread
From: Stefan Wahren @ 2019-05-13  8:14 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: Al Cooper, Linus Walleij, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

Hi Florian,

On 09.05.19 22:59, Florian Fainelli wrote:
> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>  1 file changed, 80 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> index 183d1ffe6a75..35d9f9593000 100644
> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> @@ -57,15 +57,26 @@
>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>  
>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>  
> +#define PUD_7211_MASK		0x3
> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
> +
>  /* argument: bcm2835_pinconf_pull */
>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>  
> +enum bcm7211_pinconf_pull {
> +	BCM7211_PINCONFIG_PULL_NONE,
> +	BCM7211_PINCONFIG_PULL_UP,
> +	BCM7211_PINCONFIG_PULL_DOWN,
> +};

unfortunately this not usable for DTS files.

Please look at:
include/dt-bindings/pinctrl/bcm2835.h

Btw the meaning between BCM2835 and BCM7211 of pull down and up is
different :(


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-13  8:14     ` Stefan Wahren
  0 siblings, 0 replies; 30+ messages in thread
From: Stefan Wahren @ 2019-05-13  8:14 UTC (permalink / raw)
  To: Florian Fainelli, linux-arm-kernel
  Cc: Mark Rutland,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Doug Berger, Scott Branden, Matheus Castello, Ray Jui,
	Linus Walleij, Al Cooper, open list, Eric Anholt, Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Lukas Wunner, Nathan Chancellor

Hi Florian,

On 09.05.19 22:59, Florian Fainelli wrote:
> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>  1 file changed, 80 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> index 183d1ffe6a75..35d9f9593000 100644
> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> @@ -57,15 +57,26 @@
>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>  
>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>  
> +#define PUD_7211_MASK		0x3
> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
> +
>  /* argument: bcm2835_pinconf_pull */
>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>  
> +enum bcm7211_pinconf_pull {
> +	BCM7211_PINCONFIG_PULL_NONE,
> +	BCM7211_PINCONFIG_PULL_UP,
> +	BCM7211_PINCONFIG_PULL_DOWN,
> +};

unfortunately this not usable for DTS files.

Please look at:
include/dt-bindings/pinctrl/bcm2835.h

Btw the meaning between BCM2835 and BCM7211 of pull down and up is
different :(


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
  2019-05-13  8:14     ` Stefan Wahren
  (?)
@ 2019-05-13 16:27       ` Florian Fainelli
  -1 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-13 16:27 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli, linux-arm-kernel
  Cc: Al Cooper, Linus Walleij, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On 5/13/19 1:14 AM, Stefan Wahren wrote:
> Hi Florian,
> 
> On 09.05.19 22:59, Florian Fainelli wrote:
>> From: Al Cooper <alcooperx@gmail.com>
>>
>> The 7211 has a new way of selecting the pull-up/pull-down setting
>> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
>> GP_PUDCLKn0, are no longer connected. A new set of registers,
>> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
>> a new compatible string "brcm,bcm7211-gpio" and the kernel
>> driver will use it to select which method is used to select
>> pull-up/pull-down.
>>
>> Signed-off-by: Al Cooper <alcooperx@gmail.com>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>>  1 file changed, 80 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> index 183d1ffe6a75..35d9f9593000 100644
>> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> @@ -57,15 +57,26 @@
>>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
>> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>>  
>>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>>  
>> +#define PUD_7211_MASK		0x3
>> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
>> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
>> +
>>  /* argument: bcm2835_pinconf_pull */
>>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>>  
>> +enum bcm7211_pinconf_pull {
>> +	BCM7211_PINCONFIG_PULL_NONE,
>> +	BCM7211_PINCONFIG_PULL_UP,
>> +	BCM7211_PINCONFIG_PULL_DOWN,
>> +};
> 
> unfortunately this not usable for DTS files.
> 
> Please look at:
> include/dt-bindings/pinctrl/bcm2835.h

Good point, indeed, looks like I misported this from our downstream
kernel to upstream and the pins were already set correctly.

> 
> Btw the meaning between BCM2835 and BCM7211 of pull down and up is
> different :(
> 
That can be resolved entirely within the driver though, but yes, that's
unfortunate.
-- 
Florian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-13 16:27       ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-13 16:27 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli, linux-arm-kernel
  Cc: Al Cooper, Linus Walleij, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

On 5/13/19 1:14 AM, Stefan Wahren wrote:
> Hi Florian,
> 
> On 09.05.19 22:59, Florian Fainelli wrote:
>> From: Al Cooper <alcooperx@gmail.com>
>>
>> The 7211 has a new way of selecting the pull-up/pull-down setting
>> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
>> GP_PUDCLKn0, are no longer connected. A new set of registers,
>> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
>> a new compatible string "brcm,bcm7211-gpio" and the kernel
>> driver will use it to select which method is used to select
>> pull-up/pull-down.
>>
>> Signed-off-by: Al Cooper <alcooperx@gmail.com>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>>  1 file changed, 80 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> index 183d1ffe6a75..35d9f9593000 100644
>> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> @@ -57,15 +57,26 @@
>>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
>> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>>  
>>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>>  
>> +#define PUD_7211_MASK		0x3
>> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
>> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
>> +
>>  /* argument: bcm2835_pinconf_pull */
>>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>>  
>> +enum bcm7211_pinconf_pull {
>> +	BCM7211_PINCONFIG_PULL_NONE,
>> +	BCM7211_PINCONFIG_PULL_UP,
>> +	BCM7211_PINCONFIG_PULL_DOWN,
>> +};
> 
> unfortunately this not usable for DTS files.
> 
> Please look at:
> include/dt-bindings/pinctrl/bcm2835.h

Good point, indeed, looks like I misported this from our downstream
kernel to upstream and the pins were already set correctly.

> 
> Btw the meaning between BCM2835 and BCM7211 of pull down and up is
> different :(
> 
That can be resolved entirely within the driver though, but yes, that's
unfortunate.
-- 
Florian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-13 16:27       ` Florian Fainelli
  0 siblings, 0 replies; 30+ messages in thread
From: Florian Fainelli @ 2019-05-13 16:27 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli, linux-arm-kernel
  Cc: Mark Rutland,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Doug Berger, Scott Branden, Matheus Castello, Ray Jui,
	Linus Walleij, Al Cooper, open list, Eric Anholt, Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	open list:PIN CONTROL SUBSYSTEM, Rafał Miłecki,
	Lukas Wunner, Nathan Chancellor

On 5/13/19 1:14 AM, Stefan Wahren wrote:
> Hi Florian,
> 
> On 09.05.19 22:59, Florian Fainelli wrote:
>> From: Al Cooper <alcooperx@gmail.com>
>>
>> The 7211 has a new way of selecting the pull-up/pull-down setting
>> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
>> GP_PUDCLKn0, are no longer connected. A new set of registers,
>> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
>> a new compatible string "brcm,bcm7211-gpio" and the kernel
>> driver will use it to select which method is used to select
>> pull-up/pull-down.
>>
>> Signed-off-by: Al Cooper <alcooperx@gmail.com>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/pinctrl/bcm/pinctrl-bcm2835.c | 85 +++++++++++++++++++++++++--
>>  1 file changed, 80 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> index 183d1ffe6a75..35d9f9593000 100644
>> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
>> @@ -57,15 +57,26 @@
>>  #define GPAFEN0		0x88	/* Pin Async Falling Edge Detect */
>>  #define GPPUD		0x94	/* Pin Pull-up/down Enable */
>>  #define GPPUDCLK0	0x98	/* Pin Pull-up/down Enable Clock */
>> +#define GP_GPIO_PUP_PDN_CNTRL_REG0 0xe4 /* 7211 Pin Pull-up/down select */
>>  
>>  #define FSEL_REG(p)		(GPFSEL0 + (((p) / 10) * 4))
>>  #define FSEL_SHIFT(p)		(((p) % 10) * 3)
>>  #define GPIO_REG_OFFSET(p)	((p) / 32)
>>  #define GPIO_REG_SHIFT(p)	((p) % 32)
>>  
>> +#define PUD_7211_MASK		0x3
>> +#define PUD_7211_REG_OFFSET(p)	((p) / 16)
>> +#define PUD_7211_REG_SHIFT(p)	(((p) % 16) * 2)
>> +
>>  /* argument: bcm2835_pinconf_pull */
>>  #define BCM2835_PINCONF_PARAM_PULL	(PIN_CONFIG_END + 1)
>>  
>> +enum bcm7211_pinconf_pull {
>> +	BCM7211_PINCONFIG_PULL_NONE,
>> +	BCM7211_PINCONFIG_PULL_UP,
>> +	BCM7211_PINCONFIG_PULL_DOWN,
>> +};
> 
> unfortunately this not usable for DTS files.
> 
> Please look at:
> include/dt-bindings/pinctrl/bcm2835.h

Good point, indeed, looks like I misported this from our downstream
kernel to upstream and the pins were already set correctly.

> 
> Btw the meaning between BCM2835 and BCM7211 of pull down and up is
> different :(
> 
That can be resolved entirely within the driver though, but yes, that's
unfortunate.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
  2019-05-09 20:59   ` Florian Fainelli
  (?)
@ 2019-05-16 13:25     ` Linus Walleij
  -1 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Rob Herring, Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> BCM7211 has a slightly different block layout and some additional GPIO
> registers that were added, document the compatible string.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
@ 2019-05-16 13:25     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Rob Herring, Mark Rutland, Ray Jui, Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> BCM7211 has a slightly different block layout and some additional GPIO
> registers that were added, document the compatible string.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible
@ 2019-05-16 13:25     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Mark Rutland, Stefan Wahren, Doug Berger, Scott Branden,
	Matheus Castello, Ray Jui, open list:PIN CONTROL SUBSYSTEM,
	Al Cooper, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Linux ARM

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> BCM7211 has a slightly different block layout and some additional GPIO
> registers that were added, document the compatible string.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with ACKs.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
  2019-05-09 20:59   ` Florian Fainelli
  (?)
@ 2019-05-16 13:25     ` Linus Walleij
  -1 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Doug Berger, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Doug Berger <opendmb@gmail.com>
>
> ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
> like BCM7211 which adopted that pin controller for GPIO. This
> commit makes the option menu configurable with default enabled
> for ARCH_BRCMSTB and ARCH_BCM2835.
>
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with the ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-16 13:25     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Doug Berger, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Al Cooper, open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Doug Berger <opendmb@gmail.com>
>
> ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
> like BCM7211 which adopted that pin controller for GPIO. This
> commit makes the option menu configurable with default enabled
> for ARCH_BRCMSTB and ARCH_BCM2835.
>
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with the ACKs.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB
@ 2019-05-16 13:25     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Mark Rutland, Stefan Wahren, Doug Berger, Scott Branden,
	Matheus Castello, Ray Jui, open list:PIN CONTROL SUBSYSTEM,
	Al Cooper, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Linux ARM

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Doug Berger <opendmb@gmail.com>
>
> ARCH_BRCMSTB needs to use the BCM2835 pin controller for chips
> like BCM7211 which adopted that pin controller for GPIO. This
> commit makes the option menu configurable with default enabled
> for ARCH_BRCMSTB and ARCH_BCM2835.
>
> Signed-off-by: Doug Berger <opendmb@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Patch applied for v5.3 with the ACKs.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
  2019-05-09 20:59   ` Florian Fainelli
  (?)
@ 2019-05-16 13:27     ` Linus Walleij
  -1 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:27 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Al Cooper, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Following the discussion with Stefan it appears this patch
needs more work, but you will only need to resend this
one patch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-16 13:27     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:27 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linux ARM, Al Cooper, Rob Herring, Mark Rutland, Ray Jui,
	Scott Branden,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	Eric Anholt, Stefan Wahren, Doug Berger, Matheus Castello,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	open list:PIN CONTROL SUBSYSTEM,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE, open list

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Following the discussion with Stefan it appears this patch
needs more work, but you will only need to resend this
one patch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality
@ 2019-05-16 13:27     ` Linus Walleij
  0 siblings, 0 replies; 30+ messages in thread
From: Linus Walleij @ 2019-05-16 13:27 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Mark Rutland, Stefan Wahren, Doug Berger, Scott Branden,
	Matheus Castello, Ray Jui, open list:PIN CONTROL SUBSYSTEM,
	Al Cooper, open list, Eric Anholt,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring,
	maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...,
	moderated list:BROADCOM BCM2835 ARM ARCHITECTURE,
	Rafał Miłecki, Lukas Wunner, Nathan Chancellor,
	Linux ARM

On Thu, May 9, 2019 at 11:01 PM Florian Fainelli <f.fainelli@gmail.com> wrote:

> From: Al Cooper <alcooperx@gmail.com>
>
> The 7211 has a new way of selecting the pull-up/pull-down setting
> for a GPIO pin. The registers used for the bcm2837, GP_PUD and
> GP_PUDCLKn0, are no longer connected. A new set of registers,
> GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
> a new compatible string "brcm,bcm7211-gpio" and the kernel
> driver will use it to select which method is used to select
> pull-up/pull-down.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Following the discussion with Stefan it appears this patch
needs more work, but you will only need to resend this
one patch.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2019-05-16 13:28 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 20:59 [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB Florian Fainelli
2019-05-09 20:59 ` Florian Fainelli
2019-05-09 20:59 ` Florian Fainelli
2019-05-09 20:59 ` [PATCH 1/3] dt-bindings: pinctrl: bcm2835-gpio: Document BCM7211 compatible Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-16 13:25   ` Linus Walleij
2019-05-16 13:25     ` Linus Walleij
2019-05-16 13:25     ` Linus Walleij
2019-05-09 20:59 ` [PATCH 2/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-16 13:25   ` Linus Walleij
2019-05-16 13:25     ` Linus Walleij
2019-05-16 13:25     ` Linus Walleij
2019-05-09 20:59 ` [PATCH 3/3] pinctrl: bcm2835: bcm7211: Add support for 7211 pull-up functionality Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-09 20:59   ` Florian Fainelli
2019-05-13  8:14   ` Stefan Wahren
2019-05-13  8:14     ` Stefan Wahren
2019-05-13  8:14     ` Stefan Wahren
2019-05-13 16:27     ` Florian Fainelli
2019-05-13 16:27       ` Florian Fainelli
2019-05-13 16:27       ` Florian Fainelli
2019-05-16 13:27   ` Linus Walleij
2019-05-16 13:27     ` Linus Walleij
2019-05-16 13:27     ` Linus Walleij
2019-05-09 22:53 ` [PATCH 0/3] pinctrl: bcm: Allow PINCTRL_BCM2835 for ARCH_BRCMSTB Eric Anholt
2019-05-09 22:53   ` Eric Anholt
2019-05-09 22:53   ` Eric Anholt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.