First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 64591
Alias:
Product:
Component:
Status: RESOLVED
Resolution: UPSTREAM
Assigned To: PPC Porters <ppc@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: J Robert Ray <jrray@jrray.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
pbbuttonsd.patch upstream patch patch Pieter Van den Abeele 2004-09-25 04:17 0000 8.12 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 64591 depends on: Show dependency tree
Show dependency graph
Bug 64591 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-09-18 22:21 0000
On my new 15" powerbook g4, pbbuttonsd fails to properly detect the correct i2c
device for the ambient light sensor and also the keyboard illumination
controls.

Both the unmasked 0.6.1 and masked 0.6.5 versions have the same problem.  When
it goes to detect which device to use, it starts with dev 0 and works up. 
/dev/i2c-0 looks valid but the ambient light sensor always reports a light
level of 0.

When I change the code so that it starts searching at dev 1, it discovers the
correct device at /dev/i2c-4.  The ambient light sensor reports valid data and
the keyboard illumination works properly.

E.g.:

diff -rNu pbbuttonsd-0.6.5/src/module_pmac.c
pbbuttonsd-0.6.5-jrray/src/module_pmac.c
--- pbbuttonsd-0.6.5/src/module_pmac.c  2004-09-08 13:01:41.000000000 -0700
+++ pbbuttonsd-0.6.5-jrray/src/module_pmac.c    2004-09-18 21:26:35.431804672
-0700
@@ -979,7 +979,7 @@
        char i2cdevice[20], buf[4];
        int n, fd, rc = -E_NOCHAR;

-       for(n=0; n < 256; n++) {
+       for(n=1; n < 256; n++) {
                snprintf(i2cdevice, 19, "/dev/i2c-%d", n );
                if ((fd = open (i2cdevice, O_RDWR)) >= 0 ) {
                        if (ioctl (fd, I2C_SLAVE, LMU_ADDR) >= 0 ) {

Based on this mailing list thread:
http://lists.debian.org/debian-powerpc/2004/01/msg00546.html

It seems that some powerbooks require /dev/i2c-4 and some require /dev/i2c-0. 
The pbbuttonsd code should probably be modified to make this a
user-configurable option.

- Robert

------- Comment #1 From Douglas Russell (RETIRED) 2004-09-20 05:02:42 0000 -------
This should be reported upstream.

------- Comment #2 From Pieter Van den Abeele 2004-09-22 14:40:11 0000 -------
Puggy, can you apply this one-line patch in cvs and report upstream?

------- Comment #3 From J Robert Ray 2004-09-23 00:13:55 0000 -------
I'm fairly certain that applying my patch will break pbbuttonsd for some people
while fixing it for others.  The upstream developer will probably know better
how to fix it for everyone.

------- Comment #4 From Pieter Van den Abeele 2004-09-24 15:25:51 0000 -------
I've pointed the upstream developer to this bug & patch. Thnxs for the
feedback.

------- Comment #5 From Pieter Van den Abeele 2004-09-25 04:17:32 0000 -------
Created an attachment (id=40364) [edit]
upstream patch

Upstream test request

------- Comment #6 From Lars Weiler (RETIRED) 2004-10-05 19:29:57 0000 -------
I added the patch as long as it is not resolved upstream.

First Last Prev Next    No search results available      Search page      Enter new bug