28 #include <linux/device.h>
51 reg |= (phy->
lanes.data[
i].pol <<
53 reg |= (phy->
lanes.data[
i].pos <<
69 static void csiphy_power_autoswitch_enable(
struct isp_csiphy *phy,
bool enable)
82 static int csiphy_set_power(
struct isp_csiphy *phy,
u32 power)
96 if (reg != power >> 2)
99 }
while ((reg != power >> 2) && (retry_count < 100));
101 if (retry_count == 100) {
114 static void csiphy_dphy_config(
struct isp_csiphy *phy)
141 static int csiphy_config(
struct isp_csiphy *phy,
145 unsigned int used_lanes = 0;
150 if (lanes->
data[i].pol > 1 || lanes->
data[i].pos > 3)
153 if (used_lanes & (1 << lanes->
data[i].pos))
156 used_lanes |= 1 << lanes->
data[
i].pos;
159 if (lanes->
clk.pol > 1 || lanes->
clk.pos > 3)
162 if (lanes->
clk.pos == 0 || used_lanes & (1 << lanes->
clk.pos))
178 dev_err(phy->
isp->dev,
"Power regulator for CSI PHY not "
193 csiphy_dphy_config(phy);
194 csiphy_lanes_config(phy);
202 csiphy_power_autoswitch_enable(phy,
true);
214 csiphy_power_autoswitch_enable(phy,
false);