From patchwork Thu Jan 28 09:03:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 8147941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66ECBBEEE5 for ; Thu, 28 Jan 2016 09:03:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F7512021A for ; Thu, 28 Jan 2016 09:03:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A6B0202FE for ; Thu, 28 Jan 2016 09:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965493AbcA1JDY (ORCPT ); Thu, 28 Jan 2016 04:03:24 -0500 Received: from ni.piap.pl ([195.187.100.4]:41804 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965474AbcA1JDQ convert rfc822-to-8bit (ORCPT ); Thu, 28 Jan 2016 04:03:16 -0500 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id 6E7A744199A; Thu, 28 Jan 2016 10:03:15 +0100 (CET) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Hans Verkuil Cc: linux-media , Ezequiel Garcia Subject: [PATCH 5/12] TW686x: Fix handling of TV standard values References: Date: Thu, 28 Jan 2016 10:03:15 +0100 In-Reply-To: ("Krzysztof \=\?utf-8\?Q\?Ha\=C5\=82as\?\= \=\?utf-8\?Q\?a\=22's\?\= message of "Thu, 28 Jan 2016 09:29:29 +0100") Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 90337 [Jan 28 2016] X-KLMS-AntiSpam-Version: 5.5.6 X-KLMS-AntiSpam-Envelope-From: khalasa@piap.pl X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Moebius-Timestamps: 3935536, 3935575, 3935451 X-KLMS-AntiSpam-Info: LuaCore: 406 406 5c898342d373668b3b9f614f48d8244d080de696, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2016/01/26 12:51:30 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2016/01/28 04:57:00 #6871571 X-KLMS-AntiVirus-Status: Clean, skipped Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Krzysztof Ha?asa --- 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/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c index 78f4f55..c5d8f28 100644 --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c @@ -417,18 +417,14 @@ static int tw686x_querycap(struct file *file, void *priv, static int tw686x_s_std(struct file *file, void *priv, v4l2_std_id id) { struct tw686x_video_channel *vc = video_drvdata(file); - unsigned std, count = 0; - u32 sdt, std_mask = 0; - - for (std = 0; std > ARRAY_SIZE(video_standards); std++) - if (id & video_standards[std]) { - sdt = std; - std_mask |= 1 << std; - count++; - } + unsigned cnt; + u32 sdt = 0; /* default */ - if (count != 1) - return -EINVAL; /* must request exactly one standard */ + for (cnt = 0; cnt < ARRAY_SIZE(video_standards); cnt++) + if (id & video_standards[cnt]) { + sdt = cnt; + break; + } reg_write(vc->dev, SDT[vc->ch], sdt); vc->video_standard = video_standards[sdt]; @@ -658,12 +654,13 @@ int tw686x_video_init(struct tw686x_dev *dev) vc->dev = dev; vc->ch = ch; - /* default settings */ + /* default settings: NTSC */ vc->format = &formats[0]; - vc->video_standard = V4L2_STD_PAL; - vc->field = V4L2_FIELD_SEQ_TB; + vc->video_standard = V4L2_STD_NTSC; + reg_write(vc->dev, SDT[vc->ch], 0); + vc->field = V4L2_FIELD_SEQ_BT; vc->width = 704; - vc->height = 576; + vc->height = 480; for (n = 0; n < 2; n++) { void *cpu; @@ -733,8 +730,7 @@ int tw686x_video_init(struct tw686x_dev *dev) vdev->release = video_device_release; vdev->v4l2_dev = &dev->v4l2_dev; vdev->queue = &vc->vidq; - vdev->tvnorms = V4L2_STD_PAL | V4L2_STD_NTSC | V4L2_STD_SECAM | - V4L2_STD_PAL_60; + vdev->tvnorms = V4L2_STD_ALL; vdev->minor = -1; vdev->lock = &vc->vb_mutex;