Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115616
b: refs/heads/master
c: 73a529f
h: refs/heads/master
v: v3
  • Loading branch information
Tobias Lorenz authored and Mauro Carvalho Chehab committed Oct 17, 2008
1 parent 4dce358 commit 88cde3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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: 33632d4773b8256c29525b7151cd74226352f838
refs/heads/master: 73a529f9a6fee877c4e41f7541b8689dd7561bd7
24 changes: 18 additions & 6 deletions trunk/drivers/media/radio/radio-si470x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
/* driver constants */
strcpy(tuner->name, "FM");
tuner->type = V4L2_TUNER_RADIO;
tuner->capability = V4L2_TUNER_CAP_LOW;
tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;

/* range limits */
switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) {
Expand All @@ -1451,13 +1451,18 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
tuner->rangehigh = 90 * FREQ_MUL;
break;
};
tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;

/* Stereo indicator == Stereo (instead of Mono) */
/* stereo indicator == stereo (instead of mono) */
if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 1)
tuner->audmode = V4L2_TUNER_MODE_STEREO;
tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
else
tuner->rxsubchans = V4L2_TUNER_SUB_MONO;

/* mono/stereo selector */
if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 1)
tuner->audmode = V4L2_TUNER_MODE_MONO;
else
tuner->audmode = V4L2_TUNER_MODE_STEREO;

/* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */
tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI)
Expand Down Expand Up @@ -1492,10 +1497,17 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
if (tuner->index != 0)
goto done;

if (tuner->audmode == V4L2_TUNER_MODE_MONO)
/* mono/stereo selector */
switch (tuner->audmode) {
case V4L2_TUNER_MODE_MONO:
radio->registers[POWERCFG] |= POWERCFG_MONO; /* force mono */
else
break;
case V4L2_TUNER_MODE_STEREO:
radio->registers[POWERCFG] &= ~POWERCFG_MONO; /* try stereo */
break;
default:
goto done;
}

retval = si470x_set_register(radio, POWERCFG);

Expand Down

0 comments on commit 88cde3b

Please sign in to comment.