dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

4008 Commits

Author SHA1 Message Date
Nitin Gupta 00ac9ba01d Staging: zram: Rename ramzswap to zram in documentation
Related changes:
 - Included example to show usage as generic
(non-swap) disk with ext4 filesystem.
 - Renamed rzscontrol to zramconfig to match
with new device naming.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:50:30 -07:00
Nitin Gupta f1e3cfff4d Staging: zram: Rename ramzswap to zram in code
Automated renames in code:
 - rzs* -> zram*
 - RZS* -> ZRAM*
 - ramzswap* -> zram*

Manual changes:
 - Edited comments/messages mentioning "swap"

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:49:48 -07:00
Nitin Gupta 16a4bfb9e9 Staging: Rename ramzswap files to zram
Related changes:
 - Modify revelant Kconfig and Makefile accordingly.
 - Change include filenames in code.
 - Remove dependency on CONFIG_SWAP in Kconfig as zram usage
is no longer limited to swap disks.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:46:42 -07:00
Nitin Gupta a1dd52afa9 Staging: ramzswap: Support generic I/O requests
Currently, ramzwap devices (/dev/ramzswapX) can only
be used as swap disks since it was hard-coded to consider
only the first request in bio vector.

Now, we iterate over all the segments in an incoming
bio which allows us to handle all kinds of I/O requests.

ramzswap devices can still handle PAGE_SIZE aligned and
multiple of PAGE_SIZE sized I/O requests only. To ensure
that we get always get such requests only, we set following
request_queue attributes to PAGE_SIZE:
 - physical_block_size
 - logical_block_size
 - io_min
 - io_opt

Note: physical and logical block sizes were already set
equal to PAGE_SIZE and that seems to be sufficient to get
PAGE_SIZE aligned I/O.

Since we are no longer limited to handling swap requests
only, the next few patches rename ramzswap to zram. So,
the devices will then be called /dev/zram{0, 1, 2, ...}

Usage/Examples:
 1) Use as /tmp storage
 - mkfs.ext4 /dev/zram0
 - mount /dev/zram0 /tmp

 2) Use as swap:
 - mkswap /dev/zram0
 - swapon /dev/zram0 -p 10 # give highest priority to zram0

Performance:

 - I/O benchamark done with 'dd' command. Details can be
found here:
http://code.google.com/p/compcache/wiki/zramperf
Summary:
 - Maximum read speed (approx):
   - ram disk: 1200 MB/sec
   - zram disk: 600 MB/sec
 - Maximum write speed (approx):
   - ram disk: 500 MB/sec
   - zram disk: 160 MB/sec

Issues:

 - Double caching: We can potentially waste memory by having
two copies of a page -- one in page cache (uncompress) and
second in the device memory (compressed). However, during
reclaim, clean page cache pages are quickly freed, so this
does not seem to be a big problem.

 - Stale data: Not all filesystems support issuing 'discard'
requests to underlying block devices. So, if such filesystems
are used over zram devices, we can accumulate lot of stale
data in memory. Even for filesystems to do support discard
(example, ext4), we need to see how effective it is.

 - Scalability: There is only one (per-device) de/compression
buffer stats. This can lead to significant contention, especially
when used for generic (non-swap) purposes.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:45:40 -07:00
Naveen Jain 36e574fed5 Staging: ti-st: fix protocol counting
Older mechanism of counting the number of protocols
registered with ST was slow, in-efficient.
It used to check the protocol data for NULL for each
registration/unregistration.

With this change, counting protocols in maintained by
a single counter protos_registered.

Counting protocols is not just for debug purposes

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:40:29 -07:00
Naveen Jain e2a5328285 Staging: ti-st: add version info to sysfs
Add version information to be available under the sysfs group
for kim.

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:39:38 -07:00
Naveen Jain b38fc2d965 Staging: ti-st: cleanup sysfs code
Remove the older way of communicating with user-space
daemon UIM.
The older way involved creating of a new kobj and pid
sysfs file under it, and sending signal using that pid.

Now we communicate via rfkill to user-space UIM.

Background: UIM is the user-space daemon which upon
notification from ldisc driver, opens the tty, sets
default baud and then installs (tiocsetd) the ldisc.

Signed-off-by: Naveen Jain <naveen_jain@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:39:37 -07:00
Pavan Savoy 4f62e69b2b Staging: Update TI-ST's TODO
Update the TODO of TI-ST to make sure it reflects current list
of activities that need to be done.
Also point it out to the user-space app code relevant to it.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 12:37:57 -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
Greg Kroah-Hartman 178f16db8f Merge git://git.infradead.org/users/dwmw2/spectra-2.6 into work 2010-06-18 12:13:11 -07:00
Charles Clément 013a468c45 Staging: vt6655: struct pci_driver cleanup
Rename driver struct and callbacks to vt6655_* instead of device_* and add
__devinit/__devexit directives.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:42:07 -07:00
Uwe Kleine-König 0d74395177 Staging: vt665*: fix typos concerning "management"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:42:07 -07:00
Timofey Trofimov 2555cd9f93 Staging: vt6656: fix coding style issues in 80211mgr.c
This is a patch to the 80211mgr.c file that fixes up warnings
found by the checkpatch.pl tool

Signed-off-by: Timofey Trofimov <tumoxep@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:39:56 -07:00
Otavio Salvador d500648ef6 Staging: vt6656: fix up built-in compilation together with rt2870
Fix this build error:

  drivers/staging/vt6656/built-in.o: In function `rotr1':
  (.text+0x1a878): multiple definition of `rotr1'
  drivers/staging/rt2870/built-in.o:(.text+0x106c2): first defined here
  drivers/staging/vt6656/built-in.o: In function `tkip_sbox':
  (.text+0x1a848): multiple definition of `tkip_sbox'
  drivers/staging/rt2870/built-in.o:(.text+0x10697): first defined here
  drivers/staging/vt6656/built-in.o: In function `xor_32':
  (.text+0x1ec24): multiple definition of `xor_32'
  drivers/staging/rt2870/built-in.o:(.text+0x111c4): first defined here
  drivers/staging/vt6656/built-in.o: In function `xor_128':
  (.text+0x1ec00): multiple definition of `xor_128'
  drivers/staging/rt2870/built-in.o:(.text+0x111dd): first defined here

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:37:48 -07:00
Andres More d9d1ccb51f Staging: vt6656: code cleanup, resolved checkpatch findings in headers
Resolved whitespace-related checkpatch findings in .h files

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:35:33 -07:00
Andres More 33d33e42b6 Staging: vt6656: code cleanup, fixed 'for' statements
Resolved checkpatch findings, but some long lines warnings.
	ERROR: space required before the open parenthesis '('
	ERROR: spaces required around that

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:34:59 -07:00
Greg Kroah-Hartman afb97d9a26 Staging: vt6655: fix up U32 conversion
Commit 902d241129 converted U32 to u32
which you would think would be just fine.  Unfortunatly, it seems that
VIA only builds their code on a 32bit processor (which makes sense if
you think about it), but this doesn't work on x86-64.  So fix up the few
places where this really wanted to be an unsigned long width.

