On Tue, Aug 07, 2012 at 12:05:29PM +0300, Tomi Valkeinen wrote: > On Tue, 2012-08-07 at 11:48 +0300, Felipe Balbi wrote: > > > you're not really removing. You're moving cpu_is_* somewhere else. A > > better approach, IMHO, would be to use the DSS_REVISION register to > > differentiate the DSS IP itself, not the OMAP. > > Unfortunately we can't, DSS_REVISION contains bogus information. > > I didn't look at these patches yet, but the idea has been to move the > cpu_is_* checks to only a few central places, not scattered all over. > > At some point we could perhaps either move the cpu_is_ check code to > somewhere under arch/arm, or, more probably, create our own DSS version > IDs which are found out via cpu_is or soc_is or such.
Or you could use the driver_data field on the platform_device_id and
of_device_id structures for that. Something like:
static const struct platform_device_id dss_id_table[] __initconst = {
{
{ "omap2-dss", omap2_dss_features },
{ "omap3-dss", omap3_dss_features },
{ "omap4-dss", omap4_dss_features },
{ "omap5-dss", omap5_dss_features },
{} /* Terminating entry */
};
then, on your probe, you just need to copy id->driver_data to your own
structures so you can reference them later. No need for cpu_is_* or
soc_is_* or machine_is_* anywhere.
On your platform_code, wherever you create the dss device, you need to
fix up the name though. The platform_device name should match
platform_device_id name, not platform_driver name.
--
balbi
signature.asc
Description: Digital signature
