Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3650717ybl; Mon, 12 Aug 2019 04:11:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0B+WixaYBKS8BaYhk0jQXtnR32rx/HWH2AKtVFIHv78KsOtbHcJEKwuBLZ/mUSxjnxjt8 X-Received: by 2002:a63:20a:: with SMTP id 10mr29427517pgc.226.1565608294212; Mon, 12 Aug 2019 04:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565608294; cv=none; d=google.com; s=arc-20160816; b=FJBIF0XspQvj7fAUdztkcqPgn8ti5YxeNV6U2OLxT6PYyeUUKudpEtCtKBIWHuxzWl ty+FfIS0XMtMP+tP07ia83YpLDBF5gp2R1SuHAdzYJOJd+oAwZgAzBlwK3uJ+LRT7Hy4 jBLMz85sIpRT5//D1d4cpnI0ZJZixEpMoxFoeYk/CVux5LnfPh+VIyLXkN/bXKUbbtzt E26c4SUpY4WSqX1keSWMWvVaZZAU/bQ7sL9KQOBUxQT99aJSk5tWspdq+rKsYe7IDoQq +OqUP5chVPsgvJJbQhmJqqDDNfmty+8o89E2xKD4kPwU5HCqaJDqbFK8JtuL5U+5U9G5 g8ig== 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=vED+9cQ0sertdJ1ms2MKGbJLYJH7mjscNUgYcRMgoP8=; b=1FERKHcNNZDaimBJfpixsdiqSt/VG9v8cH9wlxb+9xffBOvEu0sMx6hTk6WPlVtVQg 4uMrLrLSD6RDoX2LN3eB5Xw21DfE2V5BkbwlnCDFA4t0PM0ricJnG17+6T6hwnXF0lqA dxdvAuX4LZdJ0684nalo41DFYwgoiKey0qGAgxKvdSNIRWGQOelgMV0gpdVE/nYJjyue oniTdorTCdH2ewYtJk1N119LvnStQUsZiMSXSxJD8PD/581QkKmaoNZT26IqlWN24Qek UVk60dld4lJGZqturyP41Zdl7WTojQ4ltpsj2S61GLGhfN/4Ybla53b7piIeV40L3scb 1Gag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="nBG/fX81"; 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 o3si62588890pld.102.2019.08.12.04.11.18; Mon, 12 Aug 2019 04:11:34 -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="nBG/fX81"; 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 S1728064AbfHLLKP (ORCPT + 99 others); Mon, 12 Aug 2019 07:10:15 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:35984 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727235AbfHLLKO (ORCPT ); Mon, 12 Aug 2019 07:10:14 -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=vED+9cQ0sertdJ1ms2MKGbJLYJH7mjscNUgYcRMgoP8=; b=nBG/fX81cclUONp6sUQcuMu7E JluFxxkl0XrObYtk/lHbAKQ1I4vVR2I/xm3HeDy6A2oL/efLgCopfTe4tA7twrHPvqdWF/x+ACcYq sbKy/2Kpke0l+H62/MuFWww6VzAPB3gLYUJjeASrhWnLN+4BE4mzRJW16Qk/5FwcaFGs8=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hx8DM-000134-51; Mon, 12 Aug 2019 11:10:12 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 94A3527430B7; Mon, 12 Aug 2019 12:10:11 +0100 (BST) Date: Mon, 12 Aug 2019 12:10:11 +0100 From: Mark Brown To: Raag Jadav Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Mark Rutland , Liam Girdwood Subject: Re: [PATCH 1/2] regulator: act8865: operating mode and suspend state support Message-ID: <20190812111011.GF4592@sirena.co.uk> References: <1565423335-3213-1-git-send-email-raagjadav@gmail.com> <1565423335-3213-2-git-send-email-raagjadav@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QXO0/MSS4VvK6f+D" Content-Disposition: inline In-Reply-To: <1565423335-3213-2-git-send-email-raagjadav@gmail.com> X-Cookie: Decaffeinated coffee? Just Say No. 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 --QXO0/MSS4VvK6f+D Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 10, 2019 at 01:18:54PM +0530, Raag Jadav wrote: > +static int act8865_set_mode(struct regulator_dev *rdev, unsigned int mode) > +{ > + struct act8865 *act8865 = rdev_get_drvdata(rdev); > + struct regmap *regmap = rdev->regmap; > + int id = rdev_get_id(rdev); > + int reg, ret, val = 0; This function doesn't check if the mode is _FIXED - if it is then I'd expect to get an error when trying to set the mode (I'm assuming that means fixed in hardware). > +static unsigned int act8865_get_mode(struct regulator_dev *rdev) > +{ > + struct act8865 *act8865 = rdev_get_drvdata(rdev); > + int id = rdev_get_id(rdev); > + > + if (id < ACT8865_ID_DCDC1 || id >= ACT8865_ID_MAX) > + return -EINVAL; > + > + return act8865->op_mode[id]; > +} This should be reading the value back from the hardware. --QXO0/MSS4VvK6f+D Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1RSRIACgkQJNaLcl1U h9BhNQf7B2/bNkk+XZ0e/tSVOzn00nt73fznt5qCrh7/yAtFkVxdf6LjfSE1npvK SueIulSiA0j0bCBr//JcD19lDdGzdrCH3+bc6vRFfFSOo5tJfqsm/gCYJg8k86uS 1uT4fRIJfp0dVtG0CADCY1mxAY3bltg8TRHKudtQHv9bV5Wm0iV7oQrcSrttowCk HgsoWDMg6VHDp+kxoPt1GzP7vlIB85KOGpjq7wY0/LCPih+/rwbmvTC36KXtrD9o 3bm949Pf2aw/x1EQ8ImqVBpJmtq8gWTjhjMe7VWwhu5LuLu2UD22HvkkcA9pp7tB LEr7wsIbp2dzxwUgLWZZgVDRzNRDyg== =N1iA -----END PGP SIGNATURE----- --QXO0/MSS4VvK6f+D--