Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5107760ybe; Tue, 17 Sep 2019 02:45:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+UWb9rhBnAbYhBk2JDD0+hdyXIdB+fTr8mc6apedR/lRm/CpHx7yi2550+SR5g9ioe7Ar X-Received: by 2002:a17:906:3449:: with SMTP id d9mr3800588ejb.111.1568713512800; Tue, 17 Sep 2019 02:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568713512; cv=none; d=google.com; s=arc-20160816; b=jiH0FGySkW3wAzVDWiVgKiUm5ln6cWbVbHCwMCXIj03ghPeVKS/wJp5WDWh5T3BCfb JpsEGLAFYrVQXo6ra+CHWoFD/TP8JaklLp+Hb0vSAKALHfRbqTBT3yzBwTMi6C0RHr/v 12WWtPgP8lrGbZWL4ytj0D+q+git8RNE0OASoMOByYF6Fq8l4yoScj0Srd1Y6tq/uajU 2g+NsWfoT5AIZ3tfO7E85SiuEZ2xhRio4ewVNqnzbw9FoctBKi8Cf0FVATAUzacQISQc XV6jOYFGQV0pailerwxcONxQgxuSJTF5VDmFe7QC9+PJi/XyhpFScHpY1ULtWDLTginm 2N2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vfCZbNLxgpQ0aYm70KfX7N0z9q+cV0ADyeMHi480Xk4=; b=l0gQAikSrJrp25yPYmRkrzAww1E8js8bj1kiofiWgmLopd91b5n+wyAkyGFeDYQzju bNz+WTp2aM38Fs+wWf6J2eKNt6J+mDDuhLCwpQK/jWlCI1B0fVNkB3gPK2RgPtbzJD5L 73cickILqDIJ93DPKTiPfJppCa19c5+Qm8iR6lfDvMrgAH5CH8KECT/5lbimxJsdSczE 7Ol7uNtMCJ/PPYactejnWcPl6DezBfloP1IDiWGQcDbk0omwaXHixZyc+bp8jaooeXGp MAEEJN42izhN65HZY+Xof317rMCUmr8yB3w3/JustOA3skwA98JWZTNfgGHf9tjSUlGr S1dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si1002246edd.112.2019.09.17.02.44.50; Tue, 17 Sep 2019 02:45:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404455AbfIQHO1 (ORCPT + 99 others); Tue, 17 Sep 2019 03:14:27 -0400 Received: from protonic.xs4all.nl ([83.163.252.89]:37942 "EHLO protonic.nl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727126AbfIQHO0 (ORCPT ); Tue, 17 Sep 2019 03:14:26 -0400 Received: from erd987.prtnl (erd987.prtnl [192.168.237.3]) by sparta (Postfix) with ESMTP id 63AC744A009E; Tue, 17 Sep 2019 09:16:27 +0200 (CEST) From: Robin van der Gracht To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Marco Felsch , Philipp Zabel , Andreas Pretzsch , Robin van der Gracht Subject: [PATCH] media: i2c: tvp5150: Fix horizontal crop stop boundry Date: Tue, 17 Sep 2019 09:14:42 +0200 Message-Id: <20190917071442.24986-1-robin@protonic.nl> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The value for AVID stop is relative to the width of the active video area, not the maximum register value. Zero means equal and a negative value means we're cropping on the right side. Signed-off-by: Robin van der Gracht --- drivers/media/i2c/tvp5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index f47cb9a023fb..6bc65ab5e8ab 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1231,10 +1231,10 @@ __tvp5150_set_selection(struct v4l2_subdev *sd, struct v4l2_rect rect) regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_ST_LSB, rect.left | (1 << TVP5150_CROP_SHIFT)); regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_MSB, - (rect.left + rect.width - TVP5150_MAX_CROP_LEFT) >> + (rect.left + rect.width - TVP5150_H_MAX) >> TVP5150_CROP_SHIFT); regmap_write(decoder->regmap, TVP5150_ACT_VD_CROP_STP_LSB, - rect.left + rect.width - TVP5150_MAX_CROP_LEFT); + rect.left + rect.width - TVP5150_H_MAX); } static int tvp5150_set_selection(struct v4l2_subdev *sd, -- 2.20.1