
Thanks Simon,
-----Original Message----- From: sjg@google.com [mailto:sjg@google.com] On Behalf Of Simon Glass Sent: Saturday, February 11, 2017 12:20 PM To: Vikas MANOCHA vikas.manocha@st.com Cc: U-Boot Mailing List u-boot@lists.denx.de; Beniamino Galvani b.galvani@gmail.com; Daniel Schwierzeck daniel.schwierzeck@gmail.com; Heiko Stübner heiko@sntech.de; Kever Yang kever.yang@rock-chips.com; Konstantin Porotchkin kostap@marvell.com; Masahiro Yamada yamada.masahiro@socionext.com; Minkyu Kang mk7.kang@samsung.com; Peng Fan van.freenix@gmail.com; Stefan Roese sr@denx.de; Thomas Abraham thomas.ab@samsung.com; Wenyou Yang wenyou.yang@atmel.com; Wills Wang wills.wang@live.com Subject: Re: [PATCH 06/10] PINCTRL: stm32f7: add pin control driver
Hi Vikas,
On 10 February 2017 at 14:39, vikas vikas.manocha@st.com wrote:
Hi Simon,
On 02/10/2017 08:22 AM, Simon Glass wrote:
Hi Vikas,
On 4 February 2017 at 15:43, Vikas Manocha vikas.manocha@st.com 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 vikas.manocha@st.com
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 sjg@chromium.org
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