From: Heiko Schocher Date: Mon, 27 May 2019 14:06:03 +0200 Subject: [U-Boot] [PATCH v2] gpio: add gpio-hog support In-Reply-To: <660fd65d-45af-ce26-d13b-443e49685732@xilinx.com> References: <20190527104934.1177114-1-hs@denx.de> <660fd65d-45af-ce26-d13b-443e49685732@xilinx.com> Message-ID: <7824877a-b97a-cd91-992e-1c7cf4f6be47@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Michal, Am 27.05.2019 um 13:34 schrieb Michal Simek: > On 27. 05. 19 12:49, Heiko Schocher wrote: >> add gpio-hog support. GPIO hogging is a mechanism >> providing automatic GPIO request and configuration >> as part of the gpio-controller's driver probe function. >> >> for more infos see: >> doc/device-tree-bindings/gpio/gpio.txt >> >> Signed-off-by: Heiko Schocher >> >> --- >> not yet started clean travis build, see result: >> https://travis-ci.org/hsdenx/u-boot-test/builds/537732421 >> >> Changes in v2: >> - move gpio_hog() call from post_probe() to post_bind() >> call. Check if current gpio device has gpio-hog >> definitions, if so, probe it. > > I am using i2c to gpio chip and with v2 this chip is not listed via dm > completely. It means something is wrong for sure. What do you mean with "this chip is not listed via dm completely" ? > It looks like that parent is not probed that's why it is failing. I use this on the aristainetos board, work currently on rework for DM/DT usage in U-Boot, dts not yet in u-boot but in linux, see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi#n286 and added for u-boot now gpio hog definitons: &i2c3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; expander: tca6416 at 20 { compatible = "ti,tca6416"; reg = <0x20>; #gpio-cells = <2>; gpio-controller; env_reset { gpio-hog; input; gpios = <6 GPIO_ACTIVE_LOW>; }; boot_rescue { gpio-hog; input; gpios = <7 GPIO_ACTIVE_LOW>; }; }; }; works fine for me ... => dm tree Class Index Probed Driver Name ----------------------------------------------------------- root 0 [ + ] root_driver root_driver [...] i2c 2 [ + ] i2c_mxc | | |-- i2c at 21a8000 gpio 7 [ + ] pca953x | | | |-- tca6416 at 20 => gpio status [...] Bank gpio at 20_: gpio at 20_6: input: 0 [x] env_reset.gpio-hog gpio at 20_7: input: 1 [x] boot_rescue.gpio-hog => Hmm.. how can I reproduce your problem? bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de