We currently do not have a method to enable instance staring if i2c adapter
is NULL, in the cases of dvb demods that write to the tuner directly using
calc_regs. Prevent possible wrong instance sharing for these cases until
a better solution can be found.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Some dvb demodulators access the tuner directly without using i2c.
In these cases, i2c_adap may be NULL. This patch fixes
hybrid_tuner_request_state to allow for NULL i2c_adapters.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Assign the number of instances remaining as the return value of
hybrid_tuner_release_state, in case there is any extra cleanup that
the tuner driver needs to do after an instance has been destroyed.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Create a macro implementing a standard method to share state amongst
multiple instances of a hybrid tuner object.
Also, prepare tuner_foo printk macros for the removal of PREFIX
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
- 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>
Issuing register reads as a separate address write and data read transactions
means that other I2C activity could occur in between and state could get out
of sync. Issue both the write and read in a single transaction so that the
i2c layer can prevent other users accessing the bus until we are complete.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Some tuners, like xc3028, need to print error messages. Instead of declaring
local macros, create a tuner global macro for printing tuner errors.
To preserve CodingStyle on all tuner_macros, a few CodingStyle violations were
fixed at the other macros:
- lines with more than 80 columns
- two statements at the same line
The patch also removes the CodingStyle violation of having emacs declarations
inside de source code (CodingStyle chapter 18).
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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>