From 40e722f90897a8715d99cda8c130f39e9b57f617 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 19 Nov 2026 22:55:24 +1100 Subject: [PATCH] arm64: dts: apple: t6050: describe the headphone jack codec on every board The CS42L84 headphone codec was described only on J714s, J775d, K114c and K116s, each with its own copy of the same node. Every T6050 board's ADT has the codec at the same place: i2c2, address 0x4b, reset on AP pin 139 (active high) and interrupt on AP pin 134 (level low), and every model has a 3.5 mm jack. Move the node into a new shared t6050-jack.dtsi, which also enables i2c2, and include it from J714s, J775d and t6050-k114-k116.dtsi in place of the copies. Add it to J714c, J716c, J716s and J873s, and to K114s and K116c through t6050-k114-k116.dtsi. On the boards that limit pinctrl_ap's exposed pins (J714c, J716c, J716s, K114s, K116c) open pins 134 and 139. J714c, J716c and J716s no longer disable i2c2. The J714s, K114c and K116s DTBs are byte-identical. The J775d DTB only gains an explicit status = "okay" on i2c2, which was already enabled by default. J775c is left alone: its full board description is in review separately and already carries the codec. These boards have no sound card node yet, so the codec probes on its own; the jack reports a plug only through a macaudio card that links it. The original node was written by DjDeveloperr for the J714s, and copied by Jeff Queisser (J775d), Joshua Warren (K114c) and Jens Axboe (K116s). Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-j714c.dts | 15 +++++----- arch/arm64/boot/dts/apple/t6050-j714s.dts | 19 ++---------- arch/arm64/boot/dts/apple/t6050-j716c.dts | 10 +++---- arch/arm64/boot/dts/apple/t6050-j716s.dts | 12 ++++---- arch/arm64/boot/dts/apple/t6050-j775d.dts | 12 ++------ arch/arm64/boot/dts/apple/t6050-j873s.dts | 3 ++ arch/arm64/boot/dts/apple/t6050-jack.dtsi | 30 +++++++++++++++++++ .../arm64/boot/dts/apple/t6050-k114-k116.dtsi | 13 ++++---- arch/arm64/boot/dts/apple/t6050-k114c.dts | 18 ----------- arch/arm64/boot/dts/apple/t6050-k116s.dts | 18 ----------- 10 files changed, 61 insertions(+), 89 deletions(-) create mode 100644 arch/arm64/boot/dts/apple/t6050-jack.dtsi diff --git a/arch/arm64/boot/dts/apple/t6050-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts index cf1d62c690fcc..02e2bf0a3f1e8 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714c.dts @@ -142,8 +142,8 @@ * 0 left woofer 1, 1 right woofer 1, 2 left woofer 2, 3 right woofer 2, 4 left tweeter, * 5 right tweeter. * - * There is no sound card yet: the AOP audio driver is not on this branch, and the jack codec - * (i2c2) is not described. The amps stay in shutdown until a stream asks for them. + * There is no sound card yet: the AOP audio service is not enabled on this board. The jack + * codec is on i2c2 (t6050-jack.dtsi). The amps stay in shutdown until a stream asks for them. */ / { speaker_sdz: regulator-sn012776-sdz { @@ -194,17 +194,16 @@ }; }; -&i2c2 { - status = "disabled"; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" /* * Only the pins a node here names are exposed, as on the J716c: pin 112's register - * takes an SError when read. 80 is PCIe port 0's PERST#, 106 the amps' fault interrupt and - * 107 their shutdown line. + * takes an SError when read. 80 is PCIe port 0's PERST#, 106 the amps' fault interrupt, + * 107 their shutdown line, and 134 and 139 the jack codec's interrupt and reset. */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 25>, <108 113>; + gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 4>, <140 81>; }; /* This board's SMC fan and power keys are not yet checked */ diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 383ec08bedbe2..d33eeaa3eca02 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -833,23 +833,8 @@ }; }; -/* - * The CS42L84 headphone codec (ADT /arm-io/i2c2/audio-codec-output): its reset line - * is AP pin 139, driven high to run the codec, and its interrupt AP pin 134, level - * low. - */ -&i2c2 { - status = "okay"; - - jack_codec: codec@4b { - compatible = "cirrus,cs42l84"; - reg = <0x4b>; - reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_HIGH>; - interrupts-extended = <&pinctrl_ap 134 IRQ_TYPE_LEVEL_LOW>; - #sound-dai-cells = <0>; - sound-name-prefix = "Jack"; - }; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" / { sound { diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts index 8fdea5242027b..54d13696dd9ef 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -170,17 +170,17 @@ status = "disabled"; }; -&i2c2 { - status = "disabled"; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" /* * Pin 112's register (0x29c0001c0) takes an SError when read, so only the pins a node - * here names are exposed: 80 (PCIe port 0's PERST#, ADT pci-bridge0 function-perst). + * here names are exposed: 80 (PCIe port 0's PERST#, ADT pci-bridge0 function-perst), and + * 134 and 139 (the jack codec's interrupt and reset). * A reserved line cannot be requested, so a node that names a new pin opens it here too. */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 140>; + gpio-reserved-ranges = <0 80>, <81 53>, <135 4>, <140 81>; }; /* This board's SMC fan and power keys are not yet checked */ diff --git a/arch/arm64/boot/dts/apple/t6050-j716s.dts b/arch/arm64/boot/dts/apple/t6050-j716s.dts index 43747a4ce6be7..7743184703109 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716s.dts @@ -445,21 +445,21 @@ status = "okay"; }; -/* Audio is not brought up: six sn012776 on i2c1/i2c3 and a cs42l84 on i2c2 */ +/* The speakers are not brought up: six sn012776 on i2c1/i2c3 */ &i2c1 { status = "disabled"; }; -&i2c2 { - status = "disabled"; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" /* * Pin 112 takes an SError when read (as on the J716c), so only the pins a node - * here names are exposed: 80 (PCIe port 0's PERST#). + * here names are exposed: 80 (PCIe port 0's PERST#), and 134 and 139 (the jack + * codec's interrupt and reset). */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 140>; + gpio-reserved-ranges = <0 80>, <81 53>, <135 4>, <140 81>; }; /* diff --git a/arch/arm64/boot/dts/apple/t6050-j775d.dts b/arch/arm64/boot/dts/apple/t6050-j775d.dts index 68b4c324aca02..4adf6975666c2 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775d.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775d.dts @@ -256,16 +256,8 @@ }; }; -&i2c2 { - jack_codec: codec@4b { - compatible = "cirrus,cs42l84"; - reg = <0x4b>; - reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_HIGH>; - interrupts-extended = <&pinctrl_ap 134 IRQ_TYPE_LEVEL_LOW>; - #sound-dai-cells = <0>; - sound-name-prefix = "Jack"; - }; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" /* * The console is on the USB debug link, which drains only while a host reads diff --git a/arch/arm64/boot/dts/apple/t6050-j873s.dts b/arch/arm64/boot/dts/apple/t6050-j873s.dts index 0a7976e50230f..c00743e069860 100644 --- a/arch/arm64/boot/dts/apple/t6050-j873s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j873s.dts @@ -32,5 +32,8 @@ status = "disabled"; }; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" + #define T6050_J873S #include "t6050-peripherals.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-jack.dtsi b/arch/arm64/boot/dts/apple/t6050-jack.dtsi new file mode 100644 index 0000000000000..ae47ddb869348 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-jack.dtsi @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * The 3.5 mm headphone jack's CS42L84 codec, the same on every T6050 board + * that has one (from each board's ADT): on i2c2 at 0x4b, its reset line on + * AP pin 139, driven high to run the codec, and its interrupt on AP pin 134, + * level low. + * + * A board that includes this file also exposes pins 134 and 139 in its + * pinctrl_ap gpio-reserved-ranges. The jack only reports a plug and plays + * through a sound card (macaudio) whose jack link names &jack_codec; a board + * without one gets the codec alone. + * + * Copyright The Asahi Linux Contributors + */ + +#include +#include + +&i2c2 { + status = "okay"; + + jack_codec: codec@4b { + compatible = "cirrus,cs42l84"; + reg = <0x4b>; + reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_HIGH>; + interrupts-extended = <&pinctrl_ap 134 IRQ_TYPE_LEVEL_LOW>; + #sound-dai-cells = <0>; + sound-name-prefix = "Jack"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index f7cedd1a4c854..25261efa8ba76 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -131,18 +131,17 @@ status = "disabled"; }; -&i2c2 { - status = "disabled"; -}; +/* The headphone jack's CS42L84 on i2c2 (t6050-jack.dtsi) */ +#include "t6050-jack.dtsi" /* * As on J716c, where reading pin 112 takes an SError, only the pins a node - * here names are exposed, and none is yet. The N1 on PCIe port 0 needs its - * board's platform ID, which the static ADT does not carry, so the port and - * its PERST# pin stay unused for now. + * here names are exposed: 134 and 139, the jack codec's interrupt and reset. + * The N1 on PCIe port 0 needs its board's platform ID, which the static ADT + * does not carry, so the port and its PERST# pin stay unused for now. */ &pinctrl_ap { - gpio-reserved-ranges = <0 221>; + gpio-reserved-ranges = <0 134>, <135 4>, <140 81>; }; /* diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts index 13ea865ba58e1..47831878b2f0a 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -225,24 +225,6 @@ }; }; -/* - * The CS42L84 headphone codec (ADT /arm-io/i2c2/audio-codec-output): its reset line - * is AP pin 139, driven high to run the codec, and its interrupt AP pin 134, level - * low. - */ -&i2c2 { - status = "okay"; - - jack_codec: codec@4b { - compatible = "cirrus,cs42l84"; - reg = <0x4b>; - reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_HIGH>; - interrupts-extended = <&pinctrl_ap 134 IRQ_TYPE_LEVEL_LOW>; - #sound-dai-cells = <0>; - sound-name-prefix = "Jack"; - }; -}; - / { sound { compatible = "apple,j714-macaudio", "apple,macaudio"; diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index fe6468edc72c1..25817478cc724 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -712,24 +712,6 @@ }; }; -/* - * The CS42L84 headphone codec (ADT /arm-io/i2c2/audio-codec-output, reg 0x4b): reset on AP - * pin 139 (function-reset GPIO(0x8b, 0x1)), driven high to run; interrupt AP pin 134, level - * low. i2c2 is disabled by t6050-k114-k116.dtsi; re-enabled here. - */ -&i2c2 { - status = "okay"; - - jack_codec: codec@4b { - compatible = "cirrus,cs42l84"; - reg = <0x4b>; - reset-gpios = <&pinctrl_ap 139 GPIO_ACTIVE_HIGH>; - interrupts-extended = <&pinctrl_ap 134 IRQ_TYPE_LEVEL_LOW>; - #sound-dai-cells = <0>; - sound-name-prefix = "Jack"; - }; -}; - /* ADT admac-base-ns: 0x293800000, IRQ 637, 13 TX + 13 RX channels, dart-aop stream 8 */ &admac_base_ns { status = "okay";