summaryrefslogtreecommitdiff
path: root/drivers/media/usb
AgeCommit message (Collapse)AuthorFilesLines
2014-09-10upstream media: fix: au0828 call dvb core suspendMauro Carvalho Chehab1-21/+26
Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=66cae53024c4 Upstream Author: Shuah Khan <shuah.kh@samsung.com> Original subject: [media] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume au0828 doesn't resume correctly and TV tuning fails with xc_set_signal_source(0) failed message. Change au0828 dvb suspend and resume interfaces to suspend and resume frontend during suspend and resume respectively. dvb_frontend_suspend() suspends tuner and fe using tuner and fe ops. dvb_frontend_resume() resumes fe and tuner using fe and tuner ops ini before waking up the frontend. With this change HVR950Q suspend and resume work when system gets suspended when digital function is tuned to a channel and with active TV stream, and after resume it went right back to active TV stream. Change-Id: I84820422af70bea19cefe6d24f0f9bff5756637d Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03media: fix kernel deadlock due to tuner pull-out while playingChangbing Xiong1-1/+1
Normally, ADAP_STREAMING bit is set in dvb_usb_start_feed and cleared in dvb_usb_stop_feed. But in exceptional cases, for example, when the tv is playing programs and the tuner is pulled out, then dvb_usbv2_disconnect is called. In such case, it will first call dvb_usbv2_adapter_frontend_exit to stop dvb_frontend_thread, and then call dvb_usbv2_adapter_dvb_exit to clear ADAP_STREAMING bit. At this point, if dvb_frontend_thread is sleeping and waiting for ADAP_STREAMING to be cleared to get out of sleep. then dvb_frontend_thread can never be stoped, because clearing ADAP_STREAMING bit is performed after dvb_frontend_thread is stopped (i.e. performed in dvb_usbv2_adapter_dvb_exit). So, deadlock: [ 240.822037] INFO: task khubd:497 blocked for more than 120 seconds. [ 240.822655] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 240.830493] khubd D c0013b3c 0 497 2 0x00000000 [ 240.836996] [<c0013b3c>] (__schedule+0x200/0x54c) from [<c00110f4>] (schedule_timeout+0x14c/0x19c) [ 240.845940] [<c00110f4>] (schedule_timeout+0x14c/0x19c) from [<c00137f4>] (wait_for_common+0xac/0x150) [ 240.855234] [<c00137f4>] (wait_for_common+0xac/0x150) from [<c004989c>] (kthread_stop+0x58/0x90) [ 240.864004] [<c004989c>] (kthread_stop+0x58/0x90) from [<c03b2ebc>] (dvb_frontend_stop+0x3c/0x9c) [ 240.872849] [<c03b2ebc>] (dvb_frontend_stop+0x3c/0x9c) from [<c03b2f3c>] (dvb_unregister_frontend+0x20/0xd8) [ 240.882666] [<c03b2f3c>] (dvb_unregister_frontend+0x20/0xd8) from [<c03ed938>] (dvb_usbv2_exit+0x68/0xfc) [ 240.892204] [<c03ed938>] (dvb_usbv2_exit+0x68/0xfc) from [<c03eda18>] (dvb_usbv2_disconnect+0x4c/0x70) [ 240.901499] [<c03eda18>] (dvb_usbv2_disconnect+0x4c/0x70) from [<c031c050>] (usb_unbind_interface+0x58/0x188) [ 240.911395] [<c031c050>] (usb_unbind_interface+0x58/0x188) from [<c02c3e78>] (__device_release_driver+0x74/0xd0) [ 240.921544] [<c02c3e78>] (__device_release_driver+0x74/0xd0) from [<c02c3ef0>] (device_release_driver+0x1c/0x28) [ 240.931697] [<c02c3ef0>] (device_release_driver+0x1c/0x28) from [<c02c39b8>] (bus_remove_device+0xc4/0xe4) [ 240.941332] [<c02c39b8>] (bus_remove_device+0xc4/0xe4) from [<c02c1344>] (device_del+0xf4/0x178) [ 240.950106] [<c02c1344>] (device_del+0xf4/0x178) from [<c0319eb0>] (usb_disable_device+0xa0/0x1c8) [ 240.959040] [<c0319eb0>] (usb_disable_device+0xa0/0x1c8) from [<c03128b4>] (usb_disconnect+0x88/0x188) [ 240.968326] [<c03128b4>] (usb_disconnect+0x88/0x188) from [<c0313edc>] (hub_thread+0x4d0/0x1200) [ 240.977100] [<c0313edc>] (hub_thread+0x4d0/0x1200) from [<c0049690>] (kthread+0xa4/0xb0) [ 240.985174] [<c0049690>] (kthread+0xa4/0xb0) from [<c0009118>] (ret_from_fork+0x14/0x3c) [ 240.993259] INFO: task kdvb-ad-0-fe-0:3256 blocked for more than 120 seconds. [ 241.000349] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 241.008162] kdvb-ad-0-fe-0 D c0013b3c 0 3256 2 0x00000000 [ 241.014507] [<c0013b3c>] (__schedule+0x200/0x54c) from [<c03eda44>] (wait_schedule+0x8/0x10) [ 241.022924] [<c03eda44>] (wait_schedule+0x8/0x10) from [<c001120c>] (__wait_on_bit+0x74/0xb8) [ 241.031434] [<c001120c>] (__wait_on_bit+0x74/0xb8) from [<c00112b8>] (out_of_line_wait_on_bit+0x68/0x70) [ 241.040902] [<c00112b8>] (out_of_line_wait_on_bit+0x68/0x70) from [<c03e5e88>] (dvb_usb_fe_sleep+0xf4/0xfc) [ 241.050618] [<c03e5e88>] (dvb_usb_fe_sleep+0xf4/0xfc) from [<c03b4b74>] (dvb_frontend_thread+0x124/0x4e8) [ 241.060164] [<c03b4b74>] (dvb_frontend_thread+0x124/0x4e8) from [<c0049690>] (kthread+0xa4/0xb0) [ 241.068929] [<c0049690>] (kthread+0xa4/0xb0) from [<c0009118>] (ret_from_fork+0x14/0x3c) Fix it by calling dvb_usbv2_adapter_frontend_exit() latter. Test enviroment: odroidx2 + Hauppauge(WinTV-Aero-M) Change-Id: Ia7ccc816a36f3aaa398fee928d17609fc778a4ee Signed-off-by: Changbing Xiong <cb.xiong@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-18au0828: workaround i2c clock speed for DViCO FusionHDTV7Joonyoung Shim1-1/+1
The DViCO FusionHDTV7 usb tuner stick is not working after commit cfd0c77d0830d33288e9da17aa10db3a61de601a(au0828: improve I2C speed). This will use always 20kHz for i2c and workaround until fixed from au0828 codes. [ 28.350841] xc5000: Can't request Self-callibration. - retrying to upload firmware. [ 32.345838] xc5000: Can't request Self-callibration. - retrying to upload firmware. [ 36.325840] xc5000: Can't request Self-callibration. - retrying to upload firmware. [ 40.300846] xc5000: Can't request Self-callibration. - retrying to upload firmware. [ 44.270848] xc5000: Can't request Self-callibration. - too many retries. Giving up [ 44.272778] xc5000: Unable to initialise tuner [ 45.385845] xc5000: xc_set_signal_source(0) failed [ 47.305850] xc5000: xc_set_signal_source(0) failed Change-Id: I0099cc0061e0e3a236570d43d3f4f63ebc4d6d49 Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
2014-08-09au0828: Fix DVB resume when streamingMauro Carvalho Chehab2-7/+11
When DVB is streaming and suspend is called, it will call au0828_stop_transport(), with will clean the streaming flag. Due to that, stop_urb_transfer() will be called twice, causing an oops. So, we need another flag to be used at resume, telling it to restart DVB. While here, add a logic at stop_urb_transfer() to prevent it of being called twice, and convert the usb_streaming flag into boolean. Change-Id: I69a1096d1fae3230675ed5f452d2afdde793548b Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09au0828: fix checks if dvb is initializedMauro Carvalho Chehab1-6/+6
dev->dvb is always not null, as it is an area at the dev memory. So, checking if (dev->dvb) is always true. Instead of this stupid check, what the code wants to do is to know if the DVB was successully registered. Fix it by checking, instead, for dvb->frontend. It should also be sure that this var will be NULL if the device was not properly initialized. Change-Id: I714b87027e254d34c0448ecb9a673ce1bd9e9e32 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: add pr_info to track au0828 suspend/resume codeMauro Carvalho Chehab4-0/+17
Suspend/resume conditions can be very tricky. Add some info printk's to help tracking what's happening there. Change-Id: Ie4c2d905c501727736789bbe3bb5351a82163b7f Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: use pr_foo macrosMauro Carvalho Chehab8-75/+72
Instead of using printk(KERN_foo, use pr_foo() macros. No functional changes. Note: we should do the same for dprintk(), but that would require to remove the dprintk levels. So, for now, let's not touch on it. Change-Id: I08f9e5b09f9a86766d20c5a76ffce273da2b7c9c Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: Remove a bad whitespaceMauro Carvalho Chehab2-1/+1
Change-Id: I34d0ed4046b185ddd055cb5bb72c8ebd22bd65e9 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: add suspend/resume code for V4L2Mauro Carvalho Chehab3-1/+67
No timers should be enabled during suspend. So, stop them. At resume time, we should do the proper initialization for it to keep working. Change-Id: Ia7edbf78f685e54559d039cf1e77a5b236020abb Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: properly handle stream on/off stateMauro Carvalho Chehab1-0/+3
The STREAM_ON state is used by s_format callback, but the driver never sets it. Fix it. This will also be needed in order to handle suspend/resume ops. Change-Id: I73a5bf3d65acf7684814a056cde3db87030698b6 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: Add suspend code for DVBMauro Carvalho Chehab3-1/+34
The scheduled work should be cancelled during suspend. At resume time, we need to set the frontend again. So, add such logic to the driver. Change-Id: I5766af53a9d684200c1a79d54eea14bc7786bfc3 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09au0828: be sure to reenable the bridge and GPIOs on resumeMauro Carvalho Chehab1-0/+6
At resume, we should restore the register contents. So, reenable the bridge and GPIO settings. Change-Id: Ie4476799c75eac1e729c50b829c62a1f28eaff8a Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: don't let the IR polling thread to run at suspendMauro Carvalho Chehab1-2/+31
Trying to make au0828 to suspend can do very bad things, as the polling Kthread is not handled. We should disable it during suspend, only re-enabling it at resume. Still, analog and digital TV won't work, as we don't reinit the settings at resume, but at least it won't hang. Change-Id: I71fab1b56df5b1a32a75cda98bebf3da1dfda11b Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: remove VIDEO_AU0828_RC scope around au0828_rc_*Shuah Khan1-4/+0
Remove CONFIG_VIDEO_AU0828_RC scope around au0828_rc_register() and au0828_rc_unregister() calls in au0828-core Change-Id: I9431dffe542e5ffd625ead27fe448d6a848fd720 Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: add au0828_rc_*() for VIDEO_AU0828_RC disabledShuah Khan1-4/+11
Define au0828_rc_*() stubs to avoid compile errors when VIDEO_AU0828_RC is disabled and avoid the need to enclose au0828_rc_*() in ifdef CONFIG_VIDEO_AU0828_RC in .c files. Change-Id: I0fcea137225fd6941a6e4fddcac4862a78f636ec Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: handle IR int during suspend/resumeMauro Carvalho Chehab1-0/+6
It doesn't make sense to handle an IR code given before suspending after the device resume. So, turn off IR int while suspending. Change-Id: I2c5fa1af97e631ab5f38dd0afc8353482e0c1aa8 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09[media] au0828: avoid race conditions at RC stopMauro Carvalho Chehab1-2/+2
As the RC kthread can re-enable IR int, we should first cancel the kthread and then disable IR int. While here, remove a temporary debug printk. Change-Id: I36ab0a218c0f88c39b023e7bd0eed7b7bdbc2d0c Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-09upstream: au0828-input: Be sure that IR is enabled at pollingMauro Carvalho Chehab1-2/+10
When the DVB code sets the frontend, it disables the IR INT, probably due to some hardware bug, as there's no code there at au8522 frontend that writes on register 0xe0. Fixing it at au8522 code is hard, as it doesn't know if the IR is enabled or disabled, and just restoring the value of register 0xe0 could cause other nasty effects. So, better to add a hack at au0828-input polling interval to enable int, if disabled. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=a623ff64e71e Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Change-Id: Ie75c8e04ddefb0ab5571a5721204e79ed92de1f1
2014-08-09upstream: [media] au0828: Enable IR for HVR-850Mauro Carvalho Chehab1-0/+1
HVR-850 also has a remote. Enable it. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=c87a627b4a23 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Change-Id: I9aac2bb9d2e3aa12143583f2b3d13ed036817de8
2014-08-09upstream: au0828: add an option to disable IR via modprobe parmMauro Carvalho Chehab1-1/+5
The IR code increases the power consumption of the device. Allow to disable it via modprobe parameter. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=ca97cf053296 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Change-Id: I4a791fd762b77947c04cbac52d7b74b67749efdb
2014-08-09upstream: [media] au0828: no need to sleep at the IR codeMauro Carvalho Chehab1-2/+0
This sleep was doing some debouncing on the original driver. This is not needed on Linux, because the RC core and the input layer already takes care of it. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=8cf3799c5c7c Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Change-Id: Ic6e4a1cf2c585ed4ff551f1ed8061de23e385864
2014-08-08upstream: [media] au0828: add support for IR on HVR-950QMauro Carvalho Chehab6-4/+430
HVR-950Q uses an I2C remote controller at address 0x47 (7-bits notation). Add support for it. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=2fcfd317f66c Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: improve I2C speedMauro Carvalho Chehab2-16/+27
Commits 21dc61d3c0a4 and 7a1dd50b89d4 reduced the board I2C speed to 20 MHz by default, due to a I2C stretch issue: while xc5000 uses i2c stretch when a command is sent to it, au0828 doesn't support this feature. However, this is needed only for Xceive tuners. The other I2C devices can work at the max speed. So, revert the workarounds at board level, handling it at I2C level, only when talking with xc5000. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=cfd0c77d0830 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib0700: better document struct initMauro Carvalho Chehab1-67/+81
Instead of using anonymous initialization for dib0896 structs, identify each field by name. That helps to understand what's being initialized. No functional changes. Acked-By: Patrick Boettcher <pboettcher@kernellabs.com> Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=40d1a7c3ded0 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: don't hardcode height/widthMauro Carvalho Chehab1-7/+13
While this device doesn't have a scaler (or have it disabled), the screen dimentions are a function of the standard. Ok, right now, only 480 lines standards are implemented, although it supports other ones. Yet, let's calculate the size, to make easier to add more standards latter. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=1fe3a8fe4944 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: Only alt setting logic when neededMauro Carvalho Chehab1-17/+17
It seems that there's a bug at au0828 hardware/firmware related to alternate setting: when the device is already at alt 5, a further call causes the URBs to receive -ESHUTDOWN. I found two different encarnations of this issue: 1) at qv4l2, it fails the second time we try to open the video screen; 2) at xawtv, when audio underrun occurs, with is very frequent, at least on my test machine. The fix is simple: just check if alt=5 before calling set_usb_interface(). Cc: stable@vger.kernel.org Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=64ea37bbd8a5 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828/au8522: Add PAL-M supportMauro Carvalho Chehab1-4/+6
Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=f2fd7ce6f2db Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: add missing tuner Kconfig dependencyMauro Carvalho Chehab1-0/+1
The analog part of au0828 is missing the tuner Kconfig dependency. That makes the device to not work while in analog mode. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=0bf49ec9f7e2 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib8000: export just one symbolMauro Carvalho Chehab1-46/+92
Exporting multiple symbols don't work as it causes compilation breakages, due to the way dvb_attach() works. The bug happens when: CONFIG_DVB_DIB8000=m CONFIG_DVB_USB_DIB0700=y As a bonus, dib8000 won't be loaded anymore if the device uses a different frontend, reducing the memory footprint. Tested with both Pixelview PV-D231 and MyGica S870. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=d44913c1e547 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib8000: rename dib8000_attach to dib8000_initMauro Carvalho Chehab1-7/+7
Well, what we call as "foo_attach" is the method that should be called by the dvb_attach() macro. It should be noticed that the name "dvb_attach" is really a bad name and don't express what it does. dvb_attach() basically does three things, if the frontend is compiled as a module: - It lookups for the module that it is known to have the given symbol name and requests such module; - It increments the module usage (anonymously - so lsmod doesn't print who loaded the module); - after loading the module, it runs the function associated with the dynamic symbol. When compiled as builtin, it just calls the function given to it. As dvb_attach() increments refcount, it can't be (easily) called more than once for the same module, or the kernel will deny to remove the module, because refcount will never be zeroed. In other words, the function name given to dvb_attach() should be one single symbol that will always be called before any other function on that module to be used. For almost all DVB frontends, there's just one function, but, on dib8000, there are several exported symbols. We need to get rid of all those direct calls, because they cause compilation breakages when bridge is builtin and frontend is module, we'll need to add a new function that will be the first one to be called, whatever initialization is needed. So, let's rename this function, in order to prepare for a next patch that will add a new attach() function that will be the only one exported by this module. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=b9bc7d59b725 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib7000: export just one symbolMauro Carvalho Chehab2-122/+243
Exporting multiple symbols don't work as it causes compilation breakages, due to the way dvb_attach() works. This were reported several times, like: drivers/built-in.o: In function `cxusb_dualdig4_rev2_tuner_attach': >> cxusb.c:(.text+0x27d4b5): undefined reference to `dib7000p_get_i2c_master' drivers/built-in.o: In function `dib7070_set_param_override': cxusb.c:(.text+0x27d5a5): undefined reference to `dib0070_wbd_offset' >> cxusb.c:(.text+0x27d5be): undefined reference to `dib7000p_set_wbd_ref' drivers/built-in.o: In function `dib7070_tuner_reset': >> cxusb.c:(.text+0x27d5f9): undefined reference to `dib7000p_set_gpio' drivers/built-in.o: In function `cxusb_dualdig4_rev2_frontend_attach': >> cxusb.c:(.text+0x27df5c): undefined reference to `dib7000p_i2c_enumeration' In this specific report: CONFIG_DVB_USB_CXUSB=y CONFIG_DVB_DIB7000P=m But the same type of bug can happen if: CONFIG_DVB_DIB7000P=m and one of the bridge drivers is compiled builtin (cxusb, cx23885-dvb and/or dib0700). As a bonus, dib7000p won't be loaded anymore if the device uses a different frontend, reducing the memory footprint. Tested with Hauppauge Nova-TD (2 frontends). Reported-by: Fengguang Wu <fengguang.wu@intel.com> Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=8abe4a0a3f6d Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib7000p: rename dib7000p_attach to dib7000p_initMauro Carvalho Chehab2-15/+15
Well, what we call as "foo_attach" is the method that should be called by the dvb_attach() macro. It should be noticed that the name "dvb_attach" is really a bad name and don't express what it does. dvb_attach() basically does three things, if the frontend is compiled as a module: - It lookups for the module that it is known to have the given symbol name and requests such module; - It increments the module usage (anonymously - so lsmod doesn't print who loaded the module); - after loading the module, it runs the function associated with the dynamic symbol. When compiled as builtin, it just calls the function given to it. As dvb_attach() increments refcount, it can't be (easily) called more than once for the same module, or the kernel will deny to remove the module, because refcount will never be zeroed. In other words, the function name given to dvb_attach() should be one single symbol that will always be called before any other function on that module to be used. For almost all DVB frontends, there's just one function. However, the dib7000p initialization can require up to 3 functions to be called: - dib7000p_get_i2c_master; - dib7000p_i2c_enumeration; - dib7000p_init (before this patch dib7000_attach). (plus a bunch of other functions that the bridge driver will need to call). As we need to get rid of all those direct calls, because they cause compilation breakages when bridge is builtin and frontend is module, we'll need to add a new function that will be the first one to be called, whatever initialization is needed. So, let's rename the function that probes and init the hardware to dib7000p_init. A latter patch will add a new dib7000p_attach that will be used as originally conceived by dvb_attach() way. Backports http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=7f67d96ab181 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: reset streaming when a new frequency is setMauro Carvalho Chehab2-2/+43
As reported by Trevor, doing several opening/streaming/closing operations to the demux causes it to fail. I was able to simulate this bug too. I also noticed that, sometimes, changing channels with au0828, the same thing happens. Most of the issues seem to be due to some hardware bug, that causes the device to not fill all the URBs allocated. When the bug happens, the only known fix is to either replug the device, or to send an USB reset to it. There's also a hack a the au0828 driver that starts a thread that tries to reset the device when a package doesn't start with a sync. One of the culpits for this bad hardware behavior seem to be caused by the lack of stopping and restarting the stream every time a new channel is set. This patch warrants that the stream will be properly reset every time the set_frontend callback is called, partially solving the problem. A complete fix, however, would also need to check the PM conditions for the tuner and demux. Reported-by: Trevor Graffa <tlgraffa@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] au0828: Improve debug messages for urb_completionMauro Carvalho Chehab1-4/+8
Sometimes, it helps to know how much data was received by urb_completion. Add that information to the optional debug log. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] dib0700: fix RC support on Hauppauge Nova-TDMauro Carvalho Chehab3-9/+38
The RC support o Nova-TD is broken, as the RC endpoint there is an interrupt endpoint. That produces an ugly calltrace at the Kernel logs: WARNING: CPU: 2 PID: 56 at drivers/usb/core/urb.c:450 usb_submit_urb+0x1fd/0x5c0() usb 1-1.2: BOGUS urb xfer, pipe 3 != type 1 Modules linked in: rc_dib0700_rc5(OF) dvb_usb_dib0700(OF) dib9000(OF) dib8000(OF) dib7000m(OF) dib0090(OF) dib0070(OF) dib7000p(OF) dib3000mc(OF) dibx000_common(OF) dvb_usb(OF) rc_core(OF) snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi snd_seq snd_seq_device snd_pcm snd_timer snd soundcore bnep bluetooth 6lowpan_iphc rfkill au0828(OF) xc5000(OF) au8522_dig(OF) au8522_common(OF) tveeprom(OF) dvb_core(OF) nouveau i915 mxm_wmi ttm i2c_algo_bit drm_kms_helper drm r8169 mii i2c_core video wmi [last unloaded: au0828] CPU: 2 PID: 56 Comm: khubd Tainted: GF O 3.14.2-200.fc20.x86_64 #1 Hardware name: SAMSUNG ELECTRONICS CO., LTD. 550P5C/550P7C/SAMSUNG_NP1234567890, BIOS P05ABI.016.130917.dg 09/17/2013 0000000000000000 00000000610866bc ffff880223703860 ffffffff816eec92 ffff8802237038a8 ffff880223703898 ffffffff8108a1bd ffff8800916a2180 ffff8801d5b16000 0000000000000003 0000000000000003 0000000000000020 Call Trace: [<ffffffff816eec92>] dump_stack+0x45/0x56 [<ffffffff8108a1bd>] warn_slowpath_common+0x7d/0xa0 [<ffffffff8108a23c>] warn_slowpath_fmt+0x5c/0x80 [<ffffffff814e3ebd>] usb_submit_urb+0x1fd/0x5c0 [<ffffffffa0445925>] dib0700_rc_setup+0xb5/0x120 [dvb_usb_dib0700] [<ffffffffa0445a58>] dib0700_probe+0xc8/0x130 [dvb_usb_dib0700] ... Fix it by detecting if the endpoint is bulk or interrupt. Tested with both Hauppauge Nova-TD model 52009 (interrupt) and with a Prolink Pixelview SBTVD model PV-D231U (bulk). Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] az6027: Added the PID for a new revision of the Elgato ↵Manuel Schönlaub1-1/+6
EyeTV Sat DVB-S Tuner There is another clone of AZ6027. This patch adds the relevant PID. Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart9-14/+14
The g_std and s_std operations are video-related, move them to the video ops where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Conflicts: include/media/v4l2-subdev.h
2014-08-08upstream: [media] technisat-usb2: rename led enums to be specific to driverLuis R. Rodriguez1-14/+14
The current names clash with include/linux/leds.h namespace, although there is no compile issue currently this does affect backports. Drivers should also try to avoid generic namespaces for things like this. Cc: Felipe Pena <felipensp@gmail.com> Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] em28xx: make em28xx_free_v4l2 static()Mauro Carvalho Chehab1-1/+1
Changeset 95d2608b88 created this function, but declared it as global, by mistake. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-08upstream: [media] em28xx: move fields wq_trigger and streaming_started from ↵Frank Schaefer2-22/+25
struct em28xx to struct em28xx_audio Both wq_trigger and stream_started are used only to control the em28xx alsa streaming. They don't belong to em28xx common 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>
2014-08-08upstream: [media] em28xx: remove field tuner_addr from struct em28xxFrank Schaefer3-12/+8
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>
2014-08-08upstream: [media] em28xx: remove field tda9887_conf from struct em28xxFrank Schaefer3-7/+3
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>
2014-08-08upstream: [media] em28xx: move tuner frequency field from struct em28xx to ↵Frank Schaefer2-8/+11
struct v4l2 Move V4L2-specific frequency cache to struct em28xx_v4l2. 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>
2014-08-08upstream: [media] em28xx: move v4l2 user counting fields from struct em28xx ↵Frank Schaefer2-14/+18
to struct v4l2 Despite being at the common em28xx struct, those two fields are actually taking into account only the usage inside em28xx v4l2 submodule. So, move them out of the common 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>
2014-08-08upstream: [media] em28xx: move capture state tracking fields from struct ↵Frank Schaefer2-28/+29
em28xx to struct v4l2 Move some temporary capture tracking date to the em28xx_v4l2 struct, as those info are used only by em28xx v4l2 submodule. 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>
2014-08-08upstream: [media] em28xx: move sensor parameter fields from struct em28xx to ↵Frank Schaefer3-16/+20
struct v4l2 Move camera sensor resolution and xtal out of em28xx common struct, as thore are used only by the em28xx v4l2 submodule. 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>
2014-08-08upstream: [media] em28xx: move progressive/interlaced fields from struct ↵Frank Schaefer3-17/+22
em28xx to 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>
2014-08-08upstream: [media] em28xx: move struct em28xx_fmt *format from struct em28xx ↵Frank Schaefer2-9/+8
to struct v4l2 The analog format struct belongs to analog TV. Move it 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>
2014-08-08upstream: [media] em28xx: move TV norm from struct em28xx to struct v4l2Frank Schaefer2-17/+21
TV norm is specific to analog TV reception. move it 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>
2014-08-08upstream: [media] em28xx: move vinmode and vinctrl data from struct em28xx ↵Frank Schaefer3-16/+16
to struct v4l2 The video input mode and control data also belong only to the analog side. move them to struct em28xx_v4l. 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>