mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 00:47:56 -04:00
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>
This commit is contained in:
committed by
Mark Brown
parent
7290f1e407
commit
bb77c99ee6
@@ -1355,6 +1355,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct device *parent = dev->parent;
|
struct device *parent = dev->parent;
|
||||||
enum pxa_ssp_type type = SSP_UNDEFINED;
|
enum pxa_ssp_type type = SSP_UNDEFINED;
|
||||||
|
struct ssp_device *ssp = NULL;
|
||||||
const void *match;
|
const void *match;
|
||||||
bool is_lpss_priv;
|
bool is_lpss_priv;
|
||||||
int status;
|
int status;
|
||||||
@@ -1372,6 +1373,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
|
|||||||
return ERR_PTR(status);
|
return ERR_PTR(status);
|
||||||
|
|
||||||
type = (enum pxa_ssp_type)value;
|
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 */
|
/* Validate the SSP type correctness */
|
||||||
@@ -1394,6 +1399,10 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
|
|||||||
pdata->enable_dma = true;
|
pdata->enable_dma = true;
|
||||||
pdata->dma_burst_size = 1;
|
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);
|
status = pxa2xx_spi_init_ssp(pdev, &pdata->ssp, type);
|
||||||
if (status)
|
if (status)
|
||||||
return ERR_PTR(status);
|
return ERR_PTR(status);
|
||||||
|
|||||||
Reference in New Issue
Block a user