Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2269558imm; Thu, 11 Oct 2018 07:44:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV61s8D6Wb2vB48AUNkQDgwmZl1Y6hMs3ObqRu+rKiCHxFuGJ2gqcrcrTtpDW6CqxP0Dkgyfn X-Received: by 2002:aa7:814f:: with SMTP id d15-v6mr1906092pfn.78.1539269068083; Thu, 11 Oct 2018 07:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539269068; cv=none; d=google.com; s=arc-20160816; b=h0nBN8HD7YiDyR67B1QVrBswRJJ90/eJdYXY92tBy7KFEtxULy7RKapFJ7tt9ir98n tQ3YNZ8xk/0d7hdhLazTbPXvk52Ds9XFlCW30oZlW23lYuuA+KEAVDhVVMCj5Y5QUpAI 2KrEYtps9JKXnxL8UJkEByxw+ffizuk8tqIT6tg0SEkJma7W8rmn+W5CRCHINzlNq0Ax XBsgmOfE95tpJQwIYCWseq5DzAdq+FCsZE20JtbhVczU1kl/hoGxh0iFFvGZ53jAOT8m iPuJiF6EHByIWzkh7vk3B9VIjYX4jxA8qaJrSe5ssDhOUCC/ztaAInypt/W/AYlbenwG /0lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hEOMw4Gr5BkGstRKzySUbZCPiJkT3OspbuLHw0kWaaQ=; b=v1vE62FRUWT+IRFNi34xDPFNJPtFOwuuXJEOAEsq2ONvjj4xLyoYL8a59hENkZsZEl pIfeWY3/tS4aElL4d2HsNkK4VabMEe+W+0xXuMhfTp9P+/H9DuC9P7D5YNiMtXtuIqZj hRuh7kspc8mTrpbsAYpv9JqFY7/4liPacBKf33j/Yjvfa2k1hIopFAO2j335s1a0lg/j tm8z2YLW8J+Eka+SKstZXjNdGQCIIPYdxbmpBPhkO8+fl0thtzE4jx+TUE5wpoyLX3i0 KmWqxHjszVcybXWArCW4KEzzBvuCWpBwJ8uAUzNg1DiBEn784/WJY1pR1cvVSSL1S4SJ rSSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=wikghze3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c89-v6si28849429pfe.60.2018.10.11.07.44.06; Thu, 11 Oct 2018 07:44:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=wikghze3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbeJKWLD (ORCPT + 99 others); Thu, 11 Oct 2018 18:11:03 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:53190 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeJKWLC (ORCPT ); Thu, 11 Oct 2018 18:11:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hEOMw4Gr5BkGstRKzySUbZCPiJkT3OspbuLHw0kWaaQ=; b=wikghze3l5wk1D6kS3oRdzUgI i8SyPV5Egro/ZXCe5NZ+iTObsSQtKnq4age48ofnM49BeF5FLAQokXAUlJuV+EOt/fSj482xXtbGy iEHDE1Qn2jusH5eKW52166fTFyatKFSSq1/sOEmLpqMGnFY1tTxZW4UnnL74WHZRjU0Z8=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gAcBX-0001pS-AD; Thu, 11 Oct 2018 14:43:31 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id ECDAF11223ED; Thu, 11 Oct 2018 15:43:30 +0100 (BST) Date: Thu, 11 Oct 2018 15:43:30 +0100 From: Mark Brown To: Linus Walleij Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Marek Szyprowski Subject: Re: [PATCH] gpio/regulator: Allow nonexclusive GPIO access Message-ID: <20181011144330.GF25351@sirena.org.uk> References: <20181011143531.7195-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dWYAkE0V1FpFQHQ3" Content-Disposition: inline In-Reply-To: <20181011143531.7195-1-linus.walleij@linaro.org> X-Cookie: Use at own risk. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dWYAkE0V1FpFQHQ3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 11, 2018 at 04:35:31PM +0200, Linus Walleij wrote: > + /* > + * Some fixed regulators share the enable line between two > + * regulators which makes it necessary to get a handle on the > + * same descriptor for two different consumers. This will get > + * the GPIO descriptor, but only the first call will initialize > + * it so any flags such as inversion or open drain will only > + * be set up by the first caller and assumed identical on the > + * next caller. > + * > + * FIXME: find a better way to deal with this. > + */ > + gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE; > + It's not just fixed regulators that do this, often regulators with register control can do this as well. Since power up is often a performance critical path but regulators tend to be controlled via slow buses like I2C it's common to have register control combined with a GPIO enable line so you don't need to use the bus to do the enables. That should just be a case of adding this flag to all the drivers that have already been converted to gpiod (including the core code that's in regulator_ena_gpio_request() which I thought was coping with this already) unless I'm missing something? --dWYAkE0V1FpFQHQ3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlu/YZIACgkQJNaLcl1U h9D47Af+LHEm3qHlbkqWm0H1Ku1iFePv0+bsa4Do4nZlGNRSOLXdvuxD2YyTptAu uB4vzaULjSusPMG+7t9WDuJ1ODl6b2igrAB8v58QWLH91vMh327Pk994BBhDiE5r ZYK4srJW6X2o3kbUmAFcgzaJtBsMvrhmIYcP7tid40cR5VOhmnTMBtVC6ODguM5Z kxyBUfJtCs/5/qmiWIJPEM2IqxE/LK34yikRe74gb63Wb3cfgoZ4KwHy+Ci/vKQI jxHb2bnejiTPYJoT43veSzE0i5GJwezwF14xHgATq3M3yIblpJ30lPhHA2/rJbyp GO9z3HLVy8zHR1yEhVdFrhrnjETS3w== =Mcdt -----END PGP SIGNATURE----- --dWYAkE0V1FpFQHQ3--