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: 7490 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 24 Jul 2011 20:23:20 +0000 Received: from casper.infradead.org [85.118.1.10] by localhost.localdomain with IMAP (fetchmail-6.3.17) for (single-drop); Sun, 24 Jul 2011 17:23:41 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ql5Cq-0003XJ-0B; Sun, 24 Jul 2011 20:23:20 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117Ab1GXUXL (ORCPT + 1 other); 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 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;