Skip to content

Commit 605b903

Browse files
granquetvinodkoul
authored andcommitted
phy: phy-mtk-hdmi: Add generic phy configure callback
Some phys, such as mt8195, needs to have a configure callback defined. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> Link: https://lore.kernel.org/r/20220919-v8-2-a84c80468fe9@baylibre.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent c78fe54 commit 605b903

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/phy/mediatek/phy-mtk-hdmi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
static int mtk_hdmi_phy_power_on(struct phy *phy);
1010
static int mtk_hdmi_phy_power_off(struct phy *phy);
11+
static int mtk_hdmi_phy_configure(struct phy *phy, union phy_configure_opts *opts);
1112

1213
static const struct phy_ops mtk_hdmi_phy_dev_ops = {
1314
.power_on = mtk_hdmi_phy_power_on,
1415
.power_off = mtk_hdmi_phy_power_off,
16+
.configure = mtk_hdmi_phy_configure,
1517
.owner = THIS_MODULE,
1618
};
1719

@@ -43,6 +45,16 @@ static int mtk_hdmi_phy_power_off(struct phy *phy)
4345
return 0;
4446
}
4547

48+
static int mtk_hdmi_phy_configure(struct phy *phy, union phy_configure_opts *opts)
49+
{
50+
struct mtk_hdmi_phy *hdmi_phy = phy_get_drvdata(phy);
51+
52+
if (hdmi_phy->conf->hdmi_phy_configure)
53+
return hdmi_phy->conf->hdmi_phy_configure(phy, opts);
54+
55+
return 0;
56+
}
57+
4658
static const struct phy_ops *
4759
mtk_hdmi_phy_dev_get_ops(const struct mtk_hdmi_phy *hdmi_phy)
4860
{

drivers/phy/mediatek/phy-mtk-hdmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct mtk_hdmi_phy_conf {
2424
const struct clk_ops *hdmi_phy_clk_ops;
2525
void (*hdmi_phy_enable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
2626
void (*hdmi_phy_disable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
27+
int (*hdmi_phy_configure)(struct phy *phy, union phy_configure_opts *opts);
2728
};
2829

2930
struct mtk_hdmi_phy {

0 commit comments

Comments
 (0)