From 7f63c0a246751e5424e7916fd1e20fe479a1dcfa Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sun, 21 Apr 2013 16:48:47 +0200 Subject: Add initial pinctrl support This is a massively stripped down pinctrl support. The upper API consists of only of: int pinctrl_select_state(struct device_d *dev, const char *state); This is used to setup the pinmux for a device to a certain state. This function normally does not need to be called manually. The device core will setup the default state before probing a device. The pinctrl core has the job of handling the devicetree. It parses the pinctrl phandles for a device from devicetree, finds the correct pinctrl device and calls its set_state callback with the pinctrl setup device node. The simplicity of this pinctrl framework comes from the fact that we: - Limit usage to devicetree only for now. For non devicetree use the old legacy SoC specific APIs still can be used. - Do not parse the devicetree into internal data structures which are used by the drivers later. This adds the overhead that we may parse the devicetree multiple times for more dynamic setups, but on the other hand we do not need to parse devices from the devicetree we don't use in barebox - Do not detect resource conflicts. Since the framework mainly is a devicetree parser this would be hard to implement. It should be easy for board maintainers to avoid resource conflicts though. Signed-off-by: Sascha Hauer --- drivers/base/driver.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/base/driver.c') diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 487f478d69..edd49b367f 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -31,6 +31,7 @@ #include #include #include +#include LIST_HEAD(device_list); EXPORT_SYMBOL(device_list); @@ -79,6 +80,8 @@ int device_probe(struct device_d *dev) { int ret; + pinctrl_select_state_default(dev); + ret = dev->bus->probe(dev); if (ret) { dev_err(dev, "probe failed: %s\n", strerror(-ret)); -- cgit v1.2.3