28 Apr, 2015

4 commits

  • You must use static inline otherwise you get these errors if CONFIG_OF is not defined:

    In file included from drivers/media/platform/soc_camera/soc_camera.c:39:0:
    include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
    static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
    ^
    In file included from drivers/media/platform/soc_camera/atmel-isi.c:28:0:
    include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
    static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
    ^
    In file included from drivers/media/platform/soc_camera/rcar_vin.c:36:0:
    include/media/v4l2-of.h:112:13: warning: 'v4l2_of_free_endpoint' defined but not used [-Wunused-function]
    static void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint)
    ^

    Signed-off-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The link-frequencies property is a variable length array of link frequencies
    in an endpoint. The array is needed by an increasing number of drivers, so
    it makes sense to add it to struct v4l2_of_endpoint.

    However, the length of the array is variable and the size of struct
    v4l2_of_endpoint is fixed since it is allocated by the caller. The options
    here are

    1. to define a fixed maximum limit of link frequencies that has to be the
    global maximum of all boards. This is seen as problematic since the maximum
    could be largish, and everyone hitting the problem would need to submit a
    patch to fix it, or

    2. parse the property in every driver. This doesn't sound appealing as two
    of the three implementations submitted to linux-media were wrong, and one of
    them was even merged before this was noticed, or

    3. change the interface so that allocating and releasing memory according to
    the size of the array is possible. This is what the patch does.

    v4l2_of_alloc_parse_endpoint() is just like v4l2_of_parse_endpoint(), but it
    will allocate the memory resources needed to store struct v4l2_of_endpoint
    and the additional arrays pointed to by this struct. A corresponding release
    function v4l2_of_free_endpoint() is provided to release the memory allocated
    by v4l2_of_alloc_parse_endpoint().

    In addition to this, the link-frequencies property is parsed as well, and
    the result is stored to struct v4l2_of_endpoint field link_frequencies.

    Signed-off-by: Sakari Ailus
    Acked-by: Laurent Pinchart
    Acked-by: Sylwester Nawrocki
    Tested-by: Lad, Prabhakar
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • Zero the entire struct starting from bus_type. As more fields are added, no
    changes will be needed in the function to reset their value explicitly.

    Signed-off-by: Sakari Ailus
    Acked-by: Laurent Pinchart
    Acked-by: Sylwester Nawrocki
    Acked-by: Lad, Prabhakar
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • The field is unused. Remove it.

    Signed-off-by: Sakari Ailus
    Acked-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     

03 Apr, 2015

2 commits

  • The function fills a link data structure with the device node and port
    number at both the local and remote ends of a link defined by one of its
    endpoint nodes.

    Signed-off-by: Laurent Pinchart
    Acked-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Acked-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     
  • Add lane_polarities field to struct v4l2_of_bus_mipi_csi2 and write the
    contents of the lane-polarities property to it. The field tells the polarity
    of the physical lanes starting from the first one. Any unused lanes are
    ignored, i.e. only the polarity of the used lanes is specified.

    Also rework reading the "data-lanes" property a little.

    Signed-off-by: Sakari Ailus
    Acked-by: Laurent Pinchart
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     

07 Mar, 2014

2 commits

  • This patch adds a new struct of_endpoint which is then embedded in struct
    v4l2_of_endpoint and contains the endpoint properties that are not V4L2
    (or even media) specific: the port number, endpoint id, local device tree
    node and remote endpoint phandle. of_graph_parse_endpoint parses those
    properties and is used by v4l2_of_parse_endpoint, which just adds the
    V4L2 MBUS information to the containing v4l2_of_endpoint structure.

    Signed-off-by: Philipp Zabel
    Acked-by: Tomi Valkeinen
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Sylwester Nawrocki

    Philipp Zabel
     
  • This patch moves the parsing helpers used to parse connected graphs
    in the device tree, like the video interface bindings documented in
    Documentation/devicetree/bindings/media/video-interfaces.txt, from
    drivers/media/v4l2-core/v4l2-of.c into drivers/of/base.c.

    This allows to reuse the same parser code from outside the V4L2
    framework, most importantly from display drivers.
    The functions v4l2_of_get_next_endpoint, v4l2_of_get_remote_port,
    and v4l2_of_get_remote_port_parent are moved. They are renamed to
    of_graph_get_next_endpoint, of_graph_get_remote_port, and
    of_graph_get_remote_port_parent, respectively.
    Since there are not that many current users yet, switch all of
    them to the new functions right away.

    Signed-off-by: Philipp Zabel
    Acked-by: Tomi Valkeinen
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Sylwester Nawrocki

    Philipp Zabel
     

18 Dec, 2013

2 commits


05 Apr, 2013

1 commit

  • v4l2_of_parse_parallel_bus() function is now static and
    EXPORT_SYMBOL() doesn't apply to it any more. Drop this
    meaningless statement, which was supposed to be done in
    the original merged patch.
    While at it, edit the copyright notice so it is sorted in
    both the v4l2-of.c and v4l2-of.h file in newest entries
    on top order, and state clearly I'm just the author of
    parts of the code, not the copyright owner.

    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Kyungmin Park
    Signed-off-by: Mauro Carvalho Chehab

    Sylwester Nawrocki
     

31 Mar, 2013

1 commit

  • Add a V4L2 OF parser, implementing bindings documented in
    Documentation/devicetree/bindings/media/video-interfaces.txt.
    [s.nawrocki@samsung.com: various corrections and improvements
    since the initial version]

    Signed-off-by: Guennadi Liakhovetski
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Kyungmin Park
    Signed-off-by: Mauro Carvalho Chehab

    Guennadi Liakhovetski