From patchwork Wed Mar 6 11:26:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10840909 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0D6E139A for ; Wed, 6 Mar 2019 11:26:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AF5928ACB for ; Wed, 6 Mar 2019 11:26:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D7F02D732; Wed, 6 Mar 2019 11:26:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0040428ACB for ; Wed, 6 Mar 2019 11:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728689AbfCFL0g (ORCPT ); Wed, 6 Mar 2019 06:26:36 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47133 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbfCFL0g (ORCPT ); Wed, 6 Mar 2019 06:26:36 -0500 X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id F2E0B240014; Wed, 6 Mar 2019 11:26:32 +0000 (UTC) From: Jacopo Mondi To: laurent.pinchart@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, kieran.bingham@ideasonboard.com Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH] media: adv748x: Don't disable CSI-2 on link_setup Date: Wed, 6 Mar 2019 12:26:59 +0100 Message-Id: <20190306112659.8310-1-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When both the media links between AFE and HDMI and the two TX CSI-2 outputs gets disabled, the routing register ADV748X_IO_10 gets zeroed causing both TXA and TXB output to get disabled. This causes some HDMI transmitters to stop working after both AFE and HDMI links are disabled. Fix this by preventing writing 0 to ADV748X_IO_10 register, which gets only updated when links are enabled again. Fixes: 9423ca350df7 ("media: adv748x: Implement TX link_setup callback") Signed-off-by: Jacopo Mondi --- The issue presents itself only on some HDMI transmitters, and went unnoticed during the development of: "[PATCH v3 0/6] media: adv748x: Implement dynamic routing support" Patch intended to be applied on top of latest media-master, where the "[PATCH v3 0/6] media: adv748x: Implement dynamic routing support" series is applied. The patch reports a "Fixes" tag, but should actually be merged with the above mentioned series. Thanks j --- drivers/media/i2c/adv748x/adv748x-core.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c index f57cd77a32fa..0e5a75eb6d75 100644 --- a/drivers/media/i2c/adv748x/adv748x-core.c +++ b/drivers/media/i2c/adv748x/adv748x-core.c @@ -354,6 +354,9 @@ static int adv748x_link_setup(struct media_entity *entity, tx->src = enable ? rsd : NULL; + if (!enable) + return 0; + if (state->afe.tx) { /* AFE Requires TXA enabled, even when output to TXB */ io10 |= ADV748X_IO_10_CSI4_EN;