Commit be6f655d authored by Hartmut Hackmann's avatar Hartmut Hackmann Committed by Mauro Carvalho Chehab

V4L/DVB (3395): Fixed Pinnacle 300i DVB-T support

- fixed tda9886 port 2 setting
- turned remote control receiver off via saa7134 GPIO to avoid i2c hangs
- modified tda9886 client calls to direct i2c access to allow proper return
  to analog mode
- allow mode change to V4L2_TUNER_DIGITAL_TV in tuner VIDIOC_S_FREQUENCY
  client call
Signed-off-by: default avatarHartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 6ba54abe
...@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = { ...@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = {
.radio_type = UNSET, .radio_type = UNSET,
.tuner_addr = ADDR_UNSET, .tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET,
.tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
.inputs = {{ .inputs = {{
.name = name_tv, .name = name_tv,
.vmux = 3, .vmux = 3,
...@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = { ...@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = {
.radio_type = UNSET, .radio_type = UNSET,
.tuner_addr = ADDR_UNSET, .tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET,
.tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
.mpeg = SAA7134_MPEG_DVB, .mpeg = SAA7134_MPEG_DVB,
.inputs = {{ .inputs = {{
.name = name_tv, .name = name_tv,
...@@ -3205,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev) ...@@ -3205,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev)
/* power-up tuner chip */ /* power-up tuner chip */
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
/* this turns the remote control chip off to work around a bug in it */
saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
break;
case SAA7134_BOARD_MONSTERTV_MOBILE: case SAA7134_BOARD_MONSTERTV_MOBILE:
/* power-up tuner chip */ /* power-up tuner chip */
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
......
...@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe) ...@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg));
mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg));
mt352_write(fe, irq_cfg, sizeof(irq_cfg)); mt352_write(fe, irq_cfg, sizeof(irq_cfg));
return 0; return 0;
} }
...@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, ...@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params, struct dvb_frontend_parameters* params,
u8* pllbuf) u8* pllbuf)
{ {
static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; u8 off[] = { 0x00, 0xf1};
static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE; u8 on[] = { 0x00, 0x71};
struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
struct saa7134_dev *dev = fe->dvb->priv; struct saa7134_dev *dev = fe->dvb->priv;
struct v4l2_frequency f; struct v4l2_frequency f;
...@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, ...@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
f.tuner = 0; f.tuner = 0;
f.type = V4L2_TUNER_DIGITAL_TV; f.type = V4L2_TUNER_DIGITAL_TV;
f.frequency = params->frequency / 1000 * 16 / 1000; f.frequency = params->frequency / 1000 * 16 / 1000;
saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on); i2c_transfer(&dev->i2c_adap, &msg, 1);
saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off); msg.buf = on;
i2c_transfer(&dev->i2c_adap, &msg, 1);
pinnacle_antenna_pwr(dev, antenna_pwr); pinnacle_antenna_pwr(dev, antenna_pwr);
......
...@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
struct v4l2_frequency *f = arg; struct v4l2_frequency *f = arg;
switch_v4l2(); switch_v4l2();
if (V4L2_TUNER_RADIO == f->type && if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
V4L2_TUNER_RADIO != t->mode) { || (V4L2_TUNER_DIGITAL_TV == f->type
&& V4L2_TUNER_DIGITAL_TV != t->mode)) {
if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
== EINVAL) == EINVAL)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment