From: Patrice CHOTARD Date: Tue, 9 Oct 2018 13:17:19 +0000 Subject: [U-Boot] [PATCH v2 0/9] Add pinmux command In-Reply-To: References: <1538395177-22493-1-git-send-email-patrice.chotard@st.com> Message-ID: <6a8f7fbe-fd9e-9a06-d635-23f5d157792e@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon On 10/04/2018 03:13 AM, Simon Glass wrote: > Hi Patrice, > > On 1 October 2018 at 05:59, Patrice Chotard wrote: >> >> For debug purpose, it's useful to know the pins muxing >> to check if a pin is configured as a GPIO or as an alternate >> function and to get information about this alternate function >> configuration. For this purpose a new command pinmux is implemented. >> >> This series adds: >> - Add get_pin_muxing ops to UCLASS pinctrl >> - Add pinmux command >> - Add get_function() support to stm32 gpio driver >> - Add get_pins_count() support to stm32 pinctrl driver >> - Add get_pin_name() support to stm32 pinctrl driver >> - Add get_pin_muxing() support to stm32 pinctrl driver >> >> Changes in v2: >> - Replace pinmux_show ops which displayed the complete pin-controller >> muxing by get_pin_muxing ops which displays the muxing of one pin >> - In order to make pin muxing display less SoC specific, >> use pinctrl_pins_count(), pinctrl_get_pin_name() and >> pinctrl_get_pin_muxing() methods instead of >> previous pinctrl_pinmux_show() method. > > This looks good to me. The only think I don't like is using static > char for the string. > > Can we instead pass > > char *buf, int size > > to each method and have it snprintf() the text directly into that > buffer? The methods can then return 0 if all is well, -ve on error. Ok, i will update this part Thanks Patrice > > Regards, > Simon >