Lines Matching +full:mipi +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0
3 * Meson G12A MIPI DSI Analog PHY
12 #include <linux/phy/phy.h>
18 #include <dt-bindings/phy/phy.h>
40 struct phy *phy; member
45 static int phy_g12a_mipi_dphy_analog_configure(struct phy *phy, in phy_g12a_mipi_dphy_analog_configure() argument
48 struct phy_g12a_mipi_dphy_analog_priv *priv = phy_get_drvdata(phy); in phy_g12a_mipi_dphy_analog_configure()
51 ret = phy_mipi_dphy_config_validate(&opts->mipi_dphy); in phy_g12a_mipi_dphy_analog_configure()
55 memcpy(&priv->config, opts, sizeof(priv->config)); in phy_g12a_mipi_dphy_analog_configure()
60 static int phy_g12a_mipi_dphy_analog_power_on(struct phy *phy) in phy_g12a_mipi_dphy_analog_power_on() argument
62 struct phy_g12a_mipi_dphy_analog_priv *priv = phy_get_drvdata(phy); in phy_g12a_mipi_dphy_analog_power_on()
65 regmap_write(priv->regmap, HHI_MIPI_CNTL0, in phy_g12a_mipi_dphy_analog_power_on()
69 regmap_write(priv->regmap, HHI_MIPI_CNTL1, in phy_g12a_mipi_dphy_analog_power_on()
73 regmap_write(priv->regmap, HHI_MIPI_CNTL2, in phy_g12a_mipi_dphy_analog_power_on()
78 switch (priv->config.lanes) { in phy_g12a_mipi_dphy_analog_power_on()
95 regmap_update_bits(priv->regmap, HHI_MIPI_CNTL2, in phy_g12a_mipi_dphy_analog_power_on()
102 static int phy_g12a_mipi_dphy_analog_power_off(struct phy *phy) in phy_g12a_mipi_dphy_analog_power_off() argument
104 struct phy_g12a_mipi_dphy_analog_priv *priv = phy_get_drvdata(phy); in phy_g12a_mipi_dphy_analog_power_off()
106 regmap_write(priv->regmap, HHI_MIPI_CNTL0, 0); in phy_g12a_mipi_dphy_analog_power_off()
107 regmap_write(priv->regmap, HHI_MIPI_CNTL1, 0); in phy_g12a_mipi_dphy_analog_power_off()
108 regmap_write(priv->regmap, HHI_MIPI_CNTL2, 0); in phy_g12a_mipi_dphy_analog_power_off()
122 struct phy_provider *phy; in phy_g12a_mipi_dphy_analog_probe() local
123 struct device *dev = &pdev->dev; in phy_g12a_mipi_dphy_analog_probe()
125 struct device_node *np = dev->of_node, *parent_np; in phy_g12a_mipi_dphy_analog_probe()
130 return -ENOMEM; in phy_g12a_mipi_dphy_analog_probe()
139 priv->regmap = map; in phy_g12a_mipi_dphy_analog_probe()
141 priv->phy = devm_phy_create(dev, np, &phy_g12a_mipi_dphy_analog_ops); in phy_g12a_mipi_dphy_analog_probe()
142 if (IS_ERR(priv->phy)) in phy_g12a_mipi_dphy_analog_probe()
143 return dev_err_probe(dev, PTR_ERR(priv->phy), "failed to create PHY\n"); in phy_g12a_mipi_dphy_analog_probe()
145 phy_set_drvdata(priv->phy, priv); in phy_g12a_mipi_dphy_analog_probe()
148 phy = devm_of_phy_provider_register(dev, of_phy_simple_xlate); in phy_g12a_mipi_dphy_analog_probe()
150 return PTR_ERR_OR_ZERO(phy); in phy_g12a_mipi_dphy_analog_probe()
155 .compatible = "amlogic,g12a-mipi-dphy-analog",
164 .name = "phy-meson-g12a-mipi-dphy-analog",
171 MODULE_DESCRIPTION("Meson G12A MIPI Analog D-PHY driver");