Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2169504imm; Thu, 11 Oct 2018 06:17:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV62LOegPXCCZBgzKcrVzhN00ahxLE2kHI5mzUN3TQurAFmgAZyYqG8z5zUGw+cG8ALDHRLFo X-Received: by 2002:a63:d753:: with SMTP id w19-v6mr1368506pgi.415.1539263835584; Thu, 11 Oct 2018 06:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539263835; cv=none; d=google.com; s=arc-20160816; b=oyl/UIz9Ifk9CUdWSTGpZmixEGG0OzK3q7qkVhaZwllTKLERGozFoB/+1DvSsF/yF9 DWcbZFXG96hySPeI2h/T+meoxyEWcSZ31B5X+cvqFs9GQgwadVVVpb5MK+v/HMU+O9eE 7GfXAFIEDJW6sGxvWOsH+6u4eky1TDwSx4szrDlCDqADeYeEkiQK6rtRmQmg8/mQICvW u8WDSnlkpOS4RDvvXJ7EJNti4e623KEeeWkUCkuG3ID435WEiYJr72BGMAJgOAjsjR7j 6lqDoaoTXcgTwRmtXduWWaM2v0l2rugEITz8Q4wOtvJ2pdCTP2rAaj3YR2m+olVoBTaE PCiA== 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=wiisUMoB78VnRUVb0aR+wG/PIyXiqTPy3WOvms8qn8Y=; b=tzulcypf9QCvquqnOw35rkA1hFzfK8/ARH03mJMglravDTJh6tjViaHbWxnynJCA0w hGddlQt9IJ6+2+bzt/UcADh4zS7YA5vQoYvq3bE40hVgho6fl8qNgqZHx6tSZ18g9zKS B4zJVFlsdHQVu6c47fO/jU1BdVyQ/XlQJEJD5CEjWxX/OAqgOuwdu92R2YrZgGRV7vDw 5j1bmNSzfCxu8EWn/gm6uVITC6DpP3PzAKZuiYtyOskG9fUorUxNgV5HYtPCSXGl0om+ QooJiPPuGOLY0RwGbtCwJjl/75uzmC5iKA7Fc9ML4lGr7awnMuTpICZcV6ZYuVXh6B3n 4LaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=jaqywtzB; 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 g12-v6si32042963plm.142.2018.10.11.06.16.59; Thu, 11 Oct 2018 06:17:15 -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=jaqywtzB; 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 S1727547AbeJKUnd (ORCPT + 99 others); Thu, 11 Oct 2018 16:43:33 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:47828 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbeJKUnc (ORCPT ); Thu, 11 Oct 2018 16:43:32 -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=wiisUMoB78VnRUVb0aR+wG/PIyXiqTPy3WOvms8qn8Y=; b=jaqywtzB7jLndd2k6Gz3BSpMu MtW/1HiEKpwkxaAuQsm+KY890mIziOc4kDPgGYtJZKJbrFyHhBi1aa5Bbml/o/dUT/et+HXldJzAU /dAuwYfaQjPuxZb2frc4VM29WalzlU63IAyKJankBIJxLsoKBVNUIFuLWk/yPdsHEOs9Q=; 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 1gAaoT-0001et-57; Thu, 11 Oct 2018 13:15:37 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 7767B11223ED; Thu, 11 Oct 2018 14:15:36 +0100 (BST) Date: Thu, 11 Oct 2018 14:15:36 +0100 From: Mark Brown To: Marek Szyprowski Cc: Linus Walleij , Liam Girdwood , "linux-kernel@vger.kernel.org" , Janusz Krzysztofik , Alexander Shiyan , Haojian Zhuang , Aaro Koskinen , Mike Rapoport , Robert Jarzmik , Philipp Zabel , Daniel Mack , Marc Zyngier , jacopo , Geert Uytterhoeven , Russell King Subject: Re: [PATCH v7] regulator: fixed: Convert to use GPIO descriptor only Message-ID: <20181011131536.GA25351@sirena.org.uk> References: <20180906122436.25610-1-linus.walleij@linaro.org> <20181011090112eucas1p286d8c1edfc1a2a207d8a11c5ad7eb20e~cglSx9qcr2394623946eucas1p2y@eucas1p2.samsung.com> <20181011094701eucas1p2177080d98481b4d4ebcfad9960d7dd97~chNSImIbW1044610446eucas1p2Q@eucas1p2.samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20181011094701eucas1p2177080d98481b4d4ebcfad9960d7dd97~chNSImIbW1044610446eucas1p2Q@eucas1p2.samsung.com> 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 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 11, 2018 at 11:46:59AM +0200, Marek Szyprowski wrote: > On 2018-10-11 11:29, Linus Walleij wrote: > > On Thu, Oct 11, 2018 at 11:01 AM Marek Szyprowski > >> I've just noticed that this patch causes regression on Samsung > >> Exynos4412-based Trats2 board. Conversion to GPIO descriptor breaks > >> operation when regulators used shared GPIO: sii9234 i2c driver > >> is not able to get vcc33mhl regulator (it uses shared GPIO enable > >> line with vsil12 regulator). > > So I guess this means that this physical GPIO line will enable the > > vcc33mhl and the vsil12 regulators at the same time? > Right. It is so common case, that regulator core has special code for > handling shared enable GPIO. Yes, and we've discussed it several times already. > > I was aware of the usecase "several consumers takes the same > > GPIO line" (Mark told me several times...) so it was in the back of > > my mind, but it's just hard to see when we were gonna run into it. > > So it is the fixed regulators, on Samsung boards, I see. > I don't think this is Samsung specific. I saw similar solution on various > other boards too. Sharing enable gpio is rather common thing. The issue > happens if there are separate drivers for each hw block and they need to > enable it from their code. It's really common, yeah - things like controlling the power for an entire chip with one GPIO for all the regulators supplying that chip for example. I think what you're seeing here is that Samsung are among the most active testers of -next (thanks!) rather than that their hardware is particularly weird. > > So I was thinking to introduce > > gpiod_get_nonexclusive() to explicitly handle this case for the few > > systems that use shared GPIO lines, let me see what I can do. > The old interface also didn't allow sharing GPIO easily, so regulator > core has special code for shared enable gpio. However I still have no > idea how to do this cleanly using descriptor. Yes, it's been discussed several times and I thought Linus had some idea for it - IIRC it was a gpiod_is_equal() or something. You can also do this by converting descriptors back to numbers and comparing the numbers but obviously the numbers are supposed to be being removed. --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlu/TPIACgkQJNaLcl1U h9D05Qf9FpuZ2XrDAw5QBvxw1FOhVUT9lextbm3jYOcZReoxMZDw8hjz8Xbj7NnP QCprq5UrfQoqIJ+WUYDfsLj2fZSugrLLTTckjPF9T2TlAOa+6XKI01tfJvU0yp1p GieLF0vCeU6Xi9lAlCNqa1ll20433ubr9wr6uhqEb9qgP3aTaOq5likBnTcoghfD 1iwWyr+5ZhdI7hAm5EdUhqXBk89Wzn5nQr1/nlqWpRIigxv01D1XVwyNLcZLuWdJ vha1ocBj291/IktTWhfHNJhEfOcJuBcEdLG+bIsNRvr5F0MCvw5K/KOr/cwVLIsC afRHotQXV+Z49dvryJPNGAhgeIr/Sw== =Vvp8 -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--