From mboxrd@z Thu Jan 1 00:00:00 1970 From: Faiz Abbas Subject: Re: [PATCH 1/6] phy: Add max_bitrate attribute & phy_get_max_bitrate() Date: Mon, 5 Nov 2018 11:57:41 +0530 Message-ID: References: <20181102192616.28291-1-faiz_abbas@ti.com> <20181102192616.28291-2-faiz_abbas@ti.com> <5e1a0b67-510a-5512-d477-0b363e4733fe@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5e1a0b67-510a-5512-d477-0b363e4733fe@pengutronix.de> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Marc Kleine-Budde , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org Cc: wg@grandegger.com, robh+dt@kernel.org, mark.rutland@arm.com, kishon@ti.com List-Id: devicetree@vger.kernel.org Hi Marc, On Saturday 03 November 2018 03:06 PM, Marc Kleine-Budde wrote: > On 11/02/2018 08:26 PM, Faiz Abbas wrote: >> In some subsystems (eg. CAN) the physical layer capabilities are >> the limiting factor in the datarate of the device. Typically, the >> physical layer transceiver does not provide a way to discover this >> limitation at runtime. Thus this information needs to be represented as >> a phy attribute which is read from the device tree. >> >> Therefore, add an optional max_bitrate attribute to the generic phy >> sybsystem. Also add the complementary API which enables the consumer >> to get max_bitrate. >> >> Signed-off-by: Faiz Abbas > > NACK - We already have such a functionality in the CAN subsystem. > Please have a look at the patches: > > e759c626d826 can: m_can: Support higher speed CAN-FD bitrates > b54f9eea7667 dt-bindings: can: m_can: Document new can transceiver binding > 2290aefa2e90 can: dev: Add support for limiting configured bitrate > 54a7fbcc17bc dt-bindings: can: can-transceiver: Document new binding > I remove the transceiver child node binding documentation in patch 5/6. The existing implementation is pretty limiting as it just has a child node with no associated device. What if a transceiver requires its own configurations before it can start sending/receiving messages (for example, my usecase requires it to pull the standby line low)? I think that can be solved by implementing the transceiver as a phy and exposing a generic get_max_bitrate API. That way, the transceiver device can do all its startup configuration in the phy probe function. In any case, do suggest if you have a better idea on how to implement pull gpio low requirement. Thanks, Faiz