30 Jan, 2017

2 commits

  • The driver type can be assigned immediately when an RC device
    requests to the framework to allocate the device.

    This is an 'enum rc_driver_type' data type and specifies whether
    the device is a raw receiver or scancode receiver. The type will
    be given as parameter to the rc_allocate_device device.

    Change accordingly all the drivers calling rc_allocate_device()
    so that the device type is specified during the rc device
    allocation. Whenever the device type is not specified, it will be
    set as RC_DRIVER_SCANCODE which was the default '0' value.

    Suggested-by: Sean Young
    Signed-off-by: Andi Shyti
    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Andi Shyti
     
  • unknown and other are for IR protocols for which we have no decoder,
    so the raw IR drivers have no chance of generating them. cec is not
    an IR protocol.

    Signed-off-by: Sean Young
    Cc: Jiri Kosina
    Cc: Benjamin Tissoires
    Cc: Bruno Prémont
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     

27 Jan, 2017

1 commit

  • Drop the FSF's postal address from the source code files that typically
    contain mostly the license text. Of the 628 removed instances, 578 are
    outdated.

    The patch has been created with the following command without manual edits:

    git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
    drivers/media/ include/media|while read i; do i=$i perl -e '
    open(F,"< $ENV{i}");
    $a=join("", );
    $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
    && $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
    close(F);
    open(F, "> $ENV{i}");
    print F $a;
    close(F);'; done

    Signed-off-by: Sakari Ailus

    Sakari Ailus
     

19 Nov, 2016

1 commit

  • These are immutable. Making them "const" allows the compiler to move
    them to the "rodata" section.

    Note that cxd2841er_t_c_ops cannot be made "const", because
    cxd2841er_attach() modifies it. Ouch!

    [mchehab@s-opensource.com: fix merge conflicts]
    Signed-off-by: Max Kellermann

    Signed-off-by: Mauro Carvalho Chehab

    Max Kellermann
     

16 Feb, 2016

1 commit

  • As pointed by KASAN:

    BUG: KASAN: slab-out-of-bounds in memcpy+0x1d/0x40 at addr ffff880000038d8c
    Read of size 128 by task systemd-udevd/2536
    page:ffffea0000000800 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0
    flags: 0xffff8000004000(head)
    page dumped because: kasan: bad access detected
    CPU: 1 PID: 2536 Comm: systemd-udevd Not tainted 4.5.0-rc3+ #47
    Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
    ffff880000038d8c ffff8803b0f1f1e8 ffffffff81933901 0000000000000080
    ffff8803b0f1f280 ffff8803b0f1f270 ffffffff815602c5 ffffffff8284cf93
    ffffffff822ddc00 0000000000000282 0000000000000001 ffff88009c7c6000
    Call Trace:
    [] dump_stack+0x85/0xc4
    [] kasan_report_error+0x525/0x550
    [] kasan_report+0x39/0x40
    [] memcpy+0x1d/0x40
    [] smscore_set_device_mode+0xee0/0x2560 [smsmdtv]

    Such error happens at the memcpy code below:

    0x4bc0 is in smscore_set_device_mode (drivers/media/common/siano/smscoreapi.c:975).
    970 sizeof(u32) + payload_size));
    971
    972 data_msg->mem_addr = mem_address;
    973 memcpy(data_msg->payload, payload, payload_size);
    974
    975 rc = smscore_sendrequest_and_wait(coredev, data_msg,
    976 data_msg->x_msg_header.msg_length,
    977 &coredev->data_download_done);
    978
    979 payload += payload_size;

    The problem is that the Siano driver uses a header to store the firmware,
    with requires a few more bytes than allocated.

    Tested with:
    PCTV 77e (2013:0257)
    Hauppauge WinTV MiniStick (2040:5510)

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

05 Feb, 2016

1 commit


11 Jan, 2016

3 commits

  • Several pure digital TV devices have a frontend with the tuner
    integrated on it. Add the RF connector when dvb_create_media_graph()
    is called on such devices.

    Tested with siano and dvb_usb_mxl111sf drivers.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • 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: Sakari Ailus
    Signed-off-by: Javier Martinez Canillas
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Javier Martinez Canillas
     
  • If media controller is enabled and mdev is filled, it should
    ensure that the media graph will be properly initialized.

    Enforce that.

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

    Mauro Carvalho Chehab
     

19 Nov, 2015

1 commit


10 Jun, 2015

