Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
68 lines
2.5 KiB
C
68 lines
2.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Interface the pinconfig portions of the pinctrl subsystem
|
|
*
|
|
* Copyright (C) 2011 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>
|
|
*/
|
|
#ifndef __LINUX_PINCTRL_PINCONF_H
|
|
#define __LINUX_PINCTRL_PINCONF_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct pinctrl_dev;
|
|
struct seq_file;
|
|
|
|
/**
|
|
* struct pinconf_ops - pin config operations, to be implemented by
|
|
* pin configuration capable drivers.
|
|
* @is_generic: for pin controllers that want to use the generic interface,
|
|
* this flag tells the framework that it's generic.
|
|
* @pin_config_get: get the config of a certain pin, if the requested config
|
|
* is not available on this controller this should return -ENOTSUPP
|
|
* and if it is available but disabled it should return -EINVAL
|
|
* @pin_config_set: configure an individual pin
|
|
* @pin_config_group_get: get configurations for an entire pin group; should
|
|
* return -ENOTSUPP and -EINVAL using the same rules as pin_config_get.
|
|
* @pin_config_group_set: configure all pins in a group
|
|
* @pin_config_dbg_show: optional debugfs display hook that will provide
|
|
* per-device info for a certain pin in debugfs
|
|
* @pin_config_group_dbg_show: optional debugfs display hook that will provide
|
|
* per-device info for a certain group in debugfs
|
|
* @pin_config_config_dbg_show: optional debugfs display hook that will decode
|
|
* and display a driver's pin configuration parameter
|
|
*/
|
|
struct pinconf_ops {
|
|
#ifdef CONFIG_GENERIC_PINCONF
|
|
bool is_generic;
|
|
#endif
|
|
int (*pin_config_get) (struct pinctrl_dev *pctldev,
|
|
unsigned int pin,
|
|
unsigned long *config);
|
|
int (*pin_config_set) (struct pinctrl_dev *pctldev,
|
|
unsigned int pin,
|
|
unsigned long *configs,
|
|
unsigned int num_configs);
|
|
int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
|
|
unsigned int selector,
|
|
unsigned long *config);
|
|
int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
|
|
unsigned int selector,
|
|
unsigned long *configs,
|
|
unsigned int num_configs);
|
|
void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned int offset);
|
|
void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned int selector);
|
|
void (*pin_config_config_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned long config);
|
|
};
|
|
|
|
#endif /* __LINUX_PINCTRL_PINCONF_H */
|