Re: [PATCH 04/24] media: v4l2-mediabus: convert flags to enums and document them

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

 



On Mon 2017-10-09 07:19:10, Mauro Carvalho Chehab wrote:
> There is a mess with media bus flags: there are two sets of
> flags, one used by parallel and ITU-R BT.656 outputs,
> and another one for CSI2.
> 
> Depending on the type, the same bit has different meanings.
> 

> @@ -86,11 +125,22 @@ enum v4l2_mbus_type {
>  /**
>   * struct v4l2_mbus_config - media bus configuration
>   * @type:	in: interface type
> - * @flags:	in / out: configuration flags, depending on @type
> + * @pb_flags:	in / out: configuration flags, if @type is
> + *		%V4L2_MBUS_PARALLEL or %V4L2_MBUS_BT656.
> + * @csi2_flags:	in / out: configuration flags, if @type is
> + *		%V4L2_MBUS_CSI2.
> + * @flag:	access flags, no matter the @type.
> + *		Used just to avoid needing to rewrite the logic inside
> + *		soc_camera and pxa_camera drivers. Don't use on newer
> + * 		drivers!
>   */
>  struct v4l2_mbus_config {
>  	enum v4l2_mbus_type type;
> -	unsigned int flags;
> +	union {
> +		enum v4l2_mbus_parallel_and_bt656_flags	pb_flags;
> +		enum v4l2_mbus_csi2_flags		csi2_flags;
> +		unsigned int				flag;
> +	};
>  };
>  
>  static inline void v4l2_fill_pix_format(struct v4l2_pix_format
>  *pix_fmt,

The flags->flag conversion is quite subtle, and "flag" is confusing
because there is more than one inside. What about something like
__legacy_flags?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux