Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5860521ybp; Tue, 8 Oct 2019 09:20:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/ui21cQPxnfKOIrkoJjvABnaLg95ys6xRFtWteXgtC2dgtUyNAthfidzN4q+XpO/r6Mz6 X-Received: by 2002:a50:d090:: with SMTP id v16mr34864419edd.176.1570551615057; Tue, 08 Oct 2019 09:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570551615; cv=none; d=google.com; s=arc-20160816; b=rwOVZwyGJty4aa+x6gJwfV5XiaQY+zfUjeKnK5QgSFqT2+PZKBx4XIN6wUzI1wS6dn 48JqBtE1Y3ad54/4EdHtW9zpMumtmJutCdUxu9MD7MJ3eGfjRKyJCJdxqNm5SnNKzTN7 B3duCvpfeQhHYdEthNdPdA/ItXy8rgypVlCbg/t8Nuxvl1aLTjD2eGCoxudrvpiInw8k 47QrvRtF0ZLGRzhLMiMdlkK4XUqHhaQNYeWwEPfw09NqMEE4wLq7pkd7R6mEs3kVxOmS filN+pvVNtxxFeiqrSQkMzvZRNN05XK7eYl2PVG3wHrtVKlMJDzv4MRFgE+4hzHveipK F7eQ== 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; bh=CI11y8Bw/nULgNCYAv9jh+ecUVvjqVHlByCTxMWPnFs=; b=OfSTGbMRDcgtITP+DqKfymdyAp2qRQgNGuZ3n4EASajp0UOnMVpFOoIYJkTFkUZdV6 FY0HatnEw6Qs2aIJlDlhUZFpujSuPrR6j+j48D4te1QCcAXklNuKNc2l2YggFC9Jyvtx KemW2VGht/37H8MQ7hiWpiViMlDSfsdiewegZ8jFGYf3fmxF7EHt89PAQ8byDcl7DcBu m0YWGpH1mwYCjjeW2Y6VPV6Wz3g6Nwhr7APJehX0uKNP0Xsj4jE5dBNPGM/YmGV8mSpK nqU6ayv+XqN8lOvbPgU3MAAkgAQIsJHmHx16A8oP+2ROxh1PpsupqvoaPyTt1qOI1fMI C+Rg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si11441113ede.196.2019.10.08.09.19.50; Tue, 08 Oct 2019 09:20: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729206AbfJHQQp (ORCPT + 99 others); Tue, 8 Oct 2019 12:16:45 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35777 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbfJHQQp (ORCPT ); Tue, 8 Oct 2019 12:16:45 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iHsAD-0003h6-UN; Tue, 08 Oct 2019 18:16:41 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iHsAC-0005Lr-5L; Tue, 08 Oct 2019 18:16:40 +0200 Date: Tue, 8 Oct 2019 18:16:40 +0200 From: Marco Felsch To: Mark Brown Cc: Doug Anderson , Chunyan Zhang , Liam Girdwood , ckeepax@opensource.cirrus.com, LKML , Sascha Hauer Subject: Re: [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage Message-ID: <20191008161640.2fzqhrbc4ox6gjal@pengutronix.de> References: <20190924182758.GC2036@sirena.org.uk> <20190927084710.mt42454vsrjm3yh3@pengutronix.de> <20191007093429.qekysnxufvkbirit@pengutronix.de> <20191007182907.GB5614@sirena.co.uk> <20191008060311.3ukim22vv7ywmlhs@pengutronix.de> <20191008125140.GK4382@sirena.co.uk> <20191008145605.5yf4hura7qu4fuyg@pengutronix.de> <20191008154213.GL4382@sirena.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008154213.GL4382@sirena.co.uk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 17:52:27 up 143 days, 22:10, 95 users, load average: 0.18, 0.13, 0.04 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-10-08 16:42, Mark Brown wrote: > On Tue, Oct 08, 2019 at 04:56:05PM +0200, Marco Felsch wrote: > > On 19-10-08 13:51, Mark Brown wrote: > > > > No, we shouldn't do anything when the regulator probes - we'll only > > > disable unused regulators when we get to the end of boot (currently we > > > delay this by 30s to give userspace a chance to run, that's a hack but > > > we're fresh out of better ideas). During boot the regulator state will > > > only be changed if some consumer appears and changes the state. > > > Okay, so this won't disable the regualtor? > > > 8<---------------------------------------------------------------- > > static int reg_fixed_voltage_probe(struct platform_device *pdev) > > { > > ... > > > > if (config->enabled_at_boot) > > gflags = GPIOD_OUT_HIGH; > > else > > gflags = GPIOD_OUT_LOW; > > > > ... > > } > > 8<---------------------------------------------------------------- > > If this is a GPIO regulator then the Linux APIs mean you can't read the > status back so it's one of the regulators for which this property was > invented. This is a real limitation of the Linux APIs, with most > hardware you can actually read the status back so we shouldn't need > this. I know and I followed the discussion between you and Doug. But it is a valid use-case to have a external gpio-enabled regualtor connected to a panel. If I don't mark the regulator as 'regualtor-boot-on' and use the fixed.c driver (IMHO this is correct), the regulator gets disabled during probe. So I will have a panel off/ panel on sequence during boot. To avoid this I set the 'regualtor-boot-on' property but then I can't disable the panel during suspend.. Can you give me an advice how I can handle that otherwise? Regards, Marco