Skip to content

Commit 8c7a860

Browse files
author
Bartosz Golaszewski
committed
Merge tag 'ib-mfd-gpio-power-soc-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next
Immutable branch between MFD, GPIO, Power and SoC due for the v6.17 merge window
2 parents cc2f156 + 819687e commit 8c7a860

15 files changed

Lines changed: 1555 additions & 2 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/apple,smc-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple Mac System Management Controller GPIO
8+
9+
maintainers:
10+
- Sven Peter <sven@kernel.org>
11+
12+
description:
13+
Apple Mac System Management Controller GPIO block.
14+
15+
properties:
16+
compatible:
17+
const: apple,smc-gpio
18+
19+
gpio-controller: true
20+
21+
'#gpio-cells':
22+
const: 2
23+
24+
required:
25+
- compatible
26+
- gpio-controller
27+
- '#gpio-cells'
28+
29+
additionalProperties: false
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/apple,smc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple Mac System Management Controller
8+
9+
maintainers:
10+
- Sven Peter <sven@kernel.org>
11+
12+
description:
13+
Apple Mac System Management Controller implements various functions
14+
such as GPIO, RTC, power, reboot.
15+
16+
properties:
17+
compatible:
18+
items:
19+
- enum:
20+
- apple,t6000-smc
21+
- apple,t8103-smc
22+
- apple,t8112-smc
23+
- const: apple,smc
24+
25+
reg:
26+
items:
27+
- description: SMC area
28+
- description: SRAM area
29+
30+
reg-names:
31+
items:
32+
- const: smc
33+
- const: sram
34+
35+
mboxes:
36+
maxItems: 1
37+
38+
gpio:
39+
$ref: /schemas/gpio/apple,smc-gpio.yaml
40+
41+
reboot:
42+
$ref: /schemas/power/reset/apple,smc-reboot.yaml
43+
44+
additionalProperties: false
45+
46+
required:
47+
- compatible
48+
- reg
49+
- reg-names
50+
- mboxes
51+
52+
examples:
53+
- |
54+
soc {
55+
#address-cells = <2>;
56+
#size-cells = <2>;
57+
58+
smc@23e400000 {
59+
compatible = "apple,t8103-smc", "apple,smc";
60+
reg = <0x2 0x3e400000 0x0 0x4000>,
61+
<0x2 0x3fe00000 0x0 0x100000>;
62+
reg-names = "smc", "sram";
63+
mboxes = <&smc_mbox>;
64+
65+
smc_gpio: gpio {
66+
compatible = "apple,smc-gpio";
67+
gpio-controller;
68+
#gpio-cells = <2>;
69+
};
70+
71+
reboot {
72+
compatible = "apple,smc-reboot";
73+
nvmem-cells = <&shutdown_flag>, <&boot_stage>,
74+
<&boot_error_count>, <&panic_count>;
75+
nvmem-cell-names = "shutdown_flag", "boot_stage",
76+
"boot_error_count", "panic_count";
77+
};
78+
};
79+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/reset/apple,smc-reboot.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple SMC Reboot Controller
8+
9+
description:
10+
The Apple System Management Controller (SMC) provides reboot functionality
11+
on Apple Silicon SoCs. It uses NVMEM cells to store and track various
12+
system state information related to boot, shutdown, and panic events.
13+
14+
maintainers:
15+
- Sven Peter <sven@kernel.org>
16+
17+
properties:
18+
compatible:
19+
const: apple,smc-reboot
20+
21+
nvmem-cells:
22+
items:
23+
- description: Flag indicating shutdown (as opposed to reboot)
24+
- description: Stage at which the boot process stopped (0x30 for normal boot)
25+
- description: Counter for boot errors
26+
- description: Counter for system panics
27+
28+
nvmem-cell-names:
29+
items:
30+
- const: shutdown_flag
31+
- const: boot_stage
32+
- const: boot_error_count
33+
- const: panic_count
34+
35+
required:
36+
- compatible
37+
- nvmem-cells
38+
- nvmem-cell-names
39+
40+
additionalProperties: false

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,20 +2332,23 @@ F: Documentation/devicetree/bindings/arm/apple/*
23322332
F: Documentation/devicetree/bindings/clock/apple,nco.yaml
23332333
F: Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml
23342334
F: Documentation/devicetree/bindings/dma/apple,admac.yaml
2335+
F: Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml
23352336
F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml
23362337
F: Documentation/devicetree/bindings/input/touchscreen/apple,z2-multitouch.yaml
23372338
F: Documentation/devicetree/bindings/interrupt-controller/apple,*
23382339
F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
23392340
F: Documentation/devicetree/bindings/iommu/apple,sart.yaml
23402341
F: Documentation/devicetree/bindings/leds/backlight/apple,dwi-bl.yaml
23412342
F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
2343+
F: Documentation/devicetree/bindings/mfd/apple,smc.yaml
23422344
F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml
23432345
F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
23442346
F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml
23452347
F: Documentation/devicetree/bindings/nvmem/apple,spmi-nvmem.yaml
23462348
F: Documentation/devicetree/bindings/pci/apple,pcie.yaml
23472349
F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
23482350
F: Documentation/devicetree/bindings/power/apple*
2351+
F: Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml
23492352
F: Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml
23502353
F: Documentation/devicetree/bindings/spi/apple,spi.yaml
23512354
F: Documentation/devicetree/bindings/spmi/apple,spmi.yaml
@@ -2355,17 +2358,20 @@ F: drivers/bluetooth/hci_bcm4377.c
23552358
F: drivers/clk/clk-apple-nco.c
23562359
F: drivers/cpufreq/apple-soc-cpufreq.c
23572360
F: drivers/dma/apple-admac.c
2361+
F: drivers/gpio/gpio-macsmc.c
23582362
F: drivers/pmdomain/apple/
23592363
F: drivers/i2c/busses/i2c-pasemi-core.c
23602364
F: drivers/i2c/busses/i2c-pasemi-platform.c
23612365
F: drivers/input/touchscreen/apple_z2.c
23622366
F: drivers/iommu/apple-dart.c
23632367
F: drivers/iommu/io-pgtable-dart.c
23642368
F: drivers/irqchip/irq-apple-aic.c
2369+
F: drivers/mfd/macsmc.c
23652370
F: drivers/nvme/host/apple.c
23662371
F: drivers/nvmem/apple-efuses.c
23672372
F: drivers/nvmem/apple-spmi-nvmem.c
23682373
F: drivers/pinctrl/pinctrl-apple-gpio.c
2374+
F: drivers/power/reset/macsmc-reboot.c
23692375
F: drivers/pwm/pwm-apple.c
23702376
F: drivers/soc/apple/*
23712377
F: drivers/spi/spi-apple.c
@@ -2374,6 +2380,7 @@ F: drivers/video/backlight/apple_dwi_bl.c
23742380
F: drivers/watchdog/apple_wdt.c
23752381
F: include/dt-bindings/interrupt-controller/apple-aic.h
23762382
F: include/dt-bindings/pinctrl/apple.h
2383+
F: include/linux/mfd/macsmc.h
23772384
F: include/linux/soc/apple/*
23782385
F: include/uapi/drm/asahi_drm.h
23792386

drivers/gpio/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,16 @@ config GPIO_LP87565
14731473
This driver can also be built as a module. If so, the module will be
14741474
called gpio-lp87565.
14751475

1476+
config GPIO_MACSMC
1477+
tristate "Apple Mac SMC GPIO"
1478+
depends on MFD_MACSMC
1479+
help
1480+
Support for GPIOs controlled by the SMC microcontroller on Apple Mac
1481+
systems.
1482+
1483+
This driver can also be built as a module. If so, the module will be
1484+
called gpio-macsmc.
1485+
14761486
config GPIO_MADERA
14771487
tristate "Cirrus Logic Madera class codecs"
14781488
depends on PINCTRL_MADERA

drivers/gpio/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ obj-$(CONFIG_GPIO_LP873X) += gpio-lp873x.o
9999
obj-$(CONFIG_GPIO_LP87565) += gpio-lp87565.o
100100
obj-$(CONFIG_GPIO_LPC18XX) += gpio-lpc18xx.o
101101
obj-$(CONFIG_GPIO_LPC32XX) += gpio-lpc32xx.o
102+
obj-$(CONFIG_GPIO_MACSMC) += gpio-macsmc.o
102103
obj-$(CONFIG_GPIO_MADERA) += gpio-madera.o
103104
obj-$(CONFIG_GPIO_MAX3191X) += gpio-max3191x.o
104105
obj-$(CONFIG_GPIO_MAX7300) += gpio-max7300.o

0 commit comments

Comments
 (0)