/* SPDX-License-Identifier: GPL-2.0-only */


#ifndef PINCTRL_DEVINFO_H
#define PINCTRL_DEVINFO_H

struct device;

#ifdef CONFIG_PINCTRL

#include <linux/device.h>


#include <linux/pinctrl/consumer.h>

struct pinctrl;


struct dev_pin_info {
	struct pinctrl *p;
	struct pinctrl_state *default_state;
	struct pinctrl_state *init_state;
#ifdef CONFIG_PM
	struct pinctrl_state *sleep_state;
	struct pinctrl_state *idle_state;
#endif
};

extern int pinctrl_init_done(struct device *dev);

static inline struct pinctrl *dev_pinctrl(struct device *dev)
{
	if (!dev->pins)
		return NULL;

	return dev->pins->p;
}

#else



static inline int pinctrl_init_done(struct device *dev)
{
	return 0;
}

static inline struct pinctrl *dev_pinctrl(struct device *dev)
{
	return NULL;
}

#endif 
#endif 
