From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f41.google.com (mail-dl1-f41.google.com [74.125.82.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D4FE43C04F for ; Thu, 5 Feb 2026 16:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770310720; cv=none; b=cxoZwj54XOJ8M0bRoTxrWIN/tY0PTJWU4/aH6VU3v7cJ4PfmA+0m0JVQCG6F6xXE4sCmhjcGILL2alo9cdt15jvkLn5czztKNIQMAvo4ykHX3dPOhF4tiVuzjWqjyGJ2DwKWr9XSkilyVG6EfurViaUASHGhCHClXsF6WAu4tq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770310720; c=relaxed/simple; bh=9T36liE3vZeu4Kv34os7tzR0zDi/0YMbTrV01HUXDok=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=stZZP5dCVi3tkwuB9lFXhZAg668Mn6Geoa5XeTGIdoQ+WixuWAQrv6/KFuM4iDnp17Rk3u4zzFBe9dmnMRCd/ahDKfuc6VnNN5Uj5/E5Cb6jSD7WYN1j5FLm0ZNxSE0BJMM354FmlhliUBA9JzG6x7ZTsc4F6epZuLoYthuW/OM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nAjG+cM5; arc=none smtp.client-ip=74.125.82.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nAjG+cM5" Received: by mail-dl1-f41.google.com with SMTP id a92af1059eb24-124899ee9d3so901718c88.0 for ; Thu, 05 Feb 2026 08:58:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770310719; x=1770915519; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=2ExBShuvUs79IPImbMG3qy+Lfwt67zT0KnoLfQrrB88=; b=nAjG+cM5oJhAfhWkd3Y5eaIjDUgcn8wUNFfrsHLo7qf0lH8o0Le/eZHlR4kRCGLx34 0PuSl7OaxD/6sgeAb4xqn/uNZ0H9CAxX6TVlYYu5v3EPOupKHPf9t4qxLAs9x+MxWePP CAGUDrc5nnQKwHZZ+tWy7brhJt6FNdLTxN6qSUD1ORAbWocYj8rys/laAW3zpG6t1hVC en/ygSyuxI8pjbitGacHup0XmekXd/twUqdgzS8a8G4nia46pK7/EtgpT5ppsDP4wIQh RX/Nv5u3EVX1YxTJkB72Y4SvFh1Rzv4dUHl5ddmiBJReqZTbpwmXNJ7Kg7343HELhMJa jLHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770310719; x=1770915519; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2ExBShuvUs79IPImbMG3qy+Lfwt67zT0KnoLfQrrB88=; b=GM37wPXJlk9UaebXHziRO8z1P6aVehbPfHl4Iv227oXSe/XqTg4LxBQ5ZW1CgKa/M8 rIJE9AmhFdJaGl/BB+p+impT/O4i4Do0AAdDMt+AdzgN9npjzPwXYGxuWXSjOWzo+ZMQ fNwKEtL5r29ZugMjfZrI4gdYbdfRYNXc5eREEguAkMl/zhRrzVzv7eEbeGkJrG2Ha3nB MY8ofzBfpau0n/9RfQ6fug0qNhCT5uB9bzFBXV2RqPH9AWcYZs6BelKBL0+j56nun4Mx mbjUXQKBxFYUe59dcDHWNonJYajbQDjL1R8mxqjUY2hYvavvtv43M2XFyPk+SJ6Qy8HH Rg0g== X-Forwarded-Encrypted: i=1; AJvYcCViq1b3OW+Bh5q94S3zRS3mSOQpDnFKdOjJWx0RSlQM128JOdeVQiA6n4hSEQg/HmyfSvsl2CI8udtm5B8=@vger.kernel.org X-Gm-Message-State: AOJu0YwraXltNrDxrSUNpqXoppcEJv9siJVpFo5kiS1gy4EWtT4KnOd8 iSeFoFaqHplo/8j+1/W7nXSD+Q2XMTz3z+EFfMu4P3QdcXo/LApzydzd X-Gm-Gg: AZuq6aIrxanLau+mS4SfD4d9nmesV9UwACOz/MxxJh0EQdI6PsgCl3SQbofRYW1UYCI 7q6djbjHvSah4dpSp1npAeI3/+AoZr0zVjEYh7sUDqODutxrSWTOKSOt3ZX3Npvm10q6Tg8DBRh wNQyHpu4oOFfy65Zu0np10lGiSMfzriM8z8+5ocOLWtlhS5tGik7gqi1hggGZjDTDByid+rlkV6 /zcE+Yr2qqqZzI2RyLruuyeJpeVic1IdunbwsNTK5+547cibKpnyXVC9zlJ5uJ32PqqwF3gaUqT wPddi3K5J7lop7sKSyqXd04kNLdFyjt5W6oagNu+7YMHKJcfbddntO5p3yY+/sIaCp/Omb+tYfk iX9p/VHjRYcbJPc42L0Bc56FD9C4AE0rHWhkqyH73TRQAKtbraJiHpssqAz3gccdostzrfbEB/v gOn44h4rDqLPhF+1hFsGCeyzcN X-Received: by 2002:a05:7022:2491:b0:119:e569:f86c with SMTP id a92af1059eb24-126fc2cea3cmr1708334c88.9.1770310719421; Thu, 05 Feb 2026 08:58:39 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b832e4d18fsm3449639eec.13.2026.02.05.08.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 08:58:38 -0800 (PST) Sender: Guenter Roeck Date: Thu, 5 Feb 2026 08:58:37 -0800 From: Guenter Roeck To: carl.lee@amd.com Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Charles Hsu , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peter.shen@amd.com, colin.huang2@amd.com Subject: Re: [PATCH v2 3/3] hwmon: pmbus: mpq8785: force direct mode for VID VOUT on MPQ8785/MPQ8786 Message-ID: <07c39c3e-f82d-4ec0-b7fc-6ca9721d246d@roeck-us.net> References: <20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-0-3744cd9b2850@amd.com> <20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-3-3744cd9b2850@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260205-dt-bindings-hwmon-pmbus-mpq8785-add-mpq8786-support-v2-3-3744cd9b2850@amd.com> On Thu, Feb 05, 2026 at 06:01:39PM +0800, Carl Lee via B4 Relay wrote: > From: Carl Lee > > According to MPQ8785/MPQ8786 datasheet, VID mode configuration is > the same as direct mode configuration. Therefore, when VOUT is > reported in VID mode, it must be forced to use direct format. > Why "must" ? Yes, the LSB is the same, at least for MPQ8785, but that doesn't mean that the mode _must_ be overwritten. Maybe I am missing it, but as far as I can see the datasheet doesn't say that the VID mode configuration is the same as direct mode configuration. It says that the _LSB_ is the same for both modes. I _think_ the problem may be that the output voltages are not really reported as VID values but as raw voltages, but the datasheet is a bit vague in that regard. It talks about LSB values but doesn't exactly say how voltages are reported, and for READ_VIN it is most definitely wrong ("This bit is in VID mode with 25mv/LSB" doesn't make any sense). Thanks, Guenter > Signed-off-by: Carl Lee > --- > drivers/hwmon/pmbus/mpq8785.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c > index f35534836cb8..d6624af076c3 100644 > --- a/drivers/hwmon/pmbus/mpq8785.c > +++ b/drivers/hwmon/pmbus/mpq8785.c > @@ -48,6 +48,25 @@ static int mpq8785_identify(struct i2c_client *client, > return 0; > }; > > +static int mpq8785_read_byte_data(struct i2c_client *client, int page, int reg) > +{ > + int ret; > + > + switch (reg) { > + case PMBUS_VOUT_MODE: > + ret = pmbus_read_byte_data(client, page, reg); > + if (ret < 0) > + return ret; > + > + if ((ret >> 5) == 1) > + return PB_VOUT_MODE_DIRECT; > + default: > + return -ENODATA; > + } > + > + return ret; > +} > + > static int mpm82504_read_word_data(struct i2c_client *client, int page, > int phase, int reg) > { > @@ -133,6 +152,7 @@ static int mpq8785_probe(struct i2c_client *client) > case mpq8785: > case mpq8786: > info->identify = mpq8785_identify; > + info->read_byte_data = mpq8785_read_byte_data; > break; > default: > return -ENODEV; > > -- > 2.34.1 > >