Thread: New I2C and machine probing method
Brought to you by:
matthiasgrimm
From: Matthias G. <mat...@us...> - 2006-07-16 13:42:43
Attachments:
of_probing.c
|
Hi, I want to use some OF and kernel 2.6 features to improve device probing in pbbuttonsd. Unfortunately I have only an ancient PowerBook so I need your help to test the new routines on as many different machines as possible. I attached the source code of a short program. You could compile it as follows: $> gcc -o of_probing of_probing.c This program does three things: 1. detecting the machine ID. Any PowerBook user can test this feature. Launch the program and check if the machine ID is correctly detected on your machine. If you don't know which ID your machine have see in $> cat /proc/device-tree/model or $> cat /proc/cpuinfo Tell me if your machine is not correctly identified. PowerBooks before the G3 Pismo will get the dummy ID "1", because Apple started his numbering system just with the Pismo. 2. detecting the LMU I2C address The program looked for the "lmu-controller" in the device tree and read the attached data to find out the I2C address. This test will only have a result, if you have a PowerBook with an ambient light sensor. Otherwise the program won't find an LMU. If your machine definitely has an ambient light sensor and the program won't find it, the device tree path might be wrong. In this case please send me the correct path or an tar archive of /proc/device-tree. 3. detecting of the /dev/i2c device to communicate with the LMU This test reads /sys to find out which i2c devices are available and which one is connected to the "uni-n" controller the LMU is attached to. Each found i2c device will then be checked for the LMU. The program lists all found i2c devices to the console and mark the device with the LMU connected. This test needs the kernel module i2c-dev to be loaded. If not already done, you could load the module with $> modprobe i2c-dev I would appreciate any feedback. Thank you and Best Regards Matthias |
From: Filippo G. <fi...@es...> - 2006-07-16 16:07:40
|
On Sun, Jul 16, 2006 at 03:45:57PM +0200, Matthias Grimm wrote: >=20 > Hi, > I want to use some OF and kernel 2.6 features to improve device probing > in pbbuttonsd. Unfortunately I have only an ancient PowerBook so I need > your help to test the new routines on as many different machines as > possible. >=20 > I attached the source code of a short program. You could compile it as > follows: > $> gcc -o of_probing of_probing.c $ ./of_probing=20 Probing machine... Machine: ID =3D 62 OF: '/proc/device-tree/uni-n@f8000000/i2c@f8001000/reg' Path incomplete! One or more elements not found. LMU: No LMU found! godog@hattori:/tmp$ cat /proc/cpuinfo=20 processor : 0 cpu : 7447/7457, altivec supported clock : 998.400000MHz revision : 0.1 (pvr 8002 0101) bogomips : 47.94 timebase : 18432000 platform : PowerMac machine : PowerBook6,2 motherboard : PowerBook6,2 MacRISC3 Power Macintosh detected as : 287 (PowerBook G4) pmac flags : 0000001a L2 cache : 512K unified pmac-generation : NewWorld seems fine, powerbook 12" bought nov'03 filippo -- Filippo Giunchedi - http://esaurito.net PGP key: 0x6B79D401 random quote follows: I was once walking through the forest alone. A tree fell right in front of me -- and I didn't hear it. -- Steven Wright |
From: Matthias G. <mat...@us...> - 2006-07-17 19:16:17
Attachments:
of_probing.c
|
On Sun, 16 Jul 2006 15:45:57 +0200 Matthias Grimm <mat...@us...> wrote: Thanks a lot for your support so far. I put the new knowledge into a revised program and attached it again. Changes are: - There are two known locations for the lmu-controller in the device-tree so far. Both are supported now. - adding I/O error support. To communicate with the LMU the program must be run as root. If there was any problem with the device, an I/O error message would occur on terminal. - removing all the silly warnings - detailed machine identification by name added I hope you give it another try :-) Best Regards Matthias |
From: Johannes B. <joh...@si...> - 2006-07-16 20:39:18
|
> 2. detecting the LMU I2C address > The program looked for the "lmu-controller" in the device tree and > read the attached data to find out the I2C address. > This test will only have a result, if you have a PowerBook with an > ambient light sensor. Otherwise the program won't find an LMU. > If your machine definitely has an ambient light sensor and the program > won't find it, the device tree path might be wrong. In this case please > send me the correct path or an tar archive of /proc/device-tree. I haven't tested it, but a quick look at the code suggests it won't find it here: johannes:/proc/device-tree/uni-n@f8000000/i2c@f8001000/i2c-bus@0/lmu-micro@84$ hd compatible 00000000 6c 6d 75 2d 63 6f 6e 74 72 6f 6c 6c 65 72 00 |lmu-controller.| 0000000f ...$ hd device_type 00000000 6c 6d 75 2d 63 6f 6e 74 72 6f 6c 6c 65 72 00 |lmu-controller.| johannes |
From: Juan A. D. <ju...@li...> - 2006-07-21 00:30:13
|
nueces@galateia[~/ofp]$ strings /proc/device-tree/model PowerBook6,7 nueces@galateia[~/ofp]$ cat /proc/cpuinfo processor : 0 cpu : 7447A, altivec supported clock : 1333.333000MHz revision : 0.2 (pvr 8003 0102) bogomips : 73.47 timebase : 18432000 platform : PowerMac machine : PowerBook6,7 motherboard : PowerBook6,7 MacRISC3 Power Macintosh detected as : 287 (iBook G4) pmac flags : 0000001b L2 cache : 512K unified pmac-generation : NewWorld nueces@galateia[~/ofp]$ ./of_probing Probing machine... Machine: ID =3D 67 OF: '/proc/device-tree/uni-n@f8000000/i2c@f8001000/reg' Path incomplete! One or more elements not found. LMU: No LMU found! --=20 Juan A. Diaz |