spin_unlock_irqrestore(&cfe->state_lock, flags);
}
-static u64 sensor_link_frequency(struct cfe_device *cfe)
+static u64 sensor_link_rate(struct cfe_device *cfe)
{
struct v4l2_mbus_framefmt *source_fmt;
struct v4l2_subdev_state *state;
/* x2 for DDR. */
link_freq *= 2;
- cfe_info("Using a link frequency of %lld Hz\n", link_freq);
+ cfe_info("Using a link rate of %lld Mbps\n", link_freq / (1000 * 1000));
return link_freq;
err:
- cfe_err("Unable to determine sensor link frequency, using 999 MHz\n");
+ cfe_err("Unable to determine sensor link rate, using 999 Mbps\n");
return 999 * 1000000UL;
}
}
cfe_dbg("Configuring CSI-2 block\n");
- cfe->csi2.dphy.dphy_freq = sensor_link_frequency(cfe) / 1000000UL;
+ cfe->csi2.dphy.dphy_rate = sensor_link_rate(cfe) / 1000000UL;
csi2_open_rx(&cfe->csi2);
cfe_dbg("Starting sensor streaming\n");
return get_tstdout(dphy);
}
-static void dphy_set_hsfreqrange(struct dphy_data *dphy, uint32_t freq_mhz)
+static void dphy_set_hsfreqrange(struct dphy_data *dphy, uint32_t mbps)
{
/* See Table 5-1 on page 65 of dphy databook */
static const u16 hsfreqrange_table[][2] = {
};
unsigned int i;
- if (freq_mhz < 80 || freq_mhz > 1500)
- dphy_err("DPHY: Frequency %u MHz out of range\n", freq_mhz);
+ if (mbps < 80 || mbps > 1500)
+ dphy_err("DPHY: Datarate %u Mbps out of range\n", mbps);
for (i = 0; i < ARRAY_SIZE(hsfreqrange_table) - 1; i++) {
- if (freq_mhz <= hsfreqrange_table[i][0])
+ if (mbps <= hsfreqrange_table[i][0])
break;
}
set_tstclr(dphy, 0);
usleep_range(15, 20);
- dphy_set_hsfreqrange(dphy, dphy->dphy_freq);
+ dphy_set_hsfreqrange(dphy, dphy->dphy_rate);
usleep_range(5, 10);
dw_csi2_host_write(dphy, PHY_SHUTDOWNZ, 1);