mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 08:15:17 +07:00
e73339037f
The main goal of the change is to remove .pin_config_dbg_parse_modify
callback before a driver with its support appears. So far the in-kernel
interface did not attract any users since its introduction 5 years ago.
Originally .pin_config_dbg_parse_modify callback and the associated
'pinconf-config' debugfs file were introduced in commit f07512e615
("pinctrl/pinconfig: add debug interface"), a short description of
'pinconf-config' usage for debugging can be expressed this way:
Write to 'pinconf-config' (see pinconf_dbg_config_write() function):
% echo -n modify $map_type $device_name $state_name $pin_name $config > \
/sys/kernel/debug/pinctrl/$pinctrl/pinconf-config
It supposes to update a global (therefore single!) 'pinconf_dbg_conf'
variable with an alternative setting, the arguments should match
an existing pinconf device and some registered pinctrl mapping 'map':
* $map_type is either 'config_pin' or 'config_group', it should match
'map->type' value of PIN_MAP_TYPE_CONFIGS_PIN or
PIN_MAP_TYPE_CONFIGS_GROUP accordingly,
* $device_name should match 'map->dev_name' string value,
* $state_name should match 'map->name' string value,
* $pin_name should match 'map->data.configs.group_or_pin' string value,
If all above has matched, then $config is a new value to be set by calling
pinconfops->pin_config_dbg_parse_modify(pctldev, config, matched_config).
After a successful write into 'pinconf-config' a user can read the file
to get information about that single modified pin configuration.
The fact is .pin_config_dbg_parse_modify callback has never been defined
in 'struct pinconf_ops' of any pinconf driver, thus an actual modification
of a pin or group state on any present pinconf controller does not happen,
and it declares that all related code is no more than dead code.
I discovered the issue while attempting to add .pin_config_dbg_parse_modify
support in some drivers and found that too short 'MAX_NAME_LEN' set by
drivers/pinctrl/pinconf.c:372:#define MAX_NAME_LEN 15
is practically insufficient to store a regular pinctrl device name,
which are like 'e6060000.pin-controller-sh-pfc' or pin names like
'MX6QDL_PAD_ENET_REF_CLK', thus it is another indicator that the code
is barely usable, insufficiently tested and unprepossessing.
Of course it might be possible to increase MAX_NAME_LEN, and then add
.pin_config_dbg_parse_modify callbacks to the drivers, but the whole
idea of such a limited debug option looks inviable. A more flexible
way to functionally substitute the original approach is to implicitly
or explicitly use pinctrl_select_state() function whenever needed.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Cc: Laurent Meunier <laurent.meunier@st.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
71 lines
2.5 KiB
C
71 lines
2.5 KiB
C
/*
|
|
* 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>
|
|
*
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
*/
|
|
#ifndef __LINUX_PINCTRL_PINCONF_H
|
|
#define __LINUX_PINCTRL_PINCONF_H
|
|
|
|
#ifdef CONFIG_PINCONF
|
|
|
|
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 pin,
|
|
unsigned long *config);
|
|
int (*pin_config_set) (struct pinctrl_dev *pctldev,
|
|
unsigned pin,
|
|
unsigned long *configs,
|
|
unsigned num_configs);
|
|
int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
|
|
unsigned selector,
|
|
unsigned long *config);
|
|
int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
|
|
unsigned selector,
|
|
unsigned long *configs,
|
|
unsigned num_configs);
|
|
void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned offset);
|
|
void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned selector);
|
|
void (*pin_config_config_dbg_show) (struct pinctrl_dev *pctldev,
|
|
struct seq_file *s,
|
|
unsigned long config);
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif /* __LINUX_PINCTRL_PINCONF_H */
|