From: Luis.F.Correia <Lui...@se...> - 2005-03-28 07:36:30
|
Hi Michael, > -----Original Message----- > From: Michael Reinelt [mailto:re...@eu...] > Sent: Monday, March 28, 2005 8:08 AM > To: lcd4linux devel > Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver > > Hi Luis, > > > I told you i'm not very keen with this patch thighy... Here is the > > correct tar.gz file with all files in it! > > I forgot to tell you that the diff was created against last > night CVS at > > sourceforge. > > Thanks for the tar. Looks much better now :-) Sorry about the mess. It was very late and I really wanted to put it out. > > Anyway, I cannot compile it.I get tons of compiler errors, > all resulting > from the including of linux/i2c.h. Seems to me that this file is not > intended for userland inclusion :-) Apart from the automake stuff not having the two new files, it does compile cleanly. My devel system is Fedora Core 3 with all the latest updates. Yes, it is a 2.6 series kernel. But I2C is a major hack if you ask me... Kernel has it's own i2c functions, the lm_sensors project also has some other functions. When I stated this, I used only the in-kernel provided functions. Later on, when Paul picked up the pieces, he told me that we cannot use the in-kernel I2C, but rather use the userspace includes. This weekend I took the sources with me and edited them in a 'doze Pc, I had no compiling environment to test, until last night. Since it did compile ok, I thought all was right. Let's do this, please include these two files, and i'll see what can be done about detecting the proper i2c includes. [snip] > > .... and so on. > > Does it compile cleanly in your environment? If so, why? > > > bye, Michael > > -- > Michael Reinelt <re...@eu...> > http://home.pages.at/reinelt > GPG-Key 0xDF13BA50 > ICQ #288386781 Luis Correia |
From: Luis.F.Correia <Lui...@se...> - 2005-03-30 07:29:35
|
Hi Paul! > -----Original Message----- > From: Paul Kamphuis [mailto:pau...@xs...] > Sent: Wednesday, March 30, 2005 8:01 AM > To: Luis Correia; lcd4linux devel > Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver > > Hi Luis and Michael, > > I did a check this morning. A 'normal' build doesn't enable the i2c > support as you both noticed. The reason for this is that in > the autoconf > phase of the build the include file linux/i2c-dev.h is not > detected as > valid. I am not sure of the reason but it has to do with the > way it is > validated by autoconf. I edited configure.in to return true > for the i2c > support even in the invalid case. It now builds nicely and > i2c support > is also enabled. > Unfortunately doesn't work properly yet. I'll have to look > into it later > today. My guess is, that it has to do with the specification of the > ENABLE, RW, RS control signals. At least the observed behaviour seems > similar to what I had initialy. > Well, all you will need to do is to create a setup similar to what is in the lcd4linux.conf.sample, search for 'WRAP1C'. Copy that definition, edit where appropriate and it should work. You'll need to edit the i2c bus, the device address and where do the signals go in terms of databus. However, if your 4 data pins do not correspond to the lower 4 bus bits (ie D0 - D3) then the code needs another rewrite, but it is doable. > Later today I should have some more time to test. > > Cheers, > > Paul > Tell me your thoughts on this! Luis Correia |
From: Paul K. <pau...@xs...> - 2005-03-30 12:30:10
|
Hi Luis, I found the problem. The wire configuration is not read correctly from the config file. It uses the default all the time. (and I have RS/RW wired differently) This is how my display definition is constructed: Display HD44780-I2C { Driver 'HD44780' Bus 'i2c' Port '/dev/i2c-0' Device '38' Bits '4' Size '16x2' asc255bug 0 Icons 1 Wire { RW 'DB4' RS 'DB5' ENABLE 'DB6' GPO 'GND' } } Is that correct? I noticed that the Section and Driver strings are allways empty strings in drv_generic_i2c.c is that correct? thanks, Paul Luis.F.Correia wrote: >Hi Paul! > > > >>-----Original Message----- >>From: Paul Kamphuis [mailto:pau...@xs...] >>Sent: Wednesday, March 30, 2005 8:01 AM >>To: Luis Correia; lcd4linux devel >>Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver >> >>Hi Luis and Michael, >> >>I did a check this morning. A 'normal' build doesn't enable the i2c >>support as you both noticed. The reason for this is that in >>the autoconf >>phase of the build the include file linux/i2c-dev.h is not >>detected as >>valid. I am not sure of the reason but it has to do with the >>way it is >>validated by autoconf. I edited configure.in to return true >>for the i2c >>support even in the invalid case. It now builds nicely and >>i2c support >>is also enabled. >>Unfortunately doesn't work properly yet. I'll have to look >>into it later >>today. My guess is, that it has to do with the specification of the >>ENABLE, RW, RS control signals. At least the observed behaviour seems >>similar to what I had initialy. >> >> >> > >Well, all you will need to do is to create a setup similar to what is >in the lcd4linux.conf.sample, search for 'WRAP1C'. > >Copy that definition, edit where appropriate and it should work. > >You'll need to edit the i2c bus, the device address and where do >the signals go in terms of databus. > >However, if your 4 data pins do not correspond to the lower 4 bus bits >(ie D0 - D3) then the code needs another rewrite, but it is doable. > > > > >>Later today I should have some more time to test. >> >>Cheers, >> >>Paul >> >> >> > >Tell me your thoughts on this! > >Luis Correia > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Lcd4linux-devel mailing list >Lcd...@li... >https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > > > |
From: Paul K. <pau...@xs...> - 2005-03-30 12:46:20
|
Ok, I was to quick on the previous mail. In i2c_Open I assigned the section pointer to the Section variable, and it all works now!!! Now the only thing that remains is to sort out why autoconf doesn't validate linux/i2c-dev.h properly. Cheers, Paul |
From: Luis.F.Correia <Lui...@se...> - 2005-03-30 12:43:00
|
Hi! > -----Original Message----- > From: Paul Kamphuis [mailto:pau...@xs...] > Sent: Wednesday, March 30, 2005 1:30 PM > To: Luis.F.Correia; lcd4linux devel > Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver > > Hi Luis, > > I found the problem. The wire configuration is not read > correctly from > the config file. It uses the default all the time. (and I have RS/RW > wired differently) > This is how my display definition is constructed: > > Display HD44780-I2C { > Driver 'HD44780' > Bus 'i2c' > Port '/dev/i2c-0' > Device '38' > Bits '4' > Size '16x2' > asc255bug 0 > Icons 1 > Wire { > RW 'DB4' > RS 'DB5' > ENABLE 'DB6' > GPO 'GND' > } > } > > Is that correct? It seems to be ok, I'll have to make additional checks in order to see if the values are really read correctly. I just copy/pasted that piece of code from another driver... I can't make an actual test in any of my current development platforms, as none has a working I2C bus. Luis Correia > I noticed that the Section and Driver strings are allways > empty strings > in drv_generic_i2c.c is that correct? > > thanks, > > Paul > > > Luis.F.Correia wrote: > > >Hi Paul! > > > > > > > >>-----Original Message----- > >>From: Paul Kamphuis [mailto:pau...@xs...] > >>Sent: Wednesday, March 30, 2005 8:01 AM > >>To: Luis Correia; lcd4linux devel > >>Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver > >> > >>Hi Luis and Michael, > >> > >>I did a check this morning. A 'normal' build doesn't enable the i2c > >>support as you both noticed. The reason for this is that in > >>the autoconf > >>phase of the build the include file linux/i2c-dev.h is not > >>detected as > >>valid. I am not sure of the reason but it has to do with the > >>way it is > >>validated by autoconf. I edited configure.in to return true > >>for the i2c > >>support even in the invalid case. It now builds nicely and > >>i2c support > >>is also enabled. > >>Unfortunately doesn't work properly yet. I'll have to look > >>into it later > >>today. My guess is, that it has to do with the specification of the > >>ENABLE, RW, RS control signals. At least the observed > behaviour seems > >>similar to what I had initialy. > >> > >> > >> > > > >Well, all you will need to do is to create a setup similar to what is > >in the lcd4linux.conf.sample, search for 'WRAP1C'. > > > >Copy that definition, edit where appropriate and it should work. > > > >You'll need to edit the i2c bus, the device address and where do > >the signals go in terms of databus. > > > >However, if your 4 data pins do not correspond to the lower > 4 bus bits > >(ie D0 - D3) then the code needs another rewrite, but it is doable. > > > > > > > > > >>Later today I should have some more time to test. > >> > >>Cheers, > >> > >>Paul > >> > >> > >> > > > >Tell me your thoughts on this! > > > >Luis Correia > > > > > >------------------------------------------------------- > >SF email is sponsored by - The IT Product Guide > >Read honest & candid reviews on hundreds of IT Products from > real users. > >Discover which products truly live up to the hype. Start reading now. > >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > >_______________________________________________ > >Lcd4linux-devel mailing list > >Lcd...@li... > >https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > > > > > > > > > |
From: Luis.F.Correia <Lui...@se...> - 2005-03-30 13:00:24
|
Hi! > -----Original Message----- > From: Paul Kamphuis [mailto:pau...@xs...] > Sent: Wednesday, March 30, 2005 1:46 PM > To: Luis.F.Correia; lcd4linux devel > Subject: Re: [Lcd4linux-devel] I2C modifications to HD44780 driver > > Ok, I was to quick on the previous mail. > In i2c_Open I assigned the section pointer to the Section > variable, and > it all works now!!! Great, now what do I need to change? > > Now the only thing that remains is to sort out why autoconf doesn't > validate linux/i2c-dev.h properly. Let's validade only i2c-dev.h, and assume that i2c.h also exists. > > Cheers, > > Paul > > Luis |
From: Michael R. <re...@eu...> - 2005-03-28 19:59:27
|
Hi Luis, > My devel system is Fedora Core 3 with all the latest updates. Yes, it > is a 2.6 series kernel. Mine is debian sarge/sid/experimental/dangerous/bleeding_edge/.., but with a self-brewed vanilla kernel 2.6.11 > But I2C is a major hack if you ask me... Full ACK. > Kernel has it's own i2c functions, the lm_sensors project also has > some other functions. I did have a look at lm_sensors, looks like they don't use the i2c interface at all, but access the /proc or /sys files only. > Let's do this, please include these two files, and i'll see what can > be done about detecting the proper i2c includes. I commited your patch with some modifications, and added all the auto* stuff. It compiles cleanly here, but for a simple reason: configure decieds that linux/i2c.h is unusable, and therefore deactivates I2C support :-) Please give it a try! bye, Michael -- Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Luis C. <lfc...@lf...> - 2005-03-28 20:23:41
|
Michael Reinelt wrote: >Hi Luis, > > > >>My devel system is Fedora Core 3 with all the latest updates. Yes, it >>is a 2.6 series kernel. >> >> >Mine is debian sarge/sid/experimental/dangerous/bleeding_edge/.., but >with a self-brewed vanilla kernel 2.6.11 > > > >>But I2C is a major hack if you ask me... >> >> >Full ACK. > > >>Kernel has it's own i2c functions, the lm_sensors project also has >>some other functions. >> >> >I did have a look at lm_sensors, looks like they don't use the i2c >interface at all, but access the /proc or /sys files only. > > > >>Let's do this, please include these two files, and i'll see what can >>be done about detecting the proper i2c includes. >> >> >I commited your patch with some modifications, and added all the auto* >stuff. It compiles cleanly here, but for a simple reason: configure >decieds that linux/i2c.h is unusable, and therefore deactivates I2C >support :-) > >Please give it a try! > > > I did... it seems there is still a problem... Although you do have ifdef's around my I2C functions, and after I manually enable I2C by editing config.h, it seems to ignore the drv_generic_i2c.h file, as it spews out errors at tthe end, and drv_generic_i2c.c is not being compiled at all... What does the configure look for in order to detect I2C as present? >bye, Michael > > > Luis |
From: Paul K. <pau...@xs...> - 2005-03-30 07:00:51
|
Hi Luis and Michael, I did a check this morning. A 'normal' build doesn't enable the i2c support as you both noticed. The reason for this is that in the autoconf phase of the build the include file linux/i2c-dev.h is not detected as valid. I am not sure of the reason but it has to do with the way it is validated by autoconf. I edited configure.in to return true for the i2c support even in the invalid case. It now builds nicely and i2c support is also enabled. Unfortunately doesn't work properly yet. I'll have to look into it later today. My guess is, that it has to do with the specification of the ENABLE, RW, RS control signals. At least the observed behaviour seems similar to what I had initialy. Later today I should have some more time to test. Cheers, Paul Luis Correia wrote: > Michael Reinelt wrote: > >> Hi Luis, >> >> >> >>> My devel system is Fedora Core 3 with all the latest updates. Yes, it >>> is a 2.6 series kernel. >>> >> >> Mine is debian sarge/sid/experimental/dangerous/bleeding_edge/.., but >> with a self-brewed vanilla kernel 2.6.11 >> >> >> >>> But I2C is a major hack if you ask me... >>> >> >> Full ACK. >> >> >>> Kernel has it's own i2c functions, the lm_sensors project also has >>> some other functions. >>> >> >> I did have a look at lm_sensors, looks like they don't use the i2c >> interface at all, but access the /proc or /sys files only. >> >> >> >>> Let's do this, please include these two files, and i'll see what can >>> be done about detecting the proper i2c includes. >>> >> >> I commited your patch with some modifications, and added all the auto* >> stuff. It compiles cleanly here, but for a simple reason: configure >> decieds that linux/i2c.h is unusable, and therefore deactivates I2C >> support :-) >> >> Please give it a try! >> >> >> > I did... it seems there is still a problem... > > Although you do have ifdef's around my I2C functions, and after I > manually enable I2C by editing config.h, it seems to ignore the > drv_generic_i2c.h file, as it spews out errors at tthe end, and > drv_generic_i2c.c is not being compiled at all... > > What does the configure look for in order to detect I2C as present? > >> bye, Michael >> >> >> > > Luis > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > |
From: Michael R. <re...@eu...> - 2005-03-30 21:49:49
|
Hi Luis, > Although you do have ifdef's around my I2C functions, and after I > manually enable I2C by editing config.h, it seems to ignore the > drv_generic_i2c.h file, as it spews out errors at tthe end, and > drv_generic_i2c.c is not being compiled at all... > > What does the configure look for in order to detect I2C as present? Well, editing config.h isn't enough. The drv_generic_i2c.o will not be compiled and linked if configure cannot find the i2c includes (or thinks they're unusable, as it happens here). The detection is done within configure.in, line 57, which sets the variable "has_i2c" to true or false. This variable is checked in drivers.m4, at the very end, and ex-/includes drv_generic_i2c.o, and defines the WITH_I2C preprocessor symbol. configure checks for compiler.h, i2c.h and i2c-dev.h. Take a look at your config.log, it should contain some messages about i2c. bye, Michael -- Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: paul k. <pau...@xs...> - 2005-03-31 15:13:17
|
Hi Michael The problem is indeed in configure.in. The nested AC_CHECK_HEADERS doesn't work properly. (not sure why) AC_CHECK_HEADERS(linux/compiler.h, [AC_CHECK_HEADERS(linux/i2c.h,[ AC_CHECK_HEADERS(linux/i2c-dev.h,[has_i2c=true],[has_i2c=false]$ ],[has_i2c=false])] [has_i2c=false] ) There are actually two problems. One of them generates the warnings on linux/i2c-dev.h If I understand correctly, the behaviour of autoconf is changed. Instead of only preprocessing the header files, they now try to compile the files. If the file doesn't compile the warning is generated, so the developers (i.e. us) can change it. In the current autoconf versions, the file is still accepted if preprocessing goes well. But for future versions of autoconf, the check is based on if the file actually compiles. So it is recommended that we eliminate the warning by listing the required include files to make linux/i2c-dev.h compile. This is done by: AC_CHECK_HEADERS(linux/i2c-dev.h,[has_i2c=true],[has_i2c=false],[#include <linux/compiler.h>;#include <linux/i2c.h>;]) Using this line as the third line in the nested sequence above, still doesn't work. All 3 includes are correctly validated, but for some reason has_i2c is never set to true. I solved by changing the entire nested sequence to: AC_CHECK_HEADERS(linux/compiler.h linux/i2c.h linux/i2c-dev.h,[has_i2c=true],[has_i2c=false],[#include <linux/compiler.h>;#include <linux/i2c.h>;]) That works for me to enable i2c support, and also disables i2c support when linux/compiler.h is missing. I still have to do some additional tests, but you can give it a try with the above line. Cheers, Paul Michael Reinelt wrote: >Hi Luis, > > > >>Although you do have ifdef's around my I2C functions, and after I >>manually enable I2C by editing config.h, it seems to ignore the >>drv_generic_i2c.h file, as it spews out errors at tthe end, and >>drv_generic_i2c.c is not being compiled at all... >> >>What does the configure look for in order to detect I2C as present? >> >> > >Well, editing config.h isn't enough. The drv_generic_i2c.o will not be >compiled and linked if configure cannot find the i2c includes (or thinks >they're unusable, as it happens here). > >The detection is done within configure.in, line 57, which sets the >variable "has_i2c" to true or false. This variable is checked in >drivers.m4, at the very end, and ex-/includes drv_generic_i2c.o, and >defines the WITH_I2C preprocessor symbol. > >configure checks for compiler.h, i2c.h and i2c-dev.h. Take a look at >your config.log, it should contain some messages about i2c. > > >bye, Michael > > > |