Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5244
b: refs/heads/master
c: 9d2599d
h: refs/heads/master
v: v3
  • Loading branch information
Michael Hunold authored and Linus Torvalds committed Jul 27, 2005
1 parent bfbde5f commit cf7117e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 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: 29780bb7af61752924cf4814f2d8180747b38105
refs/heads/master: 9d2599d98e9cb511f326b2d1b353e462bc360774
39 changes: 14 additions & 25 deletions trunk/drivers/media/video/mxb.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ struct mxb

int cur_mode; /* current audio mode (mono, stereo, ...) */
int cur_input; /* current input */
int cur_freq; /* current frequency the tuner is tuned to */
int cur_mute; /* current mute status */
struct v4l2_frequency cur_freq; /* current frequency the tuner is tuned to */
};

static struct saa7146_extension extension;
Expand Down Expand Up @@ -352,9 +352,15 @@ static int mxb_init_done(struct saa7146_dev* dev)
/* select a tuner type */
tun_setup.mode_mask = T_ANALOG_TV;
tun_setup.addr = ADDR_UNSET;
tun_setup.type = 5;
tun_setup.type = TUNER_PHILIPS_PAL;
mxb->tuner->driver->command(mxb->tuner,TUNER_SET_TYPE_ADDR, &tun_setup);

/* tune in some frequency on tuner */
mxb->cur_freq.tuner = 0;
mxb->cur_freq.type = V4L2_TUNER_ANALOG_TV;
mxb->cur_freq.frequency = freq;
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY,
&mxb->cur_freq);

/* mute audio on tea6420s */
mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]);
mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]);
Expand All @@ -371,12 +377,8 @@ static int mxb_init_done(struct saa7146_dev* dev)
vm.out = 13;
mxb->tea6415c->driver->command(mxb->tea6415c,TEA6415C_SWITCH, &vm);

/* tune in some frequency on tuner */
mxb->tuner->driver->command(mxb->tuner, VIDIOCSFREQ, &freq);

/* the rest for mxb */
mxb->cur_input = 0;
mxb->cur_freq = freq;
mxb->cur_mute = 1;

mxb->cur_mode = V4L2_TUNER_MODE_STEREO;
Expand Down Expand Up @@ -819,18 +821,14 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
return -EINVAL;
}

memset(f,0,sizeof(*f));
f->type = V4L2_TUNER_ANALOG_TV;
f->frequency = mxb->cur_freq;
*f = mxb->cur_freq;

DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", mxb->cur_freq));
DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", mxb->cur_freq.frequency));
return 0;
}
case VIDIOC_S_FREQUENCY:
{
struct v4l2_frequency *f = arg;
int t_locked = 0;
int v_byte = 0;

if (0 != f->tuner)
return -EINVAL;
Expand All @@ -843,20 +841,11 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
return -EINVAL;
}

DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n",f->frequency));

mxb->cur_freq = f->frequency;
mxb->cur_freq = *f;
DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", mxb->cur_freq.frequency));

/* tune in desired frequency */
mxb->tuner->driver->command(mxb->tuner, VIDIOCSFREQ, &mxb->cur_freq);

/* check if pll of tuner & saa7111a is locked */
// mxb->tuner->driver->command(mxb->tuner,TUNER_IS_LOCKED, &t_locked);
mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_GET_STATUS, &v_byte);

/* not locked -- anything to do here ? */
if( 0 == t_locked || 0 == (v_byte & DECODER_STATUS_GOOD)) {
}
mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, &mxb->cur_freq);

/* hack: changing the frequency should invalidate the vbi-counter (=> alevt) */
spin_lock(&dev->slock);
Expand Down

0 comments on commit cf7117e

Please sign in to comment.