From patchwork Sun Jul 1 20:15:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 13172 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SlQYu-0002MQ-Nj for patchwork@linuxtv.org; Sun, 01 Jul 2012 22:16:04 +0200 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-4) with esmtp for id 1SlQYu-0002ge-9s; Sun, 01 Jul 2012 22:16:04 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751396Ab2GAUP7 (ORCPT ); Sun, 1 Jul 2012 16:15:59 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:51555 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250Ab2GAUP5 (ORCPT ); Sun, 1 Jul 2012 16:15:57 -0400 Received: by mail-qa0-f53.google.com with SMTP id s11so1561997qaa.19 for ; Sun, 01 Jul 2012 13:15:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ImDwI4SI/xwSs1LTXybhf95md0/PUXo/cwQVSXpGXc8=; b=Z7hrujMbiDdILVluV0RJTYf4+0gLPAT+4ISs0hUuTpfdCXPDb49lMmPyC/OLi36D7C BXQMQICRNDtU42/Yc1c/hnObRut4ja3ByoAh8c4jPt5Jf+JwagLc26nUQXTPdFBifpm3 sqrV7vdRGMdMFCuzxHcSMZsS0V3z4E1mM2aE6TJX1ZRZw/0yGK2f7XZAVBQW5CnQI6AJ DD1Z3lbpzTYxPaETCt+5AS8fdT4DPjL0HH0JCBbZq02zquWrlKQizdaKzzjQ6+5D3CD5 Wf4rmNhnV/BXnSnvY64CvTqR+8XdXTM+xBTYqzmAfbhJY8uLbklEjFtqVNPFfYpxKTZR LKWg== Received: by 10.224.205.195 with SMTP id fr3mr18645680qab.68.1341173757244; Sun, 01 Jul 2012 13:15:57 -0700 (PDT) Received: from localhost.localdomain (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id cz12sm26276384qab.5.2012.07.01.13.15.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 01 Jul 2012 13:15:56 -0700 (PDT) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller Subject: [PATCH 4/6] cx25840: fix vsrc/hsrc usage on cx23888 designs Date: Sun, 1 Jul 2012 16:15:12 -0400 Message-Id: <1341173714-23627-5-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1341173714-23627-1-git-send-email-dheitmueller@kernellabs.com> References: <1341173714-23627-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQlZzCS8/etoFUN15BbeU0bD+Lj+dHmbJVxmedIP+Xk1UK9ewnXzMmRE8G2MrzhDRson5rtZ 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: 2012.7.1.200625 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __OEM_PHRASE 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' The location of the vsrc/hsrc registers moved in the cx23888, causing the s_mbus call to fail prematurely indicating that "720x480 is not a valid size". The function bailed out before many pertinent registers were set related to the scaler (causing unexpected results in video rendering when doing raw video capture). Use the correct registers for the cx23888. Validated with the following boards: HVR-1800 retail (0070:7801) HVR-1800 OEM (0070:7809) HVR-1850 retail (0070:8541) Thanks to Steven Toth and Hauppauge for loaning me various boards to regression test with. Reported-by: Jonathan Thanks-to: Steven Toth Signed-off-by: Devin Heitmueler --- drivers/media/video/cx25840/cx25840-core.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 7dc7bb1..d8eac3e 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -1380,11 +1380,21 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt fmt->field = V4L2_FIELD_INTERLACED; fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; - Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; - Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; + if (is_cx23888(state)) { + Vsrc = (cx25840_read(client, 0x42a) & 0x3f) << 4; + Vsrc |= (cx25840_read(client, 0x429) & 0xf0) >> 4; + } else { + Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; + Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; + } - Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; - Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; + if (is_cx23888(state)) { + Hsrc = (cx25840_read(client, 0x426) & 0x3f) << 4; + Hsrc |= (cx25840_read(client, 0x425) & 0xf0) >> 4; + } else { + Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; + Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; + } Vlines = fmt->height + (is_50Hz ? 4 : 7);