diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-03-27 20:29:23 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-03-28 21:34:50 +0100 |
commit | bb77c99ee6d3d704086acf141d3ec92601747809 (patch) | |
tree | df889e6e01316ba53c4ab25d1c92ccfae94ea7e7 /drivers/spi/spi-pxa2xx.c | |
parent | spi: pxa2xx: Extract pxa2xx_spi_init_ssp() helper (diff) | |
download | linux-bb77c99ee6d3d704086acf141d3ec92601747809.tar.xz linux-bb77c99ee6d3d704086acf141d3ec92601747809.zip |
spi: pxa2xx: Skip SSP initialization if it's done elsewhere
If SSP has been enumerated elsewhere, skip its initialization
in pxa2xx_spi_init_pdata().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240327193138.2385910-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index e7072727c25c..b01a18c89b6b 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1355,6 +1355,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device *parent = dev->parent; enum pxa_ssp_type type = SSP_UNDEFINED; + struct ssp_device *ssp = NULL; const void *match; bool is_lpss_priv; int status; @@ -1372,6 +1373,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) return ERR_PTR(status); type = (enum pxa_ssp_type)value; + } else { + ssp = pxa_ssp_request(pdev->id, pdev->name); + if (ssp) + type = ssp->type; } /* Validate the SSP type correctness */ @@ -1394,6 +1399,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) pdata->enable_dma = true; pdata->dma_burst_size = 1; + /* If SSP has been already enumerated, use it */ + if (ssp) + return pdata; + status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type); if (status) return ERR_PTR(status); |