From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH] pinctrl: sun4i: GPIOs configured as irq must be set to input before reading Date: Wed, 11 Mar 2015 18:48:34 +0100 Message-ID: <20150311174834.GP5085@lukather> References: <1425849237-30182-1-git-send-email-hdegoede@redhat.com> Reply-To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="flW39HxDycSWn0NJ" Return-path: Content-Disposition: inline In-Reply-To: <1425849237-30182-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Hans de Goede Cc: Linus Walleij , Chen-Yu Tsai , devicetree , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Id: devicetree@vger.kernel.org --flW39HxDycSWn0NJ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline On Sun, Mar 08, 2015 at 10:13:57PM +0100, Hans de Goede wrote: > On sun4i-a10, when GPIOs are configured as external interrupt the value for > them in the data register does not seem to get updated, so set their mux to > input (and restore afterwards) when reading the pin. > > Missed edges seem to be buffered, so this does not introduce a race > condition. > > I've also tested this on sun5i-a13 and sun7i-a20 and those do not seem to > be affected, the input value representation in the data register does seem > to correctly get updated to the actual pin value while in irq mode there. > > Signed-off-by: Hans de Goede Acked-by: Maxime Ripard Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --flW39HxDycSWn0NJ--