* Re: DSS2 panel question
[not found] <6ed0b2680911210716l529e02ck23e188417fecd4f1@mail.gmail.com>
@ 2009-11-23 11:04 ` Tomi Valkeinen
2009-11-23 17:41 ` TAO HU
0 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2009-11-23 11:04 UTC (permalink / raw)
To: ext Grazvydas Ignotas; +Cc: linux-omap@vger.kernel.org
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-23 11:04 ` DSS2 panel question Tomi Valkeinen
@ 2009-11-23 17:41 ` TAO HU
2009-11-25 10:53 ` Grazvydas Ignotas
0 siblings, 1 reply; 7+ messages in thread
From: TAO HU @ 2009-11-23 17:41 UTC (permalink / raw)
To: ext Grazvydas Ignotas; +Cc: linux-omap, Tomi Valkeinen
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
<tomi.valkeinen@nokia.com> 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 majordomo@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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-23 17:41 ` TAO HU
@ 2009-11-25 10:53 ` Grazvydas Ignotas
2009-11-25 17:44 ` TAO HU
2009-11-26 10:05 ` Tomi Valkeinen
0 siblings, 2 replies; 7+ messages in thread
From: Grazvydas Ignotas @ 2009-11-25 10:53 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap, TAO HU
On Mon, Nov 23, 2009 at 7:41 PM, TAO HU <tghk48@motorola.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-25 10:53 ` Grazvydas Ignotas
@ 2009-11-25 17:44 ` TAO HU
2009-11-25 20:24 ` Grazvydas Ignotas
2009-11-26 10:05 ` Tomi Valkeinen
1 sibling, 1 reply; 7+ messages in thread
From: TAO HU @ 2009-11-25 17:44 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: Tomi Valkeinen, linux-omap, TAO HU
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 <notasas@gmail.com> wrote:
> On Mon, Nov 23, 2009 at 7:41 PM, TAO HU <tghk48@motorola.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-25 17:44 ` TAO HU
@ 2009-11-25 20:24 ` Grazvydas Ignotas
2009-11-30 19:17 ` Tony Lindgren
0 siblings, 1 reply; 7+ messages in thread
From: Grazvydas Ignotas @ 2009-11-25 20:24 UTC (permalink / raw)
To: TAO HU; +Cc: Tomi Valkeinen, linux-omap, TAO HU
On Wed, Nov 25, 2009 at 7:44 PM, TAO HU <tghk48@motorola.com> 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 <notasas@gmail.com> wrote:
>> On Mon, Nov 23, 2009 at 7:41 PM, TAO HU <tghk48@motorola.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-25 10:53 ` Grazvydas Ignotas
2009-11-25 17:44 ` TAO HU
@ 2009-11-26 10:05 ` Tomi Valkeinen
1 sibling, 0 replies; 7+ messages in thread
From: Tomi Valkeinen @ 2009-11-26 10:05 UTC (permalink / raw)
To: ext Grazvydas Ignotas; +Cc: linux-omap@vger.kernel.org, TAO HU
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@motorola.com> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DSS2 panel question
2009-11-25 20:24 ` Grazvydas Ignotas
@ 2009-11-30 19:17 ` Tony Lindgren
0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2009-11-30 19:17 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: TAO HU, Tomi Valkeinen, linux-omap, TAO HU
* Grazvydas Ignotas <notasas@gmail.com> [091125 12:23]:
> On Wed, Nov 25, 2009 at 7:44 PM, TAO HU <tghk48@motorola.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-30 19:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <6ed0b2680911210716l529e02ck23e188417fecd4f1@mail.gmail.com>
2009-11-23 11:04 ` DSS2 panel question Tomi Valkeinen
2009-11-23 17:41 ` TAO HU
2009-11-25 10:53 ` Grazvydas Ignotas
2009-11-25 17:44 ` TAO HU
2009-11-25 20:24 ` Grazvydas Ignotas
2009-11-30 19:17 ` Tony Lindgren
2009-11-26 10:05 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox