Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1969900ima; Thu, 25 Oct 2018 07:44:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5cCH+YZHNorrONF7EXeq0/YbCh616RDELWk7IwqR1r8PEvT1xwTV++eqq4ZUmd4rJKvup+4 X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr1797582plk.333.1540478669857; Thu, 25 Oct 2018 07:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478669; cv=none; d=google.com; s=arc-20160816; b=DH26+rYl/6Avj6h4qRZRsc+a5IrUKvK9F8qcR5voMIYG6rvZpvwckvdqnfw0Bz9VRH CFcnRh2ROvloIjk/J0Plfki0WDClYjDJ0FHCb5GbYoRrJx01q/nzxQhmGyD9ZTlFdfgr gkq9d8uXKpP7mXA6ruN4UUbrLlbTYBNE3VDfYGEvJRALdNbx2ZLB3vNkGJk4m2iVPEo5 pHGNHXqnyZvKeVf3Cp9woGVb1hI9v/Fk3dXmVmuqpP8oigNuip7Lrhe3NIxJJZwBByfg CWIP5xf3HDb91sbpwgY8f5iTUVGaOB0WN9moYViKrnaIkJwiWojK1Hc8vhn1eWywzGIo krUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=gwgLand+yKlpA1nJOiyL/e4R7PFEVodQ9uZk6qeVbUo=; b=CDQMZaqLj0tSMYrQCsIin7rODNQrHNFJM9BG5/62+1nRQRm5ZH4fnASrulFiISVDlg A5RWA7JkLuiTqVETLukjPI3SozkLcokHLYDDjVJT9yu1zCJikrLU00XFwXGwc9yWJ/yX Q/WZQ36zTlwwGbrYg0uXG77IsrtHolzxzoFiZBYEVQJuqitFfikdxXDAsQYfImLR6Jxv aHyQUTIJtFcOggmi8gtDJYyxk5cxpy3wGVFzwfJpBOKYZRmOhldanPiyrVzX27diQ8qR swc40T2z/d+lCZOSnifPv5NBTNRuPJYEaWRuVlx1S1f39ojhmo1v36epT4lYfJ9ZMT56 iAiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RmhpEE1k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11-v6si8515795pgj.409.2018.10.25.07.44.12; Thu, 25 Oct 2018 07:44:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=RmhpEE1k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbeJYXOg (ORCPT + 99 others); Thu, 25 Oct 2018 19:14:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728864AbeJYWsR (ORCPT ); Thu, 25 Oct 2018 18:48:17 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3023D20834; Thu, 25 Oct 2018 14:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476921; bh=De1kYG3U43zttpm4yxRbXwflxtux71hpDQwk6WJmLEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RmhpEE1k3sY9vRljaiC1vrz80GMhHFog+9oCjHjZKXP9FmsrbqS+v+aHEoSc2W7ec J6wCPo/fPBNPGp+813QVpCBQKvHyn44WmVVYKfRr8Gu0a7algqvV3B1rogLmxC7k62 rsI08VRqPsTtUBZBCukgJ36Xm+ocdRNg1cSN1jXo= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Vasut , Steve Longerbeam , Philipp Zabel , Sasha Levin Subject: [PATCH AUTOSEL 4.9 38/98] gpu: ipu-v3: Fix CSI selection for VDIC Date: Thu, 25 Oct 2018 10:13:23 -0400 Message-Id: <20181025141423.213774-38-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit b7dfee2433576f1f030cb84cdb04b70f36554992 ] The description of the CSI_SEL bit in the i.MX6 reference manual is incorrect. It states "This bit defines which CSI is the input to the IC. This bit is effective only if IC_INPUT is bit cleared". From experiment it was found this is in fact not correct. The CSI_SEL bit selects which CSI is input to _both_ the VDIC _and_ the IC. If the IC_INPUT bit is set so that the IC is receiving from the VDIC, the IC ignores the CSI_SEL bit, but CSI_SEL still selects which CSI the VDIC receives from in that case. Signed-off-by: Marek Vasut Signed-off-by: Steve Longerbeam Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-common.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index b9539f7c5e9a..99c813a4ec1f 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -715,15 +715,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi) spin_lock_irqsave(&ipu->lock, flags); val = ipu_cm_read(ipu, IPU_CONF); - if (vdi) { + if (vdi) val |= IPU_CONF_IC_INPUT; - } else { + else val &= ~IPU_CONF_IC_INPUT; - if (csi_id == 1) - val |= IPU_CONF_CSI_SEL; - else - val &= ~IPU_CONF_CSI_SEL; - } + + if (csi_id == 1) + val |= IPU_CONF_CSI_SEL; + else + val &= ~IPU_CONF_CSI_SEL; + ipu_cm_write(ipu, val, IPU_CONF); spin_unlock_irqrestore(&ipu->lock, flags); -- 2.17.1