1. 26 Aug, 2019 21 commits
  2. 23 Aug, 2019 4 commits
  3. 21 Aug, 2019 15 commits
    • Maxime Ripard's avatar
      media: dt-bindings: media: Convert Allwinner A10 IR to a schema · 01faced6
      Maxime Ripard authored
      The older Allwinner SoCs have a IR receiver supported in Linux, with a
      matching Device Tree binding.
      
      Now that we have the DT validation in place, let's convert the device tree
      bindings for that controller over to a YAML schemas.
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      01faced6
    • Maxime Ripard's avatar
      media: dt-bindings: media: Add YAML schemas for the generic RC bindings · 7c31b9d6
      Maxime Ripard authored
      The RC controllers have a bunch of generic properties that are needed in a
      device tree. Add a YAML schemas for those.
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      7c31b9d6
    • Tomas Bortoli's avatar
      media: ttusb-dec: Fix info-leak in ttusb_dec_send_command() · a10feaf8
      Tomas Bortoli authored
      The function at issue does not always initialize each byte allocated
      for 'b' and can therefore leak uninitialized memory to a USB device in
      the call to usb_bulk_msg()
      
      Use kzalloc() instead of kmalloc()
      Signed-off-by: default avatarTomas Bortoli <tomasbortoli@gmail.com>
      Reported-by: syzbot+0522702e9d67142379f1@syzkaller.appspotmail.com
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      a10feaf8
    • Nishka Dasgupta's avatar
      media: dvb-frontends/cxd2099: Make en_templ constant · 6f005abb
      Nishka Dasgupta authored
      Static structure en_templ, of type dvb_ca_en50221, is not used except to
      be copied into a local variable. Hence make it const to prevent
      unintended modification of the original fields.
      Issue found with Coccinelle.
      Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      6f005abb
    • Nishka Dasgupta's avatar
      media: ec168: Make structure ec168_props constant · 05fa782e
      Nishka Dasgupta authored
      The static structure ec168_props, of type dvb_usb_device_properties, is
      used only once, when it is assigned to field props of the constant
      structure ec168_driver_info. As this means that ec168_props will never be
      modified, make it const as well in order to prevent unintended
      modification of its fields.
      Issue found with Coccinelle.
      Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      05fa782e
    • Nishka Dasgupta's avatar
      media: firewire: Make structure fdtv_ca constant · a37c2efc
      Nishka Dasgupta authored
      Static structure fdtv_ca, of type dvb_device, is only used when it is
      passed as the third argument to function dvb_register_device(). However,
      in the definition of dvb_register_device, the third parameter is
      declared as constant. Hence make fdtv_ca const as well.
      Issue found with Coccinelle.
      Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      a37c2efc
    • Nishka Dasgupta's avatar
      media: dvb-bt8xx: Make variable dst_config constant · b501b09a
      Nishka Dasgupta authored
      Static structure dst_config, of type dst_config, is not used except to
      be assigned as the value of field state of a variable having type
      dst_state *. In the definition of dst_state, field config is declared as
      const. Hence dst_config, when assigned to config, cannot be modified.
      Therefore, make dst_config const as well.
      Issue found with Coccinelle.
      Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      b501b09a
    • Jan Pieter van Woerkom's avatar
      media: dvb-usb: add T230 to dvbsky · a9547e52
      Jan Pieter van Woerkom authored
      commit 5fa88151 ("[media] dvb-usb-cxusb: Geniatech T230 - resync TS
      FIFO after lock") does not solve the problem for all devices. This is the
      same issue reported on the T230C, which was moved to the dvbsky.c driver
      to work around this issue in commit 57422405 ("media: dvbsky: MyGica
      T230C support").
      
      In addition, the cxusb driver causes an oops when unplugging the device
      while streaming; this problem does not happen any more.
      Signed-off-by: default avatarJan Pieter van Woerkom <jp@jpvw.nl>
      Tested-by: default avatarJames Hutchinson <jahutchinson99@googlemail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      a9547e52
    • Jan Pieter van Woerkom's avatar
      media: dvb-usb: remove T230 from cxusb · fe087322
      Jan Pieter van Woerkom authored
      Remove this device from the cxusb driver so it can be added to the dvbsky
      driver.
      Signed-off-by: default avatarJan Pieter van Woerkom <jp@jpvw.nl>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      fe087322
    • Wenwen Wang's avatar
      media: dvb-core: fix a memory leak bug · fcd5ce4b
      Wenwen Wang authored
      In dvb_create_media_entity(), 'dvbdev->entity' is allocated through
      kzalloc(). Then, 'dvbdev->pads' is allocated through kcalloc(). However, if
      kcalloc() fails, the allocated 'dvbdev->entity' is not deallocated, leading
      to a memory leak bug. To fix this issue, free 'dvbdev->entity' before
      returning -ENOMEM.
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      fcd5ce4b
    • Sean Young's avatar
      media: ttpci: unknown protocol is rc-mm-32 · b1da86fc
      Sean Young authored
      This protocol responds to a real philips rc-mm remote; it does not respond
      to IR encoded with the encoder in ir-rcmm-decoder.c.
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      b1da86fc
    • Wenwen Wang's avatar
      media: dvb-frontends: fix a memory leak bug · 2f6451ed
      Wenwen Wang authored
      In cx24117_load_firmware(), 'buf' is allocated through kmalloc() to hold
      the firmware. However, if i2c_transfer() fails, it is not deallocated,
      leading to a memory leak bug.
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      2f6451ed
    • Wenwen Wang's avatar
      media: dvb-frontends: fix memory leaks · 8c3d3cdb
      Wenwen Wang authored
      In dib7000pc_detection(), 'tx' and 'rx' are allocated through kzalloc()
      respectively. However, if DiB7000PC is detected, they are not deallocated,
      leading to memory leaks. To fix this issue, create a label to free 'tx' and
      'rx' before returning from the function.
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      8c3d3cdb
    • A Sun's avatar
      media: mceusb: fix (eliminate) TX IR signal length limit · 9fc3ce31
      A Sun authored
      Fix and eliminate mceusb's IR length limit for IR signals transmitted to
      the MCE IR blaster ports.
      
      An IR signal TX exceeding 306 pulse/space samples presently causes -EINVAL
      return error. There's no such limitation nor error with the MCE device
      hardware. And valid IR signals exist with more than 400 pulse/space for the
      control of certain appliances (eg Panasonic ACXA75C00600 air conditioner).
      
      The scope of this patch is limited to the mceusb driver. There are still
      IR signal TX length and time constraints that related modules of rc core
      (eg LIRC) impose, further up the driver stack.
      
      Changes for mceusb_tx_ir():
      
      Converts and sends LIRC IR pulse/space sequence to MCE device IR
      pulse/space format.
      
      Break long length LIRC sequence into multiple (unlimited number of) parts
      for sending to the MCE device.
      Reduce kernel stack IR buffer size: 128 (was 384)
      Increase MCE IR data packet size: 31 (was 5)
      Zero time LIRC pulse/space no longer copied to MCE IR data.
      Eliminate overwriting the source/input LIRC IR data in txbuf[].
      Eliminate -EINVAL return; return number of IR samples sent (>0) or
      MCE write error code (<0).
      
      New mce_write() and mce_write_callback():
      
      Implements synchronous blocking I/O, with timeout, for writing/sending
      data to the MCE device.
      
      An unlimited multipart IR signal sent to the MCE device faster than real
      time requires flow control absent with the original mce_request_packet()
      and mce_async_callback() asynchronous I/O implementation. Also absent is
      TX error feedback.
      
      mce_write() combines and replaces mce_request_packet() and
      mce_async_callback() with conversion to synchronous I/O.
      mce_write() returns bytes sent (>0) or MCE device write error (<0).
      Debug hex dump TX data before processing.
      
      Rename mce_async_out() -> mce_command_out():
      
      The original name is misleading with underlying synchronous I/O
      implementation. Function renamed to mce_command_out().
      
      Changes in mceusb_handle_command():
      
      Add support for MCE device error case MCE_RSP_TX_TIMEOUT
      "IR TX timeout (TX buffer underrun)"
      
      Changes in mceusb_dev_printdata():
      
      Changes support test and debug of multipart TX IR.
      
      Add buffer boundary information (offset and buffer size) to TX hex dump.
      Correct TX trace bug "Raw IR data, 0 pulse/space samples"
      Add trace for MCE_RSP_TX_TIMEOUT "IR TX timeout (TX buffer underrun)"
      
      Other changes:
      
      The driver's write to USB device architecture change (async to sync I/O)
      is significant so we bump DRIVER_VERSION to "1.95" (from "1.94").
      
      Tests:
      
      $ cat -n irdata1 | head -3
           1  carrier 36000
           2  pulse 6350
           3  space 6350
      $ cat -n irdata1 | tail -3
          76  pulse 6350
          77  space 6350
          78  pulse 6350
      $ ir-ctl -s irdata1
      
      [1549021.073612] mceusb 1-1.3:1.0: requesting 36000 HZ carrier
      [1549021.073635] mceusb 1-1.3:1.0: tx data[0]: 9f 06 01 45 (len=4 sz=4)
      [1549021.073649] mceusb 1-1.3:1.0: Request carrier of 35714 Hz (period 28us)
      [1549021.073848] mceusb 1-1.3:1.0: tx done status = 4 (wait = 100, expire = 100 (1000ms), urb->actual_length = 4, urb->status = 0)
      [1549021.074689] mceusb 1-1.3:1.0: rx data[0]: 9f 06 01 45 (len=4 sz=4)
      [1549021.074701] mceusb 1-1.3:1.0: Got carrier of 35714 Hz (period 28us)
      [1549021.102023] mceusb 1-1.3:1.0: tx data[0]: 9f 08 03 (len=3 sz=3)
      [1549021.102036] mceusb 1-1.3:1.0: Request transmit blaster mask of 0x03
      [1549021.102219] mceusb 1-1.3:1.0: tx done status = 3 (wait = 100, expire = 100 (1000ms), urb->actual_length = 3, urb->status = 0)
      [1549021.131979] mceusb 1-1.3:1.0: tx data[0]: 9e ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 9e ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f ff 7f 91 ff (len=81 sz=81)
      [1549021.131992] mceusb 1-1.3:1.0: Raw IR data, 30 pulse/space samples
      [1549021.133592] mceusb 1-1.3:1.0: tx done status = 81 (wait = 100, expire = 100 (1000ms), urb->actual_length = 81, urb->status = 0)
      
      Hex dumps limited to 64 bytes.
      0xff is MCE maximum time pulse, 0x7f is MCE maximum time space.
      
      $ cat -n irdata2 | head -3
           1  carrier 36000
           2  pulse 50
           3  space 50
      $ cat -n irdata2 | tail -3
         254  pulse 50
         255  space 50
         256  pulse 50
      $ ir-ctl -s irdata2
      
      [1549306.586998] mceusb 1-1.3:1.0: tx data[0]: 9f 08 03 (len=3 sz=3)
      [1549306.587015] mceusb 1-1.3:1.0: Request transmit blaster mask of 0x03
      [1549306.587252] mceusb 1-1.3:1.0: tx done status = 3 (wait = 100, expire = 100 (1000ms), urb->actual_length = 3, urb->status = 0)
      [1549306.613275] mceusb 1-1.3:1.0: tx data[0]: 9e 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 9e 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 9e 81 (len=128 sz=128)
      [1549306.613291] mceusb 1-1.3:1.0: Raw IR data, 30 pulse/space samples
      [1549306.614837] mceusb 1-1.3:1.0: tx done status = 128 (wait = 100, expire = 100 (1000ms), urb->actual_length = 128, urb->status = 0)
      [1549306.614861] mceusb 1-1.3:1.0: tx data[0]: 9e 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 9e 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 01 81 9e 01 (len=128 sz=128)
      [1549306.614869] mceusb 1-1.3:1.0: Raw IR data, 30 pulse/space samples
      [1549306.620199] mceusb 1-1.3:1.0: tx done status = 128 (wait = 100, expire = 100 (1000ms), urb->actual_length = 128, urb->status = 0)
      [1549306.620212] mceusb 1-1.3:1.0: tx data[0]: 89 81 01 81 01 81 01 81 01 81 80 (len=11 sz=11)
      [1549306.620221] mceusb 1-1.3:1.0: Raw IR data, 9 pulse/space samples
      [1549306.633294] mceusb 1-1.3:1.0: tx done status = 11 (wait = 98, expire = 100 (1000ms), urb->actual_length = 11, urb->status = 0)
      
      Hex dumps limited to 64 bytes.
      0x81 is MCE minimum time pulse, 0x01 is MCE minimum time space.
      TX IR part 3 sz=11 shows 20msec I/O blocking delay
      (100expire - 98wait = 2jiffies)
      Signed-off-by: default avatarA Sun <as1033x@comcast.net>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      9fc3ce31
    • Christian Hewitt's avatar
      media: rc: add keymap for HardKernel ODROID remote · 8f5f33f7
      Christian Hewitt authored
      This is a simple NEC remote control device shipped with the HardKernel
      ODROID range of SBC devices.
      Signed-off-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Signed-off-by: default avatarSean Young <sean@mess.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      8f5f33f7