diff options
author | Russ Dill <Russ.Dill@ti.com> | 2014-08-26 11:13:28 +0530 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2014-09-01 10:55:11 +0300 |
commit | cd9197f3e9b0e776981334639767b0f49bc512ac (patch) | |
tree | 6b9511e5f32da707b60bd66dacca1f63f52af20e /include | |
parent | bcb3a7191f82f4aed2043ace275c2fa98402fcff (diff) |
ARM: OMAP2: Add functions to save and restore pinctrl context.
This adds a pair of context save/restore functions to save/restore the state
of a set of pinctrl registers. This simplifies some of the AM33XX PM code as
some of the pinctrl registers are lost when the per power domain loses power.
The pincrtl code can perform the necessary save/restore.
This will also be necessary for hibernation and RTC only sleep, as all
pinctrl registers all lost.
Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
[t-kristo@ti.com: dropped unnecessary code]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
[j-keerthy@ti.com] ported to 3.14
Signed-off-by: Keerthy <j-keerthy@ti.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 7 | ||||
-rw-r--r-- | include/linux/pinctrl/pinmux.h | 16 |
2 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index cc8e1aff0e2..b81a298abd1 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -163,6 +163,7 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); +extern struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *dev_name); #else struct pinctrl_dev; @@ -173,6 +174,12 @@ static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin) return pin >= 0; } +static inline struct pinctrl_dev *get_pinctrl_dev_from_devname( + const char *dev_name) +{ + return NULL; +} + #endif /* !CONFIG_PINCTRL */ #endif /* __LINUX_PINCTRL_PINCTRL_H */ diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index c15395031cb..d2c1d536dc8 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h @@ -72,6 +72,8 @@ struct pinmux_ops { unsigned group_selector); void (*disable) (struct pinctrl_dev *pctldev, unsigned func_selector, unsigned group_selector); + int (*save_context)(struct pinctrl_dev *pctldev); + void (*restore_context)(struct pinctrl_dev *pctldev); int (*gpio_request_enable) (struct pinctrl_dev *pctldev, struct pinctrl_gpio_range *range, unsigned offset); @@ -84,6 +86,20 @@ struct pinmux_ops { bool input); }; +int pinmux_save_context(struct pinctrl_dev *pctldev, const char *function); +void pinmux_restore_context(struct pinctrl_dev *pctldev, const char *function); + +#else /* !CONFIG_PINMUX */ + +static inline int pinmux_save_context(struct pinctrl_dev *pctldev, + const char *function) +{ + return 0; +} + +static inline void pinmux_restore_context(struct pinctrl_dev *pctldev, + const char *function) {} + #endif /* CONFIG_PINMUX */ #endif /* __LINUX_PINCTRL_PINMUX_H */ |