pinctrl: intel: Provide Intel pin control wide PM ops structure
With the help of EXPORT_NS_GPL_DEV_PM_OPS() and NOIRQ_SYSTEM_SLEEP_PM_OPS() we may convert PM ops functions to become static. This also takes into account the PM configuration options such as CONFIG_PM and CONFIG_PM_SLEEP. Hence the first step is to provide a generic PM ops structure that can be used by drivers directly. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20231030120734.2831419-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
b85ea95d08
commit
b10a74b5c0
2 changed files with 7 additions and 5 deletions
|
@ -899,7 +899,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
|
|||
*
|
||||
* Return: a GPIO offset, or negative error code if translation can't be done.
|
||||
*/
|
||||
static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
|
||||
static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
|
||||
{
|
||||
const struct intel_community *community;
|
||||
const struct intel_padgroup *padgrp;
|
||||
|
@ -1682,7 +1682,6 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
|
|||
}
|
||||
EXPORT_SYMBOL_NS_GPL(intel_pinctrl_get_soc_data, PINCTRL_INTEL);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static bool __intel_gpio_is_direct_irq(u32 value)
|
||||
{
|
||||
return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) &&
|
||||
|
@ -1883,7 +1882,10 @@ int intel_pinctrl_resume_noirq(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(intel_pinctrl_resume_noirq);
|
||||
#endif
|
||||
|
||||
EXPORT_NS_GPL_DEV_PM_OPS(intel_pinctrl_pm_ops, PINCTRL_INTEL) = {
|
||||
NOIRQ_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend_noirq, intel_pinctrl_resume_noirq)
|
||||
};
|
||||
|
||||
MODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>");
|
||||
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
|
||||
|
|
|
@ -255,10 +255,8 @@ struct intel_pinctrl {
|
|||
int intel_pinctrl_probe_by_hid(struct platform_device *pdev);
|
||||
int intel_pinctrl_probe_by_uid(struct platform_device *pdev);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
int intel_pinctrl_suspend_noirq(struct device *dev);
|
||||
int intel_pinctrl_resume_noirq(struct device *dev);
|
||||
#endif
|
||||
|
||||
#define INTEL_PINCTRL_PM_OPS(_name) \
|
||||
const struct dev_pm_ops _name = { \
|
||||
|
@ -266,6 +264,8 @@ const struct dev_pm_ops _name = { \
|
|||
intel_pinctrl_resume_noirq) \
|
||||
}
|
||||
|
||||
extern const struct dev_pm_ops intel_pinctrl_pm_ops;
|
||||
|
||||
struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, unsigned int pin);
|
||||
|
||||
int intel_get_groups_count(struct pinctrl_dev *pctldev);
|
||||
|
|
Loading…
Add table
Reference in a new issue