From patchwork Tue Mar 14 11:55:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav Achath X-Patchwork-Id: 69537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1719145wrd; Tue, 14 Mar 2023 05:12:54 -0700 (PDT) X-Google-Smtp-Source: AK7set/lDXTwPuaVR8+ne9sGPIX3zNAt5HF7CfBrN08mCnSxZBGHPayHWI1yszd+jxDPZKIY9cvs X-Received: by 2002:a05:6a20:3d03:b0:d5:58df:fb80 with SMTP id y3-20020a056a203d0300b000d558dffb80mr2903606pzi.62.1678795974412; Tue, 14 Mar 2023 05:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678795974; cv=none; d=google.com; s=arc-20160816; b=Avyv+YCT6KqmXfTiOb5aC9/gXRs8Gl1wv02TAoByR/qEgG4IH84RHIEfpTJVxc37nm 1A85El4bQPmGuWVysfHQsqgknyeciXxL2AFhj+/cjVmM5DLWatYN2NsUdG6UTXqlAmqs fmwgUO74mi3zADM6YJlh5nsV8RKo1axPciHep6v6oj2X/yr6Amc7evGiFXKCG9+lZPXk wPzX6+cORspcOLyhIACqgOk1ffJYxXw8qq3uI+2WASCqsG2IhhyNvVYvR9aJY6hrGrLH v5SkzHKxURwJ66Xt7jFSnf4mFAm5ha9G+yM0Wxstbu7I8yq5YS6yOF+5263ciKWiztz1 GOXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kdF/1Nr7CR+dcXyDeXuh/C6QNDhPFPgYOllESZB4OZ4=; b=fWcnGX0wIbW836CBOZSl5Cp45isvJfrNDx7zQK+L/DH4h7EVNrMuShNvn2GoITGKPV acDetsMQUlLQKLPxVPVSkWO+MZpdpX32hE7zGYADn4/WXKD0ZF0Jzlbni+utjq1ULgiI ltv+PQp93kkD91i6N8RiLYNeVDIOtOUNkc2o52wpER8bJ9HrThYo2eNGGtfc+gNFlQm0 ydsahm7UlRG6D6Ond9jNTTod0DZXIvFbHWcph1eLUwwzVB+InTP3PoYqw+QVznGIw0eX CsiCjMhplBNIIkJ+vePKTDAXAVezcnIWzS8smR6hLEESR4pT+EtsjiLioSlFZ6XyxeB6 /QcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DcCSyk8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a623207000000b005a8a1ea9ab9si2034758pfy.370.2023.03.14.05.12.38; Tue, 14 Mar 2023 05:12:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DcCSyk8q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231666AbjCNL40 (ORCPT + 99 others); Tue, 14 Mar 2023 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231624AbjCNL4Q (ORCPT ); Tue, 14 Mar 2023 07:56:16 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D3E9FBF7; Tue, 14 Mar 2023 04:55:58 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtW4H118702; Tue, 14 Mar 2023 06:55:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678794932; bh=kdF/1Nr7CR+dcXyDeXuh/C6QNDhPFPgYOllESZB4OZ4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=DcCSyk8qVBfM9unK0eM0tYrgH88ngjb+uA9q0lTeK8E4fPGdLZC2JwH9jQZloMKjq ByWilbPQ5JX5TOFlkOH+1MiQVn2aIMRq36XOI7Bs1egTuBtPXFNaOWG+GSaZhPpLgM ipoOMVZkbwhi3eK1nB70CCLuyGWrYVzgMiRTuorg= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32EBtWu4003059 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Mar 2023 06:55:32 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 14 Mar 2023 06:55:32 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 14 Mar 2023 06:55:32 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtUTP002389; Tue, 14 Mar 2023 06:55:31 -0500 From: Vaishnav Achath To: , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v7 07/13] media: cadence: csi2rx: Fix stream data configuration Date: Tue, 14 Mar 2023 17:25:10 +0530 Message-ID: <20230314115516.667-8-vaishnav.a@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230314115516.667-1-vaishnav.a@ti.com> References: <20230314115516.667-1-vaishnav.a@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760345167885748213?= X-GMAIL-MSGID: =?utf-8?q?1760345167885748213?= From: Pratyush Yadav Firstly, there is no VC_EN bit present in the STREAM_DATA_CFG register. Bit 31 is part of the VL_SELECT field. Remove it completely. Secondly, it makes little sense to enable ith virtual channel for ith stream. Sure, there might be a use-case that demands it. But there might also be a use case that demands all streams to use the 0th virtual channel. Prefer this case over the former because it is less arbitrary and also makes it very clear what the limitations of the current driver is instead of giving a false impression that multiple virtual channels are supported. Signed-off-by: Pratyush Yadav Signed-off-by: Vaishnav Achath Reviewed-by: Laurent Pinchart --- (no changes since v1) drivers/media/platform/cadence/cdns-csi2rx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index e80220840e93..f8ce9360bfb0 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -48,7 +48,6 @@ #define CSI2RX_STREAM_STATUS_RDY BIT(31) #define CSI2RX_STREAM_DATA_CFG_REG(n) (CSI2RX_STREAM_BASE(n) + 0x008) -#define CSI2RX_STREAM_DATA_CFG_EN_VC_SELECT BIT(31) #define CSI2RX_STREAM_DATA_CFG_VC_SELECT(n) BIT((n) + 16) #define CSI2RX_STREAM_CFG_REG(n) (CSI2RX_STREAM_BASE(n) + 0x00c) @@ -269,8 +268,11 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) writel(CSI2RX_STREAM_CFG_FIFO_MODE_LARGE_BUF, csi2rx->base + CSI2RX_STREAM_CFG_REG(i)); - writel(CSI2RX_STREAM_DATA_CFG_EN_VC_SELECT | - CSI2RX_STREAM_DATA_CFG_VC_SELECT(i), + /* + * Enable one virtual channel. When multiple virtual channels + * are supported this will have to be changed. + */ + writel(CSI2RX_STREAM_DATA_CFG_VC_SELECT(0), csi2rx->base + CSI2RX_STREAM_DATA_CFG_REG(i)); writel(CSI2RX_STREAM_CTRL_START,