From patchwork Sat Nov 9 12:44:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 842427 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.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 42968194125; Sat, 9 Nov 2024 12:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156286; cv=none; b=p9SXxHx8uIbdS8QmHq6vXyUU4ksj4juNI2GxFIGCWES94sgABF7JpduUnp95YNy8oQc5xLyNfanliMCZjPnzk67m/27Dz/UNFfg1B5p9oHHFLxQ2TjjExoHuFv7zGZ9BkY51/1vvDgWKvVXdc/P73D8Eggd2rw+zYNCWoVNaR08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156286; c=relaxed/simple; bh=XDi/izkEsxpjIBfFcCl4FataBQfKvJR8pQmYDtefj8s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tX3ZMB657C73xoWMnxKDgSR+tCZCR+qvAaQ6SY4madGxnN3sdJjtAF7c/ZT9q+opYBmZiO1kgJSbG6rKSiNDYoFrhJeTTmqrno5X68YGkO8cApqY6FEj+uRuJ9U2ljbMOFcXfvG1nMnDDUboSgZ8i6wPS69SGifWyH/OJCBw2Qw= 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=mE7NFZv6; arc=none smtp.client-ip=209.85.208.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="mE7NFZv6" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5ceccffadfdso4080285a12.2; Sat, 09 Nov 2024 04:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731156283; x=1731761083; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yMBRjHQI74d5Z99eEqTTVCC+GvOlvQ6t8L8FeqMEQRI=; b=mE7NFZv6bZWgNBpVidSiJZN4lPK4DPHbEHHjFmZUF20LptVARrZGmbT8yr34/ro5+Q pGIEiqe8H4aXNOYAAM8OBYyQZe66Vkc+76Wp+AJzx9nlz6d/xWqYtypvVa8NYrWv8A/u hQ3CMO/7eXINQyZWsSoO53B4nA7xGHWUPsRjo/98g3CNV5nCRFcYJPK1m7YVpDv8k2Zo wvskD7xOyAkRBZXEyEvCsgras5ViReRcKuijIsvzS9YdK6l73lwdX3RRR8pZxB6owTY9 TMfy/OAztZ0Nq7oe1mRB8cSIMIoFiVBf2vBtGX5ZCoBAuZn0kHqbBFD8hh7cWCgyljJz ly3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731156283; x=1731761083; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yMBRjHQI74d5Z99eEqTTVCC+GvOlvQ6t8L8FeqMEQRI=; b=wU1hhR7098tYo2azudaCoP+o4FeoB33osMyjRjEqyDLuf/x/70cmAU7jUYy/flk3hW Pn01a0j0813lf6v4CYwWSSTcxXe8d0jeHJjtbkuVCeRntky52T5SbOgoseSf4ZRvnEzu 6HjwOZt5JqnF6I94uEJx8hVyOs39APm8avCJtacnRMbDW/TgbDeWOnFmuPVP01pbVsy5 DseAW4QR+/1uMq7hOpY0FYywfvlly8Suz8DZBgFWan37eBId1yQSltquvBa7lZtGdBE6 vGdMfFMDRAxTpE6GkhxeIBnQWaok1sHC+dB9P+4lsmKCRsxgX16HRluKKIpqcfFlF7HK Tgqw== X-Forwarded-Encrypted: i=1; AJvYcCVY5BeYabCH8eANls7y7v5ICVR3Lv9RZoKaQHYvTn8D4ltyWJ3O5jxExpcvbt471N/b6xUYa7erznJ2Oyse8E0kkLU=@vger.kernel.org, AJvYcCW+1jpcW00089KmBDznb5b53E9Z+6NAV2gAG/Pcl18oHOYpJLovFKqMZWuu2y9jin2jo9UUiJaRnshIUmjK@vger.kernel.org, AJvYcCXB7vwEnvGef9D6VV608ViPBl7QTQFR1aoNHgTlnkRdWPCTpNCSbWBNxu8ck3uYwl/VGg6scU2ZsCSy@vger.kernel.org, AJvYcCXkmzSSVbQzjrY3flTnl9BlEUoKF4zYIg4Dp1LWu3w/G7PNUcJd/HSUWBKL6OSKaDjD5wOZdTC3aICW6/Td3g==@vger.kernel.org X-Gm-Message-State: AOJu0YwQrDRmnvveGLDayHFiiDtNkwS2pHHTAVu8Jw1MkioSOzrI2JgY GxY5K9aHoJHQB5GChmWideXILDGWn+x1Pb002F93NTCQEZP1R15DkhVCV+bf X-Google-Smtp-Source: AGHT+IGHmXkaxvNLQkweBLdDmIhicVaPliDsIzJWNuOAzUgBi/pEgCPcvtCC2kM/nBeKCrbNxy/bFw== X-Received: by 2002:a05:6402:4405:b0:5ca:da2:b2ca with SMTP id 4fb4d7f45d1cf-5cf0a32477cmr4494536a12.19.1731156283115; Sat, 09 Nov 2024 04:44:43 -0800 (PST) Received: from [127.0.1.1] (leased-line-46-53-189-50.telecom.by. [46.53.189.50]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03b5d793sm2940166a12.17.2024.11.09.04.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2024 04:44:42 -0800 (PST) From: Dzmitry Sankouski Date: Sat, 09 Nov 2024 15:44:33 +0300 Subject: [PATCH 1/4] dt-bindings: power: supply: max17042: add share-irq node Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241109-b4-max17042-v1-1-9e2b07e54e76@gmail.com> References: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> In-Reply-To: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> To: Hans de Goede , Krzysztof Kozlowski , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Sebastian Reichel , Rob Herring , Conor Dooley , Alim Akhtar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Bjorn Andersson , Konrad Dybcio Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731156277; l=1112; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=XDi/izkEsxpjIBfFcCl4FataBQfKvJR8pQmYDtefj8s=; b=S2oWIinV5ResTYdNod6KQGakhY3n2n115RbBezpr5fVJmGmnKyaCmXd8jZrZ+MQSaky4qbucC JOnSGVPtY/GD5N10XFrNG4mOf2wnORx+aMouPtcZM9TebziThuOZ1ge X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= If specified, driver should request irq as shared. Signed-off-by: Dzmitry Sankouski --- Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml index 085e2504d0dc..e98ffdad1ec3 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml @@ -59,6 +59,11 @@ properties: Voltage threshold to report battery as over voltage (in mV). Default is not to report over-voltage events. + shared-irq: + description: | + Request interrupt as shared. + Set in case of other devices using same interrupt pin. + power-supplies: true required: @@ -79,5 +84,6 @@ examples: maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; maxim,over-volt = <4300>; + shared-irq; }; }; From patchwork Sat Nov 9 12:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 842295 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.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 28EEF198822; Sat, 9 Nov 2024 12:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156289; cv=none; b=bM3IEUfro+8nyuYExgHwgCOkg0AE4ZfKNHRiaMBJzYwMZdtUS+hj8oJQgdwyUQolWWqE1D75phxSmFb7IRS15Tw1XFWGaF54GSm2mY3K2I+fwe1+twA1CLBIXY0FjwGs6DRoWgASmmQO4tWLAZp1tLxrfIyrMXnjtNTbxDDYyCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156289; c=relaxed/simple; bh=mseh9WRqz5C4m+dJG3gKVqO4w2mq1wg/wZdf/mAK3Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hG9C6OG39iMEqiFXlDWQ8ZX47dlutHAj2uhe6A54YotqlYU66loeVOhrp5+1XqGpFVzepRLlHjmK3/FN0HPjhLA6L1inG4K8bL/cFhM7QbzgDvwiaif0HDS52tGoOVBSlIgvprRrVJHNUq6hlw9EcW9NtGMPAeR/3MoZV3nOaGM= 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=U2KXXQ3m; arc=none smtp.client-ip=209.85.218.41 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="U2KXXQ3m" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a9ed49ec0f1so522813566b.1; Sat, 09 Nov 2024 04:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731156286; x=1731761086; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6NYjmB31gxcjk36kydLhN1LaoAFU9bSgURFqpBpxQVM=; b=U2KXXQ3mZ8B2bHY76oVjLFsJvZ1VH53RuxisGu8rMCfmkTqV2XC4qhdqksEgGbrcHK mXnQYPBIyWd8G6v+eeeGK/vdcq+rqKb7bHLEgUGJU8rZo9VEnV1izu3f5000tbPAAoI1 i2/MAeXK11xYcC4fAQhudzApVcMDD0d4QbuPUENsZ87gARjgZklMKgh4Cs59MokT6BQT nqBP7PFVkJEqbSugk5LUg1vi6RTmX7LXrqcov9smWC0Ks+d93etnFbu31cWXYQPm7d+Q aT5wMcg0FwvFicpILr8IRVWeHzmNxen6TdUNL+a1ULiApl0W33xrQjNpEycrET51bi1a iVsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731156286; x=1731761086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6NYjmB31gxcjk36kydLhN1LaoAFU9bSgURFqpBpxQVM=; b=T3Q3IWXlYhtZk4u6MBQp0x5ObDWxMhbGw8mbV2405p027ezSc2VhDdKdtCQj13q3I3 HdgFKinqy5Cl+iZYeFabFH4UO5uaWOXMBkMlhTHJM/JYcb+USIEfu/rmT/mVaSilHf18 bnWgRPTe58mgkC7zBF346e/1fjzeWrwqMeJEaqVVxzbJ4KaYfoxGSSghTA6RFklnoXya imeomM+d3L8k7NujpftzvsGfngJ2iExLz/EEFYQoPjeUcVQEcDIH/bbRR1ccxUDI60lL 28G+uIX92i3jjaa2eDGfsFotTKQ7gcRJGcS+pi8VVP3MfI+ZbVV4ZGi63/FWQDYPU8m/ xMig== X-Forwarded-Encrypted: i=1; AJvYcCU+QsPjVV9KYDP2EFDf5j0u+04HBfg7GczK5t6n44wwTHdHG/sZW+Xbb3Rs1nJ3pqdW+9x4/VHHCVlA@vger.kernel.org, AJvYcCU8Zk36m1wFU2kVGDKU5h71j4hUd9B/XLsNBCAjvi2xIDVLSrx6f0Udo+5pANEfjBsZX4ebcHtDY7TXKeGOPqlZKak=@vger.kernel.org, AJvYcCVwMeUKWQiFJme71Vv8dZpOvb0wIICbqic/HNZFl2mGUy9uXZgw6HCpPNVDkBnNhCZQeHnfe6/iMnq0tpDO@vger.kernel.org, AJvYcCX0Io8V2qfhUiqjDOohRY8IHlDffVEP8Y0xMyjw87DgtWAmSOoo4Q3nP3bR9CLzQOveodoeTdPR/6klYQstoA==@vger.kernel.org X-Gm-Message-State: AOJu0YzN76wyNhTw/o1OxJeNS/m/rIRF+KPR9dP3WuJtntVcp4PJ7tKs LND5+LZPhHF3+qeO4jgnPGADsoMVC5inipRgtVaZbTsk6f+6gJ4Sp84NPP+h X-Google-Smtp-Source: AGHT+IHmuYr9plCibE5R6SWQvYCuz+uxGfvZMDTXTYfiyiiZ0cPupHyPtkL4o3yovyQ65WSVh8GayA== X-Received: by 2002:a17:907:7d8e:b0:a99:f183:ea8a with SMTP id a640c23a62f3a-a9eeff40bb9mr643164866b.28.1731156286012; Sat, 09 Nov 2024 04:44:46 -0800 (PST) Received: from [127.0.1.1] (leased-line-46-53-189-50.telecom.by. [46.53.189.50]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03b5d793sm2940166a12.17.2024.11.09.04.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2024 04:44:45 -0800 (PST) From: Dzmitry Sankouski Date: Sat, 09 Nov 2024 15:44:34 +0300 Subject: [PATCH 2/4] power: supply: max17042: implement dts shared-irq Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241109-b4-max17042-v1-2-9e2b07e54e76@gmail.com> References: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> In-Reply-To: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> To: Hans de Goede , Krzysztof Kozlowski , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Sebastian Reichel , Rob Herring , Conor Dooley , Alim Akhtar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Bjorn Andersson , Konrad Dybcio Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731156277; l=1696; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=mseh9WRqz5C4m+dJG3gKVqO4w2mq1wg/wZdf/mAK3Mc=; b=p6RG8L2ppMseJHrGFGFXqKD0cvO/hmr64avCyPTMrXOmpbKJvR/L7yqOw+I7HkKgDykpfAaQc K5rjsIUntQwDRGn+xKnFPr/5z2IEZy24Orl7n7sVxJn+1/jtzpqtQCh X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= If shared-irq specified in device tree, request irq as shared. Signed-off-by: Dzmitry Sankouski --- drivers/power/supply/max17042_battery.c | 3 ++- include/linux/power/max17042_battery.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index 496c3e1f2ee6..f3d89d4d5c42 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -933,6 +933,7 @@ max17042_get_of_pdata(struct max17042_chip *chip) pdata->vmin = INT_MIN; if (of_property_read_s32(np, "maxim,over-volt", &pdata->vmax)) pdata->vmax = INT_MAX; + pdata->is_irq_shared = of_property_read_bool(np, "shared-irq"); return pdata; } @@ -1109,7 +1110,7 @@ static int max17042_probe(struct i2c_client *client) * On ACPI systems the IRQ may be handled by ACPI-event code, * so we need to share (if the ACPI code is willing to share). */ - if (acpi_id) + if (acpi_id || chip->pdata->is_irq_shared) flags |= IRQF_SHARED | IRQF_PROBE_SHARED; ret = devm_request_threaded_irq(&client->dev, client->irq, diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h index c417abd2ab70..1261dbaa5e8f 100644 --- a/include/linux/power/max17042_battery.h +++ b/include/linux/power/max17042_battery.h @@ -250,6 +250,7 @@ struct max17042_platform_data { int num_init_data; /* Number of enties in init_data array */ bool enable_current_sense; bool enable_por_init; /* Use POR init from Maxim appnote */ + bool is_irq_shared; /* * R_sns in micro-ohms. From patchwork Sat Nov 9 12:44:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 842426 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 F27781990CD; Sat, 9 Nov 2024 12:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156292; cv=none; b=Kz5zX9IQW7zZKe1zoqOGMjLWG3KFxwXnopl/J/9b+cP5ly8gM4nGD3NXw+VZmS1TCncguEmA62MVNnidhr/mIafze9/OWh60BdmW8K+LA5vLoRx4z1c5JNOicIerb17SPDe+tEYUPhVO02+7zN/8y0bQjUpJ+O9N/lsGWB3WPDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156292; c=relaxed/simple; bh=oX98cqsu9ezhoyh3zMCsqzngVH4022JCLrceQnb5H7w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CfjGAMcYQTipO+RwASIv4MpU/zberdwCHIpmScMoFPDYhCJynHV5+1KU+pK9gBfZ+7iHNJrrNbVbPqppOHj6qgWH0y+OfM/ynRRkiTU9Yj1ZyXLW/MybpkLZMVHbcyjL0lBpZTuWbCPhk25cmptQE/8y9Kndu81I3IFhnwA7dqI= 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=AyTggn1g; arc=none smtp.client-ip=209.85.208.48 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="AyTggn1g" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5cec93719ccso4002188a12.2; Sat, 09 Nov 2024 04:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731156289; x=1731761089; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CQ9NSVxNmU2bLIFXUwQFB7anXf5+cHYcjGaMIkMwGmQ=; b=AyTggn1gooi1Nn6hv4jgWcz7rKRm96xrI1LmhYUVNc6YKgXMR9refCvXO1kxRHNNB5 qRA0peLRq6FPeqqVSFGGxGOHtUOltO4oLZcAmrkmUJAxQMJuct65dTzISjzRbJ+1J5qb o9zDr8xTxRyvXfghSdpqv1d/iV1Ch8wTvm1a+qinsCI5P2GbpPc4X45t+goCjqMgrLmX wSliSXwPbgPZ8DQDyHW4gKbA0GRbPGwf8detZaxkZgTKiPIsqMYpaNZSrJR+iIeC+BOy 8XpuOQvjKV0nqrsnQfLL+u1JJ1Ashhzw7bQ2+wM0NYJEHgrPQZCY/ARH63Xaz1Hxv3ph Q+Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731156289; x=1731761089; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CQ9NSVxNmU2bLIFXUwQFB7anXf5+cHYcjGaMIkMwGmQ=; b=L+XzmlU00SbMg+R0AvpjgWT+X1SccCZHqESgjmy1W+5lTw/V36EwMPHW1o4C9EqSCT Xq4JaiVQGDDPi/y/hF+yCr2LhAJu6rJy5/ifEDYH0F4wQEl5DSaszxAo+TlMpaQz6fxh 9XVE8k19PxpTuYYDe7kA1Jy+XxS5ljhaOpFzQ6yStK088ARDvxvB2Lo6CixldisIg0jO Ic/bD7dkIErizR+FP720cBiEthJkWqN5iCnAo3y6FlQP6cm7G7Isr8aOfEBopJby8n7v rvU/0WVreIMbiVYI7rQC8VfzTQsjG8WCOxA02BIAjK1QchVjJTa3+9aMygyxrRqXHL+8 u7Qg== X-Forwarded-Encrypted: i=1; AJvYcCUqtfn9ALTHRgVY2jBurx+3ESsZmeSj2KlYUScg+LnU1oT/2mN/+F+OiTYLIvPdo/bAQGodYzhBgyyYFbLQGmVMNSk=@vger.kernel.org, AJvYcCWfBt9C5xLDHKKIaP8A5kSKUKdEORp1NQ7/l93qMpPZL2FiBCADeeXhFcXA/ixa3ziIejDmVo/IBcTU@vger.kernel.org, AJvYcCWqPR64MfaBmwTyqNERE8C2yoP6UsvLciCvxVgK8COd0BxDPh9IkaA48/sLiVvA/ldI9c/R7iMj1wu6t7ORug==@vger.kernel.org, AJvYcCXxKhy665MFCoI4souNsAJyE/uuC9rGoovXe5h+HW1du3qJ+h06QMeJUuKOhtdlp2EqZc/FEyL0XkDNcDG6@vger.kernel.org X-Gm-Message-State: AOJu0YyO6lf/aWgPGMgD1Ib8H/buWdkJXikx2Aeq2JmvMsRo3SHm5RWf GQP971WJRt79wkpbW5JyIfUoBh1M7S8RERZwtCSAzHtMybqXEm34uUcj2Mqi X-Google-Smtp-Source: AGHT+IEava32G9LkepDqhNF98BHoT2kEpMj/WzLFM5B1x5SUXXliyjsQMEGMpaCuJJcC1rJTYXaoqA== X-Received: by 2002:a05:6402:d0d:b0:5c2:439d:90d4 with SMTP id 4fb4d7f45d1cf-5cf0a45f22bmr4810410a12.30.1731156288669; Sat, 09 Nov 2024 04:44:48 -0800 (PST) Received: from [127.0.1.1] (leased-line-46-53-189-50.telecom.by. [46.53.189.50]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03b5d793sm2940166a12.17.2024.11.09.04.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2024 04:44:47 -0800 (PST) From: Dzmitry Sankouski Date: Sat, 09 Nov 2024 15:44:35 +0300 Subject: [PATCH 3/4] power: supply: max17042: use microvolts for voltage comparison Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241109-b4-max17042-v1-3-9e2b07e54e76@gmail.com> References: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> In-Reply-To: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> To: Hans de Goede , Krzysztof Kozlowski , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Sebastian Reichel , Rob Herring , Conor Dooley , Alim Akhtar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Bjorn Andersson , Konrad Dybcio Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731156277; l=7169; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=oX98cqsu9ezhoyh3zMCsqzngVH4022JCLrceQnb5H7w=; b=fSAus6hdbJoEivY1qvsqsA9L4OfkV3c0pEcQviAyQ4PUq6GytjxonoqhMMGpCSqQMVG158a0S DYpghObEXyZBGANGKXeOJNanilreWXaqeQaSScPgTm2cV2w089dJsIP X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Do not convert VCELL register value from uV to mV to compare with vmin/vmax. Rather use uV for vim/vmax, since that's a standard measure unit in power supply drivers. Convert "maxim,dead-volt" and "maxim,over-volt" to uV. Signed-off-by: Dzmitry Sankouski --- Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 2 +- arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 2 +- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 2 +- arch/arm/boot/dts/samsung/exynos4412-midas.dtsi | 2 +- arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts | 4 ++-- arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts | 4 ++-- arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts | 4 ++-- arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 2 +- drivers/power/supply/max17042_battery.c | 4 ---- 11 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml index e98ffdad1ec3..d1ad597e0837 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml @@ -83,7 +83,7 @@ examples: reg = <0x36>; maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; - maxim,over-volt = <4300>; + maxim,over-volt = <4300000>; shared-irq; }; }; diff --git a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts index 0d8495792a70..0ca755160bef 100644 --- a/arch/arm/boot/dts/samsung/exynos4210-i9100.dts +++ b/arch/arm/boot/dts/samsung/exynos4210-i9100.dts @@ -150,7 +150,7 @@ battery@36 { reg = <0x36>; maxim,over-heat-temp = <700>; - maxim,over-volt = <4500>; + maxim,over-volt = <4500000>; }; }; diff --git a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi index 9bc05961577d..758bfc10826f 100644 --- a/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi @@ -186,7 +186,7 @@ fuel-gauge@36 { pinctrl-0 = <&max77693_fuel_irq>; maxim,over-heat-temp = <500>; - maxim,over-volt = <4500>; + maxim,over-volt = <450000>; }; }; diff --git a/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi b/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi index 3d5aace668dc..c744907b7c42 100644 --- a/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4412-midas.dtsi @@ -263,7 +263,7 @@ fuel-gauge@36 { reg = <0x36>; maxim,over-heat-temp = <700>; - maxim,over-volt = <4500>; + maxim,over-volt = <4500000>; }; }; diff --git a/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi b/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi index 28a605802733..3d52aa25c83c 100644 --- a/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi @@ -175,7 +175,7 @@ fuel-gauge@36 { interrupts = <3 IRQ_TYPE_LEVEL_LOW>; maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; - maxim,over-volt = <4300>; + maxim,over-volt = <4300000>; }; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi index 1b39514d5c12..90beefaa644f 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi @@ -1141,7 +1141,7 @@ bat: fuel-gauge@36 { pinctrl-0 = <&pinctrl_gauge>; power-supplies = <&bq25895>; maxim,over-heat-temp = <700>; - maxim,over-volt = <4500>; + maxim,over-volt = <4500000>; maxim,rsns-microohm = <5000>; }; diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts index 8380451ebbf6..a02ece82ff5b 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts @@ -25,8 +25,8 @@ battery@36 { maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; - maxim,dead-volt = <3200>; - maxim,over-volt = <4500>; + maxim,dead-volt = <3200000>; + maxim,over-volt = <4500000>; }; /* charger@6b */ diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts index ec5589fc69bd..f567b7ffb613 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts @@ -36,8 +36,8 @@ battery@36 { maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; - maxim,dead-volt = <3200>; - maxim,over-volt = <4500>; + maxim,dead-volt = <3200000>; + maxim,over-volt = <4500000>; }; }; diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts index eecf78ba45bb..45ddd17243e7 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts @@ -25,8 +25,8 @@ battery@36 { maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; - maxim,dead-volt = <3200>; - maxim,over-volt = <4500>; + maxim,dead-volt = <3200000>; + maxim,over-volt = <4500000>; }; }; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi index fbd2caf405d5..2c387c8b6344 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi @@ -105,7 +105,7 @@ fuelgauge@36 { maxim,rsns-microohm = <10000>; maxim,over-heat-temp = <600>; - maxim,over-volt = <4400>; + maxim,over-volt = <4400000>; interrupt-parent = <&tlmm>; interrupts = <121 IRQ_TYPE_EDGE_FALLING>; diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index f3d89d4d5c42..ea212cb10360 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -182,8 +182,6 @@ static int max17042_get_battery_health(struct max17042_chip *chip, int *health) /* bits [0-3] unused */ vavg = val * 625 / 8; - /* Convert to millivolts */ - vavg /= 1000; ret = regmap_read(chip->regmap, MAX17042_VCELL, &val); if (ret < 0) @@ -191,8 +189,6 @@ static int max17042_get_battery_health(struct max17042_chip *chip, int *health) /* bits [0-3] unused */ vbatt = val * 625 / 8; - /* Convert to millivolts */ - vbatt /= 1000; if (vavg < chip->pdata->vmin) { *health = POWER_SUPPLY_HEALTH_DEAD; From patchwork Sat Nov 9 12:44:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 842294 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 AD734199248; Sat, 9 Nov 2024 12:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156295; cv=none; b=jr6EklTBVS87VAwwHg1Ph2sxdEEfWlLjZ/qbUXbwdZPkbcdqA93GWLgxk4BC1VnzjRDqtTcJypOw5cmt0mTi4U6ZV/ADPlclFTEdHq78PJKBI8n3vXYXIKfs0N0ZMCgixOwuxua8IL29WFZoPfFm4qd50XO5+8BLAkXUCF8zCeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156295; c=relaxed/simple; bh=Ll3+VdQ0C3YJ+cNuw/9xWFDuApiijksTxgD0D7LqbW4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Lgk1VrbakRBVWzitU5vjArRJ1LxKjAXTS5Fh8BXgjZrmwu/97YOQYSSvWUA4ybYbyIOs82GNug7syvAJCM9713fe7FyeX3K6TTvi2U+LWvfTH9Q2ImFBw+REoMBJwCTQMaYYdJUg81RJCSA5mfsNeIVgOxQq+1HpgSNgQG+5YAI= 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=LdpH/MY6; arc=none smtp.client-ip=209.85.208.45 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="LdpH/MY6" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5cedea84d77so4139348a12.1; Sat, 09 Nov 2024 04:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731156292; x=1731761092; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=59tEYZAbxZv4QLtXinFrkb5WBvn6BEbQem6S6TXlOJw=; b=LdpH/MY6EfsG950NmF0hi57ZAyHpmufR6hfiQJmyIiuxf8FUpsp6IuTrR3zQp5xqUb Yda9q0g38/R6R1kwok+mW/H08C0G1yY2mbYITiLU6Tb6NDmDl/y0VY4vwkIoR6O0hRcp L2qYQvlBJqGkPN1/6ZThxdD/M4mtEIZXVruUO9v5/EhJh0xsFtz0PYyoAkYFwPQl+UCl j6u/mYKreBPdilU7BV0t8pCrkXrQxAqOyMQcBWnJqV0lMgOfGhT7EbNd6iixf2bJefqk 9MS8Ww0l76Dqjkvxy1HqM4xcD1d7Gya6XfE8u90xKgyEbX1cCWqEctN9kYWAbr6WPMP/ qkgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731156292; x=1731761092; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=59tEYZAbxZv4QLtXinFrkb5WBvn6BEbQem6S6TXlOJw=; b=mKWeV8XNJ8yJrC6aovdOePt88yJScTf+J6ZKRA2EZVHRpwzuYEto3zDSk3Bg4A8qhx nM4wgwXFfifQxMPRsIZMebGz58oqjcOlZ+4t7pvdubF5f8nsYk165gqDCJlRxsFke7zC lX5ANClCRn1drHYB5TK8Cu7KRHgysiUTN8Bn0Tdf6+kkxW4BZ5/SGQwnmvZE6o4YV7Fx H25Os7WOPguDMFIymeVZzSPOjzbEaFSxk3ni5AyLjk8Olhglk6c4PWqABfb3zJN5EB99 mNET8oouMJ/kkrO0bCe7K/PF+Z//GInwv5PWHUrAxjJHC4HbW9MR4tmhxHP9/13Ebs39 Ex9Q== X-Forwarded-Encrypted: i=1; AJvYcCUO+6HZpak2ytMHct2OnIFiYTQIm0TmMI428DK8oq/vcyaTt7Sfj4nNGpiw3KqeIS4lJCNrjP6qwMb+2yav@vger.kernel.org, AJvYcCVB8k9RPIbx+kp3jvhC4sUqHHIuELHSo6yx4SyqkcMixHOs5+iFWd5n1TBErEILmWKG55umx0qAWOhL@vger.kernel.org, AJvYcCX9bwzf1uxkg0OeNwRCZB47aG/RXBzGB2ikBaMpFd2SD9zXY5uWtcGXe70YlvxiSScuSB+qDyYlSv4GDCAJzg==@vger.kernel.org, AJvYcCXMR6YO0b/NVaHF1xIX5DXKhjZTaMbLwBw/Xct+On8rjGLCXNC3dcFEyX6gkbqovJltxpkYRaTcdb3T0UQrDF8zq0U=@vger.kernel.org X-Gm-Message-State: AOJu0YyJQs3rVm/zme0HR371aAqePvC4+q/6iNADKy5dic0YqWLLI6f/ APuxreoAZPwEX/4R2A2VAmsD+ZLxAo+gJQtvtX07zqccpbi26I3jRXjZ3Wxt X-Google-Smtp-Source: AGHT+IHsmH3XqpW0E30HnDtDXqrPkaKiznFfyNU3gMMTiByURLm3AmURnfa20tdQ+1DxMfZF6+oL9w== X-Received: by 2002:a05:6402:3507:b0:5ce:d6b0:85c0 with SMTP id 4fb4d7f45d1cf-5cf0a444283mr4838208a12.22.1731156291637; Sat, 09 Nov 2024 04:44:51 -0800 (PST) Received: from [127.0.1.1] (leased-line-46-53-189-50.telecom.by. [46.53.189.50]) by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03b5d793sm2940166a12.17.2024.11.09.04.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2024 04:44:50 -0800 (PST) From: Dzmitry Sankouski Date: Sat, 09 Nov 2024 15:44:36 +0300 Subject: [PATCH 4/4] power: supply: max17042: rename maxim,rsns-microohm property Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241109-b4-max17042-v1-4-9e2b07e54e76@gmail.com> References: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> In-Reply-To: <20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com> To: Hans de Goede , Krzysztof Kozlowski , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Sebastian Reichel , Rob Herring , Conor Dooley , Alim Akhtar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Bjorn Andersson , Konrad Dybcio Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731156277; l=6311; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=Ll3+VdQ0C3YJ+cNuw/9xWFDuApiijksTxgD0D7LqbW4=; b=CgxjsX+bAIDHBkOI0SqP8ZHxW2061yieieg6R6BPSGwA0wkM6muqq3JM+UwOpuN8nMBZE8qH+ JYXQoELs5oIAJUPqdLaPEzqqmnhBaJeJjCaLjK07S7pPTZRU6D1PucY X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Rename maxim,rsns-microohm to common shunt-resistor-micro-ohms. Signed-off-by: Dzmitry Sankouski --- Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 5 ++--- arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts | 2 +- arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts | 2 +- arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts | 2 +- arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts | 2 +- arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 2 +- drivers/power/supply/max17042_battery.c | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml index d1ad597e0837..754d9ad3d94b 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml @@ -29,8 +29,7 @@ properties: description: | The ALRT pin, an open-drain interrupt. - maxim,rsns-microohm: - $ref: /schemas/types.yaml#/definitions/uint32 + shunt-resistor-micro-ohms: description: | Resistance of rsns resistor in micro Ohms (datasheet-recommended value is 10000). Defining this property enables current-sense functionality. @@ -81,7 +80,7 @@ examples: battery@36 { compatible = "maxim,max17042"; reg = <0x36>; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,over-volt = <4300000>; shared-irq; diff --git a/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi b/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi index 3d52aa25c83c..0b08d23366d6 100644 --- a/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi +++ b/arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi @@ -173,7 +173,7 @@ fuel-gauge@36 { pinctrl-names = "default"; interrupt-parent = <&gpx2>; interrupts = <3 IRQ_TYPE_LEVEL_LOW>; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,over-volt = <4300000>; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts index 33f398b48119..99023f302a05 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts @@ -11,7 +11,7 @@ / { }; &bat { - maxim,rsns-microohm = <1667>; + shunt-resistor-micro-ohms = <1667>; }; &led_backlight { diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi index 90beefaa644f..6f6ce14afbdc 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi @@ -1142,7 +1142,7 @@ bat: fuel-gauge@36 { power-supplies = <&bq25895>; maxim,over-heat-temp = <700>; maxim,over-volt = <4500000>; - maxim,rsns-microohm = <5000>; + shunt-resistor-micro-ohms = <5000>; }; bq25895: charger@6a { diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts index a02ece82ff5b..f5d636db33c8 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts @@ -22,7 +22,7 @@ battery@36 { pinctrl-0 = <&battery_alert_default>; pinctrl-names = "default"; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; maxim,dead-volt = <3200000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts index f567b7ffb613..35343b1fd737 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts @@ -33,7 +33,7 @@ battery@36 { pinctrl-0 = <&battery_alert_default>; pinctrl-names = "default"; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; maxim,dead-volt = <3200000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts index 45ddd17243e7..855f8a554a9b 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts @@ -22,7 +22,7 @@ battery@36 { pinctrl-0 = <&battery_alert_default>; pinctrl-names = "default"; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,cold-temp = <(-200)>; maxim,dead-volt = <3200000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi index 2c387c8b6344..0ab64154dc77 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi @@ -103,7 +103,7 @@ fuelgauge@36 { compatible = "maxim,max77849-battery"; reg = <0x36>; - maxim,rsns-microohm = <10000>; + shunt-resistor-micro-ohms = <10000>; maxim,over-heat-temp = <600>; maxim,over-volt = <4400000>; diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index ea212cb10360..497cb6f14bd9 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -916,7 +916,7 @@ max17042_get_of_pdata(struct max17042_chip *chip) * Require current sense resistor value to be specified for * current-sense functionality to be enabled at all. */ - if (of_property_read_u32(np, "maxim,rsns-microohm", &prop) == 0) { + if (of_property_read_u32(np, "shunt-resistor-micro-ohms", &prop) == 0) { pdata->r_sns = prop; pdata->enable_current_sense = true; }