mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
pinctrl: pinconf: Allow groups to be configured via debugfs
The function pinconf_dbg_config_write() currently only supports configuring a pin configuration mapping via the debugfs. Allow group mappings to also be configured via the debugfs. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
ad64498762
commit
7562998106
1 changed files with 14 additions and 6 deletions
|
@ -470,10 +470,12 @@ static int pinconf_dbg_config_print(struct seq_file *s, void *d)
|
||||||
* pinconf_dbg_config_write() - modify the pinctrl config in the pinctrl
|
* pinconf_dbg_config_write() - modify the pinctrl config in the pinctrl
|
||||||
* map, of a dev/pin/state entry based on user entries to pinconf-config
|
* map, of a dev/pin/state entry based on user entries to pinconf-config
|
||||||
* @user_buf: contains the modification request with expected format:
|
* @user_buf: contains the modification request with expected format:
|
||||||
* modify config_pin <devicename> <state> <pinname> <newvalue>
|
* modify <config> <devicename> <state> <name> <newvalue>
|
||||||
* modify is literal string, alternatives like add/delete not supported yet
|
* modify is literal string, alternatives like add/delete not supported yet
|
||||||
* config_pin is literal, alternatives like config_mux not supported yet
|
* <config> is the configuration to be changed. Supported configs are
|
||||||
* <devicename> <state> <pinname> are values that should match the pinctrl-maps
|
* "config_pin" or "config_group", alternatives like config_mux are not
|
||||||
|
* supported yet.
|
||||||
|
* <devicename> <state> <name> are values that should match the pinctrl-maps
|
||||||
* <newvalue> reflects the new config and is driver dependant
|
* <newvalue> reflects the new config and is driver dependant
|
||||||
*/
|
*/
|
||||||
static ssize_t pinconf_dbg_config_write(struct file *file,
|
static ssize_t pinconf_dbg_config_write(struct file *file,
|
||||||
|
@ -511,13 +513,19 @@ static ssize_t pinconf_dbg_config_write(struct file *file,
|
||||||
if (strcmp(token, "modify"))
|
if (strcmp(token, "modify"))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Get arg type: "config_pin" type supported so far */
|
/*
|
||||||
|
* Get arg type: "config_pin" and "config_group"
|
||||||
|
* types are supported so far
|
||||||
|
*/
|
||||||
token = strsep(&b, " ");
|
token = strsep(&b, " ");
|
||||||
if (!token)
|
if (!token)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (strcmp(token, "config_pin"))
|
if (!strcmp(token, "config_pin"))
|
||||||
|
dbg->map_type = PIN_MAP_TYPE_CONFIGS_PIN;
|
||||||
|
else if (!strcmp(token, "config_group"))
|
||||||
|
dbg->map_type = PIN_MAP_TYPE_CONFIGS_GROUP;
|
||||||
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
dbg->map_type = PIN_MAP_TYPE_CONFIGS_PIN;
|
|
||||||
|
|
||||||
/* get arg 'device_name' */
|
/* get arg 'device_name' */
|
||||||
token = strsep(&b, " ");
|
token = strsep(&b, " ");
|
||||||
|
|
Loading…
Reference in a new issue