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: 13869586 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.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 2535A1940A2 for ; Sat, 9 Nov 2024 12:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156286; cv=none; b=azkqv/0GebsP9UtlYloz8nDED6Yro2zEo55xqyr5s0qVOqeii6WT8pYF9WXO0XB6UwtZiPBNWJXqIhmArwpK2Y5ReJKbC0rInptxLmZS4ai1pWIbFg6vN1Kym2yNF43sdI6//tGWXSfDzwCcDl+8YF+HJwbGk1S7Xd77LRTOI3k= 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=csydSRzL; arc=none smtp.client-ip=209.85.208.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="csydSRzL" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5c948c41edeso4067817a12.1 for ; Sat, 09 Nov 2024 04:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731156283; x=1731761083; darn=lists.linux.dev; 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=csydSRzLrpCEQ+SpMIzLVDwl1UE+XwCJLkjAIa0xWbLSUlRHf4PTWlOhgHC0zWzkfF 5ztoowPDUJqGcvjhAGpLACHO7m22HbMK7sXZhe8YSozrMBpWp7T5Qy+hR3loOQHYR4MT K8ccsRhxAtSAstBz5Z9oCGZCMagio81p+cFdNI6rFO46/KQNz/4+RtkhplQFRDJyR7qI lFDtW2vQnANJWiqEKZfqr8ovWa7JPwcLl9FdowEnW0SPup5V7qT66yXkDdp9BCatkTWO aIu5s3caPgl2Hg25rsuBmICNV8BB0smeSyjQI6dHJyWNYt50x/3G2nhhNKA5Vv2/6L32 AmKA== 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=ApjXpn2yTMGy2C9dhx7VM/wbknP4FHTGGgx601Xre+tu3+5FGhJFyLXk8i/bNwL5b9 01w0NvsfdD5/FsZX3TwxVuJWT/SeGA4XlrpCG3W4fMkHOyKEwQ05bWpfU7RKZgJ1a40s mWotrB4QQaZbEVoi+HSgvNZwtOVY1QZ/BAxb3x27AWUdje0SOgUPeI3c4xwTvDPXk/lF OWrN6jlxyqDxs2i34LZ6ozEKrhetlT7Z5Yaqsy2ujPxC2RSam/GrmZDThTT6JUMkLZmQ LtGYNjixvygM+Xfy8+OkY7i+iz57rF5nhQoh2k1Ai8GarfQIEkqm1qIJiCLVsQGU//E5 /ulw== X-Forwarded-Encrypted: i=1; AJvYcCU2jpZ22i67cKczmrYBk3Lw98V5xCRttUGDETFtExrZIwcQFh9b3MeMXUG5OgqI0SUX3uk=@lists.linux.dev X-Gm-Message-State: AOJu0YzVV3fZt5uKStNLNd6QgLpP/bY1k3OzbU6c6pTWScF+fi4tIvAb 17ZMv3yEfxjd7fSbeSuogmU+yFh2OTSovqW11cJ2n0cD2vOSYj1c 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: imx@lists.linux.dev 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: 13869587 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 D43B2197A92 for ; Sat, 9 Nov 2024 12:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156289; cv=none; b=kLfNHmNlh5N9UtX7RwCTmN+N/De69kHD1zRlVyfC11esa0/dgzYj+ok1bAndt2SP+wbU52dLGmmKGTlUKm1qrYKHfXCPnLZMlfsPYbGXZWI3nCNwBvBYUdQELOzVwDgi9iInK2S0+gfuab1fWA0lYl4xBi7eTml1LLgd32ybzH8= 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=gSndkIUQ; arc=none smtp.client-ip=209.85.218.47 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="gSndkIUQ" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a99f646ff1bso449487566b.2 for ; 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=lists.linux.dev; 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=gSndkIUQQ6ybvSdfezIMBZQagkk/ZFkIrN07yAPSs4ekiyj2bOcuSVGhtVL8pkoB31 rvFqOe94E3Tb+mm1n2uWVx6ato4o1A/T9Y2L4Elavfy/L21TeMFxOnikhA9wUk/UVA03 jqYz8NiA092pSIjBKfEJf4CGH/DXVYtotQC3eQdI8HxrsllvCJm+zQlR49I/MaDFPjrs RlvI3ggyXUKwnJGbzmQrkpcSGR8hwerBKOz+fzMY1GLpSnG6+ow213+N4o1YCnHpYUMe ZhP2euDArl41JWqipAVWxUfZgGeFs3QB0Jcl8+nxbRF7Ne1L02SNnSQF5IfrPZSSljHD oahw== 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=GYaEbPYZ/hsakf3WGJhpm8z2/WIn44WC24LaoIks+/eJFPSYUXdXIsX9ZYDIu27Edb OFA6oILviu6wiDnP/MUP1F6Jm2TxJa2ft3NcElLIJjjXOokfKmpdJHjBzWy9EASN5AqU aeiaXB3VS0WvbVO49+59ceKTxXa7G6OnRUdp8QQHTQXh/oMpu7OYzHW9m7xNZLHxeGGX AacW7237xpvm4kRHENdzpqBgLP+I2ggBMJvxcStRumalFeLjMSjMOoJhSIaD1zHptcaR 6zSj552BXdSWouBic7tm8ln7jjmzk47bty35OhQhlfBspf76vjzhCPmGCngorVKDHzLW EmjA== X-Forwarded-Encrypted: i=1; AJvYcCV0KRrz0P3K2lyHGxnbXXSmlmdC4Xf1XGCLQch/0zDHtygHX9CJpXO2hcIABY+6+vB2LxU=@lists.linux.dev X-Gm-Message-State: AOJu0Yw/KtdrrcmTkHGtIPjTpoASKAsO5LjGcW3IWXeW4zTkDksoh+UB GiYQ8WHz8S3s6TOVsZsOrzAyYn/yqK7RuOR2GqvLA6BgaKibisEH 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: imx@lists.linux.dev 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: 13869588 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.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 BCBEA1990C7 for ; Sat, 9 Nov 2024 12:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731156292; cv=none; b=bF2mG11sEsxFBW0VXOs08+8DIUSgejQZBfB0oKzXBUVxypy0vjE35MCS8F38sNRY/JuBx+OCFdPCVNO2ZceSP4VDShUiUsMnZKDfbYbtONzh2/1zPSJzl+UnXe90LDgVhPPmqVtzkrFzJnotv2F5oAT+ZfLGLZpyUpJ5jOes3jw= 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=O/93aH0v; arc=none smtp.client-ip=209.85.208.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="O/93aH0v" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5cec93719ccso4002186a12.2 for ; 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=lists.linux.dev; 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=O/93aH0vWQX9hmmb7a+vS1gdDqVu1ks81mfUm1jUwSL+RTbJu0EebrkHQH+I1fjE4V Ye7K8xj9qVSXanuCD9R6TC3hnbIvwgQW0K39xGFxlohuwGuezjjVWS6IRFVkNRONkToP FPY8G73L7B271EOWF/CJ93+8Vd8R2D1NQe9uhL192Un5IHxbwH1W4/CuaWpnVgwiO3gi bfnE9XhjwGixoqQaoPnir6UV7W7/TuwE3sA8e572evzrxdjqFkl3AA7L4lGqHQ0p9tSV 1bcrjS6vym92cIzhNlWOMZe3l+u/y4qbyJyWK/owITw5CT9Fo1G+Qr00S1IJrKfQ538i VLEg== 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=D8dOgH4EfZLgBU6HE4llpGggQLbYYANJPtLI+dTn4md33W3cwNOE3SdpMJAYVkadDD eQO74+ootwOK/isqrQyMAMBcrKWo2y3OkEFneontMvr22KHuSYDoTJQ2beszC4h9S5m4 X0mgXqG5WCFuM7PPOC4odOAsXDVk7eR2EjxGArWALM1k0whCbgbwo3FquJM6vYwH+lvd e7F7+EfXAw/DAmdQ0HWeEXvm0VWCRajQDNUBYLqHK3rrNsT8YkXiBclVz4IZzA2A1rKD xcLL3Vnzj8DYgc8E4d/qzrBzs76BmC7gWyLOYYNOcngpbyh5AWS1fItiybJTSpiR1UyO 4pFA== X-Forwarded-Encrypted: i=1; AJvYcCVYR7blk+feZDSiiJt3ytfslIOxEATd8Xm28GpXvI+V0crSS38+aBCyBRTg/pSSsbzqoyA=@lists.linux.dev X-Gm-Message-State: AOJu0Yxxgp6L4yv/+P+cqMnIhUER2KtumliaJ6cVbG46igINy8MFHyhv DphsEkp7yTGYIzUfmmvp4t8yffvRPbY9HAFp5R71Uc5/FiS5QrnC 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: imx@lists.linux.dev 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: 13869589 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 8AE5B198822 for ; 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=qqXoN5PaDD3bZ1F1OgLXwRfdjJZrBrAtmlLP9JeUtjwqh5GmX+PruuA2DA7rTzlWpxp9CgBzvh9sV/ikoxZ0/YzKX433bIhAcG2JmgutdJqmNcsbxUNRvlVEpKBQrPyB8WJz6bb4JHyDHhjeB4GO6kr0eXfAUQ1W6U6sLt9FFZI= 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=FZOfkzaz; 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="FZOfkzaz" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c9c28c1e63so3763565a12.0 for ; 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=lists.linux.dev; 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=FZOfkzazOZAewYkPE/+SpVne7XjRvFJLd+wb691AyKCqGxxzJvlmw+HkL7Ofn/3iFK PIOdWaepzEiv3hKUZLWbC7J9br41Gj8flmj6OqNPTXro+f2bmnl2Z8L3mLxq2Mrl4GP8 u9tOXIQb04vABLmBoXB1KwNexq0/rwOP5TPp2/jg7F+Ch2CHrylkzQN5ReI8WgDz9iCa ngl7DVPBIqA/pQlDvSaF/tIkhQzlIzziZVvNL/uJPrzP8f6WUJDHCx+CJ1S1hNAkwJYV eiuxYXzLuM6WVwtXGq4RPRDW6hS8owj+AYjdg7EmCh/hTA/8nxcr+3koGjUYzGVfwo5U NYFg== 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=DHtTY2om95rKHSBO/kxqySq15tJpER67MBJfmufrYiD5J/xyNZ6fc2zoVQeak/4cke eE/1K4AE5lCVV8gvJ/RJ0o7jioVF42w4BZ0Ky9Pf2FxAlI4gGPuKLkfbgMFZZkL+F9Vz TR9iHPJcXHNyAhBXusKMfp7nAtHoRNDnEkUAScryYLiLmGnWq0zObPNaYoWMxhq+06IN 7/ICMVJs8NLIP1J1FuxVa421+C4Q957yA/Z09/h/DEhAaBMPoHFJM26VCUp4HHEHU5pX xeEL45uCNmqG5D7eKgsaMr0+7XWOsj5eNBZnNNYeVHK8fxq5KiWmnpv6X+iGbojsPl/c W0pw== X-Forwarded-Encrypted: i=1; AJvYcCXAczKNaZGDq8Y+uDtAyj4CuVVVGSCvVJkv28jVQt8LwDvaCnjivllmpVp1j2JqGvPQXQ0=@lists.linux.dev X-Gm-Message-State: AOJu0YzdNJDWsd82IBQySIejg6/bOHfD2F556f5C5Rl+d5hcAVBzAR3W PHyMsOZkhr5deEPYCTgHUIU6fWBI2deZe826sL5KEuY7/B0xl/1o 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: imx@lists.linux.dev 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; }