public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add link-frequencies to struct v4l2_of_endpoint
@ 2015-03-10  1:17 Sakari Ailus
  2015-03-10  1:18 ` [PATCH 1/3] smiapp: Clean up smiapp_get_pdata() Sakari Ailus
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Sakari Ailus @ 2015-03-10  1:17 UTC (permalink / raw)
  To: linux-media; +Cc: prabhakar.csengg, laurent.pinchart

Hi,

While I was adding a link_frequencies array field to struct
v4l2_of_endpoint, I also realised that the smiapp driver was not reading the
link-frequencies property from the endpoint, but the i2c device node
instead. This is what the second patch addresses.

The third patch does add support for reading the link-frequencies property
to struct v4l2_of_endpoint. There were a few options to consider. I'm not
entirely happy with the solution, but it still appears the best option to
me, all being:

1. Let drivers parse the link-frequencies property. There are three samples
from three different developers (myself, Laurent and Prabhakar) and two of
them seemed to have issues.

2. Reading the contents of the link-frequencies property in
v4l2_of_parse_endpoint() addresses the above issue. It currently has no
cleanup function to release memory reserved for the variable-size
link_frequencies array.

2a. Use a constant size array for link-frequencies. This limits the number
of link-frequencies and wastes memory elsewhere.

2b. Use devm_*() functions to allocate the memory. v4l2_of_parse_endpoint()
would require a device pointer argument in order to read variable size
content from the endpoint. One major issue in this approach is that the
configuration struct is typically short-lived as drivers allocate it in
stack in their DT node parsing function.

2c. Add a function to release resources reserved by
v4l2_of_parse_endpoint(). This is what the third patch does.

Comments are welcome.

-- 
Kind regards,
Sakari


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-03-15 23:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10  1:17 [PATCH 0/3] Add link-frequencies to struct v4l2_of_endpoint Sakari Ailus
2015-03-10  1:18 ` [PATCH 1/3] smiapp: Clean up smiapp_get_pdata() Sakari Ailus
2015-03-11 18:40   ` Laurent Pinchart
2015-03-11 22:24   ` Lad, Prabhakar
2015-03-11 22:38     ` Lad, Prabhakar
2015-03-10  1:18 ` [PATCH 2/3] smiapp: Read link-frequencies property from the endpoint node Sakari Ailus
2015-03-11 18:41   ` Laurent Pinchart
2015-03-11 22:25   ` Lad, Prabhakar
2015-03-11 22:38     ` Lad, Prabhakar
2015-03-10  1:18 ` [PATCH 3/3] v4l: of: Add link-frequencies array to struct v4l2_of_endpoint Sakari Ailus
2015-03-11 22:22   ` Lad, Prabhakar
2015-03-12 20:49     ` [PATCH v1.1 " Sakari Ailus
2015-03-15 17:15       ` Guennadi Liakhovetski
2015-03-15 23:16         ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox