Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp95213pxb; Fri, 16 Apr 2021 00:06:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrtbgyEjwyW9ahqnSJ4IXxNhY0Dnf2goeq+eQ6JfeJX48948O0xOPRBoU5MgRklSA7S47P X-Received: by 2002:aa7:9191:0:b029:256:898f:150 with SMTP id x17-20020aa791910000b0290256898f0150mr6970310pfa.74.1618556779401; Fri, 16 Apr 2021 00:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618556779; cv=none; d=google.com; s=arc-20160816; b=kU5mlPrB2mkk1FH2rx/hCQPGkAjkkdQut9LtrEETCfBNxNJ7sqwZrno4tfCX+nVJmo 60Qal5MNxHBzhCnVrrq1qK2GSSYJDepF6yOwAFWE00nJ1tsfQejxSdb29lUhZq5Nx6lQ ArGZkUZwQvDSDvC+9ag0qIgcHHgRDxGeb4IaGF/jAZCgD33F9+dl+SA/uHZyiLMP1do3 h3PiRtespRZw0ndMh306cUUUAm9OerHQDWa9bhY1SH9Ai5KcqodiM9/jSmT7p6Wl/6jE Su4XutBZp1P2BG8nbgrg8fxcEqVJEqP+NZaou+4YaMaf5N4e23hZTMYcZ8/iZGXttrah OT0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=xiYEHWheG8Mt8/YuNhmmBjWD0NSeUFT2CL7Ac9QXA8k=; b=etb7HcqLeglNJjEc0thbho17xAirLCMu+ebjVz0ClL49fJx2noGcRsBKktXLqbPEXB aqpDTcOGQmPKE+yVksFJy4754YpDs+Hka2U5+a8/m+3vPyN01tRqpBEXwHVAwLDhLQPl pFttU6WS4LLgeSv1MzGxgxYj3dsL8MLQR5uloBnzUPl8cMGXVrLnFRXj8pReYLTTTC01 4hGL7w/WBO1CjKgQAq6eUIMWBT3wbDJ/Pov+wB+WwBRF5JnupCJ0K7w1MPhsQ4GSA0et z6aSqiRtwzWi+pzERhf3h3A0an2HDJths8tHjZDCEAbDesKTKv49bl38dITgK97BAj+F FG2w== ARC-Authentication-Results: i=1; mx.google.com; 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 20si5596858pgx.542.2021.04.16.00.06.07; Fri, 16 Apr 2021 00:06:19 -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; 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 S239201AbhDPG6v (ORCPT + 99 others); Fri, 16 Apr 2021 02:58:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239192AbhDPG6s (ORCPT ); Fri, 16 Apr 2021 02:58:48 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 874ECC061574 for ; Thu, 15 Apr 2021 23:58:23 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXIQR-0002Eu-BI; Fri, 16 Apr 2021 08:57:59 +0200 Received: from [IPv6:2a03:f580:87bc:d400:b21a:a98c:8cd:ce9c] (unknown [IPv6:2a03:f580:87bc:d400:b21a:a98c:8cd:ce9c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mkl@blackshift.org", Issuer "StartCom Class 1 Client CA" (not verified)) (Authenticated sender: mkl@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id BCC8A60FF93; Fri, 16 Apr 2021 06:57:55 +0000 (UTC) Subject: Re: [PATCH v2 2/2] can: m_can: Add support for transceiver as phy To: Aswath Govindraju Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, Wolfgang Grandegger , Rob Herring , "David S . Miller" , Jakub Kicinski , Chandrasekar Ramakrishnan , Kishon Vijay Abraham I , Lokesh Vutla , Vignesh Raghavendra , Grygorii Strashko , Faiz Abbas References: <20210415154635.30094-1-a-govindraju@ti.com> <20210415154635.30094-3-a-govindraju@ti.com> From: Marc Kleine-Budde Autocrypt: addr=mkl@pengutronix.de; prefer-encrypt=mutual; keydata= mQINBFFVq30BEACtnSvtXHoeHJxG6nRULcvlkW6RuNwHKmrqoksispp43X8+nwqIFYgb8UaX zu8T6kZP2wEIpM9RjEL3jdBjZNCsjSS6x1qzpc2+2ivjdiJsqeaagIgvy2JWy7vUa4/PyGfx QyUeXOxdj59DvLwAx8I6hOgeHx2X/ntKAMUxwawYfPZpP3gwTNKc27dJWSomOLgp+gbmOmgc 6U5KwhAxPTEb3CsT5RicsC+uQQFumdl5I6XS+pbeXZndXwnj5t84M+HEj7RN6bUfV2WZO/AB Xt5+qFkC/AVUcj/dcHvZwQJlGeZxoi4veCoOT2MYqfR0ax1MmN+LVRvKm29oSyD4Ts/97cbs XsZDRxnEG3z/7Winiv0ZanclA7v7CQwrzsbpCv+oj+zokGuKasofzKdpywkjAfSE1zTyF+8K nxBAmzwEqeQ3iKqBc3AcCseqSPX53mPqm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 vBwerBZL94I3QuPLAHptgG8zPGVzNKoAzxjlaxI1MfqAD9XUM80MYBVjunIQlkU/AubdvmMY X7hY1oMkTkC5hZNHLgIsDvWUG0g3sACfqF6gtMHY2lhQ0RxgxAEx+ULrk/svF6XGDe6iveyc z5Mg5SUggw3rMotqgjMHHRtB3nct6XqgPXVDGYR7nAkXitG+nyG5zWhbhRDglVZ0mLlW9hij z3Emwa94FaDhN2+1VqLFNZXhLwrNC5mlA6LUjCwOL+zb9a07HyjekLyVAdA6bZJ5BkSXJ1CO 5YeYolFjr4YU7GXcSVfUR6fpxrb8N+yH+kJhY3LmS9vb2IXxneE/ESkXM6a2YAZWfW8sgwTm 0yCEJ41rW/p3UpTV9wwE2VbGD1XjzVKl8SuAUfjjcGGys3yk5XQ5cccWTCwsVdo2uAcY1MVM HhN6YJjnMqbFoHQq0H+2YenTlTBn2Wsp8TIytE1GL6EbaPWbMh3VLRcihlMj28OUWGSERxat xlygDG5cBiY3snN3xJyBroh5xk/sHRgOdHpmujnFyu77y4RTZ2W8 Message-ID: <48eb6865-857c-78b4-8fd1-878fcc3da43d@pengutronix.de> Date: Fri, 16 Apr 2021 08:57:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210415154635.30094-3-a-govindraju@ti.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IR4DSMc4fUohNh8mGIVX9vQJxJtDUXfHn" X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IR4DSMc4fUohNh8mGIVX9vQJxJtDUXfHn Content-Type: multipart/mixed; boundary="esjrgWRct3qJVhF8TeT9Ra4cor9vBvAB7"; protected-headers="v1" From: Marc Kleine-Budde To: Aswath Govindraju Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, Wolfgang Grandegger , Rob Herring , "David S . Miller" , Jakub Kicinski , Chandrasekar Ramakrishnan , Kishon Vijay Abraham I , Lokesh Vutla , Vignesh Raghavendra , Grygorii Strashko , Faiz Abbas Message-ID: <48eb6865-857c-78b4-8fd1-878fcc3da43d@pengutronix.de> Subject: Re: [PATCH v2 2/2] can: m_can: Add support for transceiver as phy References: <20210415154635.30094-1-a-govindraju@ti.com> <20210415154635.30094-3-a-govindraju@ti.com> In-Reply-To: <20210415154635.30094-3-a-govindraju@ti.com> --esjrgWRct3qJVhF8TeT9Ra4cor9vBvAB7 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 4/15/21 5:46 PM, Aswath Govindraju wrote: > From: Faiz Abbas >=20 > Add support for implementing transceiver node as phy. The max_bitrate i= s > obtained by getting a phy attribute. >=20 > Signed-off-by: Faiz Abbas > Signed-off-by: Aswath Govindraju > --- > drivers/net/can/m_can/m_can.c | 10 ++++++++++ > drivers/net/can/m_can/m_can.h | 2 ++ > drivers/net/can/m_can/m_can_platform.c | 13 +++++++++++++ > 3 files changed, 25 insertions(+) >=20 > diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_ca= n.c > index 34073cd077e4..7d31250446c2 100644 > --- a/drivers/net/can/m_can/m_can.c > +++ b/drivers/net/can/m_can/m_can.c > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > =20 > #include "m_can.h" > =20 > @@ -1514,6 +1515,7 @@ static void m_can_stop(struct net_device *dev) > static int m_can_close(struct net_device *dev) > { > struct m_can_classdev *cdev =3D netdev_priv(dev); > + int err; > =20 > netif_stop_queue(dev); > =20 > @@ -1536,6 +1538,10 @@ static int m_can_close(struct net_device *dev) > close_candev(dev); > can_led_event(dev, CAN_LED_EVENT_STOP); > =20 > + err =3D phy_power_off(cdev->transceiver); > + if (err) > + return err; > + > return 0; > } > =20 > @@ -1720,6 +1726,10 @@ static int m_can_open(struct net_device *dev) > struct m_can_classdev *cdev =3D netdev_priv(dev); > int err; > =20 > + err =3D phy_power_on(cdev->transceiver); > + if (err) > + return err; > + > err =3D m_can_clk_start(cdev); > if (err) > return err; > diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_ca= n.h > index ace071c3e58c..38cad068abad 100644 > --- a/drivers/net/can/m_can/m_can.h > +++ b/drivers/net/can/m_can/m_can.h > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > =20 > /* m_can lec values */ > enum m_can_lec_type { > @@ -82,6 +83,7 @@ struct m_can_classdev { > struct workqueue_struct *tx_wq; > struct work_struct tx_work; > struct sk_buff *tx_skb; > + struct phy *transceiver; > =20 > struct can_bittiming_const *bit_timing; > struct can_bittiming_const *data_timing; > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m= _can/m_can_platform.c > index 599de0e08cd7..82d4f1a15dd7 100644 > --- a/drivers/net/can/m_can/m_can_platform.c > +++ b/drivers/net/can/m_can/m_can_platform.c > @@ -6,6 +6,7 @@ > // Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.t= i.com/ > =20 > #include > +#include > =20 > #include "m_can.h" > =20 > @@ -67,6 +68,7 @@ static int m_can_plat_probe(struct platform_device *p= dev) > struct resource *res; > void __iomem *addr; > void __iomem *mram_addr; > + struct phy *transceiver; > int irq, ret =3D 0; > =20 > mcan_class =3D m_can_class_allocate_dev(&pdev->dev, > @@ -101,6 +103,16 @@ static int m_can_plat_probe(struct platform_device= *pdev) > goto probe_fail; > } > =20 > + transceiver =3D devm_phy_optional_get(&pdev->dev, NULL); > + if (IS_ERR(transceiver)) { > + ret =3D PTR_ERR(transceiver); > + dev_err(&pdev->dev, "error while getting phy, err=3D%d\n", ret); please use dev_err_probe(), as the probing might be deferred and this is = not an error. > + return ret; > + } > + > + if (transceiver) > + priv->cdev.can.bitrate_max =3D transceiver->attrs.max_link_rate; > + > priv->base =3D addr; > priv->mram_base =3D mram_addr; > =20 > @@ -108,6 +120,7 @@ static int m_can_plat_probe(struct platform_device = *pdev) > mcan_class->pm_clock_support =3D 1; > mcan_class->can.clock.freq =3D clk_get_rate(mcan_class->cclk); > mcan_class->dev =3D &pdev->dev; > + mcan_class->transceiver =3D transceiver; > =20 > mcan_class->ops =3D &m_can_plat_ops; > =20 >=20 Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --esjrgWRct3qJVhF8TeT9Ra4cor9vBvAB7-- --IR4DSMc4fUohNh8mGIVX9vQJxJtDUXfHn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmB5NXAACgkQqclaivrt 76nj9Af/TXX+wO0iBN6ayh6oYbeW5wgvdVc32H75shC4IH6n9/6Bx7EoB/QtHn6j 0g1KQJw1QC/USvo4QBbKGImABeawzEwtzpiSpP+H6IzDvvzFjZatI7/sl8BlVAPr aPYUZ/nZ5FgGi7BgEf12gqamgH4ePhbCKJty9v5Hr0FtUAyqanBBoAL7vS7cV47j RafsqGT0fByKKUahNlmVAKSjwHTAsogcquYZehP6NWB8uhqYhVhekk4myo2YTzwP OlVC9I4rWhOOfQP29Fh3TS1ECNdI079PWpmRaMZHOSswdwrTjXUkstZ0DawGE6rp +HZEhhJY/YiazpCeNicgSMhzkyJA6g== =FQ/6 -----END PGP SIGNATURE----- --IR4DSMc4fUohNh8mGIVX9vQJxJtDUXfHn--