Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,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 driver is not on this branch. 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 {
Expand Down Expand Up @@ -205,17 +205,16 @@
};
};

&i2c2 {
status = "disabled";
};
/* The headphone jack's CS42L84 on i2c2 */
#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>;
};

/*
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j873s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
#include "t6050-peripherals.dtsi"
#include "t6050-media.dtsi"

/* The headphone jack's CS42L84 on i2c2 (its pinctrl_ap reserves no ranges) */
#include "t6050-jack.dtsi"

/*
* Rear ports 1 and 2's USB4 routers with their PCIe and DP tunnels, and rear port 1 (ATC0, hpm0,
* the debug port) itself. The J873s ADT has acio0-2, acio-cpu0-2, dart-acio0-2 and apciec0-2
Expand Down
30 changes: 30 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-jack.dtsi
Original file line number Diff line number Diff line change
@@ -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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

&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";
};
};
6 changes: 6 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k116c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
#define T6050_TOUCHID_FIRMWARE "apple/mesacal-k116c.bin", "apple/msrk-k116c.bin"
#include "t6050-touchid.dtsi"

/*
* The headphone jack's CS42L84 on i2c2, as on the K114 boards; t6050-k114-k116.dtsi
* already exposes its pins 134 and 139.
*/
#include "t6050-jack.dtsi"

/* The USB-C ports ATC1 and ATC2, as on the other K boards */
#include "t6050-k114-k116-usb.dtsi"
#include "t6050-k114-usb.dtsi"
Expand Down
Loading