summaryrefslogtreecommitdiff
path: root/drivers/staging/easycap/easycap_low.c
AgeCommit message (Collapse)Author
2011-03-07staging/easycap: reduce code duplication for ssa stk settingsTomas Winkler
reduce code duplication in register settings instead of if (ntsc) <CODE BLOCK> else <CODE BLOCK> use cfg = (ntsc) ? <chip>configNTSC : <chip>configPAL; <CODE BLOCK> in addition change while loops to more readable for loops Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07staging/easycap: wait_i2c should be staticTomas Winkler
wait_i2c is only used from easycap_low.c so remove it from the easycap.h and mark it 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>
2011-03-07staging/easycap: convert comparison to NULL into booleanTomas Winkler
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>
2011-03-07staging/easycap: replace if(true == var) with if (var)Tomas Winkler
'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>
2011-02-18staging/easycap: style changes in easycap_low.cTomas Winkler
remove uneedet brackets in ifs and switches drop pointless castings other small fixes 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>
2011-02-18staging/easycap: don't mask return value of usb_control_msg() by 0xFFTomas Winkler
masking return value of usb_control_msg() will mask negative error values into positive. Cc: Mike Thomas <rmthomas@sciolus.org> Reported-by: Dan Carpenter <error27@gmail.com> 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>
2011-02-18staging/easycap: add first level indetnation for easycap_low.cTomas Winkler
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>
2011-02-09staging/easycap: replace NOREADBACK with moduel parameterTomas Winkler
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>
2011-02-09staging/easycap: use regget for register back readingTomas Winkler
Use regget to reading back what was written to a register. This required changning size argument to regget signature On the way remove usless variable casting Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09stagine/easycap: make functions regset and regget staticTomas Winkler
regget and regset functions are used only from within easycap_low.c so they can be static Move the functions to avoid forward declarations Move GET and SET macro definitions into the c-file Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09staging/easycap: add first level indentation to regget/set functionsTomas Winkler
Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09staging/easycap: remove EASYCAP_SILENT optionTomas Winkler
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>
2011-02-04staging/easycap: replace underscored types with regular onceTomas Winkler
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>
2011-02-04staging/easycap: rename variable u8 to tmpTomas Winkler
naming variable u8 is confusing since it is also a type name. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04staging/easycap: repace #if defined with simpler #ifdefTomas Winkler
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>
2011-02-04staging/easycap: don't cast NULL pointerTomas Winkler
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-25staging: easycap: remove redunant headersTomas Winkler
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>
2011-01-25staging: easycap: fix sparse warnings 'Should it be static'Tomas Winkler
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>
2011-01-21staging: easycap: drop redunant backslashes from the codeTomas Winkler
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>
2011-01-21Staging: easycap: fix sparse warnings for module parametersTomas Winkler
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>
2011-01-21staging: easycap: add ALSA supportMike Thomas
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>
2010-11-16staging/easycap: make module params private/static, fix buildRandy Dunlap
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>
2010-11-09staging/easycap: Eliminate BKLMike Thomas
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>
2010-11-09staging/easycap: Add option to set the hardware audio gainMike Thomas
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>
2010-11-09staging/easycap: Improve hardware initializationMike Thomas
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>
2010-11-09staging/easycap: Make code re-entrantMike Thomas
In order to allow multiple EasyCAP dongles to operate simultaneously without mutual interference all static variables have been eliminated except for a persistent inventory of plugged-in dongles at module level. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09staging/easycap: Remove obsolete routinesMike Thomas
The so-called bridger routine has proved unnecessary following general improvements elsewhere. The explain_() functions were a convenience during early development, but are unnecessary and inappropriate now. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22Staging: easycap: Upsample microphone audioMike Thomas
Upsampling from 8000 Hz mono to 32000 Hz stereo improves audio/video synchronization when userspace programs adopt default buffering. This is an experimental feature. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18Staging: easycap: add easycap driverR.M. Thomas
This adds the easycap USB video adapter driver to the staging directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>