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 @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
19 changes: 2 additions & 17 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 6 additions & 6 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};

/*
Expand Down
12 changes: 2 additions & 10 deletions arch/arm64/boot/dts/apple/t6050-j775d.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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"
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";
};
};
13 changes: 6 additions & 7 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};

/*
Expand Down
18 changes: 0 additions & 18 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
18 changes: 0 additions & 18 deletions arch/arm64/boot/dts/apple/t6050-k116s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading