mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
spi: bcm2835: Set controller max_speed_hz
Set the struct spi_controller max_speed_hz. This is based on the reported source clock frequency during probe. The maximum bus clock is half the source clock (as per the code in bcm2835_spi_transfer_one). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210107164825.21919-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
72366b3c53
commit
c6892892a9
|
|
@ -1307,6 +1307,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
|
|||
return dev_err_probe(&pdev->dev, PTR_ERR(bs->clk),
|
||||
"could not get clk\n");
|
||||
|
||||
ctlr->max_speed_hz = clk_get_rate(bs->clk) / 2;
|
||||
|
||||
bs->irq = platform_get_irq(pdev, 0);
|
||||
if (bs->irq <= 0)
|
||||
return bs->irq ? bs->irq : -ENODEV;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user