Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp848961pxb; Wed, 6 Oct 2021 17:12:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOPUx0cf4LNQb6ItetyVYyAlSMWEXoL4zuBFEOQPdAn/pFx0mUhTSuGuSmSOnfSl1QDT/C X-Received: by 2002:a63:5956:: with SMTP id j22mr863170pgm.58.1633565529594; Wed, 06 Oct 2021 17:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633565529; cv=none; d=google.com; s=arc-20160816; b=raSvFbyg/ilIT+R7wNcrkRdH/BJilLhD9KmOT2YXk8a9vw/cuD6MXP/vYFVu9Xc8RR 8vjpglD3/esJvvjyQtxzdrwSwHb+a6mwW9SC4lY5//BUL0ds5JwFsLz8c/e0oVvDCUCf zyS3G099Y0v9fpu2TeovzetrlknevEqqDj8932RODAA59Bgeio2cXXCBJLCi2Qg/qOBT GjBLX02l+ufdcj1KSrTgA0uaq1aJ1oI9ur6sCeupWJ8xnr8eGHuxDau3mPzoSyXCaMLY ZOkTcuKOpuRXsG7ric3RyZPi2pP+bxfwUFQsm1yTdvmyg/LDS4LBGPmJjQdbb+i2giz8 pZdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cr7LKagZDJQMiQdZa5eWXwRk3kS9obTp8nyHEF04/4s=; b=cMQ62bJw1wHMoJ4vEvLRprrKVLZlaxuttzzwQApwAsHgpaYKfXIKPTKJyv/2oVGcZY aq/+ds0mc3+ib3JUHZweTBr8FLVPcDQtzv3orW6K1zDpa2oxLYkqFDs87XMtQt4ycD+B P8Dh2oVcjChN7cpp6O9I+c7QhtZLR6PhdUuF18RtERpOUd3nII7XoEa80VJv46UtV85/ 28XB4DFhOBbD5oDahZzi3iyBMuKcxz/XpikkMyjlr9b2g2ZHAFu4KZTREH7066MHqP7B bEo/UuOFto4GMdoL6k3+kf1j1RzBXZ1I/EugE4cWxJg7j9W+lHUNiLRPfoG2WQgQC9+V micg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HxZZ5yYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si8777999pjp.6.2021.10.06.17.11.57; Wed, 06 Oct 2021 17:12:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HxZZ5yYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240048AbhJGAM1 (ORCPT + 99 others); Wed, 6 Oct 2021 20:12:27 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:54686 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240020AbhJGAMN (ORCPT ); Wed, 6 Oct 2021 20:12:13 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C57DF9DC; Thu, 7 Oct 2021 02:10:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1633565415; bh=larLyxcmn+saBabnWqrpHg3AhMf8NdDp0lI84lrL9DQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HxZZ5yYNOrCBDDjM02nPlHH+l+DodzLgVDAlus18uketUhMQdQJeTNaoyWqiTj3om fQtp47GSSMTi11/KuNZ541TorgWraU4Vwhj90Ofnj16uNSWld1hFPcdlD8XrysXao5 rp81lulGGrDuJCfscVUD9xFNh1k2fr1lTUhPanMA= Date: Thu, 7 Oct 2021 03:10:06 +0300 From: Laurent Pinchart To: Vinod Koul Cc: Pratyush Yadav , Paul Kocialkowski , Vignesh Raghavendra , Tomi Valkeinen , Nikhil Devshatwar , Chunfeng Yun , Kishon Vijay Abraham I , Rob Herring , linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Subject: Re: [PATCH v5 2/6] phy: cdns-dphy: Add Rx support Message-ID: References: <20210902185543.18875-1-p.yadav@ti.com> <20210902185543.18875-3-p.yadav@ti.com> <20210917172809.rjtf7ww7vjcfvey5@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On Fri, Oct 01, 2021 at 11:53:16AM +0530, Vinod Koul wrote: > On 17-09-21, 22:58, Pratyush Yadav wrote: > > On 16/09/21 12:22PM, Paul Kocialkowski wrote: > > > On Fri 03 Sep 21, 00:25, Pratyush Yadav wrote: > > > > The Cadence DPHY can be used to receive image data over the CSI-2 > > > > protocol. Add support for Rx mode. The programming sequence differs from > > > > the Tx mode so it is added as a separate set of hooks to isolate the two > > > > paths. The mode in which the DPHY has to be used is selected based on > > > > the compatible. > > > > > > I just realized that I didn't follow-up on a previous revision on the debate > > > about using the phy sub-mode to distinguish between rx/tx. > > > > > > I see that you've been using a dedicated compatible, but I'm not sure this is a > > > good fit either. My understanding is that the compatible should describe a group > > > of register-compatible revisions of a hardware component, not how the hardware > > > is used specifically. I guess the distinction between rx/tx falls under > > > the latter rather than the former. > > > > I am not sure if that is the case. For example, we use "ti,am654-ospi" > > for Cadence Quadspi controller. The default compatible, "cdns,qspi-nor", > > only supports Quad SPI (4 lines). The "ti,am654-ospi" compatible also > > supports Octal SPI (8 lines). > > Those are hardware defaults right? > > > In addition, I feel like the Rx DPHY is almost a different type of > > device from a Tx DPHY. The programming sequence is completely different, > > Is that due to direction or something else..? > > > the clocks required are different, etc. So I think using a different > > compatible for Rx mode makes sense. > > Is the underlaying IP not capable of both TX and RX and in the specific > situations you are using it as TX and RX. > > I am okay that default being TX but you can use Paul's approach of > direction with this to make it better proposal Given that the RX and TX implementations are very different (it's not a matter of selecting a mode at runtime), I'm actually tempted to recommend having two drivers, one for the RX PHY and one for the TX PHY. This can only be done with two different compatible strings, which I think would be a better approach. It's unfortunate that the original compatible string didn't contain "tx". We could rename it and keep the old one in the driver for backward compatibility, making things cleaner going forward. -- Regards, Laurent Pinchart