Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp905598imu; Tue, 11 Dec 2018 09:20:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VNfdq/jszF7OXXdSDi52+VTONs2iPYhpBEN7Lh9JqwLaUFIdzlg0LzZDAhwjLiujPhiKca X-Received: by 2002:a17:902:981:: with SMTP id 1mr16327323pln.142.1544548843055; Tue, 11 Dec 2018 09:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548843; cv=none; d=google.com; s=arc-20160816; b=YQVX2ao4DwgJj+/eHEnQXZWuBI0Hwmqxm4UfLPnLrCRtYV4SyhnD/bjsmWpDT8C2yK +RmahBVAhT3BwIfGJu7YrHcst8SMPgwru5sVmmLqbVJ8yt95mBJymfreES1YKRRnx3RA VBIQxty2CXQclq5smKjwq8cAVouOQI+0mDEE1tadUimVmhVemnc50ybu0rgtEbLasdak p6u7JVHyShoDJfPaqHc0fwvuEYN3ydajtYXgkAvMBtdSR54/6Tv9ziwzrMNtg5jCNxmK u/6O0M3wATa5Sl7hjEA056v5MGazRC5fpAo1Wizd6EPzt0Sr4xNws6/tcFN/sR8i945e sJpQ== 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=xqiz+wkFzBYV7aW60asqBnJ9KnKUJwPszxanHWrGxeY=; b=pBHItGPSNwvqX6k6Kit2emjHizpSZ6Q726E3HCqWmxJfwhLA7UVZQ8nADUIeigjLXs kvZraWuXWywG8uCjZdnBsuVDSCeeWTNaRhYjKhY+9aUdIDC+RznrvDqPgbVj9iKpjfsv cSXG+QM5GDH0m1IyoMsSzcjLtJPE6ufw8QtxvPqS3nw7qZVJJZChUkw47/jNBdW4tqkc zPBRB6MrtSI6959QaHxN2ZNEMwrKKfPIRMe7IImUF3YE1nH9YaxpGUKLMucweOINfJl5 A0LCSagAgYT8QmnvqQX70yfb/QeeQ1ivTi8gGW+C0zuTEIv8fvzYb1klWiqCSmGKP3C5 eHKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=m2A+jHn1; 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 t10si12076503pgn.551.2018.12.11.09.20.28; Tue, 11 Dec 2018 09:20:43 -0800 (PST) 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=m2A+jHn1; 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 S1728049AbeLKQrU (ORCPT + 99 others); Tue, 11 Dec 2018 11:47:20 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:60430 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727280AbeLKQrU (ORCPT ); Tue, 11 Dec 2018 11:47:20 -0500 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=xqiz+wkFzBYV7aW60asqBnJ9KnKUJwPszxanHWrGxeY=; b=m2A+jHn1sFFHKLdIKuazg5BTX oRntLbzTEhwG9b33OHcpp5wC0J8DmM1yQOAoxcKo+6h4QaYG3urs83jcv1NsmT0GRAeq0qzUG+IbT 5XHq7cpmzWnH2n5j7ApXIN3xvQtIR3OtrxnO5qtRq/yNfIz9Os2epEwRdjd40sGHmJA70=; 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 1gWlBb-0001Gg-0Y; Tue, 11 Dec 2018 16:47:07 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 76B69112540E; Tue, 11 Dec 2018 16:47:06 +0000 (GMT) Date: Tue, 11 Dec 2018 16:47:06 +0000 From: Mark Brown To: Andrei.Stefanescu@microchip.com Cc: robh+dt@kernel.org, lgirdwood@gmail.com, mark.rutland@arm.com, gregkh@linuxfoundation.org, Cristian.Birsan@microchip.com, Nicolas.Ferre@microchip.com, Claudiu.Beznea@microchip.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [RESEND PATCH v3 3/3] regulator: mcp16502: add regulator driver for MCP16502 Message-ID: <20181211164706.GL6686@sirena.org.uk> References: <1544522876-15967-1-git-send-email-andrei.stefanescu@microchip.com> <1544522876-15967-4-git-send-email-andrei.stefanescu@microchip.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="umrsQkkrw7viUWFs" Content-Disposition: inline In-Reply-To: <1544522876-15967-4-git-send-email-andrei.stefanescu@microchip.com> X-Cookie: Immanuel doesn't pun, he Kant. 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 --umrsQkkrw7viUWFs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 11, 2018 at 10:09:15AM +0000, Andrei.Stefanescu@microchip.com wrote: > This patch adds a regulator driver for the MCP16502 PMIC. > This drivers supports basic operations through the > regulator interface such as: Overall this looks really good, just a couple of comments: > +++ b/drivers/regulator/mcp16502.c > @@ -0,0 +1,555 @@ > +/* SPDX-License-Identifier: GPL-2.0 > + * > + * MCP16502 PMIC driver SPDX headers need to be C++ comments - please make the entire comment block a C++ one so it looks more intentional. > +#ifdef CONFIG_SUSPEND > +static int mcp16502_suspend(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct mcp16502 *mcp = i2c_get_clientdata(client); > + > + mcp16502_gpio_set_mode(mcp, MCP16502_OPMODE_LPM); > + > + return 0; > +} This puts the device into low power mode when the suspend function gets called but this might not be safe - devices using the regulator may not be suspended yet so could still need full regulation. Normally a GPIO triggered transition like this would be being done by hardware as part of the process of suspending the SoC. Is there some reason to do this manually? --umrsQkkrw7viUWFs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlwP6gkACgkQJNaLcl1U h9BHwwf/cHsTUWUp5ToG+Kb4Fuv/H6ZxHsx3rArRbP6RrZs8AcV8P59bDdcVWgjQ Jvrzl5wA1njl0bXYYCyNXWAsApqj5396NAHrZJhzpjYDTZu8rLQnqpJoyHsc6nUJ UptK/vhhmZEH78iiEqBIUcQY/JzYxz4cC3iVl24+O3l30AvbrHiXeMALUGr1fJ80 RutTjPkvA67Gq1ogrfhy8IALDzFDGM7bX+Xe4jha//+23lf1f8HRTCXf3dMydP0A Lk3z/8C4Dz2p4c7GZZMzwhjKrsp7AVGIH29SX0BAvM9cp6EnTv0B2l1xLQv3oXV3 OAviYfR1XwagJG5wcHyko6KGnNSjtQ== =9bae -----END PGP SIGNATURE----- --umrsQkkrw7viUWFs--