Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38239
b: refs/heads/master
c: 0540c49
h: refs/heads/master
i:
  38237: efef99c
  38235: 097c220
  38231: 50491c4
  38223: dbc759d
  38207: 31a7bb4
v: v3
  • Loading branch information
Patrick Boettcher authored and Mauro Carvalho Chehab committed Oct 3, 2006
1 parent 7696216 commit 51adcc7
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6958effedb0dc709966c22e7fd0e8210b5401b84
refs/heads/master: 0540c4961fcc6d69b8a3314c330c376890715eee
10 changes: 10 additions & 0 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,19 @@ static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buffer, si
dvb_dmx_swfilter(&adap->demux, buffer, length);
}

static void dvb_usb_data_complete_204(struct usb_data_stream *stream, u8 *buffer, size_t length)
{
struct dvb_usb_adapter *adap = stream->user_priv;
if (adap->feedcount > 0 && adap->state & DVB_USB_ADAP_STATE_DVB)
dvb_dmx_swfilter_204(&adap->demux, buffer, length);
}

int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap)
{
adap->stream.udev = adap->dev->udev;
if (adap->props.caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS)
adap->stream.complete = dvb_usb_data_complete_204;
else
adap->stream.complete = dvb_usb_data_complete;
adap->stream.user_priv = adap;
return usb_urb_init(&adap->stream, &adap->props.stream);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ struct dvb_usb_adapter_properties {
#define DVB_USB_ADAP_HAS_PID_FILTER 0x01
#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04
#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08
int caps;
int pid_filter_count;

Expand Down
35 changes: 23 additions & 12 deletions trunk/drivers/media/dvb/dvb-usb/vp702x-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ struct vp702x_fe_state {
struct dvb_frontend fe;
struct dvb_usb_device *d;

struct dvb_frontend_ops ops;

fe_sec_voltage_t voltage;
fe_sec_tone_mode_t tone_mode;

Expand Down Expand Up @@ -72,9 +74,6 @@ static int vp702x_fe_read_status(struct dvb_frontend* fe, fe_status_t *status)
else
*status = 0;

deb_fe("real state: %x\n",*status);
*status = 0x1f;

if (*status & FE_HAS_LOCK)
st->status_check_interval = 1000;
else
Expand Down Expand Up @@ -171,8 +170,6 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
st->status_check_interval = 250;
st->next_status_check = jiffies;

vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0);
msleep(30);
vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100);

if (ibuf[2] == 0 && ibuf[3] == 0)
Expand All @@ -183,6 +180,20 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
return 0;
}

static int vp702x_fe_init(struct dvb_frontend *fe)
{
struct vp702x_fe_state *st = fe->demodulator_priv;
deb_fe("%s\n",__FUNCTION__);
vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0);
return 0;
}

static int vp702x_fe_sleep(struct dvb_frontend *fe)
{
deb_fe("%s\n",__FUNCTION__);
return 0;
}

static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters *fep)
{
Expand All @@ -207,12 +218,12 @@ static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
memcpy(&cmd[3], m->msg, m->msg_len);
cmd[7] = vp702x_chksum(cmd,0,7);

vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100);
// vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100);

if (ibuf[2] == 0 && ibuf[3] == 0)
deb_fe("diseqc cmd failed.\n");
else
deb_fe("diseqc cmd succeeded.\n");
// if (ibuf[2] == 0 && ibuf[3] == 0)
// deb_fe("diseqc cmd failed.\n");
// else
// deb_fe("diseqc cmd succeeded.\n");

return 0;
}
Expand Down Expand Up @@ -318,8 +329,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
},
.release = vp702x_fe_release,

.init = NULL,
.sleep = NULL,
.init = vp702x_fe_init,
.sleep = vp702x_fe_sleep,

.set_frontend = vp702x_fe_set_frontend,
.get_frontend = vp702x_fe_get_frontend,
Expand Down
Loading

0 comments on commit 51adcc7

Please sign in to comment.