I had the same issue of fan files not being found. Also, I couldn't get pommed to read the "light" file reliably. This is on my MacBook Pro Penryn. I was also getting a bunch of warning messages in the syslog.
I did some debugging and it looks like the applesmc needs a "retry" in it. When reading the light sensors, it would read the left sensor fine, but not read the right sensor at all. If I added a retry on the right sensor, it would read it.
I ended up modifying the applesmc.c file as:
Code:
static int __wait_status(u8 val)
{
unsigned int i;
val = val & APPLESMC_STATUS_MASK;
for (i = 0; i < 100; i++) {
if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) {
if (debug)
printk(KERN_DEBUG
"Waited %d us for status %x\n",
i*10, val);
return 0;
}
udelay(10);
}
/*
printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n",
val, inb(APPLESMC_CMD_PORT));
*/
return -EIO;
}
/*
* applesmc_read_key - reads len bytes from a given key, and put them in buffer.
* Returns zero on success or a negative error on failure. Callers must
* hold applesmc_lock.
*/
static int applesmc_read_key(const char* key, u8* buffer, u8 len)
{
int i;
if (len > APPLESMC_MAX_DATA_LENGTH) {
printk(KERN_ERR "applesmc_read_key: cannot read more than "
"%d bytes\n", APPLESMC_MAX_DATA_LENGTH);
return -EINVAL;
}
outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
if (__wait_status(0x0c)) {
outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
if (__wait_status(0x0c)) {
return -EIO;
}
}
....... (more stuff in this method) ..........
Basically, it shortened the timeout in __wait_status and removed the printk, then added a retry in applesmc_read_key.
With that, everything seems to work fine. I can get the fans, the lights, position, etc....
Not sure why the retry is needed. Maybe the device in the newer macbooks are sending more data back or something. I don't really know.