Skip to content

Commit 57ab3ff

Browse files
committed
phy: apple: atc: Support DisplayPort only operation
atc3 on is used to drive the HDMI port on 14/16 inch Macbook Pros with M1/M2 Pro/Max via a DP2HMDMI converter. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent eebfc30 commit 57ab3ff

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

drivers/phy/apple/atc.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,19 +2399,35 @@ static int atcphy_probe(struct platform_device *pdev)
23992399
if (ret)
24002400
return ret;
24012401

2402+
atcphy->dp_only = of_property_read_bool(dev->of_node, "apple,mode-fixed-dp");
2403+
24022404
atcphy->mode = APPLE_ATCPHY_MODE_OFF;
24032405
atcphy->pipehandler_state = ATCPHY_PIPEHANDLER_STATE_INVALID;
24042406

2405-
ret = atcphy_probe_rcdev(atcphy);
2406-
if (ret)
2407-
return ret;
2408-
ret = atcphy_probe_mux(atcphy);
2409-
if (ret)
2410-
return ret;
2411-
ret = atcphy_probe_switch(atcphy);
2407+
if (!atcphy->dp_only) {
2408+
ret = atcphy_probe_rcdev(atcphy);
2409+
if (ret)
2410+
return ret;
2411+
ret = atcphy_probe_mux(atcphy);
2412+
if (ret)
2413+
return ret;
2414+
ret = atcphy_probe_switch(atcphy);
2415+
if (ret)
2416+
return ret;
2417+
}
2418+
2419+
ret = atcphy_probe_phy(atcphy);
24122420
if (ret)
24132421
return ret;
2414-
return atcphy_probe_phy(atcphy);
2422+
2423+
if (atcphy->dp_only) {
2424+
atcphy->target_mode = APPLE_ATCPHY_MODE_DP;
2425+
WARN_ON(!schedule_work(&atcphy->mux_set_work));
2426+
wait_for_completion_timeout(&atcphy->atcphy_online_event,
2427+
msecs_to_jiffies(1000));
2428+
}
2429+
2430+
return 0;
24152431
}
24162432

24172433
static const struct of_device_id atcphy_match[] = {

drivers/phy/apple/atc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ struct apple_atcphy {
134134

135135
struct work_struct mux_set_work;
136136
enum atcphy_mode target_mode;
137+
bool dp_only;
137138
};
138139

139140
#endif

0 commit comments

Comments
 (0)