Add Apple macsmc GPIO support
Subsystems (3)
v2 cover Add Apple macsmc GPIO support
Hi,
This series adds support for the Apple Mac SMC GPIO driver that was previously posted before the last merge window. I believe all previous review points have been addressed.
This series is smaller than the previous posting because I'm splitting this up to allow progress to be made; this driver is dependent on the Apple SMC driver in order to be buildable and usable. It is expected that this Apple SMC driver will be merged via Lee's MFD tree. The Kconfig dependencies this driver from causing build issues until that driver is also merged, so I believe it is appropriate to send this separately.
There is no issue if we wish to delay applying this until the core driver has been accepted by Lee.
The series is made up of two patches - one patch for the bindings, which now include two compatibles, one specific and one generic. The second patch adds the actual driver itself.
v2: updated bindings document
.../devicetree/bindings/gpio/gpio-macsmc.yaml | 41 ++++ drivers/gpio/Kconfig | 11 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-macsmc.c | 245 +++++++++++++++++++++ 4 files changed, 298 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml create mode 100644 drivers/gpio/gpio-macsmc.c
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
PATCH v2 1/2 dt-bindings: gpio: add binding for the GPIO block for Apple Mac SMC
Add the DT binding for the Apple Mac System Management Controller GPIOs.
--- .../devicetree/bindings/gpio/gpio-macsmc.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml
Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml new file +41 -0
@@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-macsmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple Mac System Management Controller GPIO + +maintainers: + - Hector Martin <[email protected]> + +description: + This describes the binding for the Apple Mac System Management Controller + GPIO block. + +properties: + compatible: + items: + - enum: + - apple,t8103-smc-gpio + - const: apple,smc-gpio + + gpio-controller: true + + '#gpio-cells': + const: 2 + +required: + - compatible + - gpio-controller + - '#gpio-cells' + +additionalProperties: false + +examples: + - | + gpio { + compatible = "apple,t8103-smc-gpio", "apple,smc-gpio"; + gpio-controller; + #gpio-cells = <2>; + };
Signature · 1 line
2.30.2
Re: [PATCH v2 1/2] dt-bindings: gpio: add binding for the GPIO block for Apple Mac SMC
Quoted 5 lines · Russell King (Oracle)
Add the DT binding for the Apple Mac System Management Controller GPIOs.
Signed-off-by Russell King (Oracle) <[email protected]>--- .../devicetree/bindings/gpio/gpio-macsmc.yaml | 41 +++++++++++++++++++
Sorry, just realised I hadn't renamed this file. I'll do that for v3. Please review assuming I've made that change.
Quoted 54 lines
1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-macsmc.yamlDocumentation/devicetree/bindings/gpio/gpio-macsmc.yaml new file +41
-0@@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-macsmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple Mac System Management Controller GPIO + +maintainers: + - Hector Martin <[email protected]> + +description: + This describes the binding for the Apple Mac System Management Controller + GPIO block. + +properties: + compatible: + items: + - enum: + - apple,t8103-smc-gpio + - const: apple,smc-gpio + + gpio-controller: true + + '#gpio-cells': + const: 2 + +required: + - compatible + - gpio-controller + - '#gpio-cells' + +additionalProperties: false + +examples: + - | + gpio { + compatible = "apple,t8103-smc-gpio", "apple,smc-gpio"; + gpio-controller; + #gpio-cells = <2>; + };Signature · 1 line
2.30.2
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH v2 1/2] dt-bindings: gpio: add binding for the GPIO block for Apple Mac SMC
Quoted 9 lines · Russell King (Oracle)
Quoted 5 lines · Russell King (Oracle)
Add the DT binding for the Apple Mac System Management Controller GPIOs.
Signed-off-by Russell King (Oracle) <[email protected]>--- .../devicetree/bindings/gpio/gpio-macsmc.yaml | 41 +++++++++++++++++++Sorry, just realised I hadn't renamed this file. I'll do that for v3. Please review assuming I've made that change.
v3 is needed anyway for the tooling/automated checks.
Quoted 15 lines
Quoted 15 lines
1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-macsmc.yamlDocumentation/devicetree/bindings/gpio/gpio-macsmc.yaml new file +5
-0@@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-macsmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml#
Quoted 8 lines
Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml line 13
Quoted 8 lines
Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml new file +8
-0+ +title: Apple Mac System Management Controller GPIO + +maintainers: + - Hector Martin <[email protected]> + +description: + This describes the binding for the Apple Mac System Management Controller
Missing change. Drop "This describes the binding for". This is a description of hardware.
Rest looks good.
Quoted 1 line
Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml line 14
Quoted 1 line
Documentation/devicetree/bindings/gpio/gpio-macsmc.yaml new file +1
-0+ GPIO block.
Best regards,
Krzysztof
PATCH v2 2/2 gpio: Add new gpio-macsmc driver for Apple Macs
In reply to Russell King (Oracle)From: Hector Martin <[email protected]>
This driver implements the GPIO service on top of the SMC framework on Apple Mac machines. In particular, these are the GPIOs present in the PMU IC which are used to control power to certain on-board devices.
Although the underlying hardware supports various pin config settings (input/output, open drain, etc.), this driver does not implement that functionality and leaves it up to the firmware to configure things properly. We also don't yet support interrupts/events. This is sufficient for device power control, which is the only thing we need to support at this point. More features will be implemented when needed.
To our knowledge, only Apple Silicon Macs implement this SMC feature.
--- drivers/gpio/Kconfig | 11 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-macsmc.c | 245 +++++++++++++++++++++++++++++++++++++ 3 files changed, 257 insertions(+) create mode 100644 drivers/gpio/gpio-macsmc.c
drivers/gpio/Kconfig +11 -0
@@ -1292,6 +1292,17 @@ config GPIO_LP87565 This driver can also be built as a module. If so, the module will be called gpio-lp87565. +config GPIO_MACSMC + tristate "Apple Mac SMC GPIO" + depends on APPLE_SMC + default ARCH_APPLE + help + Support for GPIOs controlled by the SMC microcontroller on Apple Mac + systems. + + This driver can also be built as a module. If so, the module will be + called gpio-macsmc. + config GPIO_MADERA tristate "Cirrus Logic Madera class codecs" depends on PINCTRL_MADERA
drivers/gpio/Makefile +1 -0
@@ -83,6 +83,7 @@ obj-$(CONFIG_GPIO_LP873X) += gpio-lp873x.o obj-$(CONFIG_GPIO_LP87565) += gpio-lp87565.o obj-$(CONFIG_GPIO_LPC18XX) += gpio-lpc18xx.o obj-$(CONFIG_GPIO_LPC32XX) += gpio-lpc32xx.o +obj-$(CONFIG_GPIO_MACSMC) += gpio-macsmc.o obj-$(CONFIG_GPIO_MADERA) += gpio-madera.o obj-$(CONFIG_GPIO_MAX3191X) += gpio-max3191x.o obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o
drivers/gpio/gpio-macsmc.c new file +245 -0
245 lines not on this page · raw message
Signature · 1 line
2.30.2