On Wed, 2009-11-25 at 11:53 +0100, ext Grazvydas Ignotas wrote: > On Mon, Nov 23, 2009 at 7:41 PM, TAO HU <tghk48@xxxxxxxxxxxx> wrote: > > Hi, > > > > One idea as below > > > > struct spi_dss_device { > > struct omap_dss_device dss_dev; > > struct spi_dss_dev_priv * spi_data; > > } spi_dss_dev; > > Hm, omap_dss_register_device() takes omap_dss_driver, not > omap_dss_device. Anyway that wouldn't work if there were 2 instances > of same panel in one system I guess, as 2 different spi_data instances > would probe, when there is only one omap_dss_driver. > > Instead I'm thinking to link omap_dss_device with spi in board file > itself by (ab)using platform_data: > > static struct omap_dss_device pandora_lcd_device = { > ... > }; > > struct spi_board_info pandora_spi_board_info = { > .bus_num = 1, > ... > .platform_data = pandora_lcd_device, > }; > > Then in panel driver: > > int spi_probe(struct spi_device *spi) > { > struct omap_dss_device *dssdev = spi->dev.platform_data; > dev_set_drvdata(&dssdev->dev, spi); > } > > static int lcd_probe(struct omap_dss_device *dssdev) > { > struct spi_device *spi = dev_get_drvdata(&dssdev->dev); > } > > Tomi, does that look reasonable to you? Yes, the linking has to be done inside the board file somehow. I need to try this at some point with N900's panel driver, but I think it looks good. I think you could also link it other way around, store the spi_board_info inside the dss_device, but I don't immediately see that this way is better than the other. Tomi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html