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_csi2_device *csi2 = phy->csi2; in omap3isp_csiphy_config()
190 for (i = 0; i < phy->num_data_lanes; i++) { in omap3isp_csiphy_config()
211 csiphy_routing_cfg(phy, buscfg->interface, true, in omap3isp_csiphy_config()
219 reg = isp_reg_readl(csi2->isp, phy->phy_regs, ISPCSIPHY_REG0); in omap3isp_csiphy_config()
230 isp_reg_writel(csi2->isp, reg, phy->phy_regs, ISPCSIPHY_REG0); in omap3isp_csiphy_config()
232 reg = isp_reg_readl(csi2->isp, phy->phy_regs, ISPCSIPHY_REG1); in omap3isp_csiphy_config()
241 isp_reg_writel(csi2->isp, reg, phy->phy_regs, ISPCSIPHY_REG1); in omap3isp_csiphy_config()
244 reg = isp_reg_readl(csi2->isp, phy->cfg_regs, ISPCSI2_PHY_CFG); in omap3isp_csiphy_config()
246 for (i = 0; i < phy->num_data_lanes; i++) { in omap3isp_csiphy_config()
260 isp_reg_writel(csi2->isp, reg, phy->cfg_regs, ISPCSI2_PHY_CFG); in omap3isp_csiphy_config()
265 int omap3isp_csiphy_acquire(struct isp_csiphy *phy) in omap3isp_csiphy_acquire() argument
269 if (phy->vdd == NULL) { in omap3isp_csiphy_acquire()
270 dev_err(phy->isp->dev, "Power regulator for CSI PHY not " in omap3isp_csiphy_acquire()
275 mutex_lock(&phy->mutex); in omap3isp_csiphy_acquire()
277 rval = regulator_enable(phy->vdd); in omap3isp_csiphy_acquire()
281 rval = omap3isp_csi2_reset(phy->csi2); in omap3isp_csiphy_acquire()
285 rval = omap3isp_csiphy_config(phy); in omap3isp_csiphy_acquire()
289 rval = csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_ON); in omap3isp_csiphy_acquire()
291 regulator_disable(phy->vdd); in omap3isp_csiphy_acquire()
295 csiphy_power_autoswitch_enable(phy, true); in omap3isp_csiphy_acquire()
296 phy->phy_in_use = 1; in omap3isp_csiphy_acquire()
299 mutex_unlock(&phy->mutex); in omap3isp_csiphy_acquire()
303 void omap3isp_csiphy_release(struct isp_csiphy *phy) in omap3isp_csiphy_release() argument
305 mutex_lock(&phy->mutex); in omap3isp_csiphy_release()
306 if (phy->phy_in_use) { in omap3isp_csiphy_release()
307 struct isp_csi2_device *csi2 = phy->csi2; in omap3isp_csiphy_release()
312 csiphy_routing_cfg(phy, buscfg->interface, false, in omap3isp_csiphy_release()
314 csiphy_power_autoswitch_enable(phy, false); in omap3isp_csiphy_release()
315 csiphy_set_power(phy, ISPCSI2_PHY_CFG_PWR_CMD_OFF); in omap3isp_csiphy_release()
316 regulator_disable(phy->vdd); in omap3isp_csiphy_release()
317 phy->phy_in_use = 0; in omap3isp_csiphy_release()
319 mutex_unlock(&phy->mutex); in omap3isp_csiphy_release()