Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Mark Brown
bb77c99e 7290f1e4

+9
+9
drivers/spi/spi-pxa2xx.c
··· 1355 1355 struct device *dev = &pdev->dev; 1356 1356 struct device *parent = dev->parent; 1357 1357 enum pxa_ssp_type type = SSP_UNDEFINED; 1358 + struct ssp_device *ssp = NULL; 1358 1359 const void *match; 1359 1360 bool is_lpss_priv; 1360 1361 int status; ··· 1373 1372 return ERR_PTR(status); 1374 1373 1375 1374 type = (enum pxa_ssp_type)value; 1375 + } else { 1376 + ssp = pxa_ssp_request(pdev->id, pdev->name); 1377 + if (ssp) 1378 + type = ssp->type; 1376 1379 } 1377 1380 1378 1381 /* Validate the SSP type correctness */ ··· 1398 1393 pdata->num_chipselect = 1; 1399 1394 pdata->enable_dma = true; 1400 1395 pdata->dma_burst_size = 1; 1396 + 1397 + /* If SSP has been already enumerated, use it */ 1398 + if (ssp) 1399 + return pdata; 1401 1400 1402 1401 status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type); 1403 1402 if (status)