Kernel Bug Tracker – Bug 26172
Radeonfb does not register monid adapter as I2C hardware monitor
Last modified: 2011-05-03 16:38:09 UTC
I have X600 Radeon video card with external LM63 temperature sensor.
In order to access the sensor the radeonfb (i2c-core, i2c_algo_bit, ...) drivers need to loaded.
When the radeonfb_create_i2c_busses() called it register I2C bus with adapter class set to 0 (default, not set explicitly). Later when lm63 module is loaded the i2c_register_driver()->__process_new_driver()->i2c_do_add_adapter()->i2c_detect() called.
This function check if adapter support driver class:
if (!(adapter->class & driver->class))
Here it's successfully failed. And the LM63 driver become useless for monitoring the GPU temp with lm_sensors.
If I add the following line to linux/drivers/video/aty/radeon_i2c.c, radeonfb_create_i2c_busses():
#warning "Debug code"
+ rinfo->i2c.adapter.class = I2C_CLASS_HWMON;
Then lm63 works as expected.
Is it possible to fix the radeon driver in this way?
Or that problem has to be solved differently?
Thanks in advance!
Created attachment 43262 [details]
Fix based on Alexander's proposal
I've just sent this patch to Benjamin Herrenschmidt.
BTW, note that using the kms radeon driver would solve your problem too, as this driver already has full support for hardware monitoring on Radeon cards.
In theory a thermal chip can be hooked up to any of the i2c buses on the asic, not just monid.
And in practice?
It's up to the oem. There's a table in the vbios that lists the i2c bus the thermal chip is on.