Re: [PATCH v1 3/3] mfd: Add support for Intel Sunrisepoint LPSS devices

From: Mika Westerberg
Date: Wed Apr 29 2015 - 11:44:01 EST


On Wed, Apr 29, 2015 at 04:06:19PM +0100, Lee Jones wrote:
> > >> +static const struct mfd_cell intel_lpss_uart_devs[] = {
> > >> + {
> > >> + .name = "dw_dmac",
> > >> + .num_resources = ARRAY_SIZE(intel_lpss_idma_resources),
> > >> + .resources = intel_lpss_idma_resources,
> > >> + .platform_data = (void *)&intel_lpss_idma_pdata,
> > >> + .pdata_size = sizeof(intel_lpss_idma_pdata),
> > >> + },
> > >> + {
> > >> + .name = "dw-apb-uart",
> > >> + .num_resources = ARRAY_SIZE(intel_lpss_dev_resources),
> > >> + .resources = intel_lpss_dev_resources,
> > >> + },
> > >> +};
> > >> +
> > >> +static const struct mfd_cell intel_lpss_spi_devs[] = {
> > >> + {
> > >> + .name = "dw_dmac",
> > >> + .num_resources = ARRAY_SIZE(intel_lpss_idma_resources),
> > >> + .resources = intel_lpss_idma_resources,
> > >> + .platform_data = (void *)&intel_lpss_idma_pdata,
> > >> + .pdata_size = sizeof(intel_lpss_idma_pdata),
> > >> + },
> > >> + {
> > >> + .name = "pxa2xx-spi",
> > >> + .num_resources = ARRAY_SIZE(intel_lpss_dev_resources),
> > >> + .resources = intel_lpss_dev_resources,
> > >> + },
> > >> +};
> > >> +
> > >> +static DEFINE_IDA(intel_lpss_devid_ida);
> > >
> > > What's wrong with using PLATFORM_DEVID_AUTO?
> >
> > We have to provide right clocks.
> > Is it possible to use AUTO and be sure that right clocks will go to
> > corresponding consumers?
>
> I guess Mike will have to help us with that, as I've never seen it
> done this way before.
>
> I guess you need to create a clock driver and register it properly as
> a platform device.

The reason why we generate the id here is that we need a way to provide
a clock with correct name to host controller and DMA drivers, and that
needs to be done before those two platform devices get created.

Moreover this makes it easy to match right DMA to right host controller
from sysfs as they are always look like:

intel-lpss.X +-> host-controller.X
|
+-> DMA.X

X is the id we generate in the MFD driver.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/