Re: [net-next v9 5/6] net: stmmac: Add glue layer for StarFive JH7110 SoC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux