From patchwork Wed Apr 24 09:55:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Yin X-Patchwork-Id: 13641673 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 E305E158D9C; Wed, 24 Apr 2024 09:56:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952582; cv=none; b=ujP4JUjTtsKJOt9XZdee6BKYN0ogg5LgcV7idjVC/kGpdZZ2l9/AJRD00MmhyyyToIFW4wONbXOKMUn4fatFQBxAZt3zPd0sk9COE7VNPwPaMfXIXZ0WEFVksjyut9WgbiLPKq8cuPwbG0UxtBF73jor/R0P3IdmCbaEO1z9xsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952582; c=relaxed/simple; bh=kR9d0v/gm6d2o7AuomAmnJwB+zXQHcAh7ya8jOFQr+M=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FFIc/R5rype9puFQ5VnF9CuE22aE5HQ6ykxziW2+qYw9KKXWW3Zgkgl6INWxWEGEuRsr6Y536f8rKs1WRy2hZZvXGefNsZ0hbW4NnZYqOzJsT0Y450ZM7MurxuFlRmBvZ/HMbH8P8bQ8tADgBevjswAnrxib8epjoiM8I1jNk4c= 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=R7Iwlxog; arc=none smtp.client-ip=209.85.167.174 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="R7Iwlxog" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c70a55988dso3694772b6e.0; Wed, 24 Apr 2024 02:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713952580; x=1714557380; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xtzaetZ2A2XG/RgyiPPy1hUBmHC1EMIQ5TN+/Eje5fM=; b=R7IwlxogmPCdEx12UlHtdFrntOOkPlnENmEmd+DEEWopu5JRfHVNHACqlF1Te2rD41 r2WW7dzMJwpWfkJ3orYyYoQTzrRSw/2HQfnFT4j48rRu83nGbZW8N6FluF9wBz79yyPr 2A5assP1+jq24bG4QfCsQjzFdlASVptcLrBqEc+x7IvVuR/8ZrE/enXyy9PKryAQMHRg +006nikODF33KsGAdzG75V2Wgb/woyFXapsQ+V7R45ya8uMpLGumXYa855sHJKuQszHt GmVNhWnHcY9BLwUoYc7VQ4eCaj+b6njmXQjJt0yqawGK3Q1/Qrvy/mEIfHq5ugK85VZ2 CauA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713952580; x=1714557380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xtzaetZ2A2XG/RgyiPPy1hUBmHC1EMIQ5TN+/Eje5fM=; b=NtdpB3Bv4h54/C86reXAlT2dks+MFsKBVpWdVVNl8dK8HXhM+3unIqBKt/ASEFHLq9 j6M2oDL4Rx6zfQFOaXteNRyTZK9rSDnc2aoJ/E9lOKx+PQzom6c4K6Af/CIdKBcvgSo/ 1PFrnUk7mKis0Wij6kwrqmjGV0XEIQ41fKjyQ5nMr6rlNut0A+Cn5ftEqzCFaIO/Jj0G 1+/FH7AdSONXeWD3F+ek2KiGBbWamwmQt1MpVUFpnp3Yt9B8VKjDC3+exl3FYDTevJMX X99yI4mlk/cjt5kusWY2c4pbcYlCEmJi30cbWUd0AftvLPp2NGB1a1ysUWm6xMoqmpNv cb2Q== X-Forwarded-Encrypted: i=1; AJvYcCXlSxayP+MVoQm9ybe1a08+lLJinTZwWxDYb6smKPqGVwMRHKy+hW8M8I73xEjLGjNOvR6pYiwRyRwZRwskZpevhkUq8uVAc+fzSI47zXopYx4OjBH9HAUZ1gs4QzLFOBvZrsbjEO18dWCRIkEA6XNiV/b9AXghreVw/WDR9ZWI0JF+FXfjj0s3fHkFWz2Mp1Cyy3tQHI9p5sstl7gaXdiCLM1NLBnd7fJUJYxa+jAfLDQj1234vmFUZwO6 X-Gm-Message-State: AOJu0Yzhlct8zVfKxyBcB9pkAp9BiAcvcI/0NiTp7UmGA+qHbGzR/iIZ nu+ujuBnYh8ockp1T7CtyrFWbp2O9/8keTWJGtzRABZbZPi2Lg7c X-Google-Smtp-Source: AGHT+IFejZJpWJETvIXC9VrPpTMlMtUeGrugQIoK4LKK+EqxwDPZEw6jjr1aKKu5513jvcSZOAZRog== X-Received: by 2002:a05:6808:a85:b0:3c8:2b71:97 with SMTP id q5-20020a0568080a8500b003c82b710097mr1811766oij.12.1713952579856; Wed, 24 Apr 2024 02:56:19 -0700 (PDT) Received: from peter-bmc.dhcpserver.bu9bmc.local (2001-b400-e380-6057-c341-626e-0f0b-b82d.emome-ip6.hinet.net. [2001:b400:e380:6057:c341:626e:f0b:b82d]) by smtp.gmail.com with ESMTPSA id b19-20020a056a000a9300b006eae3aac040sm11042932pfl.31.2024.04.24.02.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 02:56:19 -0700 (PDT) From: Peter Yin To: patrick@stwcx.xyz, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean Delvare , Guenter Roeck , Jonathan Corbet , Delphine CC Chiu , Patrick Rudolph , Michal Simek , Marek Vasut , Bjorn Helgaas , Lukas Wunner , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v1 1/3] hwmon: (pmbus) Add support for Infineon XDP710 Date: Wed, 24 Apr 2024 17:55:57 +0800 Message-Id: <20240424095604.3425857-2-peteryin.openbmc@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> References: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for xdp710 device from Infineon vendor. This is a Hot-Swap Controller. Signed-off-by: Peter Yin --- drivers/hwmon/pmbus/Kconfig | 9 ++ drivers/hwmon/pmbus/Makefile | 1 + drivers/hwmon/pmbus/xdp710.c | 155 +++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 drivers/hwmon/pmbus/xdp710.c diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 557ae0c414b0..d72bdecf758a 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -511,6 +511,15 @@ config SENSORS_UCD9200 This driver can also be built as a module. If so, the module will be called ucd9200. +config SENSORS_XDP710 + tristate "Infineon XDP710 family" + help + If you say yes here you get hardware monitoring support for Infineon + XDP710 device. + + This driver can also be built as a module. If so, the module will + be called xdp710. + config SENSORS_XDPE152 tristate "Infineon XDPE152 family" help diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile index f14ecf03ad77..4fe630793721 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o obj-$(CONFIG_SENSORS_TPS546D24) += tps546d24.o obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o +obj-$(CONFIG_SENSORS_XDP710) += xdp710.o obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o obj-$(CONFIG_SENSORS_XDPE152) += xdpe152c4.o obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o diff --git a/drivers/hwmon/pmbus/xdp710.c b/drivers/hwmon/pmbus/xdp710.c new file mode 100644 index 000000000000..3ed324bd0db6 --- /dev/null +++ b/drivers/hwmon/pmbus/xdp710.c @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Driver for Infineon XDP710 Hot-Swap Controller + */ + +#include +#include +#include +#include +#include "pmbus.h" + +#define XDP710_REG_CFG (0xD3) +#define XDP710_V_SNS_CFG (0xD4) +#define XDP710_CS_RNG (0xD5) + +struct xdp710_data { + struct pmbus_driver_info info; + u8 cs_rng; + u8 vtlm_rng; + int rsense; +}; + +/* + * 0x00 to 0x09 + * 0x0A to 0x13 + * 0x14 to 0x1D + * 0x1E to 0x27 + * 0x28 to 0x32 + * 0x33 to 0x3F + */ +const int microOhmRsense[] = { + 200, 250, 300, 330, 400, 470, 500, 600, 670, 700, + 750, 800, 900, 1000, 1100, 1200, 1250, 1300, 1400, 1500, + 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, + 2600, 2700, 2800, 3000, 3100, 3200, 3300, 3400, 3500, 3600, + 3800, 3900, 4000, 4200, 4300, 4500, 4700, 4800, 4900, 5000, + 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000 +}; + +static struct pmbus_driver_info xdp710_info = { + .pages = 1, + .format[PSC_VOLTAGE_IN] = direct, + .format[PSC_VOLTAGE_OUT] = direct, + .format[PSC_CURRENT_OUT] = direct, + .format[PSC_POWER] = direct, + .format[PSC_TEMPERATURE] = direct, + .m[PSC_VOLTAGE_IN] = 4653, + .b[PSC_VOLTAGE_IN] = 0, + .R[PSC_VOLTAGE_IN] = -2, + .m[PSC_VOLTAGE_OUT] = 4653, + .b[PSC_VOLTAGE_OUT] = 0, + .R[PSC_VOLTAGE_OUT] = -2, + .m[PSC_CURRENT_OUT] = 23165, + .b[PSC_CURRENT_OUT] = 0, + .R[PSC_CURRENT_OUT] = -2, + .m[PSC_POWER] = 4211, + .b[PSC_POWER] = 0, + .R[PSC_POWER] = -2, + .m[PSC_TEMPERATURE] = 52, + .b[PSC_TEMPERATURE] = 14321, + .R[PSC_TEMPERATURE] = -1, + .func[0] = + PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_PIN | + PMBUS_HAVE_TEMP | PMBUS_HAVE_IOUT | + PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP, +}; + +static int xdp710_probe(struct i2c_client *client) +{ + struct pmbus_driver_info *info; + struct xdp710_data *data; + int ret; + int m = 0; + + data = devm_kzalloc(&client->dev, sizeof(struct xdp710_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + memcpy(&data->info, &xdp710_info, sizeof(*info)); + info = &data->info; + + /* + * Read CS_RNG Value + */ + ret = i2c_smbus_read_word_data(client, XDP710_CS_RNG); + if (ret < 0) { + dev_err(&client->dev, + "Can't get CS_RNG. Setting the CS_RNG to 0"); + ret = 0; + } + data->cs_rng = (ret >> 6) & GENMASK(1, 0); + + /* + * Read V_SNS_CFG Value + */ + ret = i2c_smbus_read_word_data(client, XDP710_V_SNS_CFG); + if (ret < 0) { + dev_err(&client->dev, + "Can't get V_SNS_CFG. Setting the V_SNS_CFG to 0"); + ret = 0; + } + data->vtlm_rng = ret & GENMASK(1, 0); + + /* + * Read RSNS_CFG Value + */ + ret = i2c_smbus_read_word_data(client, XDP710_REG_CFG); + if (ret < 0) { + dev_err(&client->dev, + "Can't get REG_CFG, Setting the Rsense to 0.33mohm"); + ret = 3; + } + ret &= GENMASK(5, 0); + data->rsense = microOhmRsense[(u8)ret]; + + info->m[PSC_VOLTAGE_IN] <<= data->vtlm_rng; + info->m[PSC_VOLTAGE_OUT] <<= data->vtlm_rng; + + m = info->m[PSC_CURRENT_OUT]; + info->m[PSC_CURRENT_OUT] = ((m >> (data->cs_rng)) * + (data->rsense)) / 1000; + + m = info->m[PSC_POWER]; + info->m[PSC_POWER] = ((m >> (data->cs_rng)) * + (data->rsense)) / 1000; + + return pmbus_do_probe(client, info); +} + +static const struct of_device_id xdp710_of_match[] = { + { .compatible = "infineon,xdp710" }, + {} +}; + +static const struct i2c_device_id xdp710_id[] = { + {"xdp710", 0}, + { } +}; +MODULE_DEVICE_TABLE(i2c, xdp710_id); + +static struct i2c_driver xdp710_driver = { + .driver = { + .name = "xdp710", + .of_match_table = xdp710_of_match, + }, + .probe = xdp710_probe, + .id_table = xdp710_id, +}; +module_i2c_driver(xdp710_driver); + +MODULE_AUTHOR("Peter Yin "); +MODULE_DESCRIPTION("PMBus driver for XDP710 HSC"); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(PMBUS); From patchwork Wed Apr 24 09:55:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Yin X-Patchwork-Id: 13641674 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 2812E159219; Wed, 24 Apr 2024 09:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952591; cv=none; b=JbofiibQGez4JQKYXS9QTiMzZF3mctlsQqObqkc89/2lZ4b5w37yNNo3XT9iarm8KWLrVDjKBzSAjAGBgVC3NbNjaArA7R/Mntm5RUblw9puLfVVbH4aIp8CJSq/T0fAzU6Q55ker9IeUeNPcG/D+Oc6xhLtFZnp8Hq/VgRJF80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952591; c=relaxed/simple; bh=GR8A7c005nMUANFMAbqCEmqGtDL0serin5bnFniQPOo=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SEBy+e2RxPCaENfaf9u0l4QKFj8vRxOzkN/DEaJDw+Ui1UomacqBRDjdMW2Yci4GSm0s3f80vJsHfqp1HQ2RzZ5uDJ/n2mKcNA4SUwvKMK9H1BJyzyDt1PLy9jIJ88RXont3D83+HMZBamJ4XJqJDhvwrO64UNthjEvhFJFO2Qo= 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=HGdQPbdi; arc=none smtp.client-ip=209.85.210.174 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="HGdQPbdi" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f043f9e6d7so6982622b3a.3; Wed, 24 Apr 2024 02:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713952589; x=1714557389; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yN9ZYDD/GHZL9HeYNNtcwFkCjAa5nvHWIU9QFcJoOPI=; b=HGdQPbdiKcMr6ZEuEQwynP3LW4utID2QkeIBuD9KsVdMNSotjCgMVxG7KA1mtS63Kh YHD9szMTMRHDqBSI36L3SupxWA+ZoNe09uFimmNXauPjO2wvQ6OUsMrGP2RhLsmSQxiL 7P8MEb1ppKiKVZrWM5Cpj+xIhiwcKkc5mexpda6MuuBjSv1BgsV4JdMeJUoNv023Ny44 Wg00SKMxYt9ibhYlByfFjxiOlUsQcal2V0O3usCQ9395SyVWqWM1sWrBwPdvUxUWlonL MriuGg1gdfa1T/TeABUb7nMuQ2hZxKTaEMENQprPOTQSfiF/oy8Fth9i6Oo0ZcutZ07U CNRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713952589; x=1714557389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yN9ZYDD/GHZL9HeYNNtcwFkCjAa5nvHWIU9QFcJoOPI=; b=MExn7Pt00mj74G5VXke1nZygCKa1nvCYd2Yu2fyDgrwP7+faMq4PPyVqen+m6V/AaX VAV44kA1Sd/XDHf87KBdpSu8syKsLgnt5cV55lsr1DyIgkbq0/iOn4/eGkgQzz3bFG/C zEoKDkfIM1pMeLi2rAOk/XmFtthGBH6VK8md6d1H+Ze6/DnQOlpV1/gO4L74ifJsRoR7 MpAKpS7q44Ws9S+TnXpeLVbZIsWx7bJXWTYUf3SYakHRT8VNg3b8UHbTKjrp0QxuU0zv ptbGCqbuZB+jYn/8cGMyhsYt7OWz36twaCe15l80F0DoxC9ZnWSLriYMQuxBQOOczn6O rsMQ== X-Forwarded-Encrypted: i=1; AJvYcCXadpdcy/icz1MSflWMHHKKlPicF6aMiOkRe86uhyLZlgzjPrl49cS6YaJlWh9ztd7c8gfgpwuTEH91UgbLozw0OmtfnPIRzDw4j8fTLiYiyaGZ+8DMLPQAR/eCX3xomkz2iDe0JzAs2gGHzxfmmAcMVK9TkD5r+gvfgLjkutvUwsC/cFtWMPmN1kWkAMQJxmGQ1FA7e01kQg80VSpqdaz0WOWS4RtnN1TSO3dv8wmkDmnxtHJIY+oTUiXm X-Gm-Message-State: AOJu0YyI3dHKeAzmLcHy/qXJfKmBfLsXE0Hoxh9AtwL5fyc5GL/fCyf/ wyUGaGiODGtGrl4KYuyfVx+z0L7Kv4VJjBOT1fqfxwSZ0tHSBdTP X-Google-Smtp-Source: AGHT+IHqENdYJgDrTUiyFBAYDEfP2zIyky+sERTOkTbpoL6wOvHxSc59L8kaSHDYhBV3FJbCcF44SA== X-Received: by 2002:a05:6a20:96d0:b0:1ac:f796:963c with SMTP id hq16-20020a056a2096d000b001acf796963cmr1552398pzc.56.1713952589509; Wed, 24 Apr 2024 02:56:29 -0700 (PDT) Received: from peter-bmc.dhcpserver.bu9bmc.local (2001-b400-e380-6057-c341-626e-0f0b-b82d.emome-ip6.hinet.net. [2001:b400:e380:6057:c341:626e:f0b:b82d]) by smtp.gmail.com with ESMTPSA id b19-20020a056a000a9300b006eae3aac040sm11042932pfl.31.2024.04.24.02.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 02:56:29 -0700 (PDT) From: Peter Yin To: patrick@stwcx.xyz, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean Delvare , Guenter Roeck , Jonathan Corbet , Delphine CC Chiu , Patrick Rudolph , Cosmo Chou , Andre Werner , Bjorn Helgaas , Lukas Wunner , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v1 2/3] dt-bindings: hwmon: Add infineon xdp710 driver bindings Date: Wed, 24 Apr 2024 17:55:58 +0800 Message-Id: <20240424095604.3425857-3-peteryin.openbmc@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> References: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a device tree bindings for xdp710 device Signed-off-by: Peter Yin Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index e07be7bf8395..f982de168c4c 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -134,6 +134,8 @@ properties: - infineon,irps5401 # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor - infineon,tlv493d-a1b6 + # Infineon Hot-swap controller xdp710 + - infineon,xdp710 # Infineon Multi-phase Digital VR Controller xdpe11280 - infineon,xdpe11280 # Infineon Multi-phase Digital VR Controller xdpe12254 From patchwork Wed Apr 24 09:55:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Yin X-Patchwork-Id: 13641675 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 0C251158DD6; Wed, 24 Apr 2024 09:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952601; cv=none; b=tOqLAL+x0BziEXNUFjPSeqveEMsEq/634RB57nWQsOb1HKQwPOVONWG2low4c/dB2qUFyBFSUTRrGY9GPqVItdW6POTs6rmTnpie56U113iQpsakB+zRikIdx7TLVe3HWlKyGeZARRdeAeiFfXk9rXtQYggNfU3gzqz7n566KiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713952601; c=relaxed/simple; bh=YqY//5lBl+yYaGi8/E20oc5trrx5qjW8jCobmFuWfWU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MsmV/c11MV8UCYHwKf4efCFeXmhyZcbqXs2F1kELeCf+mddFdkrTvcYI+4q3w3oTJnVUBZdyeLXnjV2CgEXloQqJDjNUCljaPoxoJnRQGhjJjwSE+tDkMED4Q/NUmeVtb08WCiGFsgll4NL5HxbBHvaDecBaJwZbKVGyKcuoAmc= 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=k2RJyw35; arc=none smtp.client-ip=209.85.210.180 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="k2RJyw35" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6f103b541aeso3652364b3a.3; Wed, 24 Apr 2024 02:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713952599; x=1714557399; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1ioz599OIjAnA21zqxg3x3jvdxgxMKSXGk9djrFguws=; b=k2RJyw35eogAhvG0WDh/1v9NFNh7uA94+5mrnsyvufAKBEVTU4ZYPtQlnbUjXHDFa7 /WxPfT3TMi+pQ56evQubmPVD4Imz9FMi+CcCsNaNHCn3xyoGUDX/jqrJ/B+K8Ajz3gOD NhzG6WZzciuJVcCEEfzvGSyygSnRvJ1++/XDQkYR0/6f2PYHlYg+geTMOFepk7bm5w9B TVpYsRge2yCws2HO7eP849FUozqD9W08CJeRtIVjeEloEzKmfHhXiQNaBaHxfDcgVeJY fJVE4Qx+U0gP3oOMGdPgVq+NgqBcD6ga7ogqej7YupzhaQ7qkm91CMxrKgqy6AtLs4P3 A2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713952599; x=1714557399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ioz599OIjAnA21zqxg3x3jvdxgxMKSXGk9djrFguws=; b=v8V3c1mm4SGDskIKzbW8K2calOw6SZ4RswS08tzHSBQUVctQQJNPLJVIBTsj/jzbk5 BjUrhagwW2Hacv50UA3IlTiikJF6xiJEBopKLrEAYb6SiaN+S4d9BUsgXlVXHPHdyZ1G aCIT7mBkd9R/7mMUJLv8AMRc5MQIHuD9kRSaBupDEDpHz3ltyrD7HuwdYILb/WFsQzWs R/f7eVg0NsCjXNtZZpS3eHv3uX/MNPmRVUHv0sDcOFTZEGMC73XJ/ZAoOtdanciMtDZB syAw1xINv4TOO6cmxalXSBMkypPQiKcFcRwb8vnN3NfaOcAjGxm5wRn5ZybOvGnAz4RW 30zw== X-Forwarded-Encrypted: i=1; AJvYcCVroRMS2gOigQf0NhoKNkx+BP90OILnIfazVlZWGYHBekM0PXHpm1j0rov5oimNiid964fXcQ6H/vUiuc/cUgMiXq07jX2VakSd0PCeF/k5nnEWaSLnmC75aL9zddhpowhAnyi5TkREeDb1Yf6clsgmlqShXjfdYnE7nuiiPzy/hgKWKXGZME/SrlaxY9NMxmu0lTzVPv4rOMM3aGvI1wEk18veapIgWoaCPtYpfpPOdhrPIR+Zlee+nci5 X-Gm-Message-State: AOJu0YzGJ47zp1ZKqPI1ap2KwEUpkSSo9Sf/tpmlCX0nFv8LlGDsa+pA rsaccHenAOdo6Aw+AmghkTGWY+X2R75evaDLYiZ6uP6DLI5r9Owj X-Google-Smtp-Source: AGHT+IFqcZdGhlM5bb2WUFyDPxvKU09dA2xfnEYMM8GJ9dIteNsekJtqKWSAUpk9WriPj/pXAX3ltQ== X-Received: by 2002:a05:6a20:4322:b0:1a9:e2e0:1806 with SMTP id h34-20020a056a20432200b001a9e2e01806mr2208462pzk.43.1713952599382; Wed, 24 Apr 2024 02:56:39 -0700 (PDT) Received: from peter-bmc.dhcpserver.bu9bmc.local (2001-b400-e380-6057-c341-626e-0f0b-b82d.emome-ip6.hinet.net. [2001:b400:e380:6057:c341:626e:f0b:b82d]) by smtp.gmail.com with ESMTPSA id b19-20020a056a000a9300b006eae3aac040sm11042932pfl.31.2024.04.24.02.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 02:56:39 -0700 (PDT) From: Peter Yin To: patrick@stwcx.xyz, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean Delvare , Guenter Roeck , Jonathan Corbet , Delphine CC Chiu , Patrick Rudolph , Cosmo Chou , Andre Werner , Lukas Wunner , Bjorn Helgaas , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [PATCH v1 3/3] Documentation: hwmon: Add infineon xdp710 driver Date: Wed, 24 Apr 2024 17:55:59 +0800 Message-Id: <20240424095604.3425857-4-peteryin.openbmc@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> References: <20240424095604.3425857-1-peteryin.openbmc@gmail.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add document for xdp710 device Signed-off-by: Peter Yin --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/xdp710.rst | 83 ++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 Documentation/hwmon/xdp710.rst diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index 1ca7a4fe1f8f..b2546925fb15 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -250,6 +250,7 @@ Hardware Monitoring Kernel Drivers wm831x wm8350 xgene-hwmon + xdp710 xdpe12284 xdpe152c4 zl6100 diff --git a/Documentation/hwmon/xdp710.rst b/Documentation/hwmon/xdp710.rst new file mode 100644 index 000000000000..083891f27818 --- /dev/null +++ b/Documentation/hwmon/xdp710.rst @@ -0,0 +1,83 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver xdp710 +==================== + +Supported chips: + + * Infineon XDP710 + + Prefix: 'xdp710' + + * Datasheet + + Publicly available at the Infineon website : https://www.infineon.com/dgdl/Infineon-XDP710-001-DataSheet-v01_00-EN.pdf?fileId=8ac78c8c8412f8d301848a5316290b97 + +Author: + + Peter Yin + +Description +----------- + +This driver implements support for Infineon XDP710 Hot-Swap Controller. + +Device compliant with: + +- PMBus rev 1.3 interface. + +Device supports direct and linear format for reading input voltage, +output voltage, output current, input power and temperature. + +The driver exports the following attributes via the 'sysfs' files +for input voltage: + +**in1_input** + +**in1_label** + +**in1_max** + +**in1_max_alarm** + +**in1_min** + +**in1_min_alarm** + +The driver provides the following attributes for output voltage: + +**in2_input** + +**in2_label** + +**in2_alarm** + +The driver provides the following attributes for output current: + +**curr1_input** + +**curr1_label** + +**curr1_alarm** + +**curr1_max** + +The driver provides the following attributes for input power: + +**power1_input** + +**power1_label** + +**power1_alarm** + +The driver provides the following attributes for temperature: + +**temp1_input** + +**temp1_max** + +**temp1_max_alarm** + +**temp1_crit** + +**temp1_crit_alarm**