pinctrl: Add new function pinctrl_generic_set_state_prefix()

This new function pinctrl_generic_set_state_prefix() behaves like
pinctrl_generic_set_state() but it takes third string argument which is
used as the prefix for each device tree string property.

This is needed for Marvell pinctrl drivers, becase Linux device tree files
have pinmux properties prefixed by "marvell," string.

This change allows to use generic U-Boot pinctrl functions for Armada 38x
pinctrl driver without need to copy+paste of the majority U-Boot pinctrl
code.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Pali Rohár
2022-07-25 13:56:08 +02:00
committed by Stefan Roese
parent 87069c79e8
commit 92c4a95ec7
2 changed files with 98 additions and 30 deletions

View File

@@ -491,6 +491,8 @@ enum pin_config_param {
* Return: 0 on success, or negative error code on failure
*/
int pinctrl_generic_set_state(struct udevice *pctldev, struct udevice *config);
int pinctrl_generic_set_state_prefix(struct udevice *pctldev, struct udevice *config,
const char *prefix);
#else
static inline int pinctrl_generic_set_state(struct udevice *pctldev,
struct udevice *config)