From patchwork Fri Mar 15 01:58:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitri Belimov X-Patchwork-Id: 17445 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UHi8M-0000qj-O8 for patchwork@linuxtv.org; Mon, 18 Mar 2013 23:02:47 +0100 X-tubIT-Incoming-IP: 209.132.183.28 Received: from mx1.redhat.com ([209.132.183.28]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1UHi8M-0002lh-9l; Mon, 18 Mar 2013 23:02:22 +0100 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2IM2JiR022718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Mar 2013 18:02:19 -0400 Received: from localhost.localdomain (vpn1-5-235.gru2.redhat.com [10.97.5.235]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2IM2FHI030429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 18 Mar 2013 18:02:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=i7ZXox/STchoxjYpQSCdBLYlCG5RoBL4uBLhWGwOCTo=; b=qM+Z1+PFaMS/bx9GhJN7oRQCqNXIYu8HAUKbf8Egib6aC7fsm9cPVAFVB1yA7fnEiw 9vEwMykRTER5WqqisKs0gPE45z7eRK9dnvSJkbbP4d+J23dTVWtd95feyOYusxIeLPe9 AwfSKgtVyNK27FKm6IBFq9gZjPJh2ZI7iq9h2goxPRZYh08DPWjcMmBZksARPCw5UMFR C7aTn2M3pPNfI8Yk8TEI08bipOlGj1p7fFJjuwiAcq8pOZqDyikLqbkHDfbN+aWhQ5PG nKYnPIFjIpBXccXFlmf70QFz8mr4dGWiE69VmYtawtEr1qu9X85BH0LV244WytgExLbB rdtA== X-Received: by 10.112.43.232 with SMTP id z8mr1934973lbl.135.1363312715946; Thu, 14 Mar 2013 18:58:35 -0700 (PDT) Date: Fri, 15 Mar 2013 11:58:30 +1000 From: Dmitri Belimov (by way of Mauro Carvalho Chehab ) To: Mauro Carvalho Chehab Cc: Devin Heitmueller Message-ID: <20130315115830.5b288c36@glory.local> Mime-Version: 1.0 X-RedHat-Spam-Score: -3.09 (BAYES_00, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS, T_FRT_BELOW2) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.16 Resent-Date: Mon, 18 Mar 2013 19:02:15 -0300 Resent-From: Mauro Carvalho Chehab Subject: [PATCH] xc5000: fix incorrect debug printk Resent-Message-ID: <20130318190215.34e6beb1@redhat.com> Resent-To: patchwork@linuxtv.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.18.215415 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, FROM_NAME_PHRASE 0, __ANY_URI 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __INT_PROD_TV 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_PHRASE2 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793, T_DKIM_INVALID=0.01, T_FRT_BELOW2=0.01 autolearn=no Hi Mauro I was send this email to ML but didn't see it. May be my email is blocked. It's resend. P.S. Mauro, Is radio with tm6000 module work with your TV cards? 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. 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");