Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753463AbbHESLp (ORCPT ); Wed, 5 Aug 2015 14:11:45 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:35073 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbbHESLm (ORCPT ); Wed, 5 Aug 2015 14:11:42 -0400 MIME-Version: 1.0 In-Reply-To: <20150805180215.GA4161@localhost.localdomain> References: <1438795388-22743-1-git-send-email-edubezval@gmail.com> <1438795388-22743-3-git-send-email-edubezval@gmail.com> <20150805180215.GA4161@localhost.localdomain> Date: Wed, 5 Aug 2015 15:11:40 -0300 Message-ID: Subject: Re: [PATCH 2/2] gpio/mxc: implement reading output gpio value From: Fabio Estevam To: Eduardo Valentin Cc: Linus Walleij , Alexandre Courbot , Ulises Brindis , Fabio Estevam , "linux-gpio@vger.kernel.org" , linux-kernel , Russell King Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1473 Lines: 38 Hi Eduardo, On Wed, Aug 5, 2015 at 3:02 PM, Eduardo Valentin wrote: > > Hello Fabio, > > On Wed, Aug 05, 2015 at 02:43:05PM -0300, Fabio Estevam wrote: >> Hi Eduardo, >> >> On Wed, Aug 5, 2015 at 2:23 PM, Eduardo Valentin wrote: >> > In current implementation, reading the value of an output gpio >> > always return 0. The reason is because when a gpio is configured >> >> Have you tried setting the SION bit for the pad? > > No, I haven't. From the bit description, it looks like it does a > different thing of what we would achieve with this patch. The SION bit > is a overwrite to the pad configuration. That is, the pin will be INPUT > always. > > We don't want to force it to be input. We simply want to be able to read > the value of an output GPIO. That is achievable by reading a different > register. In case the GPIO is configured as output, the GPIO block > documentation states its value can be read from GPIO_PSR. > This approach works fine, as the GPIO will be output and we can still > read its value. Setting the SION bit allows you to do exactly that. Please see: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/271774.html Regards, Fabio Estevam -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/