From nobody Sun Feb 8 02:56:25 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 E0414221293; Fri, 9 May 2025 06:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773590; cv=none; b=TSrUiRyRt1GSEiYpIaiWQ5msx9B1V+3iWC91qnKzC+XI/Q0fzRuJeZZnsUp2QIv2+cSL6+DR2wewVfxQ/sB/61OFGadVexCzz1sBqxi/0ZTAu50EWNckkZ7T3SNoCxn8k0Q5HHT4oFW21G030/QR2xfbFv4M9vuIcW+5SpaqUlM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773590; c=relaxed/simple; bh=2idPfThrWw8aQgWtm4Z01+9Ucg83XpwGIBJ7OPCurko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sYr7V4xm+bCFZ/dbvMdTZ8FmQtsAE2SXX0D36BzfoJ9pe64rxekqRfcRRw23/U6p3666usVtYyfQtqwU1lYTAUbT1+biibMA3Qi1TTEGDDbCgNCvW/a/zg9ijUk3WJoKVUfxP31pLwjhcT6UVdCFs7EF3buJfTxPhp1WGS7pOBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KEsBvIjy; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="KEsBvIjy" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3a0ac853894so1465051f8f.3; Thu, 08 May 2025 23:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746773587; x=1747378387; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MDgPHFp407MffVy+hvMLpY3deWQ7hhBKSUfGaXpJ5UM=; b=KEsBvIjyEFVb63UHRhYKrrbQlezLKAQBdB0iunfnLBTXuEq3DW58qkSgBB7Zidhg4w zYtMzHgvByU+JtFAiHIRrML3oRtIHd+thXF7vN0ZrKWyRUvqNkQkafLYoDHksDnJxIBO 7825a7yGDRx/FJ6Um4IYM72gphhQdHzktZ1Z3Pf5mq74V7I2IzF75fiyU+JIhni1hf78 5uwuXVHMajx/kKpFE/FG1uGRPDPYiflfkU0C3Vq3Z1dzEBIGvHY1K+3WUUMKwdGpj5QS AepZv0+zdZbsfOlJrb2OzYfKHE/GG4IHRgjpkm5X/vZS0lrDoI5DTr9gfpOFEbBjwl6B VWgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746773587; x=1747378387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MDgPHFp407MffVy+hvMLpY3deWQ7hhBKSUfGaXpJ5UM=; b=lLfygr7RufXvOqvA/Ecd2S2FYkb4nPQTClkrPL551+i7R/5Lsu79A29oh/Jzy6Yqn5 FDwViTUt1UgktSxSI8Cc4M5Ow6P7YNNuUWkkY7TTw70QYyi1qaWa7Wg8uqELLOWYjZOy FVRaatPsncN49MlCJpp82qBmYYOg0K1tpWJKS/bUlgG7R8IZGiRASDZqKaA1nXC8gij2 /RKnp97HrV8uUlR3Ps4fg2FlElrqmX93DaJjrJa2vSzbLMcGVOVWIk7H0c99hiSo83yG /59qnhE2Qb5IXPbpyZdd42HhYTgRU76QI2SbvzWFois1LBdsplmeeMLEhgMgec/W3DzK reIg== X-Forwarded-Encrypted: i=1; AJvYcCUn621uphJ5mpjRRoGXAzrhk0vUSO9SmIQy7xoiJCoP3oaQinTrK4DXh31rOjuEywQz9LkL/4MeKrZP@vger.kernel.org, AJvYcCVeF1vk6w9FFbb54Fnk8pKl0fIoYM5YScZ7QFujI17KtHD7jfTXDONk+2z1luTKjvOIqpnkfqnVFaWI@vger.kernel.org, AJvYcCXEfIFxjZddbMwI3KQSmU5aCHFOqMV2tnKPRMid+TXPZgjgop/Li/9pUlroJ6adVfXr4MNygxabRMSz9mfJ@vger.kernel.org X-Gm-Message-State: AOJu0YxopQtsPpaEZfBgd7aesAUKvF+uMoVdDqQIvfOH02lMBIyR61Oq Ds70TNjkkLtpaI5dTohjr58jEnG9vTbNTBoJuugzzB7Q43fpns+V5uPGTiZV X-Gm-Gg: ASbGnctXxdu80jR3y59+qdRf3sEG3nIrIycvJQCirIw+GJZL+Vm1EFVtizIMXEhZsE/ ktQEOuKkYIZxLxI870/V/Cy+tbuxo5e+0nhYvoJAj49kCdv25E9dx5IK/y+feSJM2zzXd6xs0Eu kXf5DoyfKa530Ok79ggFN68/nrr5dTQEJV15Ut0NjTU+biG32uDMttCBG1zBPLyAxRV5ye9T9zC H69BB5CyTLzv0yqOxkIWK38zKQl0P9+3ZPsFMzMS2ZVpR4ao/zYq++VceoS7oQRbK/gBCcW8bXh 7YiBmQyLPwFRrsDJWNcgYpGBsFb1debqZn0NyWb0HR4/TvfYRanhgJx1/SswNqFuOQ== X-Google-Smtp-Source: AGHT+IFKa8IQhq/R2lqrpyp0HlL59TYo+i7nnrznDepx+EnOcQZ0BCOL2WOj/cmQzz1fR4+XpQaSKw== X-Received: by 2002:a05:6000:40df:b0:3a0:8383:ef19 with SMTP id ffacd0b85a97d-3a1f64ac258mr1799084f8f.51.1746773586665; Thu, 08 May 2025 23:53:06 -0700 (PDT) Received: from tempest2.110.lan (xt27dd.stansat.pl. [83.243.39.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442d67d5c2asm19276315e9.1.2025.05.08.23.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 May 2025 23:53:05 -0700 (PDT) From: Pawel Dembicki To: linux-hwmon@vger.kernel.org Cc: Pawel Dembicki , Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Noah Wang , Naresh Solanki , Fabio Estevam , Michal Simek , Grant Peltier , Laurent Pinchart , Shen Lichuan , Peter Zijlstra , Greg KH , Charles Hsu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 1/5] hwmon: pmbus: mpq8785: Prepare driver for multiple device support Date: Fri, 9 May 2025 08:51:05 +0200 Message-ID: <20250509065237.2392692-2-paweldembicki@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250509065237.2392692-1-paweldembicki@gmail.com> References: <20250509065237.2392692-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Refactor the driver to support multiple Monolithic Power Systems devices. Introduce chip ID handling based on device tree matching. No functional changes intended. Signed-off-by: Pawel Dembicki --- v2: - no changes done --- drivers/hwmon/pmbus/mpq8785.c | 38 +++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c index 331c274ca892..00ec21b081cb 100644 --- a/drivers/hwmon/pmbus/mpq8785.c +++ b/drivers/hwmon/pmbus/mpq8785.c @@ -8,6 +8,8 @@ #include #include "pmbus.h" =20 +enum chips { mpq8785 }; + static int mpq8785_identify(struct i2c_client *client, struct pmbus_driver_info *info) { @@ -53,26 +55,46 @@ static struct pmbus_driver_info mpq8785_info =3D { PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP, - .identify =3D mpq8785_identify, -}; - -static int mpq8785_probe(struct i2c_client *client) -{ - return pmbus_do_probe(client, &mpq8785_info); }; =20 static const struct i2c_device_id mpq8785_id[] =3D { - { "mpq8785" }, + { "mpq8785", mpq8785 }, { }, }; MODULE_DEVICE_TABLE(i2c, mpq8785_id); =20 static const struct of_device_id __maybe_unused mpq8785_of_match[] =3D { - { .compatible =3D "mps,mpq8785" }, + { .compatible =3D "mps,mpq8785", .data =3D (void *)mpq8785 }, {} }; MODULE_DEVICE_TABLE(of, mpq8785_of_match); =20 +static int mpq8785_probe(struct i2c_client *client) +{ + struct device *dev =3D &client->dev; + struct pmbus_driver_info *info; + enum chips chip_id; + + info =3D devm_kmemdup(dev, &mpq8785_info, sizeof(*info), GFP_KERNEL); + if (!info) + return -ENOMEM; + + if (dev->of_node) + chip_id =3D (uintptr_t)of_device_get_match_data(dev); + else + chip_id =3D i2c_match_id(mpq8785_id, client)->driver_data; + + switch (chip_id) { + case mpq8785: + info->identify =3D mpq8785_identify; + break; + default: + return -ENODEV; + } + + return pmbus_do_probe(client, info); +}; + static struct i2c_driver mpq8785_driver =3D { .driver =3D { .name =3D "mpq8785", --=20 2.43.0 From nobody Sun Feb 8 02:56:25 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 7261B1990A7; Fri, 9 May 2025 06:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773598; cv=none; b=JKNrzPM9t3ZTWN6xEKKjldy9qfbzhrVi2lWRIW32X9QAkMKrfpLAj03J/0MQDhk/YqppuRlfX5sAclyb9zDiSgJOItvh5/wdZ/rAPJpVZJ//34G+QWkjFa9/dZUV1MDWoUDxSphlMbnTagWCfuR8qcBhL7x9ztBCXHnUQBg9RgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773598; c=relaxed/simple; bh=THP1kaDvzB44Pso1pi/sHGv/pOUZ5gAiOpjhgkoG8uw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XoUqaOAff2+YckyTnz0J7VJeSYKMw5v/xK+akz2eOj5RlXTzRZM5CiWmHsBngWFAnLFk5en56LTDwmaqYt7X8/ebebxrhsDlND3/osFt9bT0IWnEHqS4XSwxJLoSQ5hkiPZpUu0EpeZwnziRIn6yj+HEEdQkQwzbxERVy8VBUcE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yf0M0LJm; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="Yf0M0LJm" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-43ce71582e9so12964415e9.1; Thu, 08 May 2025 23:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746773594; x=1747378394; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=frbt3kJxnwS5OF/s4kyCgZ3meikDeJAvr0ZtPJr9m5g=; b=Yf0M0LJm9juYMD8gq3e9kbEVl1E1XVcJk0eksSYKpzIeG7m4A22s56w1HGX3Ho9DVG M3qGLFXiPPfriAZgc3lnSjnqv+dADrSM8TcQ2UbGVDQvlsJQB8Nw8FGsOfb4cBFuxcES BNS8s6REYlsGpO5QX+Q2seZSDIbw5ylmpQ6kozOW86pkLbK3b5gryQvNp/rTzKjsluLQ C1+5Jim91TkvY2orHAHb49Gmd5KBIKRPZiHg+TmFWXY0YmrhUiup1gxE4FPCjsO8Ewjp TB34tGZPURvV3j3O0GOvLJbiDim4VyrSX3d9kTVBbkemkKJrYZowSoSoA3VGyiMVDFCd VSGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746773594; x=1747378394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=frbt3kJxnwS5OF/s4kyCgZ3meikDeJAvr0ZtPJr9m5g=; b=BtbUBqR9hwaeLj4Y7zhY5gmArQIeUFCNKc9HYRuuqJ1tnlsiGwlnUla+jGS6LDGflV 6KQ4rjKcfh0tZW9I438HGqhZEbnmeAjA/3MPXAxClWWymUn2udO/8/WakHcjFWCuNm3Y /dTAKdc8KZwKPX1p1qQdY4lRzn9aD7f8cO5WMwvB1ErwAxyvTTBZhHcU+6T8yFYCDCAD t+SVrErWYz7BPleuDbFj3Ag/jiHte0n6MSo8A1bJi2IwsDwy42rCfNHtjeHaw4O4dt0G h4BSol/T0b33J/Ud3wuR6fQtKnU5wmuL+4AFyvJ8oqEFkoH/nPIz3W/fyOV8lZiK9flt 12yA== X-Forwarded-Encrypted: i=1; AJvYcCU1gvyEFs/yHpSFxby84DvpAWv+oMlErdXbPkEBYM2cBbCWrEB4vZee19ZlLgs9kXwsqD2dNfhYNCpv53Wd@vger.kernel.org, AJvYcCVBCybzPq13XxaAqaQ+lmC83UpjIuvQEy6z29nkmAqUm26FMB9+Mmz7Cmgsw0xUvpLO/mjPkXZtfgsh@vger.kernel.org, AJvYcCXK/BBOkHLZh6KekxG+/Hqhgu0jFqa7TwqnDn6LlIpEy00lNvxEHRyS6P25RMecJC+2mk6JqxFqj+to@vger.kernel.org X-Gm-Message-State: AOJu0YzjFBKuM5rDLrCxmtG0udaRCv/dZWa2F2Q83gHmdPoDD/o+YPp+ 96AIZWLDy0QHdc0bqMMGC06m9Jcwz1ZnS8g5L0axvZ6QL265L9z2aM3VpvBD X-Gm-Gg: ASbGncu8SUgkHJtgQgkryLznaAp98UjxwAk+eAB1oMN2YMp40i5EejRPTREHj0KxQAn 3UWckPLnUWWjSgq2xRhlnwRhyiMLnUjEXpCLTs5GQRQ+8rH3bujf8KKCB0jGDHbtsS9CEEVAGZv HzWzk8oxT+8QxcUDwhqFdoiDe1E5FU8QFmg6Cd24ame66mnN23BjJ7yaYOnzhyJ6PrciMH37I+C cEezkPrFebhO+jn1UB8D4nFd3PINqWoEy12HXPAXhVrU1nbBv14DBFfzJIGtJXrIvSWv18SoCSM RGhGJwYlJrF0VZ8YXLTyZj/4FLb/HgvhepUT+L6FJ1D6opRK088IuyanVSqny6T3Mw== X-Google-Smtp-Source: AGHT+IFbn/axhYAYo+11glkPlpJf67HqNGpBO6rkfeDy1i5/TuiHB4LCF7t28I5nQ92+y3bwGEHe0Q== X-Received: by 2002:a05:600c:c07:b0:43d:300f:fa3d with SMTP id 5b1f17b1804b1-442d6d18abfmr17385605e9.5.1746773594296; Thu, 08 May 2025 23:53:14 -0700 (PDT) Received: from tempest2.110.lan (xt27dd.stansat.pl. [83.243.39.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442d67d5c2asm19276315e9.1.2025.05.08.23.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 May 2025 23:53:13 -0700 (PDT) From: Pawel Dembicki To: linux-hwmon@vger.kernel.org Cc: Pawel Dembicki , Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Noah Wang , Fabio Estevam , Naresh Solanki , Michal Simek , Grant Peltier , Laurent Pinchart , Peter Zijlstra , Shen Lichuan , Greg KH , Charles Hsu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 2/5] hwmon: pmbus: mpq8785: Add support for MPM82504 Date: Fri, 9 May 2025 08:51:06 +0200 Message-ID: <20250509065237.2392692-3-paweldembicki@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250509065237.2392692-1-paweldembicki@gmail.com> References: <20250509065237.2392692-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Monolithic Power Systems MPM82504 digital voltage regulator. MPM82504 uses PMBus direct format for voltage output. Tested with device tree based matching. Signed-off-by: Pawel Dembicki --- v2: - fixed signedess for temperatures < 0 deg C - remove empty lines --- Documentation/hwmon/mpq8785.rst | 20 +++++++++++++++----- drivers/hwmon/pmbus/mpq8785.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/Documentation/hwmon/mpq8785.rst b/Documentation/hwmon/mpq8785.= rst index bf8176b87086..be228ee58ce2 100644 --- a/Documentation/hwmon/mpq8785.rst +++ b/Documentation/hwmon/mpq8785.rst @@ -6,6 +6,7 @@ Kernel driver mpq8785 Supported chips: =20 * MPS MPQ8785 + * MPS MPM82504 =20 Prefix: 'mpq8785' =20 @@ -20,21 +21,30 @@ buck converter. The MPQ8785 offers a very compact solut= ion that achieves up to wide input supply range. The MPQ8785 operates at high efficiency over a wi= de output current load range. =20 +The MPM82504 is a quad 25A, scalable, fully integrated power module with a= PMBus +interface. The device offers a complete power solution that achieves up to= 25A +per output channel. The MPM82504 has four output channels that can be para= lleled +to provide 50A, 75A, or 100A of output current for flexible configurations. +The device can also operate in parallel with the MPM3695-100 and additional +MPM82504 devices to provide a higher output current. The MPM82504 operates +at high efficiency across a wide load range. + The PMBus interface provides converter configurations and key parameters monitoring. =20 -The MPQ8785 adopts MPS's proprietary multi-phase digital constant-on-time = (MCOT) +The devices adopts MPS's proprietary multi-phase digital constant-on-time = (MCOT) control, which provides fast transient response and eases loop stabilizati= on. -The MCOT scheme also allows multiple MPQ8785 devices to be connected in pa= rallel -with excellent current sharing and phase interleaving for high-current +The MCOT scheme also allows multiple devices or chennels to be connected in +parallel with excellent current sharing and phase interleaving for high-cu= rrent applications. =20 Fully integrated protection features include over-current protection (OCP), over-voltage protection (OVP), under-voltage protection (UVP), and over-temperature protection (OTP). =20 -The MPQ8785 requires a minimal number of readily available, standard exter= nal -components, and is available in a TLGA (5mmx6mm) package. +All supported modules require a minimal number of readily available, stand= ard +external components. The MPQ8785 is available in a TLGA (5mmx6mm) package +and the MPM82504 is available in a BGA (15mmx30mmx5.18mm) package. =20 Device compliant with: =20 diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c index 00ec21b081cb..9a4a211b2aeb 100644 --- a/drivers/hwmon/pmbus/mpq8785.c +++ b/drivers/hwmon/pmbus/mpq8785.c @@ -8,7 +8,9 @@ #include #include "pmbus.h" =20 -enum chips { mpq8785 }; +#define PMBUS_READ_TEMPERATURE_1_SIGN BIT(9) + +enum chips { mpq8785, mpm82504 }; =20 static int mpq8785_identify(struct i2c_client *client, struct pmbus_driver_info *info) @@ -36,6 +38,23 @@ static int mpq8785_identify(struct i2c_client *client, return 0; }; =20 +static int mpm82504_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + int ret; + + ret =3D pmbus_read_word_data(client, page, phase, reg); + + if (ret < 0 || reg !=3D PMBUS_READ_TEMPERATURE_1) + return ret; + + /* Fix PMBUS_READ_TEMPERATURE_1 signedness */ + if (ret & PMBUS_READ_TEMPERATURE_1_SIGN) + ret |=3D GENMASK(15, 10); + + return ret; +} + static struct pmbus_driver_info mpq8785_info =3D { .pages =3D 1, .format[PSC_VOLTAGE_IN] =3D direct, @@ -59,12 +78,14 @@ static struct pmbus_driver_info mpq8785_info =3D { =20 static const struct i2c_device_id mpq8785_id[] =3D { { "mpq8785", mpq8785 }, + { "mpm82504", mpm82504 }, { }, }; MODULE_DEVICE_TABLE(i2c, mpq8785_id); =20 static const struct of_device_id __maybe_unused mpq8785_of_match[] =3D { { .compatible =3D "mps,mpq8785", .data =3D (void *)mpq8785 }, + { .compatible =3D "mps,mpm82504", .data =3D (void *)mpm82504 }, {} }; MODULE_DEVICE_TABLE(of, mpq8785_of_match); @@ -88,6 +109,13 @@ static int mpq8785_probe(struct i2c_client *client) case mpq8785: info->identify =3D mpq8785_identify; break; + case mpm82504: + info->format[PSC_VOLTAGE_OUT] =3D direct; + info->m[PSC_VOLTAGE_OUT] =3D 8; + info->b[PSC_VOLTAGE_OUT] =3D 0; + info->R[PSC_VOLTAGE_OUT] =3D 2; + info->read_word_data =3D mpm82504_read_word_data; + break; default: return -ENODEV; } --=20 2.43.0 From nobody Sun Feb 8 02:56:25 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 19EDD26FA52; Fri, 9 May 2025 06:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773606; cv=none; b=rmsEX6TUOUeMWppvnJHeziHM4wdPRQDX95i5saVErs2j5AGDha4THMbjFyrJJ9MgRgQt1SWn6PLT2tdzNtpSc8MffAwAjmRbMLIQpiBCekLcaGO0LlVyvweVKV6n86Xpy7S5fOIxEJkWbdEpD1Pa32nzMwDC8NggYAbIdC7YXSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773606; c=relaxed/simple; bh=XbyvX3UwLUkwC0pc5CuR0HrjYdx11LqUUQpNigy53lQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aA6eUfzFRJ4Rsdp+vQhJPglE4erRsdGbc3aaklWcvclGhVkimupuKLxWi181gviSSNpX455o8GSHOPW+MjBtFN3ynG021KlBSouNmK1N7fi7AYBmtQ9FM6ApywCefAtwTRzJ4rxO/+n+jNuxW7GvVanAHx+78G14mOFNNiNlbm4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SIunfV3W; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="SIunfV3W" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43ce71582e9so12965055e9.1; Thu, 08 May 2025 23:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746773602; x=1747378402; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hxIjdaLc48Q8gLT2aI5w+HCOv+woxWrYc8AKvi1Mj+s=; b=SIunfV3WnXacHZtOau+OBFDeRey6mP9kYIrIodEl6tCq99opEg124CcGsiBYc4jUqt fIqRs3Fnyh1GBN9UjKWAs+UidWvKGmtM2x2/8UofrBWqAr3FWaQ8koNJThx5Uc7+1Q76 aR6bButIT5TZ78aBJ6DypUsuqBZ6eLdeP+YsRErIOMOj6ULjchj3eH2DztzH89GuybCu 87vSt6qtE9U4KSoLHBOFOmqx0Ah0lqZdr6TLJXcSjDVVjRqo8RL10wlY+7QcoGY5Ndl4 /NzBgCAr8UxrudWe6XaykVke1k4BlbsqDf045sZhlhques6d5dJ0ze/KVc1z/QHjSaQJ Qr0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746773602; x=1747378402; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hxIjdaLc48Q8gLT2aI5w+HCOv+woxWrYc8AKvi1Mj+s=; b=Sr8RtM2zzUBedEMt8G8hMVhi88LP/9DRad6e9NSe2d+uhdX/O3RMCYK7jWDx3Lcoid OzKX+jgqczefikVGz0PqbVQixCgUqDK04NZHUgRSNwoc8TTYRj7+n/vgvv+6LgMan1f0 sZkj2cQrFZm5Hp8WsoYQuUdj03dVoRmNPBofAdv51JmJUcL6QRYwzr5/i9ynIqLfkVhz T1P8I2mvDUlJSkwYtkO8fjOttG078v6TluLD86AcXJHcdaYF5/03Vle2PUQHzHSQbeWE CtoLHJRIj+gqRQxoEFy3TfsxpRCsZdo7aoyRR4Ysy29Ft7NU9sVSFc7IaPaD8fF02pMU jBZg== X-Forwarded-Encrypted: i=1; AJvYcCW4ImohDihrmEB/mfONXcWTW9KeubpHuu7I7YXHHxRPxqCYNmN4lnP1djfwgoXy1A4y4AFf+fyPXhLhzIhD@vger.kernel.org, AJvYcCX4NX61La+xXL7ciVvClxbIPbdmWMBCkVvVtOvaGZHeChf1cigJy77CDj5Jr/o0nu+ZE3MKPMd/6zCI@vger.kernel.org, AJvYcCXCGSFiFPQOGGv6KYonSzFFcnAKimS3slF2YWTQCo4yzID6bg8NJyjlYZg6LhJCIzISBWOoV6jCGmNj@vger.kernel.org X-Gm-Message-State: AOJu0Yy0ifmVSE1DATnGw02dRpSXv1c8k9LU3nKWckR8WfTCBsQDraiA DStvcSv7Vp0Elny+TI9Y+aNvWMH86+bTgTnsHMOMPW8HqzVLTq/51h9UTpL4 X-Gm-Gg: ASbGncvqZdlyXp6zxcW+eSRBwGcQjAmshdXju8KldFoefaIY6YjR+rj6SnpmAr0U7X+ 38Hk7SkLoeJR8ojvYdy4exMOImFJU6HDOnCxYuFL3yW6pVr2jWOF50vWdMix2X+HwWkoZkQ43Ef vYBOLPjOtmlvOXh90gpwv3YdHncaaPiTwBAOK/eHwkOcDN0BWvBT0BygPMfd2a0lHLtdhkcMhX/ L7ZnTuqARcviOUHWd/qEaynHomDkumEfMqzo0jWLEJVC5It5PGpZBuxSPZ+Up56zzNq211URBzp QVPiM5KyNtfvUPONMS3AlHU0R+pBhGwoV4UjZOAb07VyBOIfVmmxZw2qVpS83YpzbA== X-Google-Smtp-Source: AGHT+IGh3zWR5dloNttdtVecxcltJ6Yzv9SN6JB89Afc2kJClOZagKrYdwWELSdcLPAC4dAN0R3e+Q== X-Received: by 2002:a05:600c:c04a:b0:43d:abd:ad1c with SMTP id 5b1f17b1804b1-442d89cb6e1mr5314605e9.6.1746773602019; Thu, 08 May 2025 23:53:22 -0700 (PDT) Received: from tempest2.110.lan (xt27dd.stansat.pl. [83.243.39.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442d67d5c2asm19276315e9.1.2025.05.08.23.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 May 2025 23:53:21 -0700 (PDT) From: Pawel Dembicki To: linux-hwmon@vger.kernel.org Cc: Pawel Dembicki , Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Noah Wang , Fabio Estevam , Michal Simek , Naresh Solanki , Grant Peltier , Laurent Pinchart , Peter Zijlstra , Shen Lichuan , Greg KH , Charles Hsu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 3/5] hwmon: pmbus: mpq8785: Add support for MPM3695 family Date: Fri, 9 May 2025 08:51:07 +0200 Message-ID: <20250509065237.2392692-4-paweldembicki@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250509065237.2392692-1-paweldembicki@gmail.com> References: <20250509065237.2392692-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the Monolithic Power Systems MPM3695 family. It contains four devices with suffixes: -10, -20, -25 and -100. The device is PMBus compliant and shares characteristics with the MPM82504. MPM3695-25 has different VOLTAGE_SCALE_LOOP register size [11:0] and it needs to be separated because it will be configured in the next commit. Tested with device tree based matching (MPM3695-10). Signed-off-by: Pawel Dembicki --- v2: - Added whole MPM3695 family --- Documentation/hwmon/mpq8785.rst | 13 +++++++++---- drivers/hwmon/pmbus/mpq8785.c | 8 +++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Documentation/hwmon/mpq8785.rst b/Documentation/hwmon/mpq8785.= rst index be228ee58ce2..7093e4db4f55 100644 --- a/Documentation/hwmon/mpq8785.rst +++ b/Documentation/hwmon/mpq8785.rst @@ -7,6 +7,7 @@ Supported chips: =20 * MPS MPQ8785 * MPS MPM82504 + * MPS MPM3695 family =20 Prefix: 'mpq8785' =20 @@ -29,6 +30,14 @@ The device can also operate in parallel with the MPM3695= -100 and additional MPM82504 devices to provide a higher output current. The MPM82504 operates at high efficiency across a wide load range. =20 +The MPM3695 family is a scalable, ultra-thin, fully integrated power modul= e with +a PMBus interface. It offers a complete power solution that achieves up to +10A (-10 variant), 20A (-25 variant), 25A (-20 variant), 100A (-100 varian= t) +of output current with excellent load and line regulation across a wide in= put +voltage range. It operates at high efficiency over a wide load range, and = can +be parallled to deliver higher current. Variants -10,-20 and -100 have dif= ferent +voltage scale configuration register range (10 bits) than -25 version (11 = bits). + The PMBus interface provides converter configurations and key parameters monitoring. =20 @@ -42,10 +51,6 @@ Fully integrated protection features include over-curren= t protection (OCP), over-voltage protection (OVP), under-voltage protection (UVP), and over-temperature protection (OTP). =20 -All supported modules require a minimal number of readily available, stand= ard -external components. The MPQ8785 is available in a TLGA (5mmx6mm) package -and the MPM82504 is available in a BGA (15mmx30mmx5.18mm) package. - Device compliant with: =20 - PMBus rev 1.3 interface. diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c index 9a4a211b2aeb..34245d0d2125 100644 --- a/drivers/hwmon/pmbus/mpq8785.c +++ b/drivers/hwmon/pmbus/mpq8785.c @@ -10,7 +10,7 @@ =20 #define PMBUS_READ_TEMPERATURE_1_SIGN BIT(9) =20 -enum chips { mpq8785, mpm82504 }; +enum chips { mpq8785, mpm82504, mpm3695, mpm3695_25 }; =20 static int mpq8785_identify(struct i2c_client *client, struct pmbus_driver_info *info) @@ -79,6 +79,8 @@ static struct pmbus_driver_info mpq8785_info =3D { static const struct i2c_device_id mpq8785_id[] =3D { { "mpq8785", mpq8785 }, { "mpm82504", mpm82504 }, + { "mpm3695", mpm3695 }, + { "mpm3695-25", mpm3695_25 }, { }, }; MODULE_DEVICE_TABLE(i2c, mpq8785_id); @@ -86,6 +88,8 @@ MODULE_DEVICE_TABLE(i2c, mpq8785_id); static const struct of_device_id __maybe_unused mpq8785_of_match[] =3D { { .compatible =3D "mps,mpq8785", .data =3D (void *)mpq8785 }, { .compatible =3D "mps,mpm82504", .data =3D (void *)mpm82504 }, + { .compatible =3D "mps,mpm3695", .data =3D (void *)mpm3695 }, + { .compatible =3D "mps,mpm3695-25", .data =3D (void *)mpm3695_25 }, {} }; MODULE_DEVICE_TABLE(of, mpq8785_of_match); @@ -110,6 +114,8 @@ static int mpq8785_probe(struct i2c_client *client) info->identify =3D mpq8785_identify; break; case mpm82504: + case mpm3695: + case mpm3695_25: info->format[PSC_VOLTAGE_OUT] =3D direct; info->m[PSC_VOLTAGE_OUT] =3D 8; info->b[PSC_VOLTAGE_OUT] =3D 0; --=20 2.43.0 From nobody Sun Feb 8 02:56:25 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 905EB26FA62; Fri, 9 May 2025 06:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773613; cv=none; b=mllxJs8Nn+C3k5WbH33ADufHQ4pxOjNHSAadmCqJ/+zXmDEPrJlBzZJOyX4IRv5VO4q717da/afFSgE6N0oyR86Y/uaaJen7flpamA05jnmWXEBn8kUygWIcgrbJ3YkA0/35wdKvnWVM130OnuRXWO8+dt5e0M+zarE6qaRf1go= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773613; c=relaxed/simple; bh=l//vUM087xV+nJfyiGsMAfxiiqa54Dz/LRTuZMSZkfs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=paCk/uinVE2+OtIoTvftBhI8OwY2j9dgBiYbVqxRgLPsumsak2ig7JKXHU0ZWAdL+2cuE/v4hCzl2wPNDzR8yvxNM5RCnlejdom2zgQK31MipgQUQO4hEfFwwBmPbRA1Lsu2eAHwjtQO3G1x466FHv/qypfK40PSZbS2Kogmgx0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kxjj6J5H; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="kxjj6J5H" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so17659635e9.1; Thu, 08 May 2025 23:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746773610; x=1747378410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/mJxZyA18DAsV55MUHihR0kGwoLDmPI7gH5j+D/cQmY=; b=kxjj6J5Hz17qvteFavT+eUvJXRH5Qg4dTMzCk4RGkdgfLobtttaeMYmgtfihpMOReV K0sYGABC49WH4ocKk5Y+dlmHMeiucGMB1Vv2JsQUlkh7NMvjxXeK3OLo5f2kdPEP5CSz /pz0EdieNGYpwisyfqaX3WNNZdG8RCH0YrdI6+du6BAir4jopGByp5XJqz2EKGrc593E vq+P2O39mQ/jc3RnVRPHWOsoUig0ydpZXIDUqnZjTp+fXRHDagKAk62vmjYsHhRsr0DA QEc/1EWixJfWCbSjzyupHU8cRNiRKNxTfV0448oKucaFZ/ayIM2fcsuVPyWvQBj8nCkh sN+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746773610; x=1747378410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/mJxZyA18DAsV55MUHihR0kGwoLDmPI7gH5j+D/cQmY=; b=O8e+uKjyoaAw0y9O3KzHDY6nfo8oqUK8OcW9g2+ZHkLiTqyOVTeBNLzBJMhNpKhmL7 YQmWqXprQLI7XtKfJXk+J/n3EGV8ZaAw454JVpIumqRp4eEl9ZxP/OajX8YEkwDrRr/H bhHDG8PrhYlMSAgY7NOAUNnL/IO/87YJiZ1lLj3Lmu2tixSi1g53VMg0EeJUAKdq/j4x HkzTkl/tD3YG7TDmVJuShkz5xRqPr1oJNBcTXgB0dBhNg3ql6ekUVI46LxzZZdOH3z0s oc46yUa4ZXqo9XcJfWaHIxFxxeD8klFgVr/CmeSHXHjTZZtjCrfW6RP+JBpJOIVfNcHK o+kA== X-Forwarded-Encrypted: i=1; AJvYcCUzDhnNMpjOdSil7fQMvDiDlkJUJpiQV5g7i4yNZguJE96gAA0BWk+IU6GR6Jd8lBRgDNPqVC6g6xwS@vger.kernel.org, AJvYcCVIeblh7tarTV5w4jwxETXduLaFDWKgbQDQTiC7w2otK8TVrZVdfzjAeJqiZMZLRLQKB+3GfuN2/v259O7q@vger.kernel.org, AJvYcCVqyQLiG3JNKKepHMz5VAKU5XKj3/QclEEfbmCVpdPxz7xkN8fORmM2OlyuuVPnvDhRuo6PMvGzmH7q@vger.kernel.org X-Gm-Message-State: AOJu0YwX6Rg6joqyRLd10QLhaswD2gJ4eB+ISEm22kGiO03s4007zrvf Xx7mQpu5ALkEB4WRpznt4jEYHNAhd/u/LjSV+U9EJMToXd04zvgPAFLxoflR X-Gm-Gg: ASbGncsoqV8Mqm5+xeJl9urtoOEnZcS7jVMLV/O/muyW3koP8tHnKQmJwOsOtotqagP FPrNQFsyVIfe+udtSf6OuQHQ6AP6ItDou6Ix04pdb7JpWeVsJDJyp4rm+XSEsGwPcy4CNel+r8f zsJvLCyXW+bp0/rhnb79WnYFrUkwDEkzNq+jYN4LSoSBTkRueYEsMJs4UJ6cuuptz8xEm3r3HWR BA22BMswE/7xNBE+uvw3l4iQi01/PMzcaEuDMjscrkzG0FdzIpDyHjOlJWP4QvdM6HJ224+yRaR Q6i1l+slZKJdoaDi4M68bQVjRjJ0ydEeOoE7M59r0nTULxu/xwWRyCUo3fnOdPGmHg== X-Google-Smtp-Source: AGHT+IECt1Fjb2mC/ICq4YSSW6IpGkJhFrpmupSt1M2faiqeR6nyn/ZZhIRL6VeBFBay229oiKvh9g== X-Received: by 2002:a05:600c:6307:b0:43b:c284:5bc2 with SMTP id 5b1f17b1804b1-442d6c36448mr20301805e9.0.1746773609804; Thu, 08 May 2025 23:53:29 -0700 (PDT) Received: from tempest2.110.lan (xt27dd.stansat.pl. [83.243.39.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442d67d5c2asm19276315e9.1.2025.05.08.23.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 May 2025 23:53:29 -0700 (PDT) From: Pawel Dembicki To: linux-hwmon@vger.kernel.org Cc: Pawel Dembicki , Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Noah Wang , Michal Simek , Naresh Solanki , Fabio Estevam , Grant Peltier , Laurent Pinchart , Shen Lichuan , Peter Zijlstra , Greg KH , Charles Hsu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 4/5] hwmon: pmbus: mpq8785: Implement VOUT feedback resistor divider ratio configuration Date: Fri, 9 May 2025 08:51:08 +0200 Message-ID: <20250509065237.2392692-5-paweldembicki@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250509065237.2392692-1-paweldembicki@gmail.com> References: <20250509065237.2392692-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Implement support for setting the VOUT_SCALE_LOOP PMBus register based on an optional device tree property "mps,vout-fb-divider-ratio-permille". This allows the driver to provide the correct VOUT value depending on the feedback voltage divider configuration for chips where the bootloader does not configure the VOUT_SCALE_LOOP register. Signed-off-by: Pawel Dembicki --- v2: - rename property to mps,vout-fb-divider-ratio-permille - add register value range checking --- drivers/hwmon/pmbus/mpq8785.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/hwmon/pmbus/mpq8785.c b/drivers/hwmon/pmbus/mpq8785.c index 34245d0d2125..1d0e7ac9daf4 100644 --- a/drivers/hwmon/pmbus/mpq8785.c +++ b/drivers/hwmon/pmbus/mpq8785.c @@ -12,6 +12,13 @@ =20 enum chips { mpq8785, mpm82504, mpm3695, mpm3695_25 }; =20 +static u16 voltage_scale_loop_max_val[] =3D { + GENMASK(10, 0), /* mpq8785 */ + GENMASK(9, 0), /* mpm82504 */ + GENMASK(9, 0), /* mpm3695 */ + GENMASK(11, 0), /* mpm3695_25 */ +}; + static int mpq8785_identify(struct i2c_client *client, struct pmbus_driver_info *info) { @@ -99,6 +106,8 @@ static int mpq8785_probe(struct i2c_client *client) struct device *dev =3D &client->dev; struct pmbus_driver_info *info; enum chips chip_id; + u32 voltage_scale; + int ret; =20 info =3D devm_kmemdup(dev, &mpq8785_info, sizeof(*info), GFP_KERNEL); if (!info) @@ -126,6 +135,18 @@ static int mpq8785_probe(struct i2c_client *client) return -ENODEV; } =20 + if (!of_property_read_u32(dev->of_node, + "mps,vout-fb-divider-ratio-permille", + &voltage_scale)) { + if (voltage_scale > voltage_scale_loop_max_val[chip_id]) + return -EINVAL; + + ret =3D i2c_smbus_write_word_data(client, PMBUS_VOUT_SCALE_LOOP, + voltage_scale); + if (ret) + return ret; + } + return pmbus_do_probe(client, info); }; =20 --=20 2.43.0 From nobody Sun Feb 8 02:56:25 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 C184C26E16A; Fri, 9 May 2025 06:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773621; cv=none; b=jKFK7HWKtOX8zzSDIV10PAV0gXyDjqdov/oEcmhv481jltGbUg2mAr2Yg1IDrhiSKQZRjsHKKpP3PpFO0HekNyioAbF8wvqv4UuD80bXp7+76pvFQG4nG8H91/vsFQhFYmSGcEfibSAJyY4ax9FjMHuDuJLGu28O07YIS2uAXD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746773621; c=relaxed/simple; bh=cv3RfpeMQ4Ck7UgZdFcV3vI06Yt1aRSptGNgot++bps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RmXkGrG/j+ppMda7DvJJmnyho9d0OXW5372+tP2By8W39DBYQwhlH62SE6KDT+F7BFC+ffmJhPDRxt2J+ioRDJlW/j4u2uYY670ImAzGXCbANQkRaM00j8d1uZ62e5cm4QHhwGdBnLttWmFT7eZyUnPLo5srJHVL+Gn4aNdRFa8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NoiDDEoV; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com 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="NoiDDEoV" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43edecbfb46so12949455e9.0; Thu, 08 May 2025 23:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746773618; x=1747378418; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5LurdoLz7UweJ6Wmwk4qfD4FsF/JhV+fB9edgA8f4OU=; b=NoiDDEoVPfmfgozPVyBOTisCjYRqUX2puPamj63wl2vYX4cyo29oHIfi1ADxE7Wi1S bU5CTlTvwMhBytMfoB/epEEoa+iirr9eI/w2dQBJP+bSZeKwQIlGiOlACRW+gueb0mwb 582JhIXy23Mn7f1IyWK0G6rMXrzC7qUI2+MuK4d12/wFUEVw8JZ3cZPFft4JYhINi9Ii UuCYrBSvqrvH/0CfuTl1dNAvfhraD2+PXLDMrk+YvlJsSIRh+FcogtxT0Xf6jIcTslkq gGoa/sjaf/wSU4uMU3LNcTSGIHJabkUtEy6w/kjKLJcsqWBtjEgAy+Yb2c4EOdJZ3YUl 5jjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746773618; x=1747378418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5LurdoLz7UweJ6Wmwk4qfD4FsF/JhV+fB9edgA8f4OU=; b=kIWGxYxEtfZ0pGXGOo1zvmcvQXHfRWnyEj9xAP9cTx0Zvpi6Lyi8MrHGk/+1H74ZMr TtK87iDL6QI8VjmS8FxcrLrg0P1J5cBJ+QRtt7uTYJA/O2wSvxZykPtDiF6BsLq0aoJF 9H9ND13fOl5dkEbO6Vh/jbpjntg5iKjOqKU3LTNyLxCGNenn1bfEwj1U3Dz0rwsnsIih k6zBzfWIMv0Qpj88sbAW5x29fYb2rJnylgDd4Y5DQYHBpnxlIzhw9kyfSRVhDs0sgie/ O2wI4EkFfmO3jEjQ3oWOWvK5BwDN7yvS17PHohMfdFKQZPIGPCyHs5Ez3Inbx0rVITFb W+xw== X-Forwarded-Encrypted: i=1; AJvYcCULmmughZFLCRzDF9KRCI1USm7lKIC0lR4Cu8drsiZsgoPUvOm6R/VZdOo/3MWVrMSK1oKxSVqVE3Nxx/IQ@vger.kernel.org, AJvYcCWrlbE2XlZRw7VqUlehAVcTY56zgMRbL7BjcFx5RSpkJegi//j5YLa7z640HdfvOjSB89CEmzRFC+qY@vger.kernel.org, AJvYcCXsXeRzwY0YumZtgDJvHzDz5AxqIOWyifP6/2pbif7hmCsOODtiBFhoeeTGSaBz39efhNHpYRZZj28W@vger.kernel.org X-Gm-Message-State: AOJu0Yy8PXVt3QQYg292Zth/pusxS1GAX5ldbATqWvkDjeX1xY9z/57P tnFtvs5FlswElzyYaHZjShFLdmSAKpF09XXj9HQw9bKRwqB0AOhtM6pAshy1 X-Gm-Gg: ASbGnctNJtmJLti10NhQG3atXk0GFpGLqdUUTjbpr01dWVYKHK7G/MEFWCTc05jtYg9 c3B4DLTv3F6bFHK1ZLGkYx1ujK2Sej+kEGtYPsTk/YVUhWo8s7I0eFbvxhUTv+hU5R5bSEzxY4D 5FBYe5cn5m/BWS+y/vjq+jRG24pMNmBrGUxGNnFeA6EKCljDKjJ8XxPmi1M3Rqbe0iNb62R4oJZ 9ls94p1bUQyzc7DRavJVhi2I0QYJj+eUH5dYIInsJ24Zco4lVyxdtfDTG2Z/ylHLh44o3SP5xiS bENLrNg5NozQpt1KcryQ0G64zgBZy5fxj7+FlHEhceSXZ5iJ2RlJMq/8uOe7Hv2Z3A== X-Google-Smtp-Source: AGHT+IERkckyKlmXuZnRf0VVS6j7vxJGHp2mD1teeEiyOIji9PfSnSJn4PQPjqXigCXmZZsyuvuPGQ== X-Received: by 2002:a05:600c:34d5:b0:441:d438:4ea5 with SMTP id 5b1f17b1804b1-442d6dd24d3mr12441735e9.20.1746773617423; Thu, 08 May 2025 23:53:37 -0700 (PDT) Received: from tempest2.110.lan (xt27dd.stansat.pl. [83.243.39.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442d67d5c2asm19276315e9.1.2025.05.08.23.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 May 2025 23:53:37 -0700 (PDT) From: Pawel Dembicki To: linux-hwmon@vger.kernel.org Cc: Pawel Dembicki , Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Noah Wang , Michal Simek , Fabio Estevam , Naresh Solanki , Grant Peltier , Laurent Pinchart , Greg KH , Peter Zijlstra , Shen Lichuan , Charles Hsu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 5/5] dt-bindings: hwmon: Add bindings for mpq8785 driver Date: Fri, 9 May 2025 08:51:09 +0200 Message-ID: <20250509065237.2392692-6-paweldembicki@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250509065237.2392692-1-paweldembicki@gmail.com> References: <20250509065237.2392692-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add device tree bindings for Monolithic Power Systems MPQ8785, MPM82504 and MPM3695 PMBus-compliant voltage regulators. These bindings also documents the optional "mps,vout-fb-divider-ratio-permille" property. --- v2: - remove mps,mpq8785 from trivial-devices.yaml - fix alphabetical order - rename voltage-scale-loop to mps,vout-fb-divider-ratio-permille - add mps,vout-fb-divider-ratio-permille min and max values - rewrite mps,vout-fb-divider-ratio-permille description Signed-off-by: Pawel Dembicki --- .../bindings/hwmon/pmbus/mps,mpq8785.yaml | 88 +++++++++++++++++++ .../devicetree/bindings/trivial-devices.yaml | 2 - 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq87= 85.yaml diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml= b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml new file mode 100644 index 000000000000..3c61f5484326 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/pmbus/mps,mpq8785.yaml @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/hwmon/pmbus/mps,mpq8785.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Monolithic Power Systems Multiphase Voltage Regulators with PMBus + +maintainers: + - Charles Hsu + +description: + Monolithic Power Systems digital multiphase voltage regulators with PMBu= s. + +properties: + compatible: + enum: + - mps,mpm3695 + - mps,mpm3695-25 + - mps,mpm82504 + - mps,mpq8785 + + reg: + maxItems: 1 + + mps,vout-fb-divider-ratio-permille: + description: + The feedback resistor divider ratio, expressed in permille + (Vfb / Vout * 1000). This value is written to the PMBUS_VOUT_SCALE_L= OOP + register and is required for correct output voltage presentation. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + +allOf: + - if: + properties: + compatible: + const: mps,mpq8785 + then: + properties: + mps,vout-fb-divider-ratio-permille: + maximum: 2047 + + - if: + properties: + compatible: + const: mps,mpm82504 + then: + properties: + mps,vout-fb-divider-ratio-permille: + maximum: 1023 + + - if: + properties: + compatible: + const: mps,mpm3695 + then: + properties: + mps,vout-fb-divider-ratio-permille: + maximum: 1023 + + - if: + properties: + compatible: + const: mps,mpm3695-25 + then: + properties: + mps,vout-fb-divider-ratio-permille: + maximum: 4095 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + pmic@30 { + compatible =3D "mps,mpm82504"; + reg =3D <0x30>; + mps,vout-fb-divider-ratio-permille =3D <600>; + }; + }; diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Docum= entation/devicetree/bindings/trivial-devices.yaml index 8da408107e55..7c1c0cc29655 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -293,8 +293,6 @@ properties: - mps,mp5990 # Monolithic Power Systems Inc. digital step-down converter mp= 9941 - mps,mp9941 - # Monolithic Power Systems Inc. synchronous step-down converte= r mpq8785 - - mps,mpq8785 # Temperature sensor with integrated fan control - national,lm63 # Serial Interface ACPI-Compatible Microprocessor System Hardw= are Monitor --=20 2.43.0