Skip to contentSkip to conversation

Frame buffers and early i2c

DISCUSSION Uli Luckas 3 participants 9 messages Jun 9, 2008 – Jun 10, 2008 I2C subsystem host drivers

lore
Share & tools
lore

Uli Luckas

author
#0 lore raw

I am in the process of trying out a display connected to a colibri board's pxa frame buffer device. The display's power supply is switch through i2c.

In order to use the frame buffer console I have i2c and pxafb compiled in.

By default, the pxafb driver get's initialized before the i2c bus causing the display power up to fail.

What do i2c people think about changing the link order here?

What do other frame buffer drivers handle the absence of i2c during early boot?

regards,
Uli

Signature · 12 lines
------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 64 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing directors: Hans-Peter Constien, Hubertus von Streit
#1 lore raw
Quoted 9 lines · Uli Luckas

I am in the process of trying out a display connected to a colibri board's pxa frame buffer device. The display's power supply is switch through i2c.

In order to use the frame buffer console I have i2c and pxafb compiled in.

By default, the pxafb driver get's initialized before the i2c bus causing the display power up to fail.

What do i2c people think about changing the link order here?

Why don't you ask on the i2c mailing list? Cc added.

Personally I have no objection, but dependencies can be tricky so you'll have to be careful. video is early in the link order at the moment.

Quoted 2 lines

What do other frame buffer drivers handle the absence of i2c during early boot?

Interestingly enough, they appear to do fine, despite the linking order. Maybe because i2c_init is a subsys_initcall() while framebuffer drivers are initialized with module_init()? Then I'm not sure why your own driver has a problem there.

Signature · 1 line
Jean Delvare
author
#2 lore raw
Quoted 8 lines · Jean Delvare
Quoted 7 lines · Uli Luckas

I am in the process of trying out a display connected to a colibri board's pxa frame buffer device. The display's power supply is switch through i2c.

In order to use the frame buffer console I have i2c and pxafb compiled in.

Quoted 7 lines
Quoted 4 lines

By default, the pxafb driver get's initialized before the i2c bus causing the display power up to fail.

What do i2c people think about changing the link order here?

Why don't you ask on the i2c mailing list? Cc added.

I wanted to get i2c developers plus frame buffer and other i2c client developers involved. Crossposting to more then 2 lists seemed wrong.

Quoted 4 lines

Personally I have no objection, but dependencies can be tricky so you'll have to be careful. video is early in the link order at the moment.

Yep. I might come back for help on that later.

Quoted 8 lines
Quoted 2 lines

What do other frame buffer drivers handle the absence of i2c during early boot?

Interestingly enough, they appear to do fine, despite the linking order. Maybe because i2c_init is a subsys_initcall() while framebuffer drivers are initialized with module_init()? Then I'm not sure why your own driver has a problem there.

Well, this is only very partially true. Try:
rgrep -l subsys_initcall drivers/i2c/
rgrep -l module_init drivers/i2c/

The last of which gives drivers/i2c/busses/i2c-pxa.c for example.

I'll change the pxa i2c driver to subsys_initcall and try if that works when I get back to my desk tomorrow.

regards,
Uli

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

#3 lore raw

Hi Uli,

Quoted 5 lines · Uli Luckas
Quoted 1 line · Jean Delvare

Why don't you ask on the i2c mailing list? Cc added.

I wanted to get i2c developers plus frame buffer and other i2c client developers involved. Crossposting to more then 2 lists seemed wrong.

So you prefer to post to one random list than the two lists where your target audience is? Interesting approach. If you really don't want to post to two lists at once, just send two separate posts?

Quoted 10 lines
Quoted 5 lines

Interestingly enough, they appear to do fine, despite the linking order. Maybe because i2c_init is a subsys_initcall() while framebuffer drivers are initialized with module_init()? Then I'm not sure why your own driver has a problem there.

Well, this is only very partially true. Try:
rgrep -l subsys_initcall drivers/i2c/
rgrep -l module_init drivers/i2c/

The last of which gives drivers/i2c/busses/i2c-pxa.c for example.

Sorry, I didn't understand what you wanted originally. I thought you only wanted the i2c-core up before pxafb (which is in fact already the case) while what you actually want it i2c-pxa up before pxafb (which isn't yet the case.)

Quoted 2 lines

I'll change the pxa i2c driver to subsys_initcall and try if that works when I get back to my desk tomorrow.

I expect it to work, as apparently other platforms are doing exactly that already.

Signature · 1 line
Jean Delvare
author
#4 lore raw
Quoted 4 lines · Jean Delvare

Hi Uli,

Quoted 1 line · Uli Luckas

On Monday 09 June 2008, Jean Delvare wrote:

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Why don't you ask on the i2c mailing list? Cc added.

I wanted to get i2c developers plus frame buffer and other i2c client developers involved. Crossposting to more then 2 lists seemed wrong.

So you prefer to post to one random list than the two lists where your target audience is? Interesting approach. If you really don't want to post to two lists at once, just send two separate posts?

And have two seperate threads of communication??? lfml is where they all are and avery maintainer has different preferences. Anyway, I got your point and will come to the i2c list in the future if you prefere.

