Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1160452lqb; Thu, 30 May 2024 01:58:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTuVEaALzC9yOGfeJPQJ047LVAesM4ZonPo0GQF7v2o/1NTXWmY1Lg/qrS+yAKgp6slOaBlb6iWpcBRnCpghjyvIhmnhDCQlCjujqjHg== X-Google-Smtp-Source: AGHT+IHCVkN4a4MrJDFbaK+wodSQrN2e7MerLw91Q4chukqzTUzvQzZGlRbUagw1xQpR3iM3BZQ1 X-Received: by 2002:a50:cd15:0:b0:578:6092:dd21 with SMTP id 4fb4d7f45d1cf-57a1790316fmr1089025a12.26.1717059516763; Thu, 30 May 2024 01:58:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717059516; cv=pass; d=google.com; s=arc-20160816; b=mw/LpkZl6oNp2vHLNt5ac9oPQI++E8Vhns0A/onV84tmyLC6Atze1LE+hy4ARvhFe8 0zPJ5Gn9+jOIue3yD9BUPzIztvyLm6Vu4yBXrQJP4XvkA9PKpFrOi7wmSlEsHchGnjH2 qQvqSQFgp35CfEWqDeqzS0m6h/5kKF1FTe53bz7cC0XTwffiKKYLsyj34X65ijvjTaqQ FSH1FgUX1773g0B/czZS39JJavBfDSaSKS8yFSsyIIB3XBjwaXi4LRiM2DJNsLygPGLL sMAIRX9Jvr671XObTGqKdQFR64xG/gT6zWp8YxjNEAXJwTk4OHgl6DjUeC/3m9shLNe6 bhDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=pH6IEdvPsyMn2z81M00M9CRQyqxS5gUsz993GDmOU5c=; fh=e6CJwG1WmsUmBS+9ek7mR/20SSAeClpcaSdDKlBD7jU=; b=pNDhVqWrd0ZM07NtQ67cSion7NVqsXOjKZ22HvhslGsS/zRGK0ucjEwQDG6M87lpSb 6YO92E3dbJ6NX22+Pq0tVLfu8f9IxyCE1tg8waep44ddBRefwXBcjKJWU23eEYVdPjDZ 3Z8oaUZ0tBnXWeFMf8yuc43foO9S7QXz0BajNXZcLSu0TaI4R6m3qsy23SQsuu7SM+iq ZaJEA6H+EQ3MJ3JRYdLB+3R/DApjxCE0WKWIlI6z/x4sLXhdh0UZdlZxXS/8Xfjp/4kv 6dyuMVjpwh3j2OsZ0/66wEoAz8QajulrIqsnzdoxEudw4a8j3s3dTLOdLGA121Suyvu5 lAbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="KGe/RBV7"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195103-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57866d9203bsi6369665a12.569.2024.05.30.01.58.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 01:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="KGe/RBV7"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195103-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195103-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 924561F21929 for ; Thu, 30 May 2024 08:57:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C10517C7A4; Thu, 30 May 2024 08:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KGe/RBV7" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 C9987176AAD; Thu, 30 May 2024 08:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717059393; cv=none; b=qg4QOEczU8y7gik/x7GJVcnfIn8rbLLFa4n6yo4ylz5Sjk8NedsVG+R6PFoPPhvDTmypshoeK/0DoTUpHr1DxEUrvxuZ/grMb8hb2le5q4V+tsXX4FKHalNHfuevkxTsp3rgTsyF0zCtYlGX4QSdK2u1hgMy2zg4P/wBAD8nVw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717059393; c=relaxed/simple; bh=lvdySO4g1Iq+BvNlPqD2DOaKCv3w2CKbmZOppf2fdkE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Fl1EfwoTS8Gbx2sKY/n/aIMdNHZ67SSmuFoVzcGReuhHVgV9PVhMyGNI+euVUdqZC1K6dEXeD3reAefNUQHlDp+eCwnvIBt/wPUsgrUZe58XrN5Ssq3DkokjZ7qN8XnsH3vZaIYycFuUyGY8wrDIciCLke0R9J5U6G1VOFLIZgM= 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=KGe/RBV7; arc=none smtp.client-ip=209.85.218.53 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 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a63036f2daaso54437566b.1; Thu, 30 May 2024 01:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717059390; x=1717664190; 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=pH6IEdvPsyMn2z81M00M9CRQyqxS5gUsz993GDmOU5c=; b=KGe/RBV75ZcFlbq1s2s5SGBvVR5Uu/CYkSncDklpl+6/Kx5No6cQWpibUezKDkNE+m 7F8iJntpjFIwFC0b5RNBr/AJwoZ6ZVIG6ahLLZCPpbtF3T/VpLxfuJOyJvJvZbHXJxue LQncPRLlv5QAPQ4xoYYDBATp9gmFwFrZs6KsMsoABdQ79ShpbAHdSOACyPYT6kigp5oz J0WWT50f0pBZ8JvSjosCbHQ2R6JMqZfxBCoYHe8saT1kxDhMGI5XUTW7CAyow3AEnHYy CHjwfVHbRR3xIHluX0QZnH9cSFAwqknOBy7MWICh2uYLvX6Ot12mhRFg/OPSj4lbWO4T U6Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717059390; x=1717664190; 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=pH6IEdvPsyMn2z81M00M9CRQyqxS5gUsz993GDmOU5c=; b=b9+tkW61xLOiEixJQr47OqOHR0M89I94Ghkp9Xvc4iIpfa5KYyHinfBltnq56b1AXf 0aCkB/YgY7u393BHPvWaHMnOwj0GeoRS40EIOYW8AbQq+P3QYBIDFGAHTLCUSeEDB8d6 OMZyWnTWzbP4Yy0svsSP+hSE8ULtqsXRuu2+ADiQMKJ1/w3XlBSaNBNDRqTFgLpVzGag rD8HmZp5SvezYTHq6o0JyWqJKDpd1Qo/PzLVqUbtMQ+G8fvcxcMqnbpuAe3zto9YDfa9 ZmQ04y3J5vw0+5tL5pgq18DnBcWb1yxX7rse9whz0afCqdJH+ZFnoPcRn+2iJbez3a4/ fJMQ== X-Forwarded-Encrypted: i=1; AJvYcCWOKvJ5VrkXN5GmZmHVNZh/SgihEdUkCD9ZL2EsuPDkmGe30qPv1jSDHfc11EIsyS49cULOSj/LF/IvB1wOJecM5MQ0sEP7PzwR89iZRGhInhMRGLMfP94huOVyS2roJMLJ/U/W8ai6yELxw8Xrs/grg8te7jdCuxWAAagOhCxguQx+6XwAmdqnbAk93pNKUa8RReg6hHbclyxa8YLnm37SBzIobvA= X-Gm-Message-State: AOJu0YzoelcD7O7PXY6k5jRL4sV4vM6rYQSrbpUlb8rcMT+LaR9CsWnP 4ea9DFMYSgNtJlH0bz767D3uo6VMkJor8PJ4dTeiCX9gqpUsIi/a X-Received: by 2002:a17:906:3517:b0:a5a:44e:2b87 with SMTP id a640c23a62f3a-a65e8e5c113mr91117566b.21.1717059389889; Thu, 30 May 2024 01:56:29 -0700 (PDT) Received: from hex.my.domain (83.8.128.191.ipv4.supernova.orange.pl. [83.8.128.191]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc500a1sm798430166b.125.2024.05.30.01.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 01:56:29 -0700 (PDT) From: Artur Weber Date: Thu, 30 May 2024 10:55:53 +0200 Subject: [PATCH RFC 03/11] mfd: max77693: Add defines for charger current control Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240530-max77693-charger-extcon-v1-3-dc2a9e5bdf30@gmail.com> References: <20240530-max77693-charger-extcon-v1-0-dc2a9e5bdf30@gmail.com> In-Reply-To: <20240530-max77693-charger-extcon-v1-0-dc2a9e5bdf30@gmail.com> To: Krzysztof Kozlowski , Chanwoo Choi Cc: Sebastian Reichel , Rob Herring , Conor Dooley , Lee Jones , Krzysztof Kozlowski , Alim Akhtar , 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, ~postmarketos/upstreaming@lists.sr.ht, Henrik Grimler , Wolfgang Wiedmeyer , Denis 'GNUtoo' Carikli , Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717059384; l=1496; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=z92q56T3bzz9gRYE5sI8p34kLQvFNqoO5fMHOAH6pLc=; b=gqZVt0FTts2q85yDzL1R1OZGFpStHpJyMFNtSjLotVPYPTtwzJ9bXD5+s1WXj8u9Dm092xERY 1xicc/PZ5NnAJu1w4t2Pfvq6kpgMbO1ljOYg9eieohJFy/G5VpO+Md3 X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= From: Wolfgang Wiedmeyer This prepares for an updated regulator and charger driver. The defines are needed to set the maximum input current and the fast charge current. Signed-off-by: Wolfgang Wiedmeyer [GNUtoo@cyberdimension.org: small fix] Signed-off-by: Denis 'GNUtoo' Carikli [Artur: swap hardcoded ILIM values for DEFAULT_FAST_CHARGE_CURRENT] Signed-off-by: Artur Weber --- include/linux/mfd/max77693-private.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 54444ff2a5de..4570646e2f33 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h @@ -145,6 +145,8 @@ enum max77693_pmic_reg { #define DEFAULT_THERMAL_REGULATION_TEMP 100 /* microamps */ #define DEFAULT_BATTERY_OVERCURRENT 3500000 +/* microamps */ +#define DEFAULT_FAST_CHARGE_CURRENT 500000 /* microvolts */ #define DEFAULT_CHARGER_INPUT_THRESHOLD_VOLT 4300000 @@ -217,6 +219,10 @@ enum max77693_charger_battery_state { #define CHG_CNFG_01_CHGRSTRT_MASK (0x3 << CHG_CNFG_01_CHGRSTRT_SHIFT) #define CHG_CNFG_01_PQEN_MAKS BIT(CHG_CNFG_01_PQEN_SHIFT) +/* MAX77693_CHG_REG_CHG_CNFG_02 register */ +#define CHG_CNFG_02_CC_SHIFT 0 +#define CHG_CNFG_02_CC_MASK 0x3F + /* MAX77693_CHG_REG_CHG_CNFG_03 register */ #define CHG_CNFG_03_TOITH_SHIFT 0 #define CHG_CNFG_03_TOTIME_SHIFT 3 -- 2.45.1