1. 01 4月, 2016 2 次提交
  2. 11 3月, 2016 1 次提交
  3. 05 3月, 2016 1 次提交
    • A
      [media] hide unused functions for !MEDIA_CONTROLLER · 0a82edd0
      Arnd Bergmann 提交于
      Some functions in the au0828 driver are only used when CONFIG_MEDIA_CONTROLLER
      is enabled, and otherwise defined as empty functions:
      
      media/usb/au0828/au0828-core.c:208:13: error: 'au0828_media_graph_notify' defined but not used [-Werror=unused-function]
      media/usb/au0828/au0828-core.c:262:12: error: 'au0828_enable_source' defined but not used [-Werror=unused-function]
      media/usb/au0828/au0828-core.c:412:13: error: 'au0828_disable_source' defined but not used [-Werror=unused-function]
      
      This moves the #ifdef so the entire definitions are hidden in this case.
      
      [mchehab@osg.samsung.com: As pointed by Shuah Khan, a return 0 can be removed]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0a82edd0
  4. 04 3月, 2016 1 次提交
  5. 03 3月, 2016 1 次提交
  6. 27 2月, 2016 4 次提交
  7. 23 2月, 2016 2 次提交
  8. 16 2月, 2016 1 次提交
  9. 10 2月, 2016 2 次提交
    • M
      [media] au0828: move V4L2-specific code to au0828-core.c · 7b606ffd
      Mauro Carvalho Chehab 提交于
      Instead of having lots of #ifdefs inside au0828-core due to
      V4L2, move the dependencies to au0828-video.c. That allows
      removing all those ifdefs, as au0828-video is only compiled if
      CONFIG_VIDEO_AU0828_V4L2.
      
      This fixes the following warnings reported by Kbuild test
      with a random config with au0828 enabled, but V4L2 is disabled.
      
      All warnings (new ones prefixed by >>):
      
         drivers/media/usb/au0828/au0828-core.c: In function 'au0828_usb_probe':
      >> drivers/media/usb/au0828/au0828-core.c:463:1: warning: label 'done' defined but not used [-Wunused-label]
          done:
          ^
         drivers/media/usb/au0828/au0828-core.c: At top level:
         drivers/media/usb/au0828/au0828-core.c:250:12: warning: 'au0828_create_media_graph' defined but not used [-Wunused-function]
          static int au0828_create_media_graph(struct au0828_dev *dev)
                     ^
      
      Tested with a WinTV HVR 950Q (USB ID: 2040:7200)
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      7b606ffd
    • M
      [media] au0828: only create V4L2 graph if V4L2 is registered · 82e92f4c
      Mauro Carvalho Chehab 提交于
      It doesn't make sense to try to create the analog TV graph,
      if the device fails to register at V4L2, or if it doesn't have
      V4L2 support.
      
      Thanks to Shuah for pointing this issue.
      Reported-by: NShuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      82e92f4c
  10. 01 2月, 2016 1 次提交
  11. 11 1月, 2016 12 次提交
    • M
      [media] usb: check media device errors · 9f806795
      Mauro Carvalho Chehab 提交于
      There are now two new warnings:
      
      drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 'dvb_usbv2_media_device_register':
      drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:433:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
        media_device_register(adap->dvb_adap.mdev);
        ^
      drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function 'dvb_usb_media_device_register':
      drivers/media/usb/dvb-usb/dvb-usb-dvb.c:128:2: warning: ignoring return value of '__media_device_register', declared with attribute warn_unused_result [-Wunused-result]
        media_device_register(adap->dvb_adap.mdev);
        ^
      
      Those are because the drivers are not properly checking if the
      media device init and register were succeeded.
      
      Fix it.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9f806795
    • J
      [media] media-device: split media initialization and registration · 9832e155
      Javier Martinez Canillas 提交于
      The media device node is registered and so made visible to user-space
      before entities are registered and links created which means that the
      media graph obtained by user-space could be only partially enumerated
      if that happens too early before all the graph has been created.
      
      To avoid this race condition, split the media init and registration
      in separate functions and only register the media device node when
      all the pending subdevices have been registered, either explicitly
      by the driver or asynchronously using v4l2_async_register_subdev().
      
      The media_device_register() had a check for drivers not filling dev
      and model fields but all drivers in mainline set them and not doing
      it will be a driver bug so change the function return to void and
      add a BUG_ON() for dev being NULL instead.
      
      Also, add a media_device_cleanup() function that will destroy the
      graph_mutex that is initialized in media_device_init().
      
      [mchehab@osg.samsung.com: Fix compilation if !CONFIG_MEDIA_CONTROLLER
       and remove two warnings added by this changeset]
      Suggested-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9832e155
    • M
      [media] uapi/media.h: Rename entities types to functions · 4ca72efa
      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: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      4ca72efa
    • M
      [media] media-entity.h: rename entity.type to entity.function · 0e576b76
      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: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      0e576b76
    • M
      [media] au0828: enforce check for graph creation · 4e26f3ab
      Mauro Carvalho Chehab 提交于
      If the graph creation fails, don't register the device.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      4e26f3ab
    • M
      [media] au0828: Create connector links · 28b6ba11
      Mauro Carvalho Chehab 提交于
      Now that connectors are entities, we need to represent the
      connector links.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      28b6ba11
    • M
      [media] au0828: add support for the connectors · d1f33737
      Mauro Carvalho Chehab 提交于
      Depending on the input, an au0828 may have a different
      number of connectors. add entities to represent them.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      d1f33737
    • M
      [media] au0828: postpone call to au0828_unregister_media_device() · 7e9a8ad5
      Mauro Carvalho Chehab 提交于
      The DVB core needs to unregister the media device. So, we
      can't call au0828_unregister_media_device() before calling
      au0828_dvb_unregister(), otherwise the DVB MC free code
      (that will be implemented on the next patch) will fail.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      7e9a8ad5
    • M
      [media] tuner-core: add an input pad · 188d2d55
      Mauro Carvalho Chehab 提交于
      Tuners actually have at least one connector on its input.
      
      Add a PAD to connect it.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      188d2d55
    • M
      [media] media: convert links from array to list · 57208e5e
      Mauro Carvalho Chehab 提交于
      The entire logic that represent graph links were developed on a
      time where there were no needs to dynamic remove links. So,
      although links are created/removed one by one via some
      functions, they're stored as an array inside the entity struct.
      
      As the array may grow, there's a logic inside the code that
      checks if the amount of space is not enough to store
      the needed links. If it isn't the core uses krealloc()
      to change the size of the link, with is bad, as it
      leaves the memory fragmented.
      
      So, convert links into a list.
      
      Also, currently,  both source and sink entities need the link
      at the graph traversal logic inside media_entity. So there's
      a logic duplicating all links. That makes it to spend
      twice the memory needed. This is not a big deal for today's
      usage, where the number of links are not big.
      
      Yet, if during the MC workshop discussions, it was said that
      IIO graphs could have up to 4,000 entities. So, we may
      want to remove the duplication on some future. The problem
      is that it would require a separate linked list to store
      the backlinks inside the entity, or to use a more complex
      algorithm to do graph backlink traversal, with is something
      that the current graph traversal inside the core can't cope
      with. So, let's postpone a such change if/when it is actually
      needed.
      
      It should also be noticed that the media_link structure uses
      44 bytes on 32-bit architectures and 84 bytes on 64-bit
      architecture. It will thus be allocated out of the 64-bytes and
      96-bytes pools respectively. That's a 12.5% memory waste on
      64-bit architectures and 31.25% on 32-bit architecture.
      A linked list is less efficient than an array in this case, but
      this could later be optimized if we can get rid of the reverse
      links (with would reduce memory allocation by 50%).
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      57208e5e
    • M
      [media] media: rename the function that create pad links · 8df00a15
      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 <$i >a && mv a $i; done
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      8df00a15
    • R
      [media] au0828: Add support for media controller · bed69196
      Rafael Lourenço de Lima Chehab 提交于
      Add support for analog and dvb tv using media controller.
      Signed-off-by: NRafael Lourenço de Lima Chehab <chehabrafael@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      bed69196
  12. 10 6月, 2015 1 次提交
  13. 25 11月, 2014 1 次提交
    • S
      [media] media/au0828: Fix IR stop, poll to not access device during disconnect · eb336eab
      Shuah Khan 提交于
      au0828 IR stop and poll routines continue to access device
      while usb disconnect is in progress. There is small window
      between device disconnect and usb interface is set to null.
      This results in filling the log with several of the following
      error messages. Fix it to detect device disconnect condition
      and avoid device access.
      
      Nov 20 18:58:02 anduin kernel: [  102.949819] au0828: au0828_usb_disconnect()
      Nov 20 18:58:02 anduin kernel: [  102.950046] au0828: send_control_msg() Failed sending control message, error -71.
      Nov 20 18:58:02 anduin kernel: [  102.950052] au0828: send_control_msg() Failed sending control message, error -19.
      Nov 20 18:58:02 anduin kernel: [  102.950056] au0828: send_control_msg() Failed sending control message, error -19.
      Nov 20 18:58:02 anduin kernel: [  102.950061] au0828: send_control_msg() Failed sending control message, error -19.
      Nov 20 18:58:02 anduin kernel: [  102.950065] au0828: recv_control_msg() Failed receiving control message, error -19.
      Nov 20 18:58:02 anduin kernel: [  102.950069] au0828: recv_control_msg() Failed receiving control message, error -19.
      Nov 20 18:58:02 anduin kernel: [  102.950072] au0828: recv_control_msg() Failed receiving control message, error -19.
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      eb336eab
  14. 22 8月, 2014 7 次提交
  15. 31 7月, 2014 1 次提交
  16. 13 1月, 2014 1 次提交
  17. 26 3月, 2013 1 次提交