14005ee270
If a device have sleep and idle states in addition to the default state, look up these in the core and stash them in the pinctrl state container. Add accessor functions for pinctrl consumers to put the pins into "default", "sleep" and "idle" states passing nothing but the struct device * affected. Solution suggested by Kevin Hilman, Mark Brown and Dmitry Torokhov in response to a patch series from Hebbar Gururaja. Cc: Hebbar Gururaja <gururaja.hebbar@ti.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
|
* Per-device information from the pin control system.
|
|
* This is the stuff that get included into the device
|
|
* core.
|
|
*
|
|
* Copyright (C) 2012 ST-Ericsson SA
|
|
* Written on behalf of Linaro for ST-Ericsson
|
|
* This interface is used in the core to keep track of pins.
|
|
*
|
|
* Author: Linus Walleij <linus.walleij@linaro.org>
|
|
*
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
*/
|
|
|
|
#ifndef PINCTRL_DEVINFO_H
|
|
#define PINCTRL_DEVINFO_H
|
|
|
|
#ifdef CONFIG_PINCTRL
|
|
|
|
/* The device core acts as a consumer toward pinctrl */
|
|
#include <linux/pinctrl/consumer.h>
|
|
|
|
/**
|
|
* struct dev_pin_info - pin state container for devices
|
|
* @p: pinctrl handle for the containing device
|
|
* @default_state: the default state for the handle, if found
|
|
*/
|
|
struct dev_pin_info {
|
|
struct pinctrl *p;
|
|
struct pinctrl_state *default_state;
|
|
#ifdef CONFIG_PM
|
|
struct pinctrl_state *sleep_state;
|
|
struct pinctrl_state *idle_state;
|
|
#endif
|
|
};
|
|
|
|
extern int pinctrl_bind_pins(struct device *dev);
|
|
|
|
#else
|
|
|
|
/* Stubs if we're not using pinctrl */
|
|
|
|
static inline int pinctrl_bind_pins(struct device *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#endif /* CONFIG_PINCTRL */
|
|
#endif /* PINCTRL_DEVINFO_H */
|