Commit Graph

39 Commits

Author SHA1 Message Date
Thomas Meyer 71c9c2045c staging/easycap: Use memdup_user
Use kmemdup_user rather than duplicating its implementation
 This is a little bit restricted to reduce false positives

 The semantic patch that makes this output is available
 in scripts/coccinelle/api/memdup_user.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:22:58 -07:00
Tomas Winkler 73019286cd staging/easycap: remove oss support
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
cdaa898b5e
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>
2011-07-08 14:02:26 -07:00
Tomas Winkler cdaa898b5e staging/easycap: kill telltale logic
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>
2011-07-05 19:47:46 -07:00
Jesper Juhl 0de7586a11 Remove unneeded version.h includes (and add where needed) for drivers/staging/easycap/
It was pointed out by 'make versioncheck' that linux/version.h was not
always being included where needed and sometimes included needlessly
in drivers/staging/easycap/.
This patch fixes up the includes.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:39:39 -07:00
Linus Torvalds 76d21c5635 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (442 commits)
  [media] videobuf2-dma-contig: make cookie() return a pointer to dma_addr_t
  [media] sh_mobile_ceu_camera: Do not call vb2's mem_ops directly
  [media] V4L: soc-camera: explicitly require V4L2_BUF_TYPE_VIDEO_CAPTURE
  [media] v4l: soc-camera: Store negotiated buffer settings
  [media] rc: interim support for 32-bit NEC-ish scancodes
  [media] mceusb: topseed 0x0011 needs gen3 init for tx to work
  [media] lirc_zilog: error out if buffer read bytes != chunk size
  [media] lirc: silence some compile warnings
  [media] hdpvr: use same polling interval as other OS
  [media] ir-kbd-i2c: pass device code w/key in hauppauge case
  [media] rc/keymaps: Remove the obsolete rc-rc5-tv keymap
  [media] remove the old RC_MAP_HAUPPAUGE_NEW RC map
  [media] rc/keymaps: Rename Hauppauge table as rc-hauppauge
  [media] rc-rc5-hauppauge-new: Fix Hauppauge Grey mapping
  [media] rc-rc5-hauppauge-new: Add support for the old Black RC
  [media] rc-rc5-hauppauge-new: Add the old control to the table
  [media] rc-winfast: Fix the keycode tables
  [media] a800: Fix a few wrong IR key assignments
  [media] opera1: Use multimedia keys instead of an app-specific mapping
  [media] dw2102: Use multimedia keys instead of an app-specific mapping
  ...

Fix up trivial conflicts (remove/modify and some real conflicts) in:
	arch/arm/mach-omap2/devices.c
	drivers/staging/Kconfig
	drivers/staging/Makefile
	drivers/staging/dabusb/dabusb.c
	drivers/staging/dabusb/dabusb.h
	drivers/staging/easycap/easycap_ioctl.c
	drivers/staging/usbvideo/usbvideo.c
	drivers/staging/usbvideo/vicam.c
2011-03-24 09:50:13 -07:00
Hans Verkuil 7ee40aadab [media] v4l: removal of old, obsolete ioctls
Some ioctl's were defined wrong on 2.6.2 and 2.6.6, using the wrong
type of R/W arguments. They were fixed, but the old ioctl names are
still there, maintained to avoid breaking binary compatibility:

There's no sense on preserving those forever, as it is very doubtful
that someone would try to use a such old binary with a modern kernel.
Removing them will allow us to remove some magic done at the V4L ioctl
handler.

Note that any application compiled with a videodev2.h from 2.6.7 or later
will be using the correct ioctls.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:32:12 -03:00
Linus Torvalds f74b944419 Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
  BKL: That's all, folks
  fs/locks.c: Remove stale FIXME left over from BKL conversion
  ipx: remove the BKL
  appletalk: remove the BKL
  x25: remove the BKL
  ufs: remove the BKL
  hpfs: remove the BKL
  drivers: remove extraneous includes of smp_lock.h
  tracing: don't trace the BKL
  adfs: remove the big kernel lock
