Commit Graph

60 Commits

Author SHA1 Message Date
Michael Krufky 0f2ce98342 V4L/DVB (7055): make tuner names consistent with standard cases
Change TDA9887 to tda9887.

TDA8290 shall reflect the actual hardware present in its name,
  ie:

tda8295+18271
tda8290+8275a

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:10 -02:00
Michael Krufky 006ed1ecf2 V4L/DVB (6989): tda18271: clean up chip id logic in tda829x_release
This test is easier to read.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:45 -02:00
Michael Krufky a4f263b587 V4L/DVB (6986): tda18271: share state between analog and digital tuner instances
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:43 -02:00
Michael Krufky f21e0d7f05 V4L/DVB (6962): tda18271: allow device-specific configuration of IF frequency and std bits
Allow drivers to pass device-specific configuration parameters during attach.

If these parameters are omitted, default values will be used.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:36 -02:00
Michael Krufky 255b5113b4 V4L/DVB (6960): tda18271: add support for NXP TDA18271HD/C2
Tested successfully with QAM256 digital cable.
Analog television is limping, needs more work.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:35 -02:00
Michael Krufky c90762799c V4L/DVB (6908): tda8290: add the option not to probe for tuners passed into tda829x_config
Prevent the tda8290 module from probing for tuners during tda829x_attach,
by passing:

.probe_tuner = TDA829X_DONT_PROBE,

...in struct tda829x_config

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:20 -02:00
Michael Krufky bc3e5c7fc2 V4L/DVB (6881): include struct analog_demod_ops directly inside struct dvb_frontend
Rather than using a pointer, include struct analog_demod_ops directly
inside struct dvb_frontend.  This will allow us to use dvb_attach in
the future, along with removing the need to check the ops structure
before having to check the pointer to the method being called.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:11 -02:00
Michael Krufky 9ad89f0104 V4L/DVB (6880): kill tuner-driver.h
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:04:10 -02:00
Michael Krufky e435f95ce6 V4L/DVB (6801): tda18271: pass i2c gate configuration into tda18271_attach()
If we pass TDA18271_GATE_DIGITAL into tda18271_attach(), it will always try to
use the digital demodulator's i2c gate.

If we pass TDA18271_GATE_ANALOG into tda18271_attach(), it will always try to
use the analog demodulator's i2c gate.

If we pass TDA18271_GATE_AUTO into tda18271_attach(), it will try to use the
analog demodulator's i2c gate when tuning in analog mode, and it will try to
use the digital demodulator's i2c gate when tuning in digital mode.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:32 -02:00
Michael Krufky a55db8cd7f V4L/DVB (6786): tuner: add struct analog_demod_info to struct analog_tuner_ops
Store the analog demodulator name in fe.ops.analog_demod_ops.info.name

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:28 -02:00
Michael Krufky ab1660503a V4L/DVB (6785): tda8290: remove dependency on struct tuner
- remove dependency of tda8290 module on struct tuner
- move tuner_foo printk macros from tuner-driver.h into tuner-core.c
- clean up #includes of tuner-i2c.h / tuner-driver.h

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:28 -02:00
Michael Krufky fa746aee33 V4L/DVB (6784): tda8290: prevent possible memory leak
Always call tda829x_release if tda829x_attach fails for a reason
other than failure to allocate memory for private structure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:27 -02:00
Michael Krufky c7919d520f V4L/DVB (6783): tuner: combine set_tv_freq and set_radio_freq into a single set_params method
We can tell whether we are tuning television or radio by testing for
struct analog_parameters *params->mode == V4L2_TUNER_RADIO

There is no longer any need for separate set_tv_freq and
set_radio_freq functions in the analog tuner demodulator modules.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:27 -02:00
Michael Krufky 6881647cce V4L/DVB (6782): tda8290: access frontend structure directly, where possible
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:03:27 -02:00
Michael Krufky 63c254805e V4L/DVB (6679): tda8290: force tuner init after attach
Force tuner init after attach, then sleep until use.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:59 -02:00
Michael Krufky bbe1e0ba52 V4L/DVB (6563): tda8290: optimize for loop in tda829x_probe function
Thanks to Trent Piepho for pointing this out.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:02 -02:00
Hans Verkuil 9dd659de9f V4L/DVB (6556): tuner: convert to bus-based I2C API
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:02:00 -02:00
Michael Krufky a818e1c8f7 V4L/DVB (6551): tda8290: rule out tda988x before detecting tda8290/tda8295
To ensure prevention of detecting a tda9885/6/7 as a tda8290 or tda8295, we
will rule out the tda988x before testing the tda8290 / tda8295 id registers.

