summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-cards.c
Commit message (Collapse)AuthorAge
* [media] em28xx: fix spelling mistake: "missdetected" -> "misdetected"Colin Ian King2017-06-06
| | | | | | | | Trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: don't treat device as webcam if an unknown sensor is detectedFrank Schaefer2017-04-17
| | | | | | | | | | | | | With an unknown sensor, norm_maxw() and norm_maxh() return 0 as max. height and width values, which causes a devide by zero in size_to_scale(). Of course we could use speculative default values for unknown sensors, but the chance that the device works at this resolution without any driver/setup is very low and therefore not worth the efforts. Instead, just don't treat the device as camera. A message will then be printed to the log that the device isn't supported. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: Add new USB ID eb1a:5051Alexandre-Xavier Labonté-Lamoureux2017-04-17
| | | | | | | | Add new usbid eb1a:5051 for the Ion Video 2 PC MKII, Startech svid2usb23 and Raygo R12-41373. Signed-off-by: Alexandre-Xavier Labonté-Lamoureux <alexandrexavier@live.ca> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] tveeprom: get rid of unused arg on tveeprom_hauppauge_analog()Mauro Carvalho Chehab2017-03-03
| | | | | | | | | | | | tveeprom_hauppauge_analog() used to need the I2C adapter in order to print debug messages. As it now uses pr_foo() facilities since commit 6037b3ca28f4 ("[media] tveeprom: print log messages using pr_foo()"), the first argument of the function is not needed anymore. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: support for Hauppauge WinTV-dualHD 01595 ATSC/QAMKevin Cheng2017-02-03
| | | | | | | | | | | | | | Hauppauge WinTV-dualHD model 01595 is a USB 2.0 dual ATSC/QAM tuner with the following components: USB bridge: Empia em28274 Demodulator: 2x LG LGDT3306a at addresses 0xb2 and 0x1c Tuner: 2x Silicon Labs si2157 at addresses 0xc0 and 0xc4 This patch enables only the first tuner. Signed-off-by: Kevin Cheng <kcheng@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: don't store usb_device at struct em28xxMauro Carvalho Chehab2016-12-12
| | | | | | | | Now that we're storing usb_interface at em28xx struct, there's no good reason to keep storing usb_device, as we can get it from usb_interface. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: use usb_interface for dev_foo() callsMauro Carvalho Chehab2016-12-12
| | | | | | | | The usb_device->dev is not the right device for dev_foo() calls. Instead, it should use usb_interface->dev. Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: don't change the device's nameMauro Carvalho Chehab2016-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the device name, causes it to be unable to remove the sysfs file, causing troubles if a device is removed and then re-inserted. [ 1010.310320] WARNING: CPU: 3 PID: 119 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x7b/0x90 [ 1010.310323] sysfs: cannot create duplicate filename '/bus/usb/devices/1-3.3' [ 1010.310325] Modules linked in: lgdt330x em28xx_dvb dvb_core em28xx_alsa tuner_xc2028 tuner tvp5150 em28xx_v4l videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core em28xx tveeprom v4l2_common videodev media xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables cmac bnep cpufreq_powersave cpufreq_conservative cpufreq_userspace binfmt_misc parport_pc ppdev lp parport snd_hda_codec_hdmi iTCO_wdt snd_hda_codec_realtek iTCO_vendor_support snd_hda_codec_generic arc4 intel_rapl x86_pkg_temp_thermal iwlmvm intel_powerclamp coretemp kvm_intel mac80211 kvm i915 [ 1010.310383] irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel iwlwifi pl2303 aesni_intel btusb aes_x86_64 usbserial lrw btrtl gf128mul glue_helper btbcm ablk_helper cryptd btintel bluetooth drm_kms_helper cfg80211 drm psmouse pcspkr i2c_i801 e1000e serio_raw snd_hda_intel snd_soc_rt5640 snd_hda_codec snd_soc_rl6231 snd_soc_ssm4567 mei_me i2c_smbus rfkill snd_hda_core ptp mei snd_soc_core ehci_pci sg lpc_ich shpchp mfd_core ehci_hcd pps_core snd_hwdep i2c_algo_bit snd_compress snd_pcm sdhci_acpi snd_timer battery snd sdhci elan_i2c snd_soc_sst_acpi mmc_core fjes dw_dmac i2c_hid soundcore snd_soc_sst_match i2c_designware_platform video i2c_designware_core acpi_pad acpi_als kfifo_buf tpm_tis button industrialio tpm_tis_core tpm ext4 crc16 jbd2 fscrypto mbcache dm_mod joydev evdev hid_logitech_hidpp [ 1010.310449] sd_mod hid_logitech_dj usbhid hid ahci libahci crc32c_intel libata xhci_pci xhci_hcd scsi_mod usbcore fan thermal [ 1010.310464] CPU: 3 PID: 119 Comm: kworker/3:2 Not tainted 4.9.0-rc8+ #14 [ 1010.310466] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015 [ 1010.310487] Workqueue: usb_hub_wq hub_event [usbcore] [ 1010.310490] 0000000000000000 ffffffff848f56c5 ffff8803b1f7f858 0000000000000000 [ 1010.310496] ffffffff8414f8f8 ffff88030000001f ffffed00763eff07 ffff8803b1f7f8f0 [ 1010.310501] ffff8803b3ea1e60 0000000000000001 ffffffffffffffef ffff8803b45c6840 [ 1010.310505] Call Trace: [ 1010.310517] [<ffffffff848f56c5>] ? dump_stack+0x5c/0x77 [ 1010.310522] [<ffffffff8414f8f8>] ? __warn+0x168/0x1a0 [ 1010.310526] [<ffffffff8414f9e4>] ? warn_slowpath_fmt+0xb4/0xf0 [ 1010.310529] [<ffffffff8414f930>] ? __warn+0x1a0/0x1a0 [ 1010.310534] [<ffffffff845436c6>] ? kasan_kmalloc+0xa6/0xd0 [ 1010.310539] [<ffffffff846ec2fa>] ? kernfs_path_from_node+0x4a/0x60 [ 1010.310543] [<ffffffff846f66eb>] ? sysfs_warn_dup+0x7b/0x90 [ 1010.310547] [<ffffffff846f6f26>] ? sysfs_do_create_link_sd.isra.2+0xb6/0xd0 [ 1010.310553] [<ffffffff84cd5a08>] ? bus_add_device+0x318/0x6b0 [ 1010.310557] [<ffffffff846f8693>] ? sysfs_create_groups+0x83/0x110 [ 1010.310562] [<ffffffff84ccff87>] ? device_add+0x777/0x1350 [ 1010.310567] [<ffffffff84ccf810>] ? device_private_init+0x180/0x180 [ 1010.310583] [<ffffffffc00c0f77>] ? usb_new_device+0x707/0x1030 [usbcore] [ 1010.310598] [<ffffffffc00c58c5>] ? hub_event+0x1d65/0x3280 [usbcore] [ 1010.310604] [<ffffffff841eb4ab>] ? account_entity_dequeue+0x30b/0x4a0 [ 1010.310618] [<ffffffffc00c3b60>] ? hub_port_debounce+0x280/0x280 [usbcore] [ 1010.310624] [<ffffffff8407ccd0>] ? compat_start_thread+0x80/0x80 [ 1010.310629] [<ffffffff851f5cb4>] ? __schedule+0x704/0x1770 [ 1010.310633] [<ffffffff851f55b0>] ? io_schedule_timeout+0x390/0x390 [ 1010.310638] [<ffffffff84541783>] ? cache_reap+0x173/0x200 [ 1010.310642] [<ffffffff84197bed>] ? process_one_work+0x4ed/0xe60 [ 1010.310646] [<ffffffff84198642>] ? worker_thread+0xe2/0xfd0 [ 1010.310650] [<ffffffff8421f76c>] ? __wake_up_common+0xbc/0x160 [ 1010.310654] [<ffffffff84198560>] ? process_one_work+0xe60/0xe60 [ 1010.310658] [<ffffffff841a837c>] ? kthread+0x1cc/0x220 [ 1010.310663] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310667] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310671] [<ffffffff841a81b0>] ? kthread_park+0x80/0x80 [ 1010.310675] [<ffffffff852016f5>] ? ret_from_fork+0x25/0x30 Tested-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: convert it from pr_foo() to dev_foo()Mauro Carvalho Chehab2016-11-18
| | | | | | | | | | | Instead of using pr_foo(), use dev_foo(), with provides a better output. As this device is a multi-interface one, we'll set the device name to show the chipset and the driver used. While here, get rid of printk continuation messages. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: don't break long linesMauro Carvalho Chehab2016-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. </script> use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } </script> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: convert the remaining printks to pr_fooMauro Carvalho Chehab2016-10-21
| | | | | | | | | | | | There are still several places with printk's called directly. Convert them to pr_foo() macros, except for the debug printk's, as those are enabled via modprobe vars. While here, realign the pr_foo() arguments to match the recommended CodingStyle. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: use pr_foo instead of em28xx-specific printk macrosMauro Carvalho Chehab2016-10-21
| | | | | | | There's no reason to keep using em28xx-specific printk macros here. Just use pr_foo(). Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: don't break long linesMauro Carvalho Chehab2016-10-21
| | | | | | | | | | Due to the 80-cols checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. So, join those continuation lines. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] em28xx: add support for Hauppauge WinTV-dualHD DVB tunerOlli Salonen2016-05-09
| | | | | | | | | | | | | | | | | | | | | Hauppauge WinTV-dualHD is a USB 2.0 dual DVB-T/T2/C tuner with following components: USB bridge: Empia EM28274 (chip id is the same as EM28174) Demodulator: 2x Silicon Labs Si2168-B40 Tuner: 2x Silicon Labs Si2157-A30 This patch adds support only for the first tuner. The demodulator needs firmware, available for example here: http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.11/ The demodulators sit on the same I2C bus and their addresses are 0x64 and 0x67. The tuners are behind the demodulators and their addresses are 0x60 and 0x63. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add support for PLEX PX-BCUD (ISDB-S)Satoshi Nagahama2016-05-06
| | | | | | | | | | | | | | | | | | PX-BCUD has the following components: USB interface: Empia EM28178 Demodulator: Toshiba TC90532 (works by code for TC90522) Tuner: Next version of Sharp QM1D1C0042 em28xx_dvb_init(): add init code for PLEX PX-BCUD with calling px_bcud_init() that does things like pin configuration. qm1d1c0042_init(): support the next version of QM1D1C0042, change to choose an appropriate array of initial registers by reading chip id. [mchehab@osg.samsung.com: fold a fixup patch and fix checkpatch.pl errors/warnings, where applicable] Signed-off-by: Satoshi Nagahama <sattnag@aim.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: fix Terratec Grabby AC97 codec detectionMatthieu Rogez2016-03-05
| | | | | | | | | | | | | | | | EMP202 chip inside Terratec Grabby (hw rev 2) seems to require some time before accessing reliably its registers. Otherwise it returns some values previously put on the I2C bus. To account for that period, we delay card setup until we have a proof that accessing AC97 registers is reliable. We get this proof by polling AC97_RESET until the expected value is read. We also check that unrelated registers don't return the same value. This second check handles the case where the expected value is constantly returned no matter which register is accessed. Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add support for Terratec Grabby Record ledMatthieu Rogez2016-03-03
| | | | | | | | Terratec Grabby (hw rev 2) Record led is connected to GPIO 3 and its logic is inverted: (PIO3 = 0: on, PIO3 = 1: off). Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add support for Terratec Grabby REC buttonMatthieu Rogez2016-03-03
| | | | | | | | Terratec Grabby (hw rev 2) REC button uses the standard snapshot button configuration. Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media_device: move allocation out of media_device_*_initMauro Carvalho Chehab2016-02-23
| | | | | | | | | | Right now, media_device_pci_init and media_device_usb_init does media_device allocation internaly. That preents its usage when the media_device struct is embedded on some other structure. Move memory allocation outside it, to make it more generic. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media-device: move PCI/USB helper functions from v4l2-mcMauro Carvalho Chehab2016-02-23
| | | | | | | | | | | | | | | | | | Those ancillary functions could be called even when compiled without V4L2 support, as warned by ktest build robot: All errors (new ones prefixed by >>): >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined! >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined! >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined! Also, there's nothing there that are specific to V4L2. So, move those ancillary functions to MC core. No functional changes. Just function rename. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] use v4l2_mc_usb_media_device_init() on most USB devicesMauro Carvalho Chehab2016-02-16
| | | | | | | | | | | Except for the usbuvc driver (with has an embedded media_device struct on it), the other drivers have a pointer to media_device. On those drivers, replace their own implementation for the core one. That warrants that those subdev drivers will fill the media_device info the same way. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] tvp5150: move input definition header to dt-bindingsJavier Martinez Canillas2016-02-11
| | | | | | | | | Add a header file for the tvp5150 input connectors constants that can be shared between the driver and Device Tree source files. [mchehab@osg.samsung.com: rename tvp5150.h also at em28xx-cards.c] Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add media controller supportMauro Carvalho Chehab2016-02-01
| | | | | | | Add the needed bits to make em28xx to create a media controller graph. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: make sure that the device has videoMauro Carvalho Chehab2016-02-01
| | | | | | | | | | | There are some devices, like Terratec Cinergy HTC, where while the device supports analog TV, the driver is not capable yet of handling it, because the analog TV driver was not written. So, don't bind the em28xx-v4l drivers on such devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: fix tuner detection for Pixelview Prolink PlayTV USB 2.0Mauro Carvalho Chehab2016-02-01
| | | | | | | The tuner is at address 0x60. This address is not probed by default by tuner anymore, so we need to explicitly add it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: remove unused input typesMauro Carvalho Chehab2016-02-01
| | | | | | | | | The em28xx driver have lots of different input types but only 4 of such types are actually used. The others are bogus. Remove them, in order to cleanup the driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] Add support for dvb usb stick Hauppauge WinTV-soloHDArno Bauernöppel2015-11-19
| | | | | | | | | | | | This patch adds support for the DVB-T/C/T2 usb stick WinTV-soloHD from Hauppauge. It adds the usb ID 2040:0264 Hauppauge to the cards of the driver em28xx. I successfully tested DVB-T/C and the IR remote control with the firmware dvb-demod-si2168-b40-01.fw. Signed-off-by: Arno Bauernoeppel <arno@aziraphale.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add Terratec Cinergy T XS (MT2060)Alberto Mardegan2015-11-19
| | | | | | | | | | | | | The Terratec Cinergy T XS is a DVB-T receiver with no analog TV tuner. This patch adds support for the cards carrying the mt2060 tuner; it's unclear whether there are cards sold under the same name which use a different tuner. As long as there are no reports of such cards, and indeed as long as there are no working drivers for them, we assume that the USB device [0ccd:0043] is carrying the mt2060 tuner. Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] include/media: move driver interface headers to a separate dirMauro Carvalho Chehab2015-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's not mix headers used by the core with those headers that are needed by some driver-specific interface header. The headers used on drivers were manually moved using: mkdir include/media/drv-intf/ git mv include/media/cx2341x.h include/media/cx25840.h \ include/media/exynos-fimc.h include/media/msp3400.h \ include/media/s3c_camif.h include/media/saa7146.h \ include/media/saa7146_vv.h include/media/sh_mobile_ceu.h \ include/media/sh_mobile_csi2.h include/media/sh_vou.h \ include/media/si476x.h include/media/soc_mediabus.h \ include/media/tea575x.h include/media/drv-intf/ And the references for those headers were corrected using: MAIN_DIR="media/" PREV_DIR="media/" DIRS="drv-intf/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
* [media] include/media: split I2C headers from V4L2 coreMauro Carvalho Chehab2015-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, include/media is messy, as it contains both the V4L2 core headers and some driver-specific headers on the same place. That makes harder to identify what core headers should be documented and what headers belong to I2C drivers that are included only by bridge/main drivers that would require the functions provided by them. Let's move those i2c specific files to its own subdirectory. The files to move were produced via the following script: mkdir include/media/i2c (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done) (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done) for i in include/media/*.h; do n=`basename $i`; (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done And the references corrected via this script: MAIN_DIR="media/" PREV_DIR="media/" DIRS="i2c/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
* [media] Basic support for the Elgato EyeTV Hybrid INT 2008 USB StickGilles Risch2015-03-03
| | | | | | | | | This patch will add basic support for the Elgato EyeTV Hybrid INT 2008 USB Stick. Signed-off-by: Gilles Risch <gilles.risch@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: checkpatch cleanup: whitespaces/new lines cleanupsMauro Carvalho Chehab2014-12-04
| | | | | | | | | | | | | | | | | | | This patch is basically produced while testing a tool that Joe Perches sent upstream sometime ago: https://lkml.org/lkml/2014/7/11/794 I used it with those arguments: $ reformat_with_checkpatch.sh drivers/media/usb/em28xx/em28xx*.[ch] It actually produced 24 patches, with is too much, and showed interesting things: gcc produced different codes on most of the patches, even with just linespace changes. The total code data remained the same on all cases I checked though. Anyway, provided that we fold the resulting patches, this tool seems useful. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: Add support for Terratec Cinergy T2 Stick HDOlli Salonen2014-11-25
| | | | | | | | | | | | | | | | | | | Terratec Cinergy T2 Stick HD [eb1a:8179] is a USB DVB-T/T2/C tuner that contains following components: * Empia EM28178 USB bridge * Silicon Labs Si2168-A30 demodulator * Silicon Labs Si2146-A10 tuner I don't have the remote, so the RC_MAP is a best guess based on the pictures of the remote controllers and other supported Terratec devices with a similar remote. [Antti: Resolved conflict caused by Leadtek VC100 patch] Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: add support for Leadtek VC100 USB capture deviceWitold Krecicki2014-11-03
| | | | | | | | Leadtek VC100 is a simple USB capture stick, similar to Yakumo Movie Mixer. Signed-off-by: Witold Krecicki <wpk+lkml@culm.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* Revert "[media] media: em28xx - remove reset_resume interface"Mauro Carvalho Chehab2014-09-26
| | | | | | | | | | The reset_resume call is needed, otherwise it will break resume on some conditions, depending on the usb ehci/xhci controller. This reverts commit b89193e0b06f44f48e3bf897a5b5cb4a7aff3359. Reported-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: simplify usb audio class handlingFrank Schaefer2014-09-23
| | | | | | | | | | | | | | | As far as we know devices can either have audio class or vendor class usb interfaces but not both at the same time. Even if both interface types could be provided by devices at the same time, the current code is totally broken for that case. So clean up and simplify the usb audio class handling by replacing fields "has_audio_class" (device has usb audio class compliant interface) and "has_alsa_audio" (device has vendor audio interface) in struct em28xx with a single enum em28xx_usb_audio_type. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: check if a device has audio earlier"Frank Schaefer2014-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GIT_AUTHOR_DATE=1409603039 This reverts commit b99f0aadd33fad269c8e62b5bec8b5c012a44a56 Author: Mauro Carvalho Chehab <m.chehab@samsung.com> [media] em28xx: check if a device has audio earlier Better to split chipset detection from the audio setup. So, move the detection code to em28xx_init_dev(). It broke analog audio of the Hauppauge winTV HVR 900 and very likely many other em28xx devices. Background: The local variable has_audio in em28xx_usb_probe() describes if the currently probed _usb_interface_ has an audio endpoint, while dev->audio_mode.has_audio means that the _device_ as a whole provides analog audio. Hence it is wrong to set dev->audio_mode.has_audio = has_audio in em28xx_usb_probe(). As result, audio support is no longer detected and configured on devices which have the audio endpoint on a separate interface, because em28xx_audio_setup() bails out immediately at the beginning. Revert the faulty commit to restore the old audio detection procedure, which checks the chip configuration register to determine if the device has analog audio. Cc: <stable@vger.kernel.org> # 3.14 to 3.16 Reported-by: Oravecz Csaba <oravecz@nytud.mta.hu> Tested-by: Oravecz Csaba <oravecz@nytud.mta.hu> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] em28xx: fix sparse warningsHans Verkuil2014-09-03
| | | | | | | | drivers/media/usb/em28xx/em28xx-core.c:297:16: warning: cast to restricted __le16 drivers/media/usb/em28xx/em28xx-cards.c:2249:20: warning: symbol 'em28xx_bcount' was not declared. Should it be static? Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] media: em28xx - remove reset_resume interfaceShuah Khan2014-07-26
| | | | | | | | | | | | | em28xx uses resume interface as its reset_resume interface. If usb device is reset during suspend, reset_resume doesn't do the necessary initialization which leads to resume failure. Many systems don't maintain do not maintain suspend current to the USB host controllers during hibernation. Remove reset_resume to allow disconnect to be called followed by device restore sequence. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: add MSI Digivox Trio supportHans Verkuil2014-07-04
| | | | | | | | Add support for the MSI Digivox Trio device. Signed-off-by: P. van Gaans <w3ird_n3rd@gmx.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: remove field tuner_addr from struct em28xxFrank Schaefer2014-05-23
| | | | | | | | | The tuner address is only used by the v4l submodule and at tuner setup and can be obtained from the board data directly (if specified). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: remove field tda9887_conf from struct em28xxFrank Schaefer2014-05-23
| | | | | | | | | | | | | | The tda9887 chipset is part of the analog tuner. Move it out of em28xx-cards. Also, it is used only one time by the v4l2 sub-module at tuner setup. With that, we can get rid of an additional data inside the em28xx common structure. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: move progressive/interlaced fields from struct em28xx to ↵Frank Schaefer2014-05-23
| | | | | | | | | | | struct v4l2 The video progressive data fields belong to analog TV. Move them out of the common em28xx struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: move videobuf2 related data from struct em28xx to struct v4l2Frank Schaefer2014-05-23
| | | | | | | | | | The video and VBI-specific VB2 queue and mutexes are used only by the v4l2 sub-driver. Move them to the V4L2 struct, preventing wasting memory if this sub-driver is not used. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: fix indenting in em28xx_usb_probe()Frank Schaefer2014-05-23
| | | | | | | | No functional changes. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: add [2013:025f] PCTV tripleStick (292e)Antti Palosaari2014-04-23
| | | | | | | Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx-cards: remove a wrong indent levelDan Carpenter2014-03-11
| | | | | | | | | This code is correct but the indenting is wrong and triggers a static checker warning "add curly braces?". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: Only deallocate struct em28xx after finishing all extensionsMauro Carvalho Chehab2014-03-11
| | | | | | | | | | | We can't free struct em28xx while one of the extensions is still using it. So, add a kref() to control it, freeing it only after the extensions fini calls. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: only enable PCTV 80e led when streamingMauro Carvalho Chehab2014-03-11
| | | | | | | Instead of keeping the led always on, use it to indicate when DVB is streaming. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] em28xx: Add LED support for Kworld UB435-Q v3Mauro Carvalho Chehab2014-03-04
| | | | | | | | | This device has a led at bit 7 of GPIO reg. 0x80 to indicate when a DVB capture is happening. Add support for it. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>