From patchwork Mon Mar 24 19:28:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 3883541 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 497899F2B6 for ; Mon, 24 Mar 2014 19:28:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B03B201F4 for ; Mon, 24 Mar 2014 19:28:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E3B620170 for ; Mon, 24 Mar 2014 19:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbaCXT2H (ORCPT ); Mon, 24 Mar 2014 15:28:07 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:34910 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753687AbaCXT2G (ORCPT ); Mon, 24 Mar 2014 15:28:06 -0400 Received: by mail-ee0-f42.google.com with SMTP id d17so4856082eek.29 for ; Mon, 24 Mar 2014 12:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Ud37DT9rQxLvnGgmEut8c1hA8rnlqUiv6YNwXRjnMio=; b=OWXPYbSQJJZmMKnyk+Hd/HLYvKJZmf0HZsgIEsB/kCW2IiQ6Jk32ItyTJlgh9+63yf Xhj/t3ZqHPfXfZEBYQvuQPGq6u7rntwAsjQesF0kpbMK7jubP7ezgIKkOuN8cz8xkXtx imQF/2gRVCUlacbY4BlKZteTeG+mQP+mkImI94ycSeHbh+BbxYR3OkASQCLr+0urfCmA aXqm0indCh+yyDNFUqQDD7ueBnzhTRHi7UntXPB234E4FkrCKsp378ZpHbMKuMob4OFN +wOkLlAUIpmMXGlcV/qkuszizSZDTXBPOT3qyD+TZRPJhTegtjemNTWZsGcDWnOS8jax tI/A== X-Received: by 10.14.110.199 with SMTP id u47mr6573312eeg.74.1395689285229; Mon, 24 Mar 2014 12:28:05 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-109-91-213-89.unitymediagroup.de. [109.91.213.89]) by mx.google.com with ESMTPSA id 48sm35106271eee.2.2014.03.24.12.28.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 12:28:04 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH v2 4/5] em28xx: remove function em28xx_compression_disable() and its call Date: Mon, 24 Mar 2014 20:28:36 +0100 Message-Id: <1395689316-2397-1-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 em28xx_compression_disable() is a single line function which is called only one time and this call also isn't needed. Register 0x26 is always configured as part of the scaler configuration, which in turn is always done when the resolution changes. And the initial resolution setting is applied at first device open. Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-video.c | 5 ++--- drivers/media/usb/em28xx/em28xx.h | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 0856e5d..a2133d5 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -274,7 +274,7 @@ static void em28xx_capture_area_set(struct em28xx *dev, u8 hstart, u8 vstart, static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v) { - u8 mode; + u8 mode = 0x00; /* the em2800 scaler only supports scaling down to 50% */ if (dev->board.is_em2800) { @@ -293,7 +293,7 @@ static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v) to work correctly */ mode = (h || v) ? 0x30 : 0x00; } - return em28xx_write_reg_bits(dev, EM28XX_R26_COMPR, mode, 0x30); + return em28xx_write_reg(dev, EM28XX_R26_COMPR, mode); } /* FIXME: this only function read values from dev */ @@ -2376,7 +2376,6 @@ static int em28xx_v4l2_init(struct em28xx *dev) (EM28XX_XCLK_AUDIO_UNMUTE | val)); em28xx_set_outfmt(dev); - em28xx_compression_disable(dev); /* Add image controls */ /* NOTE: at this point, the subdevices are already registered, so bridge diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index e95f4eb..dd6190c 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -793,12 +793,6 @@ int em28xx_init_camera(struct em28xx *dev); printk(KERN_WARNING "%s: "fmt,\ dev->name , ##arg); } while (0) -static inline int em28xx_compression_disable(struct em28xx *dev) -{ - /* side effect of disabling scaler and mixer */ - return em28xx_write_reg(dev, EM28XX_R26_COMPR, 0x00); -} - /*FIXME: maxw should be dependent of alt mode */ static inline unsigned int norm_maxw(struct em28xx *dev) {