From: Eugen Hristev Date: Mon, 1 Oct 2018 16:26:43 +0300 Subject: [U-Boot] [PATCH v2 9/9] pinctrl: sandbox: Add get_pin_muxing ops support In-Reply-To: <1538395177-22493-10-git-send-email-patrice.chotard@st.com> References: <1538395177-22493-1-git-send-email-patrice.chotard@st.com> <1538395177-22493-10-git-send-email-patrice.chotard@st.com> Message-ID: <0d17efb9-6ae2-cc50-3181-007cdb10ab45@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01.10.2018 14:59, Patrice Chotard wrote: > Add get_pin_mux ops support to display the pin muxing > description of the sandbox_pins[] > > Signed-off-by: Patrice Chotard > --- > > Changes in v2: None > > drivers/pinctrl/pinctrl-sandbox.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/pinctrl/pinctrl-sandbox.c b/drivers/pinctrl/pinctrl-sandbox.c > index 755ac08bdf72..5c92acbff8e0 100644 > --- a/drivers/pinctrl/pinctrl-sandbox.c > +++ b/drivers/pinctrl/pinctrl-sandbox.c > @@ -17,6 +17,14 @@ static const char * const sandbox_pins[] = { > "W1" > }; > > +static const char * const sandbox_pins_muxing[] = { > + "I2C SCL", > + "I2C SDA", > + "Uart TX", > + "Uart RX", > + "Onwire gpio", You have a typo here, its "Onewire", but can name it "1-wire gpio" as it fits the most used naming. > +}; > + > static const char * const sandbox_groups[] = { > "i2c", > "serial_a", > @@ -56,6 +64,12 @@ static const char *sandbox_get_pin_name(struct udevice *dev, unsigned selector) > return sandbox_pins[selector]; > } > > +static const char *sandbox_get_pin_muxing(struct udevice *dev, > + unsigned int selector) > +{ > + return sandbox_pins_muxing[selector]; > +} > + > static int sandbox_get_groups_count(struct udevice *dev) > { > return ARRAY_SIZE(sandbox_groups); > @@ -123,6 +137,7 @@ static int sandbox_pinconf_group_set(struct udevice *dev, > const struct pinctrl_ops sandbox_pinctrl_ops = { > .get_pins_count = sandbox_get_pins_count, > .get_pin_name = sandbox_get_pin_name, > + .get_pin_muxing = sandbox_get_pin_muxing, > .get_groups_count = sandbox_get_groups_count, > .get_group_name = sandbox_get_group_name, > .get_functions_count = sandbox_get_functions_count, >