mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
pinctrl: sandbox: Add get_pin_muxing ops support
Add get_pin_mux ops support to display the pin muxing description of the sandbox_pins[] Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:

committed by
Tom Rini

parent
cad732499b
commit
21e23aaff6
@ -17,6 +17,14 @@ static const char * const sandbox_pins[] = {
|
|||||||
"W1"
|
"W1"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char * const sandbox_pins_muxing[] = {
|
||||||
|
"I2C SCL",
|
||||||
|
"I2C SDA",
|
||||||
|
"Uart TX",
|
||||||
|
"Uart RX",
|
||||||
|
"1-wire gpio",
|
||||||
|
};
|
||||||
|
|
||||||
static const char * const sandbox_groups[] = {
|
static const char * const sandbox_groups[] = {
|
||||||
"i2c",
|
"i2c",
|
||||||
"serial_a",
|
"serial_a",
|
||||||
@ -56,6 +64,15 @@ static const char *sandbox_get_pin_name(struct udevice *dev, unsigned selector)
|
|||||||
return sandbox_pins[selector];
|
return sandbox_pins[selector];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sandbox_get_pin_muxing(struct udevice *dev,
|
||||||
|
unsigned int selector,
|
||||||
|
char *buf, int size)
|
||||||
|
{
|
||||||
|
snprintf(buf, size, "%s", sandbox_pins_muxing[selector]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int sandbox_get_groups_count(struct udevice *dev)
|
static int sandbox_get_groups_count(struct udevice *dev)
|
||||||
{
|
{
|
||||||
return ARRAY_SIZE(sandbox_groups);
|
return ARRAY_SIZE(sandbox_groups);
|
||||||
@ -123,6 +140,7 @@ static int sandbox_pinconf_group_set(struct udevice *dev,
|
|||||||
const struct pinctrl_ops sandbox_pinctrl_ops = {
|
const struct pinctrl_ops sandbox_pinctrl_ops = {
|
||||||
.get_pins_count = sandbox_get_pins_count,
|
.get_pins_count = sandbox_get_pins_count,
|
||||||
.get_pin_name = sandbox_get_pin_name,
|
.get_pin_name = sandbox_get_pin_name,
|
||||||
|
.get_pin_muxing = sandbox_get_pin_muxing,
|
||||||
.get_groups_count = sandbox_get_groups_count,
|
.get_groups_count = sandbox_get_groups_count,
|
||||||
.get_group_name = sandbox_get_group_name,
|
.get_group_name = sandbox_get_group_name,
|
||||||
.get_functions_count = sandbox_get_functions_count,
|
.get_functions_count = sandbox_get_functions_count,
|
||||||
|
Reference in New Issue
Block a user