Cc: Charles Clément <caratorn@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>,
Cc: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:30:21 -07:00
Charles Clément cf160bc926 Staging: vt6655: include linux/ headers instead of asm/
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:04 -07:00
Charles Clément 9d828c458f Staging: vt6655: remove PDWORD typedef
Use unsigned long * instead.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:03 -07:00
Charles Clément 15df6c2b92 Staging: vt6655: remove PWORD typedef
Use unsigned short * instead.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:03 -07:00
Charles Clément 2989e96f17 Staging: vt6655: remove PBYTE typedef
Use unsigned char * instead.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:03 -07:00
Charles Clément b2e876b608 Staging: vt6655: remove custom ULONGLONG typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:19:05 -07:00
Charles Clément e3fd16d081 Staging: vt6655: remove custom ULONG typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:19:04 -07:00
Charles Clément b6e95cd52a Staging: vt6655: remove custom UINT typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:18:45 -07:00
Charles Clément 800acdbdf8 Staging: vt6655: remove custom USHORT typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:18:32 -07:00
Charles Clément 5c9824e124 Staging: vt6655: remove custom UCHAR typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:14:00 -07:00
Charles Clément b83cc2ed46 Staging: vt6655: remove custom LONG typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:11:16 -07:00
Charles Clément 7ca3019525 Staging: vt6655: remove custom INT typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:11:16 -07:00
Charles Clément 0c93a98a0e Staging: vt6655: removed custom SHORT typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:11:15 -07:00
Charles Clément 5a4197bdda Staging: vt6655: removed custom CHAR typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:11:15 -07:00
Charles Clément 902d241129 Staging: vt6655: remove U32 custom macro
Remove custom macro for unsigned 32-bit integers, replace by u32.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:09:25 -07:00
Charles Clément c17ce8c21d Staging: vt6655: remove U16 custom macro
Remove custom macro for unsigned 16-bit integers.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:09:25 -07:00
Charles Clément 737c3d708c Staging: vt6655: remove U8 custom macro
Remove custom macro for unsigned 8-bit integers.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:09:24 -07:00
Charles Clément ec28c7fab4 Staging: vt6655: remove I8 custom macro
Remove custom macro for signed 8-bit integers.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:09:24 -07:00
Charles Clément 8fa5dd133e Staging: vt6655: remove unused OUT definition
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:09:24 -07:00
Charles Clément 8fee12e4d1 Staging: vt6655: remove double definition of Calcu_LinkQual
Calcu_LinkQual is already defined a couple lines earlier.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:07:48 -07:00
Charles Clément 6b1e6b8f95 Staging: vt6655: remove unused argument in ChannelValid function
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:07:48 -07:00
Charles Clément 2ef98c6065 Staging: vt6655: use compare_ether_addr instead of custom macro
Replace custom macro IS_ETH_ADDRESS_EQUAL by compare_ether_addr from
<linux/etherdevice.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:06:53 -07:00
Charles Clément 8b0591e501 Staging: vt6655: use is_zero_ether_addr instead of custom macro
Replace custom macro IS_NULL_ADDRESS by is_zero_ether_addr from
<linux/etherdevice.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:06:53 -07:00
Charles Clément ca9e12acda Staging: vt6655: use is_broadcast_ether_addr instead of custom macro
Replace custom macro IS_BROADCAST_ADDRESS by is_broadcast_ether_addr
from <linux/etherdevice.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:06:53 -07:00
Charles Clément 670ea81ead Staging: vt6655: use is_multicast_ether_addr instead of custom macro
Replace custom macro IS_MULTICAST_ADDRESS by is_multicast_ether_addr
from <linux/etherdevice.h>.
Remove linux/if_ether.h include as it is included in
linux/etherdevice.h already.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:06:53 -07:00
Charles Clément c92069f3d7 Staging: vt6655: use ETH_ZLEN macro instead of custom one
Replace custom minimum packet lenght definition MIN_PACKET_LEN by
ETH_ZLEN from <linux/if_ether.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:06:52 -07:00
Timofey Trofimov 3a4d1b9096 Staging: winbond: fix some checkpatch.pl issues in phy_calibration.c
This is a patch to the phy_calibration.c that fixes up almost all
warnings and errors (except 80 characters limit and lack of tabs errors)
found by the checkpatch.pl tool

Signed-off-by: Timofey Trofimov <tumoxep@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:01:31 -07:00
Adam Latham 07bbf35048 Staging: winbond: Fix for brace style, length and whitespace in mac_structures.h
This patch fixes line length, brace style and whitespace issues in the
mac_structures.h file found by the checkpatch.pl tool

Signed-off-by: Adam Latham <adam.latham@unisontorbay.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:00:40 -07:00
Adam Latham cb016cc48a Staging: winbond: Fix C99 Comment issues in mac_structures.h
This patch fixes the use of //C99 comments in the mac_structures.h found by
the checkpatch.pl tool

Signed-off-by: Adam Latham <adam.latham@unisontorbay.org.uk>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:00:09 -07:00
Tobias Klauser 15f0beb169 Staging: hv: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 09:22:28 -07:00
Gustavo Silva 3cc544df93 Staging: comedi: drivers: fix coding style issues in pcl812.c
This is a patch to the pcl812.c file that fixes up the following
issues:

ERROR: code indent should use tabs where possible		   x 27
WARNING: line over 80 characters				   x 37
WARNING: please, no space before tabs				   x 13
WARNING: braces {} are not necessary for single statement blocks   x  2
WARNING: printk() should include KERN_ facility level		   x 22
WARNING: braces {} are not necessary for any arm of this statement x  5

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 09:16:44 -07:00
Lars Lindley ba22a15ae8 Staging: et131x: Small format/style tidyups
I fixed indentation in one place and two long lines, a space and a brace
found by checkpatch.pl and fixed some long lines and whitespace around an =.

Signed-off-by: Lars Lindley <lindley@coyote.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 16:08:45 -07:00
Ian Abbott 80370692f6 Staging: Comedi: drivers: Remove comment copied from skel.c
The dmm32at.c and comedi_bond.c comedi driver files contain an
instructional comment block copied over from skel.c about how to format
a driver comment block.  This comment was modified in skel.c by a
previous patch in this series to stop Comedi's 'dump_doc' script
treating it as an actual driver comment block.  There isn't any need to
repeat this comment block in the other source files, so rather than
modify it, this patch just removes it from those files.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 16:03:59 -07:00
Ian Abbott 9a390f38b6 Staging: comedi: drivers: skel: Add whitespace to example comment block
The Comedi team have a script 'dump_doc' to extract text from the driver
comment block (starting with line 'Driver:') in (most of) the comedi
driver source files.  This was recently updated to allow and strip off a
" * " prefix at the start of each line (well actually, it uses the perl
substitution 's/^ ?\* ?//').

