[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230328232541.5539bce6@kernel.org>
Date: Tue, 28 Mar 2023 23:25:41 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Guo Samin <samin.guo@...rfivetech.com>
Cc: <linux-kernel@...r.kernel.org>, <linux-riscv@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <netdev@...r.kernel.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Emil Renner Berthing <kernel@...il.dk>,
Jose Abreu <joabreu@...opsys.com>,
Richard Cochran <richardcochran@...il.com>,
Conor Dooley <conor@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Peter Geis <pgwipeout@...il.com>,
Yanhong Wang <yanhong.wang@...rfivetech.com>,
Tommaso Merciai <tomm.merciai@...il.com>
Subject: Re: [net-next v9 5/6] net: stmmac: Add glue layer for StarFive
JH7110 SoC
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.
Powered by blists - more mailing lists