Re: DSS2 panel question
* Grazvydas Ignotas [091125 12:23]: > On Wed, Nov 25, 2009 at 7:44 PM, TAO HU wrote: > > Hi, Grazvydas Ignotas > > > > What did you mean "Hm, omap_dss_register_device() takes omap_dss_driver"? > > Whoops, I meant omap_dss_register_driver() > > > Below is what I saw from the code > > int omap_dss_register_device(struct omap_dss_device *dssdev) > > > > I assume the code I have is for DSS. Does DSS2 change the API? > > I was referring to version that is being submitted to mainline, and > panel drivers in particular, like: > http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=drivers/video/omap2/displays/panel-generic.c;h=eb48d1afd8008437458bb3fe87e351b5ce785c42;hb=HEAD > > > BTW, what's the location for DSS2 code in linux-omap tree? Seems not > > see it anywhere > > Tony is probably waiting for it to reach mainline and fall from there. Pulled Tomi's for-next now into linux-omap master branch for some last testing before the merge window starts :) Tony -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
On Wed, 2009-11-25 at 11:53 +0100, ext Grazvydas Ignotas wrote: > On Mon, Nov 23, 2009 at 7:41 PM, TAO HU 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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
On Wed, Nov 25, 2009 at 7:44 PM, TAO HU wrote: > Hi, Grazvydas Ignotas > > What did you mean "Hm, omap_dss_register_device() takes omap_dss_driver"? Whoops, I meant omap_dss_register_driver() > Below is what I saw from the code > int omap_dss_register_device(struct omap_dss_device *dssdev) > > I assume the code I have is for DSS. Does DSS2 change the API? I was referring to version that is being submitted to mainline, and panel drivers in particular, like: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=drivers/video/omap2/displays/panel-generic.c;h=eb48d1afd8008437458bb3fe87e351b5ce785c42;hb=HEAD > BTW, what's the location for DSS2 code in linux-omap tree? Seems not > see it anywhere Tony is probably waiting for it to reach mainline and fall from there. > > - Hu Tao > > > On Wed, Nov 25, 2009 at 6:53 PM, Grazvydas Ignotas wrote: >> On Mon, Nov 23, 2009 at 7:41 PM, TAO HU 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? >> > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
Hi, Grazvydas Ignotas What did you mean "Hm, omap_dss_register_device() takes omap_dss_driver"? Below is what I saw from the code int omap_dss_register_device(struct omap_dss_device *dssdev) I assume the code I have is for DSS. Does DSS2 change the API? BTW, what's the location for DSS2 code in linux-omap tree? Seems not see it anywhere - Hu Tao On Wed, Nov 25, 2009 at 6:53 PM, Grazvydas Ignotas wrote: > On Mon, Nov 23, 2009 at 7:41 PM, TAO HU 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? > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
On Mon, Nov 23, 2009 at 7:41 PM, TAO HU 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? -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
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; spi_dss_probe.c spi_probe(spi_device * spi) { spi_dss_dev. spi_data = spi; omap_dss_register_device((spi_ device *) &spi_dss_dev); } spi_dss_drv.c spi_dss_drv_probe(omap_dss_device * dev) { my_spi_dss_dev = container_of(dev, struct spi_dss_device, dss_dev); spi_data = my_spi_dss_dev; } - Hu Tao On Mon, Nov 23, 2009 at 7:04 PM, Tomi Valkeinen wrote: > > On Sat, 2009-11-21 at 16:16 +0100, ext Grazvydas Ignotas wrote: > > Hello, > > > > I've been updating Pandora's panel for upstream-going DSS2, which now > > uses device/device_driver model for panels. The thing is that the > > panel we use is SPI controlled, so it needs to be set up as > > spi_driver. From SPI probe function I can do > > omap_dss_register_driver(), but how do I pass SPI data to > > omap_dss_device cleanly? Surely some globals would help, but this is > > not a "clean" way I guess. There used to be panel-n800.c with similar > > requirements, but it's not yet converted, right? Do you have any ideas > > how this can be done? > > I don't have any good answer for this. For N900's panel there was a > static global variable, if I remember right. Not very clean, as you > said. > > Tomi > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: DSS2 panel question
On Sat, 2009-11-21 at 16:16 +0100, ext Grazvydas Ignotas wrote: > Hello, > > I've been updating Pandora's panel for upstream-going DSS2, which now > uses device/device_driver model for panels. The thing is that the > panel we use is SPI controlled, so it needs to be set up as > spi_driver. From SPI probe function I can do > omap_dss_register_driver(), but how do I pass SPI data to > omap_dss_device cleanly? Surely some globals would help, but this is > not a "clean" way I guess. There used to be panel-n800.c with similar > requirements, but it's not yet converted, right? Do you have any ideas > how this can be done? I don't have any good answer for this. For N900's panel there was a static global variable, if I remember right. Not very clean, as you said. Tomi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html