Lines Matching +full:meson8b +full:- +full:hdmi +full:- +full:tx +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0+
3 * Meson8, Meson8b and Meson8m2 HDMI TX PHY.
14 #include <linux/phy/phy.h>
40 static int phy_meson8_hdmi_tx_init(struct phy *phy) in phy_meson8_hdmi_tx_init() argument
42 struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy); in phy_meson8_hdmi_tx_init()
44 return clk_prepare_enable(priv->tmds_clk); in phy_meson8_hdmi_tx_init()
47 static int phy_meson8_hdmi_tx_exit(struct phy *phy) in phy_meson8_hdmi_tx_exit() argument
49 struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy); in phy_meson8_hdmi_tx_exit()
51 clk_disable_unprepare(priv->tmds_clk); in phy_meson8_hdmi_tx_exit()
56 static int phy_meson8_hdmi_tx_power_on(struct phy *phy) in phy_meson8_hdmi_tx_power_on() argument
58 struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy); in phy_meson8_hdmi_tx_power_on()
62 if (clk_get_rate(priv->tmds_clk) >= 2970UL * 1000 * 1000) in phy_meson8_hdmi_tx_power_on()
67 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, in phy_meson8_hdmi_tx_power_on()
71 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, 0x0); in phy_meson8_hdmi_tx_power_on()
75 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, in phy_meson8_hdmi_tx_power_on()
80 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL1, in phy_meson8_hdmi_tx_power_on()
88 static int phy_meson8_hdmi_tx_power_off(struct phy *phy) in phy_meson8_hdmi_tx_power_off() argument
90 struct phy_meson8_hdmi_tx_priv *priv = phy_get_drvdata(phy); in phy_meson8_hdmi_tx_power_off()
92 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, in phy_meson8_hdmi_tx_power_off()
109 struct device_node *np = pdev->dev.of_node; in phy_meson8_hdmi_tx_probe()
113 struct phy *phy; in phy_meson8_hdmi_tx_probe() local
117 return -EINVAL; in phy_meson8_hdmi_tx_probe()
119 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in phy_meson8_hdmi_tx_probe()
121 return -ENOMEM; in phy_meson8_hdmi_tx_probe()
123 priv->hhi = syscon_node_to_regmap(np->parent); in phy_meson8_hdmi_tx_probe()
124 if (IS_ERR(priv->hhi)) in phy_meson8_hdmi_tx_probe()
125 return PTR_ERR(priv->hhi); in phy_meson8_hdmi_tx_probe()
127 priv->tmds_clk = devm_clk_get(&pdev->dev, NULL); in phy_meson8_hdmi_tx_probe()
128 if (IS_ERR(priv->tmds_clk)) in phy_meson8_hdmi_tx_probe()
129 return PTR_ERR(priv->tmds_clk); in phy_meson8_hdmi_tx_probe()
131 phy = devm_phy_create(&pdev->dev, np, &phy_meson8_hdmi_tx_ops); in phy_meson8_hdmi_tx_probe()
132 if (IS_ERR(phy)) in phy_meson8_hdmi_tx_probe()
133 return PTR_ERR(phy); in phy_meson8_hdmi_tx_probe()
135 phy_set_drvdata(phy, priv); in phy_meson8_hdmi_tx_probe()
137 phy_provider = devm_of_phy_provider_register(&pdev->dev, in phy_meson8_hdmi_tx_probe()
144 { .compatible = "amlogic,meson8-hdmi-tx-phy" },
152 .name = "phy-meson8-hdmi-tx",
159 MODULE_DESCRIPTION("Meson8, Meson8b and Meson8m2 HDMI TX PHY driver");