From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933446AbdCaN21 (ORCPT ); Fri, 31 Mar 2017 09:28:27 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:42310 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933137AbdCaN2Z (ORCPT ); Fri, 31 Mar 2017 09:28:25 -0400 Date: Fri, 31 Mar 2017 15:28:22 +0200 From: Boris Brezillon To: Simon Hatliff Cc: Linus Walleij , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Petazzoni Subject: Re: [PATCH 1/2] gpio: Add a driver for Cadence GPIO controller Message-ID: <20170331152822.20d30bb4@bbrezillon> In-Reply-To: <3422ee23-53b5-8d09-2a5e-d700358ab09d@cadence.com> References: <1490803459-29697-1-git-send-email-boris.brezillon@free-electrons.com> <20170330132946.41314874@bbrezillon> <3422ee23-53b5-8d09-2a5e-d700358ab09d@cadence.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Mar 2017 18:26:01 +0100 Simon Hatliff wrote: > > Another solution would be to write 0xffffffff into CDNS_GPIO_OUTPUT_EN > > at probe time so that each time CDNS_GPIO_DIRECTION_MODE is modified to > > set a pin in output mode, the CDNS_GPIO_OUTPUT_EN is already correctly > > configured. > > Simon, would that work? Is there a good reason to keep a bit in > > CDNS_GPIO_OUTPUT_EN set to 0 when the GPIO is in input mode (power > > consumption?)? > If direction_mode is set to input then output_en is ignored so this > should work. The hardware defaults to output mode, so as long as you > set all pins to input mode before you set all output_en bits there > should be no negative effect. Okay, I'll try something like that, except I'll probably keep already output-enabled in their existing state to avoid modifying bootloader's GPIO settings. Thanks for the feedback. Boris