Message ID | 20201217112708.3473-2-kostap@marvell.com |
---|---|
State | New |
Headers | show |
Series | spi: new feature and fix for Marvell Orion driver | expand |
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index b57b8b3cc26e..3bfda4225d45 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -507,6 +507,16 @@ static int orion_spi_transfer_one(struct spi_master *master, static int orion_spi_setup(struct spi_device *spi) { + struct orion_spi *orion_spi = spi_master_get_devdata(spi->master); + + /* + * Make sure the clocks are enabled before + * configuring the SPI controller. + */ + clk_prepare_enable(orion_spi->clk); + if (!IS_ERR(orion_spi->axi_clk)) + clk_prepare_enable(orion_spi->axi_clk); + return orion_spi_setup_transfer(spi, NULL); }