From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Thu, 31 Mar 2016 13:41:04 -0700 Subject: [U-Boot] [PATCH] dm: gpio: handle GPIO_ACTIVE_LOW flag in DT In-Reply-To: <20160329045729.GA32493@linux-7smt.suse> References: <1458936731-13223-1-git-send-email-eric@nelint.com> <20160329045729.GA32493@linux-7smt.suse> Message-ID: <56FD8B60.8060103@nelint.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Peng, On 03/28/2016 09:57 PM, Peng Fan wrote: > Hi Eric, > > On Fri, Mar 25, 2016 at 01:12:11PM -0700, Eric Nelson wrote: >> Device tree parsing of GPIO nodes is currently ignoring flags. >> >> Add support for GPIO_ACTIVE_LOW by checking for the presence >> of the flag and setting the desc->flags field to the driver >> model constant GPIOD_ACTIVE_LOW. > > You may need to try this: https://patchwork.ozlabs.org/patch/597363/ > Thanks for pointing this out. This patch also works, but it has me confused. How/why is parsing the ACTIVE_LOW flag specific to MXC? This is a general-purpose flag in the kernel, not something machine- specific. It also appears that there are a bunch of other copies of this same bit of code in the various mach_xlate() routines: desc->flags = args->args[1] & GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0; If it's done in gpio-uclass, this isn't needed and xlate can be removed from mxc-gpio and quite a few other architectures. Please advise, Eric