Re: [PATCH 06/10] media: ar0521: Configure pixel rate using LINK_FREQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jacopo Mondi <jacopo@xxxxxxxxxx> writes:

> Now that the V4L2_LINK_FREQUENCY control is available, use it to
> configure the sensor pixel rate.
>
> Adjust the default pixel rate to match the first listed link_frequency.
> @@ -330,10 +333,21 @@ static u32 calc_pll(struct ar0521_dev *sensor, u32 freq, u16 *pre_ptr, u16 *mult
>  static void ar0521_calc_mode(struct ar0521_dev *sensor)
>  {
>  	unsigned int pixel_clock;
> +	unsigned int link_freq;
> +	s64 frequency;
> +	u32 pixel_rate;
>  	u16 pre, mult;
>  	u32 vco;
>  	int bpp;
>  
> +	/* Update the PIXEL_RATE value using the desired link_frequency. */
> +	bpp = ar0521_code_to_bpp(sensor);
> +	link_freq = sensor->ctrls.link_freq->val;
> +	frequency = ar0521_link_frequencies[link_freq];
> +	pixel_rate = frequency * sensor->lane_count * 2 / bpp;

Must be that div64 thing.

> +
> +	__v4l2_ctrl_s_ctrl_int64(sensor->ctrls.pixrate, pixel_rate);
> +

-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux