bttv: Convert to generic TEA575x interface
Subsystems (2)
PATCH 1/1 bttv: Convert to generic TEA575x interface
Remove tea575x-specific code from bttv and use the common driver instead.
Only set_frequency is implemented (signal/stereo detection or seek would require more changes to bttv).
It works fine on Video Highway Xtreme (it actually makes the radio usable as it currently cannot be tuned properly).
Miro/Pinnacle is untested but seems to be simple and should work.
However, I don't understand the Terratec Active Radio Upgrade code. The HW seems to need IOR, IOW and CSEL signals that were taken from ISA bus on older cards (IOR and IOW directly and CSEL from some address decoder) and are emulated here using GPIOs. But the code manipulating these signals in bttv seems to be broken - it never asserts the IOR signal. If anyone has this HW, please test if I got that right.
--- drivers/media/pci/bt8xx/Kconfig | 3 + drivers/media/pci/bt8xx/bttv-cards.c | 317 ++++++++++++--------------------- drivers/media/pci/bt8xx/bttv-driver.c | 6 +- drivers/media/pci/bt8xx/bttvp.h | 14 +- 4 files changed, 125 insertions(+), 215 deletions(-)
drivers/media/pci/bt8xx/Kconfig +3 -0
@@ -4,12 +4,15 @@ config VIDEO_BT848 select I2C_ALGOBIT select VIDEOBUF_DMA_SG depends on RC_CORE + depends on MEDIA_RADIO_SUPPORT select VIDEO_TUNER select VIDEO_TVEEPROM select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TVAUDIO if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TDA7432 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_SAA6588 if MEDIA_SUBDRV_AUTOSELECT + select RADIO_ADAPTERS + select RADIO_TEA575X ---help--- Support for BT848 based frame grabber/overlay boards. This includes the Miro, Hauppauge and STB boards. Please read the material in
drivers/media/pci/bt8xx/bttv-cards.c +110 -207
363 lines not on this page · raw message
drivers/media/pci/bt8xx/bttv-driver.c +4 -2
@@ -1874,8 +1874,10 @@ static void bttv_set_frequency(struct bttv *btv, const struct v4l2_frequency *f)if (new_freq.type ==V4L2_TUNER_RADIO ) {radio_enable (btv); btv->radio_freq = new_freq.frequency; -if (btv->has_matchbox) -tea5757_set_freq (btv, btv->radio_freq); +if (btv->has_tea575x) { + btv->tea.freq = btv->radio_freq; +snd_tea575x_set_freq (&btv->tea); + } }else { btv->tv_freq = new_freq.frequency; }
drivers/media/pci/bt8xx/bttvp.h +8 -6
@@ -42,6 +42,7 @@#include <media/tveeprom.h> #include <media/rc-core.h> #include <media/ir-kbd-i2c.h> +#include <media/tea575x.h> #include "bt848.h" #include "bttv.h"
@@ -359,6 +360,10 @@ struct bttv_suspend_state {struct bttv_buffer *vbi; }; +struct bttv_tea575x_gpio { +u8 data, clk, wren, most; +}; +struct bttv {struct bttv_core c;
@@ -445,12 +450,9 @@ struct bttv {/* miro/pinnacle + Aimslab VHX philips matchbox (tea5757 radio tuner) support */ -int has_matchbox; -int mbox_we; -int mbox_data; -int mbox_clk; -int mbox_most; -int mbox_mask; +int has_tea575x; +struct bttv_tea575x_gpio tea_gpio; +struct snd_tea575x tea;/* ISA stuff (Terratec Active Radio Upgrade) */ int mbox_ior;
Signature · 1 line
Ondrej Zary