Lines Matching defs:phy

23 static void csiphy_routing_cfg_3630(struct isp_csiphy *phy,
30 regmap_read(phy->isp->syscon, phy->isp->syscon_offset, &reg);
65 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, reg);
68 static void csiphy_routing_cfg_3430(struct isp_csiphy *phy, u32 iface, bool on,
79 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, 0);
86 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, csirxfe);
91 * @phy: relevant phy device
101 static void csiphy_routing_cfg(struct isp_csiphy *phy,
105 if (phy->isp->phy_type == ISP_PHY_TYPE_3630 && on)
106 return csiphy_routing_cfg_3630(phy, iface, ccp2_strobe);
107 if (phy->isp->phy_type == ISP_PHY_TYPE_3430)
108 return csiphy_routing_cfg_3430(phy, iface, on, ccp2_strobe);
115 static void csiphy_power_autoswitch_enable(struct isp_csiphy *phy, bool enable)
117 isp_reg_clr_set(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG,
128 static int csiphy_set_power(struct isp_csiphy *phy, u32 power)
133 isp_reg_clr_set(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG,
139 reg = isp_reg_readl(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG) &
148 dev_err(phy->isp->dev, "CSI2 CIO set power failed!\n");
162 static int omap3isp_csiphy_config(struct isp_csiphy *phy)
164 struct isp_pipeline *pipe = to_isp_pipeline(phy->entity);
181 if (num_data_lanes > phy->num_data_lanes)
206 csiphy_routing_cfg(phy, buscfg->interface, true,
214 reg = isp_reg_readl(phy->isp, phy->phy_regs, ISPCSIPHY_REG0);
225 isp_reg_writel(phy->isp, reg, phy->phy_regs, ISPCSIPHY_REG0);
227 reg = isp_reg_readl(phy->isp, phy->phy_regs, ISPCSIPHY_REG1);
236 isp_reg_writel(phy->isp, reg, phy->phy_regs, ISPCSIPHY_REG1);
239 reg = isp_reg_readl(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG);
255 isp_reg_writel(phy->isp, reg, phy->cfg_regs, ISPCSI2_PHY_CFG);
260 int omap3isp_csiphy_acquire(struct isp_csiphy *phy, struct media_entity *entity)
264 if (phy->vdd == NULL) {
265 dev_err(phy->isp->dev,
270 mutex_lock(&phy->mutex);
272 rval = regulator_enable(phy->vdd);
276 rval = omap3isp_csi2_reset(phy->csi2);
280 phy->entity = entity;
282 rval = omap3isp_csiphy_config(phy);
286 if (phy->isp->revision == ISP_REVISION_15_0) {
287 rval = csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_ON);
289 regulator_disable(phy->vdd);
293 csiphy_power_autoswitch_enable(phy, true);
297 phy->entity = NULL;
299 mutex_unlock(&phy->mutex);
303 void omap3isp_csiphy_release(struct isp_csiphy *phy)
305 mutex_lock(&phy->mutex);
306 if (phy->entity) {
307 struct isp_pipeline *pipe = to_isp_pipeline(phy->entity);
311 csiphy_routing_cfg(phy, buscfg->interface, false,
313 if (phy->isp->revision == ISP_REVISION_15_0) {
314 csiphy_power_autoswitch_enable(phy, false);
315 csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF);
317 regulator_disable(phy->vdd);
318 phy->entity = NULL;
320 mutex_unlock(&phy->mutex);