On Wed, Jun 03, 2015 at 05:07:48PM +0300, Jarkko Nikula wrote: > On 06/03/2015 03:11 PM, Mark Brown wrote: > My idea to detect these newer platforms and set the type accordingly is to > check does the device have named resource "lpss_priv" in a code snip below > @@ -1299,6 +1319,13 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device > *pdev) > if (IS_ERR(ssp->mmio_base)) > return NULL; > > + if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv")) { > + type = LPSS_SPT_SSP; > + pdata->tx_param = pdev->dev.parent; > + pdata->rx_param = pdev->dev.parent; > + pdata->dma_filter = pxa2xx_spi_idma_filter; > + } > + Why not just pass some platform data? The above seems like it's abusing the API a bit and might upset generic code. > ssp->clk = devm_clk_get(&pdev->dev, NULL); > ssp->irq = platform_get_irq(pdev, 0); > ssp->type = type; > That made me thinking can I set the type to LPSS_SPT_SSP and needed DMA > filter directly when acpi_match_device() returns NULL. At quick look it > seems no any other platform device case than our new MFD registration enters > here but have to look at more carefully. That might work too, checking for DT as well would help defensiveness though you'd have to watch out for board file registraitons too since I'm not sure all the PXA platforms were DTified. Or just register the device with a different ID and use that?
Attachment:
signature.asc
Description: Digital signature