From patchwork Mon Nov 30 12:08:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 63690 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAUClNAF005261 for ; Mon, 30 Nov 2009 12:47:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753413AbZK3Mqp (ORCPT ); Mon, 30 Nov 2009 07:46:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753075AbZK3Mqo (ORCPT ); Mon, 30 Nov 2009 07:46:44 -0500 Received: from ns.gsystems.sk ([62.176.172.50]:48589 "EHLO www.gsystems.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752812AbZK3MqS (ORCPT ); Mon, 30 Nov 2009 07:46:18 -0500 X-Greylist: delayed 2269 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Nov 2009 07:46:18 EST Received: from main.reblok.sk ([62.176.172.51] helo=omega.fornet.sk) by www.gsystems.sk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1NF53T-0002pJ-QW; Mon, 30 Nov 2009 13:08:35 +0100 To: vandrove@vc.cvut.cz Subject: [resend] radio-sf16fmi: fix mute, add SF16-FMP to texts Cc: linux-media@vger.kernel.org Content-Disposition: inline From: Ondrej Zary Date: Mon, 30 Nov 2009 13:08:33 +0100 MIME-Version: 1.0 Message-Id: <200911301308.34295.zary@gsystems.sk> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -urp linux-source-2.6.31-orig/drivers/media/radio/Kconfig linux-source-2.6.31/drivers/media/radio/Kconfig --- linux-source-2.6.31-orig/drivers/media/radio/Kconfig 2009-09-10 00:13:59.000000000 +0200 +++ linux-source-2.6.31/drivers/media/radio/Kconfig 2009-11-28 11:51:42.000000000 +0100 @@ -196,7 +196,7 @@ config RADIO_MAESTRO module will be called radio-maestro. config RADIO_SF16FMI - tristate "SF16FMI Radio" + tristate "SF16-FMI/SF16-FMP Radio" depends on ISA && VIDEO_V4L2 ---help--- Choose Y here if you have one of these FM radio cards. If you diff -urp linux-source-2.6.31-orig/drivers/media/radio/radio-sf16fmi.c linux-source-2.6.31/drivers/media/radio/radio-sf16fmi.c --- linux-source-2.6.31-orig/drivers/media/radio/radio-sf16fmi.c 2009-09-10 00:13:59.000000000 +0200 +++ linux-source-2.6.31/drivers/media/radio/radio-sf16fmi.c 2009-11-28 11:39:35.000000000 +0100 @@ -1,4 +1,4 @@ -/* SF16FMI radio driver for Linux radio support +/* SF16-FMI and SF16-FMP radio driver for Linux radio support * heavily based on rtrack driver... * (c) 1997 M. Kirkwood * (c) 1998 Petr Vandrovec, vandrove@vc.cvut.cz @@ -11,7 +11,7 @@ * * Frequency control is done digitally -- ie out(port,encodefreq(95.8)); * No volume control - only mute/unmute - you have to use line volume - * control on SB-part of SF16FMI + * control on SB-part of SF16-FMI/SF16-FMP * * Converted to V4L2 API by Mauro Carvalho Chehab */ @@ -30,14 +30,14 @@ #include MODULE_AUTHOR("Petr Vandrovec, vandrove@vc.cvut.cz and M. Kirkwood"); -MODULE_DESCRIPTION("A driver for the SF16MI radio."); +MODULE_DESCRIPTION("A driver for the SF16-FMI and SF16-FMP radio."); MODULE_LICENSE("GPL"); static int io = -1; static int radio_nr = -1; module_param(io, int, 0); -MODULE_PARM_DESC(io, "I/O address of the SF16MI card (0x284 or 0x384)"); +MODULE_PARM_DESC(io, "I/O address of the SF16-FMI or SF16-FMP card (0x284 or 0x384)"); module_param(radio_nr, int, 0); #define RADIO_VERSION KERNEL_VERSION(0, 0, 2) @@ -47,7 +47,7 @@ struct fmi struct v4l2_device v4l2_dev; struct video_device vdev; int io; - int curvol; /* 1 or 0 */ + bool mute; unsigned long curfreq; /* freq in kHz */ struct mutex lock; }; @@ -105,7 +105,7 @@ static inline int fmi_setfreq(struct fmi outbits(8, 0xC0, fmi->io); msleep(143); /* was schedule_timeout(HZ/7) */ mutex_unlock(&fmi->lock); - if (fmi->curvol) + if (!fmi->mute) fmi_unmute(fmi); return 0; } @@ -116,7 +116,7 @@ static inline int fmi_getsigstr(struct f int res; mutex_lock(&fmi->lock); - val = fmi->curvol ? 0x08 : 0x00; /* unmute/mute */ + val = fmi->mute ? 0x00 : 0x08; /* mute/unmute */ outb(val, fmi->io); outb(val | 0x10, fmi->io); msleep(143); /* was schedule_timeout(HZ/7) */ @@ -204,7 +204,7 @@ static int vidioc_g_ctrl(struct file *fi switch (ctrl->id) { case V4L2_CID_AUDIO_MUTE: - ctrl->value = fmi->curvol; + ctrl->value = fmi->mute; return 0; } return -EINVAL; @@ -221,7 +221,7 @@ static int vidioc_s_ctrl(struct file *fi fmi_mute(fmi); else fmi_unmute(fmi); - fmi->curvol = ctrl->value; + fmi->mute = ctrl->value; return 0; } return -EINVAL;