Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2219300pxb; Fri, 8 Oct 2021 03:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRQ9Kn3kFHWzVE/TystCmsterWQ+ozDtF2xEPg+HtvMvLoFqGFnRqCff+Bv1cMofKuSEct X-Received: by 2002:a17:906:b782:: with SMTP id dt2mr3359562ejb.310.1633688986967; Fri, 08 Oct 2021 03:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633688986; cv=none; d=google.com; s=arc-20160816; b=lCoSVm/86jwh4u3H0R0wyOuyJdGajcD3OnGfl4aKOfaG3YXCXlaXB99jadaw0E3u+a lVTbpgARcOJhAiiR0vwBUuye4aN1a9uuY8HY3qoqNKu2FKVsZOKNpW1Zs540aodGj07r 3xOdsC05jDYe313Cp9lRQJSLdVJ5EY+QPek/20FG4uUb6DyNXO6YqczvXLKwFOM/ABVi 5oQXr1Oj65XHo4Hh/aBWK2FpNcrg/BW6iVOan45eQk20xnBEmlbWkDPAi1zsP6CHWCnq fdZu3alsCC3SB3USSZnuVvTkj7wUOqCNzJq+1Fkevz5Aae0/iv/+1kdP7NHTVagqmiQ2 9hUA== 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=QVSRrvp2HHZulKJKAn8vA/TU6oGCxocDWYjxHQcRosI=; b=0VPgR4cvATDGSNOuoMi6XgYT7sYe23QA9cRo4g4U8MD6tHY/ZwEknXzO8CUVT18CbT 6cUByznzT3vaGVY4GuwRlFHxn3HhhpiRyfN1JekAv4JDsPWWKWHXFuPEV/Rw80JmGL7X 3FQG/hF+f5C8T6XbuFV/Y8o1MhYjOr/z57+2Nn4o+MlNAmFzIiXfIUMWRanKLKecFOG4 CLAAwpiB6eLKUIz01AUcD4eknVfNRa9L2FgntjrpFRtCepffJikjxR5PmRfTgwRKgR1r tBE7esVrSIYjmm93mbHaUmxDHebvPrPICneg1I77dMui5JcCFWasfNTOe9r57QdO/B4Q /uXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=wFFVrO63; 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 br17si2806763ejb.615.2021.10.08.03.29.22; Fri, 08 Oct 2021 03:29:46 -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=wFFVrO63; 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 S236118AbhJHKaC (ORCPT + 99 others); Fri, 8 Oct 2021 06:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbhJHKaA (ORCPT ); Fri, 8 Oct 2021 06:30:00 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2896C061570 for ; Fri, 8 Oct 2021 03:28:05 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3D187581; Fri, 8 Oct 2021 12:28:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1633688883; bh=O/OYayj1ukIAB3FdcOduo8Ue4fDcLxGu5RhxJwuFdC4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wFFVrO633mz76kUAGqZCu/F3OOKQS1ZNBkMG4QklxdKxXoI2j65I6mFVOgx5/NiyR yWtoKRuj7zhS/PfJUby+szUoAgr2WgdEQEQFAIR7/15njlT9H7Fw+M2vQXzhGPBO4o PG8VnU6KuG+nqmsri3fyHRxPJCp9Uh0FFLV98gU0= Date: Fri, 8 Oct 2021 13:27:53 +0300 From: Laurent Pinchart To: Pratyush Yadav Cc: Vinod Koul , 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> <20211007121436.jkck2cue5zd3rys4@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211007121436.jkck2cue5zd3rys4@ti.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pratyush, On Thu, Oct 07, 2021 at 05:44:38PM +0530, Pratyush Yadav wrote: > On 07/10/21 03:10AM, Laurent Pinchart wrote: > > 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. > > FWIW, I think having different drivers would certainly make things > easier to maintain. I'm sorry for not having recommended this in the first place. Any objection from anyone against going in this direction ? > > 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