01 Feb, 2016

1 commit


11 Jan, 2016

6 commits

  • With the MC next gen rework, what's left for media_entity_init()
    is to just initialize the PADs. However, certain devices, like
    a FLASH led/light doesn't have any input or output PAD.

    So, there's no reason why calling media_entity_init() would be
    mandatory. Also, despite its name, what this function actually
    does is to initialize the PADs data. So, rename it to
    media_entity_pads_init() in order to reflect that.

    The media entity actual init happens during entity register,
    at media_device_register_entity(). We should move init of
    num_links and num_backlinks to it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Rename the userspace types from MEDIA_ENT_T_ to MEDIA_ENT_F_
    and add the backward compatibility bits.

    The changes at the .c files was generated by the following
    coccinelle script:

    @@
    @@
    -MEDIA_ENT_T_UNKNOWN
    +MEDIA_ENT_F_UNKNOWN
    @@
    @@
    -MEDIA_ENT_T_DVB_BASE
    +MEDIA_ENT_F_DVB_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_BASE
    +MEDIA_ENT_F_V4L2_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_BASE
    +MEDIA_ENT_F_V4L2_SUBDEV_BASE
    @@
    @@
    -MEDIA_ENT_T_CONNECTOR_BASE
    +MEDIA_ENT_F_CONNECTOR_BASE
    @@
    @@
    -MEDIA_ENT_T_V4L2_VIDEO
    +MEDIA_ENT_F_IO_V4L
    @@
    @@
    -MEDIA_ENT_T_V4L2_VBI
    +MEDIA_ENT_F_IO_VBI
    @@
    @@
    -MEDIA_ENT_T_V4L2_SWRADIO
    +MEDIA_ENT_F_IO_SWRADIO
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN
    +MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
    @@
    @@
    -MEDIA_ENT_T_CONN_RF
    +MEDIA_ENT_F_CONN_RF
    @@
    @@
    -MEDIA_ENT_T_CONN_SVIDEO
    +MEDIA_ENT_F_CONN_SVIDEO
    @@
    @@
    -MEDIA_ENT_T_CONN_COMPOSITE
    +MEDIA_ENT_F_CONN_COMPOSITE
    @@
    @@
    -MEDIA_ENT_T_CONN_TEST
    +MEDIA_ENT_F_CONN_TEST
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
    +MEDIA_ENT_F_CAM_SENSOR
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_FLASH
    +MEDIA_ENT_F_FLASH
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_LENS
    +MEDIA_ENT_F_LENS
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_DECODER
    +MEDIA_ENT_F_ATV_DECODER
    @@
    @@
    -MEDIA_ENT_T_V4L2_SUBDEV_TUNER
    +MEDIA_ENT_F_TUNER
    @@
    @@
    -MEDIA_ENT_T_DVB_DEMOD
    +MEDIA_ENT_F_DTV_DEMOD
    @@
    @@
    -MEDIA_ENT_T_DVB_DEMUX
    +MEDIA_ENT_F_TS_DEMUX
    @@
    @@
    -MEDIA_ENT_T_DVB_TSOUT
    +MEDIA_ENT_F_IO_DTV
    @@
    @@
    -MEDIA_ENT_T_DVB_CA
    +MEDIA_ENT_F_DTV_CA
    @@
    @@
    -MEDIA_ENT_T_DVB_NET_DECAP
    +MEDIA_ENT_F_DTV_NET_DECAP

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Entities should have one or more functions. Calling it as a
    type proofed to not be correct, as an entity could eventually
    have more than one type.

    So, rename the field as function.

    Please notice that this patch doesn't extend support for
    multiple function entities. Such change will happen when
    we have real case drivers using it.

    No functional changes.

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

    Mauro Carvalho Chehab
     
  • The driver creates two subdevs, one for the image sensor pixel array
    (and the related readout logic) and one for an ISP.

    The first subdev already uses the MEDIA_ENT_T_V4L2_SUBDEV_SENSOR type,
    but the second subdev isn't a sensor pixel array.

    So, rename the second subdev as MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • With the new API, a link can be either between two PADs or between an interface
    and an entity. So, we need to use a better name for the function that create
    links between two pads.

    So, rename the such function to media_create_pad_link().

    No functional changes.

    This patch was created via this shell script:
    for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g a && mv a $i; done

    Acked-by: Hans Verkuil
    Tested-by: Javier Martinez Canillas
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Currently, media_entity_init() creates an array with the links,
    allocated at init time. It provides a parameter (extra_links)
    that would allocate more links than the current needs, but this
    is not used by any driver.

    As we want to be able to do dynamic link allocation/removal,
    we'll need to change the implementation of the links. So,
    before doing that, let's first remove that extra unused
    parameter, in order to cleanup the interface first.

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

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

