All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	sakari.ailus@maxwell.research.nokia.com,
	Sylwester Nawrocki <snjw23@gmail.com>,
	Stan <svarbanov@mm-sol.com>, Hans Verkuil <hansverk@cisco.com>,
	saaguirre@ti.com, Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH v2] V4L: add media bus configuration subdev operations
Date: Wed, 29 Jun 2011 22:19:10 +0300	[thread overview]
Message-ID: <4E0B7AAE.7010900@iki.fi> (raw)
In-Reply-To: <Pine.LNX.4.64.1106291806260.12577@axis700.grange>

Guennadi Liakhovetski wrote:
> On Mon, 27 Jun 2011, Guennadi Liakhovetski wrote:
> 
> [snip]
> 
>>> If the structures are expected to be generic I somehow feel that a field of
>>> flags isn't the best way to describe the configuration of CSI-2 or other
>>> busses. Why not to just use a structure with bus type and an union for
>>> bus-specific configuration parameters? It'd be easier to access and also to
>>> change as needed than flags in an unsigned long field.
>>
>> Well, yes, a union can be a good idea, thanks.
> 
> ...on a second thought, we currently only have one field: flags, and it is 
> common for all 3 bus types: parallel, reduced parallel (bt.656, etc.), and 
> CSI-2. In the future, when we need more parameters for any of these busses 
> we'll just add such a union, shouldn't be a problem.

What I meant above was that I would prefer to describe the capabilities
in a structure which would contain appropriate data type for the field,
not as flags or sets of flags in a bit field.

This would allow e.g. just testing for
v4l2_mbus_config.u.parallel.hsync_active_low instead of
v4l2_mbus_config.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW. This way the flags
used for the bus also express the bus explicitly rather than implicitly.

Do you see downsides with this compared to using an integer field as
flags? The other benefits of this are described in my earlier comment.

Regards,

-- 
Sakari Ailus
sakari.ailus@iki.fi

  reply	other threads:[~2011-06-29 19:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 21:26 [PATCH v2] V4L: add media bus configuration subdev operations Guennadi Liakhovetski
2011-06-22 21:53 ` Hans Verkuil
2011-06-22 22:17   ` Guennadi Liakhovetski
2011-06-23 22:01 ` Sakari Ailus
2011-06-23 22:35   ` Guennadi Liakhovetski
2011-06-27  8:19     ` Sakari Ailus
2011-06-27  8:54       ` Guennadi Liakhovetski
2011-06-27 12:43         ` Sakari Ailus
2011-06-27 12:58           ` Guennadi Liakhovetski
2011-06-29 16:08         ` Guennadi Liakhovetski
2011-06-29 19:19           ` Sakari Ailus [this message]
2011-06-29 19:28             ` Guennadi Liakhovetski
2011-06-30 16:50               ` Sakari Ailus
2011-07-01  7:09                 ` Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E0B7AAE.7010900@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=g.liakhovetski@gmx.de \
    --cc=hansverk@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=saaguirre@ti.com \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    --cc=snjw23@gmail.com \
    --cc=svarbanov@mm-sol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.