Quoted 6 lines
Quoted 2 lines

I'll change the pxa i2c driver to subsys_initcall and try if that works when I get back to my desk tomorrow.

I expect it to work, as apparently other platforms are doing exactly that already.

Just changing the initcall to subsys really did the trick. I thought, this was the first thing I tried and I thought it crashed my device. But obviousely I had some other problem.
If Russell gives his Ack, could this be pushed upstream through i2c?

regards,
Uli

Initialize the pxa i2c bus during subsystem initialization to make it available during driver initialization (e.g. display powerup for pxafb).

---
 drivers/i2c/busses/i2c-pxa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-pxa.c +1 -1
index eb69fba..78c0fc4 100644
@@ -1134,5 +1134,5 @@ static void __exit i2c_adap_pxa_exit(void)
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pxa2xx-i2c");
 
-module_init(i2c_adap_pxa_init);
+subsys_initcall(i2c_adap_pxa_init);
 module_exit(i2c_adap_pxa_exit);
Signature · 12 lines
------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 64 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing directors: Hans-Peter Constien, Hubertus von Streit
#5 lore raw
Quoted 21 lines · Uli Luckas
Quoted 4 lines · Jean Delvare

Hi Uli,

Quoted 1 line · Uli Luckas

On Monday 09 June 2008, Jean Delvare wrote:

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Why don't you ask on the i2c mailing list? Cc added.

I wanted to get i2c developers plus frame buffer and other i2c client developers involved. Crossposting to more then 2 lists seemed wrong.

So you prefer to post to one random list than the two lists where your target audience is? Interesting approach. If you really don't want to post to two lists at once, just send two separate posts?

And have two seperate threads of communication??? lfml is where they all are and avery maintainer has different preferences. Anyway, I got your point and will come to the i2c list in the future if you prefere.

Quoted 3 lines
Quoted 2 lines

I'll change the pxa i2c driver to subsys_initcall and try if that works when I get back to my desk tomorrow.

Quoted 7 lines
Quoted 3 lines

I expect it to work, as apparently other platforms are doing exactly that already.

Just changing the initcall to subsys really did the trick. I thought, this was the first thing I tried and I thought it crashed my device. But obviousely I had some other problem.
If Russell gives his Ack, could this be pushed upstream through i2c?

Does this work if the code is built as a module?

BTW, if people do have these sort of dependencies, then modules are another way of sorting out the load order, unless you have the module autoload enabled.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#6 lore raw
Quoted 7 lines · Ben Dooks
Quoted 4 lines · Uli Luckas

Just changing the initcall to subsys really did the trick. I thought, this was the first thing I tried and I thought it crashed my device. But obviousely I had some other problem.
If Russell gives his Ack, could this be pushed upstream through i2c?

Does this work if the code is built as a module?

subsys_initcall degrades to module_init in modules, so Uli's patch doesn't change anything in that case.

Quoted 3 lines

BTW, if people do have these sort of dependencies, then modules are another way of sorting out the load order, unless you have the module autoload enabled.

Signature · 1 line
Jean Delvare
author
#7 lore raw
In reply to Ben Dooks
Quoted 4 lines · Ben Dooks

BTW, if people do have these sort of dependencies, then modules are another way of sorting out the load order, unless you have the module autoload enabled.

True. But my original post stated:

Quoted 1 line

In order to use the frame buffer console I have i2c and pxafb compiled in

This is one example where waiting for user space to be up and running is not an option.

regards,
Uli

Signature · 12 lines
------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 64 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing directors: Hans-Peter Constien, Hubertus von Streit
#8 lore raw
In reply to Uli Luckas
Quoted 8 lines · Uli Luckas
Quoted 4 lines · Jean Delvare

So you prefer to post to one random list than the two lists where your target audience is? Interesting approach. If you really don't want to post to two lists at once, just send two separate posts?

And have two seperate threads of communication??? lfml is where they all are and avery maintainer has different preferences. Anyway, I got your point and will come to the i2c list in the future if you prefere.

If you believe that every kernel developer reads LKML, you're seriously mistaken. We have a hundred of dedicated mailing lists for a reason. I would have missed your post if you hadn't Cc'd directly.

Quoted 18 lines

Just changing the initcall to subsys really did the trick. I thought, this was the first thing I tried and I thought it crashed my device. But obviousely I had some other problem.
If Russell gives his Ack, could this be pushed upstream through i2c? (...)
Initialize the pxa i2c bus during subsystem initialization to make it available during driver initialization (e.g. display powerup for pxafb).

---
 drivers/i2c/busses/i2c-pxa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-pxa.c +0 -0
index eb69fba..78c0fc4 100644

drivers/i2c/busses/i2c-pxa.c static void __exit i2c_adap_pxa_exit(void) · line 1138

Quoted 6 lines
drivers/i2c/busses/i2c-pxa.c +1 -1
@@ -1134,5 +1134,5 @@ static void __exit i2c_adap_pxa_exit(void)
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pxa2xx-i2c");
 
-module_init(i2c_adap_pxa_init);
+subsys_initcall(i2c_adap_pxa_init);
 module_exit(i2c_adap_pxa_exit);

That's fine with me.

Signature · 1 line
Jean Delvare