1 commit

  • The DVB API was originally defined using typedefs. This is against
    Kernel CodingStyle, and there's no good usage here. While we can't
    remove its usage on userspace, we can avoid its usage in Kernelspace.

    So, let's do it.

    This patch was generated by this shell script:

    for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," a && mv a $i; done; done

    While here, make CodingStyle fixes on the affected lines.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Stefan Richter # for drivers/media/firewire/*

    Mauro Carvalho Chehab
     

14 May, 2015

1 commit


09 May, 2015

1 commit


02 Mar, 2015

3 commits

  • This is really a simple function, but using it avoids to have
    if's inside the drivers.

    Also, the kABI becomes a little more clearer.

    This shouldn't generate any overhead, and the type check
    will happen when compiling with MC DVB enabled.

    So, let's do it.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function ‘dvb_usbv2_adapter_dvb_exit’:
    drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable ‘d’ [-Wunused-variable]
    struct dvb_usb_device *d = adap_to_d(adap);
    ^
    drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: ‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
    static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)

    drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: ‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
    static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
    ^

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Instead of using media_dev argument for dvb_create_media_graph(),
    use the adapter.

    That allows to create a stub for this function, if compiled
    without DVB support, avoiding to add extra if's at the drivers.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

26 Feb, 2015

10 commits


25 Nov, 2014

1 commit


04 Sep, 2014

1 commit


22 Aug, 2014

1 commit


26 Jul, 2014

1 commit

  • The basic API of rc-core used to be:

    dev = rc_allocate_device();
    dev->x = a;
    dev->y = b;
    dev->z = c;
    rc_register_device();

    which is a pretty common pattern in the kernel, after the introduction of
    protocol arrays the API looks something like:

    dev = rc_allocate_device();
    dev->x = a;
    rc_set_allowed_protocols(dev, RC_BIT_X);
    dev->z = c;
    rc_register_device();

    There's no real need for the protocols to be an array, so change it
    back to be consistent (and in preparation for the following patches).

    [m.chehab@samsung.com: added missing changes at some files]
    Signed-off-by: David Härdeman
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman
     

22 Jul, 2014

1 commit

  • X-Patchwork-Delegate: mchehab@redhat.com
    Remove the CONFIG_ prefix from two Kconfig symbols in a dependency for
    SMS_SIANO_DEBUGFS. This prefix is invalid inside Kconfig files.

    Note that the current (common sense) dependency on SMS_USB_DRV and
    SMS_SDIO_DRV being equal ensures that SMS_SIANO_DEBUGFS will not
    violate its constraints. These constraint are that:
    - it should only be built if SMS_USB_DRV is set;
    - it can't be builtin if USB support is modular.

    So drop the dependency on SMS_USB_DRV, as it is unneeded.

    Fixes: 6c84b214284e ("[media] sms: fix randconfig building error")

    Reported-by: Martin Walch
    Signed-off-by: Paul Bolle
    Signed-off-by: Mauro Carvalho Chehab

    Paul Bolle
     

12 Mar, 2014

1 commit

  • The allowed and enabled protocol masks need to be expanded to be per
    filter type in order to support wakeup filter protocol selection. To
    ease that process abstract access to the rc_dev::allowed_protos and
    rc_dev::enabled_protocols members with inline functions.

    Signed-off-by: James Hogan
    Reviewed-by: Antti Seppälä
    Signed-off-by: Mauro Carvalho Chehab

    James Hogan
     

07 Feb, 2014

1 commit


30 Nov, 2013

1 commit

  • Fix various spelling errors in strings and comments throughout the media
    tree. The majority of these were found using Lucas De Marchi's codespell
    tool.

    [m.chehab@samsung.com: discard hunks with conflicts]

    Signed-off-by: Jonathan McCrohan
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Jonathan McCrohan
     

17 Oct, 2013

1 commit

  • drivers/media/common/siano/smsdvb-main.c:47:5: warning: symbol 'sms_to_guard_interval_table' was not declared. Should it be static?
    drivers/media/common/siano/smsdvb-main.c:54:5: warning: symbol 'sms_to_code_rate_table' was not declared. Should it be static?
    drivers/media/common/siano/smsdvb-main.c:63:5: warning: symbol 'sms_to_hierarchy_table' was not declared. Should it be static?
    drivers/media/common/siano/smsdvb-main.c:70:5: warning: symbol 'sms_to_modulation_table' was not declared. Should it be static?
    drivers/media/common/siano/smscoreapi.c:925:35: warning: cast to restricted __le32
    drivers/media/common/siano/smscoreapi.c:926:28: warning: cast to restricted __le32

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

    Hans Verkuil
     