The skel.c file contains an instructional comment block about how to
format this driver comment block, but the updated 'dump_doc' script
mistakenly treats this as a valid driver comment block.  This patch adds
some extra whitespace to stop the instructional comment block being
treated as a valid driver comment block by Comedi's 'dump_doc' script.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 16:03:58 -07:00
Ian Abbott 389cd417e3 Staging: comedi: drivers: das08: Add whitespace to driver comment block
Previous whitespace changes to das08.c removed some whitespace from a
"driver comment block" that the Comedi team would like to keep.  "Header
continuation lines" in this comment block should be indented with
whitespace.  (This is after the " * " at the start of each line.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 16:03:58 -07:00
Gustavo Silva 3420f6b4c1 Staging: comedi: drivers: fix coding style issues in quatech_daqp_cs.c
This is a patch to the quatech_daqp_cs.c file that fixes up the following
issues:

ERROR: code indent should use tabs where possible		   x  1
WARNING: line over 80 characters				   x  1
WARNING: braces {} are not necessary for single statement blocks   x 10
WARNING: printk() should include KERN_ facility level		   x  6

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 15:54:24 -07:00
Gustavo Silva 8b83e005d1 Staging: comedi: drivers: fix coding style issues in pcmda12.c
This is a patch to the pcmda12.c file that fixes up five printk() warning issues

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 15:54:24 -07:00
Gustavo Silva 4c68fb42c2 Staging: comedi: drivers: fix coding style issues in pcl816.c
This is a patch to the pcl816.c file that fixes up the following
issues:

ERROR: code indent should use tabs where possible		   x  2
WARNING: line over 80 characters				   x 34
WARNING: please, no space before tabs				   x  1
WARNING: braces {} are not necessary for single statement blocks   x  6
WARNING: printk() should include KERN_ facility level		   x 15
WARNING: braces {} are not necessary for any arm of this statement x  1

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 15:54:24 -07:00
Gustavo Silva 8f4e80af3a Staging: comedi: drivers: Fix coding style issues in pcl711.c
This is a patch to the pcl711.c file that fixes up printk()
warning issues.

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 15:54:12 -07:00
Gustavo Silva b6241fda0a Staging: comedi: drivers: fix coding style issues in me4000.c
This is a patch to the me4000.c file that fixes up the following
issues:

ERROR: space required after that close brace '}' 		   x 13
ERROR: spaces required around that ':' (ctx:VxV) 		   x  3
WARNING: line over 80 characters                 		   x 96
WARNING: braces {} are not necessary for any arm of this statement x  2

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 15:54:12 -07:00
Arun Thomas 56b8421cee Staging: comedi: Remove typedefs
Remove all remaining typedefs from comedi drivers

Signed-off-by: Arun Thomas <arun.thomas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:49:07 -07:00
Arun Thomas 727b286b44 Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro
Move the PCI devinit/devexit routines to the respective C source files
instead of calling COMEDI_PCI_INITCLEANUP

Signed-off-by: Arun Thomas <arun.thomas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:48:12 -07:00
Arun Thomas 7114a28011 Staging: comedi: Remove COMEDI_INITCLEANUP macro
Move the init/exit routines to the respective C source files
instead of calling COMEDI_INITCLEANUP

Signed-off-by: Arun Thomas <arun.thomas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:47:00 -07:00
Arun Thomas 90f703d30d Staging: comedi: Remove COMEDI_MODULES_MACRO
Add MODULE_AUTHOR, MODULE_LICENSE, and MODULE_DESCRIPTION calls
to the respective C source files instead of calling COMEDI_MODULES_MACRO

Signed-off-by: Arun Thomas <arun.thomas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:45:47 -07:00
Maurice Dawson 88d8ed4b64 Staging: comedi: fix printk() coding style issue in ni_labpc.c
This is a patch to the ni_labpc.c file that fixes all, printk() should
include KERN-facility level, warnings found by the checkpatch.pl tool

Signed-off-by: Maurice Dawson <mauricedawson2699@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:44:15 -07:00
Bob Beattie 0c55484dca Staging: comedi: drivers: fix space coding style in am9513.h
This is a patch to the file am9513.h that fixes missing space warnings
found by the checkpatch.pl tool.

Signed-off-by: Bob Beattie <bob.beattie@ntlworld.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:43:12 -07:00
John Sheehan daca497d80 Staging: comedi: fix code warnings in s626.c
A patch for s626.c to fix some of the warnings
reported by the checkpatch.pl tool, namely,
printk() should include KERN_ facility level
unnecessary whitespace before a quoted newline

Signed-off-by: John Sheehan <john.d.sheehan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:36:34 -07:00
John Sheehan 6fd071cccf Staging: comedi: fix code style errors in unioxx5.c
A patch for unioxx5.c which fixes "trailing statements
should be on next line" errors raised by the
chechpatch.pl tool

Signed-off-by: John Sheehan <john.d.sheehan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:36:34 -07:00
Mark Rankilor 4c67da06f0 Staging: comedi: Fixed long lines in gsc_hpdi.c
This patch fixes some long line lengths in gsc_hpdi.c as found by the
checkpatch.pl tool

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:36:34 -07:00
Mark Rankilor 2f6df34cd3 Staging: comedi: Checkpatch cleanups in adl_pci9111.c
This patch cleans up some various warnings generated from checkpatch.pl

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:36:33 -07:00
Dan Carpenter f25bd6bfdf Staging: comedi: cleanup: remove unneeded null checks
These checks are obviously pointless because kfree() can handle null
dereferences.

But really the main problem is that if the pointers were null that would
cause problems on the ealier lines.  The dereferences would cause an
oops and the _release() functions use ->priv to determine which IRQ to
free.  I looked into it and quite a few of the detach functions assume
link->priv is non-null.  It seems like we can remove these checks.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:36:33 -07:00
Ian Abbott c5da20905c Staging: comedi: serial2002: Use NULL instead of 0 for pointers
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:28:57 -07:00
Ian Abbott 668f272e57 Staging: comedi: serial2002: Reduce stack usage on 'open'
Reduce stack usage in serial_2002_open() by allocating dig_in_config,
dig_out_config, chan_in_config, and chan_out_config temporary arrays
using kcalloc() and freeing them when done with.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:28:57 -07:00
Ian Abbott fa3b5d9ab0 Staging: comedi: serial2002: Fix memory leak on detach
The comedi device 'detach' method for the serial2002 driver has an
off-by-one error in its loop for freeing data belonging to its
subdevices.  Fix it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:28:56 -07:00
Ian Abbott 9e7f225688 Staging: comedi: serial2002: handle allocation failures on 'open'
The comedi device 'open' method for the serial2002 driver frees any old
'maxdata_list' and 'range_table_list' arrays belonging to a subdevice
and allocates them again, but was missing checks for allocation failure.

If an allocation fails, free the 'maxdata_list' and 'range_table_list'
arrays for all subdevices and return an error.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:28:56 -07:00
Ian Abbott 3c17ba0743 Staging: comedi: Allow 'open' driver method to fail
Some comedi drivers should return an error from their 'open' method when
something goes wrong.  Change the prototype of the 'open' method in
'struct comedi_device' to allow this, and change the drivers that use it.
Propagate any error to the 'open' file operation.

The corresponding 'close' method won't be called when the 'open' method
fails, so drivers failing the 'open' need to clean up any mess they
created.

The dt9812 and serial2002 drivers can now return an error on 'open'.
The jr3_pci driver also uses the 'open' method but doesn't fail it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 13:28:56 -07:00
Cody Harmon 3d34023a99 Staging: comedi: ni_tio: fixed brace coding style issues and a few errors
Fixed code style and placed KERN_ERR in printk statement.

Signed-off-by: Cody Harmon <harmonco@engr.orst.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 11:42:58 -07:00
Samuel Richardson 091b4242eb Staging: comedi: fixed brace coding style issue in ni_tio.c
This is a patch to the ni_tio.c file that fixes a brace warning found by
the checkpatch.pl tool

Signed-off-by: Samuel Richardson <sam.j.richardson@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 11:41:36 -07:00
David Woodhouse bf46b9a92e spectra: Rename config options
This is the Spectra driver, so use CONFIG_SPECTRA.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-06-08 18:28:24 +01:00
David Woodhouse 8ae4f63623 spectra: Move to drivers/staging
It'll take some work before this is really shippable.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-06-08 18:08:32 +01:00
Linus Torvalds e620d1e39a Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (87 commits)
  V4L/DVB: ivtv: Timing tweaks and code re-order to try and improve stability
  V4L/DVB: ivtv: Avoid accidental video standard change
  V4L/DVB: ivtvfb : Module load / unload fixes
  V4L/DVB: cx2341x: Report correct temporal setting for log-status
  V4L/DVB: cx18, cx23885, v4l2 doc, MAINTAINERS: Update Andy Walls' email address
  V4L/DVB: drivers/media: Eliminate a NULL pointer dereference
  V4L/DVB: dvb-core: Fix ULE decapsulation bug
  V4L/DVB: Bug fix: make IR work again for dm1105
  V4L/DVB: media/IR: nec-decoder needs to select BITREV
  V4L/DVB: video/saa7134: change dprintk() to i2cdprintk()
  V4L/DVB: video/saa7134: remove duplicate break
  V4L/DVB: IR/imon: add auto-config for 0xffdc rf device
  V4L/DVB: IR/imon: clean up usage of bools
  V4L/DVB: em28xx: remove unneeded null checks
  V4L/DVB: ngene: remove unused #include <linux/version.h>
  V4L/DVB: ak881x needs slab.h
  V4L/DVB: FusionHDTV: Use quick reads for I2C IR device probing
  V4L/DVB: Technotrend S2-3200 ships with a TT 1500 remote
  V4L/DVB: drivers/media: Use kzalloc
  V4L/DVB: m920x: Select simple tuner
  ...
2010-06-04 15:38:12 -07:00
Dan Carpenter 640f7dcfe0 Staging: sep: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bytes remaining but we want to
return a negative error code here.  These functions are used in the
ioctl handler and the error code gets returned to userspace.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:58 -07:00
Dan Carpenter 2d98bb22c3 Staging: rc2860: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bytes remaining but we want to
return a negative error code.  This is in the ioctl handler and the
error code gets passed to userspace.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:58 -07:00
Julia Lawall c60e55f30a Staging: Eliminate a NULL pointer dereference
Eliminate a NULL or near NULL pointer dereference.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E,E1;
identifier f;
statement S1,S2,S3;
@@

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Julia Lawall 0aa3f139cd staging: Use GFP_ATOMIC when a lock is held
In each case, the containing function is only called from one place, where
a spin lock is held.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@gfp exists@
identifier fn;
position p;
@@

fn(...) {
... when != spin_unlock
    when any
  GFP_KERNEL@p
 ... when any
}

@locked@
identifier gfp.fn;
@@

spin_lock(...)
... when != spin_unlock
fn(...)

@depends on locked@
position gfp.p;
@@

- GFP_KERNEL@p
+ GFP_ATOMIC
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Martin Homuth-Rosemann ebe8622342 Staging: comedi - correct parameter gainlkup for DAQCard-6024E in driver ni_mio_cs.c
Correct at least one of the incorrect specs for a national instrument
data acquisition card DAQCard-6024E. This card has only four different
gain settings (+-10V, +-5V, +-0.5V, +-0.05V).

Signed-off-by: Martin Homuth-Rosemann <homuth-rosemann@gmx.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Alexander Kurz 7f00b36e9e Staging: comedi: fixing ni_labpc to mite dependancy
the dependancy of ni_labpc on mite was missing,

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

index 0aa2b0d..79f5f2e 100644
2010-06-04 13:38:57 -07:00
Henk de Groot f502cb6eb2 Staging: wlags49_h2, wlags49_h25: fixed Kconfig dependencies
Fixes Kconfig so the wlags49_h2 and wlags49_h25 drivers can be
selected from menuconfig without having to select another WLAN
driver first. Before it could only be selected when another driver
already selected WIRELESS_EXT. Also adds WEXT_PRIV on which
the driver also depends.

Align help text in Kconfig.

Signed-off-by: Henk de Groot <pe1dnn@amsat.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Randy Dunlap c28040e515 Staging: phison: depends on ATA_BMDMA
phison uses interfaces and data that are built only when
ATA_BMDMA is enabled, so it should depend on that symbol.

drivers/staging/phison/phison.c:43: error: implicit declaration of function 'ATA_BMDMA_SHT'
drivers/staging/phison/phison.c:43: error: initializer element is not constant
drivers/staging/phison/phison.c:43: error: (near initialization for 'phison_sht.module')
drivers/staging/phison/phison.c:47: error: 'ata_bmdma_port_ops' undeclared here (not in a function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: evan_ko@phison.com
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Barry Song b6ee30a27f Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filename
Signed-off-by: Barry Song <21cnbao@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Mike Frysinger c3dee74f52 Staging: adis16255: add proper section markings to hotplug funcs
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Mike Frysinger 08a16d9f0e Staging: adis16255: fix typo in Kconfig
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:57 -07:00
Sven Eckelmann 0375fc4d27 Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL
A new buffer for a packet is created when a icmp packet is received.
This happens in a context with disabled irq. Thus we are not allowed to
sleep or call function which might sleep. kmalloc must be called with
GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:56 -07:00
Sven Eckelmann 3d9b235893 Staging: batman-adv: Don't call free_netdev twice
Free_netdev is registered as destructor in interface_setup for every
soft_device. This destructor is automatically called from
unregister_netdev and we must not call it again for the freed
net_device.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:56 -07:00
Sven Eckelmann 20c8a44b7c Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock
We must call unregister_netdev when we couldn't initialise the
batman-adv module and the soft_device was registered. There are two
version of the function which we can use:
 * unregister_netdevice - removes device
 * unregister_netdev - takes rtnl semaphore and remove device

We don't hold the semaphore in an error situation. So we must use
unregister_netdev.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:55 -07:00
Marek Lindner 5f411a90ee Staging: batman-adv: fix rogue packets on shutdown
On module shutdown batman-adv would purge the internal packet
queue by sending all remaining packets which could confuse
other nodes. Now, the packets are silently discarded.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:55 -07:00
Stepan Moskovchenko 9d20015391 Staging: add MSM framebuffer driver
Qualcomm development of the MSM SOC framebuffer driver has
diverged significantly from the driver used by Android. This
is a snapshot of our current driver, in all it's agony. We are
putting this in staging to help with the process of converging
the two drivers.

At this point, the driver has been tested only in dumb
framebuffer mode.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
[dwalker@codeaurora.org: added a small compile fix and TODO.]
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:54 -07:00
Alexander Kurz 34ef545aa8 Staging: comedi: fixing ni_tio to mite PCI dependancy
On Wed, 19 May 2010, Randy Dunlap wrote:
> linux-next of 2010-0519:
> when CONFIG_PCI is not enabled:
> 
> drivers/staging/comedi/drivers/mite.c: In function 'mite_init':
> drivers/staging/comedi/drivers/mite.c:89: error: implicit declaration of function 'pci_dev_get'
> drivers/staging/comedi/drivers/mite.c:89: warning: assignment makes pointer from integer without a cast
> make[5]: *** [drivers/staging/comedi/drivers/mite.o] Error 1

This patch fixes the problem.

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:54 -07:00
Alexander Kurz 824196248c Staging: comedi: fix 8255 and DAS08 Kconfig dependancies.
Both drivers support directly or indirectly multiple bus types,
hence both are listed independent of bus types.

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:54 -07:00
Ian Abbott 53fa827e29 Staging: comedi: For COMEDI_BUFINFO, check access to command
Don't allow COMEDI_BUFINFO ioctl if some other file object has locked
the subdevice or has an active command.  If there is no active command,
just report back the last buffer position.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:53 -07:00
Ian Abbott 4772c018e3 Staging: comedi: COMEDI_BUFINFO with no async - report no bytes read or written
When the COMEDI_BUFINFO ioctl is used on a subdevice without
asynchronous streaming command support, set 'bytes_read = 0' and
'bytes_written = 0' in the buffer info returned back to the user.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:53 -07:00
Ian Abbott d261154057 Staging: comedi: don't write to buffer if command finished
For write(), any data copied to the data buffer after the previously
set up streaming acquisition command has finished won't be used, but a
non-empty write() does not currently return 0 (or -EPIPE on error) after
the command has finished until the data buffer has been filled up.
Change this behavior to return 0 (or -EPIPE) any time after the command
has finished, without bothering to fill up the buffer with more useless
data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:53 -07:00
Ian Abbott ee4063fa6b Staging: comedi: amplc_dio200: Protect counter subdevice with spinlock
The internal state of an 82C54 counter timer chip will get messed up if
several threads read, write, configure, or check the status of the chip
simultaneously.  Protect the register access sequences with a spin lock.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:53 -07:00
Ian Abbott d4da77a73c Staging: comedi: adv_pci_dio: Support Advantech PCI-1735U
Add support for the Advantech PCI-1735U card, including support for a
counter subdevice (based on an 82C54 counter timer chip).

The counter subdevice needs more testing, as the only person I know who
tried it couldn't get it to work!

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:52 -07:00
Ian Abbott b2e68b00d5 Staging: comedi: addi-data: don't overwrite name for request_irq()
The Addi-Data PCI drivers for Comedi use sprintf() in their comedi
"attach" routine to construct a string to pass as the name in the call
to request_irq().  All calls to "attach" routine share the same static
buffer for this name, but the contents will differ on each call
(including the comedi device number and the comedi board name).  This
changes the name displayed in /proc/interrupts for previous calls to
request_irq() using the same buffer.  Just use the board name instead;
it has slightly less information (no comedi device number) but at least
it doesn't change over the lifetime of the IRQ handler.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:52 -07:00
Ian Abbott 6d8b0f5be5 Staging: comedi: Give the addi_apci_* drivers different driver names
It is not currently possible for more than one of the addi_apci_*
drivers to register themselves with comedi at once because they all use
the same comedi driver name "addi_common".  Give them different names.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:52 -07:00
Sreedhara DS a4cff8b82a Staging: mid: Intel MID touch screen driver
Touchscreen driver used by intel mid devices. Some clean up by Alan Cox. This
driver is basically ready for upstreaming properly but is tied wrongly to the
SPI layer and needs firmware/SFI changes to fix that.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:51 -07:00
apatard@mandriva.com d7636e0b07 staging: Add framebuffer driver for XGI chipsets
This driver handles XG20, XG21, XG40, XG42 chipsets from XGI. They're
also known as Z7,Z9,Z11 chipsets. It's based on the SiS fb driver but
has been heavily modified by XGI to support their newer chipsets.


Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:51 -07:00
Wolfram Sang fbae3fb154 i2c: Remove all i2c_set_clientdata(client, NULL) in drivers
I2C drivers can use the clientdata-pointer to point to private data. As I2C
devices are not really unregistered, but merely detached from their driver, it
used to be the drivers obligation to clear this pointer during remove() or a
failed probe(). As a couple of drivers forgot to do this, it was agreed that it
was cleaner if the i2c-core does this clearance when appropriate, as there is
no guarantee for the lifetime of the clientdata-pointer after remove() anyhow.
This feature was added to the core with commit
e4a7b9b04d to fix the faulty drivers.

As there is no need anymore to clear the clientdata-pointer, remove all current
occurrences in the drivers to simplify the code and prevent confusion.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Richard Purdie <rpurdie@linux.intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-06-03 11:33:58 +02:00
Stefan Ringel 7e2d9820c3 V4L/DVB: tm6000: add DVB support for tuner xc5000
[mchehab@redhat.com: Fix compilation breakage due to duplicate cfg config delaration without {}]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:07 -03:00
Stefan Ringel dcf5d3aa08 V4L/DVB: tm6000: set variable dev_mode in function tm6000_start_stream
set variable dev_mode in function tm6000_start_stream and check mode

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:06 -03:00
Stefan Ringel 71d67f739e V4L/DVB: tm6000: Properly select the tuners
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:05 -03:00
Stefan Ringel f36cc0342d V4L/DVB: tm6000: Add control to the power led
Turn power led off, if device is disconnected

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:03 -03:00
Stefan Ringel 5a4b55e2c2 V4L/DVB: tm6000: bugfix stabilizing urb data
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:02 -03:00
Stefan Ringel 4b6ed9fd0b V4L/DVB: tm6000: bugfix video image
bugfix: Avoid loosing frames, causing image delays on some of the image lines.

[mchehab@redhat.com: Fix compilation breakage by merging with the patch fix]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:22:01 -03:00
Stefan Ringel 3569417e5a V4L/DVB: tm6000: add vbi message inside the type switch
add case line for vbi message

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:59 -03:00
Stefan Ringel 0f9bdbc2da V4L/DVB: tm6000: bugfix incorrect size
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:58 -03:00
Dmitri Belimov 2a15ac7ad6 V4L/DVB: tm6000, reset I2C bus function
Add new function for reset I2C bus. Rework some code for use this function.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:57 -03:00
Stefan Ringel b9eb39d8f4 V4L/DVB: tm6000: Remove an extra ; symbol
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:55 -03:00
Stefan Ringel 0439db75c1 V4L/DVB: tm6000: add extension module support
add module init over tm6000 extension

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01 01:21:54 -03:00
Linus Torvalds d28619f156 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
  quota: Convert quota statistics to generic percpu_counter
  ext3 uses rb_node = NULL; to zero rb_root.
  quota: Fixup dquot_transfer
  reiserfs: Fix resuming of quotas on remount read-write
  pohmelfs: Remove dead quota code
  ufs: Remove dead quota code
  udf: Remove dead quota code
  quota: rename default quotactl methods to dquot_
  quota: explicitly set ->dq_op and ->s_qcop
  quota: drop remount argument to ->quota_on and ->quota_off
  quota: move unmount handling into the filesystem
  quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
  quota: move remount handling into the filesystem
  ocfs2: Fix use after free on remount read-only

Fix up conflicts in fs/ext4/super.c and fs/ufs/file.c
2010-05-30 09:11:11 -07:00
Christoph Hellwig 7ea8085910 drop unused dentry argument to ->fsync
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-05-27 22:05:02 -04:00
FUJITA Tomonori 6d256fa886 Staging: saa7134-go7007: replace dma_sync_single with dma_sync_single_for_cpu
dma_sync_single() is deprecated and will be removed soon.

No functional change since dma_sync_single is the wrapper of
dma_sync_single_for_cpu.

saa7134-go7007.c is commented out but anyway let's replace it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:52 -07:00
Dmitry Monakhov 36a32ae000 pohmelfs: Remove dead quota code
Quota on pohmelfs is non-functional. IFAIU quota logic was copy-pasted
from generic setattr().

Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-27 17:39:18 +02:00
Andy Shevchenko 1356de06ce staging: rt2860: use new hex_to_bin() method
Instead of using own implementation involve hex_to_bin() function.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-25 08:07:05 -07:00
Linus Torvalds d79df0b1ed Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (577 commits)
  Staging: ramzswap: Handler for swap slot free callback
  swap: Add swap slot free callback to block_device_operations
  swap: Add flag to identify block swap devices
  Staging: vt6655: use ETH_FRAME_LEN macro instead of custom one
  Staging: vt6655: use ETH_DATA_LEN macro instead of custom one
  Staging: vt6655: use ETH_FCS_LEN macro instead of custom one
  Staging: vt6656: use ETH_HLEN macro instead of custom one
  Staging: comedi: quatech_daqp_cs.c Replace eos semaphore with a completion.
  Staging: dt3155v4l: remove private memory allocator
  Staging: crystalhd: Remove typedefs from driver
  Staging: winbond: Fix for pointer name format issue in mds.c
  Staging: vt6656: removed custom UCHAR/USHORT/UINT/ULONG/ULONGLONG typedefs
  Staging: vt6656: removed custom CHAR/SHORT/INT/LONG typedefs
  Staging: comedi: Altered the way printk is used in 8255.c
  staging: iio: adis16350 and similar IMU driver
  Staging: iio: max1363 Fix two bugs in single_channel_from_ring
  Staging: iio: adis16220 extract bin_attribute structures from state
  Staging: iio: adis16220 vibration sensor driver
  Staging: comedi: Kconfig dependancy fixes
  Staging: comedi: fix up build error from last Kconfig changes
  ...
2010-05-21 15:26:46 -07:00
Greg Kroah-Hartman c8d1a12692 Merge staging-next tree into Linus's latest version
Conflicts:
	drivers/staging/arlan/arlan-main.c
	drivers/staging/comedi/drivers/cb_das16_cs.c
	drivers/staging/cx25821/cx25821-alsa.c
	drivers/staging/dt3155/dt3155_drv.c
	drivers/staging/hv/hv.c
	drivers/staging/netwave/netwave_cs.c
	drivers/staging/wavelan/wavelan.c
	drivers/staging/wavelan/wavelan_cs.c
	drivers/staging/wlags49_h2/wl_cs.c

This required a bit of hand merging due to the conflicts
that happened in the later .34-rc releases, as well as
some staging driver changing coming in through other trees
(v4l and pcmcia).

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-21 12:48:55 -07:00
Chris Wright 2c3c8bea60 sysfs: add struct file* to bin_attr callbacks
This allows bin_attr->read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-21 09:37:31 -07:00
Thomas Gleixner 3142788b79 drivers/base: Convert dev->sem to mutex
The semaphore is semantically a mutex. Convert it to a real mutex and
fix up a few places where code was relying on semaphore.h to be included
by device.h, as well as the users of the trylock function, as that value
is now reversed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-21 09:37:30 -07:00
Linus Torvalds 7a9b149212 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits)
  USB: remove unused usb_buffer_alloc and usb_buffer_free macros
  usb: musb: update gfp/slab.h includes
  USB: ftdi_sio: fix legacy SIO-device header
  USB: kl5usb105: reimplement using generic framework
  USB: kl5usb105: minor clean ups
  USB: kl5usb105: fix memory leak
  USB: io_ti: use kfifo to implement write buffering
  USB: io_ti: remove unsused private counter
  USB: ti_usb: use kfifo to implement write buffering
  USB: ir-usb: fix incorrect write-buffer length
  USB: aircable: fix incorrect write-buffer length
  USB: safe_serial: straighten out read processing
  USB: safe_serial: reimplement read using generic framework
  USB: safe_serial: reimplement write using generic framework
  usb-storage: always print quirks
  USB: usb-storage: trivial debug improvements
  USB: oti6858: use port write fifo
  USB: oti6858: use kfifo to implement write buffering
  USB: cypress_m8: use kfifo to implement write buffering
  USB: cypress_m8: remove unused drain define
  ...

Fix up conflicts (due to usb_buffer_alloc/free renaming) in
	drivers/input/tablet/acecad.c
	drivers/input/tablet/kbtab.c
	drivers/input/tablet/wacom_sys.c
	drivers/media/video/gspca/gspca.c
	sound/usb/usbaudio.c
2010-05-20 21:26:12 -07:00
Linus Torvalds f8965467f3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
  qlcnic: adding co maintainer
  ixgbe: add support for active DA cables
  ixgbe: dcb, do not tag tc_prio_control frames
  ixgbe: fix ixgbe_tx_is_paused logic
  ixgbe: always enable vlan strip/insert when DCB is enabled
  ixgbe: remove some redundant code in setting FCoE FIP filter
  ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
  ixgbe: fix header len when unsplit packet overflows to data buffer
  ipv6: Never schedule DAD timer on dead address
  ipv6: Use POSTDAD state
  ipv6: Use state_lock to protect ifa state
  ipv6: Replace inet6_ifaddr->dead with state
  cxgb4: notify upper drivers if the device is already up when they load
  cxgb4: keep interrupts available when the ports are brought down
  cxgb4: fix initial addition of MAC address
  cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
  cnic: Convert cnic_local_flags to atomic ops.
  can: Fix SJA1000 command register writes on SMP systems
  bridge: fix build for CONFIG_SYSFS disabled
  ARCNET: Limit com20020 PCI ID matches for SOHARD cards
  ...

Fix up various conflicts with pcmcia tree drivers/net/
{pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
wireless/orinoco/spectrum_cs.c} and feature removal
(Documentation/feature-removal-schedule.txt).

Also fix a non-content conflict due to pm_qos_requirement getting
renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
2010-05-20 21:04:44 -07:00
Alan Stern 85bcb5ee88 USB: remove URB_NO_SETUP_DMA_MAP
Now that URB_NO_SETUP_DMA_MAP is no longer in use, this patch (as1376)
removes all references to it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:40 -07:00
Greg Kroah-Hartman c220cc3e37 USB: staging: fix up usb_buffer_alloc calls in the staging tree
This renames the functions usb_buffer_alloc and usb_buffer_free to the correct
ones for the drivers in the staging tree.

Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:38 -07:00
Eric Lescouet 27729aadd3 USB: make hcd.h public (drivers dependency)
The usbcore headers: hcd.h and hub.h are shared between usbcore,
HCDs and a couple of other drivers (e.g. USBIP modules).
So, it makes sense to move them into a more public location and
to cleanup dependency of those modules on kernel internal headers.
This patch moves hcd.h from drivers/usb/core into include/linux/usb/

Signed-of-by: Eric Lescouet <eric@lescouet.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:30 -07:00
Linus Torvalds fb091be08d Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (534 commits)
  V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers
  V4L/DVB: vivi and mem2mem_testdev need slab.h to build
  V4L/DVB: tm6000: bugfix image position
  V4L/DVB: IR/imon: remove dead IMON_KEY_RELEASE_OFFSET
  V4L/DVB: tm6000: README - add vbi
  V4L/DVB: Fix unlock logic at medusa_video_init
  V4L/DVB: fix dvb frontend lockup
  V4L/DVB: s2255drv: remove dead code
  V4L/DVB: s2255drv: return if vdev not found
  V4L/DVB: ov511: cleanup: remove unneeded null check
  V4L/DVB: media/mem2mem: dereferencing free memory
  V4L/DVB: media/IR: Add missing include file to rc-map.c
  V4L/DVB: dvb/stv6110x: cleanup error handling
  V4L/DVB: ngene: Add lgdt3303 and mt2131 deps to Kconfig
  V4L/DVB: ngene: start separating out DVB functions into separate file
  V4L/DVB: ngene: split out card specific code into a separate file
  V4L/DVB: ngene: split out i2c code into a separate file
  V4L/DVB: ngene: add initial support for digital side of Avermedia m780
  V4L/DVB: ngene: properly support boards where channel 0 isn't a TS input
  V4L-DVB: ngene: make sure that tuner headers are included
  ...
2010-05-20 09:37:45 -07:00
Linus Torvalds f39d01be4c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (44 commits)
  vlynq: make whole Kconfig-menu dependant on architecture
  add descriptive comment for TIF_MEMDIE task flag declaration.
  EEPROM: max6875: Header file cleanup
  EEPROM: 93cx6: Header file cleanup
  EEPROM: Header file cleanup
  agp: use NULL instead of 0 when pointer is needed
  rtc-v3020: make bitfield unsigned
  PCI: make bitfield unsigned
  jbd2: use NULL instead of 0 when pointer is needed
  cciss: fix shadows sparse warning
  doc: inode uses a mutex instead of a semaphore.
  uml: i386: Avoid redefinition of NR_syscalls
  fix "seperate" typos in comments
  cocbalt_lcdfb: correct sections
  doc: Change urls for sparse
  Powerpc: wii: Fix typo in comment
  i2o: cleanup some exit paths
  Documentation/: it's -> its where appropriate
  UML: Fix compiler warning due to missing task_struct declaration
  UML: add kernel.h include to signal.c
  ...
2010-05-20 09:20:59 -07:00
Mauro Carvalho Chehab e8d0416796 V4L/DVB (13554a): v4l: Use the video_drvdata function in drivers
Fix all device drivers to use the video_drvdata function instead of
maintaining a local list of minor to private data mappings. Call
video_set_drvdata to register the driver private pointer when not
already done.

Where applicable, the local list of mappings is completely removed when
it becomes unused.

[mchehab.redhat.com: patch broke into two. This one changes just tm6000]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:18 -03:00
Stefan Ringel 3c7c5e9e89 V4L/DVB: tm6000: bugfix image position
bugfix incorrect image and line position in videobuffer

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:17 -03:00
Stefan Ringel 9986da291b V4L/DVB: tm6000: README - add vbi
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:16 -03:00
Mauro Carvalho Chehab 64561a3883 V4L/DVB: Fix unlock logic at medusa_video_init
As reported by Dan Carpenter:
> This was my patch:  "cx25821: fix double unlock in medusa_video_init()"
>
> It accidentally got merged two times.  The version from the staging tree
> is not correct.  Please can you revert it:
> 7a02f549fc "Staging: cx25821: fix double
> unlock in medusa_video_init()"

After reviewing the logic at the function, instead of just adding a patch to
revert the wrong one, the better is to apply a different logic: add a goto
that will always unlock and return the error.

This simplifies the code a little bit, and, instead of just return -EINVAL,
it will return the error condition reported by the called functions.

This patch is folded with another patch from Dan that added one missing
goto.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:59:16 -03:00
Hans Verkuil ffb4877ba0 V4L/DVB: v4l2-common: simplify prio utility functions
v4l2_prio_init/open/close returned an int when in fact they would
always return 0. Make these void functions.

v4l2_prio_close and v4l2_prio_check pass an enum v4l2_priority as a
pointer for no good reason. Replace with a normal enum v4l2_priority
argument.

These changes will simplify the work of moving priority handling into
the v4l core.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:54 -03:00
Dmitri Belimov 1b0e48ad55 V4L/DVB: Rework for support xc5000
Set correct GPIO number for BEHOLD_WANDER/VOYAGER
Add xc5000 callback function
Small rework tm6000_cards_setup function
Small rework tm6000_config_tuner, build mode_mask by config information
Rework for support xc5000 silicon tuner
Add some information messages for more better understand an errors.

[mchehab@redhat.com: Fix CodingStyle and merge conflicts]
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:41 -03:00
Ricardo Maraschini 7ded150f57 V4L/DVB: cx25821-video-upstream.c: Added severity to printk calls
Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:36 -03:00
sai bde4301d9a V4L/DVB: staging:cx25821:fixes coding styles in cx25821-i2c.c
This is a patch to the cx25821-i2c.c file that fixes warning and errors found by checkpatch.pl tool

[mchehab@redhat.com: fix conflicts with changeset 2587a7ef7b8bc3c7db7c43659297b45b168922ab]
Signed-off-by: sai<tsg321@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:36 -03:00
sai 770238bf56 V4L/DVB: staging:cx2581: fixes coding style issues in cx25821-cards.c
This patch fixes all the coding style issues reported by checkpatch.pl tool

Signed-off-by: sai <tsg321@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:35 -03:00
sai gopal 629dcf23df V4L/DVB: cx25821: fix coding style issues in cx25821-alsa.c
This is a patch to cx25821-alsa.c file that fixes of most of the
warning & errors found by checkpatch.pl tool

[mchehab@redhat.com: Fix conflicts with changeset 4e0c923a0d23f86c7331b32bc2aeb280e10e029e]
Signed-off-by: sai gopal <tsg321@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:34 -03:00
Mauro Carvalho Chehab 5a11b6fe5d Fix compilation breakage with tm6000
Randy Dunlap <randy.dunlap@oracle.com>  reported a breakage while compiling
drivers/staging/tm6000, due to this change:
    commit 1c1b78bee1a94f98deeb9c24b21c4812e191646c
    Author: Greg Kroah-Hartman <gregkh@suse.de>
    Date:   Thu Apr 29 15:46:07 2010 -0700

    USB: remove unused usb_buffer_alloc and usb_buffer_free macros

    Now that all callers are converted over, remove the compatibility
    functions and all is good.

As the function got renamed, the rename should also be applied at
tm6000.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:23 -03:00
Mauro Carvalho Chehab 6bc4631dbc V4L/DVB: tm6000: update the todo list
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:22 -03:00
Mauro Carvalho Chehab 4223871357 V4L/DVB: Fix color format with tm6010
The values for the fourcc format were correct, but applied to the
wrong register. With this change, video is now barely working again with
tm6000.

While here, let's remove, for now, the memset. This way, people can
have some image when testing this device.

Yet to be fixed: parts of the image frame are missed. As we don't clean
the buffers anymore, this is "recovered" by repeating the values from a
previous frame. The quality is bad, since the image pixels will contain
data from some previous frames, generating weird delay artifacts.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:22 -03:00
Roel Van Nyen 9d5164da8d V4L/DVB: tm6000: fix coding style issues of tm6000-cards.c
fix coding style issues

[mchehab@redhat.com: Fix conflicts with other patches]
Signed-off-by: Roel Van Nyen <roel.vannyen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:21 -03:00
Stefan Ringel e18f58c626 V4L/DVB: tm6000: renaming firmware
renaming tm6000-xc3028.fw to xc3028-v24.fw

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:20 -03:00
Stefan Ringel 120756e10e V4L/DVB: tm6000: bugfix analog init for tm6010
- change values in function tm6000_set_fourcc_format
- disable digital source
- add vbi and audio init

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:20 -03:00
Mauro Carvalho Chehab 801dd3b32d V4L/DVB: tm6000: Don't copy outside the buffer
tm6000 tm6000_irq_callback :urb resubmit failed (error=-1)
BUG: unable to handle kernel paging request at 000000000100f700
IP: [<ffffffffa007ee79>] tm6000_irq_callback+0x51e/0xac7 [tm6000]

(gdb) list * tm6000_irq_callback+0x51e
0x2e79 is in tm6000_irq_callback (drivers/staging/tm6000/tm6000-video.c:363).
358                                             dev->isoc_ctl.tmp_buf_len--;
359                                     }
360                                     if (dev->isoc_ctl.tmp_buf_len) {
361                                             memcpy (&header,p,
362                                                     dev->isoc_ctl.tmp_buf_l$
363                                             memcpy (((u8 *)header)+
364                                                     dev->isoc_ctl.tmp_buf,
365                                                     ptr,
366                                                     4-dev->isoc_ctl.tmp_buf$
367                                             ptr+=4-dev->isoc_ctl.tmp_buf_le$

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:19 -03:00
Mauro Carvalho Chehab f4b727b3ae V4L/DVB: tm6000: Fix a panic if buffer become NULL
Changing a video standard takes a long time to happen on tm6000, since it
needs to load another firmware, and the i2c implementation on this device
is really slow. When the driver tries to change the video standard, a
kernel panic is produced:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffffa0c7b48a>] tm6000_irq_callback+0x57f/0xac2 [tm6000]
...
Kernel panic - not syncing: Fatal exception in interrupt

By inspecting it with gdb:

(gdb) list *tm6000_irq_callback+0x57f
0x348a is in tm6000_irq_callback (drivers/staging/tm6000/tm6000-video.c:202).
197             /* FIXME: move to tm6000-isoc */
198             static int last_line = -2, start_line = -2, last_field = -2;
199
200             /* FIXME: this is the hardcoded window size
201              */
202             unsigned int linewidth = (*buf)->vb.width << 1;
203
204             if (!dev->isoc_ctl.cmd) {
205                     c = (header >> 24) & 0xff;
206

Clearly, it was the trial to access *buf, at line 202 that caused the
Panic.

As ioctl is serialized, While S_STD is handled,QBUF/DQBUF won't be called.
So, the driver will run out of the buffers, and *buf will become NULL.

As, on tm6000, the same URB can contain more than one video buffer, it is
likely to hit a condition where no new buffer is available whily copying
the streams. The fix is to leave the URB copy loop, if there's no more buffers
are available.

The same bug could also be produced by an application that is not fast enough
to request new video buffers.

The same bug were reported by Bee Hock Goh <beehock@gmail.com>.

Thanks-to: Bee Hock Goh <beehock@gmail.com> for reporting the bug
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:19 -03:00
Mauro Carvalho Chehab 6ae635c4f3 V4L/DVB: tm6000: Properly set alternate when preparing to stream
Although the code is getting the better alternates, it is not really using
it. Get the interface/alternate numbers and use it where needed.

This patch implements also one small fix at the last_line set, as
proposed by Bee Hock Goh <behock@gmail.com>.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:18 -03:00
Bee Hock Goh 1ebf2c7f78 V4L/DVB: tm6000: Add additional GPIO for UT821 during frmware loading
Signed-off-by: Bee Hock Goh <beehock@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:18 -03:00
Dmitri Belimov 20dead8da8 V4L/DVB: tm6000: fix i2c read
Set correct limit for I2C packet.
Use different method for the tm5600/tm6000 and tm6010 to read word.

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:58:17 -03:00
Mauro Carvalho Chehab af9d9cfd54 V4L/DVB: tm6000: fix compilation due to the lack of a semicolon
Add a missing semicolon to fix this error:

In file included from drivers/staging/tm6000/tm6000-cards.c:32:
drivers/staging/tm6000/tm6000.h:123: error: two or more data types in
declaration specifiers

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:36 -03:00
Bee Hock Goh c16dd82b48 V4L/DVB: TM6000: Fix code which cause memory corruption
The driver was doing malloc when buf is null causing memory corruption.

The analog part is still pretty much broken but at least fixing this
will stop it from crashing the machine when streamon.

Signed-off-by: Bee Hock Goh <beehock@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:33 -03:00
Stefan Ringel 2f79088486 V4L/DVB: tm6000: request labeling board version check
request labeling board version check

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:32 -03:00
Stefan Ringel f1434f4e90 V4L/DVB: tm6000: tm6000_i2c_xfer: request labeling
labeling the request after tuner reading and writeing

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:31 -03:00
Stefan Ringel b57f432c28 V4L/DVB: tm6000: add gpios for tm6010 generic board
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 2edab1ee86 V4L/DVB: tm6000: add gpios to board struct
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:28 -03:00
Stefan Ringel 32a2232bfd V4L/DVB: tm6000: switch to gpio strcut
switch to a gpio structure

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:27 -03:00
Andreas Bombe dab7e3106d V4L/DVB: V4L2: Replace loops for finding max buffers in VIDIOC_REQBUFS callbacks
Due to obvious copy and paste coding a number of video capture drivers
which implement a limit on the buffer memory decremented the user
supplied buffer count in a while loop until it reaches an acceptable
value.

This is a silly thing to do when the maximum value can be directly
computed.

Signed-off-by: Andreas Bombe <aeb@debian.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:57:13 -03:00
Olimpiu Pascariu 1099123517 V4L/DVB: cx25821: fix coding style issues in cx25821-video-upstream.c
This is a patch to cx25821-video-upstream.c file that fixes up warnings
and errors found by the checkpatch.pl tool

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19 12:56:40 -03:00
Nitin Gupta 107c161b7d Staging: ramzswap: Handler for swap slot free callback
Install handler for swap_slot_free_notify callback which is called
when a swap slot is no longer used. This handler immediately frees
memory allocated corresponding to the given swap slot.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Nigel Cunningham <nigel@tuxonice.net>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 15:07:52 -07:00
Charles Clément f4a68b9388 Staging: vt6655: use ETH_FRAME_LEN macro instead of custom one
Replace custom maximum packet lenght definition MAX_PACKET_LEN by
ETH_FRAME_LEN from <linux/if_ether.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 15:00:02 -07:00
Charles Clément 31c21b7791 Staging: vt6655: use ETH_DATA_LEN macro instead of custom one
Replace custom maximum data lenght definition MAX_DATA_LEN by
ETH_DATA_LEN from <linux/if_ether.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:58:32 -07:00
Charles Clément 855181f515 Staging: vt6655: use ETH_FCS_LEN macro instead of custom one
Replace custom FCS/CRC length definition U_CRC_LEN by ETH_FCS_LEN
from <linux/if_ether.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:55:05 -07:00
Charles Clément 21ec51f3df Staging: vt6656: use ETH_HLEN macro instead of custom one
Replace custom header length definition U_HEADER_LEN by ETH_HLEN
from <linux/if_ether.h>. Also remove unused U_TYPE_LEN.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:55:05 -07:00
Alessio Igor Bogani 7ec52ed250 Staging: comedi: quatech_daqp_cs.c Replace eos semaphore with a completion.
Build tested only.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:53:17 -07:00
Marin Mitov a57941c2e7 Staging: dt3155v4l: remove private memory allocator
This patch removes the private memory allocator
and all conjugated functions. Now the driver uses
videobuf-dma-contig module for allocations.
Added reserving 4MB coherent memory for private
per device allocations at probe time.

Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:53:17 -07:00
Lior Dotan abfc768d9e Staging: crystalhd: Remove typedefs from driver
Remove typedefs from driver

Signed-of-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:53:17 -07:00
Adam Latham 973267a212 Staging: winbond: Fix for pointer name format issue in mds.c
This patch fixes the unnecessary whitespace found in pointer names in
the mds.c file found by the checkpatch.pl tool

Signed-off-by: Adam Latham <adam.latham@unisontorbay.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:51:08 -07:00
Andres More cc856e61ee Staging: vt6656: removed custom UCHAR/USHORT/UINT/ULONG/ULONGLONG typedefs
Cleared all checkpatch warnings but 'do not add new typedefs' ones.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:51:08 -07:00
Andres More 213d2e9322 Staging: vt6656: removed custom CHAR/SHORT/INT/LONG typedefs
Cleared all checkpatch warnings but one 'do not add new typedefs'

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:50:30 -07:00
Mark 0263869760 Staging: comedi: Altered the way printk is used in 8255.c
This patch moves around the use of printk calls in 8255.c to include accurate
logging levels and in turn fixes a few warnings from checkpatch.

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:49:23 -07:00
Barry Song 5763dcab5c staging: iio: adis16350 and similar IMU driver
This version has the right part number in the commit message.
Whilst technically the part I listed last time is also supported
by the driver, the commit message might have caused confusion.

Another driver from Barry at Analog.  Again, I've lifted
if from the blackfin tree and done the usual sparse
and checkpatch fixes + the abi changes.  I actually
have one of these, so am particularly pleased to see
it supported!

Signed-off-by: Barry Song <Barry.Song@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:44:28 -07:00
Jonathan Cameron 81b77f94a1 Staging: iio: max1363 Fix two bugs in single_channel_from_ring
This patch contains fixes for the two bugs Michael pointed
out last week.  As the other suggestion Michael made is
not a bug fix (just a much more sensible way of handling
things), I'll do that as a separate patch soon.

The bugs were introduced with the abi changes.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reported-by: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:43:08 -07:00
Jonathan Cameron 9a3af585e7 Staging: iio: adis16220 extract bin_attribute structures from state
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:42:57 -07:00
Barry Song 06f1962ab4 Staging: iio: adis16220 vibration sensor driver
Signed-off-by: Barry Song <Barry.Song@analog.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:40:47 -07:00
Alexander Kurz ba2450b89b Staging: comedi: Kconfig dependancy fixes
There are three minor changes I would like to do on my last patch:

* Comedi is formally not dependant on any hardware, e.g. it is possible
  to use comedi_test without (PCI || PCMCIA || PCCARD || USB || ISA)
* comedi_parport is not dependant on PARPORT_PC.
* indirect ni_mio_cs (16-bit PCMCIA) dependancy on mite PCI-chip may
  confuse users, thus changing COMEDI_NI_TIO depends on COMEDI_MITE
  to select COMEDI_MITE.

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:31:34 -07:00
Greg Kroah-Hartman 77f047e257 Staging: comedi: fix up build error from last Kconfig changes
We need the 8255 module to be present for some PCI comedi
modules.  So for now, just build the thing.  We need some better
Kconfig rules to figure this out properly.

Cc: Alexander Kurz <linux@blala.de>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:29:33 -07:00
Alexander Kurz f1d7dbbef5 Staging: comedi: new Kconfig and Makefiles, drivers grouped by bustype.
PC/104-drivers went into ISA,
PC/104+ went into PCI,
Drivers without a bustype went into "misc".
In doubt drivers supporting both ISA/PCI went into PCI.
Drivers without any detailed hardware info went into ISA, e.g. fl512.c
Some NI drivers are used by other NI drivers from different bustypes
are grouped seperately in NI_COMMON.

[tweaked by gregkh to handle the new driver recently added]

Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@speakeasy.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-18 14:23:12 -07:00
Mauro Carvalho Chehab f2466d63a5 V4L/DVB: cx25821: prepend cx25821_ to video exported symbols
As reported by Randy Dunlap <randy.dunlap@oracle.com>:
drivers/staging/cx25821/cx25821-video.c:89:struct cx25821_fmt *format_by_fourcc(unsigned int fourcc)
(not static)

conflicts with (has the same non-static name as)

drivers/media/common/saa7146_video.c:87:struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc)

To solve, add cx25821_ prefix to the exported functions found on cx25821-video.h.

This patch were generated by this little shell/perl script:

cat drivers/staging/cx25821/cx25821-video.h|perl -ne \
'if (m/extern.* ([^\s\*]+)\(/) { $n=$1; print "s/([^\d\w_\.])$1/\\1cx25821_$1/g;\n" if (!($n =~ m/cx25821/)); }' \
>changes; for i in drivers/staging/cx25821/*.[ch]; do sed -r -f changes $i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
2010-05-18 00:51:17 -03:00
Mauro Carvalho Chehab d7d9338742 V4L/DVB: cx25821-video.c: fix table indent
Table indent were likely damaged by Lindent. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
2010-05-18 00:51:16 -03:00
Olimpiu Pascariu 51e9dd3249 V4L/DVB: cx25821: fix coding style issues in cx25821-i2c.c
Fixes up warnings and errors found by the checkpatch.pl tool
on cx25821-i2c.c

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
Cc: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:15 -03:00
Olimpiu Pascariu 0dd8be8c94 V4L/DVB: cx25821: fix coding style issues in cx25821-medusa-video.c
Fixes up warnings and errors found by the checkpatch.pl tool on
cx25821-medusa-video.c

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Cc: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:14 -03:00
Olimpiu Pascariu 1c614239b6 V4L/DVB: cx25821: fix coding style issues in cx25821-gpio.c
Fixes up warnings and errors found by the checkpatch.pl tool on
cx25821-gpio.c.

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
Cc: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:14 -03:00
Olimpiu Pascariu de2c434920 V4L/DVB: cx25821: fix coding style issues in cx25821-core.c
Fixes up warnings and errors found by the checkpatch.pl tool on
cx25821-core.c.

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
CC: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:13 -03:00
Mauro Carvalho Chehab b5f11cc703 V4L/DVB: cx25821-audio-upstream.c: Fixed some checkpatch.pl warnings/errors
This patch fixes up some warnings&errors found by the checkpatch.pl script

Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
CC: Palash Bandyopadhyay <palash.bandyopadhyay@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:51:02 -03:00
Olimpiu Pascariu 8889a8a53e V4L/DVB: Staging: cx25821: fix coding style issues in cx25821-alsa.c
>From 9473816c446a6ca91905fc49a73732f70b5223b4 Mon Sep 17 00:00:00 2001
 This is a patch to the cx25821-alsa.c file that fixes up errors and warnings found by the checkpatch.pl tool

[mchehab@redhat.com: a few adjustments on the comments to improve readability]
Signed-off-by: Olimpiu Pascariu <olimpiu.pascariu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:18 -03:00
Mauro Carvalho Chehab 2415a2c14e V4L/DVB: tm6000: replace occurences of req05 magic by a naming alias
Yet another naming replace magic thanks to perl scripts. This time, it
is done with:

cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\,
0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf
"s/REQ_${req}_SET_GET_USBREG, 0x[0]*$3,/$1,/\n" }'  >a; for i in tm*.c;
do sed -f a $i >b && mv b $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:12 -03:00
Mauro Carvalho Chehab d9a7240736 V4L/DVB: tm6000: add request to registers of the group 05
Yet another script magic. This time, the change were generated by this
script:

cat tm6000-regs.h |perl -ne 'if (m/^(\#define TM6010_REQ)(05)([^\s]+)(\s+)0x([A-F0-9].)/) { \
$name="$1$2$3"; $sp=$4; $req=$2; $val=$5; $val=~tr/A-F/a-f/; \
printf "$name%s0x%s, 0x%s\n", $sp, $req, $val; } else { print $_ }' \
>a; mv a tm6000-regs.h

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:11 -03:00
Mauro Carvalho Chehab f7d110c68c V4L/DVB: tm6000: Replace naming convention for registers of req 05 group
After looking at the "magic" registers, it is clear that usb registers
belong to request 5.

Replace them with this script:

cat /tmp/reg3 |perl -ne 'if (m/define (TM6000_U_)([^\s]+)\s+0x([A-F0-9].)/) { \
$name=$2; $val=$3; printf "s,$1$2,TM6010_REQ05_R%s_%s,g\n", $val, $name; }' >a;
sed -f a tm6000-regs.h >b; mv b tm6000-regs.h

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:10 -03:00
Mauro Carvalho Chehab 9afec493e2 V4L/DVB: tm6000: Replace all magic values by a register alias
Instead of using magic pairs of req/reg, replace them by the defined
values.

This patch were generated by the following script:

cat tm6000-regs.h |perl -ne 'if (m/(TM6010_REQ[^\s]+)\s+0x([a-f0-9]+)\,
0x([a-f0-9]+)/) { $name="$1"; $req=$2; $val=$3; printf
"s/REQ_${req}_SET_GET_AVREG[_BIT]*, 0x[0]*$3,/$1,/\n" }'  >a; for i in
tm*.c; do sed -f a $i >b && mv b $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:09 -03:00
Mauro Carvalho Chehab 77012fb995 V4L/DVB: tm6000: Add request at Req07/Req08 register definitions
Use a pair Req/Reg for all registers at req07 and req08 groups. This
makes easier to replace them at the code with a script and helps to
avoid using the wrong req with some register.

This change were generated by this script:

if (m/^(\#define TM6010_REQ)([0-9].)([^\s]+)(\s+)0x([A-F0-9].)/) {
$name="$1$2$3"; $sp=$4; $req=$2; $val=$5; $val=~tr/A-F/a-f/; printf
"$name%s0x%s, 0x%s\n", $sp, $req, $val; } else { print $_ }

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:09 -03:00
Mauro Carvalho Chehab c4bccf5e78 V4L/DVB: tm6000: Replace all Req 8 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x08 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.

This patch were made with the help of this simple perl script, applied
over the definitions of the last register groups:

if (m/define (TM6000_)([^\s]+)\s+0x([A-F0-9].)/) { $name=$2;
$val=$3; printf "s,$1$2,TM6010_REQ08_R%s_%s,g\n", $val, $name; }

And were manually adjusted to fix a few minor issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:08 -03:00
Mauro Carvalho Chehab b8e286260e V4L/DVB: tm6000: Replace all Req 7 group of regs with another naming convention
According with the original patch that added the register names, those
are related to tm6010, so name it properly as such. Also, clearly
indicates when a register belongs to Request 0x07 and add its register
value at the name. This makes easier to double check if the proper
register is used along the driver.

This patch were made with the help of this simple perl script:

if (m/define (TM6000_)([^\s]+)\s+0x([A-F0-9].)/) { $name=$2; $val=$3;
printf "s,$1$2,TM6010_REQ07_R%s_%s,g\n", $val, $name; }

And were manually adjusted to fix a few minor issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:07 -03:00
Stefan Ringel 8b0d2a0527 V4L/DVB: tm6000: add new hybrid-stick
-add Hauppauge WinTV HVR 900H/WinTV USB2-Stick
	vid/pid
	0x2040/6601
	0x2040/6610
	0x2040/6611

-add Terratec Cinergy Hybrid-Stick
	vid/pid
	0x0ccd/0x00a5

-add Twinhan TU501(704D1)
	vid/pid
	0x13d3/0x3240
	0x13d3/0x3241
	0x13d3/0x3243
	0x13d3/0x3264

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:02 -03:00
Dmitri Belimov 723fb9b79b V4L/DVB: tm6000 register defines
Add defines for all registers of the tm6000 module.
This defines made by doc for TM6010, need look docs for TM6000 and TM5600
Some registers can be different.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:46:32 -03:00
Stefan Ringel 02512fe33e V4L/DVB: tm6000: bugfix reading problems with demodulator zl10353
Reading from zl10353 with tm6000 has a bug. For example:

regs  w/o patch  with patch

0x06     0x00        0x7f
0x07     0x33        0x30
0x08     0x00        0x00
0x09     0x58        0x50
0x0f     0x31        0x28
0x10     0x00        0x84

This patch provides the workaround for the bug

[mchehab@redhat.com: Fix merge conflict and add a comment at the workaround]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:44:08 -03:00
Stefan Ringel 4e11502d45 V4L/DVB: tm6000: add send and recv function
Split the i2c send and receive functions on separate functions

[mchehab@redhat.com: CodingStyle and fix the logic for more than 2 read values]
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:44:08 -03:00