Commit Graph

11119 Commits (1fde28cffb6953487e0ab96a4123f4443d499364)

Author SHA1 Message Date
Hyunwoong Kim 1b09f292eb [media] s5p-fimc: update checking scaling ratio range
Horizontal and vertical scaling range are according to the following equations.
If (SRC_Width >= 64 x DST_Width) { Exit(-1);  /* Out of Horizontal scale range}
If (SRC_Height >= 64 x DST_Height) { Exit(-1);  /* Out of Vertical scale range}

fimc_check_scaler_ratio() is used to check if horizontal and vertical
scale range are valid or not. To use fimc_check_scaler_ratio,
source and destination format should be set by VIDIOC_S_FMT.
And in case of scaling up, it doesn't have to check the scale range.

Reviewed-by: Jonghun Han <jonghun.han@samsung.com>
Signed-off-by: Hyunwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:40 -03:00
Sylwester Nawrocki 70f66ea2aa [media] s5p-fimc: Move scaler details handling to the register API file
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Hyunwoong Kim b241c6d6f4 [media] s5p-fimc: Configure scaler registers depending on FIMC version
The main scaler has four SFRs for main scaler ratio depending on FIMC version.
FIMC 4.x has only two SFRs and FIMC 5.x has four SFRs for main scaler.
Those are MainHorRatio, MainHorRatio_ext, MainVerRatio and MainverRatio_ext.

The FIMC 5.x has 15 bit resolution for scaling ratio as below.
{MainHorRatio,MainHorRatio_ext} = {[14:6],[5:0]}.
{MainVerRatio,MainVerRatio_ext} = {[14:6],[5:0]}.
MainHorRatio = CISCCTRL[24:16], MainHorRatio_ext = CIEXTEN[15:10]
MainVerRatio = CISCCTRL[8:0],   MainVerRatio_ext = CIEXTEN[5:0]

This patch supports FIMC 4.x and FIMC 5.x using platform_device_id::driver_data.

Reviewed-by: Jonghun Han <jonghun.han@samsung.com>
Signed-off-by: Hyunwoong Kim <khw0178.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Hyunwoong Kim 10038bea7a [media] s5p-fimc: fix the value of YUV422 1-plane formats
Some color formats are mismatched in s5p-fimc driver.
CIOCTRL[1:0], order422_out, should be set 2b'00 not 2b'11
to use V4L2_PIX_FMT_YUYV. Because in V4L2 standard V4L2_PIX_FMT_YUYV means
"start + 0: Y'00 Cb00 Y'01 Cr00 Y'02 Cb01 Y'03 Cr01". According to datasheet
2b'00 is right value for V4L2_PIX_FMT_YUYV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Sylwester Nawrocki a25be18dfb [media] s5p-fimc: Add control of the external sensor clock
Manage the camera sensor clock in the host driver rather than
leaving this task for sensor drivers. The clock frequency
must be passed in the sensor's and host driver's platform data.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Sylwester Nawrocki ac75934cc6 [media] s5p-fimc: Enable simultaneous rotation and flipping
Map all (0, 90, 180, 270) deg counterclockwise rotation and
horizontal and vertical flip controls to (0, 90) deg rotation,
horizontal and vertical flip transformations available
in the device.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Sylwester Nawrocki d9160afd31 [media] s5p-fimc: Use default input DMA burst count
Increase the input DMA "successive burst count" to default
value 4 to improve DMA performance. Minor cleanup.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:39 -03:00
Sylwester Nawrocki e9654ef287 [media] s5p-fimc: Enable interworking without subdev s_stream
Prevent VIDIOC_STREAMON failing when s_stream callback is
not implemented by a sensor subdev driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:38 -03:00
Sylwester Nawrocki 3d0ce7ed03 [media] s5p-fimc: Derive camera bus width from mediabus pixelcode
Remove bus_width from s5p_fimc_isp_info data structure.
Determine camera data bus width based on mediabus pixel format.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:38 -03:00
Sylwester Nawrocki df7e09a351 [media] s5p-fimc: Rename s3c_fimc* to s5p_fimc*
Change s3c_fimc.h header file name to s5p_fimc.h, replace s3c_fimc_*
names with s5p_fimc_*. s3c_fimc need to be reserved for S3C series
and s5p-fimc driver will not cover CAMIF devices in S3C SoC series.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:38 -03:00
Sylwester Nawrocki 8293ebfce2 [media] s5p-fimc: Use v4l core mutex in ioctl and file operations
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:36 -03:00
Sylwester Nawrocki ef7af59b2c [media] s5p-fimc: Conversion to multiplanar formats
Conversion to multiplanar color formats and minor cleanup.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:36 -03:00
Sylwester Nawrocki 2dab38e227 [media] s5p-fimc: Porting to videobuf 2
Porting to videobuf 2 and minor cleanup.
Separate videobuf_queue_ops are are created for m2m
and capture video nodes.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:36 -03:00
Marek Szyprowski d80ee38cd8 [media] v4l: mem2mem: port m2m_testdev to vb2
This patch ports mem2mem test device to videobuf2 framework.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:35 -03:00
Marek Szyprowski 908a0d7c58 [media] v4l: mem2mem: port to videobuf2
Port memory-to-memory framework to videobuf2 framework.

Add support for multi-planar Video for Linux 2 API extensions to the
memory-to-memory driver framework.

Based on the original patch written by Pawel Osciak.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:35 -03:00
Mauro Carvalho Chehab 08b99e26a3 [media] vb2 core: Fix a few printk warnings
drivers/media/video/videobuf2-core.c: In function ‘__vb2_perform_fileio’:
drivers/media/video/videobuf2-core.c:1638: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’
drivers/media/video/videobuf2-core.c:1697: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’
drivers/media/video/videobuf2-core.c:1703: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Marek Szyprowski b25748fe61 [media] v4l: videobuf2: add read() and write() emulator
Add a generic file io (read and write) emulator for videobuf2. It uses
MMAP memory type buffers and generic vb2 calls: req_bufs, qbuf and
dqbuf. Video date is being copied from mmap buffers to userspace with
standard copy_to_user() function. To add support for file io the driver
needs to provide an additional callback - read_setup or write_setup. It
should provide the default number of buffers used by emulator and flags.

With these flags one can detemine the style of read() or write()
emulation. By default 'streaming' style is used. With
VB2_FILEIO_READ_ONCE flag one can select 'one shot' mode for read()
emulator. With VB2_FILEIO_WRITE_IMMEDIATE flag one can select immediate
conversion of write calls to qbuf for write() emulator, so the vb2 will
not wait until each buffer is filled completely before queueing it to
the driver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Andrzej Pietrasiewicz 5ba3f757f0 [media] v4l: videobuf2: add DMA scatter/gather allocator
Add an implementation of DMA scatter/gather allocator and handling
routines for videobuf2.

For mmap operation mode it is implemented on top of
alloc_page + sg_set_page/_free_page.

For userptr operation mode it is implemented on top of
get_user_pages + sg_set_page/put_page.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Pawel Osciak 1a758d4e84 [media] v4l: videobuf2: add DMA coherent allocator
Add an implementation of DMA coherent memory allocator and handling
routines for videobuf2, implemented on top of dma_alloc_coherent() call.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Pawel Osciak 3c18ff06d8 [media] v4l: videobuf2: add vmalloc allocator
Add an implementation of contiguous virtual memory allocator and handling
routines for videobuf2, implemented on top of vmalloc()/vfree() calls.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Marek Szyprowski 004cc3781c [media] v4l: videobuf2: add generic memory handling routines
Add generic memory handling routines for userspace pointer handling,
contiguous memory verification and mapping.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Pawel Osciak e23ccc0ad9 [media] v4l: add videobuf2 Video for Linux 2 driver framework
Videobuf2 is a Video for Linux 2 API-compatible driver framework for
multimedia devices. It acts as an intermediate layer between userspace
applications and device drivers. It also provides low-level, modular
memory management functions for drivers.

Videobuf2 eases driver development, reduces drivers' code size and aids in
proper and consistent implementation of V4L2 API in drivers.

Videobuf2 memory management backend is fully modular. This allows custom
memory management routines for devices and platforms with non-standard
memory management requirements to be plugged in, without changing the
high-level buffer management functions and API.

The framework provides:
- implementations of streaming I/O V4L2 ioctls and file operations
- high-level video buffer, video queue and state management functions
- video buffer memory allocation and management

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:34 -03:00
Pawel Osciak 52a3082fea [media] v4l: Add compat functions for the multi-planar API
Add multi-planar ioctl handling to the 32bit compatibility layer.

[mchehab@redhat.com: Merged with a fixup patch from Pawel]
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Pawel Osciak d14e6d76eb [media] v4l: Add multi-planar ioctl handling code
Add multi-planar API core ioctl handling and conversion functions.

[mchehab@redhat.com: CondingStyle fixup]
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Pawel Osciak f8f3914cf9 [media] v4l: Add multi-planar API definitions to the V4L2 API
Multi-planar API is as a backwards-compatible extension of the V4L2 API,
which allows video buffers to consist of one or more planes. Planes are
separate memory buffers; each has its own mapping, backed by usually
separate physical memory buffers.

Many different uses for the multi-planar API are possible, examples
include:
- embedded devices requiring video components to be placed in physically
separate buffers, e.g. for Samsung S3C/S5P SoC series' video codec,
Y and interleaved Cb/Cr components reside in buffers in different
memory banks;
- applications may receive (or choose to store) video data of one video
buffer in separate memory buffers; such data would have to be temporarily
copied together into one buffer before passing it to a V4L2 device;
- applications or drivers may want to pass metadata related to a buffer and
it may not be possible to place it in the same buffer, together with video
data.

[mchehab@redhat.com: CodingStyle fixes]
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Mauro Carvalho Chehab 4ec02ea0d8 [media] technisat-usb2: Don't use a deprecated call
drivers/media/dvb/dvb-usb/technisat-usb2.c: In function ‘technisat_usb2_disconnect’:
drivers/media/dvb/dvb-usb/technisat-usb2.c:770: warning: ‘cancel_rearming_delayed_work’ is deprecated (declared at include/linux/workqueue.h:421)

Cc: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Patrick Boettcher 739ff04f63 [media] technisat-usb2: added driver for Technisat's USB2.0 DVB-S/S2 receiver
This patch is adding support for Technisat's new USB2.0 DVB-S/S2 receiver
device. The development was sponsored by Technisat.

The Green led is toggle depending on the frontend-state. The Red LED is turned
on all the time.

The MAC address reading from the EEPROM along with the
LRC-method to check whether its valid.

Support for the IR-receiver of the Technisat USB2 box. The keys of
small, black remote-control are built-in, repeated key behaviour are
simulated.

The i2c-mutex of the dvb-usb-structure is used as a general mutex for
USB requests, as there are 3 threads racing for atomic requests
consisting of multiple usb-requests.

A module option is there which disables the toggling of LEDs by the
driver on certain triggers. Useful when being used in a "dark"
environment.

[mchehab@redhat.com: Fix merge conflicts with RC renaming patches]
Signed-off-by: Martin Wilks <m.wilks@technisat.com>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Patrick Boettcher 4f7200a8a0 [media] stv090x: add tei-field to config-structure
Some backends want to receive the full transport stream including
uncorrected packets. To have that feature this patchs add a field to
the config-structure called TEI (transport stream error indicator).

Cc:  Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Martin Wilks <m.wilks@technisat.com>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:33 -03:00
Patrick Boettcher b4797048f7 [media] stv090x: added function to control GPIOs from the outside
This patch STV090X adds and exports a function to control the GPIOs of
the stv090x-devices.

Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Martin Wilks <m.wilks@technisat.com>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21 20:31:32 -03:00
Linus Torvalds a952baa034 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (64 commits)
  Input: tsc2005 - remove 'disable' sysfs attribute
  Input: tsc2005 - add open/close
  Input: tsc2005 - handle read errors from SPI layer
  Input: tsc2005 - do not rearm timer in hardirq handler
  Input: tsc2005 - don't use work for 'pen up' handling
  Input: tsc2005 - do not use 0 in place of NULL
  Input: tsc2005 - use true/false for boolean variables
  Input: tsc2005 - hide selftest attribute if we can't reset
  Input: tsc2005 - rework driver initialization code
  Input: tsc2005 - set up bus type in input device
  Input: tsc2005 - set up parent device
  Input: tsc2005 - clear driver data after unbinding
  Input: tsc2005 - add module description
  Input: tsc2005 - remove driver banner message
  Input: tsc2005 - remove incorrect module alias
  Input: tsc2005 - convert to using dev_pm_ops
  Input: tsc2005 - use spi_get/set_drvdata()
  Input: introduce tsc2005 driver
  Input: xen-kbdfront - move to drivers/input/misc
  Input: xen-kbdfront - add grant reference for shared page
  ...
2011-03-19 22:27:06 -07:00
Linus Torvalds 4c5811bf46 Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits)
  tty: serial: altera_jtaguart: Add device tree support
  tty: serial: altera_uart: Add devicetree support
  dt: eliminate of_platform_driver shim code
  dt: Eliminate of_platform_{,un}register_driver
  dt/serial: Eliminate users of of_platform_{,un}register_driver
  dt/usb: Eliminate users of of_platform_{,un}register_driver
  dt/video: Eliminate users of of_platform_{,un}register_driver
  dt/net: Eliminate users of of_platform_{,un}register_driver
  dt/sound: Eliminate users of of_platform_{,un}register_driver
  dt/spi: Eliminate users of of_platform_{,un}register_driver
  dt: uartlite: merge platform and of_platform driver bindings
  dt: xilinx_hwicap: merge platform and of_platform driver bindings
  ipmi: convert OF driver to platform driver
  leds/leds-gpio: merge platform_driver with of_platform_driver
  dt/sparc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: move of_bus_type infrastructure to ibmebus
  drivercore/dt: add a match table pointer to struct device
  dt: Typo fix.
  altera_ps2: Add devicetree support
  ...
2011-03-16 17:28:10 -07:00
Linus Torvalds 9179746652 Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] mantis_pci: remove asm/pgtable.h include
  [media] tda829x: fix regression in probe functions
  [media] mceusb: don't claim multifunction device non-IR parts
  [media] nuvoton-cir: fix wake from suspend
  [media] cx18: Add support for Hauppauge HVR-1600 models with s5h1411
  [media] ivtv: Fix corrective action taken upon DMA ERR interrupt to avoid hang
  [media] cx25840: fix probing of cx2583x chips
  [media] cx23885: Remove unused 'err:' labels to quiet compiler warning
  [media] cx23885: Revert "Check for slave nack on all transactions"
  [media] DiB7000M: add pid filtering
  [media] Fix sysfs rc protocol lookup for rc-5-sz
  [media] au0828: fix VBI handling when in V4L2 streaming mode
  [media] ir-raw: Properly initialize the IR event (BZ#27202)
  [media] s2255drv: firmware re-loading changes
  [media] Fix double free of video_device in mem2mem_testdev
  [media] DM04/QQBOX memcpy to const char fix
2011-03-10 13:22:10 -08:00
Arnaud Patard (Rtp) a4e36e60a6 [media] mantis_pci: remove asm/pgtable.h include
mantis_pci.c is including asm/pgtable.h and it's leading to a build failure on
arm. It has been noticed here :

https://buildd.debian.org/fetch.cgi?pkg=linux-2.6&arch=armel&ver=2.6.38~rc6-1~experimental.1&stamp=1298430952&file=log&as=raw

As this header doesn't seem to be used, I'm removing it. I've build tested it
with arm and x86.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-03 10:15:35 -03:00
Jarod Wilson 89a8969afa [media] tda829x: fix regression in probe functions
In commit 567aba0b79, the probe address
for tda8290_probe and tda8295_probe was hard-coded to 0x4b, which is the
default i2c address for those devices, but its possible for the device
to be at an alternate address, 0x42, which is the case for the HVR-1950.
If we probe the wrong address, probe fails and we have a non-working
device. We have the actual address passed into the function by way of
i2c_props, we just need to use it. Also fix up some copy/paste comment
issues and streamline debug spew a touch. Verified to restore my
HVR-1950 to full working order.

Special thanks to Ken Bass for reporting the issue in the first place,
and to both he and Gary Buhrmaster for aiding in debugging and analysis
of the problem.

Reported-by: Ken Bass <kbass@kenbass.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 14:18:12 -03:00
Jarod Wilson a6994eb0a7 [media] mceusb: don't claim multifunction device non-IR parts
There's a Realtek combo card reader and IR receiver device with multiple
usb interfaces on it. The mceusb driver is incorrectly grabbing all of
them. This change should make it bind to only interface 2 (patch based
on lsusb output on the linux-media list from Lucian Muresan).

Tested regression-free with the six mceusb devices I have myself.

Reported-by: Patrick Boettcher <pboettcher@kernellabs.com>
Reported-by: Lucian Muresan <lucianm@users.sourceforge.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 14:15:17 -03:00
Jarod Wilson 3198ed161c [media] nuvoton-cir: fix wake from suspend
The CIR Wake FIFO is 67 bytes long, but the stock remote appears to only
populate 65 of them. Limit comparison to 65 bytes, and wake from suspend
works a whole lot better (it wasn't working at all for most folks).

Fix based on comparison with the old lirc_wb677 driver from Nuvoton,
debugging and testing done by Dave Treacy by way of the lirc mailing
list.

Reported-by: Dave Treacy <davetreacy@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 14:12:24 -03:00
Devin Heitmueller e3bfeabbf5 [media] cx18: Add support for Hauppauge HVR-1600 models with s5h1411
The newest variants of the HVR-1600 have an s5h1411/tda18271 for the digital
frontend.  Add support for these boards.

Thanks to Hauppauge Computer Works for providing sample hardware.

[awalls@md.metrocast.net: Changed an additional log message to clarify for
the end user that the driver is defaulting to an original HVR-1600 for
unknown model numbers.]

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:56 -03:00
Michael d213ad0836 [media] ivtv: Fix corrective action taken upon DMA ERR interrupt to avoid hang
After upgrading the kernel from stock Ubuntu 7.10 to
10.04, with no hardware changes, I started getting the dreaded DMA
TIMEOUT errors, followed by inability to encode until the machine was
rebooted.

I came across a post from Andy in March
(http://www.gossamer-threads.com/lists/ivtv/users/40943#40943) where he
speculates that perhaps the corrective actions being taken after a DMA
ERROR are not sufficient to recover the situation.  After some testing
I suspect that this is indeed the case, and that in fact the corrective
action may be what hangs the card's DMA engine, rather than the
original error.

Specifically these DMA ERROR IRQs seem to present with two different
values in the IVTV_REG_DMASTATUS register: 0x11 and 0x13.  The current
corrective action is to clear that status register back to 0x01 or
0x03, and then issue the next DMA request.  In the case of a 0x13 this
seems to result in a minor glitch in the encoded stream due to the
failed transfer that was not retried, but otherwise things continue OK.
In the case of a 0x11 the card's DMA write engine is never heard from
again, and a DMA TIMEOUT follows shortly after.  0x11 is the killer.

I suspect that the two cases need to be handled differently.  The
difference is in bit 1 (0x02), which is set when the error is about to
be successfully recovered, and clear when things are about to go bad.

Bit 1 of DMASTATUS is described differently in different places either
as a positive "write finished", or an inverted "write busy".  If we
take the first definition, then when an error arises with state 0x11,
it means that the write did not complete.   It makes sense to start a
new transfer, as in the current code.  But if we take the second
definition, then 0x11 means "an error but the write engine is still
busy".  Trying to feed it a new transfer in this situation might not be
a good idea.

As an experiment, I added code to ignore the DMA ERROR IRQ if DMASTATUS
is 0x11.  I.e., don't start a new transfer, don't clear our flags, etc.
The hope was that the card would complete the transfer and issue a ENC
DMA COMPLETE, either successfully or with an error condition there.
However the card still hung.

The only remaining corrective action being taken with a 0x11 status was
then the write back to the status register to clear the error, i.e.
DMASTATUS = DMASTATUS & ~3.  This would have the effect of clearing the
error bit 4, while leaving the lower bits indicating DMA write busy.

Strangely enough, removing this write to the status register solved the
problem!  If the DMA ERROR IRQ with DMASTATUS=0x11 is completely
ignored, with no corrective action at all, then the card will complete
the transfer and issue a new IRQ.  If the status register is written to
when it has the value 0x11, then the DMA engine hangs.  Perhaps it's
illegal to write to
DMASTATUS while the read or write busy bit is set?  At any rate, it
appears that the current corrective action is indeed making things
worse rather than better.

I put together a patch that modifies ivtv_irq_dma_err to do the
following:

- Don't write back to IVTV_REG_DMASTATUS.
- If write-busy is asserted, leave the card alone.  Just extend the
timeout slightly.
- If write-busy is de-asserted, retry the current transfer.

This has completely fixed my DMA TIMEOUT woes.  DMA ERR events still
occur, but now they seem to be correctly handled.  0x11 events no
longer hang the card, and 0x13 events no longer result in a glitch in
the stream, as the failed transfer is retried.  I'm happy.

I've inlined the patch below in case it is of interest.  As described
above, I have a theory about why it works (based on a different
interpretation of bit 1 of DMASTATUS), but I can't guarantee that my
theory is correct.  There may be another explanation, or it may be a
fluke.  Maybe ignoring that IRQ entirely would be equally effective?
Maybe the status register read/writeback sequence is race condition if
the card changes it in the mean time?  Also as I am using a PVR-150
only, I have not been able to test it on other cards, which may be
especially relevant for 350s that support concurrent decoding.
Hopefully the patch does not break the DMA READ path.

Mike

[awalls@md.metrocast.net: Modified patch to add a verbose comment, make minor
brace reformats, and clear the error flags in the IVTV_REG_DMASTATUS iff both
read and write DMA were not in progress.  Mike's conjecture about a race
condition with the writeback is correct; it can confuse the DMA engine.]

[Comment and analysis from the ML post by Michael <mike@rsy.com>]
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:42 -03:00
Sven Barth 1e6406b8f0 [media] cx25840: fix probing of cx2583x chips
Fix the probing of cx2583x chips, because two controls were clustered
that are not created for these chips.

This regression was introduced in 2.6.36.

Signed-off-by: Sven Barth <pascaldragon@googlemail.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:33 -03:00
Andy Walls 593110d143 [media] cx23885: Remove unused 'err:' labels to quiet compiler warning
The previous revert-commit, that affected cx23885-i2c.c, left some
unused labels that the compiler griped about.  Clean them up.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:27 -03:00
Andy Walls 67914b5c40 [media] cx23885: Revert "Check for slave nack on all transactions"
This reverts commit 44835f197b.

With the CX23885 hardware I2C master, checking for I2C slave ACK/NAK
is not valid when the I2C_EXTEND or I2C_NOSTOP bits are set.
Revert the commit that checks for I2C slave ACK/NAK on all transactions,
so that XC5000 tuners work with the CX23885 again.

Thanks go to Mark Zimmerman for reporting and bisecting this problem.

Bisected-by: Mark Zimmerman <markzimm@frii.com>

Reported-by: Mark Zimmerman <markzimm@frii.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:19 -03:00
Olivier Grenie e192a7cf0e [media] DiB7000M: add pid filtering
This patch adds the pid filtering for the dib7000M demod. It also
corrects the pid filtering for the dib7700 based board. It should
prevent an oops, when using dib7700p based board.

References: https://bugzilla.novell.com/show_bug.cgi?id=644807

Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Tested-by: Pavel SKARKA <paul.sp@seznam.cz>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:45:12 -03:00
Antti Seppälä 0a91be40ed [media] Fix sysfs rc protocol lookup for rc-5-sz
With the current matching rules the lookup for rc protocol named rc-5-sz matches with "rc-5" before finding "rc-5-sz". Thus one is able to never enable/disable the rc-5-sz protocol via sysfs.

Fix the lookup to require an exact match which allows the manipulation of sz protocol.

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-02 13:44:40 -03:00
Grant Likely 1c48a5c93d dt: Eliminate of_platform_{,un}register_driver
Final step to eliminate of_platform_bus_type.  They're all just
platform drivers now.

v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell)

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-28 13:22:46 -07:00
Linus Torvalds f2f1756d7d Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] fix saa7111 non-detection
  [media] rc/streamzap: fix reporting response times
  [media] mceusb: really fix remaining keybounce issues
  [media] rc: use time unit conversion macros correctly
  [media] rc/ir-lirc-codec: add back debug spew
  [media] ir-kbd-i2c: improve remote behavior with z8 behind usb
  [media] lirc_zilog: z8 on usb doesn't like back-to-back i2c_master_send
  [media] hdpvr: fix up i2c device registration
  [media] rc/mce: add mappings for missing keys
  [media] gspca - zc3xx: Discard the partial frames
  [media] gspca - zc3xx: Fix bad images with the sensor hv7131r
  [media] gspca - zc3xx: Bad delay when given by a table
2011-02-02 17:52:19 -08:00
Devin Heitmueller 54ebb8b83f [media] au0828: fix VBI handling when in V4L2 streaming mode
au0828: fix VBI handling when in V4L2 streaming mode

It turns up V4L2 streaming mode (a.k.a mmap) was broken for VBI streaming.
This was causing libzvbi to fall back to V4L1 capture mode, and is a blatent
violation of the V4L2 specification.

Make the implementation work properly in this mode.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-02 12:08:33 -02:00
Mauro Carvalho Chehab 83587839d6 [media] ir-raw: Properly initialize the IR event (BZ#27202)
Changeset 4651918a4a changed the way events
are stored. However, it forgot to fix ir_raw_event_store_edge() to work
with the new way. Due to that, the decoders will likely do bad things.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-02 11:20:04 -02:00
sensoray-dev 752eb7ae50 [media] s2255drv: firmware re-loading changes
Change for firmware re-loading and updated firmware versions.

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-02 11:13:37 -02:00
Pawel Osciak 0552774d06 [media] Fix double free of video_device in mem2mem_testdev
video_device is already being freed in video_device.release callback on
release.

Signed-off-by: Pawel Osciak <pawel@osciak.com>
Reported-by: Roland Kletzing <devzero@web.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-02 10:42:48 -02:00
Malcolm Priestley 15c88fad4b [media] DM04/QQBOX memcpy to const char fix
Driver Version v1.75 Kernel oops appears in 2.6.37-rc8 in
lme_firmware_switch because of a memcpy to a const char.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-02-02 10:42:14 -02:00
Dmitry Torokhov aebd636bd6 Input: switch completely over to the new versions of get/setkeycode
All users of old style get/setkeycode methids have been converted so
it is time to retire them.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-31 21:16:59 -08:00
Dmitry Torokhov f06e6a52ca Input: dvb-usb-remote - convert to new style of get/setkeycode
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-31 21:16:53 -08:00
Russell King bed3c1de66 [media] fix saa7111 non-detection
One saa7111 device is reporting a different ID:

saa7115 0-0024: chip found @ 0x48 (ID 0f7111d0e111111) does not match a known saa711x chip.

As this is for sure a saa7111, change the detection code to also
cover this device.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 14:19:50 -02:00
Jarod Wilson 56b0ec30c4 [media] rc/streamzap: fix reporting response times
The streamzap driver has relatively low sampling resolution, and any
delays in reporting events seem to cause some minor problems for the
likes of irw when using the lirc bridge driver, resulting in a single
keypress registering as multiple independent ones, rather than as a
single press with repeats. If we call ir_raw_event_handle() more
frequently and reset the rawir kfifo at end-of-signal, the behavior
improves quite a bit.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:22:13 -02:00
Jarod Wilson 5bd9d73c84 [media] mceusb: really fix remaining keybounce issues
Make sure rawir struct is zeroed out before populating it for each
ir_raw_event_store_with_filter() call, and when we see a trailing 0x80
packet (end-of-data), issue an ir_raw_event_reset() call.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:20:35 -02:00
Jarod Wilson b4608faee0 [media] rc: use time unit conversion macros correctly
Due to my own stupidity, some of the wrong time unit conversion macros
were being used inside some of the IR drivers I've been working on. Fix
that, and convert over some additional places to also use the macros.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:20:11 -02:00
Jarod Wilson 457e2ffcef [media] rc/ir-lirc-codec: add back debug spew
Some occasionally useful debug spew disappeared as part of a feature
update a while back, and I'm finding myself in need of it again to help
diagnose some issues.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:19:42 -02:00
Jarod Wilson 8df59918b5 [media] ir-kbd-i2c: improve remote behavior with z8 behind usb
Add the same "are you ready?" i2c_master_send() poll command to
get_key_haup_xvr found in lirc_zilog, which is apparently seen in
the Windows driver for the PVR-150 w/a z8. This stabilizes what is
received from both the HD-PVR and HVR-1950, even with their polling
intervals at the default of 100, thus the removal of the custom
260ms polling_interval in pvrusb2-i2c-core.c.

Acked-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Mike Isely <isely@isely.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:19:15 -02:00
Jarod Wilson 7f2a06deaa [media] hdpvr: fix up i2c device registration
We have to actually call i2c_new_device() once for each of the rx and tx
addresses. Also improve error-handling and device remove i2c cleanup.

Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:18:04 -02:00
Jarod Wilson 86ee659488 [media] rc/mce: add mappings for missing keys
Per http://mediacenterguides.com/book/export/html/31 and investigation
by Erin, we were missing these last three mappings to complete the mce
key table. Lets remedy that.

Reported-by: Erin Simonds <fisslefink@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:16:52 -02:00
Jean-François Moine a5ecdfb3da [media] gspca - zc3xx: Discard the partial frames
In some cases, some frames may not end with the JPEG end of frame.
Being not complete, they are now discarded.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:05:48 -02:00
Jean-François Moine 3d244065cb [media] gspca - zc3xx: Fix bad images with the sensor hv7131r
The problem was introduced by the commit 2af0b4c60c.
Some registers were no more initialized.

Tested-by: <Giovanni Scafora giovanni@archlinux.org>
Tested-by: <Sergey Manucharian sm@ingeniware.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:05:26 -02:00
Jean-François Moine 7c45f2c7fe [media] gspca - zc3xx: Bad delay when given by a table
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-31 12:04:25 -02:00
Dmitry Torokhov 54e74b87e2 Input: rc-keymap - return KEY_RESERVED for unknown mappings
Do not respond with -EINVAL to EVIOCGKEYCODE for not-yet-mapped
scancodes, but rather return KEY_RESERVED.

This fixes breakage with Ubuntu's input-kbd utility that stopped
returning full keymaps for remote controls.

Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Mark Lord <kernel@teksavvy.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-31 13:04:11 +10:00
Linus Torvalds 13a3cec844 Merge branch 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (101 commits)
  [media] staging/lirc: fix mem leaks and ptr err usage
  [media] hdpvr: reduce latency of i2c read/write w/recycled buffer
  [media] hdpvr: enable IR part
  [media] rc/mceusb: timeout should be in ns, not us
  [media] v4l2-device: fix 'use-after-freed' oops
  [media] v4l2-dev: don't memset video_device.dev
  [media] zoran: use video_device_alloc instead of kmalloc
  [media] w9966: zero device state after a detach
  [media] v4l: Fix a use-before-set in the control framework
  [media] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h
  [media] DocBook/v4l: update V4L2 revision and update copyright years
  [media] DocBook/v4l: fix validation error in dev-rds.xml
  [media] v4l2-ctrls: queryctrl shouldn't attempt to replace V4L2_CID_PRIVATE_BASE IDs
  [media] v4l2-ctrls: fix missing 'read-only' check
  [media] pvrusb2: Provide more information about IR units to lirc_zilog and ir-kbd-i2c
  [media] ir-kbd-i2c: Add back defaults setting for Zilog Z8's at addr 0x71
  [media] lirc_zilog: Update TODO.lirc_zilog
  [media] lirc_zilog: Add Andy Walls to copyright notice and authors list
  [media] lirc_zilog: Remove useless struct i2c_driver.command function
  [media] lirc_zilog: Remove unneeded tests for existence of the IR Tx function
  ...
2011-01-21 16:50:31 -08:00
David Rientjes 6a108a14fa kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT
The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
is used to configure any non-standard kernel with a much larger scope than
only small devices.

This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
references to the option throughout the kernel.  A new CONFIG_EMBEDDED
option is added that automatically selects CONFIG_EXPERT when enabled and
can be used in the future to isolate options that should only be
considered for embedded systems (RISC architectures, SLOB, etc).

Calling the option "EXPERT" more accurately represents its intention: only
expert users who understand the impact of the configuration changes they
are making should enable it.

Reviewed-by: Ingo Molnar <mingo@elte.hu>
Acked-by: David Woodhouse <david.woodhouse@intel.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Greg KH <gregkh@suse.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Robin Holt <holt@sgi.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-20 17:02:05 -08:00
Jarod Wilson 559d162e1e [media] hdpvr: reduce latency of i2c read/write w/recycled buffer
The current hdpvr code kmalloc's a new buffer for every i2c read and
write. Rather than do that, lets allocate a buffer in the driver's
device struct and just use that every time.

The size I've chosen for the buffer is the maximum size I could
ascertain might be used by either ir-kbd-i2c or lirc_zilog, plus a bit
of padding (lirc_zilog may use up to 100 bytes on tx, rounded that up
to 128).

Note that this might also remedy user reports of very sluggish behavior
of IR receive with hdpvr hardware.

v2: make sure (len <= (dev->i2c_buf)) [Jean Delvare]

Reported-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 12:52:21 -02:00
Jarod Wilson 324b04ba5d [media] hdpvr: enable IR part
A number of things going on here, but the end result is that the IR part
on the hdpvr gets enabled, and can be used with ir-kbd-i2c and/or
lirc_zilog.

First up, there are some conditional build fixes that come into play
whether i2c is built-in or modular. Second, we're swapping out
i2c_new_probed_device() for i2c_new_device(), as in my testing, probing
always fails, but we *know* that all hdpvr devices have a z8 chip at
0x70 and 0x71. Third, we're poking at an i2c address directly without a
client, and writing some magic bits to actually turn on this IR part
(this could use some improvement in the future). Fourth, some of the
i2c_adapter storage has been reworked, as the existing implementation
used to lead to an oops following i2c changes c. 2.6.31.

Earlier editions of this patch have been floating around the 'net for a
while, including being patched into Fedora kernels, and they *do* work.
This specific version isn't yet tested, beyond loading ir-kbd-i2c and
confirming that it does bind to the RX address of the hdpvr.

[mchehab@redhat.com: I2C_CLASS_TV_ANALOG is not defined. Fix compilation bug]
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 12:52:20 -02:00
Jarod Wilson 706c57d802 [media] rc/mceusb: timeout should be in ns, not us
Fixes an egregious bug in mceusb driver, where the receiver was being
put into idle mode far sooner than it should have, thanks to storing a
timeout value that in us where it should be ns. Basically, the receiver
kept going into idle mode before a trailing space had been fully
received, which was causing problems for some protocols, most notably
manifesting as lirc userspace never receiving a trailing space for any
rc5 signals.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 12:52:19 -02:00
Hans Verkuil 672dcd5477 [media] v4l2-device: fix 'use-after-freed' oops
Fix a bug in v4l2_device_unregister where the sd pointer can be dereferenced
after it was freed.

Normally the i2c adapter is removed before this function is called. Removing
the adapter will also unregister all subdevs on that adapter, so generally
v4l2_device_unregister has nothing to do. However, in the case of a platform
i2c bus that bus is generally not freed.

In that case, after freeing the i2c subdevice the code will fall into the
second block when it tests if the subdev is a SPI device. But by that time
the subdev is already freed and the kernel oopses.

The fix is trivial: continue with the loop after freeing the i2c or spi
subdevice.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reported-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:14 -02:00
Hans Verkuil 46b633779b [media] v4l2-dev: don't memset video_device.dev
Zeroing video_device.dev causes a memory leak if video_set_drvdata
was called before video_register_device was called. video_set_drvdata
calls dev_set_drvdata which allocates video_device.dev.p.

memsetting this will prevent freeing of that memory.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:13 -02:00
Hans Verkuil 6ce3ced4f7 [media] zoran: use video_device_alloc instead of kmalloc
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:12 -02:00
Hans Verkuil bd5ba3ba2e [media] w9966: zero device state after a detach
After a detach zero the whole device state to ensure a clean slate
on the next attach.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:11 -02:00
Laurent Pinchart eac9aa005a [media] v4l: Fix a use-before-set in the control framework
v4l2_queryctrl sets the step value based on the control type. That would
be fine if it used the control type stored in the V4L2 kernel control
object, not the one stored in the userspace ioctl structure that has
just been memset to 0. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:52:10 -02:00
Hans Verkuil 829fb2dcb5 [media] v4l2-ctrls: queryctrl shouldn't attempt to replace V4L2_CID_PRIVATE_BASE IDs
When queryctrl is called with a V4L2_CID_PRIVATE_BASE control ID, then
currently it is replaced by the real internal ID. This is not according to
the spec so keep the V4L2_CID_PRIVATE_BASE ID in this case.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:46:15 -02:00
Hans Verkuil c959acfddb [media] v4l2-ctrls: fix missing 'read-only' check
VIDIOC_S_CTRL did not check against read-only controls. Even worse, for
controls of type CTRL_CLASS it would cause a kernel oops since those controls
do not have a s_ctrl op.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:46:14 -02:00
Andy Walls 4999e27a62 [media] pvrusb2: Provide more information about IR units to lirc_zilog and ir-kbd-i2c
When registering an IR Rx device with the I2C subsystem, provide more detailed
information about the IR device and default remote configuration for the IR
driver modules.

Also explicitly register any IR Tx device with the I2C subsystem.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:46:13 -02:00
Andy Walls c69a4af6f0 [media] ir-kbd-i2c: Add back defaults setting for Zilog Z8's at addr 0x71
This reverts a portion of commit

	44243fc2ef

A commit for which I errantly recommended that defaults for I2C address
0x71 not be set by ir-kbd-i2c.c

The pvrusb2 and bttv drivers currently rely on ir-kbd-i2c setting
defaults for that address.  Until I can get those bridge drivers fixed
to properly send IR_i2c_init_data for boards with Zilog Z8 chips,
just add back the default settings for I2C address 0x71.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:46:12 -02:00
Stefan Richter 22f37712f2 [media] firedtv: fix remote control with newer Xorg evdev
After a recent update of xf86-input-evdev and xorg-server, I noticed
that X11 applications did not receive keypresses from the FireDTV
infrared remote control anymore.  Instead, the Xorg log featured lots of

    "FireDTV remote control: dropping event due to full queue!"

exclamations.  The Linux console did not have an issue with the
FireDTV's RC though.

The fix is to insert EV_SYN events after the key-down/-up events.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:59 -02:00
Geert Uytterhoeven 2400982a2e [media] radio-aimslab.c needs #include <linux/delay.h>
Commit e3c9221519 ("[media] radio-aimslab.c: Fix
gcc 4.5+ bug") removed the include, but introduced new callers of msleep():

| drivers/media/radio/radio-aimslab.c: In function ‘rt_decvol’:
| drivers/media/radio/radio-aimslab.c:76: error: implicit declaration of function ‘msleep’

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:57 -02:00
Randy Dunlap 2dbd61b465 [media] ir-raw: fix sparse non-ANSI function warning
Fix sparse warning for non-ANSI function declaration:

drivers/media/rc/ir-raw.c:247:30: warning: non-ANSI function declaration of function 'ir_raw_get_allowed_protocols'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:56 -02:00
Christian Gmeiner b7eccc46a1 [media] adv7175: support s_power
This patch adds s_power support to adv7175 driver. Power-down is done
by power-down all four DACs.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:55 -02:00
Dan Carpenter cb26a24ee9 [media] [v3,media] av7110: check for negative array offset
info->num comes from the user.  It's type int.  If the user passes
in a negative value that would cause memory corruption.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:54 -02:00
Jarod Wilson 76f1ef427c [media] rc/imon: default to key mode instead of mouse mode
My initial thinking was that we should default to mouse mode, so people
could use the mouse function to click on something on a login screen,
but a lot of systems where a remote is useful automatically log in a
user and launch a media center application, some of which hide the
mouse, which can be confusing to users if they punch buttons on the
remote and don't see any feedback. Plus, first and foremost, its a
remote, so lets default to being a remote, and only toggle into mouse
mode when the user explicitly asks for it. As a nice side-effect, this
actually simplifies some of the code a fair bit...

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:53 -02:00
Jarod Wilson 5aad724280 [media] rc: fix up and genericize some time unit conversions
The ene_ir driver was using a private define of MS_TO_NS, which is meant
to be microseconds to nanoseconds. The mceusb driver copied it,
intending to use is a milliseconds to microseconds. Lets move the
defines to a common location, expand and standardize them a touch, so
that we now have:

  MS_TO_NS - milliseconds to nanoseconds
  MS_TO_US - milliseconds to microseconds
  US_TO_NS - microseconds to nanoseconds

Reported-by: David Härdeman <david@hardeman.nu>
CC: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:52 -02:00
Jarod Wilson 9ad77eb57b [media] rc/imon: need to submit urb before ffdc type check
Otherwise, we have a null receive buffer, and the logic all falls down,
goes boom, all ffdc devs wind up as imon IR w/VFD. Oops.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:51 -02:00
Kyle McMartin 2e4c55626a [media] rc/ene_ir: fix oops on module load
dev->rdev is accessed in ene_setup_hw_settings, so it needs to be wired
up before then.

[Jarod Wilson]: Also fix a possible improper resource freeing bug while
we're looking at possible probe issues here.

Signed-off-by: Kyle McMartin <kmcmartin@redhat.com>
CC: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:50 -02:00
Jarod Wilson 7d2edfc23e [media] rc/imon: fix ffdc device detection oops
There's a nasty bug that slipped in when the rc device interface was
altered, only affecting the older 0xffdc imon devices. We were trying
to access ictx->rdev->allowed_protos before ictx->rdev had been set.

There's also an issue with call ordering that meant the correct
keymap wasn't getting loaded for MCE IR type 0xffdc devices.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:49 -02:00
Thadeu Lima de Souza Cascardo e95342f168 [media] DVB: cx231xx drivers does not use dummy frontend anymore
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:48 -02:00
Matti Aaltonen 34b8fc8e68 [media] V4L2: WL1273 FM Radio: Replace ioctl with unlocked_ioctl
Use unlocked_ioctl in v4l2_file_operations. The locking is
already in place.

Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:47 -02:00
Tejun Heo a3bc5e3304 [media] v4l/cx18: update workqueue usage
With cmwq, there's no reason to use separate out_work_queue.  Drop it
and use system_wq instead.  The in_work_queue needs to be ordered so
can't use one of the system wqs; however, as it isn't used to reclaim
memory, allocate the workqueue with alloc_ordered_workqueue() without
WQ_MEM_RECLAIM.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:46 -02:00
Jesper Juhl fd01ad9894 [media] media, tlg2300: Fix memory leak in alloc_bulk_urbs_generic()
Hi,

While reading
drivers/media/video/tlg2300/pd-video.c::alloc_bulk_urbs_generic() I
noticed that

 - We don't free the memory allocated to 'urb' if the call to
   usb_alloc_coherent() fails.
 - If the 'num' argument to the function is ever <= 0 we'll return an
   uninitialized variable 'i' to the caller.

The following patch addresses both of the above by a) calling
usb_free_urb() when usb_alloc_coherent() fails and by explicitly
initializing 'i' to zero.
I also moved the variables 'mem' and 'urb' inside the for loop. This does
not actually make any difference, it just seemed more correct to me to let
variables exist only in the innermost scope they are used.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:45 -02:00
Jesper Juhl 36fd97884d [media] frontends/ix2505v: Remember to free allocated memory in failure path
We may leak the storage allocated to 'state' in
drivers/media/dvb/frontends/ix2505v.c::ix2505v_attach() on error, as
it is too early to be able to call ix2505v_release().

This patch makes sure we free the allocated memory in the failure case.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:44 -02:00
Jean-François Moine a63d601803 [media] gspca - sonixj: Add LED (illuminator) control to the webcam 0c45:614a
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:43 -02:00
Jean-François Moine 3afef85bfe [media] gspca - sonixj: Infrared bug fix and enhancement
The infrared was set by sensor write instead of bridge GPIO.
It is now settable by the standard control ILLUMINATOR_1.
A module parameter permits to set the right GPIO bit according
to the StarCam model.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:42 -02:00
Jean-François Moine 14b67c2969 [media] gspca - ov534: Propagate errors to higher level
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:41 -02:00
Jean-François Moine ddffa49e25 [media] gspca - ov534: Clearer debug messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:39 -02:00
Jean-François Moine fc63de88e0 [media] gspca - ov519: Cleanup source and add a comment
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:38 -02:00
Jean-François Moine ded5e903b7 [media] gspca: Remove useless instructions
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:37 -02:00
Jean-François Moine 95c967c167 [media] gspca: Remove __devinit, __devinitconst and __devinitdata
__devinit* must not be used in USB drivers.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:35 -02:00
Jean-François Moine 0beb6714e7 [media] gspca: Version change
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:33 -02:00
Hans Verkuil 2a863793be [media] v4l2-ctrls: v4l2_ctrl_handler_setup must set is_new to 1
Renamed has_new to is_new.

Drivers can use the is_new field to determine if a new value was specified
for a control. The v4l2_ctrl_handler_setup() must always set this to 1 since
the setup has to force a full update of all controls.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:32 -02:00
Hans Verkuil 45f6f84af3 [media] v4l2-subdev: add (un)register internal ops
Some subdevs need to call into the board code after they are registered
and have a valid struct v4l2_device pointer. The s_config op was abused
for this, but now that it is removed we need a cleaner way of solving this.

So this patch adds a struct with internal ops that the v4l2 core can call.

Currently only two ops exist: register and unregister. Subdevs can implement
these to call the board code and pass it the v4l2_device pointer, which the
board code can then use to get access to the struct that embeds the
v4l2_device.

It is expected that in the future open and close ops will also be added.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:31 -02:00
Hans Verkuil 3c7c9370fb [media] v4l2-subdev: remove core.s_config and v4l2_i2c_new_subdev_cfg()
The core.s_config op was meant for legacy drivers that needed to work with old
pre-2.6.26 kernels. This is no longer relevant. Unfortunately, this op was
incorrectly called from several drivers.

Replace those occurences with proper i2c_board_info structs and call
v4l2_i2c_new_subdev_board.

After these changes v4l2_i2c_new_subdev_cfg() was no longer used, so remove
that function as well.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:30 -02:00
Mauro Carvalho Chehab ecb71d262b [media] saa7134: Kworld SBTVD: make both analog and digital to work
There are some weird bugs at tda8290/tda18271 initialization, as it
insits do do analog initialization during DVB frontend attach:

DVB: registering new adapter (saa7133[0])
DVB: registering adapter 0 frontend 0 (Fujitsu mb86A20s)...
mb86a20s: mb86a20s_initfe
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer returned: -5
tda18271_init: [2-0060|M] error -5 on line 830
tda18271_tune: [2-0060|M] error -5 on line 908
tda18271_write_regs
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x5, len = 1, i2c_transfer returned: -5
tda18271c2_rf_tracking_filters_correction: [2-0060|M] error -5 on line 265
tda18271_write_regs
tda18271_write_regs: [2-0060|M] ERROR: idx = 0x25, len = 1, i2c_transfer returned: -5
tda18271_channel_configuration: [2-0060|M] error -5 on line 119
tda18271_set_analog_params: [2-0060|M] error -5 on line 1045
tda18271_set_analog_params: [2-0060|M] error -5 on line 1045
tda829x 2-004b: tda8295 not locked, no signal?
tda829x 2-004b: tda8295_i2c_bridge: disable i2c gate
tda829x 2-004b: tda8295 not locked, no signal?
tda829x 2-004b: tda8295_i2c_bridge: disable i2c gate
mb86a20s_i2c_writereg: writereg error (rc == -5, reg == 0x29, data == 0x33)
mb86a20s: Init failed. Will try again later

The problem is that mb86a20s is only visible if the analog part is disabled.

However, due to a trick at mb86a20s, it will later initialize properly:

mb86a20s: mb86a20s_initfe: Initialization succeded.

This is hacky and ugly. However, I coldn't find any easy way to fix it.
A proper fix would be to have a resource locking schema, used by both
V4L and DVB parts that would block access to analog registers while
digital registers are in use, but this will probably put tda829x into
a dead lock.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:28 -02:00
Mauro Carvalho Chehab 6a58bc0f50 [media] saa7134: Fix digital mode on Kworld SBTVD
This patch fixes digital mode on Kworld SBTVD. Unfortunately, it disables
analog mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:27 -02:00
Mauro Carvalho Chehab 6183040680 [media] saa7134: Fix analog mode for Kworld SBTVD
There were some issues at tda8290 that were preventing this device
to work. Now that those fixes were fixed, we can enable analog
mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:26 -02:00
Mauro Carvalho Chehab c736a5f28e [media] mb86a20s: Be sure that device is initialized before starting DVB
Due to a hard to track bug between tda829x/tda18271/saa7134, tda829x
wants to go to analog mode during DVB initialization, causing some
I2C errors.

The analog failure doesn't cause any harm, as the device were already
properly initialized in analog mode. However, the failure at the digital
mode causes the frontend mb86a20s to not initialize. Fortunately, at
least on my tests, it was possible to detect that the device is a
mb86a20s before the failure.

What happens is that tda8290 is a very bad boy: during DVB setup, it
keeps insisting to call tda18271 analog_set_params, that calls
tune_agc code. The tune_agc code calls saa7134 driver, changing the
value of GPIO 27, switching from digital to analog mode and disabling
the access to mb86a20s, as, on Kworld SBTVD, the same GPIO used
to switch the hardware AGC mode seems to be used to enable the I2C
switch that allows access to the frontend (mb86a20s).

So, a call to analog_set_params ultimately disables the access to
the frontend, and causes a failure at the init frontend logic.

This patch is a workaround for this issue: it simply checks if the
frontend init had any failure. If so, it will init the frontend when
some DTV application will try to set DVB mode.

Even being a hack for Kworld SBTVD to work, and assumning that we could
teach tda8290 to be a good boy, this is actually an improvement at the
frontend driver, as it will be more reliable to initialization failures.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:25 -02:00
Mauro Carvalho Chehab 7570800c9d [media] mb86a20s: Fix i2c read/write error messages
A script replaced err var to rc. Howerver, this script gambled
"error" string, changing it to "rcor". Revert that bad change.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:24 -02:00
Mauro Carvalho Chehab 9d700a0696 [media] tda8290: Turn tda829x on before touching at the I2C gate
On Kworld SBTVD, tda8295-c1 starts in power off mode. It needs
to be powered, otherwise, the I2C gate control command won't work.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:23 -02:00
Mauro Carvalho Chehab 47ab285a96 [media] tda8290: Fix a bug if no tuner is detected
If tda8290 is detected, but no tuner is found, the driver will do bad
things:

tuner 2-0060: chip found @ 0xc0 (saa7133[0])
tda829x 2-0060: could not clearly identify tuner address, defaulting to 60
tda829x 2-0060: tuner access failed!
BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
IP: [<ffffffffa048c267>] set_audio+0x47/0x170 [tda8290]
PGD 1187b0067 PUD 11771e067 PMD 0
Oops: 0002 [#1] SMP
last sysfs file: /sys/module/i2c_core/initstate
CPU 0
Modules linked in: tda8290(U) tea5767(U) tuner(U) ir_lirc_codec(U) lirc_dev(U) ir_sony_decoder(U) ir_jvc_decoder(U) ir_rc6_decoder(U) ir_rc5_decoder(U) saa7134(+)(U) v4l2_common(U) ir_nec_decoder(U) videodev(U) v4l2_compat_ioctl32(U) rc_core(U) videobuf_dma_sg(U) videobuf_core(U) tveeprom(U) ebtable_nat ebtables xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT bridge stp llc autofs4 sunrpc cpufreq_ondemand acpi_cpufreq freq_table xt_physdev iptable_filter ip_tables ip6t_REJECT ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log parport kvm_intel kvm uinput floppy tpm_infineon wmi sg serio_raw iTCO_wdt iTCO_vendor_support tg3 snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc i7core_edac edac_core nouveau
Modules linked in: tda8290(U) tea5767(U) tuner(U) ir_lirc_codec(U) lirc_dev(U) ir_sony_decoder(U) ir_jvc_decoder(U) ir_rc6_decoder(U) ir_rc5_decoder(U) saa7134(+)(U) v4l2_common(U) ir_nec_decoder(U) videodev(U) v4l2_compat_ioctl32(U) rc_core(U) videobuf_dma_sg(U) videobuf_core(U) tveeprom(U) ebtable_nat ebtables xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT bridge stp llc autofs4 sunrpc cpufreq_ondemand acpi_cpufreq freq_table xt_physdev iptable_filter ip_tables ip6t_REJECT ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log parport kvm_intel kvm uinput floppy tpm_infineon wmi sg serio_raw iTCO_wdt iTCO_vendor_support tg3 snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc i7core_edac edac_core nouveau ttm drm_kms_helper drm i2c_algo_bit video output i2c_core ext3 jbd mbcache firewire_ohci firewire_core crc_itu_t sr_mod cdrom sd_mod crc_t10dif ahci dm_mod [last unloaded: microcode]
Pid: 9497, comm: modprobe Not tainted 2.6.32-72.el6.x86_64 #1 HP Z400 Workstation
RIP: 0010:[<ffffffffa048c267>]  [<ffffffffa048c267>] set_audio+0x47/0x170 [tda8290]
RSP: 0018:ffff88010ba01b28  EFLAGS: 00010206
RAX: 00000000000000ff RBX: ffff880119522800 RCX: 0000000000000002
RDX: 0000000000003be0 RSI: ffff88010ba01bb8 RDI: 0000000000000000
RBP: ffff88010ba01b28 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88010ba01bb8 R14: 0000000000001900 R15: 0000000000001900
FS:  00007f4b96b3d700(0000) GS:ffff880028200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000020 CR3: 000000011866c000 CR4: 00000000000026f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 9497, threadinfo ffff88010ba00000, task ffff880100708a70)
Stack:
 ffff88010ba01b98 ffffffffa048c95b ffff88010ba01b78 0000000000000060
<0> 0000000000000000 0000000e00000000 000000000000001d ffffffffa03ec838
<0> ffff88010abac240 ffff880119522800 ffff880119522800 ffff880119522bc0
Call Trace:
 [<ffffffffa048c95b>] tda8295_set_params+0x3b/0x210 [tda8290]
 [<ffffffffa03ec838>] ? v4l2_i2c_new_subdev_cfg+0x88/0xc0 [v4l2_common]
 [<ffffffffa0484418>] set_freq+0x128/0x2f0 [tuner]
 [<ffffffffa0486464>] tuner_s_std+0xc4/0x740 [tuner]
 [<ffffffffa04b9ae6>] saa7134_set_tvnorm_hw+0x2d6/0x3d0 [saa7134]
 [<ffffffffa04ba455>] set_tvnorm+0xd5/0x100 [saa7134]
 [<ffffffffa04bc9fd>] saa7134_video_init2+0x1d/0x50 [saa7134]
 [<ffffffffa04bf57e>] saa7134_initdev+0x6e1/0xb1d [saa7134]
 [<ffffffff8125afea>] ? kobject_get+0x1a/0x30
 [<ffffffff812765f7>] local_pci_probe+0x17/0x20
 [<ffffffff812777e1>] pci_device_probe+0x101/0x120
 [<ffffffff8132ec72>] ? driver_sysfs_add+0x62/0x90
 [<ffffffff8132ee10>] driver_probe_device+0xa0/0x2a0
 [<ffffffff8132f0bb>] __driver_attach+0xab/0xb0
 [<ffffffff8132f010>] ? __driver_attach+0x0/0xb0
 [<ffffffff8132e074>] bus_for_each_dev+0x64/0x90
 [<ffffffff8132ebae>] driver_attach+0x1e/0x20
 [<ffffffff8132e4b0>] bus_add_driver+0x200/0x300
 [<ffffffff8132f3e6>] driver_register+0x76/0x140
 [<ffffffff814c7c43>] ? printk+0x41/0x46
 [<ffffffff81277a46>] __pci_register_driver+0x56/0xd0
 [<ffffffffa04de000>] ? saa7134_init+0x0/0x4f [saa7134]
 [<ffffffffa04de04d>] saa7134_init+0x4d/0x4f [saa7134]
 [<ffffffff8100a04c>] do_one_initcall+0x3c/0x1d0
 [<ffffffff810af5ef>] sys_init_module+0xdf/0x250
 [<ffffffff81013172>] system_call_fastpath+0x16/0x1b
Code: 20 01 49 c7 c0 c9 ec 48 a0 83 7e 04 01 74 2d 8b 0d 3f 2f 00 00 85 c9 0f 85 d7 00 00 00 c9 c3 0f 1f 44 00 00 a9 03 00 01 00 74 61 <c6> 47 20 02 83 7e 04 01 49 c7 c0 cc ec 48 a0 75 d3 0f b6 47 22
RIP  [<ffffffffa048c267>] set_audio+0x47/0x170 [tda8290]
 RSP <ffff88010ba01b28>
CR2: 0000000000000020

This happens because some I2C callbacks actually depend on having the
driver entirely initialized. To avoid this OOPS, just clean the I2C
callbacks, as if no device were detected.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:22 -02:00
Mauro Carvalho Chehab 567aba0b79 [media] tda8290: Make all read operations atomic
Read operations should be preceeded by a write operation. However,
nothing prevents that an I2C operation could happen between the two
transactions.

To avoid that problem, use an unique I2C transfer for both parts of
the I2C transaction.

Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:20 -02:00
Mauro Carvalho Chehab 5a85025f7d [media] em28xx: Fix IR support for WinTV USB2
Due to a lack of a break inside the switch, it were getting the
wrong keytable and get_key function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:19 -02:00
Mauro Carvalho Chehab e6bcb2f324 [media] ir-kbd-i2c: Make IR debug messages more useful
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:18 -02:00
Mauro Carvalho Chehab 59aa346009 [media] dib0700: Fix IR keycode handling
Fixes Fedora 14 bug: https://bugzilla.redhat.com/show_bug.cgi?id=667157

There are a few bugs at the code that generates the scancode at dib0700:
	- RC keycode is wrong (it outputs a 24 bits keycode);
	- NEC extended outputs a keycode that have endiannes issues;
	- keycode tables for NEC extended remotes need to be updated.

The last issue need to be done as we get reports, as we don't have
the complete NEC-extended keycodes at the dibcom table.

This patch fixes the first two issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:17 -02:00
Mauro Carvalho Chehab 312d63e4b0 [media] rc-dib0700-nec: Fix keytable for Pixelview SBTVD
dib0700 now outputs NEC extended keycodes. Fix the keytable to reflect that.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:16 -02:00
Tobias Lorenz 186a21cb77 [media] radio-si470x: Always report support for RDS
The si470x i2c and usb driver support the RDS, so this ifdef statement
doesn't need more.

[mchehab@redhat.com: Fix a conflict on it]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:15 -02:00
Tobias Lorenz 131ddd1a30 [media] radio-si470x: de-emphasis should be set if requested by module parameter
instead of always setting de-emphasis.

Reported-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:14 -02:00
Hans Verkuil a1198ccf9c [media] v4l2-ioctl: fix incorrect error code if VIDIOC_DBG_G/S_REGISTER are unsupported
The ioctls VIDIOC_DBG_S_REGISTER and VIDIOC_DBG_G_REGISTER should return -EINVAL
if the driver didn't implement them. Currently they return -EPERM if called as
non-root user. However, this check should only be done if the driver actually
implemented these ioctls. Otherwise, just return -EINVAL as we do with all
unimplemented ioctls.

This bug make the v4l2-compliance test suite fail.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:13 -02:00
Hans de Goede 4c77590225 [media] gspca_sonixb: Fix mirrored image with ov7630
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:12 -02:00
Hans de Goede e48d38f7f1 [media] gspca_sonixj: Add one more commented out usb-id
While going through windows inf file I found more usb-id, add a comment
with this id for future reference.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:11 -02:00
Hans de Goede e530a5e3cf [media] gspca_sonixj: Probe sensor type independent of bridge type
Looking at the windows inf file, for usb ids with a sensor type where probing
is needed to determine the type (for example ov7630 or soi768), this is
needed for all bridge variants with a usb id indicating this sensor type.

So do the probing to determine the actual sensor type for types where the
usb-id info is not 100% deterministic, independent of the bridge type.

If you look through the list of currently active usb ids in sonixj, this
effectively only changes the code path for 0c45:60fe (sn9c105 + ov7630) and
0c45:612e (sn9c110 + ov7630), which according to the inf file can have a
soi768 instead of a ov7630 just like the sn9c120 + ov7630 models where we
already probe for a soi7630.

The main reason for this code change is to keep the code paths as bridge
variant independent as possible, so that we don't need a lot of special
per bridge cases, as we enable more usb-ids in the future.

This change makes the 0c45:60fe code path identical to the successfully
tested 0c45:613e, so also make sonixj the default driver for 0c45:60fe.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:10 -02:00
Hans de Goede 4944e27d85 [media] gspca_sonixj: Enable more usb ids when sn9c102 gets compiled too
Both we and the windows driver make no sensor specific differences
(with some exceptions) for different sonixj bridge types. Thus if a
sn9c105 bridge has been successfully tested with a sensor, the same
sensor can be successfully used with a sn9c120 bridge too.

Using this knowledge we can move over most usb-ids too the sonixj
driver when both are compiled.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:08 -02:00
Hans de Goede 69ffd25457 [media] gspca_sonixb: Add usb ids for known sn9c103 cameras
Now that our bridge code is unified for sn9c101/102 and sn9c103 models,
the sn9c103 models should simply work, given that the only difference
in the sn9c103 is audio support and a gamma correction table.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:07 -02:00
Hans de Goede 4e17cd2eac [media] gspca_sonixb: TAS5130C brightness control really is a gain control
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:07 -02:00
Hans de Goede 0d0d7ef71e [media] gspca_sonixb: Fix TAS5110D sensor gain control
Also fix the issue of the image being mirrored.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:06 -02:00
Hans de Goede f913c001cd [media] gspca_sonixb: Adjust autoexposure window for vga cams so that it is centered
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:05 -02:00
Hans de Goede 0a76cb8cef [media] gspca_sonixb: Refactor to unify bridge handling
Refactor the code to unify how the sn9c101/102 and the sn9c103 bridge
are handled. Also move code which is the same for all sensors from
the per sensor init register settings to a central place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:03 -02:00
Hans de Goede a24f0c5c47 [media] sn9c102: Remove not supported and non existing usb ids
The sn9c102 driver claims a number of usb-ids which are for cameras
with sensor types which it does not support. Also it claims a number
of usb-ids which do not exist at all (not present in the windows
drivers .inf files, not known by google).

This patch also fixes the conflict with the gspca_sonixj driver for the
0c45:60c0 and 0c45:60fb usb ids.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:02 -02:00
Hans de Goede 8b064ee19d [media] et61x251: remove wrongly claimed usb ids
The et61x251 driver claims a whole list of usb id's, but it only has
one sensor "module" which does sensor detection based on usb id and that
only supports devices with the 102c:6251 usb id. Remove the usb-ids for
other devices as for those the driver will fail with an unable to determine
sensor type message anyways.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:01 -02:00
Hans de Goede 0d0ae15dde [media] gspca_main: wake wq on streamoff
We check for not streaming as a condition to abort waiting in dqbuf, so
when another thread does a streamoff we should wake the wq.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:45:00 -02:00
Hans de Goede ce5610bca7 [media] gspca_main: Allow switching from read to mmap / userptr mode
Some applications (xawtv, qv4l2) mix read and mmap calls. Allow switching
from read mode back to mmap mode (by doing a reqbufs).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:59 -02:00
Hans de Goede ee3629914b [media] gspca_main: Simplify read mode memory type checks
gspca_dev->memory == GSPCA_MEMORY_NO implies gspca_dev->nframes == 0,
so there is no need to check for both in dev_poll. The check in
dev_read also is more complex then needed, as dqbuf which dev_read
calls already does all necessary checks. Moreover dqbuf is holding
the proper locks while checking where as dev_read itself is not.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:58 -02:00
Hans de Goede d642de2ed4 [media] gspca_main: Set memory type to GSPCA_MEMORY_NO on buffer release
Before this patch we were not setting the memory type to GSPCA_MEMORY_NO
when the buffers were released by the app doing a reqbufs 0. Nor would
the memory type be set to GSPCA_MEMORY_NO on device close, as capture_file
already is NULL on device close because of the reqbufs 0. This caused the
following problem:
-app1 does reqbufs USERPTR for 4 buffers
-app1 does reqbufs USERPTR for 0 buffers
-app2 tries to do reqbufs MMAP for 4 buffers
 fails because gspca_dev->memory still is USERPTR

Fixing this also allows an app to switch memory type's by unrequesting
the buffers and re-requesting them of a different type.

This patch also moves the setting of gspca_dev->frsz and gscpa_dev->memory
to after alloc_frame succeeding, so that they are not changed when allocating
fails.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:57 -02:00
Hans de Goede 7f6eb118df [media] gspca_main: Remove no longer used users variable
Remove the no longer used / useful users variable, and with that gone
there also is no longer a need to take queue_lock in dev_open.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:56 -02:00
Hans de Goede 4a82bc60a9 [media] gspca_main: Update buffer flags even when user_copy fails
Before this patch dqbuf errors out on a failing user_copy (with user pointers)
before updating the buffer flags, causing a successsfully dequeued buffer
to still have the DONE flag, which means that it could no longer be
re-queueud (assuming the app somehow survives the segfault).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:55 -02:00
Hans de Goede 27074efa2e [media] gspca_main: Locking fixes 2
Before this patch vidioc_dqbuf is using its own read_lock, where as
other queue related functions use queue_lock. This means that dqbuf is
accessing several variables in a racy manor. The most important one
being fr_o, which may be changed from underneath dqbuf by vidioc_reqbufs
or vidioc_streamoff. Other variables which it accesses unprotected
are gspca_dev->memory, gspca_dev->streaming and gspca_dev->capt_file.

This patch fixes this by changing vidioc_dqbuf to also use the queue_lock.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:54 -02:00
Hans de Goede 4e770f7602 [media] gspca_main: Locking fixes 1
The gspca_dev->streaming boolean is protected against multiple access
through gspca_dev->queue_lock everywhere except for 2 places. This patch
fixes this by bringing it under the lock in vidioc_streamoff. And by
removing the check for gspca_dev->streaming in gspca_disconnect,
the destroy_urbs call may be called multiple times (and is protected
by the usb_lock) and calling wake_up_interruptible can also always be done
safely.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:53 -02:00
Antti Palosaari 82f4b5b67e [media] af9013: fix AF9013 TDA18271 IF config
IF freq	for DVB-T 7 MHz	and 8 MHz was set slightly wrong. Due to that it
didn't worked at all (?) for 7 MHz channels and most likely performance
was dropped for 8 MHz channels.

That bug was pointed by few people during last two months. Thank you.

Trivial fix. Compile tested only due to lack of proper HW and signal.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: Romolo Manfredini <romoloman@hotmail.com>
Cc: Alireza Moini <alireza.moini@silverbrookresearch.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:44:52 -02:00
Hans Verkuil 424852f437 [media] radio-gemtek-pci: remove duplicate driver
The radio-gemtek-pci driver is for the same hardware as the radio-maxiradio
driver which uses the same GemTek PR103 and tea5757 combination and the two
drivers are identical. I chose the maxiradio over the gemtek-pci driver since
the maxiradio has support for mono/stereo detection.

Tested with my gemtek-pci card.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:23 -02:00
Hans Verkuil 90d873a7f9 [media] radio-maxiradio.c: use sensible frequency range
Use the standard USA/Europe frequency range of 87-108 MHz instead of the
arbitrary 50-150 MHz.

Copied from the radio-gemtek-pci driver which supports the same hardware.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:22 -02:00
Hans Verkuil 9bfaae24f9 [media] davinci: convert vpif_display to core-assisted locking
vpif_display now uses .unlocked_ioctl instead of .ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:21 -02:00
Hans Verkuil 46656afa8a [media] davinci: convert vpif_capture to core-assisted locking
Now uses .unlocked_ioctl instead of .ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:20 -02:00
Mats Randgaard 2c0ddd1774 [media] vpif_cap/disp: Cleanup, improved comments
Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Murali Karicheri <mkaricheri@gmail.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:19 -02:00
Mats Randgaard c027e165d2 [media] vpif_cap/disp: Added support for DV timings
Added functions to set and get custom DV timings.

Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:17 -02:00
Mats Randgaard 40c8bcea6b [media] vpif_cap/disp: Add support for DV presets
- Added functions to set/get/query/enum DV presets for vpif_caputre and
  vpif_display.
- The format specification table is extended with all the DV formats
  supported by TVP7002.

Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:16 -02:00
Mats Randgaard aa44440635 [media] vpif: Consolidate formats from capture and display
- The ch_params tables in vpif_capture.c and vpif_display.c are moved to a common
  table in vpif.c. Then it is easier to maintain the table.
- The field "fps" is removed from the struct vpif_channel_config_params because it
  is not used.

Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by : Murali Karicheri <mkaricheri@gmail.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:15 -02:00
Mats Randgaard 7036d6a73c [media] vpif_cap/disp: Add debug functionality
The following functions are added to the drivers:
    - vpif_g_chip_ident
    - vpif_dbg_g_register
    - vpif_dbg_s_register
    - vpif_log_status

Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:14 -02:00
Hans Verkuil d2db8fee0d [media] cpia2: convert .ioctl to .unlocked_ioctl
Implement core-assisted locking in cpia2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:12 -02:00
Hans Verkuil 9af39713fe [media] saa7146: Convert from .ioctl to .unlocked_ioctl
Convert saa7146 to use core-assisted locking.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:10 -02:00
Hans Verkuil b219ab9cfb [media] bttv: remove obsolete 'no_tda9875' field
Since tda9875 is part of tvaudio this field no longer makes sense. Remove it.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:09 -02:00
Hans Verkuil f037484337 [media] tda9875: remove duplicate driver
In commit 411674fd18 the tda9875 support was
added to tvaudio. This means that tda9875 is no longer used since mid-2009.

If there are out-of-tree users of this driver, then they can switch to tvaudio
instead.

The original commit message read as follows:

    This change allows bttv to use tvaudio for this device. Since this device
    has the same i2c address as the tda9874 we need to support both in the same
    tvaudio driver. This makes it possible for tvaudio to detect which chip is
    used. Originally the tda9875 was only available in the dedicated tda9875
    driver, but that makes life very hard for bttv since loading tvaudio might
    misdetect a tda9875 as a tda9874.

So there were good reasons for moving the tda9875 code into tvaudio.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19 11:28:08 -02:00
Linus Torvalds d73b388459 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI/PM: Report wakeup events before resuming devices
  PCI/PM: Use pm_wakeup_event() directly for reporting wakeup events
  PCI: sysfs: Update ROM to include default owner write access
  x86/PCI: make Broadcom CNB20LE driver EMBEDDED and EXPERIMENTAL
  x86/PCI: don't use native Broadcom CNB20LE driver when ACPI is available
  PCI/ACPI: Request _OSC control once for each root bridge (v3)
  PCI: enable pci=bfsort by default on future Dell systems
  PCI/PCIe: Clear Root PME Status bits early during system resume
  PCI: pci-stub: ignore zero-length id parameters
  x86/PCI: irq and pci_ids patch for Intel Patsburg
  PCI: Skip id checking if no id is passed
  PCI: fix __pci_device_probe kernel-doc warning
  PCI: make pci_restore_state return void
  PCI: Disable ASPM if BIOS asks us to
  PCI: Add mask bit definition for MSI-X table
  PCI: MSI: Move MSI-X entry definition to pci_regs.h

Fix up trivial conflicts in drivers/net/{skge.c,sky2.c} that had in the
meantime been converted to not use legacy PCI power management, and thus
no longer use pci_restore_state() at all (and that caused trivial
conflicts with the "make pci_restore_state return void" patch)
2011-01-14 09:29:05 -08:00
Linus Torvalds 008d23e485 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  Documentation/trace/events.txt: Remove obsolete sched_signal_send.
  writeback: fix global_dirty_limits comment runtime -> real-time
  ppc: fix comment typo singal -> signal
  drivers: fix comment typo diable -> disable.
  m68k: fix comment typo diable -> disable.
  wireless: comment typo fix diable -> disable.
  media: comment typo fix diable -> disable.
  remove doc for obsolete dynamic-printk kernel-parameter
  remove extraneous 'is' from Documentation/iostats.txt
  Fix spelling milisec -> ms in snd_ps3 module parameter description
  Fix spelling mistakes in comments
  Revert conflicting V4L changes
  i7core_edac: fix typos in comments
  mm/rmap.c: fix comment
  sound, ca0106: Fix assignment to 'channel'.
  hrtimer: fix a typo in comment
  init/Kconfig: fix typo
  anon_inodes: fix wrong function name in comment
  fix comment typos concerning "consistent"
  poll: fix a typo in comment
  ...

Fix up trivial conflicts in:
 - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
 - fs/ext4/ext4.h

Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.
2011-01-13 10:05:56 -08:00
Linus Torvalds 23d69b09b7 Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits)
  usb: don't use flush_scheduled_work()
  speedtch: don't abuse struct delayed_work
  media/video: don't use flush_scheduled_work()
  media/video: explicitly flush request_module work
  ioc4: use static work_struct for ioc4_load_modules()
  init: don't call flush_scheduled_work() from do_initcalls()
  s390: don't use flush_scheduled_work()
  rtc: don't use flush_scheduled_work()
  mmc: update workqueue usages
  mfd: update workqueue usages
  dvb: don't use flush_scheduled_work()
  leds-wm8350: don't use flush_scheduled_work()
  mISDN: don't use flush_scheduled_work()
  macintosh/ams: don't use flush_scheduled_work()
  vmwgfx: don't use flush_scheduled_work()
  tpm: don't use flush_scheduled_work()
  sonypi: don't use flush_scheduled_work()
  hvsi: don't use flush_scheduled_work()
  xen: don't use flush_scheduled_work()
  gdrom: don't use flush_scheduled_work()
  ...

Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c
as per Tejun.
2011-01-07 16:58:04 -08:00
Linus Torvalds 3e5b08cbbf Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (144 commits)
  USB: add support for Dream Cheeky DL100B Webmail Notifier (1d34:0004)
  USB: serial: ftdi_sio: add support for TIOCSERGETLSR
  USB: ehci-mxc: Setup portsc register prior to accessing OTG viewport
  USB: atmel_usba_udc: fix freeing irq in usba_udc_remove()
  usb: ehci-omap: fix tll channel enable mask
  usb: ohci-omap3: fix trivial typo
  USB: gadget: ci13xxx: don't assume that PAGE_SIZE is 4096
  USB: gadget: ci13xxx: fix complete() callback for no_interrupt rq's
  USB: gadget: update ci13xxx to work with g_ether
  USB: gadgets: ci13xxx: fix probing of compiled-in gadget drivers
  Revert "USB: musb: pm: don't rely fully on clock support"
  Revert "USB: musb: blackfin: pm: make it work"
  USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path
  USB: uas: Ensure we only bind to a UAS interface
  USB: uas: Rename sense pipe and sense urb to status pipe and status urb
  USB: uas: Use kzalloc instead of kmalloc
  USB: uas: Fix up the Sense IU
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  usb: gadget: g_ncm added
  ...

Manually fix up trivial conflicts in USB Kconfig changes in:
	arch/arm/mach-omap2/Kconfig
	arch/sh/Kconfig
	drivers/usb/Kconfig
	drivers/usb/host/ehci-hcd.c
and annoying chip clock data conflicts in:
	arch/arm/mach-omap2/clock3xxx_data.c
	arch/arm/mach-omap2/clock44xx_data.c
2011-01-07 13:16:28 -08:00
Linus Torvalds 9e9bc97367 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: (255 commits)
  [media] radio-aimslab.c: Fix gcc 4.5+ bug
  [media] cx25821: Fix compilation breakage due to BKL dependency
  [media] v4l2-compat-ioctl32: fix compile warning
  [media] zoran: fix compiler warning
  [media] tda18218: fix compile warning
  [media] ngene: fix compile warning
  [media] DVB: IR support for TechnoTrend CT-3650
  [media] cx23885, cimax2.c: Fix case of two CAM insertion irq
  [media] ir-nec-decoder: fix repeat key issue
  [media] staging: se401 depends on USB
  [media] staging: usbvideo/vicam depends on USB
  [media] soc_camera: Add the ability to bind regulators to soc_camedra devices
  [media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor
  [media] v4l: soc-camera: switch to .unlocked_ioctl
  [media] v4l: ov772x: simplify pointer dereference
  [media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
  [media] ov9640: use macro to request OmniVision OV9640 sensor private data
  [media] ivtv-i2c: Fix two warnings
  [media] staging/lirc: Update lirc TODO files
  [media] cx88: Remove the obsolete i2c_adapter.id field
  ...
2011-01-06 18:32:12 -08:00
Mauro Carvalho Chehab e3c9221519 [media] radio-aimslab.c: Fix gcc 4.5+ bug
gcc 4.5+ doesn't properly evaluate some inlined expressions.
A previous patch were proposed by Andrew Morton using noinline.
However, the entire inlined function is bogus, so let's just
remove it and be happy.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-06 08:26:02 -02:00
Hans Verkuil 36f54ff67b [media] v4l2-compat-ioctl32: fix compile warning
drivers/media/video/v4l2-compat-ioctl32.c: In function 'get_v4l2_format32':
drivers/media/video/v4l2-compat-ioctl32.c:169:2: warning: case value '0' not in enumerated type 'enum v4l2_buf_type'
drivers/media/video/v4l2-compat-ioctl32.c: In function 'put_v4l2_format32':
drivers/media/video/v4l2-compat-ioctl32.c:200:2: warning: case value '0' not in enumerated type 'enum v4l2_buf_type'

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-04 16:47:50 -02:00
Hans Verkuil 1a5e5af0d2 [media] zoran: fix compiler warning
drivers/media/video/zoran/zoran_driver.c: In function 'zoran_dqbuf':
drivers/media/video/zoran/zoran_driver.c:2197:21: warning: 'bs.frame' may be used uninitialized in this function

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-04 16:47:49 -02:00
Hans Verkuil 0c8fc77e48 [media] tda18218: fix compile warning
drivers/media/common/tuners/tda18218.c: In function 'tda18218_wr_regs':
drivers/media/common/tuners/tda18218.c:58:5: warning: 'ret' may be used uninitialized in this function

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-04 16:47:45 -02:00
Hans Verkuil 4f77b86c66 [media] ngene: fix compile warning
drivers/media/dvb/ngene/ngene-core.c: In function 'ngene_start':
drivers/media/dvb/ngene/ngene-core.c:1308:16: warning: unused variable 'flags'

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-04 16:47:43 -02:00
Justin P. Mattock eb78bd7d8a media: comment typo fix diable -> disable.
The below patch fixes a typo "diable" to "disable".

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-03 16:03:38 +01:00
Hans Verkuil 8fd0bda511 [media] em28xx: radio_fops should also use unlocked_ioctl
em28xx uses core assisted locking, so it shouldn't use .ioctl.
The .ioctl callback was replaced by .unlocked_ioctl for video nodes,
but not for radio nodes. This is now corrected.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-03 09:52:25 -02:00
Mauro Carvalho Chehab 46e67acd5d [media] wm8775: Revert changeset fcb9757333 to avoid a regression
It seems that cx88 and ivtv use wm8775 on some different modes. The
patch that added support for a board with wm8775 broke ivtv boards with
this device. As we're too close to release 2.6.37, let's just revert
it.

Reported-by: Andy Walls <awalls@md.metrocast.net>
Reported-by: Eric Sharkey <eric@lisaneric.org>
Reported-by: Auric <auric@aanet.com.au>
Reported by: David Gesswein <djg@pdp8online.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-03 09:09:56 -02:00
Andy Walls f23b7952d3 [media] cx25840: Prevent device probe failure due to volume control ERANGE error
This patch fixes a regression that crept into 2.6.36.

The volume control scale in the cx25840 driver has an unusual mapping
from register values to v4l2 volume control values.  Enforce the mapping
limits, so that the default volume control setting does not fall out of
bounds to prevent the cx25840 module device probe from failing.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-03 09:08:16 -02:00
David Henningsson 9d1da730ee [media] DVB: IR support for TechnoTrend CT-3650
Based on Waling Dijkstra's discovery that the IR works the same as
on the TT-1500, this patch has been rewritten to fit with the
rc_core infrastructure.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-31 13:46:21 -02:00
Igor M. Liplianin ebce9a3331 [media] cx23885, cimax2.c: Fix case of two CAM insertion irq
For example  boot up with two CAM inserted.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-31 13:46:20 -02:00
Mariusz Białończyk 21d3301410 [media] ir-nec-decoder: fix repeat key issue
Fixing the problem with NEC protocol and repeating keys under the following
circumstances. The problem occurs when there is a repeat code without
properly decoded scancode. This leads to repeat the wrong (last decoded)
scancode.

An example from real life:
I am pressing volume down, then several minutes later i am pressing
volume up, but the real scancode is wrongly decoded and only a repeat
event is emitted, so as a result volume is going down while i am holding
volume up button.

The patch fixes above problem using rc_keyup timeout (as pointed by Mauro).
It just prevents key repeats if they appear after rc_keyup.

Signed-off-by: Mariusz Białończyk <manio@skyboo.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-31 13:46:01 -02:00
Alberto Panizzo 96e442c1b2 [media] soc_camera: Add the ability to bind regulators to soc_camedra devices
In certain machines, camera devices are supplied directly
by a number of regulators. This patch add the ability to drive
these regulators directly by the soc_camera driver.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:37 -02:00
Alberto Panizzo 3153ac9c62 [media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:34 -02:00
Guennadi Liakhovetski b6a633c18b [media] v4l: soc-camera: switch to .unlocked_ioctl
Use the V4L mutex infrastructure in soc-camera core and drivers and switch to
.unlocked_ioctl.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:26 -02:00
Guennadi Liakhovetski c85bb69af0 [media] v4l: ov772x: simplify pointer dereference
Use a more direct way to obtain a pointer to struct ov772x_priv, where the
subdevice is available.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:23 -02:00
David Cohen 63c9718c1a [media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
OmniVision OV9640 driver wasn't requesting properly its private data
on I2C remove and video_probe functions. It was retrieving the V4L2
subdev struct address instead of priv struct's one. This patch fixes
such problem.

Signed-off-by: David Cohen <dacohen@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:21 -02:00
David Cohen f7b74f76a3 [media] ov9640: use macro to request OmniVision OV9640 sensor private data
This cleanup patch creates macro to request OmniVision OV9640 private
data, which increases readability.

Signed-off-by: David Cohen <dacohen@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 22:29:20 -02:00
Mauro Carvalho Chehab 9804ed9e84 [media] ivtv-i2c: Fix two warnings
Fix two gcc warnings:

drivers/media/video/ivtv/ivtv-i2c.c:170: warning: cast from pointer to integer of different size
drivers/media/video/ivtv/ivtv-i2c.c:171: warning: cast from pointer to integer of different size
$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)

They seem bogus, but, as the original code also has problems with
LE/BE, just change its implementation to be clear.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 13:06:35 -02:00
Mauro Carvalho Chehab 6a23a520c0 [media] cx88: Remove the obsolete i2c_adapter.id field
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:19 -02:00
Andy Walls a9cd591e29 [media] ir-kbd-i2c: Add HD PVR IR Rx support to ir-kbd-i2c
Add HD PVR IR Rx support to ir-kbd-i2c

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:16 -02:00
Andy Walls ea6c06033f [media] hdpvr: Add I2C and ir-kdb-i2c registration of the Zilog Z8 IR chip
Adds I2C registration of the Zilog Z8F0811 IR microcontroller for either
lirc_zilog or ir-kbd-i2c to use.  This is a required step in removing
lirc_zilog's use of the deprecated struct i2c_adapter.id field.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:14 -02:00
Mauro Carvalho Chehab 8a6334fc91 [media] ivtv-i2c: Don't use IR legacy mode for Zilog IR
The Zilog IR entries are already handled by IR new code. So,
remove its usage from the legacy IR support.

Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:10 -02:00
Mauro Carvalho Chehab e1e2c57565 [media] ivtv: Add Adaptec Remote Controller
lirc-i2c implements a get key logic for the Adaptec Remote
Controller, at address 0x6b. The only driver that seems to have
an Adaptec device is ivtv:

$ git grep -i adaptec drivers/media
drivers/media/video/cs53l32a.c: * cs53l32a (Adaptec AVC-2010 and AVC-2410) i2c ivtv driver.
drivers/media/video/cs53l32a.c: * Audio source switching for Adaptec AVC-2410 added by Trev Jackson
drivers/media/video/cs53l32a.c:   /* Set cs53l32a internal register for Adaptec 2010/2410 setup */
drivers/media/video/ivtv/ivtv-cards.c:/* Adaptec VideOh! AVC-2410 card */
drivers/media/video/ivtv/ivtv-cards.c:    { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ADAPTEC, 0x0093 },
drivers/media/video/ivtv/ivtv-cards.c:    .name = "Adaptec VideOh! AVC-2410",
drivers/media/video/ivtv/ivtv-cards.c:/* Adaptec VideOh! AVC-2010 card */
drivers/media/video/ivtv/ivtv-cards.c:    { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ADAPTEC, 0x0092 },
drivers/media/video/ivtv/ivtv-cards.c:    .name = "Adaptec VideOh! AVC-2010",
drivers/media/video/ivtv/ivtv-cards.h:#define IVTV_CARD_AVC2410         7 /* Adaptec AVC-2410 */
drivers/media/video/ivtv/ivtv-cards.h:#define IVTV_CARD_AVC2010         8 /* Adaptec AVD-2010 (No Tuner) */
drivers/media/video/ivtv/ivtv-cards.h:#define IVTV_PCI_ID_ADAPTEC                 0x9005
drivers/media/video/ivtv/ivtv-driver.c:            "\t\t\t 8 = Adaptec AVC-2410\n"
drivers/media/video/ivtv/ivtv-driver.c:            "\t\t\t 9 = Adaptec AVC-2010\n"
drivers/media/video/ivtv/ivtv-i2c.c:              0x6b,   /* Adaptec IR */

There are two Adaptec cards defined there, but AVC-2010 doesn't have a
remote controller. So, the logic at lirc_i2c seems to be for Adaptec AVC-2410.

As we'll remove lirc_i2c from kernel, move the getkey code to ivtv driver, and
use it for AVC-2410.

Reviewed-by: Andy Walls <awalls@md.metrocast.net>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:08 -02:00
Mauro Carvalho Chehab 1c0eb0ffb0 [media] cx88: Add RC logic for Leadtek PVR 2000
Currently, lirc-i2c has a decoding logic for Leadtek Remote
Control. Move it to cx88, as we intend to remove lirc-i2c.

For now, initialize LIRC remote keytable with RC_MAP_EMPTY, as
we don't know its keymap yet. It would be nice to later check
if is there any file on LIRC userspace with that keytable.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:06 -02:00
Mauro Carvalho Chehab b22374544b [media] bttv-input: Add a note about PV951 RC
When comparing lirc-i2c and ir-kbd-i2c/bttv-input logic, a difference
was noticed. As lirc-i2c will be removed soon, store the difference on
a comment inside ir-kbd-i2c, in order to preserve the knowledge we
have about that remote controller.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 12:17:05 -02:00
Hans Verkuil 61ea3aa5bf [media] timblogiw: fix compile warning
Fix 64-bit compile warning:

drivers/media/video/timblogiw.c: In function ‘timblogiw_dma_filter_fn’:
drivers/media/video/timblogiw.c:151: warning: cast from pointer to integer of different size
drivers/media/video/timblogiw.c: In function ‘timblogiw_open’:
drivers/media/video/timblogiw.c:670: warning: cast to pointer from integer of different size

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Richard Rojförs <richard.rojfors@pelagicore.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:35 -02:00
Hans Verkuil 657f227105 [media] v4l: fix handling of v4l2_input.capabilities
The v4l core sets the v4l2_input.capabilities field based on the supplied
v4l2_ioctl_ops. However, several drivers do a memset or memcpy of the v4l2_input
struct, thus overwriting that field incorrectly.

Either remove the memset (which is already done by the v4l core), or add the
proper capabilities field in case of a memcpy.

The same is also true for v4l2_output, but that only affected the ivtv driver.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:29 -02:00
Hans Verkuil 3ea2b673a5 [media] em28xx: fix incorrect s_ctrl error code and wrong call to res_free
Calling subdevs to handle s_ctrl returned a non-zero return code even if
everything went fine.

Calling STREAMOFF if no STREAMON happened earlier would hit a BUG_ON
in res_free.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:23 -02:00
Hans Verkuil 02ac04805e [media] v4l2-ctrls: only check def for menu, integer and boolean controls
The 'def' field is only valid for menus, integers and booleans.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:18 -02:00
Hans Verkuil 513521eaee [media] v4l2-ctrls: use const char * const * for the menu arrays
This prevents checkpatch warnings generated when defining
'static const char *foo[]' arrays. It makes sense to use
const char * const * anyway since the pointers in the array
are indeed const.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:14 -02:00
Hans Verkuil 6d6a48e51f [media] usbvision: coding style
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:09 -02:00
Hans Verkuil 52cb0bf275 [media] usbvision: convert // to /* */
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:02:02 -02:00
Hans Verkuil 5490a7cbe6 [media] usbvision: get rid of camelCase
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:01:56 -02:00
Hans Verkuil c627b9d1f5 [media] usbvision: convert to unlocked_ioctl
Convert driver to use core-assisted locking.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30 08:01:45 -02:00
Jean-François Moine aa777a88b2 [media] gspca - sonixj: Bad clock for om6802 in 640x480
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:21 -02:00
Jean-François Moine 71e84ea7f0 [media] gspca - stv06xx/st6422: Use the new video control mechanism
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:21 -02:00
Jean-François Moine 7e5f9059a8 [media] gspca - vc032x: Cleanup source
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:20 -02:00
Jean-François Moine 7fbee99aa2 [media] gspca - zc3xx: The sensor of the VF0250 is a GC0303
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:20 -02:00
Jean-François Moine 49fb5e60f7 [media] gspca - zc3xx: Use the new video control mechanism
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:20 -02:00
Jean-François Moine 7d55a84b0a [media] gspca - zc3xx: Keep sorted the device table
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:20 -02:00
Jean-François Moine 2bbf53bd17 [media] gspca: Bad comment
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:19 -02:00
Jean-François Moine 0aeb5ec74b [media] gspca - pac7302/pac7311: Fix some warnings
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:19 -02:00
Jean-François Moine d85185902f [media] gspca - main: Fix some warnings
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:19 -02:00
Hans Verkuil b9218f2f15 [media] saa6588: rename rds.h to saa6588.h
The naming of the media/rds.h header suggested that it was a generic
RDS header, when in fact it is just a saa6588 module API that is
internal to the kernel.

Rename the header and the struct and defines in it to make this clear.

Also removed the header include in radio-si470x.h (not used anymore)
and from ioctl-number.txt (it's internal to the kernel and never called
from userspace).

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:18 -02:00
Vasiliy Kulikov a519d70e0c [media] media: video: pvrusb2: fix memory leak
Use put_device() instead of kfree() because of device name leak.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:18 -02:00
Alexey Chernov 9028f58f5d [media] support of GoTView PCI-E X5 3D Hybrid in cx23885
Some comments:
1. Everything initialize properly except radio.
2. All analog inputs (TV, composite, S-Video) are tested by myself in several
TV norms (SECAM-D, PAL, NTSC), everything work fine.

So the patch adds general support/detection of the card with working analog
part, DVB part is not supported for now.

Signed-off-by: Alexey Chernov <4ernov@gmail.com>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:18 -02:00
Dan Carpenter 5f63306d82 [media] cx231xx: use bitwise negate instead of logical
Bitwise negate was intended here.  INPUT_SEL_MASK is 0x30.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:18 -02:00
Mauro Carvalho Chehab a3fa904ec7 [media] em28xx: Fix audio input for Terratec Grabby
The audio input line was wrong. Fix it.

Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:17 -02:00
Ramiro Morales b7a0f2e793 [media] saa7134: Add support for Compro VideoMate Vista M1F
Signed-off-by: Pavel Osnova <pvosnova@gmail.com>
Signed-off-by: Ramiro Morales <ramiro@rmorales.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:17 -02:00
Ang Way Chuang 44c6e2a7c2 [media] cx88-dvb.c: DVB net latency using Hauppauge HVR4000
A Hauppauge HVR 4000 is used on a School On Internet Asia (SOI Asia)
project in order to carry IP traffic over ULE. However, there is an
issue with high latency jitter.

My boss, Husni, identified the problem and provided a patch for it.

The default buffer size of 32 TS frames on cx88 causes the high latency,
so our deployment changes that to 6 TS frames. This patch made the
buffer size tunable, while keeping the default buffer size of 32 TS
frames unchanged.

Signed-off-by: Achmad Husni Thamrin <husni@ai3.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:17 -02:00
Dan Carpenter fe04164647 [media] cx231xxx: fix typo in saddr_len check
The original code compared "saddr_len" with zero twice in a nonsensical
way.  I asked the list, and Andy Walls and Sri Deevi say that the second
check should be if "saddr_len == 1".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Srinivasa Deevi <Srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:16 -02:00
Anatolij Gustschin 50155c25bf [media] fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support
VIDIOC_QUERYSTD and VIDIOC_G_STD ioctls are currently not
supported in the FSL VIU driver. The decoder subdevice
driver saa7115 extended by previous patch supports QUERYSTD
for saa711x, so we add the appropriate ioctls to the VIU
driver to be able to determine the video input's standard.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:16 -02:00
Anatolij Gustschin f9d7d78784 [media] saa7115: allow input standard autodetection for more chips
Autodetect input's standard using field frequency detection
feature (FIDT in status byte at 0x1F) of the chips saa7111/
saa7111a/saa7113/saa7114/saa7118.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:16 -02:00
David Henningsson db9285f79b [media] MEDIA: RC: Provide full scancodes for TT-1500 remote control
Add 0x15 prefix to scancodes for TT-1500 remote control.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:15 -02:00
David Henningsson 730726a6f9 [media] DVB: Set scanmask for Budget/SAA7146 cards
These devices do not return the full command+address, so set
scanmask accordingly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:15 -02:00
Mauro Carvalho Chehab 2d5ca76f2b [media] dabusb: Move it to staging to be deprecated
dabusb driver were conceived as an experimental driver for a test
device. The driver never supported any shipped product, and, while
there were some updates on it in 2003, for an ancient product,
those changes were never submitted upstream.

Also, there's no DocBook for its API, nor any upstream discussion.

So, better to remove it, on .39. If later needed, we may rescue it
from git logs. For now, let's move it to staging.

Acked-by: Deti Fliegl <deti@fliegl.de>
Cc: Deti Fliegl <deti@fliegl.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:15 -02:00
Mauro Carvalho Chehab 0170f6bcb2 [media] streamzap: Fix a compilation warning when compiled builtin
drivers/media/rc/streamzap.c: In function ‘streamzap_probe’:
drivers/media/rc/streamzap.c:460:2: warning: statement with no effect

Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:14 -02:00
Mauro Carvalho Chehab 465a9e3a2f [media] af9013: Fix a compilation warning
drivers/media/dvb/frontends/af9013.c: In function ‘af9013_update_signal_strength.clone.0’:
drivers/media/dvb/frontends/af9013.c:967:6: warning: ‘ret’ may be used uninitialized in this function

Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:14 -02:00
Mauro Carvalho Chehab 187e7d3b9b [media] stv090x: Fix some compilation warnings
A few typos at the driver are causing the following warnings:

drivers/media/dvb/frontends/stv090x.c: In function ‘stv090x_start_search’:
drivers/media/dvb/frontends/stv090x.c:1486:27: warning: comparison between ‘enum stv090x_search’ and ‘enum stv090x_delsys’
drivers/media/dvb/frontends/stv090x.c:1487:24: warning: comparison between ‘enum stv090x_search’ and ‘enum stv090x_delsys’
drivers/media/dvb/frontends/stv090x.c: In function ‘stv090x_optimize_track’:
drivers/media/dvb/frontends/stv090x.c:2943:2: warning: case value ‘4’ not in enumerated type ‘enum stv090x_delsys’

The first two are due to the lack of using the delsys types
	STV090x_DVBS1/STV090x_DSS
instead of
	STV090x_SEARCH_DVBS1/STV090x_SEARCH_DSS

The second one is due to the usage of STV090x_UNKNOWN (enum stv090x_modulation)
instead of STV090x_ERROR (enum stv090x_delsys).

Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:14 -02:00
Mauro Carvalho Chehab 95f18be2e4 [media] gspca: Fix a warning for using len before filling it
The check for status errors is now before the check for len. That's
ok. However, the error printk's for the status error prints the URB
length. This generates this error:

drivers/media/video/gspca/gspca.c: In function ‘fill_frame’:
drivers/media/video/gspca/gspca.c:305:9: warning: ‘len’ may be used uninitialized in this function

The fix is as simple as moving the len init to happen before the checks.

Cc: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:14 -02:00
Mauro Carvalho Chehab 2e94b53c55 [media] dib7000m/dib7000p: Add support for TRANSMISSION_MODE_4K
Fixes several warnings:

drivers/media/dvb/frontends/dib7000m.c: In function ‘dib7000m_set_channel’:
drivers/media/dvb/frontends/dib7000m.c:808:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:869:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c: In function ‘dib7000m_tune’:
drivers/media/dvb/frontends/dib7000m.c:1023:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:1033:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000m.c:1043:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c: In function ‘dib7000p_set_channel’:
drivers/media/dvb/frontends/dib7000p.c:720:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:773:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c: In function ‘dib7000p_tune’:
drivers/media/dvb/frontends/dib7000p.c:997:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:1007:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’
drivers/media/dvb/frontends/dib7000p.c:1017:3: warning: case value ‘255’ not in enumerated type ‘fe_transmit_mode_t’

The drivers were prepared to support 4K carriers, but as the define were added
later, they were using a "magic" value of 255.

Cc: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:13 -02:00
Mauro Carvalho Chehab fce50ac80e [media] radio-wl1273: Fix two warnings
drivers/media/radio/radio-wl1273.c: In function ‘wl1273_fm_upload_firmware_patch’:
drivers/media/radio/radio-wl1273.c:675:2: warning: ‘n’ may be used uninitialized in this function
drivers/media/radio/radio-wl1273.c:675:2: warning: ‘i’ may be used uninitialized in this function

Those vars are never initialized, and the debug message makes no sense, as it
will show just two random values.

Cc: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:13 -02:00
Mauro Carvalho Chehab 9ae2ae35f8 [media] dmxdev: Fix a compilation warning due to a bad type
drivers/media/dvb/dvb-core/dmxdev.c: In function ‘dvb_dmxdev_start_feed’:
drivers/media/dvb/dvb-core/dmxdev.c:583:13: warning: comparison between ‘enum dmx_ts_pes’ and ‘enum <anonymous>’

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:13 -02:00
Mauro Carvalho Chehab 22efe50770 [media] omap_vout: Remove an obsolete comment
This comment mentions a field that doesn't exist, and talks about
videodev.h that got removed. So, it doesn't make any sense to keep
it.

Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:12 -02:00
Mauro Carvalho Chehab 88ae7624a6 [media] V4L1 removal: Remove linux/videodev.h
There's no sense on keeping it on 2.6.38, as nobody is using it
anymore, at the kernel tree, and installing it at the userspace
API.

As two deprecated drivers still need it, move it to their internal
directories.

Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:11 -02:00
Mauro Carvalho Chehab 58c66df3e3 [media] Remove VIDEO_V4L1 Kconfig option
There's no sense on keeping VIDEO_V4L1 Kconfig option just because of
two deprecated drivers moved to staging scheduled to die on 2.6.39.

Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:11 -02:00
Andy Walls ddda424999 [media] ivtv: Return EFAULT when copy_from_user() fails in ivtv_write_vbi_from_user()
If write() on a VBI device node fails due to a bad buffer pointer from
userspace, we should notify the application properly with EFAULT, per the
V4L2 API spec.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:10 -02:00
Andy Walls b0c45686c8 [media] ivtv: ivtv_write_vbi() should use copy_from_user() for user data buffers
ivtv_write_vbi() is used for both VBI data that came from the
driver internally and VBI data that came from the user.  However,
it did not use copy_from_user() for reading the VBI data from the
user buffers.

This change adds a new version of the function,
ivtv_write_vbi_from_user(), that uses copy_from_user() to read the VBI
data provided via user buffers.

This should resolve a sparse build warning reported by Dave Gilbert.

Reported-by: Dr. David Alan Gilbert <linux at treblig.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:10 -02:00
Andy Walls 754f9969c3 [media] cx18: Only allocate a struct cx18_dvb for the DVB TS stream
The cx18_stream struct contained a struct cx18_dvb for
every stream object, most of which were for analog capture.
Now we only allocate the cx18_dvb object for the DTV TS stream.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:10 -02:00
Andy Walls fa98447f09 [media] ivtv, cx18: Make ioremap failure messages more useful for users
The error messages these drivers emitted for ioremap() failures
were misleading and not helpful for users.  Reworded those messages
to help the user take action to resolve vmalloc address space
exhaustion.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:09 -02:00
Hans Verkuil 0a58d71306 [media] stk-webcam: remove V4L1 compatibility code, replace with V4L2 controls
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:09 -02:00
Hans Verkuil 71bb2876a3 [media] se401: deprecate driver, move to staging
The se401 driver is deprecated and is moved to staging. If no one will
convert this driver to V4L2, then it will be removed in 2.6.39.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:08 -02:00
Hans Verkuil 745da4280f [media] usbvideo: deprecate the vicam driver
Move usbvideo to staging and mark it deprecated.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:08 -02:00
Hans Verkuil 5772dcaa79 [media] usbvideo: remove deprecated drivers
Remove ibmcam, konicawc and ultracam drivers. There are replaced by
gspca drivers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:08 -02:00
Hans Verkuil 41d9931c5a [media] videobuf-dma-sg: remove obsolete comments
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:07 -02:00
Hans Verkuil ad1ecf8639 [media] zoran: remove V4L1 compat code and zoran custom ioctls
All the functionality is now handled through V4L2.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:07 -02:00
Hans Verkuil 08af245de0 [media] V4L: remove V4L1 compatibility mode
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:07 -02:00
Jean-François Moine b69a219e0e [media] gspca - ov534_9: Remove an useless instruction
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:06 -02:00
Jean-François Moine 7a5a414ccb [media] gspca - ov519: Bad detection of some ov7670 sensors
Tested-by: jim smyth <jsmyth1969@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:06 -02:00
Jean-François Moine 668f44a603 [media] gspca: Use the global error status for get/set streamparm
Also, in ov534, don't check the parm type.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:06 -02:00
Jean-François Moine 76ebc16b87 [media] gspca - main: Check the isoc packet status before its length
When an error is set for an isochronous packet, the length of the packet
may be null. In this case, the error was not detected and the image
was not discarded as it should be.

Reported-by: Franck Bourdonnec <fbourdonnec@chez.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:06 -02:00
Jean-François Moine f2c5d92ecd [media] gspca - sq930x: Fix a bad comment
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:05 -02:00
Jean-François Moine efd3769269 [media] gspca - sq930x: Some detected sensors are not handled yet
These are OmniVision's OV7660 and OV9630.
Don't register the webcam when they are found.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:05 -02:00
Jean-François Moine 3ebd179464 [media] gspca - sq930x: Don't register a webcam when there are USB errors
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:05 -02:00
Theodore Kilgore 634b477053 [media] gspca - sq905c: Adds the Lego Bionicle
This patch adds the Vendor:Product number of the Lego Bionicle camera to
the existing gspca/sq905c.c and also a line for the camera in gspca.txt.
The camera works "out of the box" with these small changes. So this is
just in time for Christmas. Think of the children.

Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:05 -02:00
Pete Eberlein a19a5cd7b3 [media] s2255drv: remove BKL
Remove BKL ioctl and use unlocked_ioctl with core-assisted locking instead.

Signed-off-by: Pete Eberlein <pete@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:04 -02:00
Marek Szyprowski 07e80305ba [media] v4l: mem2mem_testdev: remove BKL usage
Remove usage of BKL by usign per-device mutex.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:04 -02:00
Dan Carpenter dcd745b723 [media] timblogiw: too large value for strncpy()
This is a copy and paste error.  It should be using sizeof(cap->driver)
instead of sizeof(cap->card).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Richard Rojförs <richard.rojfors@pelagicore.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:04 -02:00
Jesper Juhl ef330dc2e7 [media] saa7164: Remove pointless conditional and save a few bytes in saa7164_downloadfirmware()
Hi,

release_firmware() just does nothing if passed a NULL pointer. So there's
no reason to test before the call in
saa7164-fw.c::saa7164_downloadfirmware().

Removing the pointless conditional also saves a few bytes.
before:
   text    data     bss     dec     hex filename
   7943     112    2144   10199    27d7 drivers/media/video/saa7164/saa7164-fw.o
after:
   text    data     bss     dec     hex filename
   7931     112    2136   10179    27c3 drivers/media/video/saa7164/saa7164-fw.o

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:04 -02:00
Sam Doshi 10304ca65f [media] drivers:media:dvb: add USB PIDs for Elgato EyeTV Sat
Adds USB PIDs for the Elgato EyeTV Sat device.
This device is a clone of the Terratec S7.

Signed-off-by: Sam Doshi <sam@metal-fish.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:03 -02:00
Anatolij Gustschin c335333050 [media] media: fsl-viu: fix support for streaming with mmap method
Streaming using mmap didn't work in the VIU driver. We need to
start/stop DMA in streamon/streamoff and free the buffers on
release. Add appropriate driver extension now.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:03 -02:00
Dan Carpenter 2a72b39e51 [media] zoran: bit-wise vs logical and
zr->frame_num is a counter and && was intended here instead of &.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:03 -02:00
Malcolm Priestley 75aecc3af2 [media] DM04/QQBOX Frontend attach change
On Fri, 2010-12-03 at 09:32 -0200, Mauro Carvalho Chehab wrote:
> Em 27-11-2010 11:13, Malcolm Priestley escreveu:
> > Driver Version v1.73 - Frontend attach change.
> > To stop double rc registration in multi tuner environment or firmware change.
> >
> > Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
> >
> >
> > +static int lme_name(struct dvb_usb_adapter *adap)
> > +{
> > +	struct lme2510_state *st = adap->dev->priv;
> > +	const char *desc = adap->dev->desc->name;
> > +	char *fe_name[] = {"", " LG TDQY-P001F", " SHARP:BS2F7HZ7395"};
> > +	char *name = adap->fe->ops.info.name;
> > +
> > +	strcpy(name, desc);
> > +	strcat(name, fe_name[st->tuner_config]);
>
> Please use, instead, strlcpy/strlcat, to avoid writing outside the buffer size.
>

Driver Version v1.74
Amended patch with change to strlcpy/strlcat.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:03 -02:00
Randy Dunlap c59a9bfabf [media] media: fix em28xx build, needs hardirq.h
Fix em28xx build by adding hardirq.h header file:

drivers/media/video/em28xx/em28xx-vbi.c:49: error: implicit declaration of function 'in_interrupt'

Reported-by: Zimny Lech <napohybelskurwysynom2010@gmail.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:02 -02:00
Vasiliy Kulikov 4c8b869805 [media] rc: ir-lirc-codec: fix potential integer overflow
'n' may be bigger than MAX_INT*sizeof(int), if so checking of truncated
(int)(n/sizeof(int)) for LIRCBUF_SIZE overflow and then using nontruncated 'count'
doesn't make sense.  Also n may be up to sizeof(int)-1 bytes bigger than expected,
so check value of (n % sizeof(int)) too.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:02 -02:00
Matti Aaltonen 87d1a50ce4 [media] V4L2: WL1273 FM Radio: TI WL1273 FM radio driver
This module implements V4L2 controls for the Texas Instruments
WL1273 FM Radio and handles the communication with the chip.

Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:02 -02:00
Hans de Goede 00765f16f1 [media] gspca_sonixb: Add support for 0c45:602a
Add support for cameras with the HV7131D sensor, such as the 0c45:602a

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:01 -02:00
Hans de Goede 2b3e284a89 [media] gspca_sonixb: Rewrite start of frame detection
Our old start of frame detection code wrongly assumes that the sof
marker always lives at the beginning of the frame. At least for the
0c45:602a camera this is not the case. This patch also improves
the framerate from 28 fps to 30 fps with the 0c45:6005 and 0c45:6007

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:01 -02:00
Hans de Goede d6746d55da [media] gspca_sonixb: Make sonixb handle 0c45:6007 instead of sn9c102
I've a 0c45:6007 camera and it works fine with the gspca_sonixb driver,
so make that handle it instead of the deprecated sn9c102 driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:01 -02:00
Mauro Carvalho Chehab 788e5d4dc8 [media] cx231xx: Fix IR keymap for Pixelview SBTVD Hybrid
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:01 -02:00
Mauro Carvalho Chehab 12007419b7 [media] Add a keymap for Pixelview 002-T remote
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:00 -02:00
Mauro Carvalho Chehab e330289ed4 [media] cx231xx: Fix inverted bits for RC on PV Hybrid
At Pixelview SBTVD Hybrid, the bits sent by the IR are inverted. Due to that,
the existing keytables produce wrong codes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:00 -02:00
Stephen Rothwell 49aefd2bcd [media] timblogiw: const and __devinitdata do not mix
This fixes the following error in PowerPC builds:

drivers/media/video/timblogiw.c: In function 'timblogiw_probe':
drivers/media/video/timblogiw.c:749: error: timblogiw_ioctl_ops causes a section type conflict

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:00 -02:00
Mauro Carvalho Chehab d162e7aac2 [media] gspca/sn9c20x: Fix support for mt9m001 (mi1300) sensor
Support for mt9m001 (mi1300) is broken:
	- Table is incomplete;
	- Only one resolution is currently supported by the driver;
	- Resolution is incomplete;
	- it complains about broken JPEG headers.

Use the same init found on em28xx driver, and properly report the
output format as 8-bits GRAY.

Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:17:00 -02:00
Mauro Carvalho Chehab d4b416f262 [media] gspca core: Fix regressions gspca breaking devices with audio
Changeset 35680ba broke several devices:
	- Sony Playstation Eye (1415:2000);
	- Gigaware model 25-234 (0c45:628f);
	- Logitech Messenger Plus (046d:08f6).

Probably more devices were broken by this change.

What happens is that several devices don't need to save some bandwidth
for audio.

Also, as pointed by Hans de Goede <hdegoede@redhat.com>, the logic
that implements the bandwidth reservation for audio is broken, since
it will reduce the alt number twice, on devices with audio.

So, let's just revert the broken logic, and think on a better solution
for usb 1.1 devices with audio that can't use the maximum packetsize.

Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:59 -02:00
Mauro Carvalho Chehab 86701c1d6a [media] gspca/sn9c20x: Get rid of scale "magic" numbers
Use macros for the supported scales, instead of using magic numbers
from 0 to 3.

Code become cleaner by using macros for it.

Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:59 -02:00
Mauro Carvalho Chehab e78567d227 [media] gspca/sn9c20x: Test if sensor is a OV sensor
Instead of just assuming a ov9650 sensor based on USB ID,
double-check it, by reading the sensor ID.

Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:59 -02:00
Richard Zidlicky dd89aec473 [media] keycodes for DSR-0112 remote bundled with Haupauge MiniStick
Add kycodes for DSR-0112 remote that comes together with
Haupauge MiniStick
  http://lirc.sourceforge.net/remotes/hauppauge/DSR-0112.jpg

[mchehab@redhat.com: Fix KEY_PREVIOUS to match the definition for the other model]
Signed-off-by: Richard Zidlicky <rz@linux-m68k.org>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:59 -02:00
Joe Perches 8350e1551c [media] media: Remove unnecessary casts of usb_get_intfdata
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:58 -02:00
Philippe Bourdin 9124544320 [media] Terratec Cinergy Hybrid T USB XS
I found that the problems people have reported with the USB-TV-stick
"Terratec Cinergy Hybrid T USB XS" (USB-ID: 0ccd:0042)
are coming from a wrong header file in the v4l-sources.

Attached is a diff, which fixes the problem (tested successfully here).
Obviously the USB-ID has been associated with a wrong chip: EM2880
instead of EM2882, which would be correct.

Reported-by: Philippe Bourdin <richel@AngieBecker.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:58 -02:00
Vasiliy Kulikov b395cbac36 [media] media: rc: lirc_dev: check kobject_set_name() result
kobject_set_name() may fail with -ENOMEM, check for it.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:58 -02:00
David Härdeman 801c73c04a [media] rc-core: add loopback driver
This patch adds a loopback driver to rc-core which I've found useful for
running scripted tests of different parts of rc-core without having to
fiddle with real hardware.

Basically it emulates hardware with a learning and a non-learning
receiver and two transmitters (which correspond to the two
receivers). TX data that is sent is fed back as input on the
corresponding receiver, which allows for debugging of IR decoders,
keymaps, etc.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:58 -02:00
Mauro Carvalho Chehab dea8a39fb5 [media] rc-core: Initialize return value to zero
At ir_setkeycode, if INPUT_KEYMAP_BY_INDEX is used, the routine may return
an invalid value if not error.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:58 -02:00
Mauro Carvalho Chehab b7c7a4bed8 [media] bttv: remove custom_irq and gpioq from bttv struct
The RC5 old decoder used custom_irq to indicate the need of handling
the IRQ on a different way. Instead of doing it, let the core just call the
bttv input IRQ handler, and add the code there to call the legacy decoder.

While here, remove the gpioq waitqueue, as this is not used anywhere, and
add a debug msg to help removing the legacy RC5 code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:57 -02:00
Dan Carpenter 5ae094cea1 [media] cx231xx: stray unlock on error path
The lock isn't held here and doesn't need to be unlocked.  The code has
been like this since the driver was merged.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:57 -02:00
Paul Bender 5ad1a55542 [media] rc: fix sysfs entry for mceusb and streamzap
When trying to create persistent device names for mceusb and streamzap
devices, I noticed that their respective drivers are not creating the rc
device as a child of the USB device. Rather it creates it as virtual
device. As a result, udev cannot use the USB device information to
create persistent device names for event and lirc devices associated
with the rc device. Not having persistent device names makes it more

difficult to make use of the devices in userspace as their names can
change.

Forward-ported to media_tree staging/for_v2.6.38 and tested with
both streamzap and mceusb devices:
$ ll /dev/input/by-id/
...
lrwxrwxrwx. 1 root root 9 Nov 17 17:06 usb-Streamzap__Inc._Streamzap_Remote_Control-event-if00 -> ../event6
lrwxrwxrwx. 1 root root 9 Nov 17 17:05 usb-Topseed_Technology_Corp._eHome_Infrared_Transceiver_TS000BzY-event-if00 -> ../event5
Previously, nada.

Signed-off-by: Paul Bender <pebender@gmail.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:57 -02:00
Nicolas Kaiser 5df465df7b [media] drivers/media: nuvoton: fix chip id probe v2
Make sure we have a matching chip id high and one or the other
of the chip id low values.
Print the values if the probe fails.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:57 -02:00
Joe Perches ecfc95eb74 [media] ngene-core.c: Remove unnecessary casts of pci_get_drvdata
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:56 -02:00
Joe Perches b1dc614a81 [media] drivers/media/video: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:56 -02:00
Alexey Chernov a363436396 [media] Patch for cx18 module with added support of GoTView PCI DVD3 Hybrid tuner
I've got code which adds support of GoTView PCI DVD3 Hybrid tuner in
cx18 module and Andy Walls in ivtv mailing-list gave me some advice on
making a patch and sending it here. So here's the patch against
staging/2.6.37-rc1 branch (the tutorial recommends to include it as
plain text but if it's the case I can surely send as an attachment):

Several comments on the patch:

1. Both users on the official Gotview forum and support said that PCI
DVD3 is very similar to Yuan MPC718 card so the main part of code is
taken from Yuan configuration. Some users reported it to work properly.

2. Everything is being initialized correctly including analog, dvb,
radio and alsa parts. Analogue part and alsa virtual card is tested by
myself using original Gotview card.

[mchehab@redhat.com: Whitespace cleanups]
Signed-off-by: Alexey Chernov <4ernov@gmail.com>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:56 -02:00
Mauro Carvalho Chehab 97108cf682 [media] Fix parameter description for disable_ir
It seems that a wrong cut-and-paste error were done here.

Reported-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:55 -02:00
Mariusz Białończyk eac8ae087a [media] Fix rc-tbs-nec table after converting the cx88 driver to ir-core
The patch fixes the rc-tbs-nec table after converting
drivers/media/video/cx88 to ir-core
(commit ba7e90c9f878e0ac3c0614a5446fe5c62ccc33ec).

It is also adds two missing buttons (10- and 10+) with
its definition (KEY_10CHANNELSUP and KEY_10CHANNELSDOWN).

[mchehab@redhat.com: move keycode numbers to 0x1b8/0x1b9 as requested by the input Maintainer]
Signed-off-by: Mariusz Białończyk <manio@skyboo.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:55 -02:00
Dan Carpenter 0e835087df [media] lirc_dev: add some __user annotations
Sparse complains because there are no __user annotations.

drivers/media/rc/lirc_dev.c:156:27: warning:
	incorrect type in initializer (incompatible argument 2 (different address spaces))
drivers/media/rc/lirc_dev.c:156:27:    expected int ( *read )( ... )
drivers/media/rc/lirc_dev.c:156:27:    got int ( extern [toplevel] *<noident> )( ... )

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:55 -02:00
David Härdeman 829ba9fe34 [media] rc-core: fix some leftovers from the renaming patches
Fix some minor comments etc which are leftover from the old naming scheme.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:54 -02:00
David Härdeman 3938e0cfeb [media] bttv: merge ir decoding timers
Similarly to saa7134, bttv_ir has two timers, only one of which is used
at a time and which serve the same purpose. Merge them.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:54 -02:00
David Härdeman edb4c25ca3 [media] bttv: rename struct card_ir to bttv_ir
bttv_ir is more consistent with all other structs used in the same driver.
Also, clean up the struct to remove commented out members and the work_struct
which is unused.

[mchehab@redhat.com: fix a warning at bttv_rc5_timer_end]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:54 -02:00
David Härdeman 7c8352d18d [media] saa7134: merge saa7134_card_ir->timer and saa7134_card_ir->timer_end
Both timers are used for a similar purpose. Merging them allows for some
minor simplifications.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:54 -02:00
David Härdeman 651c7a5f7f [media] saa7134: some minor cleanups
Mostly using appropriate data types and constants (e.g. int -> bool).

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:53 -02:00
David Härdeman b0ddb0f364 [media] saa7134: use full keycode for BeholdTV
Using the full keycode for BeholdTV hardware makes another module
parameter unnecessary.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:53 -02:00
David Härdeman a29df8579a [media] saa7134: remove unused module parameter
ir_rc5_remote_gap is a leftover from ir-common, remove it.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:53 -02:00
Hans de Goede 622d9f5d30 [media] pwc: failure to submit an urb is a fatal error
Failure to submit an urb is a fatal error, make isoc_init return an
error when this happens rather then only log it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:53 -02:00
Hans de Goede c7d18867c8 [media] pwc: Also set alt setting to alt0 when no error occured
isoc_cleanup contains a check to not set the altsetting to alt0 when
the device was unplugged, but the check currently is buggy, and causes
the alt setting to only be set to 0 if an error occured while streaming.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:52 -02:00
Hans de Goede 3751e288bc [media] pwc: do not start isoc stream on /dev/video open
pwc was starting streaming on /dev/video# open rather then on STREAM_ON. Now
that the v4l1 compat code is removed from the pwc driver there is no reason
left to do this. So this patch changes the pwc driver to delay starting
the isoc stream (and thus using valuable usb bandwidth) until the application
does a STREAM_ON

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:52 -02:00
Mauro Carvalho Chehab a931910d3b [media] stb6100: warning cleanup
drivers/media/dvb/frontends/stb6100.c:120: warning: ‘stb6100_normalise_regs’ defined but not used

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:52 -02:00
Mauro Carvalho Chehab 03c9a806e3 [media] rc: Rename IR raw interface to ir-raw.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:52 -02:00
Mauro Carvalho Chehab d100e659b6 [media] rc: use rc_map_ prefix for all rc map tables
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:52 -02:00
Mauro Carvalho Chehab 2f4f58d689 [media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.

Use a common standard for everything.

Patch generated by this script:

for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:51 -02:00
Mauro Carvalho Chehab b088ba658b [media] rc: Properly name the rc_map struct
The struct that describes a rc mapping had an weird and long name.
We should properly name it, to make easier for developers to work
with it, and to avoid confusion.

Basically, generated by this script:

for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode_table,rc_map,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_tab,rc_map,g <$i >a && mv a $i; done

(and manually fixed where needed)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:51 -02:00
Mauro Carvalho Chehab 52b661449a [media] rc: Rename remote controller type to rc_type instead of ir_type
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,IR_TYPE,RC_TYPE,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_type,rc_type,g <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:50 -02:00
Mauro Carvalho Chehab 29e3ec19d5 [media] cx231xx: Properly name rc_map name
rc_map is confusing, as it may be understood as another thing. Properly
rename the field to indicate its usage.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:50 -02:00
Mauro Carvalho Chehab ca86674b8a [media] Rename all public generic RC functions from ir_ to rc_
Those functions are not InfraRed specific. So, rename them to properly
reflect it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:50 -02:00
Mauro Carvalho Chehab 6bda96447c [media] rc: rename the remaining things to rc_core
The Remote Controller subsystem is meant to be used not only by Infra Red
but also for similar types of Remote Controllers. The core is not specific
to Infra Red. As such, rename:
	- ir-core.h to rc-core.h
	- IR_CORE to RC_CORE
	- namespace inside rc-core.c/rc-core.h

To be consistent with the other changes.

No functional change on this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:50 -02:00
Mauro Carvalho Chehab a6e3b81f61 [media] rc: Remove ir-common.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:49 -02:00
Mauro Carvalho Chehab bce8d0fe4a [media] rc: remove ir-common module
Something weird happened with commit 740069e6e043403199dbe2b42256722fb814f6ae.
Instead of dong the right thing, it got somehow corrupted and reverted the
rc changes.

Thanks to David Härdeman for pointing me about the problem.

This patch should be merged with 740069e6e04 before sending upstream.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:49 -02:00
Manu Abraham 1697c8dfba [media] stb0899: fix diseqc messages getting lost
- Some badly written applications in conjuction with certain SEC devices
  do send too many messages causing the DiSEqC bus to get congested. As
  a result, the end devices do get confused and hence do not respond.
  The issue was found by Julian Scheel.

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:49 -02:00
Manu Abraham f14bfe94e4 [media] stb6100: Improve tuner performance
- Reduce the amount of white noise present, which causes the
  demodulator a significant time to acquire a frontend lock
  on a whole. Frontend shows a large significant improvement in
  performance.

Thanks to Peter Nayler for helping to identify the potential
hotspots and fixing them.

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:49 -02:00
Ben Hutchings 3037fd1430 [media] Mantis: Rename gpio_set_bits to mantis_gpio_set_bits
This function is declared extern and exported, and should not be given
a generic name which may conflict with gpiolib in future.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:48 -02:00
Bjørn Mork a22407faba [media] Mantis: use dvb_attach to avoid double dereferencing on module removal
Convert the driver to use the dvb_attach macro to avoid the hard dependency
on the frontend drivers.  The hard dependecy will result in loading a
number of unused frontends, and unwanted automatic dereferencing.

This fixes a bug where unloading the mantis driver will derefence any
attached frontend twice, which will cause an oops if the same frontend is
used by another driver.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:48 -02:00
Marko Ristola 9c81496a88 [media] Mantis: append tasklet maintenance for DVB stream delivery
After dvb-core has called mantis-fe->stop_feed(dvbdmxfeed)
the last time (count to zero), no data should ever be copied
with dvb_dmx_swfilter() by a tasklet: the target structure
might be in an unusable state. Caller of mantis_fe->stop_feed()
assumes that feeding is stopped after stop_feed() has been
called, ie. dvb_dmx_swfilter() isn't running, and won't be called.

There is a risk that dvb_dmx_swfilter() references freed resources
(memory or spinlocks or ???) causing instabilities. Thus
tasklet_disable(&mantis->tasklet) must be called inside of
mantis-fe->stop_feed(dvbdmxfeed) when necessary.

Signed-off-by: Marko Ristola <marko.ristola@kolumbus.fi>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:48 -02:00
Manu Abraham 116d588ea2 [media] Mantis, hopper: use MODULE_DEVICE_TABLE
use the macro to make modules auto-loadable

Thanks to Ozan Çağlayan <ozan@pardus.org.tr> for pointing it out

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:48 -02:00
Wolfram Sang e6f199f3e7 [media] i2c: Remove obsolete cleanup for clientdata
A few new i2c-drivers came into the kernel which clear the clientdata-pointer
on exit. This is obsolete meanwhile, so fix it and hope the word will spread.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:47 -02:00
Wolfram Sang c0ff9f4c24 [media] media: video: do not clear 'driver' from an i2c_client
The i2c-core does this already.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:47 -02:00
Jesper Juhl 9a9dcb4a19 [media] cx231xx-417: Remove unnecessary casts of void ptr returning alloc function return values
Hi,

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/media/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:47 -02:00
Randy Dunlap 9c0147b694 [media] timblogiw: fix kconfig & build error
timblogiw uses dma() interfaces and it selects TIMB_DMA for that
support.  However, drivers/dma/ is not built unless
CONFIG_DMA_ENGINE is enabled, so select/enable that symbol also.

drivers/built-in.o: In function `timblogiw_close':
timblogiw.c:(.text+0x4419fe): undefined reference to `dma_release_channel'
drivers/built-in.o: In function `buffer_release':
timblogiw.c:(.text+0x441a8d): undefined reference to `dma_sync_wait'
drivers/built-in.o: In function `timblogiw_open':
timblogiw.c:(.text+0x44212b): undefined reference to `__dma_request_channel'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:47 -02:00
Richard Röjfors 9eae42e5a2 [media] media: Add timberdale video-in driver
This patch adds the timberdale video-in driver.

The video IP of timberdale delivers the video data via DMA.
The driver uses the DMA api to handle DMA transfers, and make use
of the V4L2 video buffers to handle buffers against user space.

If available the driver uses an encoder to get/set the video standard

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:46 -02:00
Matthias Schwarzott 13d28e4917 [media] IX2505V: i2c transfer error code ignored
It seems that ix2505v driver ignores a i2c error in ix2505v_read_status_reg.
This looks like a typing error using (ret = 1) instead of correct (ret == 1).

Acked-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:46 -02:00
Mauro Carvalho Chehab 8ea43d0a2f [media] rc: Remove ir-common module
Now, just one old bttv board uses the old RC5 raw decoding routines.
Its conversion to rc-core requires the generation of IRQ data for both
positive and negative transitions at the IRQ line. I'm not sure if
bttv driver supports it or if the transitions will be reliable enough.
So, due to the lack of hardware for testing, the better for now is to
just move the legacy routines to bttv driver, and wait for someone with
a Nebula Digi could help to port it to use also rc-core raw decoders.

Acked-by: Hermann Pitton <hermann-pitton@arcor.de>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:45 -02:00
Mauro Carvalho Chehab 6c7e653ff6 [media] saa7134: Remove legacy IR decoding logic inside the module
The only IR left still using the old raw decoders on saa7134 is ENCORE
FM 5.3. As it is now using the standard rc-core raw decoders, lots
of old code can be removed from saa7134.

Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:45 -02:00
Mauro Carvalho Chehab 70de39183a [media] saa7134: use rc-core raw decoders for Encore FM 5.3
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:44 -02:00
Joe Perches 101b25b55e [media] drivers/media: Use vzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:44 -02:00
Jean-François Moine 42e142f6b7 [media] gspca - ov519: New sensor ov7660 with bridge ov530 (ov519)
[mchehab@redhat.com: Some CodingStyle fixes]
Tested-by: Anca Emanuel <anca.emanuel@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:44 -02:00
Jean-François Moine 7491f785dd [media] gspca - ov519: Re-initialize the webcam at resume time
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:43 -02:00
Jean-François Moine b4e96ea30a [media] gspca - ov519: Initialize the ov519 snapshot register
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:43 -02:00
Jean-François Moine 5927abcb21 [media] gspca - ov519: Change the ov519 start and stop sequences
- start and stop streaming are done via the FRAR
- streaming suspend (for control change) is done by video reset

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:43 -02:00
Jean-François Moine a23acec4bc [media] gspca - ov519: Simplify the LED control functions
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:43 -02:00
Jean-François Moine e2817029b3 [media] gspca - ov519: Check the disabled controls at start time only
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:43 -02:00
Jean-François Moine 858ea5e941 [media] gspca - ov519: Clearer debug and error messages
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:42 -02:00
Jean-François Moine f8f20188e8 [media] gspca - ov519: Propagate errors to higher level
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:42 -02:00
Jean-François Moine 83db76886c [media] gspca - ov519: Define the disabled controls in a table
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:42 -02:00
Jean-François Moine 2186780325 [media] gspca - ov519: Set their numbers in the ov519 and ov7670 register names
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:42 -02:00
Jean-François Moine 87bae740fd [media] gspca - ov519: Cleanup source
- move hexadecimal value to lowercase
- remove/add empty lines and spaces
- comment unused macros
- change some comments

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:41 -02:00
Nicolas Kaiser 9be1d6cde9 [media] gspca - cpia1: Fix error check
It looks to me like it was intended to check the return value
at this point.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:41 -02:00
Jean-François Moine 7bbe6b8d1f [media] gspca - ov519: Define the sensor types in an enum
This patch also checks if the sensor is well detected at connection time.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:41 -02:00
Jean-François Moine d6fa66384b [media] gspca - ov519: Reduce the size of some variables
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:41 -02:00
Jean-François Moine 9d1593a84c [media] gspca - ov519: Change types '__xx' to 'xx'
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:40 -02:00
Jean-François Moine d65174c06f [media] gspca - ov519: Don't do USB exchanges after disconnection
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:40 -02:00
Jean-François Moine 14653e64e9 [media] gspca - ov519: Handle the snapshot on capture stop when CONFIG_INPUT=m
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:40 -02:00
Hans de Goede c0b33bdc5b [media] gspca-stv06xx: support bandwidth changing
stv06xx devices have only one altsetting, but the actual used
bandwidth can be programmed through a register. We were already
setting this register lower then the max packetsize of the altsetting
indicates. This patch makes the gspca-stv06xx update the usb descriptor
for the alt setting to reflect the actual packetsize in use, so that
the usb subsystem uses the correct information for scheduling usb transfers.

This patch also tries to fallback to lower speeds in case a ENOSPC error
is received when submitting urbs, but currently this is only supported
with stv06xx cams with the pb0100 sensor, as this is the only one for
which we know how to change the framerate.

This patch is based on an initial incomplete patch by
Lee Jones <lee.jones@canonical.com>

Signed-off-by: Lee Jones <lee.jones@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:40 -02:00
Steven Toth bc25068495 [media] saa7164: Checkpatch compliance cleanup
Checkpatch compliance cleanup across files in the saa7164 driver.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:39 -02:00
Dan Carpenter 0e72cc8b8d [media] saa7164: make buffer smaller
This isn't a runtime bug, it's just to make static checkers happy.

In vidioc_querycap() we copy a saa7164_dev ->name driver array into a
v4l2_capability -> driver array.  The ->driver array is only 16 chars
long so ->name also can't be more than 16 characters.

The ->name gets set in v4l2_capability() and it always is less than 16
characters so we can easily make the buffer smaller.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:39 -02:00
Axel Lin 76e4a9a716 [media] tea6415c: return -EIO if i2c_check_functionality fails
If the adapter does not support I2C_FUNC_SMBUS_WRITE_BYTE,
return -EIO instead of 0.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:39 -02:00
Joe Perches 1ce6a14335 [media] drivers/media/video: Update WARN uses
Add missing newlines.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:39 -02:00
VDR User 9e21ccaa69 [media] dvb-usb-gp8psk: get firmware and fpga versions
This patch adds retrieval of firmware and FPGA versions of Genpix devices.
That information is useful for users who experience performance differences
with the various firmware versions, and may want to use a specific firmware
that best suits their needs.

Example dmesg output:
gp8psk: FW Version = 2.09.4 (0x20904)  Build 2009/04/02
gp8psk: FPGA Version = 1

Signed-off-by: Derek Kelly <user.vdr@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:38 -02:00
Mauro Carvalho Chehab 141bb0dc2d [media] cx231xx: Fix i2c support at cx231xx-input
There was a bug at cx231xx-input, where it were registering the remote
controls twice, one via ir-kbd-i2c and another directly.
Also, the patch that added rc_register_device() broke compilation for it.

This patch fixes cx231xx-input by fixing the depends on, to point to the
new symbol, and initializing the scanmask via platform_data.

While here, also fix Kconfig symbol change for IR core dependencies.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:38 -02:00
Mauro Carvalho Chehab 2eb2583277 [media] ir-kbd-i2c: add rc_dev as a parameter to the driver
There are several fields on rc_dev that drivers can benefit. Allow drivers
to pass it as a parameter to the driver.

For now, the rc_dev parameter is optional. If drivers don't pass it, create
them internally. However, the best is to create rc_dev inside the drivers,
in order to fill other fields, like open(), close(), driver_name, etc.
So, a latter patch making it mandatory and changing the caller drivers is
welcome.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:38 -02:00
David Härdeman 5b2e303f6d [media] rc-core: convert winbond-cir
Move winbond-cir from drivers/input/misc/ into drivers/media/rc/
and convert it to use rc-core.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:38 -02:00
David Härdeman d8b4b5822f [media] ir-core: make struct rc_dev the primary interface
This patch merges the ir_input_dev and ir_dev_props structs into a single
struct called rc_dev. The drivers and various functions in rc-core used
by the drivers are also changed to use rc_dev as the primary interface
when dealing with rc-core.

This means that the input_dev is abstracted away from the drivers which
is necessary if we ever want to support multiple input devs per rc device.

The new API is similar to what the input subsystem uses, i.e:
rc_device_alloc()
rc_device_free()
rc_device_register()
rc_device_unregister()

[mchehab@redhat.com: Fix compilation on mceusb and cx231xx, due to merge conflicts]
Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:37 -02:00
David Härdeman 4c7b355df6 [media] rc-core: Code cleanup after merging rc-sysfs and rc-map into rc-main
[mchehab@redhat.com: this patch were originally bundled with some renaming
stuff and with the file merges, as seen at:
https://patchwork.kernel.org/patch/291092/.

Instead of using the original approach, I wrote the rename patches and the
code merge as separate changes, then applied the difference on this patch.
This way, it is easier to see the real changes at the code, and will be easier
to merge upstream, especially if some conflict rises on the renaming patches]

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:37 -02:00
Mauro Carvalho Chehab 631493ecac [media] rc-core: merge rc-map.c into rc-main.c
With this change, all rc-core functions are into just one file, except
for the rc-raw specific functions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:37 -02:00
Mauro Carvalho Chehab bc2a6c5719 [media] rc-core: Merge rc-sysfs.c into rc-main.c
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:37 -02:00
Mauro Carvalho Chehab f62de675f7 [media] Rename rc-core files from ir- to rc-
As protocol decoders are specific to InfraRed, keep their names as-is.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:36 -02:00
Mauro Carvalho Chehab 32cf86f6d1 [media] rename drivers/media/IR to drives/media/rc
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:36 -02:00
David Härdeman 3ffea4988b [media] ir-core: more cleanups of ir-functions.c
cx88 only depends on VIDEO_IR because it needs ir_extract_bits().
Move that function to ir-core.h and make it inline.

Lots of drivers had dependencies on VIDEO_IR when they really
wanted IR_CORE.

The only remaining drivers to depend on VIDEO_IR are bt8xx and
saa7134 (ir_rc5_timer_end is the only function exported by
ir-functions).

Rename VIDEO_IR -> IR_LEGACY to give a hint to anyone writing or
converting drivers to IR_CORE that they do not want a dependency
on IR_LEGACY.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:36 -02:00
David Härdeman 62c6503125 [media] ir-core: remove remaining users of the ir-functions keyhandlers
This patch removes the remaining usages of the ir_input_nokey() and
ir_input_keydown() functions provided by drivers/media/IR/ir-functions.c
by using the corresponding functionality in ir-core instead.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:35 -02:00
David Härdeman 2997137be8 [media] ir-core: convert drivers/media/video/cx88 to ir-core
This patch converts the cx88 driver (for sampling hw) to use the
decoders provided by ir-core instead of the separate ones provided
by ir-functions (and gets rid of those).

The value for MO_DDS_IO had a comment saying it corresponded to
a 4kHz samplerate. That comment was unfortunately misleading. The
actual samplerate was something like 3250Hz.

The current value has been derived by analyzing the elapsed time
between interrupts for different values (knowing that each interrupt
corresponds to 32 samples).

Thanks to Mariusz Bialonczyk <manio@skyboo.net> for testing my patches
(about one a day for two weeks!) on actual hardware.

Signed-off-by: David Härdeman <david@hardeman.nu>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:35 -02:00
Jarkko Nikula 00df055ae3 [media] radio-si4713: Add regulator framework support
Convert the driver to use regulator framework instead of set_power callback.
This with gpio_reset platform data provide cleaner way to manage chip VIO,
VDD and reset signal inside the driver.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:35 -02:00
Devin Heitmueller bf797165f0 [media] au0828: enable VBI timeout when calling read() without streamon()
Because some clients (e.g. tvtime) will just open the filehandle and call
read() instead of explicitly calling streamon first, we need to make sure the
VBI timeout routine gets enabled in this case.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:35 -02:00
Devin Heitmueller 78ca500559 [media] au0828: fixes for timeout on no video
The first pass of fixes to cause the driver to continue streaming even when
there is no video arriving over the ITU656 bus were not adequate.  Continue
the work from the previous patch.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:34 -02:00
Devin Heitmueller 6e04b7b95a [media] au0828: continue video streaming even when no ITU-656 coming in
We need the au0828 to continue delivering frames even when the device is not
delivering video, or else applications such as tvtime will block indefinitely.

Unfortunately, the au8522 doesn't have any sort of free-running mode or "blue
screen on no video" like some other decoders.

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:34 -02:00
Devin Heitmueller 301c9f26d7 [media] au8522: Handle differences in comb filter config for s-video input
Tweak the comb filter config when in s-video mode to match the Hauppauge
Windows driver values (based on register dumps).

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:34 -02:00
Devin Heitmueller d2c194ce47 [media] au8522: fix clamp control for different video modes
Straighten out the clamp control configurations for the various video modes,
based off of register diffs done against the Hauppauge Windows driver.

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:34 -02:00
Devin Heitmueller 2428a2ed6a [media] au8522: cleanup code which disables audio decoder
Cleanup the routine which disables the audio decoder.  In particular, the i2s
output was being shut off but the audio processor itself was not, resulting
in more power being consumed than needed.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:33 -02:00
Devin Heitmueller bde3bb9a67 [media] au0828: Fix field alignment for video frames delivered by driver
Fix the alignment of fields being delivered by the driver, which was
resulting in jerky video when there was horizontal motion (since the bottom
field of the frame was being sent with the top field of the previous frame)

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:33 -02:00
Devin Heitmueller 83f859c5a6 [media] au0828: set max packets per URB to match Windows driver
We had the max packets per URB set to an incredibly low "10" as opposed to
the Windows driver which has it as 128.  Set the value to match the
Windows driver, which will reduce interrupts considerably.

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:33 -02:00
Devin Heitmueller 88464106f9 [media] au8522: Properly set default brightness
The chip's default value for the brightness didn't match what we were sending
back in the queryctrl ioctl(), so if the application actually set the
brightness to the "default", it would actually end up being way too bright.

This work was sponsored by GetWellNetwork Inc.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:33 -02:00
Jean-François Moine 1d00d6c1ff [media] gspca: Convert some uppercase hexadecimal values to lowercase
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:33 -02:00
Jean-François Moine a79cc7b918 [media] gspca - sonixj: Simplify and clarify the hv7131r probe function
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:32 -02:00
Jean-François Moine d581bcd78b [media] gspca - zc3xx: Bad clocksetting for mt9v111_3 with 640x480 resolution
The bad value prevented the autogain to work correctly
and some images were truncated.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:32 -02:00
Jean-François Moine a23c1947f4 [media] gspca - main: Fix a small code error
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:32 -02:00
Jean-François Moine 0b8851b6c3 [media] gspca - main: Version change
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:31 -02:00
Hans de Goede 614d06917d [media] gspca_ov519: generate release button event on stream stop if needed
Generate a release button event when the button is still pressed when the
stream stops.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:31 -02:00
Hans de Goede e0657be561 [media] gspca_xirlink_cit: Add support camera button
gspca_xirlink_cit: Add support camera button

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:31 -02:00
Hans de Goede 2c4e776aa3 [media] gspca_xirlink_cit: Frames have a 4 byte footer
At least on the ibm netcam pro frames have a 4 byte footer, take this
into account when calculating sizeimage.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:31 -02:00
Hans de Goede bc46bae637 [media] gspca_xirlink_cit: various usb bandwidth allocation improvements / fixes
The following usb bandwidth allocation changes were made to the ibm netcam
pro code:
- Don't restart negotiation at max packet size on stop0, as that gets called
  by gspca_main during negotiation. Move this to sd_isoc_init.
- Don't ask for full bandwidth when running at 160x120, that does not need
  full bandwidth
- Make minimum acceptable bandwidth depend upon resolution

[mchehab@redhat.com: Fix CodingStyle problems at switch statements]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:30 -02:00
Hans de Goede 2661da47da [media] gspca: only set gspca->int_urb if submitting it succeeds
Currently alloc_and_submit_int_urb() is setting gspca->int_urb
as soon as the allocation has succeeded, but if the subsequent
submit fails, the urb gets destroyed. And then later will
get destroyed again in gspca_input_destroy_urb() because
gspca->int_urb is set, leading to a double free.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:30 -02:00
Hans de Goede 314b3e0881 [media] gspca: submit interrupt urbs *after* isoc urbs
Currently gspca supported usb-1.1 webcams for which we support the input
button through an interrupt endpoint won't stream (not enough bandwidth
error) when used through an USB-2.0 hub.

After much debugging I've found out that the cause for this is that the
ehci-sched.c schedeling code does not like it when there are already urb's
scheduled when (large) isoc urbs are queued. By moving the submission
of the interrupt urbs to after submitting the isoc urbs the camera
starts working again through usb-2.0 hubs.

Note that this does not fix isoc. streaming through a usb-hub while another
1.1 usb device (like the microphone of the same cam) is also active
at the same time :(

I've spend a long time analyzing the linux kernel ehci scheduler code,
resulting in this (long) mail:
http://www.spinics.net/lists/linux-usb/msg37982.html

The conclusion of the following mail thread is that yes there are several
issues when using usb-1.1 devices through a usb-2.0 hub, but these are not
easily fixable in the current code. Fixing this in ehci-sched.c requires
an almost full rewrite, which is not bound to happen anytime soon.

So with this patch gspca driven usb-1.1 webcams will atleast work when
connected through an usb-2.0 hub when the microphone is not used.

As an added bonus this patch avoids extra destroy/create input urb cycles
when we end up falling back to a lower speed alt setting because of bandwidth
limitations.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:30 -02:00
Malcolm Priestley 25ad9847ca [media] lmedm04: change USB Timeouts to avoid troubles
DM04/QQBOX USB Timing change.

Improved timing to avoid USB corruptions on some systems.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:30 -02:00
Malcolm Priestley f23e6616ac [media] lmed04: Improve frontend handling
Improved frontend handling.

Frontend now remains open at all times, with signal lock, snr & signal level
polled from Interupt.

Updated driver for DM04/QQBOX USB DVB-S BOXES to version 1.70.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:29 -02:00
Daniel Drake ea7c681e89 [media] cafe_ccic: fix colorspace corruption on resume
If you suspend and resume during video capture, the video colours
are corrupted on resume. This is because the sensor is being unconditionally
powered off during the resume path.

Only power down during resume if the camera is not in use, and correctly
reconfigure the sensor during resume.
Fixes http://dev.laptop.org/ticket/10190

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:29 -02:00
Joe Perches c429e7b62a [media] drivers/media: Removed unnecessary KERN_<level>s from dprintk uses
Converted if (debug >= 2) printk(KERN_DEBUG... to if debug >= 2) dprintk(...)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:29 -02:00
Mauro Carvalho Chehab 1bc25f7d6c [media] cx231xx: Add IR support for Pixelview Hybrid SBTVD
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:28 -02:00
Mauro Carvalho Chehab 9ab66912e0 [media] cx231xx: Add a driver for I2C-based IR
Although cx231xx has a very good IR support, already supported by
mceusb driver, some designs decided to add a separate I2C
microcontroller chip in order to handle IR.

Due to that, add a glue to ir-kbd-i2c is needed, in order to support
those devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:28 -02:00
Mauro Carvalho Chehab f0551efc77 [media] Add DVB support for SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:28 -02:00
Mauro Carvalho Chehab 68541cdaad [media] Add support for Kworld SBTVD board
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:28 -02:00
Mauro Carvalho Chehab 7572f9c557 [media] mb86a20s: add support for serial streams
By comparing the traffic between Pixelview (cx23102-based and Kworld
(saa7134-based), the only difference is at register 0xd5. After some
tests, It seems that it is used to change mode between serial and parallel.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:28 -02:00
Mauro Carvalho Chehab 55fa288dec [media] cx231xx: use callback to set agc on PixelView
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:27 -02:00
Mauro Carvalho Chehab ede676c72d [media] add digital support for PV SBTVD hybrid
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:27 -02:00
Mauro Carvalho Chehab 9417bc6dd9 [media] Add analog support for Pixelvied Hybrid SBTVD
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:27 -02:00
Mauro Carvalho Chehab b9ede79ada [media] add a driver for mb86a20s
This adds the trivial bits to mb86a20s. As the driver won't touch
at the channel/layer parameters, this may not be enough for
receiving all channels, especially ISDB-Tsb, but the driver worked
properly for receiving video channels on my tests.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:27 -02:00
Mauro Carvalho Chehab ca3dfd6a6f [media] em28xx: Add support for Leadership ISDB-T
This device uses an em2874B + Sharp 921 One Seg frontend.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:26 -02:00
Mauro Carvalho Chehab 3a509bb11a [media] Re-write the s921 frontend
On our tests with Leadership ISDBT, the s921 frontend were not work. As its
design contained some weird things, it ended to be easier to just re-write
it, getting another frontend as an example (cx24123).

As the old s921 driver weren't used, there's no regression. Some info from
the old frontend were used as a way to double check the behavior that were
noticed on the USB dumps retrieved from Leadership driver.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29 08:16:26 -02:00
Linus Torvalds bec41d5b84 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:
  [media] v4l: soc-camera: fix multiple simultaneous user case
2010-12-28 11:23:30 -08:00
Jiri Kosina bb9fb42029 Revert conflicting V4L changes
This is a partial revert of b595076a18
("tree-wide: fix comment/printk typos"), as it changes the code
that no longer exists in linux-next.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-12-28 14:16:15 +01:00
Guennadi Liakhovetski 24d8c0293b [media] v4l: soc-camera: fix multiple simultaneous user case
A recent patch has introduced a regression, whereby a second open of an
soc-camera video device breaks the running capture. This patch fixes this bug
by guaranteeing, that video buffers get initialised only during the first open
of the device node.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-25 22:54:49 -02:00
Tejun Heo 8c71778cbf media/video: don't use flush_scheduled_work()
This patch converts the remaining users of flush_scheduled_work() in
media/video.

* bttv-input.c and cx23885-input.c don't use workqueue at all.  No
  need to flush.

* Make omap24xxcam.c and saa7134-empress.c flush the used work
  directly.

* In fd_defio.c, replace cancel_delayed_work() +
  flush_scheduled_work() with cancel_delayed_work_sync().  While at
  it, replace the deprecated cancel_rearming_delayed_work() with
  cancel_delayed_work_sync().

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
2010-12-24 16:14:20 +01:00
Tejun Heo 707bcf326b media/video: explicitly flush request_module work
Video drivers request submodules using a work during probe and calls
flush_scheduled_work() on exit to make sure the work is complete
before being unloaded.  This patch makes these drivers flush the work
directly instead of using flush_scheduled_work().

While at it, relocate request_submodules() call in saa7134_initdev()
right right before successful return as in other drivers to avoid
failing after the work is scheduled and returning failure without the
work still active.

This is in preparation for the deprecation of flush_scheduled_work().

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
2010-12-24 16:14:20 +01:00
Tejun Heo 0d9c76aedb dvb: don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed.

* Flush the used works directly.

* Replace the deprecated cancel_rearming_delayed_work() +
  flush_scheduled_work() -> cancel_delayed_work_sync().

* Make sure mantis->uart_work isn't running on exit.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
2010-12-24 16:00:17 +01:00
Linus Torvalds e82bb314ea 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: (21 commits)
  [media] mceusb: set a default rx timeout
  [media] mceusb: fix inverted mask inversion logic
  [media] mceusb: add another Fintek device ID
  [media] lirc_dev: fixes in lirc_dev_fop_read()
  [media] lirc_dev: stray unlock in lirc_dev_fop_poll()
  [media] rc: fix sysfs entry for mceusb and streamzap
  [media] streamzap: merge timeout space with trailing space
  [media] mceusb: fix keybouce issue after parser simplification
  [media] IR: add tv power scancode to rc6 mce keymap
  [media] mceusb: buffer parsing fixups for 1st-gen device
  [media] mceusb: fix up reporting of trailing space
  [media] nuvoton-cir: improve buffer parsing responsiveness
  [media] mceusb: add support for Conexant Hybrid TV RDU253S
  [media] s5p-fimc: Fix output DMA handling in S5PV310 IP revisions
  [media] s5p-fimc: Use correct fourcc code for 32-bit RGB format
  [media] s5p-fimc: Convert m2m driver to unlocked_ioctl
  [media] s5p-fimc: Explicitly add required header file
  [media] s5p-fimc: Fix vidioc_g_crop/cropcap on camera sensor
  [media] s5p-fimc: BKL lock removal - compilation fix
  [media] soc-camera: fix static build of the sh_mobile_csi2.c driver
  ...
2010-12-23 15:59:23 -08:00
Jon Mason 1d3c16a818 PCI: make pci_restore_state return void
pci_restore_state only ever returns 0, thus there is no benefit in
having it return any value.  Also, a large majority of the callers do
not check the return code of pci_restore_state.  Make the
pci_restore_state a void return and avoid the overhead.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-12-23 12:53:09 -08:00
Greg Kroah-Hartman 2af10844eb USB: Merge 2.6.37-rc5 into usb-next
This is to resolve the conflict in the file,
drivers/usb/gadget/composite.c that was due to a revert in Linus's tree
needed for the 2.6.37 release.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-22 12:25:34 -08:00
Jiri Kosina 4b7bd36470 Merge branch 'master' into for-next
Conflicts:
	MAINTAINERS
	arch/arm/mach-omap2/pm24xx.c
	drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
2010-12-22 18:57:02 +01:00
Linus Torvalds 8cad7f06e3 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:
  [media] gspca - sonixj: Better handling of the bridge registers 0x01 and 0x17
  [media] gspca - sonixj: Add the bit definitions of the bridge reg 0x01 and 0x17
  [media] gspca - sonixj: Set the flag for some devices
  [media] gspca - sonixj: Add a flag in the driver_info table
  [media] gspca - sonixj: Fix a bad probe exchange
  [media] gspca - sonixj: Move bridge init to sd start
  [media] bttv: remove unneeded locking comments
  [media] bttv: fix mutex use before init (BZ#24602)
  [media] Don't export format_by_forcc on two different drivers
2010-12-20 10:35:04 -08:00