netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Guo Samin <samin.guo@starfivetech.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Jose Abreu <joabreu@synopsys.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Conor Dooley <conor@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Peter Geis <pgwipeout@gmail.com>,
	Yanhong Wang <yanhong.wang@starfivetech.com>,
	Tommaso Merciai <tomm.merciai@gmail.com>
Subject: Re: [net-next v9 5/6] net: stmmac: Add glue layer for StarFive JH7110 SoC
Date: Tue, 28 Mar 2023 23:25:41 -0700	[thread overview]
Message-ID: <20230328232541.5539bce6@kernel.org> (raw)
In-Reply-To: <f8be0cf7-fe78-7e63-7fbc-78d083a9f186@starfivetech.com>

On Wed, 29 Mar 2023 10:57:00 +0800 Guo Samin wrote:
> static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed)
> {
>         struct starfive_dwmac *dwmac = priv;
>         unsigned long rate;
>         int err;
> 
> 	rate = clk_get_rate(dwmac->tx_clk);
> 
>         switch (speed) {
>         case SPEED_1000:
>                 rate = 125000000;
>                 break;
>         case SPEED_100:
>                 rate = 25000000;
>                 break;
>         case SPEED_10:
>                 rate = 2500000;
>                 break;
>         default:
>                 dev_err(dwmac->dev, "invalid speed %u\n", speed);
>                 break;
>         }   
> 
>         err = clk_set_rate(dwmac->clk_tx, rate);
>         if (err)
>                 dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
> }
> 
> What do you think?

Yup, that's even better.

  reply	other threads:[~2023-03-29  6:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28  6:20 [net-next v9 0/6] Add Ethernet driver for StarFive JH7110 SoC Samin Guo
2023-03-28  6:20 ` [net-next v9 1/6] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version Samin Guo
2023-03-28  6:20 ` [net-next v9 2/6] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string Samin Guo
2023-03-28  6:20 ` [net-next v9 3/6] dt-bindings: net: snps,dwmac: Add 'ahb' reset/reset-name Samin Guo
2023-03-28  6:20 ` [net-next v9 4/6] dt-bindings: net: Add support StarFive dwmac Samin Guo
2023-04-05  6:34   ` Krzysztof Kozlowski
2023-04-07  1:59     ` Guo Samin
2023-03-28  6:20 ` [net-next v9 5/6] net: stmmac: Add glue layer for StarFive JH7110 SoC Samin Guo
2023-03-29  2:17   ` Jakub Kicinski
2023-03-29  2:57     ` Guo Samin
2023-03-29  6:25       ` Jakub Kicinski [this message]
2023-03-28  6:20 ` [net-next v9 6/6] net: stmmac: starfive-dmac: Add phy interface settings Samin Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230328232541.5539bce6@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pgwipeout@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=samin.guo@starfivetech.com \
    --cc=tomm.merciai@gmail.com \
    --cc=yanhong.wang@starfivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).