10 Jun, 2015

1 commit

  • In little endian cases, macro cpu_to_be16 unfolds to __swab16 which
    provides special case for constants. In big endian cases,
    __constant_cpu_to_be16 and cpu_to_be16 expand directly to the
    same expression. So, replace __constant_cpu_to_be16 with
    cpu_to_be16 with the goal of getting rid of the definition of
    __constant_cpu_to_be16 completely.

    The semantic patch that performs this transformation is as follows:

    @@expression x;@@

    - __constant_cpu_to_be16(x)
    + cpu_to_be16(x)

    Signed-off-by: Vaishali Thakkar
    Reviewed-by: Andrzej Hajda
    Signed-off-by: Mauro Carvalho Chehab

    Vaishali Thakkar
     

28 Apr, 2015

1 commit

  • Fix these compiler warnings that appeared after switching to gcc-5.1.0:

    drivers/media/i2c/s5k5baf.c: In function 's5k5baf_set_power':
    drivers/media/i2c/s5k5baf.c:1057:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
    if (!on != state->power)
    ^
    drivers/media/i2c/s5k6aa.c: In function 's5k6aa_set_power':
    drivers/media/i2c/s5k6aa.c:878:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
    if (!on == s5k6aa->power) {
    ^
    drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function 's5c73m3_oif_set_power':
    drivers/media/i2c/s5c73m3/s5c73m3-core.c:1456:17: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
    } else if (!on == state->power) {
    ^

    Signed-off-by: Hans Verkuil
    Cc: Kamil Debski
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

08 Apr, 2015

1 commit


24 Mar, 2015

1 commit

  • If a subdevice pad op is called from a bridge driver, then there is
    no v4l2_subdev_fh struct that can be passed to the subdevice. This
    made it hard to use such subdevs from a bridge driver.

    This patch replaces the v4l2_subdev_fh pointer by a v4l2_subdev_pad_config
    pointer in the pad ops. This allows bridge drivers to use the various
    try_ pad ops by creating a v4l2_subdev_pad_config struct and passing it
    along to the pad op.

    The v4l2_subdev_get_try_* macros had to be changed because of this, so
    I also took the opportunity to use the full name of the v4l2_subdev_get_try_*
    functions in the __V4L2_SUBDEV_MK_GET_TRY macro arguments: if you now do
    'git grep v4l2_subdev_get_try_format' you will actually find the header
    where it is defined.

    One remark regarding the drivers/staging/media/davinci_vpfe patches: the
    *_init_formats() functions assumed that fh could be NULL. However, that's
    not true for this driver, it's always set. This is almost certainly a copy
    and paste from the omap3isp driver. I've updated the code to reflect the
    fact that fh is never NULL.

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

    Hans Verkuil
     

23 Dec, 2014

1 commit

  • drivers/media/i2c/s5k5baf.c:1796:33: warning: duplicate const
    drivers/media/i2c/s5k5baf.c:379:24: warning: cast to restricted __le16
    drivers/media/i2c/s5k5baf.c:437:11: warning: incorrect type in assignment (different base types)
    drivers/media/i2c/s5k5baf.c:445:16: warning: incorrect type in return expression (different base types)

    Signed-off-by: Hans Verkuil
    Acked-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

15 Nov, 2014

1 commit

  • In order to have subsytem agnostic media bus format definitions we've
    moved media bus definitions to include/uapi/linux/media-bus-format.h and
    prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

    Replace all references to the old definitions in i2c drivers.

    Signed-off-by: Boris Brezillon
    Acked-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Acked-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Boris BREZILLON
     

04 Sep, 2014

1 commit


22 Jul, 2014

1 commit


07 Mar, 2014

1 commit

  • 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
     

04 Feb, 2014

1 commit

  • Using variable length array in s5k5baf_write_arr_seq caused
    an implicit assumption that i2c sequences should be short.
    The patch rewrites the function so it can handle sequences
    of any length and does not use variable length array.

    Reported-by: Dan Carpenter
    Signed-off-by: Andrzej Hajda
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Andrzej Hajda
     

07 Jan, 2014

3 commits


21 Dec, 2013

1 commit

  • Driver for Samsung S5K5BAF UXGA 1/5" 2M CMOS Image Sensor with
    embedded SoC ISP. The device is exposed as two V4L2 subdevices:

    - S5K5BAF-CIS - the image sensor matrix, fixed 1600x1200 format,
    no controls.
    - S5K5BAF-ISP - the Image Signal Processor, formats up to 1600x1200,
    pre/post ISP cropping, downscaling via selection API, controls.

    [m.chehab@samsung.com: Whitespace cleanups]
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Andrzej Hajda
    Signed-off-by: Kyungmin Park

    Signed-off-by: Mauro Carvalho Chehab

    Andrzej Hajda