Re: [PATCH 4/8] minnowboard: Add base platform driver for the MinnowBoard

From: Linus Walleij
Date: Thu Jun 27 2013 - 05:14:41 EST


On Wed, Jun 26, 2013 at 3:53 AM, Darren Hart <dvhart@xxxxxxxxxxxxxxx> wrote:

> Provide a minimal public interface:
> minnow_detect()
> minnow_lvds_detect()
> minnow_hwid()
> minnow_phy_reset()

So instead of these calling drivers issueing gpio_request() themselves
to obtain a resource, they make a function call to this proxy that issue
gpio_request() for them.

This is generally not how we do things. A driver should request its
GPIO just as it requests its regulator or clock or IRQ line or anything
else. Centralizing resource handling is not a good idea IMO, it's better
that each driver request it's GPIO pin(s) and do the stuff it needs
with them.

This of course creates the problem of associating the GPIOs to a
driver and how it should look that up, which I guess ACPI can do,
isn't that what acpi_find_gpio() is for?

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/