From patchwork Tue Feb 23 08:32:32 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: 8388981 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D2D959F1D4 for ; Tue, 23 Feb 2016 08:32:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A46DA204EA for ; Tue, 23 Feb 2016 08:32:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7287520392 for ; Tue, 23 Feb 2016 08:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932625AbcBWIcg (ORCPT ); Tue, 23 Feb 2016 03:32:36 -0500 Received: from ni.piap.pl ([195.187.100.4]:51277 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932551AbcBWIcf (ORCPT ); Tue, 23 Feb 2016 03:32:35 -0500 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id 7BB95441572; Tue, 23 Feb 2016 09:32:32 +0100 (CET) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: linux-media Cc: Hans Verkuil , Ezequiel Garcia Subject: Re: [PATCH v3] TW686x frame grabber driver References: Date: Tue, 23 Feb 2016 09:32:32 +0100 In-Reply-To: ("Krzysztof \=\?utf-8\?Q\?Ha\=C5\=82as\?\= \=\?utf-8\?Q\?a\=22's\?\= message of "Tue, 16 Feb 2016 08:51:12 +0100") Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 91752 [Feb 23 2016] X-KLMS-AntiSpam-Version: 5.5.9.33 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: 3976665, 3976682, 3976153 X-KLMS-AntiSpam-Info: LuaCore: 414 414 652141367f63b6038f5642fa97308d3a9d2edb46, Auth:dkim=none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2016/02/20 11:27:52 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2016/02/22 23:54:00 #7202494 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 > A driver for Intersil/Techwell TW686x-based PCIe frame grabbers. The v3 TW686x patch was missing a few small changes (attached). Will post complete v4 patch. --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c @@ -260,6 +260,10 @@ static void setup_dma_cfg(struct tw686x_video_channel *vc) reg_write(vc->dev, VIDEO_SIZE[vc->ch], (1 << 31) | (field_height << 16) | field_width); reg = reg_read(vc->dev, VIDEO_CONTROL1); + if (vc->video_standard & V4L2_STD_625_50) + reg |= 1 << (vc->ch + 13); + else + reg &= ~(1 << (vc->ch + 13)); reg_write(vc->dev, VIDEO_CONTROL1, reg); } @@ -569,8 +573,8 @@ static int video_thread(void *arg) /* handle channel events */ if ((request & 0x01000000) | - (reg_read(dev, VIDEO_FIFO_STATUS) & 0x01010001) | - (reg_read(dev, VIDEO_PARSER_STATUS) & 0x00000101)) { + (reg_read(dev, VIDEO_FIFO_STATUS) & (0x01010001 << ch)) | + (reg_read(dev, VIDEO_PARSER_STATUS) & (0x00000101 << ch))) { /* DMA Errors - reset channel */ u32 reg; @@ -667,6 +671,7 @@ int tw686x_video_init(struct tw686x_dev *dev) if (err) return err; + reg_write(dev, VIDEO_CONTROL1, 0); /* NTSC, disable scaler */ reg_write(dev, PHASE_REF, 0x00001518); /* Scatter-gather DMA mode */ /* setup required SG table sizes */