lm_sensors && bt869
Quoted 9 lines
I saw that you have developed the bt869 driver for the
lm_sensorsproject. I always used your module with my Voodoo3 3000 AGP without major problems. However, I had to switch to the 2.6.0 Linux kernel and now I don't know how to get the TV-Out working. According to the lm-Sensors homepage, the modules can't be used with the 2.6.0 kernel (the i2c-voodoo3 is already included in the kernel but there's no bt869). Do you know any way how to get around that problem or anyone who could help me? Isn't there a way to load the bt869-module in a 2.6.0 kernel?
All drivers need to be ported before they can be used with Linux 2.6. All bus drivers have already been (including i2c-voodoo3) but several chip drivers haven't been yet (including bt869). If you want to port it yourself, let us know and we'll point you to the correct docs. That's not really complicated, but we are all rather busy and don't have all the necessary hardware for testing, which is preferable when messing with kernel drivers. If you don't want to, or cannot, port it yourself, you'll have to wait until someone else does, and I can't tell you how much time it will be.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Dear Jean Delvare,
am Sonntag, 28. Dezember 2003 um 15:37 schrieben Sie:
JD> All drivers need to be ported before they can be used with Linux 2.6. JD> All bus drivers have already been (including i2c-voodoo3) but several JD> chip drivers haven't been yet (including bt869). If you want to port it JD> yourself, let us know and we'll point you to the correct docs. That's JD> not really complicated, but we are all rather busy and don't have all JD> the necessary hardware for testing, which is preferable when messing JD> with kernel drivers. If you don't want to, or cannot, port it yourself, JD> you'll have to wait until someone else does, and I can't tell you how JD> much time it will be.
Well...I don't actually know what the difference between kernel modules in 2.4 and 2.6 is. Does the module need to be fully rewritten or do I only have to change parts? Could you point me to those docs?
Bernhard Gruber
Quoted 2 lines
Let me kick this over to the main mailing list to see if you can get a a better answer than you would from just me. ;')
Phil, you really need a rest, don't you? ;)
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Let me kick this over to the main mailing list to see if you can get a better answer than you would from just me. ;')
Phil
Quoted 18 lines · Berni
Dear phil,
I saw that you have developed the bt869 driver for the
lm_sensorsproject. I always used your module with my Voodoo3 3000 AGP without major problems. However, I had to switch to the 2.6.0 Linux kernel and now I don't know how to get the TV-Out working. According to the lm-Sensors homepage, the modules can't be used with the 2.6.0 kernel (the i2c-voodoo3 is already included in the kernel but there's no bt869). Do you know any way how to get around that problem or anyone who could help me? Isn't there a way to load the bt869-module in a 2.6.0 kernel?Thanks in advance for your help!
Bernhard Gruber
Dear Jean Delvare,
Quoted 1 line
Quoted 1 line
6.
switch_output_format: 2=RGB, 1=SVIDEO, 0=Composite
JD> Using "format" is a bit confusing IMHO. What about "output_source"? (Oh JD> well this is maybe even more confusing...)
Perhaps output_mode ?
JD> As a general rule, you don't want to prepend the action to the file JD> names.
Sorry, I didn't know that.
JD> Well, without the hardware I probably won't help much - and I don't JD> really plan to read the full data sheet ;) Don't know what to do with JD> these. If it's not a "public" think, we don't care much, except that it JD> might conflict with something else someday... Do as you want. If it's JD> not widely used, this also mean we can change it later if needed.
When I tried it in the past (with a 2.4 kernel) it gave out quite strange results. I think I'll name it bt869_status[1-3] so that it doesn't interfere. OK?
Bernhard Gruber
Dear Jean Delvare,
am Donnerstag, 1. Januar 2004 um 08:10 schrieben Sie:
JD> So I invite you to submit a file names proposal on this list, as JD> detailed as possible when it comes to the reasons of your choices each JD> time it isn't obvious (and possibly even when it seems to be). We'll JD> discuss it together to make sure it will be a safe base for future video JD> drivers as well, and then you can go coding ;)
JD> Thanks.
Well...actually I think we need the following new names:
1. switch_ntsc : To tell the bt869 to output either ntsc or pal (1=NTSC, 0=PAL)
2. switch_colorbars : 1 to turn on colorbars calibration screen and 0 to turn it off
3. change_colordepth : To change the color depth (for Voodoo3 there's only 16 and 24bit for TV-Out-Mode, other would have 32bit here, too)
4. change_resolution[1-2] : 1 for the width(x) and 2 for the height(y)
5. switch_half_resolution : Switch to turn on the Half-Resolution-Mode (this is a special mode which can't be merged with switch_resolution!)
6. switch_output_format : 2=RGB, 1=SVIDEO, 0=Composite
There's also a status[0-2] in there (read-only), but I couldn't figure out what exactly this is for. It is used but as it seems it's only for driver-internal things and not really for the end-user...Perhaps you could take a look over it!
Bernhard Gruber
mailto:[email protected]
Quoted 2 lines
Well...I don't actually know what the difference between kernel modules in 2.4 and 2.6 is.
Just to make it clear, the difference we are talking about is somewhat i2c-chip-drivers specific (although one of the most important changes is that they now use sysfs instead of procfs, which is a typical 2.4 to 2.6 change).
Quoted 2 lines
Does the module need to be fully rewritten or do I only have to change parts?
Well, somewhere in the middle. There is much more to do than just a few trivial changes. Still I don't consider it unfeasable, even for a newbie, if you can follow a guide and keep track of four files at once (see below).
Quoted 1 line
Could you point me to those docs?
See Documentation/i2c/porting clients in linux-2.6.1-rc1. I suggest that you follow that guide, with four additional files opened: the old bt869 driver, the new bt869 (that you'll be writing), and the old and new version of an arbitrary driver that has already been ported (I'd suggest lm75 or lm83). This is what I did and it works well.
Good luck. Feel free to ask questions as they come.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 4 lines
Well...I think I could manage to change almost everything according to the guide and other ported files but there where 2 points where I ran into problems:
1. Section "Detect", Device Creation: Do I have to use names from the
Quoted 8 lines
sysfs-interface-doc here? The problem is, that I couldn't find anything useable here as the bt869 isn't a sensor chip in the traditional way (it does neither read temperatures nor voltages or whatever...).
2. Quite the same problem is at the point where I have to define show and set functions: I should use names from the sysfs-interface-doc but there isn't anything according to the functions which the bt869 has...
The sysfs-interface is really meant for sensor chips IMHO, with the exception of eeprom because it it both generic (it is a raw reading of the whole addressing space) and special (because it is a binary file).
So you of course can't use what's documented in sysfs-interface for now. What we should do is chose files that make sense for your chipset, while keeping a few simple rules in mind:
* The names should not interfere with those documented in sysfs. It's unlikely it would happen anyway.
* The names should be such that anyone doubtlessly know what the value represents, just from the name.
* The names should follow the naming scheme described in sysfs-interface whenever it applies (i.e. <channel>_<value><number>). This choice is still subject to change but I want names to be consistent until there.
* Remember that sysfs has only one value per file, which wasn't the case with procfs. So you typically have more files in the new driver than in the old one.
* The names you chose should be reusable by other video chips driver. For example, you would prefer "video_norm_out" over"video_norm" because other chips could have "video_norm_in".
Our goal with the sysfs interface is that no particular knowledge about chip specificity should be required to read from and write to the sysfs interface files. This hopefully should let us have a much simpler library to access this information, with no chip specific data. The library we have for now needs to be updated as soon as new drivers are written or old drivers are changed.
So I invite you to submit a file names proposal on this list, as detailed as possible when it comes to the reasons of your choices each time it isn't obvious (and possibly even when it seems to be). We'll discuss it together to make sure it will be a safe base for future video drivers as well, and then you can go coding ;)
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 3 lines
Well...actually I think we need the following new names:
1.switch_ntsc: To tell the bt869 to output either ntsc or pal (1=NTSC, 0=PAL)
I'd call the file "output_norm".
Quoted 2 lines
2.
switch_colorbars: 1 to turn on colorbars calibration screen and 0 to turn it off
Not sure about this one, I think I'd simply call it "colorbars".
Quoted 2 lines
3.
change_colordepth: To change the color depth (for Voodoo3 there's only 16 and 24bit for TV-Out-Mode, other would have 32bit here, too)
This is "colordepth".
Quoted 1 line
4. change_resolution[1-2] : 1 for the width(x) and 2 for the height(y)
I would say "output_width" and "output_height".
Quoted 2 lines
5.
switch_half_resolution: Switch to turn on the Half-Resolution-Mode (this is a special mode which can't be merged withswitch_resolution!)
"half_resolution" ?
Quoted 1 line
6.
switch_output_format: 2=RGB, 1=SVIDEO, 0=Composite
Using "format" is a bit confusing IMHO. What about "output_source"? (Oh well this is maybe even more confusing...)
As a general rule, you don't want to prepend the action to the file names.
Quoted 4 lines
There's also a status[0-2] in there (read-only), but I couldn't figure out what exactly this is for. It is used but as it seems it's only for driver-internal things and not really for the end-user...Perhaps you could take a look over it!
Well, without the hardware I probably won't help much - and I don't really plan to read the full data sheet ;) Don't know what to do with these. If it's not a "public" think, we don't care much, except that it might conflict with something else someday... Do as you want. If it's not widely used, this also mean we can change it later if needed.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 6 lines
Quoted 1 line
Quoted 1 line
6.
switch_output_format: 2=RGB, 1=SVIDEO, 0=CompositeJD> Using "format" is a bit confusing IMHO. What about JD> "
output_source"? (Oh well this is maybe even more confusing...)Perhaps
output_mode?
I thought "source" because that's the term that is used in xawtv when you have to choose between tuner, composite and s-video for input. I admit that output_source sounds a bit strange but input_source (for an hypothetical video decoder chipset) would be correct. This is the reason why I was proposing this. "Mode", as "format", is not explicit enough and could apply to other things as well. I think I'd go for "output_source" because people will probably understand immediately what it represents, although "output" and "source" are somewhat contradictory terms.
Quoted 10 lines
JD> Well, without the hardware I probably won't help much - and I JD> don't really plan to read the full data sheet ;) Don't know what JD> to do with these. If it's not a "public" think, we don't care JD> much, except that it might conflict with something else someday... JD> Do as you want. If it's not widely used, this also mean we can JD> change it later if needed.
When I tried it in the past (with a 2.4 kernel) it gave out quite strange results. I think I'll name it bt869_status[1-3] so that it doesn't interfere. OK?
This is OK for me.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
[Don't forget to CC: the mailing-list on replies]
Quoted 3 lines
I think the bt869 for 2.6 should be OK so far, but I don't know how I can compile it standalone and so I couldn't test it. Where do I have to put it and what are the gcc-paramters I have to use?
I don't know. I'd suggest you copy your source file in linux/drivers/i2c/chips, and edit linux/drivers/i2c/chips/Makefile (add a line like "obj-m += bt869.o"). Then configure a fake kernel with as least options as possible (but don't forget to at least enable i2c-core). Then compile your kernel and see what happens.
That doesn't look very immediate nor professional, I admit, but that's how I do and it works ;) If anyone has a better way of testing new drivers, let us know.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Dear Jean Delvare,
am Mittwoch, 31. Dezember 2003 um 22:15 schrieben Sie:
Quoted 2 lines
Quoted 2 lines
Well...I don't actually know what the difference between kernel modules in 2.4 and 2.6 is.
JD> Just to make it clear, the difference we are talking about is somewhat JD> i2c-chip-drivers specific (although one of the most important changes is JD> that they now use sysfs instead of procfs, which is a typical 2.4 to 2.6 JD> change).
Quoted 2 lines
Quoted 2 lines
Does the module need to be fully rewritten or do I only have to change parts?
JD> Well, somewhere in the middle. There is much more to do than just a few JD> trivial changes. Still I don't consider it unfeasable, even for a JD> newbie, if you can follow a guide and keep track of four files at once JD> (see below).
Quoted 1 line
Quoted 1 line
Could you point me to those docs?
JD> See Documentation/i2c/porting clients in linux-2.6.1-rc1. I suggest that JD> you follow that guide, with four additional files opened: the old bt869 JD> driver, the new bt869 (that you'll be writing), and the old and new JD> version of an arbitrary driver that has already been ported (I'd suggest JD> lm75 or lm83). This is what I did and it works well.
JD> Good luck. Feel free to ask questions as they come.
Well...I think I could manage to change almost everything according to the guide and other ported files but there where 2 points where I ran into problems:
1. Section "Detect", Device Creation: Do I have to use names from the sysfs-interface-doc here? The problem is, that I couldn't find anything useable here as the bt869 isn't a sensor chip in the traditional way (it does neither read temperatures nor voltages or whatever...).
2. Quite the same problem is at the point where I have to define show and set functions: I should use names from the sysfs-interface-doc but there isn't anything according to the functions which the bt869 has...
Thanks for your help!
Bernhard Gruber
Guten Tag Jean Delvare,
am Freitag, 2. Januar 2004 um 14:02 schrieben Sie:
JD> [Don't forget to CC: the mailing-list on replies]
I wasn't at home when I wrote this, so i forgot that. Sorry!
JD> I don't know. I'd suggest you copy your source file in
JD> linux/drivers/i2c/chips, and edit linux/drivers/i2c/chips/Makefile (add JD> a line like "obj-m += bt869.o"). Then configure a fake kernel with as JD> least options as possible (but don't forget to at least enable JD> i2c-core). Then compile your kernel and see what happens.
JD> That doesn't look very immediate nor professional, I admit, but that's JD> how I do and it works ;) If anyone has a better way of testing new JD> drivers, let us know.
I tried this (kernel 2.6.0), but I can't figure out the reason for the following two problems:
1. For text-output, the new functions like dev_info, dev_dbg and so on should be used as I read. However a line like dev_info(&client->dev, "probing address %d .\n", address); always produces the error that "client" is undeclared. A also tried "adapter" instead of "client" but with the similar result. In the lm83.c it's used the same way, but there, the problem does not exist. Do you have any idea on that?
2. When I get to the device creation I also get problems with undeclared variables. However, this line device_create_file(&new_client->dev, &dev_attr_output_norm); sounds right for me.
Perhaps I just forgot one line anywhere which would solve those two problems...
Bernhard Gruber
mailto:[email protected]
Sorry for the late answer, I have been busy these last days.
Quoted 10 lines
I tried this (kernel 2.6.0), but I can't figure out the reason for the following two problems:
1. For text-output, the new functions like
dev_info,dev_dbgand so on should be used as I read. However a line likedev_info(&client->dev, "probing address %d .\n", address); always produces the error that "client" is undeclared. A also tried "adapter" instead of "client" but with the similar result. In thelm83.cit's used the same way, but there, the problem does not exist. Do you have any idea on that?
Well, you must use the right variable accoring to your own code, be it of type i2c_client or i2c_adapter, whichever it applies to at that time. It's hard to tell you without seeing your actual code.
You made me notice that I have an error in my lm83 driver. I call "dev_dbg(&client->dev, ..." instead of "dev_dbg(&adapter->dev, ..." once. I did not notice it before because dev_dbg resolves to nothing unless DEBUG is set. Thanks :)
Quoted 4 lines
2. When I get to the device creation I also get problems with undeclared variables. However, this line
device_create_file(&new_client->dev, &dev_attr_output_norm); sounds right for me.
Again it's hard to tell you without seeing your code. If you still couldn't get it to work, please send my your code and I'll take a look.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/