Skip to contentSkip to conversation

I2C_CLASS_HWMON vs. I2C_CLASS_ALL for i2c adapter driver

DISCUSSION Mark A. Greer 2 participants 3 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

Chris Elston pointed out an oversight that I made in drivers/i2c/busses/i2c-mv64xxx.c. I didn't set the adapter owner and class fields. (The ctlr is a basic i2c ctlr residing on the hostbridge/Northbridge.)

My question is, should I set the class field to I2C_CLASS_HWMON or I2C_CLASS_ALL? Theoretically [AFAIK], this ctlr can talk to any type of i2c client so I2C_CLASS_ALL seems like the right one to use. However, no other driver uses it which worries me.

I searched the FAQ and googled for previous email threads. There was a discussion around a year ago that touched on it but I couldn't find anything definitive.

What is the correct one to use?

Thanks,

Mark

#1 lore raw

Hi Mark,

Quoted 9 lines

Chris Elston pointed out an oversight that I made in drivers/i2c/busses/i2c-mv64xxx.c. I didn't set the adapter owner and class fields. (The ctlr is a basic i2c ctlr residing on the hostbridge/Northbridge.)

My question is, should I set the class field to I2C_CLASS_HWMON or I2C_CLASS_ALL? Theoretically [AFAIK], this ctlr can talk to any type of i2c client so I2C_CLASS_ALL seems like the right one to use. However, no other driver uses it which worries me.

In theory, almost any client could be connected to almost any adapter. The class field was added to express the known, existing combinations, not the theoretical ones. Use I2C_CLASS_HWMON. If you now you need another class, OR it. No adapter should ever use I2C_CLASS_ALL (in fact I see very little reason why it was defined in the first place).

Basically, the idea is to prevent hardware monitoring chip drivers from accessing the video i2c busses.

Hope that helps,

Signature · 1 line
Jean Delvare
#2 lore raw
In reply to Mark A. Greer
Quoted 22 lines · Jean Delvare

Hi Mark,

Quoted 11 lines

Chris Elston pointed out an oversight that I made in drivers/i2c/busses/i2c-mv64xxx.c. I didn't set the adapter owner and class fields. (The ctlr is a basic i2c ctlr residing on the hostbridge/Northbridge.)

My question is, should I set the class field to I2C_CLASS_HWMON or I2C_CLASS_ALL? Theoretically [AFAIK], this ctlr can talk to any type of i2c client so I2C_CLASS_ALL seems like the right one to use. However, no other driver uses it which worries me.

In theory, almost any client could be connected to almost any adapter. The class field was added to express the known, existing combinations, not the theoretical ones. Use I2C_CLASS_HWMON. If you now you need another class, OR it. No adapter should ever use I2C_CLASS_ALL (in fact I see very little reason why it was defined in the first place).

Quoted 6 lines

Basically, the idea is to prevent hardware monitoring chip drivers from accessing the video i2c busses.

Hope that helps,

Yes it does! I2C_CLASS_HWMON it is.

Thanks Jean.

Mark