Re: [PATCH] gpio: add GPIO support for F71882FG and F71889F

From: Linus Walleij
Date: Sun Jul 21 2013 - 10:35:43 EST


On Mon, Jul 1, 2013 at 6:28 PM, Simon Guinot <simon.guinot@xxxxxxxxxxxx> wrote:
> On Sun, Jun 30, 2013 at 01:35:00AM +0200, Linus Walleij wrote:

>> > +static struct platform_driver f7188x_gpio_driver = {
>> > + .driver = {
>> > + .owner = THIS_MODULE,
>> > + .name = DRVNAME,
>> > + },
>> > + .probe = f7188x_gpio_probe,
>> > + .remove = f7188x_gpio_remove,
>> > +};
>> > +
>> > +static int __init f7188x_gpio_init(void)
>> > +{
>> > + int err;
>> > + struct f7188x_sio sio;
>> > +
>> > + if (f7188x_find(0x2e, &sio) &&
>> > + f7188x_find(0x4e, &sio))
>> > + return -ENODEV;
>>
>> This looks like the life on the ISA-bus. Is that not dangerous?
>
> I guess this looks like the ISA bus because this super-I/O uses the LPC
> bus which is ISA-compatible. At my knowledge, reading this I/O ports
> and trying to match the vendor and device IDs is the only way to
> identify the super-I/O chip. For example, have a look at the drivers
> f71882fg (hwmon) and f71808e_wdt (watchdog). Both are using the same
> identification mechanism.

As said yesterday, this is OK, I guess.

Auto-detection is always to be preferred.

I was just worrying if it could somehow be hazardous if this
module is loaded on systems without this hardware.

It also goes against the trend of describing hardware using
things like devicetree or ACPI tables, but that is a broader
discussion and something we cannot always influence.

Yours,
Linus Walleij
--
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/