tuner-core has no business to do with digital TV. So, don't use
T_DIGITAL_TV on it, as it has no code to distinguish between
them, and nobody fills T_DIGITAL_TV right.
tda9887 used to use the T_STANDBY type internally, while tea5761
used it to put the device to sleep. Fix the code for it to work
properly with the tuner core changes and remove this flag from
tuner.h.
Remove the now obsolete set_freq. Also merge set_addr and set_type_addr.
In the past, it used to have two different setup calls, one to set just
the tuner type to any tuner found, and another to set the type only if
the address matches. Those two internal calls were grouped together,
but the functions weren't merged, making the code uglier.
[media] tuner-core: Don't use a static var for xc5000_cfg
A static var is evil, especially if a device has two boards with
xc5000. Instead, just like the other drivers, use stack to store
its config during setup.
[media] tuner-core: Some cleanups at check_mode/set_mode
Properly document those functions and do some cleanups around that.
There's just one behavior change on this patchset: it will now restore
TV frequency when changing from radio to TV mode.
[media] tuner-core: Reorganize the functions internally
This is a big patch with no functional changes. It just
rearranges everything inside the driver, and prepares to
break TV and Radio into two separate fops groups.
Currently, it has an heuristics logic to determine if the
call came from radio or video. However, the caller driver
knows for sure, so tuner-core shouldn't try to guess it.
[media] cx88: Don't allow opening a device while it is not ready
After registering the cdev, it would be possible do have an open on it.
In a matter of fact, some versions of udev do this. So, move registration
to the end and protect it with a mutex.
[media] cx231xx: Allow some boards to not use I2C port 3
Some devices don't need to use it. So allow to just disable this logic.
Having it enabled on some devices cause power management to complain,
generating error -71.
[media] cx231xx: Use parameters to describe some board variants
Instead of per-model tests all over the code, use some parameters
at the board entries to describe the model variants for:
- devices with 417 MPEG encoder;
- devices that use external AV;
- devices where vbi VANC endpoint doesn't work;
- devices with xc5000 that require different IF
initialization (and probably will cover also
xc3028).
- devices with xceive tuner that require a reset
during init.
[media] cx231xx: Use a generic check for TUNER_XC5000
The check for xc5000 assumes that the tuner will always
be using the same bus and will have the same address.
As those are configurable via dev->board, it should use,
instead, the values defined there.
Also, a similar type of test will be needed by other
tuners (for example, for TUNER_XC2028)
[media] cx231xx: Simplify interface checking logic at probe
Just a cleanup patch. Removes one indent level by moving
the return -ENODEV to happen before the device register
logic, if the interface is not the audio/video (int 1).
[media] saa7134: Properly report when a board doesn't have eeprom
When a device is not detected, the driver prints a warning message.
That's ok, except for the fact that, even on newer devices that have
eeprom but aren't yet supported, it prints a message saying that the
device doesn't have eeprom.
Fix it by having a separate message for devices with eeprom, but not
yet known by the driver.
[media] ngene: Fix compilation when cxd2099 is not enabled
drivers/media/dvb/ngene/ngene-i2c.o: In function `cxd2099_attach':
ngene-i2c.c:(.text+0x195): multiple definition of `cxd2099_attach'
drivers/media/dvb/ngene/ngene-core.o:ngene-core.c:(.text+0x100): first defined here
drivers/media/dvb/ngene/ngene-cards.o: In function `cxd2099_attach':
ngene-cards.c:(.text+0x116): multiple definition of `cxd2099_attach'
drivers/media/dvb/ngene/ngene-core.o:ngene-core.c:(.text+0x100): first defined here
drivers/media/dvb/ngene/ngene-dvb.o: In function `cxd2099_attach':
ngene-dvb.c:(.text+0x7ad): multiple definition of `cxd2099_attach'
drivers/media/dvb/ngene/ngene-core.o:ngene-core.c:(.text+0x100): first defined here
This driver is abusing the kernel<=>userspace API, due to the lack of a
proper solution for it. A discussion were done at:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg22196.html
But there's not a solution for it yet. So, move the driver to staging, while
we don't have a final solution.
Oliver Endriss [Mon, 10 Jan 2011 09:36:24 +0000 (06:36 -0300)]
[media] stv090x: 22kHz workaround must also be performed for the 2nd frontend
22kHz workaround must also be performed for the 2nd frontend.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Mon, 10 Jan 2011 09:36:22 +0000 (06:36 -0300)]
[media] stv090x: Fix losing lock in dual DVB-S2 mode
Do not clear registers ACLC/BCLC in DVB-S2 mode for Cut <= 20.
Otherwise, the demod could lose the lock periodically.
Verified with cineS2 and Duoflex.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Mon, 10 Jan 2011 09:36:21 +0000 (06:36 -0300)]
[media] stv090x: Fixed typos in register macros
Fixed typos in register macros.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Ralph Metzler [Mon, 10 Jan 2011 09:36:15 +0000 (06:36 -0300)]
[media] ngene: CXD2099AR Common Interface driver
Driver for the Common Interface Controller CXD2099AR.
Supports the CI of the cineS2 DVB-S2.
For now, data is passed through '/dev/dvb/adapterX/sec0':
- Encrypted data must be written to 'sec0'.
- Decrypted data can be read from 'sec0'.
- Setup the CAM using device 'ca0'.
Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Oliver Endriss [Mon, 10 Jan 2011 09:36:10 +0000 (06:36 -0300)]
[media] stv090x: Optional external lock routine
Card driver may supply its own lock routine now.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Andreas Regel [Mon, 10 Jan 2011 09:36:09 +0000 (06:36 -0300)]
[media] stv090x: make sleep/wakeup specific to the demod path
The STV0900 features two demodulator paths in one chip. Thus it is not
possible to use the generic power off function of the chip when sending
one of them to standby. The other path will stop working in that case.
The sleep function now switches off functionality specific to the demod
path. The global stuff is only switched off, when both paths are in
sleep mode. The wakeup function always turns on the global functionality
and then works specific to the path.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Something went wrong with the alignments for the if clause at line 2113.
Instead of using one tab for alignments, it used 3 tabs, plus one space
character.
WARNING: suspect code indent for conditional statements (8, 33)
+ if ((state->fe[0]->dtv_property_cache.delivery_system != SYS_ISDBT) ||
[...]
+ int i = 80000;
[media] Add v4l2 subdev driver for NOON010PC30L image sensor
Add I2C/V4L2 subdev driver for Siliconfile NOON010PC30 CIF camera.
The driver implements basic functionality, i.e. CIF/QCIF/QQCIF
resolution and color format selection, automatic/manual color
balance control. Other functions like cropping, rotation/flip,
exposure etc. can be easily implemented if needed.
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> 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>
Hyunwoong Kim [Wed, 29 Dec 2010 10:08:32 +0000 (07:08 -0300)]
[media] s5p-fimc: fix MSCTRL.FIFO_CTRL for performance enhancement
This patch fixes the value of FIFO_CTRL in MSCTRL.
Main-scaler has the value to specify a basis FIFO control of input DMA.
The description of FIFO_CTRL has been changed as below.
0 = FIFO Empty (Next burst transaction is possible when FIFO is empty)
1 = FIFO Full (Next burst transaction is possible except Full FIFO)
Value '1' is recommended to enhance the FIMC operation performance.
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>
Hyunwoong Kim [Wed, 29 Dec 2010 07:47:49 +0000 (04:47 -0300)]
[media] s5p-fimc: Support stop_streaming and job_abort
This patch adds callback functions, stop_streaming and job_abort,
to abort or finish any DMA in progress. stop_streaming is called
by videobuf2 framework and job_abort is called by m2m framework.
ST_M2M_PEND state is added to discard the next job.
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>
Hyunwoong Kim [Wed, 29 Dec 2010 01:12:43 +0000 (22:12 -0300)]
[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>
Hyunwoong Kim [Tue, 28 Dec 2010 14:27:13 +0000 (11:27 -0300)]
[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>
Hyunwoong Kim [Wed, 22 Dec 2010 03:56:05 +0000 (00:56 -0300)]
[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.
[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.
[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.
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.
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’
[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>