summaryrefslogtreecommitdiffstats
path: root/drivers/staging/easycap/easycap_main.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: Move media drivers to staging/mediaMauro Carvalho Chehab2011-11-031-4253/+0Star
| | | | | | | | | | | | In practice, it is being hard to distinguish when a patch should go to staging tree or to the media tree. Better to distinguish it, by putting the media drivers at a separate staging directory. Newer staging drivers that include anything with "dvb*.h", "v4l2*.h" or "videodev2.h" should go to the drivers/staging/media tree. Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* staging/easycap: kill timeval members of easycap structTomas Winkler2011-10-181-48/+0Star
| | | | | | | | timeval[0-9] were not used or used in a ready only code so we can remove them safely and so the code Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* easycap: fix ntsc module parameter descriptionThomas Petazzoni2011-10-111-1/+1
| | | | | | | Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: fix mismatch in easycap_poll() mutex lock-unlockAlexey Khoroshilov2011-08-291-1/+3
| | | | | | | | | | | | In case if condition (kd != isdongle(peasycap)) becomes true, easycap_poll() returns without releasing easycapdc60_dongle[kd].mutex_video. The patch adds mutex_unlock() before that return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: remove oss supportTomas Winkler2011-07-081-66/+1Star
| | | | | | | | | | | | | | | remove support for OSS. OSS is being deprecated and it is just plain headache to support both alsa and oss. Last I broke the compilation when OSS is enabled with the patch cdaa898b5efcc598ab1004e8f913061dc7005091 staging/easycap: kill telltale logic so this fixes also that issue. Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: kill telltale logicTomas Winkler2011-07-061-81/+3Star
| | | | | | | | | | | | | | | This reason for this feature was 'some versions of the videodev module overwrite the data which has been written by the call to usb_set_intfdata() in easycap_usb_probe(), replacing it with a pointer to the embedded v4l2_device structure. to detect this, the string in the easycap.telltale[] buffer is checked.' The upstream version of v4l2_device_register sets driver data only when it wasn't already set, therefore this is not needed Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: easycap: use after free in easycap_delete()Dan Carpenter2011-07-051-2/+3
| | | | | | | | | The JOM() macro dereferences peasycap, so I moved the free down some lines. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_probe: drop more unused variablesTomas Winkler2011-05-181-5/+0Star
| | | | | | | | wMaxPacketSize are bEndpointAddress assigned but not used Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: probe: simplify the endpoints testsTomas Winkler2011-05-181-144/+119Star
| | | | | | | | | we are interested only in isochronous in endpoints so we can simplify the flow Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_probe: drop verbose printoutsTomas Winkler2011-05-181-30/+0Star
| | | | | | | | reduce printouts of not necessary information Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_probe: drop unuzed variablesTomas Winkler2011-04-211-13/+0Star
| | | | | | Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_probe: take out duplicated code from ifdef - elseTomas Winkler2011-04-211-10/+4Star
| | | | | | Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_probe : rename usb variables to common namesTomas Winkler2011-04-211-75/+68Star
| | | | | | | | | | | | | | | 1. rename usb variables to more common names struct usb_device *pusb_device -> usbdev struct usb_host_interface *pusb_host_interface -> alt struct usb_endpoint_descriptor *pepd -> struct usb_interface_descriptor *pusb_interface_descriptor -> interface; 2. use usb_altnum_to_altsetting to access alternative settings Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: revamp reset functionTomas Winkler2011-04-201-35/+24Star
| | | | | | | | fix indentation and drop success statements printouts that just causes code be less readable Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: kill EASYCAP_IS_VIDEODEV_CLIENT compilation conditionalTomas Winkler2011-03-071-93/+0Star
| | | | | | | | | remove EASYCAP_IS_VIDEODEV_CLIENT and irrelevant code as the define is always set in the in-kernel driver Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: convert comparison to NULL into booleanTomas Winkler2011-03-071-81/+81
| | | | | | | | | convert if (NULL != ptr) to if (ptr) convert if (NULL == ptr) to if (!ptr) Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: replace if(false == var) with if (!var)Tomas Winkler2011-03-071-15/+15
| | | | | | | | 's/(false == \([^ ]\+\))/(!\1)/g' Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: replace if(true == var) with if (var)Tomas Winkler2011-03-071-49/+49
| | | | | | | | 's/(true == \([^ ]\+\))/(\1)/g' Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: more style fixing in easycap_main.cTomas Winkler2011-03-071-76/+57Star
| | | | | | | | mostly indentation fixes and some line over 80 characters fixes Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: add first level indentation to easycap_mainTomas Winkler2011-03-011-2330/+2234Star
| | | | | | | | | | | | Add first level indentation to easayca_main.c This created around 300 lines over 80 characters. Around 100 of straight forward once were fixed in this patch. The another 200 require more code movement and need to be fixed later Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: use USB_SUBCLASS_AUDIOSTREAMING instead of 0x02Tomas Winkler2011-02-231-2/+4
| | | | | | | | | | use USB_SUBCLASS_AUDIOSTREAMING constant from usb/audio.h instead of 0x02 Cc: Mike Thomas <rmthomas@sciolus.org> Cc: Dan Carpenter <error27@gmail.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: easycap_usb_probe: more indentation cleanupsTomas Winkler2011-02-231-22/+16Star
| | | | | | | Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: revamp inputset population codeTomas Winkler2011-02-231-66/+39Star
| | | | | | | | | make inputset population to be more compact and readable Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: fix style issues in easycap_usb_probe functionTomas Winkler2011-02-231-75/+29Star
| | | | | | | | | | fix some code styles and drop too verbose printouts and non relevant code Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: use %p for printing pointersTomas Winkler2011-02-181-22/+12Star
| | | | | | | | | use %p instead of %X drop casting of pointer to long long int Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: kill EASYCAP_NEEDS_V4L2_DEVICE_H and EASYCAP_NEEDS_V4L2_FOPSTomas Winkler2011-02-181-25/+1Star
| | | | | | | | | EASYCAP_NEEDS_V4L2_DEVICE_H and EASYCAP_NEEDS_V4L2_FOPS are required in in-tree driver Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: replace NOREADBACK with moduel parameterTomas Winkler2011-02-091-0/+4
| | | | | | | | | NOREADBACK doesn't justify Kconfig option so we use module paramter for it. Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: remove EASYCAP_SILENT optionTomas Winkler2011-02-091-6/+0Star
| | | | | | | | This has simulated a fault condition of probing for audio capability Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* stagine/easycap: use module paramter for default encoding instead of ifdefTomas Winkler2011-02-091-7/+7
| | | | | | | | remove PREFER_NTSC ifdef as it cannot be possible put into Kconfig Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: prefer printk over SAY in module entry functionsTomas Winkler2011-02-091-9/+3Star
| | | | | | | | | Use INFO level when registering driver and ERR for error. Drop messages from oneliner exit function Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: remove paranoid argument checks in usb probe/disconnectTomas Winkler2011-02-091-26/+3Star
| | | | | | | | | remove checks for NULL for usb_interface. USB bus won't call these functions with NULL Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: add level 1 tabs in usb_probe/disconnect functionTomas Winkler2011-02-041-1159/+1159
| | | | | | | | | Add first level indentation before revamping the functions This of course breaks 80 characters limit but it will be fixed through the revamp Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: replace underscored types with regular onceTomas Winkler2011-02-041-49/+49
| | | | | | | the underscored types should be used in user space headers only Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: rename variable s32 to tmpTomas Winkler2011-02-041-83/+83
| | | | | | | | | 1. naming variable s32 is confusing since it is also a type name. 2. use s32 instead of __s32, the later is for user space Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: remove explicit NULL initializationTomas Winkler2011-02-041-8/+3Star
| | | | | | | | | remove intializations to NULL where not needed and let the compiler find flows with unitilized variables. Fix one such flow in easycap_vma_fault function Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: improve coding style when checking return valueTomas Winkler2011-02-041-16/+16
| | | | | | | | use idiom 'if (rc)' for checking return value instead of if (0 != rc) Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: fix artificial line breaksTomas Winkler2011-02-041-8/+4Star
| | | | | | | | | | | | | | | fix style issue: if (NULL != pdata_urb->purb) { created by the patch: 'staging/easycap: don't cast NULL pointer' After dropping the casting there is no longer 80 columns limitation Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: repace #if defined with simpler #ifdefTomas Winkler2011-02-041-28/+25Star
| | | | | | | | for sake of readability replace #if defined with #ifdef and #if (!defined with #ifndef Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: kill EASYCAP_NEEDS_UNLOCKED_IOCTLTomas Winkler2011-02-041-10/+2Star
| | | | | | | we can kill this option for in-kernel driver Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: don't cast NULL pointerTomas Winkler2011-02-041-58/+58
| | | | | Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: make OSS compilation optional instead of ALSATomas Winkler2011-01-251-18/+18
| | | | | | | | | | | | OSS is deprecated yet currently it is reported to be more stable therefore we keep it but make it optional Revert the conditional compilation: add CONFIG_EASYCAP_OSS and kill EASYCAP_NEEDS_ALSA move oss-only code from easycap_sound.c to easycap_sound_oss.c Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: implement strerror functionTomas Winkler2011-01-251-261/+62Star
| | | | | | | | | | | Replace long switch statements that just print out errno with strerror function. It reduces around 700 lines from the code. The function should be probably dropped at all but leave for now to not break currently expected debug output. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: make functions local to easycap_main.c staticTomas Winkler2011-01-241-142/+120Star
| | | | | | | | | 1. remove declarations from the header file 2. rearange code in main.c to reduce number of forward declarations Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: group module parameters handlingTomas Winkler2011-01-241-13/+16
| | | | | | | | | 1. For readability group module parameters handling on one place 2. Introduce kernel config option EASY_DEBUG Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: remove redunant headersTomas Winkler2011-01-241-1/+0Star
| | | | | | | | | | place all globals to easycap.h, which is included by all c-files easycap_standard: fix declaration vs. definiton conflict Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: fix sparse warnings 'Should it be static'Tomas Winkler2011-01-241-9/+7Star
| | | | | | | | | | | | | | | | | | | | | | | easycap_main.c:41:23: warning: symbol 'easycapdc60_dongle' was not declared. Should it be static? easycap_main.c:49:22: warning: symbol 'easycap_usb_device_id_table' was not declared. Should it be static? easycap_main.c:69:30: warning: symbol 'easycap_fops' was not declared. Should it be static? easycap_main.c:82:29: warning: symbol 'easycap_vm_ops' was not declared. Should it be static? easycap_main.c:87:25: warning: symbol 'easycap_class' was not declared. Should it be static? easycap_main.c:95:35: warning: symbol 'v4l2_fops' was not declared. Should it be static? easycap_main.c:5071:1: warning: symbol 'easycap_module_init' was not declared. Should it be static? easycap_main.c:5101:1: warning: symbol 'easycap_module_exit' was not declared. Should it be static? easycap_low.c:45:50: warning: symbol 'stk1160configPAL' was not declared. Should it be static? easycap_low.c:87:28: warning: symbol 'stk1160configNTSC' was not declared. Should it be static? easycap_low.c:129:50: warning: symbol 'saa7113configPAL' was not declared. Should it be static? easycap_low.c:187:28: warning: symbol 'saa7113configNTSC' was not declared. Should it be static? easycap_ioctl.c:915:5: warning: symbol 'adjust_mute' was not declared. Should it be static? easycap_settings.c:42:31: warning: symbol 'easycap_standard' was not declared. Should it be static? easycap_settings.c:312:23: warning: symbol 'easycap_format' was not declared. Should it be static? easycap_settings.c:607:23: warning: symbol 'easycap_control' was not declared. Should it be static? Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: drop redunant backslashes from the codeTomas Winkler2011-01-211-561/+561
| | | | | | | remove \ from the code where C syntex doesnt require it Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: easycap: fix sparse warnings for module parametersTomas Winkler2011-01-211-1/+6
| | | | | | | | | | | | | | | | | easycap_main.c:34:5: warning: symbol 'easycap_debug' was not declared. Should it be static? easycap_main.c:36:5: warning: symbol 'easycap_gain' was not declared. Should it be static? These two variables actually were declared in several places. The variables are used in several files. I've fixed "easycap_debug" so it gets declared in one place only and included properly. For "easycap_gain" made it static and I created added a ->gain member to the easycap struct. This seems cleaner than using a global variable and later on we may make this controlable via sysfs. Cc:Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: easycap: add ALSA supportMike Thomas2011-01-211-164/+230
| | | | | | | This is necessary because some distributions are disabling OSS entirely. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: easycap: Make easycap_debug non-staticMike Thomas2011-01-211-1/+1
| | | | | | | | | The parameter easycap_debug appears in macros JOT and JOM and therefore needs to be visible from all source files. The easycap_ prefix should be sufficient to avoid namespace clashes outside the module. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>