We read 8 bytes from the chip.  If they are all equal, then it is not a
tda829x, or some other error has occurred.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Michael Krufky 1f3a4e3285 V4L/DVB (6550): tda8290: return -ENODEV on probe failures
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:58 -02:00
Michael Krufky f1f32849d6 V4L/DVB (6543): tda8290: enable probing of tda8295
Prevent the tda8295 from falsely being detected as a tda9887

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:56 -02:00
Hans Verkuil 1cba97d71d V4L/DVB (6471): tuner: i2c_client cannot be part of the tuner struct
The bus-based I2C subsystem allocates the i2c_client struct. So if in order to
be able to convert the tuner to the bus-based I2C API the embedded i2c_client
struct must be removed from the tuner struct and replaced with a pointer.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:32 -02:00
Michael Krufky 8c125f2ceb V4L/DVB (6468): tda8290: auto-detect tda8290 or tda8295
Consolidate tda8290_attach() and tda8295_attach() into a single function,
tda829x_attach(), which will detect chip combinations tda8290 or tda8295 with
tda8275, tda8275a or tda18271.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:30 -02:00
Michael Krufky a72dd305f9 V4L/DVB (6448): tda8290: fill i2c_gate_ctrl callback
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:14 -02:00
Michael Krufky 5c82f4497b V4L/DVB (6442): move std if setting from tda8290 to tda827x
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:10 -02:00
Michael Krufky 4e9154b8a7 V4L/DVB (6440): tuner: convert analog tuner demod sub-modules to dvb_frontend interface
Convert tda9887 and tda8290/5 to dvb_frontend interface

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:09 -02:00
Michael Krufky 16f291684c V4L/DVB (6438): tuner: move analog_demod_priv into struct dvb_frontend
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:08 -02:00
Michael Krufky 1dde7a4fa2 V4L/DVB (6436): tuner: move analog_tuner_ops into dvb_frontend_ops
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:07 -02:00
Michael Krufky 5bea1cd387 V4L/DVB (6435): tda8290: add support for NXP TDA18271 tuner and TDA8295 analog demod
Add basic support for NXP TDA8295 analog demod and TDA18271 tuner silicon.

TDA8295 + TDA8275a not yet tested.
TDA8290 + TDA18271 not yet supported.

Digital mode of TDA18271 not yet tested & needs more work.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:06 -02:00
Michael Krufky 746d9732db V4L/DVB (6433): Move all tda8275/8275a tuning code from tda8290 module into tda827x module
Add analog tuning support to tda827x dvb_frontend tuner module.

Convert tda8290 module back to native tuner interface.

The tda8290 analog demodulator will be handled the same way as tda9887.
The tuner.ko module (tuner-core) will pass commands to tda8290 via the
tuner_operations interface.  tda8290 will communicate with tda827x via
the dvb_frontend interface, while passing a pointer to a private data
structure.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:01:05 -02:00
Michael Krufky 3782e050f8 V4L/DVB (6140): tda8290: add get_rf_strength and improve status reading efficiency
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:49 -03:00
Michael Krufky 910bb3e3c5 V4L/DVB (6129): tda8290: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:35 -03:00
Michael Krufky db8a695658 V4L/DVB (6127): tuner: kill i2c_client interface to tuner sub-drivers
To ease the conversion of the analog tuner sub-drivers into dvb_frontend
style tuner modules, we must remove the i2c_client interface.

dvb_frontend style tuner modules use i2c_transfer directly on the i2c_adapter.

This change only alters the interface between tuner.ko and the tuner
sub-drivers. The v4l2 / i2c_client interface to tuner.ko remains intact.

This patch adds inline functions tuner_i2c_xfer_send, and tuner_i2c_xfer_recv,
to replace i2c_master_send and i2c_master_recv inside the tuner sub-drivers.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:34 -03:00
Michael Krufky ffbb807c13 V4L/DVB (6075): tuner: kernel headers go above subsystem headers
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:06:04 -03:00
Michael Krufky 8218b0b2ca V4L/DVB (5793): Tuner: remove hardware-specific info from public header
Move internal structures and debug macros to drivers/media/video/tuner-driver.h

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:23 -03:00
Michael Krufky 7fd8b26367 V4L/DVB (5755): Tda8290: store tuning operations in tuner_operations structure
Create static struct tuner_operations tda8290_tuner_ops
for tda8290 tuning function callback pointers

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:04 -03:00
Michael Krufky 7a91a80a0d V4L/DVB (5753): Tuner: create struct tuner_operations
Move tuner callback function pointers out of struct tuner, into
struct tuner_operations.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:02 -03:00
Michael Krufky 024cf53089 V4L/DVB (5742): Tuner: define release callback for mt20xx, tda9887 and tda8290
Define tuner release callbacks for mt20xx, tda9887 and tda8290, so that
these drivers can release their own private structures themselves.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:55 -03:00
Michael Krufky b208319993 V4L/DVB (5719): Tuner: Move device-specific private data out of tuner struct
Create private data struct for device specific private data.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:23:48 -03:00
Hartmut Hackmann e65ec752ce V4L/DVB (5484): Set tda8290 to analog mode after init
Set tda8290 to analog mode after init, otherwise the tuner driver will 
not accept i.e. the standby command.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:15 -03:00
Hartmut Hackmann cfeb88398f V4L/DVB (5323): Updated support for tuner callbacks
This change supplies a more generic version of the tuner callback.
The tuner struct now has a function pointer
  int (*tuner_callback) (void *dev, int command, int arg)
