summaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners/xc5000.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] xc5000: use after free in release()Dan Carpenter2014-10-241-1/+1
| | | | | | | | | | | | I moved the call to hybrid_tuner_release_state(priv) after "priv->firmware" dereference. Fixes: 5264a522a597 ('[media] media: tuner xc5000 - release firmwware from xc5000_release()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: tuner xc5000 - try to avoid firmware load in resume pathShuah Khan2014-09-231-1/+15
| | | | | | | | | | | | | xc5000 doesn't load firmware at attach time instead loads it when it needs to set and change configuration from its init, frequency, digital and analog mode set interffaces. As a result, when system is suspended before firmware is loaded, firmware load can be avoided during resume. Loading formware in this scenario results in slowpath warnings during resume as it won't be in the suspend firmware cache. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: tuner xc5000 - release firmwware from xc5000_release()Shuah Khan2014-09-231-14/+20
| | | | | | | | | | | xc5000 releases firmware right after loading it. Change it to save the firmware and release it from xc5000_release(). This helps avoid fecthing firmware when forced firmware load requests come in to change analog tv frequence and when firmware needs to be reloaded after suspend and resume. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] xc5000: be sure that the firmware is there before set paramsMauro Carvalho Chehab2014-08-211-5/+5
| | | | | | | | | | Now that xc5000_set_params() is also called during resume, move the code that checks for the firmware to happen there. This way, the firmware will be loaded either for analog or digital TV when .resume callback is called. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: better name the functionsMauro Carvalho Chehab2014-08-211-5/+5
| | | | | | | | | | | xc5000_set_params() is a bad name for a function that handles only digital TV. Rename it to xc5000_set_digital_params(), and proper name the generic function that works for both digital and analog. No functional changes. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: add a resume functionMauro Carvalho Chehab2014-08-211-0/+1
| | | | | | | If a device suspends/hibertates with a station tuned, restore the tuner station at resume. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: Split config and set code for analog/radioMauro Carvalho Chehab2014-08-211-25/+56
| | | | | | | | | | | As we need a function that reapply the last tuned radio, in order to do resume, split the code that validates and updates the internal priv struct from the ones that actually set radio and TV. A latter patch will add support for resume. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] au0828: move the code that sets DTV on a separate functionMauro Carvalho Chehab2014-08-211-34/+45
| | | | | | | | | | As we'll be adding a code to resume tuner operation, we need to move the code that actually sets DTV on a separate function, to be called by the resume code. No functional changes, just code got moved. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: fix xc5000 suspendMauro Carvalho Chehab2014-08-211-0/+19
| | | | | | | | | | After xc5000 stops working, it waits for 5 seconds, waiting for a new usage. Only after that it goes to low power mode. If a suspend event happens before that, a work queue will remain active, with causes suspend to crash. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: always write at dmesg when it fails to upload firmwareMauro Carvalho Chehab2014-07-301-13/+27
| | | | | | | | On a normal condition, no errors should happen at xc5000 firmware upload is done. So, print at the dmesg if something bad happens. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: optimize firmware retry logicMauro Carvalho Chehab2014-07-301-35/+38
| | | | | | | | | | | | Currently, firmware retry logic keeps reading from FS every time during the retry logic. This is not needed. Instead, only release the firmware read after success. While here, make the non-debug messages less verbose, as it only matters to the user if the firmware was successfully loaded, or if some error happened. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: Don't try forever to load the firmwareMauro Carvalho Chehab2014-07-301-19/+21
| | | | | | | | | | With the current code, if something bad happens during the firmware init process, the device will keep trying forever, and removing it would cause an OOPS. Instead, try only a limited amount of time. If not, fails. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: Fix get_frequency()Mauro Carvalho Chehab2014-07-221-10/+12
| | | | | | | | | The programmed frequency on xc5000 is not the middle frequency, but the initial frequency on the bandwidth range. However, the DVB API works with the middle frequency. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: remove unnecessary break after gotoFabian Frederick2014-07-221-1/+0
| | | | | Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: delay tuner sleep to 5 secondsMauro Carvalho Chehab2014-05-251-9/+34
| | | | | | | | | | Some drivers, like au0828 are very sensitive to tuner sleep and may break if the sleep happens too fast. Also, by keeping the tuner alive for a while could speedup tuning process during channel scan. So, change the logic to delay the actual sleep to 5 seconds after its command. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: Don't use whitespace before tabsMauro Carvalho Chehab2014-05-251-5/+5
| | | | | | | | | | | | | | | | | | | WARNING: please, no space before tabs +#define XC_PRODUCT_ID_FW_LOADED ^I0x1388$ WARNING: please, no space before tabs +#define DK_SECAM_A2LDK3 ^I13$ WARNING: please, no space before tabs +#define DK_SECAM_A2MONO ^I14$ WARNING: please, no space before tabs +#define FM_RADIO_INPUT2 ^I21$ WARNING: please, no space before tabs +#define FM_RADIO_INPUT1 ^I22$ Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: fix CamelCaseMauro Carvalho Chehab2014-05-251-69/+69
| | | | | | | | There are several CamelCase non-codingstyle compliances here. Fix them. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: Don't wrap msleep()Mauro Carvalho Chehab2014-05-251-10/+5
| | | | | | | | There's absolutely no reason to wrap msleep() call here. Just rename all occurences of xc_wait() with msleep() and remove the wrapper function. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: get rid of positive error codesMauro Carvalho Chehab2014-05-251-56/+48
| | | | | | | Errors should also be negative and should follow the Kernel standards. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] xc5000: fix incorrect debug printnkDmitri Belimov2013-03-211-7/+13
| | | | | | | | | | | | | | | | I found very small bug in xc5000 source. When set option debug=1 and listen a radio we see in dmesg xc5000: xc_SetTVStandard() Standard = M/N-NTSC/PAL-BTSC at all times. However, it should be, instead "FM Radio-INPUT1_MONO". That happens because xc5000_set_radio_freq() gets the correct value for VideoMode and AudioMode for radio and calls xc_SetTVStandard() where name of standard comes from the incorrect place priv->video_standard. This incorrect debug message makes debugging a little difficult. Signed-off-by: Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()Dan Carpenter2013-02-051-0/+1
| | | | | | | | There is a missing break so we use XC_RF_MODE_CABLE instead of XC_RF_MODE_AIR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] common: move media/common/tuners to media/tunersMauro Carvalho Chehab2012-08-131-0/+1366
Move the tuners one level up, as the "common" directory will be used by drivers that are shared between more than one driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
OpenPOWER on IntegriCloud