From patchwork Sun Jul 24 20:23:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1003322 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6OKNTWr004473 for ; Sun, 24 Jul 2011 20:23:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117Ab1GXUXL (ORCPT ); Sun, 24 Jul 2011 16:23:11 -0400 Received: from mail-ey0-f171.google.com ([209.85.215.171]:55245 "EHLO mail-ey0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074Ab1GXUXL (ORCPT ); Sun, 24 Jul 2011 16:23:11 -0400 Received: by eye22 with SMTP id 22so3151795eye.2 for ; Sun, 24 Jul 2011 13:23:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.102.144 with SMTP id g16mr485485ebo.62.1311538989928; Sun, 24 Jul 2011 13:23:09 -0700 (PDT) Received: by 10.213.7.79 with HTTP; Sun, 24 Jul 2011 13:23:09 -0700 (PDT) Date: Sun, 24 Jul 2011 16:23:09 -0400 Message-ID: Subject: [PATCH] au8522: set signal field to 100% when signal present From: Devin Heitmueller To: Linux Media Mailing List Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 24 Jul 2011 20:23:29 +0000 (UTC) This patch makes the HVR-950q behave consistently with other drivers, which is to show the signal level as 100% in cases where we have a signal present but given we are unable to determine an actual signal level. The old code would set the value to "1", which divided by 65535 is rounded down to 0%. Devin au8522: set signal field to 100% when signal present From: Devin Heitmueller The signal state field in G_TUNER is typically scaled from 0-100%. Since we don't know the signal level, we really would prefer the field to contain 100% than 1/256, which in many utilities (such as v4l2-ctl) rounds to 0% even when a signal is actually present. This patch makes the behavior consistent with other drivers. Signed-off-by: Devin Heitmueller diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index b537891..2b248c1 100644 --- a/drivers/media/dvb/frontends/au8522_decoder.c +++ b/drivers/media/dvb/frontends/au8522_decoder.c @@ -692,7 +692,7 @@ static int au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) /* Interrogate the decoder to see if we are getting a real signal */ lock_status = au8522_readreg(state, 0x00); if (lock_status == 0xa2) - vt->signal = 0x01; + vt->signal = 0xffff; else vt->signal = 0x00;