From patchwork Wed Mar 13 04:23:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitri Belimov X-Patchwork-Id: 17348 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UFdE9-0000Qm-U8; Wed, 13 Mar 2013 05:23:45 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1UFdE8-0007Yc-FJ; Wed, 13 Mar 2013 05:23:45 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751081Ab3CMEXm (ORCPT + 1 other); Wed, 13 Mar 2013 00:23:42 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:52296 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914Ab3CMEXm (ORCPT ); Wed, 13 Mar 2013 00:23:42 -0400 Received: by mail-la0-f46.google.com with SMTP id fq12so650280lab.19 for ; Tue, 12 Mar 2013 21:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=MDiZxCY6ZZvr5xFBd/sLclhAoHHiGoVJop8q4slBOY8=; b=P/vYX9UvrPorbuzqwjATvvnkBC603oFtMZoEkIX0QZzjUel8wWCY0hBqTSJULa7/Nf jM9SFecrg6Bq/Xg7KeS58zCsBSJTkvOt/yK71r4OIvLyZYZ1twMGng9tRL2zID+8iwNX 1K3D/DloOaO0jG03WzNPdWb6MBG08fACFIqX17vb3f8vbCV4BkcNu3G0hh9Kom7bibVj p20jLewF2dFoCPgrjg23fKifHXpB3XHEc+QaMgHGmlZ3L1ihInrSUQ3umw5DZOl6aaak +9JeZnohos3kzIe6gLcDnKsBCY/23EdXV7yJrRWqxMwayhwnVlMR625rR6h6l3ptjgU4 Z8Pg== X-Received: by 10.112.5.6 with SMTP id o6mr1400872lbo.57.1363148620396; Tue, 12 Mar 2013 21:23:40 -0700 (PDT) Received: from glory.local ([188.168.81.127]) by mx.google.com with ESMTPS id t17sm10447690lam.9.2013.03.12.21.23.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 Mar 2013 21:23:39 -0700 (PDT) Date: Wed, 13 Mar 2013 14:23:36 +1000 From: Dmitri Belimov To: Devin Heitmueller , LMML Subject: [PATCH] xc5000: fix incorrect debug printnk Message-ID: <20130313142336.63cc4d55@glory.local> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.13.41817 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Hello I found very small bag in xc5000 source. When set option debug=1 and listen a radio we see in dmesg xc5000: xc_SetTVStandard() Standard = M/N-NTSC/PAL-BTSC at all time. But true value is "FM Radio-INPUT1_MONO". It happens because in function xc5000_set_radio_freq get correct value VideoMode and AudioMode for radio and call xc_SetTVStandard where name of standard get from incorrect place priv->video_standard . This incorrect debug message do debugging little difficult. I found very small bag in xc5000 source. When set option debug=1 and listen a radio we see in dmesg xc5000: xc_SetTVStandard() Standard = M/N-NTSC/PAL-BTSC at all time. But true value is "FM Radio-INPUT1_MONO". It happens because in function xc5000_set_radio_freq get correct value VideoMode and AudioMode for radio and call xc_SetTVStandard where name of standard get from incorrect place priv->video_standard . This incorrect debug message do debugging little difficult. Signed-off-by: Dmitry Belimov With my best regards, Dmitry. --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c index d6be1b6..5cd09a6 100644 --- a/drivers/media/tuners/xc5000.c +++ b/drivers/media/tuners/xc5000.c @@ -422,13 +422,19 @@ static int xc_initialize(struct xc5000_priv *priv) } static int xc_SetTVStandard(struct xc5000_priv *priv, - u16 VideoMode, u16 AudioMode) + u16 VideoMode, u16 AudioMode, u8 RadioMode) { int ret; dprintk(1, "%s(0x%04x,0x%04x)\n", __func__, VideoMode, AudioMode); - dprintk(1, "%s() Standard = %s\n", - __func__, - XC5000_Standard[priv->video_standard].Name); + if (RadioMode) { + dprintk(1, "%s() Standard = %s\n", + __func__, + XC5000_Standard[RadioMode].Name); + } else { + dprintk(1, "%s() Standard = %s\n", + __func__, + XC5000_Standard[priv->video_standard].Name); + } ret = xc_write_reg(priv, XREG_VIDEO_MODE, VideoMode); if (ret == XC_RESULT_SUCCESS) @@ -824,7 +830,7 @@ static int xc5000_set_params(struct dvb_frontend *fe) ret = xc_SetTVStandard(priv, XC5000_Standard[priv->video_standard].VideoMode, - XC5000_Standard[priv->video_standard].AudioMode); + XC5000_Standard[priv->video_standard].AudioMode, 0); if (ret != XC_RESULT_SUCCESS) { printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n"); return -EREMOTEIO; @@ -940,7 +946,7 @@ tune_channel: ret = xc_SetTVStandard(priv, XC5000_Standard[priv->video_standard].VideoMode, - XC5000_Standard[priv->video_standard].AudioMode); + XC5000_Standard[priv->video_standard].AudioMode, 0); if (ret != XC_RESULT_SUCCESS) { printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n"); return -EREMOTEIO; @@ -1003,7 +1009,7 @@ static int xc5000_set_radio_freq(struct dvb_frontend *fe, priv->rf_mode = XC_RF_MODE_AIR; ret = xc_SetTVStandard(priv, XC5000_Standard[radio_input].VideoMode, - XC5000_Standard[radio_input].AudioMode); + XC5000_Standard[radio_input].AudioMode, radio_input); if (ret != XC_RESULT_SUCCESS) { printk(KERN_ERR "xc5000: xc_SetTVStandard failed\n");