New I2C and machine probing method
Brought to you by:
matthiasgrimm
From: Matthias G. <mat...@us...> - 2006-07-16 13:42:43
|
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 |