From patchwork Thu May 30 08:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13679972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB7A5C25B74 for ; Thu, 30 May 2024 08:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bPVvNHe1+RG/MYwLkvw0x419qz/IeIMQXgj2tyXySKs=; b=Hh+9C0QRSnN4WT iTyeT5uHOWckBZhF/6SmbCDDekh2BffaHBSamo2FwUcQHqkqp3prUpFey0x2SylrV/mNTPVZdkdQ6 ZRWngoVtpWss36nPi2caERwTkIgQjJgv2WyerwzGYu70KMPPFAVQVM/KNoJfFOUPfUKB8FdwWKFFA inzYmBODTWrrW7nptSKjr4fQagnB0HHhNZicntOxVBDsOgSOuakL4l6ScwVj1T0kcyDVBWVbnEFM+ R/XvSc3Th6ftnEjs0uL9T+JqXTGblNtbULUt36WuDrSgp4i+6T+QTbryMYnbaafRNY0lZyzZQszvk 7ZAXiHvpLVdvgXwdL0jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCbb3-00000006hpy-0sFh; Thu, 30 May 2024 08:57:17 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCbaK-00000006hZB-0T6X for linux-arm-kernel@lists.infradead.org; Thu, 30 May 2024 08:56:33 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-57a1fe63a96so301203a12.0 for ; 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=lists.infradead.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=Js2nxIVIrX5L20h4ZsHIODrt5NEAtW9+lsITNjeX160bINLhtthLn/LtI/TAYU6VWU wWzXPap7nFpck6vIA/XpNl39KwiUazR+pys2FTnaiEibJGkZ9GitsiXqJuczqkaqQn4T Wf+4QGKfGbK8SqpvMfiRh4xrt3hYUZ7o5x15c8fUAYJ3KbZ+GYidfIpsHnHAxHO23qpc aUTCSBhW+t0U60vP5Rnv3ghlywW58SqRTBqm0G94hr+CZrNc/iYWEFYSDQvfCQ/Ntvd5 8YLhEhfMAeI9Q+x5Qq7sotDMkuHpQqmaWquJ+2bkCV+F5soM3pvF+xeEso3hg1cDKSaV 1K4Q== 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=tBcfQKOScgVTvEo7m0NnpetmCorCUtpdZTgydmkH7TbIzDflDDifXtiR+30QrnCULl yDo270B4aAf51go3/7tFap7wNcMFJEmJjnDUitX5j4h4f9cjVq1DndPXZ/fmGCgnT0Ih SiVoJ8pPvCetNC9mqYcPE78t6fYTM0LR9ESuy7mI5vSOGZv9PSXdCRVbEr55XgpL63Rm Mixe+qJKqAwsw/XeFBqunV86W/Bti9deU7H+q5viiY9myw3hK8ul5FT/tVBtdMeSq7Ck 8nqJ1tlLEz/AgM/6kDZ+nHQY0ZfBz43lnnLjSWXm8KUHjYfqPAjPS3lHyVXIIEFcv0XY OrsQ== X-Forwarded-Encrypted: i=1; AJvYcCWAb4+LkB+ub8cculMdcLal7fJMb8K0Nc8/+bppQbkBgChnnq6KtuWMmPnDVkH/vq5ONfnpz+J4pArTDpjox9NF/1Wb6cPVVFwRrXZMgq9esdumtYQ= X-Gm-Message-State: AOJu0Yxmrav11DFF0f405QhskDfUQzBZe+4x34cpd6iXIB93G1GbPOlp Cuo5uba4zGfOcA3NXGD9X99UVVYo87iI4hxnNXjQCpABCyafFTdsdd1BTg== X-Google-Smtp-Source: AGHT+IGnGk2ljLwZ0u8xsY1XXY1Hnt1SDUWhWdbiRrxUqPljltWq596nPnHiBYXJnSz/3lFgR53uBA== 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 MIME-Version: 1.0 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_015632_229317_98105986 X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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