2011-03-16 17:21:00 -07:00
Tomas Winkler 6888393c43 staging/easycap: convert comparison to NULL into boolean
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-07 13:24:04 -08:00
Tomas Winkler 27d683ab79 staging/easycap: replace if(true == var) with if (var)
'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-03-07 13:24:03 -08:00
Arnd Bergmann 5edc341313 drivers: remove extraneous includes of smp_lock.h
These were missed the last time I cleaned this up
globally, because of code moving around or new code
getting merged.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2011-03-02 00:02:40 +01:00
Tomas Winkler 50e1fbdc1c staging/easycap: add first level indentation to easycap_ioctl.c
Add the first level indentation to easycap_testcard.c with astyle -t8.
About 100 of 80 columns warnings were left out for further fix

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-28 15:24:19 -08:00
Tomas Winkler 6ae2dbec4d staging/easycap: remove AUDIOTIME feature
remove code guarded by AUDIOTIME define
This was experimental code in which I tried  improve audio-video
synchronization but it didn't work well

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-09 11:59:06 -08:00
Tomas Winkler f62bc44e05 staging/easycap: remove obsolete VIDIOC_S_CTRL_OLD ioctl
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-09 11:59:05 -08:00
Tomas Winkler 5dd00908be staging/easycap: replace one more EASYCAP_NEEDS_ALSA with CONFIG_EASYCAP_OSS
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-09 11:59:05 -08:00
Tomas Winkler 055e3a3a2c staging/easycap: replace underscored types with regular once
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-04 12:44:33 -08:00
Tomas Winkler 6911e7e4a6 staging/easycap: improve coding style when checking return value
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>
2011-02-04 12:44:31 -08:00
Tomas Winkler 3fc0dae888 staging/easycap: repace #if defined with simpler #ifdef
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-04 12:44:31 -08:00
Tomas Winkler f2b3c685b9 staging/easycap: kill EASYCAP_NEEDS_UNLOCKED_IOCTL
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>
2011-02-04 12:44:31 -08:00
Tomas Winkler 3c1fb66ede staging/easycap: don't cast NULL pointer
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 12:44:30 -08:00
Tomas Winkler 1945f939b6 staging/easycap: make oss ops function static in sound_oss.c
1. make oss ops function static
2. move around code so to avid forward declarations
3. move OSS ioclts from ioctl.c to 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>
2011-01-25 07:32:54 +08:00
Tomas Winkler 0edbc24c5d staging/easycap: make OSS compilation optional instead of ALSA
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>
2011-01-25 07:32:53 +08:00
Tomas Winkler e86ba1162f staging/easycap: fix missing backslash in ifdef statement
the backslash was removed by mistake in the patch
'staging:easycap: drop redundant backslashes from the code'
this breaks compilation only when EASYCAP_NEEDS_ALSA is not set

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-25 07:26:56 +08:00
Tomas Winkler b4f63e9a0f staging: easycap: remove redunant headers
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-25 06:43:04 +08:00
Tomas Winkler dbf4805ee6 staging: easycap: fix sparse warnings 'Should it be static'
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-25 06:43:03 +08:00
Tomas Winkler 1dc6e41825 staging: easycap: drop redunant backslashes from the code
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-21 12:29:35 -08:00
Mike Thomas a985591729 staging: easycap: add ALSA support
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>
2011-01-21 12:25:55 -08:00
Mike Thomas 268dfede46 staging/easycap: Improve interface to the videodev module
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>
2010-11-09 16:31:16 -08:00
Mike Thomas ae59dad4fe staging/easycap: Eliminate BKL
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-09 16:31:15 -08:00
Mike Thomas 2a87a0b922 staging/easycap: Avoid compiler warning about frame size ... larger than ...
Replacing some of the large automatic variables by dynamically allocated
variables in the IOCTL routines gets rid of the compiler warning.

Signed-off-by: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 16:31:15 -08:00
Mike Thomas 94155cf419 staging/easycap: Add option to set the hardware audio gain
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-09 16:31:15 -08:00
Mike Thomas 40b8d50ac9 staging/easycap: Implement interlaced modes and reduced framerates
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>
2010-11-09 16:31:15 -08:00
Mike Thomas f36bc37a48 staging/easycap: Improve hardware initialization
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-09 16:31:14 -08:00
Mike Thomas e68703cfe8 staging/easycap: Make code re-entrant
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-09 16:31:14 -08:00
Mike Thomas ce36cedab3 staging/easycap: Remove obsolete routines
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-11-09 16:31:14 -08:00
Frederic Weisbecker 5ef06839f5 staging: Pushdown bkl to easycap ioctl handlers
These were amongst the last users of struct file_operations:ioctl

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-08-09 03:28:40 +02:00
Joe Perches ba952d84e1 Staging: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:43:51 -07:00
Mike Thomas 7ebc8760b3 Staging: easycap: Upsample microphone audio
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-07-22 11:08:55 -07:00
Mike Thomas 3d423e91b4 Staging: easycap: Replace some global variables
New members of struct easycap take the place of undesirable global variables.

Signed-off-by: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:08:01 -07:00
R.M. Thomas 702422bd2d Staging: easycap: add easycap driver
This adds the easycap USB video adapter driver to
the staging directory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:34:42 -07:00