additionally to a int config parameter.
both can be set through the TUNER_SET_TYPE_ADDR client call.
Note that the meaning of the parameters depend on the tuner type.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:43:40 -03:00
Hartmut Hackmann 58ef4f924c V4L/DVB (5314): Added support for tda827x tuners with preamlifiers
This patch contains
- new tuning code for the tda827xa silicon tuner.
- controls the preamplifier of some boards with this tuner.
- support for the Philips Tiger S hybrid DVB-T reference design.
- reworked the saa7134-dvb modulue to get rid of most of the
  small board specific functions.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:43:32 -03:00
Hartmut Hackmann 44fd06fa90 V4L/DVB (3378): Restore power on defaults of tda9887 after tda8290 probe
The probing code for tda8290 changes the state of the tda9887 GP ports.
The patch assumes that if probing for tda8290 failed, this must be a 
tda9887 and restores its power on defaults.
This should solve the module load order issue with some pinnacle cards.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-27 00:09:11 -03:00
Hartmut Hackmann 0157a9cc72 V4L/DVB (3303): TDA8290 update
This patch
- works around a bug in the I2C bridge that makes the initialization
  of the TDA10046 fail on recent LifeView cards
- puts the AGC output to tristate in sleep mode. This is necessary for
  recent hybrid cards that switch the AGC via tristateing.

Signed-off-by: Hartmut Hackmann<hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-07 06:49:09 -02:00
Hans Verkuil 27487d4471 V4L/DVB (3384): Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
- Moved MSP_SET_MATRIX to v4l2-common.h
- Fix typos and integer overflows in tea5767.c
- Split old freq field into a tv_freq and a radio_freq. Prevents
  that a radio tuner is initialized with a tv frequency or vice versa.
- When switching to radio mode initialize the tuner with the last
  used radio frequency (this was already done for the TV mode).
  As a result of these changes the tuner module now remembers the
  last set radio and TV frequencies, which is what you would expect
  to happen.
- Move out of range frequencies to the closest valid frequency as per
  v4l2 API spec.
- Fix incorrect initial radio frequency (multiplier is 16000, not 16)
- Add boundary check for out of range frequencies.
- Use new flag to check if the order of the CB and freq. depends on
  the last set frequency. That is needed for some tuners or you can
  get static as a result. The flag is added for those tuners where I know
  that the datasheet indicates that this is necessary.
- For this new check use the last set div value, not the last frequency
  as radio frequencies are always much higher due to the 16000 multiplier.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-15 21:25:32 -02:00
Mauro Carvalho Chehab f3c5987a38 V4L (0987): Added Secam L' std on tda9887 and common macros moved to videodev2.h
- Added SECAM L' video standard
- Common std macros moved to videodev2.h

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2006-01-09 15:25:00 -02:00
Hartmut Hackmann 70146cfc84 [PATCH] v4l: (949) Added support for secam l'
Added support for SECAM L'

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:19 -08:00
Hartmut Hackmann 4ac95af9a0 [PATCH] V4L: 896: fixed tda8290 secam l
Fixed tda8290 SECAM-L

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:29 -08:00
Nickolay V. Shmyrev 01cb9633e1 [PATCH] v4l: 826: unify whitespaces
- Unify whitespaces.

Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:23 -08:00
Hartmut Hackmann 95736034df [PATCH] v4l: 823: corrected probing code for tda8290
- Corrected probing code for tda8290

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:23 -08:00
Mauro Carvalho Chehab 13dd38d081 [PATCH] v4l: 819: added autodetection code to tda8290 to avoid conflicts
- Added autodetection code to tda8290, to avoid conflicts with tda9887.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:22 -08:00