Re: qestion about I2C_CLASS_HWMON flag

From: Francis Moreau
Date: Fri Sep 05 2008 - 09:38:37 EST


On Fri, Sep 5, 2008 at 3:11 PM, Jean Delvare <khali@xxxxxxxxxxxx> wrote:
> On Fri, 5 Sep 2008 14:44:30 +0200, Francis Moreau wrote:
>> On Fri, Sep 5, 2008 at 11:20 AM, Jean Delvare <khali@xxxxxxxxxxxx> wrote:
>> > Nothing prevents you from setting the class flags based on
>> > platform-specific information if you have a need for that.
>>
>> Just to be sure, do you mean by hacking the adapter source code ?
>
> It's not about hacking, it can be done cleanly. Just have the adapter
> driver code check for information in the platform data, and if class
> information is provided, use that instead of the default value. Or if
> all users will provide the information, don't even have a default in
> the driver. Again, the class flags are a (needed) mechanism, the policy
> is left for driver authors and platform maintainers to establish.
>

Ah OK I see now.

On v2.6.23 i2c-gpio.c had no I2C_CLASS_HWMON flag set and
had no way to pass this info from platform board.

But on v2.6.27 it is now set whatever the platforms.

Wouldn't it have been better to allow the platform code to pass this type
information through the 'i2c_gpio_platform_data' structure for example ?

Thanks Jean !
--
Francis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/