summaryrefslogtreecommitdiffstats
path: root/drivers/staging/easycap/easycap_main.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* staging/easycap: make module params private/static, fix buildRandy Dunlap2010-11-161-9/+9
| | | | | | | | | | | | | | The easycap driver has module parameters (bars, gain, & debug) with global scope that intrude on the kernel namespace and cause build problems. Change the names of them to be driver-specific and make 2 of them static. drivers/built-in.o:(.bss+0x97c00): multiple definition of `debug' ld: Warning: size of symbol `debug' changed from 58 in arch/x86/built-in.o to 4 in drivers/built-in.o Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Improve interface to the videodev moduleMike Thomas2010-11-101-26/+135
| | | | | | | | The changes here represent an intermediate step towards bringing the driver within the V4L2 framework. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Eliminate BKLMike Thomas2010-11-101-92/+219
| | | | | | | | | | No locking is required for normal operation of the driver, but locking is needed to prevent an Oops during some hot-unplugging scenarios. The BKL is replaced here by mutex locks together with traps to detect null pointers following asynchronous device disconnection. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Add option to set the hardware audio gainMike Thomas2010-11-101-2/+6
| | | | | | | | | A new module parameter adjusts the gain of the AC'97 audio chip, if one is present. Attenuation as well as amplification should be possible according to the datasheet, but attenuation seems not to work yet. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Add option to show conspicuous indication of signal lossMike Thomas2010-11-101-16/+55
| | | | | | | | | | A new module parameter turns on the option of displaying a testcard when the analogue input signal is lost (more precisely: when the hardware detects no field/frame synchronization). This feature has been requested in the context of security cameras used at night. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Implement interlaced modes and reduced frameratesMike Thomas2010-11-101-33/+45
| | | | | | | | Interlaced modes are requested by tvtime. Reduced framerates are preferred by some userspace programs, e.g. astronomy applications. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/easycap: Improve hardware initializationMike Thomas2010-11-101-146/+640
| | | | | | | | | | | Sometimes at startup the video urbs consistently and persistently deliver bad data, each video frame (not isoc frame) containing an excess of precisely two bytes. A brute-force cure implemented here is to repeatedly reinitialize the registers of the SAA7113H chip and the STK1160 USB bridge until good behaviour is obtained. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>