14 Oct, 2013

1 commit

  • At this bugzilla and similar ones:
    https://bugzilla.kernel.org/show_bug.cgi?id=60645
    Those debug messages were seen as errors, but they're just debug
    data, and are OK to appear on sms1100 and sms2270. Re-tag them
    to appear only if debug is enabled.

    Signed-off-by: Mauro Carvalho Chehab
    Tested-by: André Roth
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

24 Aug, 2013

1 commit

  • As reported by Jim Davis ,
    building with:
    CONFIG_USB=m
    CONFIG_SMS_USB_DRV=m
    CONFIG_SMS_SDIO_DRV=y
    CONFIG_SMS_SIANO_MDTV=y
    CONFIG_SMS_SIANO_DEBUGFS=y

    causes a build error:

    drivers/built-in.o: In function `smsdvb_debugfs_register':
    /home/jim/linux/drivers/media/common/siano/smsdvb-debugfs.c:537:
    undefined reference to `usb_debug_root'
    make: *** [vmlinux] Error 1

    That happens because the siano-mdtv is builtin, while USB is a
    module. As it makes not much sense to have sms-usb compiled as 'm'
    and sms-sdio compiled as 'y' (or vice-versa), only allow enabling
    debugfs if both are either 'y' or 'm'.

    Reported-by: Jim Davis
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

22 Aug, 2013

