Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320552
b: refs/heads/master
c: 3d0fe51
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jul 30, 2012
1 parent 32a9bb8 commit bbe47d7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 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: 31a62d415726d94bae5caf5f2e50232aa06babf6
refs/heads/master: 3d0fe51cfa3d07751224c034f8226136a7dd05f2
1 change: 1 addition & 0 deletions trunk/include/sound/tea575x-tuner.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct snd_tea575x {
int radio_nr; /* radio_nr */
bool tea5759; /* 5759 chip is present */
bool cannot_read_data; /* Device cannot read the data pin */
bool cannot_mute; /* Device cannot mute */
bool mute; /* Device is muted? */
bool stereo; /* receiving stereo */
bool tuned; /* tuned to a station */
Expand Down
35 changes: 19 additions & 16 deletions trunk/sound/i2c/other/tea575x-tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
tea->vd.lock = &tea->mutex;
tea->vd.v4l2_dev = tea->v4l2_dev;
tea->vd.ctrl_handler = &tea->ctrl_handler;
tea->fops = tea575x_fops;
tea->fops.owner = owner;
tea->vd.fops = &tea->fops;
Expand All @@ -394,29 +393,33 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
if (tea->cannot_read_data)
v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK);

v4l2_ctrl_handler_init(&tea->ctrl_handler, 1);
v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
retval = tea->ctrl_handler.error;
if (retval) {
v4l2_err(tea->v4l2_dev, "can't initialize controls\n");
v4l2_ctrl_handler_free(&tea->ctrl_handler);
return retval;
}

if (tea->ext_init) {
retval = tea->ext_init(tea);
if (!tea->cannot_mute) {
tea->vd.ctrl_handler = &tea->ctrl_handler;
v4l2_ctrl_handler_init(&tea->ctrl_handler, 1);
v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops,
V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
retval = tea->ctrl_handler.error;
if (retval) {
v4l2_err(tea->v4l2_dev, "can't initialize controls\n");
v4l2_ctrl_handler_free(&tea->ctrl_handler);
return retval;
}
}

v4l2_ctrl_handler_setup(&tea->ctrl_handler);
if (tea->ext_init) {
retval = tea->ext_init(tea);
if (retval) {
v4l2_ctrl_handler_free(&tea->ctrl_handler);
return retval;
}
}

v4l2_ctrl_handler_setup(&tea->ctrl_handler);
}

retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->radio_nr);
if (retval) {
v4l2_err(tea->v4l2_dev, "can't register video device!\n");
v4l2_ctrl_handler_free(&tea->ctrl_handler);
v4l2_ctrl_handler_free(tea->vd.ctrl_handler);
return retval;
}

Expand All @@ -426,7 +429,7 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
void snd_tea575x_exit(struct snd_tea575x *tea)
{
video_unregister_device(&tea->vd);
v4l2_ctrl_handler_free(&tea->ctrl_handler);
v4l2_ctrl_handler_free(tea->vd.ctrl_handler);
}

static int __init alsa_tea575x_module_init(void)
Expand Down

0 comments on commit bbe47d7

Please sign in to comment.