All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: mchehab@redhat.com
Cc: hverkuil@xs4all.nl, linux-media@vger.kernel.org,
	"Frank Schäfer" <fschaefer.oss@googlemail.com>
Subject: [RFC PATCH v2 5/6] bttv: avoid mute on last close when the radio device node is still open
Date: Sun, 10 Mar 2013 22:53:53 +0100	[thread overview]
Message-ID: <1362952434-2974-6-git-send-email-fschaefer.oss@googlemail.com> (raw)
In-Reply-To: <1362952434-2974-1-git-send-email-fschaefer.oss@googlemail.com>

In contrast to video devices, radio devices should not be muted on the last
close of the device node.
In cases where a device provides a video and a radio device node, tuner
ownership has to be taken into account.

The current code doesn't handle tuner ownership yet, so never mute the device if
the radio device node is still open.
Also add a comment about this issue.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/pci/bt8xx/bttv-driver.c |    6 ++++--
 1 Datei geändert, 4 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 6432bfe..7459ad6 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -3114,7 +3114,6 @@ static int bttv_release(struct file *file)
 	}
 
 	/* free stuff */
-
 	videobuf_mmap_free(&fh->cap);
 	videobuf_mmap_free(&fh->vbi);
 	file->private_data = NULL;
@@ -3122,8 +3121,11 @@ static int bttv_release(struct file *file)
 	btv->users--;
 	bttv_field_count(btv);
 
-	if (!btv->users)
+	if (!btv->users && !btv->radio_user)
 		audio_mute(btv, 1);
+	/* FIXME: should also depend on tuner ownership ! */
+	/* NOTE as long as we don't handle the tuner ownership properly,
+	 * only mute the device if the radio device node isn't open. */
 
 	v4l2_fh_del(&fh->fh);
 	v4l2_fh_exit(&fh->fh);
-- 
1.7.10.4


  parent reply	other threads:[~2013-03-10 21:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10 21:53 [RFC PATCH v2 0/6] bttv: fix muting/unmuting on probing, first open and last close Frank Schäfer
2013-03-10 21:53 ` [RFC PATCH v2 1/6] bttv: audio_mux() use a local variable "gpio_mute" instead of modifying the function parameter "mute" Frank Schäfer
2013-03-12 13:25   ` Hans Verkuil
2013-03-10 21:53 ` [RFC PATCH v2 2/6] bttv: audio_mux(): do not change the value of the v4l2 mute control Frank Schäfer
2013-03-12 13:41   ` Hans Verkuil
2013-03-15 17:38     ` Frank Schäfer
2013-03-10 21:53 ` [RFC PATCH v2 3/6] bttv: fix mute on last close of the video device node Frank Schäfer
2013-03-10 21:53 ` [RFC PATCH v2 4/6] bttv: do not unmute the device before the first open Frank Schäfer
2013-03-10 21:53 ` Frank Schäfer [this message]
2013-03-10 21:53 ` [RFC PATCH v2 6/6] bttv: radio: apply mute settings on open Frank Schäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362952434-2974-6-git-send-email-fschaefer.oss@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.