* [PATCH 0/4] gpio: dwapb: Fix reference clocks usage @ 2020-03-06 13:24 Sergey.Semin 2020-03-12 13:58 ` Linus Walleij ` (2 more replies) 0 siblings, 3 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-06 13:24 UTC (permalink / raw) Cc: Serge Semin, Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, linux-gpio, devicetree, linux-kernel From: Serge Semin <fancer.lancer@gmail.com> There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers supported by the kernel DW APB GPIO driver. It works for them just fine with no modifications. But still there is a room for optimizations there. First of all as it tends to be traditional for all Baikal-T1 SoC related patchset we replaced the legacy plain text-based dt-binding file with yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, but in order to use it the corresponding reference clock must be enabled. We added support of that clock in the driver and made sure the dt-bindings had its declaration. In addition seeing both APB and debounce reference clocks are optional, we replaced the standard devm_clk_get() usage with the function of optional clocks acquisition. This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: commit 98d54f81e36b ("Linux 5.6-rc4"). Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: linux-gpio@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (4): dt-bindings: gpio: Replace DW APB GPIO legacy bindings with YAML-based one dt-bindings: gpio: Add DW GPIO debounce clocks bindings gpio: dwapb: Use optional-clocks interface for APB ref-clocks gpio: dwapb: Add debounce reference clock support .../bindings/gpio/snps,dw-apb-gpio.yaml | 140 ++++++++++++++++++ .../bindings/gpio/snps-dwapb-gpio.txt | 65 -------- drivers/gpio/gpio-dwapb.c | 41 +++-- 3 files changed, 166 insertions(+), 80 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt -- 2.25.1 ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 0/4] gpio: dwapb: Fix reference clocks usage 2020-03-06 13:24 [PATCH 0/4] gpio: dwapb: Fix reference clocks usage Sergey.Semin @ 2020-03-12 13:58 ` Linus Walleij 2020-03-13 15:29 ` Sergey Semin 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin 2020-04-15 21:27 ` [PATCH 0/4] " Linus Walleij 2 siblings, 1 reply; 31+ messages in thread From: Linus Walleij @ 2020-03-12 13:58 UTC (permalink / raw) To: Sergey.Semin Cc: Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, open list:GPIO SUBSYSTEM, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linux-kernel On Fri, Mar 6, 2020 at 2:25 PM <Sergey.Semin@baikalelectronics.ru> wrote: > From: Serge Semin <fancer.lancer@gmail.com> > > There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers > supported by the kernel DW APB GPIO driver. It works for them just fine with > no modifications. But still there is a room for optimizations there. > > First of all as it tends to be traditional for all Baikal-T1 SoC related > patchset we replaced the legacy plain text-based dt-binding file with > yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, > but in order to use it the corresponding reference clock must be enabled. > We added support of that clock in the driver and made sure the dt-bindings > had its declaration. In addition seeing both APB and debounce reference > clocks are optional, we replaced the standard devm_clk_get() usage with > the function of optional clocks acquisition. > > This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: > commit 98d54f81e36b ("Linux 5.6-rc4"). > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> > Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> > Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> > Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> > Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Hoan Tran <hoan@os.amperecomputing.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: linux-gpio@vger.kernel.org > Cc: devicetree@vger.kernel.org > Cc: linux-kernel@vger.kernel.org I like these patches, once Rob is happy with the bindings I'll be happy to merge them. I haven't heard from Hoan Tran in a while, so if we don't hear from him this time either I would suggest you also add yourself as maintainer for this driver, if you don't mind. Thanks, Linus Walleij ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 0/4] gpio: dwapb: Fix reference clocks usage 2020-03-12 13:58 ` Linus Walleij @ 2020-03-13 15:29 ` Sergey Semin 0 siblings, 0 replies; 31+ messages in thread From: Sergey Semin @ 2020-03-13 15:29 UTC (permalink / raw) To: Linus Walleij Cc: Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, open list:GPIO SUBSYSTEM, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linux-kernel On Thu, Mar 12, 2020 at 02:58:33PM +0100, Linus Walleij wrote: > On Fri, Mar 6, 2020 at 2:25 PM <Sergey.Semin@baikalelectronics.ru> wrote: > > > From: Serge Semin <fancer.lancer@gmail.com> > > > > There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers > > supported by the kernel DW APB GPIO driver. It works for them just fine with > > no modifications. But still there is a room for optimizations there. > > > > First of all as it tends to be traditional for all Baikal-T1 SoC related > > patchset we replaced the legacy plain text-based dt-binding file with > > yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, > > but in order to use it the corresponding reference clock must be enabled. > > We added support of that clock in the driver and made sure the dt-bindings > > had its declaration. In addition seeing both APB and debounce reference > > clocks are optional, we replaced the standard devm_clk_get() usage with > > the function of optional clocks acquisition. > > > > This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: > > commit 98d54f81e36b ("Linux 5.6-rc4"). > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > > Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> > > Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> > > Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> > > Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> > > Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> > > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > > Cc: Paul Burton <paulburton@kernel.org> > > Cc: Ralf Baechle <ralf@linux-mips.org> > > Cc: Hoan Tran <hoan@os.amperecomputing.com> > > Cc: Linus Walleij <linus.walleij@linaro.org> > > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > > Cc: Philipp Zabel <p.zabel@pengutronix.de> > > Cc: Rob Herring <robh+dt@kernel.org> > > Cc: Mark Rutland <mark.rutland@arm.com> > > Cc: linux-gpio@vger.kernel.org > > Cc: devicetree@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > I like these patches, once Rob is happy with the bindings I'll be > happy to merge them. I haven't heard from Hoan Tran in a while, > so if we don't hear from him this time either I would suggest you > also add yourself as maintainer for this driver, if you don't mind. > > Thanks, > Linus Walleij Hello Linus, Thanks for positive response. I'll resend the patchset soon in the email-threaded form together with two extra patches, which will add me to the MAINTAINERS list and to the dt-schema of the driver. If Hoan Tran will show up before you merge them, just drop these two new patches. Regards, -Sergey ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v2 0/6] gpio: dwapb: Fix reference clocks usage 2020-03-06 13:24 [PATCH 0/4] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-12 13:58 ` Linus Walleij @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin ` (6 more replies) 2020-04-15 21:27 ` [PATCH 0/4] " Linus Walleij 2 siblings, 7 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) Cc: Serge Semin, Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, linux-gpio, devicetree, linux-kernel From: Serge Semin <fancer.lancer@gmail.com> There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers supported by the kernel DW APB GPIO driver. It works for them just fine with no modifications. But still there is a room for optimizations there. First of all as it tends to be traditional for all Baikal-T1 SoC related patchset we replaced the legacy plain text-based dt-binding file with yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, but in order to use it the corresponding reference clock must be enabled. We added support of that clock in the driver and made sure the dt-bindings had its declaration. In addition seeing both APB and debounce reference clocks are optional, we replaced the standard devm_clk_get() usage with the function of optional clocks acquisition. This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: commit 98d54f81e36b ("Linux 5.6-rc4"). Changelog v2: - Use a shorter summary describing the DT bindings conversion patch. - Add myself to the MAINTAINERS file as a maintainer of the DW APB GPIO driver. - Add myself to the maintainers list of the DW APB GPIO driver DT schema. - Print error instead of info-message if APB/debounce clocks either failed to be acquired or couldn't be enabled. - Rearrange the SoB tags. - Make sure DT schema defines the lowercase hex numbers in the main dt-node name and in the sub-node names. - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations on the "snps,nr-gpios" property of the DW APB GPIO DT schema. - Discard "interrupts-extended" property from the DT schema. - Make sure the sub-nodes have names with either 'gpio-port' or 'gpio-controller' prefixes. - Our corporate email server doesn't change Message-Id anymore, so the patchset is resubmitted being in the cover-letter-threaded format. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: linux-gpio@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (6): dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema dt-bindings: gpio: Add DW GPIO debounce clock property dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers gpio: dwapb: Use optional-clocks interface for APB ref-clock gpio: dwapb: Add debounce reference clock support MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver .../bindings/gpio/snps,dw-apb-gpio.yaml | 134 ++++++++++++++++++ .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- MAINTAINERS | 1 + drivers/gpio/gpio-dwapb.c | 41 ++++-- 4 files changed, 161 insertions(+), 80 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt -- 2.25.1 ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v2 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin ` (5 subsequent siblings) 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland, Hoan Tran Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Rob Herring, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Modern device tree bindings are supposed to be created as YAML-files in accordance with DT schema. This commit replaces Synopsys DW GPIO legacy bare text binding with YAML file. As before the binding file states that the corresponding dts node is supposed to be compatible with generic DW I2C controller indicated by the "snps,dw-apb-gpio" compatible string and to provide a mandatory registers memory range. It may also have an optional clock and reset phandle references. There must be specified at least one subnode with "snps,dw-apb-gpio-port" compatible string indicating the GPIO port, which would actually export the GPIO controller functionality. Such nodes should have traditional GPIO controller properties together with optional interrupt-controller attributes if the corresponding controller was synthesized to detect and report the input values change to the parental IRQ controller. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Changelog v2: - Use lowercase hex numbers in the main node name and in the sub-node names. - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations on the "snps,nr-gpios" property. - Discard "interrupts-extended" property. - Make sure the sub-nodes have names with either 'gpio-port' or 'gpio-controller' prefixes. The DT scheme provided by this patch will pass the dt_binding_check command after the next patches are merged to the dt-schema repo: --- a/schemas/gpio/gpio.yaml +++ b/schemas/gpio/gpio.yaml @@ -34,7 +34,7 @@ properties: - $ref: "/schemas/types.yaml#/definitions/phandle-array" patternProperties: - ".*-gpios?$": + "(?<!,nr)-gpios?$": $ref: "/schemas/types.yaml#/definitions/phandle-array" "^gpios$": $ref: "/schemas/types.yaml#/definitions/phandle-array" --- a/meta-schemas/gpios.yaml 2020-03-13 20:20:10.072900019 +0300 +++ b/meta-schemas/gpios.yaml 2020-03-13 20:20:16.000953216 +0300 @@ -19,9 +19,7 @@ $ref: "cell.yaml#array" patternProperties: - '.*-gpio$': - $ref: "cell.yaml#array" - '.*-gpios$': + '(?<!,nr)-gpios?$': $ref: "cell.yaml#array" dependencies: --- .../bindings/gpio/snps,dw-apb-gpio.yaml | 129 ++++++++++++++++++ .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- 2 files changed, 129 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml new file mode 100644 index 000000000000..f84f92c4dd53 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/snps,dw-apb-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Synopsys DesignWare APB GPIO controller + +description: | + Synopsys DesignWare GPIO controllers have a configurable number of ports, + each of which are intended to be represented as child nodes with the generic + GPIO-controller properties as desribed in this bindings file. + +maintainers: + - Hoan Tran <hoan@os.amperecomputing.com> + +properties: + $nodename: + pattern: "^gpio@[0-9a-f]+$" + + compatible: + const: snps,dw-apb-gpio + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reg: + maxItems: 1 + + clocks: + items: + - description: APB interface clock source + + clock-names: + items: + - const: bus + + resets: + maxItems: 1 + +patternProperties: + "^gpio-(port|controller)@[0-9a-f]+$": + type: object + properties: + compatible: + const: snps,dw-apb-gpio-port + + reg: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + snps,nr-gpios: + description: The number of GPIO pins exported by the port. + default: 32 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 1 + maximum: 32 + + interrupts: + description: | + The interrupts to the parent controller raised when GPIOs generate + the interrupts. If the controller provides one combined interrupt + for all GPIOs, specify a single interrupt. If the controller provides + one interrupt for each GPIO, provide a list of interrupts that + correspond to each of the GPIO pins. + minItems: 1 + maxItems: 32 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + + dependencies: + interrupt-controller: [ interrupts ] + + additionalProperties: false + +additionalProperties: false + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + +examples: + - | + gpio: gpio@20000 { + compatible = "snps,dw-apb-gpio"; + reg = <0x20000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + + porta: gpio-port@0 { + compatible = "snps,dw-apb-gpio-port"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + snps,nr-gpios = <8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&vic1>; + interrupts = <0>; + }; + + portb: gpio-port@1 { + compatible = "snps,dw-apb-gpio-port"; + reg = <1>; + gpio-controller; + #gpio-cells = <2>; + snps,nr-gpios = <8>; + }; + }; +... diff --git a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt deleted file mode 100644 index 839dd32ffe11..000000000000 --- a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt +++ /dev/null @@ -1,65 +0,0 @@ -* Synopsys DesignWare APB GPIO controller - -Required properties: -- compatible : Should contain "snps,dw-apb-gpio" -- reg : Address and length of the register set for the device. -- #address-cells : should be 1 (for addressing port subnodes). -- #size-cells : should be 0 (port subnodes). - -The GPIO controller has a configurable number of ports, each of which are -represented as child nodes with the following properties: - -Required properties: -- compatible : "snps,dw-apb-gpio-port" -- gpio-controller : Marks the device node as a gpio controller. -- #gpio-cells : Should be two. The first cell is the pin number and - the second cell is used to specify the gpio polarity: - 0 = active high - 1 = active low -- reg : The integer port index of the port, a single cell. - -Optional properties: -- interrupt-controller : The first port may be configured to be an interrupt -controller. -- #interrupt-cells : Specifies the number of cells needed to encode an - interrupt. Shall be set to 2. The first cell defines the interrupt number, - the second encodes the triger flags encoded as described in - Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -- interrupts : The interrupts to the parent controller raised when GPIOs - generate the interrupts. If the controller provides one combined interrupt - for all GPIOs, specify a single interrupt. If the controller provides one - interrupt for each GPIO, provide a list of interrupts that correspond to each - of the GPIO pins. When specifying multiple interrupts, if any are unconnected, - use the interrupts-extended property to specify the interrupts and set the - interrupt controller handle for unused interrupts to 0. -- snps,nr-gpios : The number of pins in the port, a single cell. -- resets : Reset line for the controller. - -Example: - -gpio: gpio@20000 { - compatible = "snps,dw-apb-gpio"; - reg = <0x20000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - - porta: gpio@0 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - #gpio-cells = <2>; - snps,nr-gpios = <8>; - reg = <0>; - interrupt-controller; - #interrupt-cells = <2>; - interrupt-parent = <&vic1>; - interrupts = <0>; - }; - - portb: gpio@1 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - #gpio-cells = <2>; - snps,nr-gpios = <8>; - reg = <1>; - }; -}; -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v2 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin ` (4 subsequent siblings) 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland Cc: Serge Semin, Serge Semin, Rob Herring, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Port A of the DW GPIO controller may optionally have a debounce logic enabled if it was synthesized with that functionality enabled. In this case a dedicated reference clock should be declared in the node with corresponding "db" name presented in the clock-names property. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Acked-by: Rob Herring <robh@kernel.org> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml index f84f92c4dd53..58a8df367623 100644 --- a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -31,12 +31,16 @@ properties: maxItems: 1 clocks: + minItems: 1 items: - description: APB interface clock source + - description: DW GPIO debounce reference clock source clock-names: + minItems: 1 items: - const: bus + - const: db resets: maxItems: 1 -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v2 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin ` (3 subsequent siblings) 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland Cc: Serge Semin, Serge Semin, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Rob Herring, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Seeing Hoan has been silent for a long time Linus suggested to me to be also maintaining the driver. This patch adds myself to the list of maintainers in the DT schema of the driver. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml index 58a8df367623..04a3c51e1dc1 100644 --- a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -13,6 +13,7 @@ description: | maintainers: - Hoan Tran <hoan@os.amperecomputing.com> + - Serge Semin <fancer.lancer@gmail.com> properties: $nodename: -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin ` (2 preceding siblings ...) 2020-03-23 18:06 ` [PATCH v2 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:36 ` Andy Shevchenko 2020-03-23 18:06 ` [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin ` (2 subsequent siblings) 6 siblings, 1 reply; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) To: Hoan Tran, Linus Walleij, Bartosz Golaszewski Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Thomas Gleixner, Kate Stewart, Andy Shevchenko, linux-gpio, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> The common clocks kernel framework provides a generic way to use an optional reference clock sources. If it's utilized there is no need in checking whether the clock descriptor pointer is actually a negative error at the moment of the prepare/unprepare clocks method calling. So if the corresponding clock source is provided, then getting an error shall actually terminate the device probe procedure. If it isn't specified then the driver shall proceed with further initializations. We'll use the optional clocks getting method to handle the APB reference clock, which can be provided for instance in the device of-node with "bus" clock-name. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Changelog v2: - Print error instead of info-message if APB clock either failed to be acquired or couldn't be enabled. --- drivers/gpio/gpio-dwapb.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 92e127e74813..0c5abfa361e6 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -690,13 +690,16 @@ static int dwapb_gpio_probe(struct platform_device *pdev) return PTR_ERR(gpio->regs); /* Optional bus clock */ - gpio->clk = devm_clk_get(&pdev->dev, "bus"); - if (!IS_ERR(gpio->clk)) { - err = clk_prepare_enable(gpio->clk); - if (err) { - dev_info(&pdev->dev, "Cannot enable clock\n"); - return err; - } + gpio->clk = devm_clk_get_optional(&pdev->dev, "bus"); + if (IS_ERR(gpio->clk)) { + dev_err(&pdev->dev, "Cannot get APB clock\n"); + return PTR_ERR(gpio->clk); + } + + err = clk_prepare_enable(gpio->clk); + if (err) { + dev_err(&pdev->dev, "Cannot enable APB clock\n"); + return err; } gpio->flags = 0; @@ -793,8 +796,7 @@ static int dwapb_gpio_resume(struct device *dev) unsigned long flags; int i; - if (!IS_ERR(gpio->clk)) - clk_prepare_enable(gpio->clk); + clk_prepare_enable(gpio->clk); spin_lock_irqsave(&gc->bgpio_lock, flags); for (i = 0; i < gpio->nr_ports; i++) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock 2020-03-23 18:06 ` [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin @ 2020-03-23 18:36 ` Andy Shevchenko 0 siblings, 0 replies; 31+ messages in thread From: Andy Shevchenko @ 2020-03-23 18:36 UTC (permalink / raw) To: Sergey.Semin Cc: Hoan Tran, Linus Walleij, Bartosz Golaszewski, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Thomas Gleixner, Kate Stewart, linux-gpio, linux-kernel On Mon, Mar 23, 2020 at 09:06:30PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > The common clocks kernel framework provides a generic way to use > an optional reference clock sources. If it's utilized there is no > need in checking whether the clock descriptor pointer is actually a > negative error at the moment of the prepare/unprepare clocks method > calling. So if the corresponding clock source is provided, then > getting an error shall actually terminate the device probe procedure. > If it isn't specified then the driver shall proceed with further > initializations. > > We'll use the optional clocks getting method to handle the APB reference > clock, which can be provided for instance in the device of-node with > "bus" clock-name. > - if (!IS_ERR(gpio->clk)) > - clk_prepare_enable(gpio->clk); > + clk_prepare_enable(gpio->clk); Perhaps it makes sense now to consider error code returned by above. Maybe it's material for a separate patch (up to you). The rest looks good. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin ` (3 preceding siblings ...) 2020-03-23 18:06 ` [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:38 ` Andy Shevchenko 2020-03-23 18:06 ` [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin 6 siblings, 1 reply; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) To: Hoan Tran, Linus Walleij, Bartosz Golaszewski Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Allison Randal, Kate Stewart, Andy Shevchenko, Thomas Gleixner, linux-gpio, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Aside from the APB reference clock DW GPIO controller can have a dedicated clock connected to setup a debounce time interval for GPIO-based IRQs. Since this functionality is optional the corresponding clock source is also optional. Due to this lets handle the debounce clock in the same way as it has been developed for the APB reference clock, but using the bulk request/enable-disable methods. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Changelog v2: - Print error instead of info-message if APB/debounce clocks either failed to be acquired or couldn't be enabled. --- drivers/gpio/gpio-dwapb.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 0c5abfa361e6..d2ed11510f3c 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -62,6 +62,8 @@ #define GPIO_INTSTATUS_V2 0x3c #define GPIO_PORTA_EOI_V2 0x40 +#define DWAPB_NR_CLOCKS 2 + struct dwapb_gpio; #ifdef CONFIG_PM_SLEEP @@ -97,7 +99,7 @@ struct dwapb_gpio { struct irq_domain *domain; unsigned int flags; struct reset_control *rst; - struct clk *clk; + struct clk_bulk_data clks[DWAPB_NR_CLOCKS]; }; static inline u32 gpio_reg_v2_convert(unsigned int offset) @@ -689,16 +691,19 @@ static int dwapb_gpio_probe(struct platform_device *pdev) if (IS_ERR(gpio->regs)) return PTR_ERR(gpio->regs); - /* Optional bus clock */ - gpio->clk = devm_clk_get_optional(&pdev->dev, "bus"); - if (IS_ERR(gpio->clk)) { - dev_err(&pdev->dev, "Cannot get APB clock\n"); - return PTR_ERR(gpio->clk); + /* Optional bus and debounce clocks */ + gpio->clks[0].id = "bus"; + gpio->clks[1].id = "db"; + err = devm_clk_bulk_get_optional(&pdev->dev, DWAPB_NR_CLOCKS, + gpio->clks); + if (err) { + dev_err(&pdev->dev, "Cannot get APB/Debounce clocks\n"); + return err; } - err = clk_prepare_enable(gpio->clk); + err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks); if (err) { - dev_err(&pdev->dev, "Cannot enable APB clock\n"); + dev_err(&pdev->dev, "Cannot enable APB/Debounce clocks\n"); return err; } @@ -727,7 +732,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev) out_unregister: dwapb_gpio_unregister(gpio); dwapb_irq_teardown(gpio); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return err; } @@ -739,7 +744,7 @@ static int dwapb_gpio_remove(struct platform_device *pdev) dwapb_gpio_unregister(gpio); dwapb_irq_teardown(gpio); reset_control_assert(gpio->rst); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return 0; } @@ -784,7 +789,7 @@ static int dwapb_gpio_suspend(struct device *dev) } spin_unlock_irqrestore(&gc->bgpio_lock, flags); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return 0; } @@ -794,9 +799,13 @@ static int dwapb_gpio_resume(struct device *dev) struct dwapb_gpio *gpio = dev_get_drvdata(dev); struct gpio_chip *gc = &gpio->ports[0].gc; unsigned long flags; - int i; + int i, err; - clk_prepare_enable(gpio->clk); + err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks); + if (err) { + dev_err(gpio->dev, "Cannot reenable APB/Debounce clocks\n"); + return err; + } spin_lock_irqsave(&gc->bgpio_lock, flags); for (i = 0; i < gpio->nr_ports; i++) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support 2020-03-23 18:06 ` [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin @ 2020-03-23 18:38 ` Andy Shevchenko 2020-03-23 19:25 ` Sergey Semin 0 siblings, 1 reply; 31+ messages in thread From: Andy Shevchenko @ 2020-03-23 18:38 UTC (permalink / raw) To: Sergey.Semin Cc: Hoan Tran, Linus Walleij, Bartosz Golaszewski, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Allison Randal, Kate Stewart, Thomas Gleixner, linux-gpio, linux-kernel On Mon, Mar 23, 2020 at 09:06:31PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Aside from the APB reference clock DW GPIO controller can have a > dedicated clock connected to setup a debounce time interval for > GPIO-based IRQs. Since this functionality is optional the corresponding > clock source is also optional. Due to this lets handle the debounce > clock in the same way as it has been developed for the APB reference > clock, but using the bulk request/enable-disable methods. > + if (err) { > + dev_err(gpio->dev, "Cannot reenable APB/Debounce clocks\n"); > + return err; > + } Yeah, this should be a separate change. Otherwise looks good. Also, did I miss the documentation update (bindings)? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support 2020-03-23 18:38 ` Andy Shevchenko @ 2020-03-23 19:25 ` Sergey Semin 2020-03-23 21:37 ` Andy Shevchenko 0 siblings, 1 reply; 31+ messages in thread From: Sergey Semin @ 2020-03-23 19:25 UTC (permalink / raw) To: Andy Shevchenko Cc: Hoan Tran, Linus Walleij, Bartosz Golaszewski, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Allison Randal, Kate Stewart, Thomas Gleixner, linux-gpio, linux-kernel On Mon, Mar 23, 2020 at 08:38:37PM +0200, Andy Shevchenko wrote: > On Mon, Mar 23, 2020 at 09:06:31PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > > > Aside from the APB reference clock DW GPIO controller can have a > > dedicated clock connected to setup a debounce time interval for > > GPIO-based IRQs. Since this functionality is optional the corresponding > > clock source is also optional. Due to this lets handle the debounce > > clock in the same way as it has been developed for the APB reference > > clock, but using the bulk request/enable-disable methods. > > > + if (err) { > > + dev_err(gpio->dev, "Cannot reenable APB/Debounce clocks\n"); > > + return err; > > + } > > Yeah, this should be a separate change. > Linus didn't think it was necessary in v1. > Otherwise looks good. > > Also, did I miss the documentation update (bindings)? > No, it's there: https://www.spinics.net/lists/devicetree/msg342655.html You just haven't been in Cc there. -Sergey > -- > With Best Regards, > Andy Shevchenko > > ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support 2020-03-23 19:25 ` Sergey Semin @ 2020-03-23 21:37 ` Andy Shevchenko 0 siblings, 0 replies; 31+ messages in thread From: Andy Shevchenko @ 2020-03-23 21:37 UTC (permalink / raw) To: Sergey Semin Cc: Andy Shevchenko, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Allison Randal, Kate Stewart, Thomas Gleixner, open list:GPIO SUBSYSTEM, Linux Kernel Mailing List On Mon, Mar 23, 2020 at 9:28 PM Sergey Semin <Sergey.Semin@baikalelectronics.ru> wrote: > On Mon, Mar 23, 2020 at 08:38:37PM +0200, Andy Shevchenko wrote: > > On Mon, Mar 23, 2020 at 09:06:31PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > > > > > Aside from the APB reference clock DW GPIO controller can have a > > > dedicated clock connected to setup a debounce time interval for > > > GPIO-based IRQs. Since this functionality is optional the corresponding > > > clock source is also optional. Due to this lets handle the debounce > > > clock in the same way as it has been developed for the APB reference > > > clock, but using the bulk request/enable-disable methods. > > > > > + if (err) { > > > + dev_err(gpio->dev, "Cannot reenable APB/Debounce clocks\n"); > > > + return err; > > > + } > > > > Yeah, this should be a separate change. > > > > Linus didn't think it was necessary in v1. Ah, okay! > > Otherwise looks good. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin ` (4 preceding siblings ...) 2020-03-23 18:06 ` [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin @ 2020-03-23 18:06 ` Sergey.Semin 2020-03-23 18:34 ` Andy Shevchenko 2020-03-23 18:36 ` Joe Perches 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin 6 siblings, 2 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 18:06 UTC (permalink / raw) Cc: Serge Semin, Serge Semin, Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, Andy Shevchenko, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-gpio@vger.kernel.org --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6158a143a13e..1940862de204 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c SYNOPSYS DESIGNWARE APB GPIO DRIVER M: Hoan Tran <hoan@os.amperecomputing.com> +S: Serge Semin <fancer.lancer@gmail.com> L: linux-gpio@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 18:06 ` [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin @ 2020-03-23 18:34 ` Andy Shevchenko 2020-03-23 19:18 ` Sergey Semin 2020-03-23 18:36 ` Joe Perches 1 sibling, 1 reply; 31+ messages in thread From: Andy Shevchenko @ 2020-03-23 18:34 UTC (permalink / raw) To: Sergey.Semin Cc: Serge Semin, Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, linux-kernel On Mon, Mar 23, 2020 at 09:06:32PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. I see neither cover letter, nor first three patches. What's going on? > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c > > SYNOPSYS DESIGNWARE APB GPIO DRIVER > M: Hoan Tran <hoan@os.amperecomputing.com> > +S: Serge Semin <fancer.lancer@gmail.com> Are you sure you used a correct letter? > L: linux-gpio@vger.kernel.org > S: Maintained > F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt Had you chance to run parse-maintainers.pl to see if other fields are in order? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 18:34 ` Andy Shevchenko @ 2020-03-23 19:18 ` Sergey Semin 0 siblings, 0 replies; 31+ messages in thread From: Sergey Semin @ 2020-03-23 19:18 UTC (permalink / raw) To: Andy Shevchenko Cc: Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, linux-kernel On Mon, Mar 23, 2020 at 08:34:24PM +0200, Andy Shevchenko wrote: > On Mon, Mar 23, 2020 at 09:06:32PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > > > Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. > > I see neither cover letter, nor first three patches. What's going on? > Automatic "cc-cmd" is added you to the Cc list. You've been referenced as a patch submitter, that's why you are in Cc to this and some another patch. Regards, -Sergey > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c > > > > SYNOPSYS DESIGNWARE APB GPIO DRIVER > > M: Hoan Tran <hoan@os.amperecomputing.com> > > > +S: Serge Semin <fancer.lancer@gmail.com> > > Are you sure you used a correct letter? > > > L: linux-gpio@vger.kernel.org > > S: Maintained > > F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > > Had you chance to run parse-maintainers.pl to see if other fields are in order? > > -- > With Best Regards, > Andy Shevchenko > > ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 18:06 ` [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin 2020-03-23 18:34 ` Andy Shevchenko @ 2020-03-23 18:36 ` Joe Perches 2020-03-23 19:16 ` Sergey Semin 1 sibling, 1 reply; 31+ messages in thread From: Joe Perches @ 2020-03-23 18:36 UTC (permalink / raw) To: Sergey.Semin Cc: Serge Semin, Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, Andy Shevchenko, linux-kernel On Mon, 2020-03-23 at 21:06 +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. [] > diff --git a/MAINTAINERS b/MAINTAINERS [] > @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c > > SYNOPSYS DESIGNWARE APB GPIO DRIVER > M: Hoan Tran <hoan@os.amperecomputing.com> > +S: Serge Semin <fancer.lancer@gmail.com> nack - S: is not the right line type prefix You need to use an M: type line not an S:. The S: line is for subsystem status which should be one of: S: *Status*, one of the following: Supported: Someone is actually paid to look after this. Maintained: Someone actually looks after it. Odd Fixes: It has a maintainer but they don't have time to do much other than throw the odd patch in. See below.. Orphan: No current maintainer [but maybe you could take the role as you write your new code]. Obsolete: Old code. Something tagged obsolete generally means it has been replaced by a better system and you should be using that. > L: linux-gpio@vger.kernel.org > S: Maintained like this... > F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 18:36 ` Joe Perches @ 2020-03-23 19:16 ` Sergey Semin 0 siblings, 0 replies; 31+ messages in thread From: Sergey Semin @ 2020-03-23 19:16 UTC (permalink / raw) To: Joe Perches Cc: Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, Andy Shevchenko, linux-kernel On Mon, Mar 23, 2020 at 11:36:45AM -0700, Joe Perches wrote: > On Mon, 2020-03-23 at 21:06 +0300, Sergey.Semin@baikalelectronics.ru > wrote: > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > > > Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. > [] > > diff --git a/MAINTAINERS b/MAINTAINERS > [] > > @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c > > > > SYNOPSYS DESIGNWARE APB GPIO DRIVER > > M: Hoan Tran <hoan@os.amperecomputing.com> > > +S: Serge Semin <fancer.lancer@gmail.com> > > nack - S: is not the right line type prefix > > You need to use an M: type line not an S:. > Ah, yeah. Will fix it in v3. Regards, -Sergey > The S: line is for subsystem status which should be one of: > > S: *Status*, one of the following: > Supported: Someone is actually paid to look after this. > Maintained: Someone actually looks after it. > Odd Fixes: It has a maintainer but they don't have time to do > much other than throw the odd patch in. See below.. > Orphan: No current maintainer [but maybe you could take the > role as you write your new code]. > Obsolete: Old code. Something tagged obsolete generally means > it has been replaced by a better system and you > should be using that. > > > L: linux-gpio@vger.kernel.org > > S: Maintained > > like this... > > > F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > > > ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin ` (5 preceding siblings ...) 2020-03-23 18:06 ` [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin @ 2020-03-23 19:53 ` Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin ` (6 more replies) 6 siblings, 7 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:53 UTC (permalink / raw) Cc: Serge Semin, Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, Andy Shevchenko, linux-gpio, devicetree, linux-kernel From: Serge Semin <fancer.lancer@gmail.com> There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers supported by the kernel DW APB GPIO driver. It works for them just fine with no modifications. But still there is a room for optimizations there. First of all as it tends to be traditional for all Baikal-T1 SoC related patchset we replaced the legacy plain text-based dt-binding file with yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, but in order to use it the corresponding reference clock must be enabled. We added support of that clock in the driver and made sure the dt-bindings had its declaration. In addition seeing both APB and debounce reference clocks are optional, we replaced the standard devm_clk_get() usage with the function of optional clocks acquisition. This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: commit 98d54f81e36b ("Linux 5.6-rc4"). Changelog v2: - Use a shorter summary describing the DT bindings conversion patch. - Add myself to the MAINTAINERS file as a maintainer of the DW APB GPIO driver. - Add myself to the maintainers list of the DW APB GPIO driver DT schema. - Print error instead of info-message if APB/debounce clocks either failed to be acquired or couldn't be enabled. - Rearrange the SoB tags. - Make sure DT schema defines the lowercase hex numbers in the main dt-node name and in the sub-node names. - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations on the "snps,nr-gpios" property of the DW APB GPIO DT schema. - Discard "interrupts-extended" property from the DT schema. - Make sure the sub-nodes have names with either 'gpio-port' or 'gpio-controller' prefixes. - Our corporate email server doesn't change Message-Id anymore, so the patchset is resubmitted being in the cover-letter-threaded format. Changelog v3: - Replace S: with M: section entry in the MAINTAINERS file. - Cc Andy to all patches he isn't added by the auto "cc-cmd" command. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Cc: linux-gpio@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (6): dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema dt-bindings: gpio: Add DW GPIO debounce clock property dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers gpio: dwapb: Use optional-clocks interface for APB ref-clock gpio: dwapb: Add debounce reference clock support MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver .../bindings/gpio/snps,dw-apb-gpio.yaml | 134 ++++++++++++++++++ .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- MAINTAINERS | 1 + drivers/gpio/gpio-dwapb.c | 41 ++++-- 4 files changed, 161 insertions(+), 80 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt -- 2.25.1 ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin @ 2020-03-23 19:53 ` Sergey.Semin 2020-03-31 19:24 ` Rob Herring 2020-03-23 19:53 ` [PATCH v3 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin ` (5 subsequent siblings) 6 siblings, 1 reply; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:53 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland, Hoan Tran, Serge Semin Cc: Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, Rob Herring, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Modern device tree bindings are supposed to be created as YAML-files in accordance with DT schema. This commit replaces Synopsys DW GPIO legacy bare text binding with YAML file. As before the binding file states that the corresponding dts node is supposed to be compatible with generic DW I2C controller indicated by the "snps,dw-apb-gpio" compatible string and to provide a mandatory registers memory range. It may also have an optional clock and reset phandle references. There must be specified at least one subnode with "snps,dw-apb-gpio-port" compatible string indicating the GPIO port, which would actually export the GPIO controller functionality. Such nodes should have traditional GPIO controller properties together with optional interrupt-controller attributes if the corresponding controller was synthesized to detect and report the input values change to the parental IRQ controller. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- Changelog v2: - Use lowercase hex numbers in the main node name and in the sub-node names. - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations on the "snps,nr-gpios" property. - Discard "interrupts-extended" property. - Make sure the sub-nodes have names with either 'gpio-port' or 'gpio-controller' prefixes. The DT scheme provided by this patch will pass the dt_binding_check command after the next patches are merged to the dt-schema repo: --- a/schemas/gpio/gpio.yaml +++ b/schemas/gpio/gpio.yaml @@ -34,7 +34,7 @@ properties: - $ref: "/schemas/types.yaml#/definitions/phandle-array" patternProperties: - ".*-gpios?$": + "(?<!,nr)-gpios?$": $ref: "/schemas/types.yaml#/definitions/phandle-array" "^gpios$": $ref: "/schemas/types.yaml#/definitions/phandle-array" --- a/meta-schemas/gpios.yaml 2020-03-13 20:20:10.072900019 +0300 +++ b/meta-schemas/gpios.yaml 2020-03-13 20:20:16.000953216 +0300 @@ -19,9 +19,7 @@ $ref: "cell.yaml#array" patternProperties: - '.*-gpio$': - $ref: "cell.yaml#array" - '.*-gpios$': + '(?<!,nr)-gpios?$': $ref: "cell.yaml#array" dependencies: --- .../bindings/gpio/snps,dw-apb-gpio.yaml | 129 ++++++++++++++++++ .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- 2 files changed, 129 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml new file mode 100644 index 000000000000..f84f92c4dd53 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/snps,dw-apb-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Synopsys DesignWare APB GPIO controller + +description: | + Synopsys DesignWare GPIO controllers have a configurable number of ports, + each of which are intended to be represented as child nodes with the generic + GPIO-controller properties as desribed in this bindings file. + +maintainers: + - Hoan Tran <hoan@os.amperecomputing.com> + +properties: + $nodename: + pattern: "^gpio@[0-9a-f]+$" + + compatible: + const: snps,dw-apb-gpio + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reg: + maxItems: 1 + + clocks: + items: + - description: APB interface clock source + + clock-names: + items: + - const: bus + + resets: + maxItems: 1 + +patternProperties: + "^gpio-(port|controller)@[0-9a-f]+$": + type: object + properties: + compatible: + const: snps,dw-apb-gpio-port + + reg: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + snps,nr-gpios: + description: The number of GPIO pins exported by the port. + default: 32 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 1 + maximum: 32 + + interrupts: + description: | + The interrupts to the parent controller raised when GPIOs generate + the interrupts. If the controller provides one combined interrupt + for all GPIOs, specify a single interrupt. If the controller provides + one interrupt for each GPIO, provide a list of interrupts that + correspond to each of the GPIO pins. + minItems: 1 + maxItems: 32 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + + dependencies: + interrupt-controller: [ interrupts ] + + additionalProperties: false + +additionalProperties: false + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + +examples: + - | + gpio: gpio@20000 { + compatible = "snps,dw-apb-gpio"; + reg = <0x20000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + + porta: gpio-port@0 { + compatible = "snps,dw-apb-gpio-port"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + snps,nr-gpios = <8>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&vic1>; + interrupts = <0>; + }; + + portb: gpio-port@1 { + compatible = "snps,dw-apb-gpio-port"; + reg = <1>; + gpio-controller; + #gpio-cells = <2>; + snps,nr-gpios = <8>; + }; + }; +... diff --git a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt deleted file mode 100644 index 839dd32ffe11..000000000000 --- a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt +++ /dev/null @@ -1,65 +0,0 @@ -* Synopsys DesignWare APB GPIO controller - -Required properties: -- compatible : Should contain "snps,dw-apb-gpio" -- reg : Address and length of the register set for the device. -- #address-cells : should be 1 (for addressing port subnodes). -- #size-cells : should be 0 (port subnodes). - -The GPIO controller has a configurable number of ports, each of which are -represented as child nodes with the following properties: - -Required properties: -- compatible : "snps,dw-apb-gpio-port" -- gpio-controller : Marks the device node as a gpio controller. -- #gpio-cells : Should be two. The first cell is the pin number and - the second cell is used to specify the gpio polarity: - 0 = active high - 1 = active low -- reg : The integer port index of the port, a single cell. - -Optional properties: -- interrupt-controller : The first port may be configured to be an interrupt -controller. -- #interrupt-cells : Specifies the number of cells needed to encode an - interrupt. Shall be set to 2. The first cell defines the interrupt number, - the second encodes the triger flags encoded as described in - Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -- interrupts : The interrupts to the parent controller raised when GPIOs - generate the interrupts. If the controller provides one combined interrupt - for all GPIOs, specify a single interrupt. If the controller provides one - interrupt for each GPIO, provide a list of interrupts that correspond to each - of the GPIO pins. When specifying multiple interrupts, if any are unconnected, - use the interrupts-extended property to specify the interrupts and set the - interrupt controller handle for unused interrupts to 0. -- snps,nr-gpios : The number of pins in the port, a single cell. -- resets : Reset line for the controller. - -Example: - -gpio: gpio@20000 { - compatible = "snps,dw-apb-gpio"; - reg = <0x20000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - - porta: gpio@0 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - #gpio-cells = <2>; - snps,nr-gpios = <8>; - reg = <0>; - interrupt-controller; - #interrupt-cells = <2>; - interrupt-parent = <&vic1>; - interrupts = <0>; - }; - - portb: gpio@1 { - compatible = "snps,dw-apb-gpio-port"; - gpio-controller; - #gpio-cells = <2>; - snps,nr-gpios = <8>; - reg = <1>; - }; -}; -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema 2020-03-23 19:53 ` [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin @ 2020-03-31 19:24 ` Rob Herring 0 siblings, 0 replies; 31+ messages in thread From: Rob Herring @ 2020-03-31 19:24 UTC (permalink / raw) To: Sergey.Semin Cc: Linus Walleij, Bartosz Golaszewski, Mark Rutland, Hoan Tran, Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, linux-gpio, devicetree, linux-kernel On Mon, Mar 23, 2020 at 10:53:56PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Modern device tree bindings are supposed to be created as YAML-files > in accordance with DT schema. This commit replaces Synopsys DW GPIO > legacy bare text binding with YAML file. As before the binding file > states that the corresponding dts node is supposed to be compatible > with generic DW I2C controller indicated by the "snps,dw-apb-gpio" > compatible string and to provide a mandatory registers memory range. > It may also have an optional clock and reset phandle references. > > There must be specified at least one subnode with > "snps,dw-apb-gpio-port" compatible string indicating the GPIO port, > which would actually export the GPIO controller functionality. Such > nodes should have traditional GPIO controller properties together > with optional interrupt-controller attributes if the corresponding > controller was synthesized to detect and report the input values > change to the parental IRQ controller. > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > --- > > Changelog v2: > - Use lowercase hex numbers in the main node name and in the sub-node names. > - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations > on the "snps,nr-gpios" property. > - Discard "interrupts-extended" property. > - Make sure the sub-nodes have names with either 'gpio-port' or > 'gpio-controller' prefixes. > > The DT scheme provided by this patch will pass the dt_binding_check > command after the next patches are merged to the dt-schema repo: Merged now. > --- > .../bindings/gpio/snps,dw-apb-gpio.yaml | 129 ++++++++++++++++++ > .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- > 2 files changed, 129 insertions(+), 65 deletions(-) > create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml > delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt Reviewed-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v3 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin @ 2020-03-23 19:53 ` Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin ` (4 subsequent siblings) 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:53 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland Cc: Serge Semin, Serge Semin, Rob Herring, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Port A of the DW GPIO controller may optionally have a debounce logic enabled if it was synthesized with that functionality enabled. In this case a dedicated reference clock should be declared in the node with corresponding "db" name presented in the clock-names property. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Acked-by: Rob Herring <robh@kernel.org> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml index f84f92c4dd53..58a8df367623 100644 --- a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -31,12 +31,16 @@ properties: maxItems: 1 clocks: + minItems: 1 items: - description: APB interface clock source + - description: DW GPIO debounce reference clock source clock-names: + minItems: 1 items: - const: bus + - const: db resets: maxItems: 1 -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin @ 2020-03-23 19:53 ` Sergey.Semin 2020-03-31 19:25 ` Rob Herring 2020-03-23 19:53 ` [PATCH v3 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin ` (3 subsequent siblings) 6 siblings, 1 reply; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:53 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Mark Rutland Cc: Serge Semin, Serge Semin, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, Rob Herring, linux-gpio, devicetree, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Seeing Hoan has been silent for a long time Linus suggested to me to be also maintaining the driver. This patch adds myself to the list of maintainers in the DT schema of the driver. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml index 58a8df367623..04a3c51e1dc1 100644 --- a/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml @@ -13,6 +13,7 @@ description: | maintainers: - Hoan Tran <hoan@os.amperecomputing.com> + - Serge Semin <fancer.lancer@gmail.com> properties: $nodename: -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers 2020-03-23 19:53 ` [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin @ 2020-03-31 19:25 ` Rob Herring 0 siblings, 0 replies; 31+ messages in thread From: Rob Herring @ 2020-03-31 19:25 UTC (permalink / raw) To: Sergey.Semin Cc: Linus Walleij, Bartosz Golaszewski, Mark Rutland, Serge Semin, Serge Semin, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, linux-gpio, devicetree, linux-kernel On Mon, 23 Mar 2020 22:53:58 +0300, <Sergey.Semin@baikalelectronics.ru> wrote: > From: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Seeing Hoan has been silent for a long time Linus suggested to me > to be also maintaining the driver. This patch adds myself to the list > of maintainers in the DT schema of the driver. > > Suggested-by: Linus Walleij <linus.walleij@linaro.org> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Cc: Hoan Tran <hoan@os.amperecomputing.com> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml | 1 + > 1 file changed, 1 insertion(+) > Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v3 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin ` (2 preceding siblings ...) 2020-03-23 19:53 ` [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin @ 2020-03-23 19:53 ` Sergey.Semin 2020-03-23 19:54 ` [PATCH v3 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin ` (2 subsequent siblings) 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:53 UTC (permalink / raw) To: Hoan Tran, Serge Semin, Linus Walleij, Bartosz Golaszewski Cc: Serge Semin, Andy Shevchenko, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Enrico Weigelt, metux IT consult, Greg Kroah-Hartman, Thomas Gleixner, linux-gpio, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> The common clocks kernel framework provides a generic way to use an optional reference clock sources. If it's utilized there is no need in checking whether the clock descriptor pointer is actually a negative error at the moment of the prepare/unprepare clocks method calling. So if the corresponding clock source is provided, then getting an error shall actually terminate the device probe procedure. If it isn't specified then the driver shall proceed with further initializations. We'll use the optional clocks getting method to handle the APB reference clock, which can be provided for instance in the device of-node with "bus" clock-name. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Changelog v2: - Print error instead of info-message if APB clock either failed to be acquired or couldn't be enabled. --- drivers/gpio/gpio-dwapb.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 92e127e74813..0c5abfa361e6 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -690,13 +690,16 @@ static int dwapb_gpio_probe(struct platform_device *pdev) return PTR_ERR(gpio->regs); /* Optional bus clock */ - gpio->clk = devm_clk_get(&pdev->dev, "bus"); - if (!IS_ERR(gpio->clk)) { - err = clk_prepare_enable(gpio->clk); - if (err) { - dev_info(&pdev->dev, "Cannot enable clock\n"); - return err; - } + gpio->clk = devm_clk_get_optional(&pdev->dev, "bus"); + if (IS_ERR(gpio->clk)) { + dev_err(&pdev->dev, "Cannot get APB clock\n"); + return PTR_ERR(gpio->clk); + } + + err = clk_prepare_enable(gpio->clk); + if (err) { + dev_err(&pdev->dev, "Cannot enable APB clock\n"); + return err; } gpio->flags = 0; @@ -793,8 +796,7 @@ static int dwapb_gpio_resume(struct device *dev) unsigned long flags; int i; - if (!IS_ERR(gpio->clk)) - clk_prepare_enable(gpio->clk); + clk_prepare_enable(gpio->clk); spin_lock_irqsave(&gc->bgpio_lock, flags); for (i = 0; i < gpio->nr_ports; i++) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v3 5/6] gpio: dwapb: Add debounce reference clock support 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin ` (3 preceding siblings ...) 2020-03-23 19:53 ` [PATCH v3 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin @ 2020-03-23 19:54 ` Sergey.Semin 2020-03-23 19:54 ` [PATCH v3 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin 2020-03-23 21:39 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Andy Shevchenko 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:54 UTC (permalink / raw) To: Hoan Tran, Serge Semin, Linus Walleij, Bartosz Golaszewski Cc: Serge Semin, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, Enrico Weigelt, metux IT consult, Allison Randal, Thomas Gleixner, linux-gpio, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Aside from the APB reference clock DW GPIO controller can have a dedicated clock connected to setup a debounce time interval for GPIO-based IRQs. Since this functionality is optional the corresponding clock source is also optional. Due to this lets handle the debounce clock in the same way as it has been developed for the APB reference clock, but using the bulk request/enable-disable methods. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> --- Changelog v2: - Print error instead of info-message if APB/debounce clocks either failed to be acquired or couldn't be enabled. --- drivers/gpio/gpio-dwapb.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 0c5abfa361e6..d2ed11510f3c 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -62,6 +62,8 @@ #define GPIO_INTSTATUS_V2 0x3c #define GPIO_PORTA_EOI_V2 0x40 +#define DWAPB_NR_CLOCKS 2 + struct dwapb_gpio; #ifdef CONFIG_PM_SLEEP @@ -97,7 +99,7 @@ struct dwapb_gpio { struct irq_domain *domain; unsigned int flags; struct reset_control *rst; - struct clk *clk; + struct clk_bulk_data clks[DWAPB_NR_CLOCKS]; }; static inline u32 gpio_reg_v2_convert(unsigned int offset) @@ -689,16 +691,19 @@ static int dwapb_gpio_probe(struct platform_device *pdev) if (IS_ERR(gpio->regs)) return PTR_ERR(gpio->regs); - /* Optional bus clock */ - gpio->clk = devm_clk_get_optional(&pdev->dev, "bus"); - if (IS_ERR(gpio->clk)) { - dev_err(&pdev->dev, "Cannot get APB clock\n"); - return PTR_ERR(gpio->clk); + /* Optional bus and debounce clocks */ + gpio->clks[0].id = "bus"; + gpio->clks[1].id = "db"; + err = devm_clk_bulk_get_optional(&pdev->dev, DWAPB_NR_CLOCKS, + gpio->clks); + if (err) { + dev_err(&pdev->dev, "Cannot get APB/Debounce clocks\n"); + return err; } - err = clk_prepare_enable(gpio->clk); + err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks); if (err) { - dev_err(&pdev->dev, "Cannot enable APB clock\n"); + dev_err(&pdev->dev, "Cannot enable APB/Debounce clocks\n"); return err; } @@ -727,7 +732,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev) out_unregister: dwapb_gpio_unregister(gpio); dwapb_irq_teardown(gpio); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return err; } @@ -739,7 +744,7 @@ static int dwapb_gpio_remove(struct platform_device *pdev) dwapb_gpio_unregister(gpio); dwapb_irq_teardown(gpio); reset_control_assert(gpio->rst); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return 0; } @@ -784,7 +789,7 @@ static int dwapb_gpio_suspend(struct device *dev) } spin_unlock_irqrestore(&gc->bgpio_lock, flags); - clk_disable_unprepare(gpio->clk); + clk_bulk_disable_unprepare(DWAPB_NR_CLOCKS, gpio->clks); return 0; } @@ -794,9 +799,13 @@ static int dwapb_gpio_resume(struct device *dev) struct dwapb_gpio *gpio = dev_get_drvdata(dev); struct gpio_chip *gc = &gpio->ports[0].gc; unsigned long flags; - int i; + int i, err; - clk_prepare_enable(gpio->clk); + err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks); + if (err) { + dev_err(gpio->dev, "Cannot reenable APB/Debounce clocks\n"); + return err; + } spin_lock_irqsave(&gc->bgpio_lock, flags); for (i = 0; i < gpio->nr_ports; i++) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v3 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin ` (4 preceding siblings ...) 2020-03-23 19:54 ` [PATCH v3 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin @ 2020-03-23 19:54 ` Sergey.Semin 2020-03-23 21:39 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Andy Shevchenko 6 siblings, 0 replies; 31+ messages in thread From: Sergey.Semin @ 2020-03-23 19:54 UTC (permalink / raw) Cc: Serge Semin, Serge Semin, Linus Walleij, Hoan Tran, Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Andy Shevchenko, linux-gpio, Mauro Carvalho Chehab, David S. Miller, Rob Herring, Greg Kroah-Hartman, Jonathan Cameron, linux-kernel From: Serge Semin <Sergey.Semin@baikalelectronics.ru> Add myself as a co-maintainer of the Synopsis DesignWare APB GPIO driver. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Hoan Tran <hoan@os.amperecomputing.com> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-gpio@vger.kernel.org --- Changelog v3: - Replace S: with M: section entry. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6158a143a13e..de46d94d70f7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16084,6 +16084,7 @@ F: drivers/tty/serial/8250/8250_dw.c SYNOPSYS DESIGNWARE APB GPIO DRIVER M: Hoan Tran <hoan@os.amperecomputing.com> +M: Serge Semin <fancer.lancer@gmail.com> L: linux-gpio@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt -- 2.25.1 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin ` (5 preceding siblings ...) 2020-03-23 19:54 ` [PATCH v3 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin @ 2020-03-23 21:39 ` Andy Shevchenko 6 siblings, 0 replies; 31+ messages in thread From: Andy Shevchenko @ 2020-03-23 21:39 UTC (permalink / raw) To: Sergey.Semin Cc: Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, Andy Shevchenko, open list:GPIO SUBSYSTEM, devicetree, Linux Kernel Mailing List On Mon, Mar 23, 2020 at 9:55 PM <Sergey.Semin@baikalelectronics.ru> wrote: > > From: Serge Semin <fancer.lancer@gmail.com> > > There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers > supported by the kernel DW APB GPIO driver. It works for them just fine with > no modifications. But still there is a room for optimizations there. > > First of all as it tends to be traditional for all Baikal-T1 SoC related > patchset we replaced the legacy plain text-based dt-binding file with > yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, > but in order to use it the corresponding reference clock must be enabled. > We added support of that clock in the driver and made sure the dt-bindings > had its declaration. In addition seeing both APB and debounce reference > clocks are optional, we replaced the standard devm_clk_get() usage with > the function of optional clocks acquisition. > > This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: > commit 98d54f81e36b ("Linux 5.6-rc4"). Thank you! FWIW, Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > > Changelog v2: > - Use a shorter summary describing the DT bindings conversion patch. > - Add myself to the MAINTAINERS file as a maintainer of the DW APB GPIO driver. > - Add myself to the maintainers list of the DW APB GPIO driver DT schema. > - Print error instead of info-message if APB/debounce clocks either > failed to be acquired or couldn't be enabled. > - Rearrange the SoB tags. > - Make sure DT schema defines the lowercase hex numbers in the main dt-node > name and in the sub-node names. > - Use "allOf:" statement to apply uint32 and "minimum/maximum" limitations > on the "snps,nr-gpios" property of the DW APB GPIO DT schema. > - Discard "interrupts-extended" property from the DT schema. > - Make sure the sub-nodes have names with either 'gpio-port' or > 'gpio-controller' prefixes. > - Our corporate email server doesn't change Message-Id anymore, so the patchset > is resubmitted being in the cover-letter-threaded format. > > Changelog v3: > - Replace S: with M: section entry in the MAINTAINERS file. > - Cc Andy to all patches he isn't added by the auto "cc-cmd" command. > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> > Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> > Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> > Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> > Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Hoan Tran <hoan@os.amperecomputing.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, > Cc: linux-gpio@vger.kernel.org > Cc: devicetree@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > > Serge Semin (6): > dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema > dt-bindings: gpio: Add DW GPIO debounce clock property > dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers > gpio: dwapb: Use optional-clocks interface for APB ref-clock > gpio: dwapb: Add debounce reference clock support > MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver > > .../bindings/gpio/snps,dw-apb-gpio.yaml | 134 ++++++++++++++++++ > .../bindings/gpio/snps-dwapb-gpio.txt | 65 --------- > MAINTAINERS | 1 + > drivers/gpio/gpio-dwapb.c | 41 ++++-- > 4 files changed, 161 insertions(+), 80 deletions(-) > create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml > delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > > -- > 2.25.1 > -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 0/4] gpio: dwapb: Fix reference clocks usage 2020-03-06 13:24 [PATCH 0/4] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-12 13:58 ` Linus Walleij 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin @ 2020-04-15 21:27 ` Linus Walleij 2020-04-16 5:09 ` Sergey Semin 2 siblings, 1 reply; 31+ messages in thread From: Linus Walleij @ 2020-04-15 21:27 UTC (permalink / raw) To: Sergey.Semin Cc: Serge Semin, Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, open list:GPIO SUBSYSTEM, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linux-kernel I have applied the v3 version of the patch set after some tinkering with the b4 tool. For some reason some patches are missing in my inbox and also on som mailing lists, they are not in my spamfolder even. Anyways with some help from Konstantin I managed to get the series out using the b4 tool and applied it. Thanks! Linus Walleij ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH 0/4] gpio: dwapb: Fix reference clocks usage 2020-04-15 21:27 ` [PATCH 0/4] " Linus Walleij @ 2020-04-16 5:09 ` Sergey Semin 0 siblings, 0 replies; 31+ messages in thread From: Sergey Semin @ 2020-04-16 5:09 UTC (permalink / raw) To: Linus Walleij Cc: Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, open list:GPIO SUBSYSTEM, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linux-kernel On Wed, Apr 15, 2020 at 11:27:49PM +0200, Linus Walleij wrote: > I have applied the v3 version of the patch set after some tinkering > with the b4 tool. > > For some reason some patches are missing in my inbox and also > on som mailing lists, they are not in my spamfolder even. > > Anyways with some help from Konstantin I managed to get the > series out using the b4 tool and applied it. Thanks Linus. Regarding missing the messages in your inbox. It's weird. I double checked. All messages were sent to your email. Regarding missing them in the devicetree mailing list. It's my mistake. Forgot to add it to Cc'es. Next time I'll keep in mind that this is necessary. Regards, -Sergey > > Thanks! > Linus Walleij ^ permalink raw reply [flat|nested] 31+ messages in thread
[parent not found: <20200306132448.13917-1-Sergey.Semin@baikalelectronics.ru>]
* Re: [PATCH 0/4] gpio: dwapb: Fix reference clocks usage [not found] <20200306132448.13917-1-Sergey.Semin@baikalelectronics.ru> @ 2020-03-10 0:23 ` Sergey Semin 0 siblings, 0 replies; 31+ messages in thread From: Sergey Semin @ 2020-03-10 0:23 UTC (permalink / raw) To: Alexey Malahov, Maxim Kaurkin, Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko, Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle, Hoan Tran, Linus Walleij, Bartosz Golaszewski, Philipp Zabel, Rob Herring, Mark Rutland, linux-gpio, devicetree, linux-kernel On Fri, Mar 06, 2020 at 04:24:44PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > From: Serge Semin <fancer.lancer@gmail.com> > > There is no need in any fixes to have the Baikal-T1 SoC DW GPIO controllers > supported by the kernel DW APB GPIO driver. It works for them just fine with > no modifications. But still there is a room for optimizations there. > > First of all as it tends to be traditional for all Baikal-T1 SoC related > patchset we replaced the legacy plain text-based dt-binding file with > yaml-based one. Baikal-T1 DW GPIO port A supports a debounce functionality, > but in order to use it the corresponding reference clock must be enabled. > We added support of that clock in the driver and made sure the dt-bindings > had its declaration. In addition seeing both APB and debounce reference > clocks are optional, we replaced the standard devm_clk_get() usage with > the function of optional clocks acquisition. > > This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: > commit 98d54f81e36b ("Linux 5.6-rc4"). > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> > Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> > Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru> > Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru> > Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Hoan Tran <hoan@os.amperecomputing.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: linux-gpio@vger.kernel.org > Cc: devicetree@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > > Serge Semin (4): > dt-bindings: gpio: Replace DW APB GPIO legacy bindings with YAML-based > one > dt-bindings: gpio: Add DW GPIO debounce clocks bindings > gpio: dwapb: Use optional-clocks interface for APB ref-clocks > gpio: dwapb: Add debounce reference clock support > > .../bindings/gpio/snps,dw-apb-gpio.yaml | 140 ++++++++++++++++++ > .../bindings/gpio/snps-dwapb-gpio.txt | 65 -------- > drivers/gpio/gpio-dwapb.c | 41 +++-- > 3 files changed, 166 insertions(+), 80 deletions(-) > create mode 100644 Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml > delete mode 100644 Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > > -- > 2.25.1 > Folks, It appears our corporate email server changes the Message-Id field of messages passing through it. Due to that the emails threading gets to be broken. I'll resubmit the properly structured patchset as soon as our system administrator fixes the problem. Sorry for the inconvenience caused by it. Regards, -Sergey ^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2020-04-16 5:09 UTC | newest] Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-03-06 13:24 [PATCH 0/4] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-12 13:58 ` Linus Walleij 2020-03-13 15:29 ` Sergey Semin 2020-03-23 18:06 ` [PATCH v2 0/6] " Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin 2020-03-23 18:06 ` [PATCH v2 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin 2020-03-23 18:36 ` Andy Shevchenko 2020-03-23 18:06 ` [PATCH v2 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin 2020-03-23 18:38 ` Andy Shevchenko 2020-03-23 19:25 ` Sergey Semin 2020-03-23 21:37 ` Andy Shevchenko 2020-03-23 18:06 ` [PATCH v2 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin 2020-03-23 18:34 ` Andy Shevchenko 2020-03-23 19:18 ` Sergey Semin 2020-03-23 18:36 ` Joe Perches 2020-03-23 19:16 ` Sergey Semin 2020-03-23 19:53 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 1/6] dt-bindings: gpio: Convert snps,dw-apb-gpio to DT schema Sergey.Semin 2020-03-31 19:24 ` Rob Herring 2020-03-23 19:53 ` [PATCH v3 2/6] dt-bindings: gpio: Add DW GPIO debounce clock property Sergey.Semin 2020-03-23 19:53 ` [PATCH v3 3/6] dt-bindings: gpio: Add Sergey Semin to DW APB GPIO driver maintainers Sergey.Semin 2020-03-31 19:25 ` Rob Herring 2020-03-23 19:53 ` [PATCH v3 4/6] gpio: dwapb: Use optional-clocks interface for APB ref-clock Sergey.Semin 2020-03-23 19:54 ` [PATCH v3 5/6] gpio: dwapb: Add debounce reference clock support Sergey.Semin 2020-03-23 19:54 ` [PATCH v3 6/6] MAINTAINERS: Add Segey Semin to maintainers of DW APB GPIO driver Sergey.Semin 2020-03-23 21:39 ` [PATCH v3 0/6] gpio: dwapb: Fix reference clocks usage Andy Shevchenko 2020-04-15 21:27 ` [PATCH 0/4] " Linus Walleij 2020-04-16 5:09 ` Sergey Semin [not found] <20200306132448.13917-1-Sergey.Semin@baikalelectronics.ru> 2020-03-10 0:23 ` Sergey Semin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).