Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138365
b: refs/heads/master
c: 5fa7b9f
h: refs/heads/master
i:
  138363: 27a8b5a
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent f037a14 commit 8021db2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 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: 8f84a775c2ad8a0d95f944f6397248b9c0c25e50
refs/heads/master: 5fa7b9f3c0f249a4faed6c3e534917199249ead8
24 changes: 19 additions & 5 deletions trunk/drivers/media/video/tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,8 @@ static int tvaudio_g_ctrl(struct v4l2_subdev *sd,

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
if (!(desc->flags & CHIP_HAS_INPUTSEL))
break;
ctrl->value=chip->muted;
return 0;
case V4L2_CID_AUDIO_VOLUME:
Expand Down Expand Up @@ -1552,6 +1554,9 @@ static int tvaudio_s_ctrl(struct v4l2_subdev *sd,

switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
if (!(desc->flags & CHIP_HAS_INPUTSEL))
break;

if (ctrl->value < 0 || ctrl->value >= 2)
return -ERANGE;
chip->muted = ctrl->value;
Expand Down Expand Up @@ -1636,7 +1641,9 @@ static int tvaudio_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)

switch (qc->id) {
case V4L2_CID_AUDIO_MUTE:
return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
if (desc->flags & CHIP_HAS_INPUTSEL)
return v4l2_ctrl_query_fill(qc, 0, 1, 1, 0);
break;
case V4L2_CID_AUDIO_VOLUME:
if (desc->flags & CHIP_HAS_VOLUME)
return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
Expand All @@ -1661,7 +1668,9 @@ static int tvaudio_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *
struct CHIPSTATE *chip = to_state(sd);
struct CHIPDESC *desc = chip->desc;

if (!(desc->flags & CHIP_HAS_INPUTSEL) || rt->input >= 4)
if (!(desc->flags & CHIP_HAS_INPUTSEL))
return 0;
if (rt->input >= 4)
return -EINVAL;
/* There are four inputs: tuner, radio, extern and intern. */
chip->input = rt->input;
Expand All @@ -1678,8 +1687,11 @@ static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
struct CHIPDESC *desc = chip->desc;
int mode = 0;

if (!desc->setmode)
return 0;
if (chip->radio)
return 0;

switch (vt->audmode) {
case V4L2_TUNER_MODE_MONO:
case V4L2_TUNER_MODE_STEREO:
Expand All @@ -1695,7 +1707,7 @@ static int tvaudio_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
}
chip->audmode = vt->audmode;

if (desc->setmode && mode) {
if (mode) {
chip->watch_stereo = 0;
/* del_timer(&chip->wt); */
chip->mode = mode;
Expand All @@ -1710,15 +1722,17 @@ static int tvaudio_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
struct CHIPDESC *desc = chip->desc;
int mode = V4L2_TUNER_MODE_MONO;

if (!desc->getmode)
return 0;
if (chip->radio)
return 0;

vt->audmode = chip->audmode;
vt->rxsubchans = 0;
vt->capability = V4L2_TUNER_CAP_STEREO |
V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;

if (desc->getmode)
mode = desc->getmode(chip);
mode = desc->getmode(chip);

if (mode & V4L2_TUNER_MODE_MONO)
vt->rxsubchans |= V4L2_TUNER_SUB_MONO;
Expand Down

0 comments on commit 8021db2

Please sign in to comment.