1 commit

  • GIT_AUTHOR_DATE=1376465691
    I took a quick look at the code and wonder if the problem is caused by
    an initial zero statistics message? This is all just a wild guess, but
    if it is correct, then the attached untested patch might fix it...
    Bjørn
    >From d78a0599d5b5d4da384eae08bf7da316389dfbe5 Mon Sep 17 00:00:00 2001
    ts_packets and ets_packets counters can be 0. Don't fall over
    if they are. Fixes:
    [ 846.851711] divide error: 0000 [#1] SMP
    [ 846.851806] Modules linked in: smsdvb dvb_core ir_lirc_codec lirc_dev ir_sanyo_decoder ir_mce_kbd_decoder ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder ir_nec_decoder rc_hauppauge smsusb smsmdtv rc_core pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport cpufreq_userspace cpufreq_powersave cpufreq_stats cpufreq_conservative rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss oid_registry nfs_acl nfs lockd dns_resolver fscache sunrpc ext4 jbd2 fuse tp_smapi(O) thinkpad_ec(O) loop firewire_sbp2 dm_crypt snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm thinkpad_acpi nvram snd_page_alloc hid_generic snd_seq_midi snd_seq_midi_event arc4 usbhid snd_rawmidi uvcvideo hid iwldvm coretemp kvm_intel mac8021
    1 cdc_wdm
    [ 846.853477] cdc_acm snd_seq videobuf2_vmalloc videobuf2_memops videobuf2_core videodev media kvm radeon r852 ttm joydev cdc_ether usbnet pcmcia mii sm_common nand btusb drm_kms_helper tpm_tis acpi_cpufreq bluetooth iwlwifi nand_ecc drm nand_ids i2c_i801 mtd snd_seq_device iTCO_wdt iTCO_vendor_support r592 memstick lpc_ich mperf tpm yenta_socket pcmcia_rsrc pcmcia_core cfg80211 snd_timer snd pcspkr i2c_algo_bit crc16 i2c_core tpm_bios processor mfd_core wmi psmouse mei_me rfkill mei serio_raw soundcore evdev battery button video ac microcode ext3 mbcache jbd md_mod dm_mirror dm_region_hash dm_log dm_mod sg sr_mod sd_mod cdrom crc_t10dif firewire_ohci sdhci_pci sdhci mmc_core firewire_core crc_itu_t thermal thermal_sys ahci libahci ehci_pci uhci_hcd ehci_hcd libata scsi_mod usbcore e1000
    e usb_common
    [ 846.855310] ptp pps_core
    [ 846.855356] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 3.10-2-amd64 #1 Debian 3.10.5-1
    [ 846.855490] Hardware name: LENOVO 4061WFA/4061WFA, BIOS 6FET92WW (3.22 ) 12/14/2011
    [ 846.855609] task: ffffffff81613400 ti: ffffffff81600000 task.ti: ffffffff81600000
    [ 846.855636] RIP: 0010:[] [] smsdvb_onresponse+0x264/0xa86 [smsdvb]
    [ 846.863906] RSP: 0018:ffff88013bc03cf0 EFLAGS: 00010046
    [ 846.863906] RAX: 0000000000000000 RBX: ffff880133bf6000 RCX: 0000000000000000
    [ 846.863906] RDX: 0000000000000000 RSI: ffff88005d3b58c0 RDI: ffff880133bf6000
    [ 846.863906] RBP: ffff88005d1da000 R08: 0000000000000058 R09: 0000000000000015
    [ 846.863906] R10: 0000000000001a0d R11: 000000000000021a R12: ffff88005d3b58c0
    [ 846.863906] R13: ffff88005d1da008 R14: 00000000ffffff8d R15: ffff880036cf5060
    [ 846.863906] FS: 0000000000000000(0000) GS:ffff88013bc00000(0000) knlGS:0000000000000000
    [ 846.863906] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 846.863906] CR2: 00007f3a4b69ae50 CR3: 0000000036dac000 CR4: 00000000000407f0
    [ 846.863906] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 846.863906] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 846.863906] Stack:
    [ 846.863906] ffff88007a102000 ffff88005d1da000 ffff88005d3b58c0 0000000000085824
    [ 846.863906] ffffffffa08c5aa3 ffff88005d1da000 ffff8800a6907390 ffff8800a69073b0
    [ 846.863906] ffff8800a6907000 ffffffffa08b642c 000000000000021a ffff8800a69073b0
    [ 846.863906] Call Trace:
    [ 846.863906]
    [ 846.863906]
    [ 846.863906] [] ? smscore_onresponse+0x1d5/0x353 [smsmdtv]
    [ 846.863906] [] ? smsusb_onresponse+0x146/0x192 [smsusb]
    [ 846.863906] [] ? usb_hcd_giveback_urb+0x6c/0xac [usbcore]
    [ 846.863906] [] ? ehci_urb_done+0x62/0x72 [ehci_hcd]
    [ 846.863906] [] ? qh_completions+0x91/0x364 [ehci_hcd]
    [ 846.863906] [] ? ehci_work+0x8a/0x68e [ehci_hcd]
    [ 846.863906] [] ? timekeeping_get_ns.constprop.10+0xd/0x31
    [ 846.863906] [] ? update_cfs_rq_blocked_load+0xde/0xec
    [ 846.863906] [] ? run_posix_cpu_timers+0x25/0x575
    [ 846.863906] [] ? ehci_irq+0x211/0x23d [ehci_hcd]
    [ 846.863906] [] ? usb_hcd_irq+0x31/0x48 [usbcore]
    [ 846.863906] [] ? handle_irq_event_percpu+0x49/0x1a4
    [ 846.863906] [] ? handle_irq_event+0x32/0x4b
    [ 846.863906] [] ? handle_fasteoi_irq+0x80/0xb6
    [ 846.863906] [] ? handle_irq+0x18/0x20
    [ 846.863906] [] ? do_IRQ+0x40/0x95
    [ 846.863906] [] ? common_interrupt+0x6d/0x6d
    [ 846.863906]
    [ 846.863906]
    [ 846.863906] [] ? arch_local_irq_enable+0x4/0x8
    [ 846.863906] [] ? cpuidle_enter_state+0x52/0xc1
    [ 846.863906] [] ? cpuidle_idle_call+0xd4/0x143
    [ 846.863906] [] ? arch_cpu_idle+0x5/0x17
    [ 846.863906] [] ? cpu_startup_entry+0x10d/0x187
    [ 846.863906] [] ? start_kernel+0x3e8/0x3f3
    [ 846.863906] [] ? repair_env_string+0x54/0x54
    [ 846.863906] [] ? x86_64_start_kernel+0xf2/0xfd
    [ 846.863906] Code: 25 09 00 00 c6 83 da 08 00 00 03 8b 45 54 48 01 83 b6 08 00 00 8b 45 50 48 01 83 db 08 00 00 8b 4d 18 69 c1 ff ff 00 00 03 4d 14 f7 f1 89 83 a8 09 00 00 e9 68 fe ff ff 48 8b 7f 10 e8 79 92
    [ 846.863906] RIP [] smsdvb_onresponse+0x264/0xa86 [smsdvb]
    [ 846.863906] RSP
    Reference: http://bugs.debian.org/719623

    Reported-by: Johannes Rohr
    Signed-off-by: Bjørn Mork
    Signed-off-by: Mauro Carvalho Chehab

    Bjørn Mork
     

13 Jun, 2013

1 commit


22 May, 2013

1 commit