Lines Matching refs:phy
26 static void csiphy_routing_cfg_3630(struct isp_csiphy *phy, in csiphy_routing_cfg_3630() argument
33 regmap_read(phy->isp->syscon, phy->isp->syscon_offset, ®); in csiphy_routing_cfg_3630()
68 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, reg); in csiphy_routing_cfg_3630()
71 static void csiphy_routing_cfg_3430(struct isp_csiphy *phy, u32 iface, bool on, in csiphy_routing_cfg_3430() argument
82 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, 0); in csiphy_routing_cfg_3430()
89 regmap_write(phy->isp->syscon, phy->isp->syscon_offset, csirxfe); in csiphy_routing_cfg_3430()
104 static void csiphy_routing_cfg(struct isp_csiphy *phy, in csiphy_routing_cfg() argument
108 if (phy->isp->phy_type == ISP_PHY_TYPE_3630 && on) in csiphy_routing_cfg()
109 return csiphy_routing_cfg_3630(phy, iface, ccp2_strobe); in csiphy_routing_cfg()
110 if (phy->isp->phy_type == ISP_PHY_TYPE_3430) in csiphy_routing_cfg()
111 return csiphy_routing_cfg_3430(phy, iface, on, ccp2_strobe); in csiphy_routing_cfg()
118 static void csiphy_power_autoswitch_enable(struct isp_csiphy *phy, bool enable) in csiphy_power_autoswitch_enable() argument
120 isp_reg_clr_set(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG, in csiphy_power_autoswitch_enable()
131 static int csiphy_set_power(struct isp_csiphy *phy, u32 power) in csiphy_set_power() argument
136 isp_reg_clr_set(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG, in csiphy_set_power()
142 reg = isp_reg_readl(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG) & in csiphy_set_power()
151 dev_err(phy->isp->dev, "CSI2 CIO set power failed!\n"); in csiphy_set_power()
165 static int omap3isp_csiphy_config(struct isp_csiphy *phy) in omap3isp_csiphy_config() argument
167 struct isp_pipeline *pipe = to_isp_pipeline(phy->entity); in omap3isp_csiphy_config()
184 if (num_data_lanes > phy->num_data_lanes) in omap3isp_csiphy_config()
209 csiphy_routing_cfg(phy, buscfg->interface, true, in omap3isp_csiphy_config()
217 reg = isp_reg_readl(phy->isp, phy->phy_regs, ISPCSIPHY_REG0); in omap3isp_csiphy_config()
228 isp_reg_writel(phy->isp, reg, phy->phy_regs, ISPCSIPHY_REG0); in omap3isp_csiphy_config()
230 reg = isp_reg_readl(phy->isp, phy->phy_regs, ISPCSIPHY_REG1); in omap3isp_csiphy_config()
239 isp_reg_writel(phy->isp, reg, phy->phy_regs, ISPCSIPHY_REG1); in omap3isp_csiphy_config()
242 reg = isp_reg_readl(phy->isp, phy->cfg_regs, ISPCSI2_PHY_CFG); in omap3isp_csiphy_config()
258 isp_reg_writel(phy->isp, reg, phy->cfg_regs, ISPCSI2_PHY_CFG); in omap3isp_csiphy_config()
263 int omap3isp_csiphy_acquire(struct isp_csiphy *phy, struct media_entity *entity) in omap3isp_csiphy_acquire() argument
267 if (phy->vdd == NULL) { in omap3isp_csiphy_acquire()
268 dev_err(phy->isp->dev, in omap3isp_csiphy_acquire()
273 mutex_lock(&phy->mutex); in omap3isp_csiphy_acquire()
275 rval = regulator_enable(phy->vdd); in omap3isp_csiphy_acquire()
279 rval = omap3isp_csi2_reset(phy->csi2); in omap3isp_csiphy_acquire()
283 phy->entity = entity; in omap3isp_csiphy_acquire()
285 rval = omap3isp_csiphy_config(phy); in omap3isp_csiphy_acquire()
289 if (phy->isp->revision == ISP_REVISION_15_0) { in omap3isp_csiphy_acquire()
290 rval = csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_ON); in omap3isp_csiphy_acquire()
292 regulator_disable(phy->vdd); in omap3isp_csiphy_acquire()
296 csiphy_power_autoswitch_enable(phy, true); in omap3isp_csiphy_acquire()
300 phy->entity = NULL; in omap3isp_csiphy_acquire()
302 mutex_unlock(&phy->mutex); in omap3isp_csiphy_acquire()
306 void omap3isp_csiphy_release(struct isp_csiphy *phy) in omap3isp_csiphy_release() argument
308 mutex_lock(&phy->mutex); in omap3isp_csiphy_release()
309 if (phy->entity) { in omap3isp_csiphy_release()
310 struct isp_pipeline *pipe = to_isp_pipeline(phy->entity); in omap3isp_csiphy_release()
314 csiphy_routing_cfg(phy, buscfg->interface, false, in omap3isp_csiphy_release()
316 if (phy->isp->revision == ISP_REVISION_15_0) { in omap3isp_csiphy_release()
317 csiphy_power_autoswitch_enable(phy, false); in omap3isp_csiphy_release()
318 csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF); in omap3isp_csiphy_release()
320 regulator_disable(phy->vdd); in omap3isp_csiphy_release()
321 phy->entity = NULL; in omap3isp_csiphy_release()
323 mutex_unlock(&phy->mutex); in omap3isp_csiphy_release()