From: Vikas MANOCHA Date: Sun, 12 Feb 2017 18:09:21 +0000 Subject: [U-Boot] [PATCH 06/10] PINCTRL: stm32f7: add pin control driver In-Reply-To: References: <1486248221-20978-1-git-send-email-vikas.manocha@st.com> <1486248221-20978-7-git-send-email-vikas.manocha@st.com> <1f030511-224e-323d-a697-613c48bec7aa@st.com> Message-ID: <61a6a65e90ae4d3ca6651363c1a0e91b@SFHDAG7NODE3.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 Thanks Simon, > -----Original Message----- > From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass > Sent: Saturday, February 11, 2017 12:20 PM > To: Vikas MANOCHA > Cc: U-Boot Mailing List ; Beniamino Galvani ; Daniel Schwierzeck > ; Heiko St?bner ; Kever Yang ; Konstantin > Porotchkin ; Masahiro Yamada ; Minkyu Kang > ; Peng Fan ; Stefan Roese ; Thomas Abraham > ; Wenyou Yang ; Wills Wang > Subject: Re: [PATCH 06/10] PINCTRL: stm32f7: add pin control driver > > Hi Vikas, > > On 10 February 2017 at 14:39, vikas wrote: > > Hi Simon, > > > > On 02/10/2017 08:22 AM, Simon Glass wrote: > >> Hi Vikas, > >> > >> On 4 February 2017 at 15:43, Vikas Manocha wrote: > >>> This driver uses the same pin control binding as that of linux, > >>> binding document of this patch is copied from linux. One addition > >>> done is for GPIO input and output mode configuration which was missing. > >>> > >>> Signed-off-by: Vikas Manocha > >>> --- > >>> configs/stm32f746-disco_defconfig | 3 + > >>> .../pinctrl/st,stm32-pinctrl.txt | 133 +++++++++++++++++++++ > >>> drivers/pinctrl/Kconfig | 9 ++ > >>> drivers/pinctrl/Makefile | 1 + > >>> drivers/pinctrl/pinctrl_stm32.c | 118 ++++++++++++++++++ > >>> 5 files changed, 264 insertions(+) > >>> create mode 100644 > >>> doc/device-tree-bindings/pinctrl/st,stm32-pinctrl.txt > >>> create mode 100644 drivers/pinctrl/pinctrl_stm32.c > >> > >> Reviewed-by: Simon Glass > >> > >> nits below > >> > [..] > > >> > >>> + fdt_get_property(gd->fdt_blob, args.node, "pinmux", &len); > >>> + len /= 4; > >>> + debug("%s: no of pinmux entries= %d\n", __func__, len); > >>> + rv = fdtdec_get_int_array(gd->fdt_blob, args.node, > >>> + "pinmux", pin_mux, > >>> + len); > >> > >> Can you use fdtdec_get_int_array_count() ? > > > > Yes but it's almost same, the only difference being xxx_array_count is relaxed on lenght/count. > > And in this case we are reading length of the property just before. > > > > In any case, i will change it to xxx_array_count in v2. > > Yes your code works. I'm only suggesting the change because, in a way, > fdt_get_property() is quite a low-level function. You can do what you want with an fdtdec function and thus avoid using libfdt > directly. Ah..got it, I will remove the length check & use xxx_array_count in v3. Cheers, Vikas > > [...] > > Regards, > Simon