Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7aa76b6e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Add check for sensor data rate"

parents c28af583 6c4cd9be
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@
#define MBPS                                      1000000
#define SNPS_INTERPHY_OFFSET                      0x800
#define SET_THE_BIT(x)                            (0x1 << x)
#define SNPS_MAX_DATA_RATE_PER_LANE               2500000000ULL

#undef CDBG
#define CDBG(fmt, args...) pr_debug(fmt, ##args)
@@ -185,7 +186,15 @@ static int msm_csiphy_snps_2_lane_config(
	void __iomem *csiphybase;

	csiphybase = csiphy_dev->base;

	if (csiphy_params->data_rate >
		SNPS_MAX_DATA_RATE_PER_LANE * num_lanes) {
		pr_err("unsupported data rate\n");
		return -EINVAL;
	}

	local_data_rate = csiphy_params->data_rate;

	if (mode == TWO_LANE_PHY_A)
		offset = 0x0;
	else if (mode == TWO_LANE_PHY_B)
@@ -208,15 +217,6 @@ static int msm_csiphy_snps_2_lane_config(
		diff = diff_i;
	}

	if (i == (sizeof(snps_v100_freq_values)/
		sizeof(snps_v100_freq_values[0]))) {
		if (local_data_rate >
			snps_v100_freq_values[--i].default_bit_rate) {
			pr_err("unsupported data rate\n");
			return -EINVAL;
		}
	}

	csiphy_dev->snps_programmed_data_rate = csiphy_params->data_rate;

	if (mode == TWO_LANE_PHY_A) {