Skip to content

Commit 4931e8e

Browse files
jannaumarcan
authored andcommitted
fixup! phy: apple: Add DP TX phy driver
Signed-off-by: Janne Grunau <[email protected]>
1 parent 8a3bd9a commit 4931e8e

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

drivers/phy/apple/dptx.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ static int dptx_phy_activate(struct apple_dptx_phy *phy, u32 dcp_index)
315315
return 0;
316316
}
317317

318+
static int dptx_phy_deactivate(struct apple_dptx_phy *phy)
319+
{
320+
return 0;
321+
}
322+
318323
int dptx_phy_set_link_rate(struct apple_dptx_phy *phy, u32 link_rate)
319324
{
320325
u32 sts_1008, sts_1014, val_100c, val_20b0, val_20b4;
@@ -517,17 +522,30 @@ static int dptx_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode)
517522
{
518523
struct apple_dptx_phy *dptx_phy = phy_get_drvdata(phy);
519524

520-
if (mode != PHY_MODE_DP || submode < 0 || submode > 5)
521-
return -EINVAL;
525+
switch (mode) {
526+
case PHY_MODE_INVALID:
527+
return dptx_phy_deactivate(dptx_phy);
528+
case PHY_MODE_DP:
529+
if (submode < 0 || submode > 5)
530+
return -EINVAL;
531+
return dptx_phy_activate(dptx_phy, submode);
532+
default:
533+
break;
534+
}
522535

523-
return dptx_phy_activate(dptx_phy, submode);
536+
return -EINVAL;
524537
}
525538

526539
static int dptx_phy_validate(struct phy *phy, enum phy_mode mode, int submode,
527540
union phy_configure_opts *opts_)
528541
{
529542
struct phy_configure_opts_dp *opts = &opts_->dp;
530543

544+
if (mode == PHY_MODE_INVALID) {
545+
memset(opts, 0, sizeof(*opts));
546+
return 0;
547+
}
548+
531549
if (mode != PHY_MODE_DP)
532550
return -EINVAL;
533551
if (submode < 0 || submode > 5)

0 commit comments

Comments
 (0)