From patchwork Wed Jan 8 14:13:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 855871 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 4284A1FCFF5; Wed, 8 Jan 2025 14:14:09 +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=1736345655; cv=none; b=nyoalskF/+9+PhGQv8DphnKtUPRtu1u6t2/ixj+GMmXLXqoDjb3ESciUkgOcmQiUeVL8obrT88uUvi1qBjjmE4HPposNZ6t0Xl7re4LOTFuCopF53CM1RgidukWDNFbE786Jg+bW9Lhrgkur7sTcJb/c5+Y2prSZXG0KJiVomwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345655; c=relaxed/simple; bh=LRRZ1LF62sUfrrQaRQZQnd6FxEzB6hrrJNyuB8N+gNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TkGSD0upc7MpAaz7K2lGWxubbeKmSwefEArblnF6fh8XWjMB9fzQm0PyyphV1h5Vr8bgIOFR4MVkK26/TIDCjbZcK0ZdheJLildoHaOHE7bvRKtL3+nmHhWOSjncyWjRpHK6aJBEeiXp/nx5yDdHvqESozv+xwcVLVr+9mVSZ8k= 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=ZviKUWDl; 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="ZviKUWDl" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5d3f28881d6so24986170a12.1; Wed, 08 Jan 2025 06:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736345646; x=1736950446; 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=yyujKwEsNfDHScoNav6ae3GjHsN1+8L3jPXCGfk2bqY=; b=ZviKUWDlvHWzJC59FxpYs9kn0BGIPn+4v9AoasN2jzoTEo5v0BPC7gEFsr0Llb5Zf3 2PzT9XHS+nxFC8if6N74+XLnPMeiTOtEa4WSrly8Ab7fm2HNWSLv5sEHf5azDCcowPrT 4ykuov4VV6uupRKpQSYYqFByh/B5fQ+PtwO/1zFFMug5DUu5Uc9tug0ldEI/emDwj3Q+ dK47z20R9ZA0eXb8wINbJKUxTEkJt9OntwZX0W5y2/Hc8TANsuimFmfekFvKZEkq0t/Z qhKhSIdQK/NkOkgfBFnfFdQ/p6yftb5rbo0CnEh9SHqgfP+cZyiPZCcGTPQDVahIwG0E 8KUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736345646; x=1736950446; 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=yyujKwEsNfDHScoNav6ae3GjHsN1+8L3jPXCGfk2bqY=; b=qQAzIQNIMly/4Vft/BR6tRmFTypsnglhfRbl7Sdi7oV034tnCD98x20guNYM5yHhCT Roks0+vB9d5BX8rpEGkVK7xWy3xnp2hml+ZbEEeS0oYL/tU230hSzypANo7pBsNWXFi2 4drFH/3AMLGufd3dh4Ldd8yVr2uoqf7Nkaq0aw9lSNuE2pPE+Q/BjWBxhpj7b86OehMR e4Ud6k+AptylIe3B9a7mjTsUgXdiXAzC/vOS57UAim6JDkorfYk+29wXeHkldhdzJD3V CjpEAfO+8AY1wkdofc4no84+Z91g7ms0DIVSHMTcifVFMXBnBMpo22/6sN7Xei5tfYBS CYfg== X-Forwarded-Encrypted: i=1; AJvYcCW9el4xVyT0XWE/0Ss3ytBDWwXfj87LNOaG+dbkbSYu1kKTIqmdNkKLjS8+YTDKOUgAUl5V1PkObmr02A==@vger.kernel.org, AJvYcCWRoV+t+zqfPF+bnySQPisdcW3CLMKnPuJ2v2jUAxA5ZrBfJ4f7uGleHjxo7eD3Kq06ObuX94fmDt7e5GU=@vger.kernel.org, AJvYcCXg7NHCnBWi+p1JlpLcDJ4cf9L8iVeAQyt/k3OYlJXaBjTbMigzi7yIwcDoefRGhNfHgZc234uOyHIZ@vger.kernel.org, AJvYcCXlpXYgTQc4f81WAWaEMqLfgvhxMJWUOg04BaF9Jrt7oasVh3NmsH4y5BM4X1Uiveo62j0+5Cdq9+TYAg/c@vger.kernel.org X-Gm-Message-State: AOJu0YwEL5Dd/7VJzvZYJ8rKOounYX0+pY+B8l89Lr+0u807MRjOdgqU R69DKqMWRVUL5G20Rd/NVIA8FCZ4dHESU6wM25C/MrgXH1JkvRM+ X-Gm-Gg: ASbGncuCAFHqT3EAZyPWrJd8tLi+TB9GkPLqIjq0A9rHjVyyDmhtgxGTOYO2gM5R5D0 zXZ4M9lIGm1sQTIjbqiubed0sFtW8JQysFpJ1hrG0/CfdatUrD7Th3diz1Yxofma1EZd3IOPUgL zRB8OP0kF1qCMg92SsaqjNHtZTExQDhLZRTyegZOlm8PyafDa4Up7AEd4MLjSx7UuYTj5y0yUU+ cPoRa3iJpXd/G5LOpfvu+5gvjwBH0VFsNfYn+vJqsH0fV7IBCc5JjQJfXx3WaN2cLR7AzjAYtYg 9lpbiukCVJamqcqE5+9c8DH8sg== X-Google-Smtp-Source: AGHT+IGVM5pD1YcoKYnzP654hghnKgGHGlW/glRlDkDsJcU4SselCB7M3z74Cs4SO4Tf4FrZNUuH5g== X-Received: by 2002:a05:6402:35ca:b0:5d0:d818:559d with SMTP id 4fb4d7f45d1cf-5d972e0b954mr6919492a12.11.1736345645944; Wed, 08 Jan 2025 06:14:05 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0efe4941sm2500562666b.95.2025.01.08.06.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:14:05 -0800 (PST) From: Dzmitry Sankouski Date: Wed, 08 Jan 2025 17:13:46 +0300 Subject: [PATCH v14 02/10] dt-bindings: power: supply: max17042: add max77705 support Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-starqltechn_integration_upstream-v14-2-f6e84ec20d96@gmail.com> References: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> In-Reply-To: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski , Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736345640; l=906; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=LRRZ1LF62sUfrrQaRQZQnd6FxEzB6hrrJNyuB8N+gNI=; b=nlwz+W7BOSRQcqzk0vd9qZ7XPsoXHIGVqTz9Q48a7M/o8VyxKMa1YFk7CmcGpYA0OY0NO/Dfh PiWDngZDtUrDWJkqRMjJso2wSlVx2FfA/5GV/MBDqdlpMdOyZS2K9q9 X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add max77705 fuel gauge support. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dzmitry Sankouski --- Changes in v14: - add reviewed trailers Changes in v10: - keep alphabetical order --- Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml index 085e2504d0dc..14242de7fc08 100644 --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml @@ -19,6 +19,7 @@ properties: - maxim,max17047 - maxim,max17050 - maxim,max17055 + - maxim,max77705-battery - maxim,max77849-battery reg: From patchwork Wed Jan 8 14:13:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 855870 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 12FCF1FDE1E; Wed, 8 Jan 2025 14:14:12 +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=1736345656; cv=none; b=rxdOha5Hd+ilwdlQHyrd2HyPRck6tsUtd5hisJV2eddyBshN4IrAvCGDb2MxhjyhouLJJeBZzkqqcZUfEwv7tA8ye3Xz2rpjwwN8/HhtES0NARGBrZILVsJHyqQQJWL0HTRJAyQ2nNY0ufPcvdyGYcY2BrmeWPjYoAcknlm7X5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345656; c=relaxed/simple; bh=mXulzNx4i224RQ8aQPPgZBPHi1e9Kt7QhQnDuW8jmXc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ESynRbc2sXs480Ho+IFSVuarM1Bj+lOqa9MEfQW85KPXv9Miw+pFAORBGPlK3pMlSe0bxbF47rsXxytgN/Qq6ED3InH4nd1UTz1CaY14I9tBPaxQgfN9ltf46uhua7KSTZj/+ck88PXNrTiwk/XwPbCR/dKu8KPdvzNyz/6mEh4= 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=TGARD5D7; 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="TGARD5D7" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-ab2bb0822a4so78540466b.3; Wed, 08 Jan 2025 06:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736345649; x=1736950449; 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=xQSiT5dvcU6OhgUSCqKULAtjaZ5NEb8Wz7CRSD9s8+k=; b=TGARD5D7UTlj8z0ZaFfciFQNFSu1QtKFxvhra9y1K5g2rzFrqb6vpWHEMbOK8oG7wB XZ05MHJQ6AEXs+lp1mb6WhStuZZQfMVz6MeeULojTt/m6bqFOXDLp0U10axcd/HDznHY PlQf34D+pOcaJt+YH03b15If6hKzQMCDQDBRDHUUBkbpiRFg3cn5apVl0mBwl5ODLK6n mYadiGKlF0xxiup/TPSZhB+Vc5MvfYiip6dEFzyBxg1Afy7CKh4FyFZsQ/jgD34AvSUV OL9oUTSbalcmVUUG3Bz5sllCyyHQGOsxFdoTZtWuv90zrv/ZV0uhwGgl2K4gpfDPFaUP MXGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736345649; x=1736950449; 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=xQSiT5dvcU6OhgUSCqKULAtjaZ5NEb8Wz7CRSD9s8+k=; b=tvr/U4UIud5+jrPVq8H0IdflebwKSq/t8/vfTCchnIDoQ1ZSrPd3v0VjKZqfiXaKXT 2XmHUhczvmqztLHzij/Uo1UUQ40TuruZwBwlyIvZ7qwBPWQNsvSgeqky5WOZCE89PAAZ mKZhVGFrLWIWwt+vqZ1R8WMoj0LlaLrMwvaexEfqIm1TfPB05zSuJps9JN0Lc+GCZrOD yD0dvv9PQW73cpd7YKQVwboPLof3QOrl+5QpuKbftwgNdHyfgyEl23yphrhl+rst8wKm U53/szWPz8cETCEvz+kz8ijV5F6IUUAL4zj+WKTlWhoUGUiuBln2ABiCagAxjavC9AQC xOWw== X-Forwarded-Encrypted: i=1; AJvYcCU6ZfbjpIGgiqAIe4JZfuhta5UZjODLROS6FXerCMCMW2EXXU7A0/w79gbK1kK3v2dmAovNy6ZImgWtUK8=@vger.kernel.org, AJvYcCV1T5pndfD5+qMBOT/+kQu4yCXiEc6Qprzix8DjQkZsKAxQ/P9sGBOPZxCLepAC7iyqeowgz36wtJelFw==@vger.kernel.org, AJvYcCV1qgVsGP/HitQ5U9ebG87PofW5+Kki4bgbWrbCx/dI4x5kdS6SPMFZFESAG+jRNbq12dvKDyLdpU0q@vger.kernel.org, AJvYcCVbAaJftVrMpnWa5WPnph0cS9r7STifCQ2AQugHLPkIyvS1uNeXfwqUv3z8BPiHZU5pS3z7wO4tA08mwixD@vger.kernel.org X-Gm-Message-State: AOJu0YxsodcgT0H6QHqJTrqkK7j/vdlv9BcyzU7UeSE0uMl9speeGHYP VsuGXa8i6EVYeHS01qvDkF2ShpOhRW8tV5IH5fSCizG8Q74A9vSn X-Gm-Gg: ASbGnct7VUWu/RoApIv8r7eqYPk7DzZrwt/g2jrflmkEvYFvwQBECihKT4TKbfeuVKF qI3Lfx7ETBNFIFqhXjcTTiVMVRdTsHMrb9PQ5s1vryL3aoiHGTa4NQEQryphxjJdiUQF3ia9XwJ mLBXsW2s4msqQFxxdx3fxJ3025PGc2CwaX4LEa8usYrU1ZF9/T+V2dtoJRglkixRGWI/g/biMj8 I/ce2IFOWduM0LMPp6RWK/9xjFQdQ7j4XJeShSfh+qZItMxWI+0Bpmcj+xuXJQy28DW/+j8bTjg SD2A5ly4m5Mpy8DUyyMo8UVPWA== X-Google-Smtp-Source: AGHT+IEc+YyQrhZo9f7zyYG8/lmiMoe+tUfXq3VmdJX3/6HmzM7qshAy0MO9tQGfbVXaMLrD5NNjKQ== X-Received: by 2002:a17:907:d1b:b0:aa6:b63a:4521 with SMTP id a640c23a62f3a-ab2ab558881mr329670366b.15.1736345649227; Wed, 08 Jan 2025 06:14:09 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0efe4941sm2500562666b.95.2025.01.08.06.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:14:08 -0800 (PST) From: Dzmitry Sankouski Date: Wed, 08 Jan 2025 17:13:48 +0300 Subject: [PATCH v14 04/10] dt-bindings: mfd: add maxim,max77705 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-starqltechn_integration_upstream-v14-4-f6e84ec20d96@gmail.com> References: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> In-Reply-To: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736345640; l=6754; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=mXulzNx4i224RQ8aQPPgZBPHi1e9Kt7QhQnDuW8jmXc=; b=K04FYt3FGPc6OSfA9ut5bj99NTfM8qLd1SS1ClVmYHAs3HFNKY89cxcqwGSFefhhQ5N1P0ueb mKXWVMX9qO8BJC6EyoswMs95eFzzmRL9YD/mSuxGmot5Uxv5CHdKKuH X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add maxim,max77705 binding part, containing leds controller and haptics. Charger and fuel gauge are separate device, thus not included. Reviewed-by: Rob Herring (Arm) Signed-off-by: Dzmitry Sankouski --- Changes in v14: - add reviewed trailers - move "patternProperties" after the "properties:" block Changes in v13: - drop unused address-cells and size-cells properties Changes in v12: - revert: description: mention this is a part - adjust commit message Changes in v12: - move fuelgauge bindings to separate patch because separate device - move charger bindings to separate patch because separate device - description: mention this is a part Changes in v11: - remove reviewed tags because of major changes - none of children are supposed to have addresses, all nodes are unit-less Changes in v10: - leds: replace label with color and function properties - leds: add support for leds-class-multicolor - move fuelgauge node to patternProperties "^fuel-gauge@[0-9a-f]+$" to comply with max17042 binding Changes in v9: - replace max77705 fuel gauge with max17042 - remove monitored battery because not supported by max17042 Changes in v8: - fix leds compatible Changes in v6: - unevaluatedProperties must be false - drop excessive sentence from description, just describe the device - change leds compatible to maxim,max77705-rgb Changes in v5: - formatting changes - add unevaluatedProperties: false for nodes referencing common schemas - remove additionalProperties on nodes with unevaluatedProperties: false - add min and max to led index Changes in v4: - change dts example intendation from tabs to spaces - remove interrupt-names property - remove obvious reg description - split long(>80) lines --- Documentation/devicetree/bindings/mfd/maxim,max77705.yaml | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 159 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml b/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml new file mode 100644 index 000000000000..0ec89f0adc64 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/maxim,max77705.yaml @@ -0,0 +1,158 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/maxim,max77705.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Maxim MAX77705 Companion Power Management and USB Type-C interface + +maintainers: + - Dzmitry Sankouski + +description: | + This is a part of device tree bindings for Maxim MAX77705. + + Maxim MAX77705 is a Companion Power Management and Type-C + interface IC which includes charger, fuelgauge, LED, haptic motor driver and + Type-C management. + +properties: + compatible: + const: maxim,max77705 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + haptic: + type: object + additionalProperties: false + + properties: + compatible: + const: maxim,max77705-haptic + + haptic-supply: true + + pwms: + maxItems: 1 + + required: + - compatible + - haptic-supply + - pwms + + leds: + type: object + additionalProperties: false + description: + Up to 4 LED channels supported. + + properties: + compatible: + const: maxim,max77705-rgb + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + multi-led: + type: object + $ref: /schemas/leds/leds-class-multicolor.yaml# + unevaluatedProperties: false + + properties: + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + patternProperties: + "^led@[0-3]$": + type: object + $ref: /schemas/leds/common.yaml# + unevaluatedProperties: false + + properties: + reg: + maxItems: 1 + + required: + - reg + + patternProperties: + "^led@[0-3]$": + type: object + $ref: /schemas/leds/common.yaml# + unevaluatedProperties: false + + properties: + reg: + maxItems: 1 + + required: + - reg + + required: + - compatible + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@66 { + compatible = "maxim,max77705"; + reg = <0x66>; + interrupt-parent = <&pm8998_gpios>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&chg_int_default>; + pinctrl-names = "default"; + + leds { + compatible = "maxim,max77705-rgb"; + + multi-led { + color = ; + function = LED_FUNCTION_STATUS; + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + color = ; + }; + + led@2 { + reg = <2>; + color = ; + }; + + led@3 { + reg = <3>; + color = ; + }; + }; + }; + + haptic { + compatible = "maxim,max77705-haptic"; + haptic-supply = <&vib_regulator>; + pwms = <&vib_pwm 0 50000>; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index f8922b37489d..98a77dece2f1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14287,6 +14287,7 @@ B: mailto:linux-samsung-soc@vger.kernel.org F: Documentation/devicetree/bindings/*/maxim,max14577.yaml F: Documentation/devicetree/bindings/*/maxim,max77686.yaml F: Documentation/devicetree/bindings/*/maxim,max77693.yaml +F: Documentation/devicetree/bindings/*/maxim,max77705*.yaml F: Documentation/devicetree/bindings/*/maxim,max77843.yaml F: Documentation/devicetree/bindings/clock/maxim,max77686.txt F: drivers/*/*max77843.c From patchwork Wed Jan 8 14:13:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 855869 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 573071FE461; Wed, 8 Jan 2025 14:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345660; cv=none; b=L95MiDrBDV2f4ZtQR+8L2NuzUKs15YafvOVpuz3dorqSvw5O4yMjLiam12FnmFFIw/2FwmoPQGXX6SpL6PE+nt7uDPBHwkLfwHw2iy47G0lGIY/sYL2gsD01On9rz9AavAMV6iKnUSzOyZsgrmNKQ8eB5fEs7Zvi3CmQZOcd21M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345660; c=relaxed/simple; bh=I7mtjfCVJ1O2Vg6443qyW0B5WFDFjRpanCU/ThHHH0E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JrwwOIyCxyktee/NVMleAwA9Z2tGjspjDgOvI1rX0SmwHkrd0dyIPAgsZWxmDQ2B0FCtqqIqbJDKmLrvkeIPwwkBn3CxkMrVCQWQS7lDbxM5EGaHlmKhA6SHS9Z7k8bCGs6FzLeKNIDdl0NQX7NNgWlbY39iKYDHr+3NKVW3r6A= 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=F/go+vW3; arc=none smtp.client-ip=209.85.218.43 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="F/go+vW3" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa69107179cso2799526066b.0; Wed, 08 Jan 2025 06:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736345653; x=1736950453; 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=QAsrsTp1vVx4HKavdMezqlK1BcLoKSQ4OHEn1+GzS2A=; b=F/go+vW3tRiweffasKTeRCub3UTRfcRVEvw4LkqZrsvT1QkYl56ouWjA0NyeNSndJu dHfxbqw1IkbYtMDaMer8I16mNDpHagvuSBqhZMfkdZVp3uD7WvRWfBPlHhxpulUds9FS JsHs9L5f6hG8KD9AIbfmS2esC+UJJpsTFmNvdCg21Vam+IZ2XK/gw+rGJZOE869EsmtQ 7UnPGkGg3+EAVVBIvsdhmrXeIlNKrzKIy5Xf3xzznvxk+gRhqPKicq8/uVGd5kgEkvMC nyfd3uP8cwhtByYTcVsifPjro0DNZKzo+eBfZtUZNATjhdACB+y/hwnze7i2xp0dlaxl JqGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736345653; x=1736950453; 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=QAsrsTp1vVx4HKavdMezqlK1BcLoKSQ4OHEn1+GzS2A=; b=e0m8Uw3WmPs8QN8PF1Z8qq/mvGAb6+nw2+RtrPdL0See09q/U0uIvBybWeqPM/22Va sNjkd+se2o5KfuUxFldP3KlL0lmlBx7pbXfCJOE0/fHp8TBNiWHuLXse/g2qzzuguJrs hUQAsH+L4DceqeAEnqRAUZPi+/KMzOuBDhkrnwaWIC0svTcdTZ0lgRZkxSHPSnBbk63T cdLnyEDkr+r2yq3vuSV8lZmr1AX9J59nSUo9ei63U9F0ZeHOyRxAEYcq78Q/0NEY7OYc ZqPRTMsWMxdePeZ1IMvHRI2C7sIu5Nu+Qxo/BHnQO7O3J0ED/YTb0OTzgULZqiOkZAml uYFQ== X-Forwarded-Encrypted: i=1; AJvYcCVe/6AXgP0M978ec+VphATWc5taFiuuAKDEYkhtdZaNhNhhoFHMdt0yV+KWmIBBTneW12Xr1zaXgnlW@vger.kernel.org, AJvYcCW3zx6qGMQh/7k4ncU1rM92rCXGJkxUNNGMWIWtd6Waa98xa7BfVgf93JO7GX66p0c/Zfs6lijNm6k0jg==@vger.kernel.org, AJvYcCXIjMQXUawOi/pU8uACj7Z4oxY1u+A1zjsfV5qTNG7HXA1jOgrhfoo3n/sNUsVXzevfDsYPRCqfezls1sg=@vger.kernel.org, AJvYcCXqb7lxK3bUXqVo/4mQBVHOEsEgn4V77PxGUsmPpnIFH+F1jSzaKuJ3c+l12h5c/ywe113uciOx14aDzxcz@vger.kernel.org X-Gm-Message-State: AOJu0Yz4itEsMFwcCQwddxjASpqU8hr0nfgqMXP3uh9elLBYtkaLKD8D f9aSZU/X+8N0Sfy74KGrno0Qr8/XEKxBZayBfiRE0PlgpvBYfeq4 X-Gm-Gg: ASbGncvOJoCeWXKpvEhO4RLoOW3Rn73eN4hw6eNiv2v7vEmSQEKF+wbzyWX9M0DNpDQ fASVY1ToyEg66D0JX3FGoxx2za7+um7Ppun4mgcRsACjlIcX+lAxHLwR0+iCFU2tR0dkQSB/36a T3/90uANpnGnJ+E1lyvifjlCMz1jLnBs3sS3uHjOif8wrZeKGuDxCfjnstN3mjpzaGF+eWWWfvB 7Xiyai0B/DpxhMQ22wWtJR2cQBI/EDDHUGUh0DSkATz0jRR0ysaSBbqFmFs+z4yCd4na1pqDw+I pQaJfnD+LHsDH6MiGxhQ7nwppw== X-Google-Smtp-Source: AGHT+IGEh+LVPv/D0Mg3OQICJF+cwxS9rog2MJCMJ4L3QLCPHPYJH6o6Fpoe2HikJOse/wolK+fTRA== X-Received: by 2002:a17:907:72cf:b0:aaf:c19b:6ca0 with SMTP id a640c23a62f3a-ab2ab66ce98mr241981466b.5.1736345653293; Wed, 08 Jan 2025 06:14:13 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0efe4941sm2500562666b.95.2025.01.08.06.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:14:13 -0800 (PST) From: Dzmitry Sankouski Date: Wed, 08 Jan 2025 17:13:51 +0300 Subject: [PATCH v14 07/10] mfd: simple-mfd-i2c: Add MAX77705 support Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-starqltechn_integration_upstream-v14-7-f6e84ec20d96@gmail.com> References: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> In-Reply-To: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736345640; l=1436; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=I7mtjfCVJ1O2Vg6443qyW0B5WFDFjRpanCU/ThHHH0E=; b=pQqkRhG7P6Z9S4s6K74BVMR+tI2s4Dz0WPDeeEKk00l3/T6eRhGO5wyLt/xv6O5FwFvsebaOG 1fn0qsDGJKtDmjq6VkTFx4WecO7zXYn1Bb1L+X/C3SUKBRw2sDIYm1l X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add MAX77705 support - fuel gauge and hwmon devices. Hwmon provides charger input and system bus measurements. Signed-off-by: Dzmitry Sankouski --- Changes in v13: - remove compatible from cells - change mfd compatible to match max77705 fuel gauge node --- drivers/mfd/simple-mfd-i2c.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 6eda79533208..22159913bea0 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -83,11 +83,22 @@ static const struct simple_mfd_data maxim_max5970 = { .mfd_cell_size = ARRAY_SIZE(max5970_cells), }; +static const struct mfd_cell max77705_sensor_cells[] = { + { .name = "max77705-battery" }, + { .name = "max77705-hwmon", }, +}; + +static const struct simple_mfd_data maxim_mon_max77705 = { + .mfd_cell = max77705_sensor_cells, + .mfd_cell_size = ARRAY_SIZE(max77705_sensor_cells), +}; + static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a}, { .compatible = "maxim,max5970", .data = &maxim_max5970}, { .compatible = "maxim,max5978", .data = &maxim_max5970}, + { .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705}, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); From patchwork Wed Jan 8 14:13:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 855867 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.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 31A9E1FE47A; Wed, 8 Jan 2025 14:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345664; cv=none; b=hd5TaNUochM2OsI6qaL5edFSE3Ll0QNZaxuHsQftQXSzeJoaPU2KyJ6AZo8pwmosNmtg9egdlrZARhZF9y6K/j05Sjohj/0KtoMeNOuWqtZh56NeKrA7oFzngLmtJrvZ1WjUcUUyXSj7V0rRVbkRUIvw+g8HKayglRyUjrr2RMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345664; c=relaxed/simple; bh=mYVzhE9cRrQLHZbeZNt+OeVeLu1RBOyrZa3r7Sk0x0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zh60OfmA5dLZ2VoqxbHyI9GYo2PuIt51s1Ve22WyMV0Gtldy0Ck3G/FNZzKBF60XxmiZqcA/354sLUy/q/bGWCCuisKqlKQ7zYlxb70V03leIMLVNwrsJ+slWklOZnYSEo+xkqeeYF9OIMw8WxQdsKJSZ2AIdic01MqWgkuvYXg= 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=IR/IwVCT; arc=none smtp.client-ip=209.85.218.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="IR/IwVCT" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-ab2b72fb3c9so110381966b.0; Wed, 08 Jan 2025 06:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736345655; x=1736950455; 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=xqqhn1C38pfbvYQFEl3cKvUanz7vNMzqdHr5FCRUyks=; b=IR/IwVCTLsnzpW9t8m490S2XR3B9YdwSS/XDokkHJy6ZnMsGGC6Hk+e+aa9vJFoRgb xYC6lZJI5f/+xW3pzFW+6sk//dp5bpA+vfrcBX4GAs2qwTOTBfp87WmSjgHQU79pAc38 Qhbrn9wvid/LnsjhCxBvRhdYobZkPiZRKejxxqJ4sFMt8o29sCW5AJ/2w3hMgVhOqIje KU9S5eoHZhgUobQ63fO9i2oL7kEiYdmwd5y7r/v8Oc2fY5JYE3yeGgXPLtxPCUUuVSvY aUzywrhL2pZ3Anb8Etld/lL4zpqY0D2JZQ+ZKUsiW/arAf/wggyxsiRxvuJnMGrRUndB J/NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736345655; x=1736950455; 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=xqqhn1C38pfbvYQFEl3cKvUanz7vNMzqdHr5FCRUyks=; b=r5dxEBjiffxWat6pGLDl5VBxptdVRi6bafV5d7jmTVoI8ZhgwNvhAAACe/Cub6MthX rZSQpSR0UluawKmej1S1pGsnqRXOc1veoRkyP+0eY46Bbsdf1CIfItfX9PDR9DrRNo5O UjEzdcGn079hXO74fbtnOUR+kDTFuNxgONYOqd+KIKvwmq6Nc6HecKdiEMXLpke4ODI9 zfHktcdCRCq/qxvYpJGgjBiahQIPHHlDEr4OSEUzwhT1shii2QUV7GH9Q2o4p4wrMfcg 3QjM6uC2D02OZlSsq54fEdkrX/Zkinr7CLBVwcJTxjwW8Ws63rOGicD5oHWA8BJ1hY/y WBhw== X-Forwarded-Encrypted: i=1; AJvYcCVd6r4CL/t+6W1T+Fiyw27BujP+D9WKQlRo04a2A9hlrej4bx1dIdhaxX23aLhHbFqJixbEarjV9U0qOxY=@vger.kernel.org, AJvYcCWecqPNhBVNdCyWqhA4bC9y35XrojVQhOLSJJgJ6nhJ2D5u5BYg33mZHHrCgR1bYNtuJOGiUkT1IfgE@vger.kernel.org, AJvYcCWy6V8NKLfBfrtzyd0mcdVs1aL4RJufaIl1aybUD9+m7z+JLx3CYL+F43kSdH2I51+rbCVkxrzK/Ra9a74G@vger.kernel.org, AJvYcCXmh2dBF1jlnHoTMc9l8jNtM/pYVladKAKb3WDOQxF8KFIDWdzQg/TWYL9IQIGlADbcib49ZN1zul+1rg==@vger.kernel.org X-Gm-Message-State: AOJu0YwBLvmZMCbG646oO++v3WNM4GIJG3Vg2p3aMgkNLOKQEHx1dVP5 nHjoq2aO8QhpUs1OpK91XgjAQRbC145Zt4tGm97FVfcBrAEz3JF3 X-Gm-Gg: ASbGncsJag7y9WEdCJ/R1Dx6PIv9ErmxW0KijUmcS4JYY/aYf4KEQUOlC4A9DzzrBft UKuQj21hCpUHp+fMY/A//W/hXTt7yKAtk8UP1NgtYSPWaEvwIbsiGyXtr9jngoYsRjm9Q+C9Osx 16LtHiMeTtGq7pr3pICtU7qV+LNI4GrLIJuegpKjqp7qy8GZC15LOoK/9k63r2W6cC+XlORSdXf 2QyO3E3VlzkE0+7q1PX9ITnWtKfJuCXUIG9zIcnkBjiG3mQI21Ywu5r3jw1oTMLNeNQ1bk5vxbP EqFBqV6K5R2JC9WHyRBtBIAN6A== X-Google-Smtp-Source: AGHT+IFKBO/R4GQJ0OZX15a/pyi8IA/nju8yQdirTSElfNhs7wu3LodIkkdTq3zuK8QRRi+x6xj06Q== X-Received: by 2002:a17:906:794d:b0:aae:83c7:fd50 with SMTP id a640c23a62f3a-ab2a79f1e11mr269175366b.9.1736345654639; Wed, 08 Jan 2025 06:14:14 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0efe4941sm2500562666b.95.2025.01.08.06.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:14:14 -0800 (PST) From: Dzmitry Sankouski Date: Wed, 08 Jan 2025 17:13:52 +0300 Subject: [PATCH v14 08/10] mfd: Add new driver for MAX77705 PMIC Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-starqltechn_integration_upstream-v14-8-f6e84ec20d96@gmail.com> References: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> In-Reply-To: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736345640; l=18833; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=mYVzhE9cRrQLHZbeZNt+OeVeLu1RBOyrZa3r7Sk0x0k=; b=C51RxfiXc7+EuM/AFSlbAV6d6hAVuSg5PdddbKl3H6YSJTEePCHEKHgvOp3Ynslk6dDoSX3IZ AISAB2YWbrWCjQVZJ2zeSCO/uRLRBj6i5UVm03a5ww2KvJZody/phyj X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add the core MFD driver for max77705 PMIC. Drivers for sub-devices will be added in subsequent patches. Signed-off-by: Dzmitry Sankouski --- Changes for v12: - remove fuelgauge support (it's moved to simple-mfd-i2c, to reflect the fact it's a separate device with it's own i2c client) - remove unneeded ending comma - remove struct dev_pm_ops because defined by DEFINE_SIMPLE_DEV_PM_OPS - Kconfig: select MFD_SIMPLE_MFD_I2C Changes for v10: - never blank line between call and its error check - remove unnecessary line wrap - revert wrong changes in max77693-common.h - move max77705_pm_ops from header to c file - fail probe, when fuelgauge is not found in sub device list - remove fuelgauge compatible, because with compatible, platform matches using compatible, and platform_device id_entry is empty. With no compatible, platform matches by device id, and id_entry is populated. - use dev_err_probe for error handling Changes for v9: - use max17042 as fuel gauge chip - initialize max17042 i2c dummy device in mfd device, because bus can be used for reading additional values, not related to fuelgauge, like chip input current, system bus current - fix pmic_rev kernel test robot error Changes for v8: - fix comment style C++ -> C - remove unused pmic_ver Changes for v6: - add PMIC suffix in Kconfig - remove filename from file header - reorder headers alphabetically - move out fg and chg adresses definitions - rename led name and compatible - remove overbracketing - move charger and fuel gauge i2c initialization to their drivers - fix max77705_i2c_driver tabbing - formatting fixes Changes for v5: - license change to 2.0 - use same hardware name in Kconfig and module descriptions Changes for v4: - rework driver from scratch - migrate to regmap_add_irq_chip, remove max77705-irq.c, rename max77705-core.c to max77705.c - cleanup headers - remove debugfs code - migrate to use max77693_dev structure - remove max77705.h --- MAINTAINERS | 2 ++ drivers/mfd/Kconfig | 13 +++++++++ drivers/mfd/Makefile | 2 ++ drivers/mfd/max77705.c | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/max77693-common.h | 4 ++- include/linux/mfd/max77705-private.h | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 407 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 98a77dece2f1..eb5222a833f8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14294,6 +14294,7 @@ F: drivers/*/*max77843.c F: drivers/*/max14577*.c F: drivers/*/max77686*.c F: drivers/*/max77693*.c +F: drivers/*/max77705*.c F: drivers/clk/clk-max77686.c F: drivers/extcon/extcon-max14577.c F: drivers/extcon/extcon-max77693.c @@ -14301,6 +14302,7 @@ F: drivers/rtc/rtc-max77686.c F: include/linux/mfd/max14577*.h F: include/linux/mfd/max77686*.h F: include/linux/mfd/max77693*.h +F: include/linux/mfd/max77705*.h MAXIRADIO FM RADIO RECEIVER DRIVER M: Hans Verkuil diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 6b0682af6e32..5064b1b42f76 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -916,6 +916,19 @@ config MFD_MAX77693 additional drivers must be enabled in order to use the functionality of the device. +config MFD_MAX77705 + tristate "Maxim MAX77705 PMIC Support" + depends on I2C + select MFD_CORE + select MFD_SIMPLE_MFD_I2C + help + Say yes here to add support for Maxim Integrated MAX77705 PMIC. + This is a Power Management IC with Charger, safe LDOs, Flash, Haptic + and MUIC controls on chip. + This driver provides common support for accessing the device; + additional drivers must be enabled in order to use the functionality + of the device. + config MFD_MAX77714 tristate "Maxim Semiconductor MAX77714 PMIC Support" depends on I2C diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 9220eaf7cf12..c18bb5a57734 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -168,6 +168,7 @@ obj-$(CONFIG_MFD_MAX77620) += max77620.o obj-$(CONFIG_MFD_MAX77650) += max77650.o obj-$(CONFIG_MFD_MAX77686) += max77686.o obj-$(CONFIG_MFD_MAX77693) += max77693.o +obj-$(CONFIG_MFD_MAX77705) += max77705.o obj-$(CONFIG_MFD_MAX77714) += max77714.o obj-$(CONFIG_MFD_MAX77843) += max77843.o obj-$(CONFIG_MFD_MAX8907) += max8907.o @@ -233,6 +234,7 @@ obj-$(CONFIG_MFD_RK8XX_I2C) += rk8xx-i2c.o obj-$(CONFIG_MFD_RK8XX_SPI) += rk8xx-spi.o obj-$(CONFIG_MFD_RN5T618) += rn5t618.o obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o +obj-$(CONFIG_MFD_S2DOS05) += s2dos05.o obj-$(CONFIG_MFD_SYSCON) += syscon.o obj-$(CONFIG_MFD_LM3533) += lm3533-core.o lm3533-ctrlbank.o obj-$(CONFIG_MFD_VEXPRESS_SYSREG) += vexpress-sysreg.o diff --git a/drivers/mfd/max77705.c b/drivers/mfd/max77705.c new file mode 100644 index 000000000000..18d344620755 --- /dev/null +++ b/drivers/mfd/max77705.c @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Maxim MAX77705 PMIC core driver +// +// Copyright (C) 2024 Dzmitry Sankouski + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct mfd_cell max77705_devs[] = { + { + .name = "max77705-rgb", + .of_compatible = "maxim,max77705-rgb", + }, + { + .name = "max77705-charger", + .of_compatible = "maxim,max77705-charger", + }, + { + .name = "max77705-haptic", + .of_compatible = "maxim,max77705-haptic", + }, +}; + +static const struct regmap_range max77705_readable_ranges[] = { + regmap_reg_range(MAX77705_PMIC_REG_PMICID1, MAX77705_PMIC_REG_BSTOUT_MASK), + regmap_reg_range(MAX77705_PMIC_REG_INTSRC, MAX77705_PMIC_REG_RESERVED_29), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL1, MAX77705_PMIC_REG_BOOSTCONTROL1), + regmap_reg_range(MAX77705_PMIC_REG_MCONFIG, MAX77705_PMIC_REG_MCONFIG2), + regmap_reg_range(MAX77705_PMIC_REG_FORCE_EN_MASK, MAX77705_PMIC_REG_FORCE_EN_MASK), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL1, MAX77705_PMIC_REG_BOOSTCONTROL1), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL2, MAX77705_PMIC_REG_BOOSTCONTROL2), + regmap_reg_range(MAX77705_PMIC_REG_SW_RESET, MAX77705_PMIC_REG_USBC_RESET), +}; + +static const struct regmap_range max77705_writable_ranges[] = { + regmap_reg_range(MAX77705_PMIC_REG_MAINCTRL1, MAX77705_PMIC_REG_BSTOUT_MASK), + regmap_reg_range(MAX77705_PMIC_REG_INTSRC, MAX77705_PMIC_REG_RESERVED_29), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL1, MAX77705_PMIC_REG_BOOSTCONTROL1), + regmap_reg_range(MAX77705_PMIC_REG_MCONFIG, MAX77705_PMIC_REG_MCONFIG2), + regmap_reg_range(MAX77705_PMIC_REG_FORCE_EN_MASK, MAX77705_PMIC_REG_FORCE_EN_MASK), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL1, MAX77705_PMIC_REG_BOOSTCONTROL1), + regmap_reg_range(MAX77705_PMIC_REG_BOOSTCONTROL2, MAX77705_PMIC_REG_BOOSTCONTROL2), + regmap_reg_range(MAX77705_PMIC_REG_SW_RESET, MAX77705_PMIC_REG_USBC_RESET), + +}; + +static const struct regmap_access_table max77705_readable_table = { + .yes_ranges = max77705_readable_ranges, + .n_yes_ranges = ARRAY_SIZE(max77705_readable_ranges), +}; + +static const struct regmap_access_table max77705_writable_table = { + .yes_ranges = max77705_writable_ranges, + .n_yes_ranges = ARRAY_SIZE(max77705_writable_ranges), +}; + +static const struct regmap_config max77705_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .rd_table = &max77705_readable_table, + .wr_table = &max77705_writable_table, + .max_register = MAX77705_PMIC_REG_USBC_RESET, +}; + +static const struct regmap_config max77705_leds_regmap_config = { + .reg_base = MAX77705_RGBLED_REG_BASE, + .reg_bits = 8, + .val_bits = 8, + .max_register = MAX77705_LED_REG_END, +}; + +static const struct regmap_irq max77705_topsys_irqs[] = { + { .mask = MAX77705_SYSTEM_IRQ_BSTEN_INT, }, + { .mask = MAX77705_SYSTEM_IRQ_SYSUVLO_INT, }, + { .mask = MAX77705_SYSTEM_IRQ_SYSOVLO_INT, }, + { .mask = MAX77705_SYSTEM_IRQ_TSHDN_INT, }, + { .mask = MAX77705_SYSTEM_IRQ_TM_INT, }, +}; + +static const struct regmap_irq_chip max77705_topsys_irq_chip = { + .name = "max77705-topsys", + .status_base = MAX77705_PMIC_REG_SYSTEM_INT, + .mask_base = MAX77705_PMIC_REG_SYSTEM_INT_MASK, + .num_regs = 1, + .irqs = max77705_topsys_irqs, + .num_irqs = ARRAY_SIZE(max77705_topsys_irqs), +}; + +static int max77705_i2c_probe(struct i2c_client *i2c) +{ + struct max77693_dev *max77705; + struct regmap_irq_chip_data *irq_data; + struct irq_domain *domain; + int ret; + unsigned int pmic_rev_value; + enum max77705_hw_rev pmic_rev; + + max77705 = devm_kzalloc(&i2c->dev, sizeof(*max77705), GFP_KERNEL); + if (!max77705) + return -ENOMEM; + + max77705->i2c = i2c; + max77705->dev = &i2c->dev; + max77705->irq = i2c->irq; + max77705->type = TYPE_MAX77705; + i2c_set_clientdata(i2c, max77705); + + max77705->regmap = devm_regmap_init_i2c(i2c, &max77705_regmap_config); + if (IS_ERR(max77705->regmap)) + return PTR_ERR(max77705->regmap); + + if (regmap_read(max77705->regmap, MAX77705_PMIC_REG_PMICREV, &pmic_rev_value) < 0) + return -ENODEV; + + pmic_rev = pmic_rev_value & MAX77705_REVISION_MASK; + if (pmic_rev != MAX77705_PASS3) + return dev_err_probe(max77705->dev, -ENODEV, + "Rev.0x%x is not tested\n", pmic_rev); + + max77705->regmap_leds = devm_regmap_init_i2c(i2c, &max77705_leds_regmap_config); + if (IS_ERR(max77705->regmap_leds)) + return dev_err_probe(max77705->dev, PTR_ERR(max77705->regmap_leds), + "Failed to register leds regmap\n"); + + ret = devm_regmap_add_irq_chip(max77705->dev, max77705->regmap, + max77705->irq, + IRQF_ONESHOT | IRQF_SHARED, 0, + &max77705_topsys_irq_chip, + &irq_data); + if (ret) + return dev_err_probe(max77705->dev, ret, "Failed to add irq chip\n"); + + /* Unmask interrupts from all blocks in interrupt source register */ + ret = regmap_update_bits(max77705->regmap, + MAX77705_PMIC_REG_INTSRC_MASK, + MAX77705_SRC_IRQ_ALL, (unsigned int)~MAX77705_SRC_IRQ_ALL); + if (ret < 0) + return dev_err_probe(max77705->dev, ret, + "Could not unmask interrupts in INTSRC\n"); + + domain = regmap_irq_get_domain(irq_data); + + ret = devm_mfd_add_devices(max77705->dev, PLATFORM_DEVID_NONE, + max77705_devs, ARRAY_SIZE(max77705_devs), + NULL, 0, domain); + if (ret) + return dev_err_probe(max77705->dev, ret, "Failed to register child devices\n"); + + device_init_wakeup(max77705->dev, true); + + return 0; +} + +static int max77705_suspend(struct device *dev) +{ + struct i2c_client *i2c = to_i2c_client(dev); + struct max77693_dev *max77705 = i2c_get_clientdata(i2c); + + disable_irq(max77705->irq); + + if (device_may_wakeup(dev)) + enable_irq_wake(max77705->irq); + + return 0; +} + +static int max77705_resume(struct device *dev) +{ + struct i2c_client *i2c = to_i2c_client(dev); + struct max77693_dev *max77705 = i2c_get_clientdata(i2c); + + if (device_may_wakeup(dev)) + disable_irq_wake(max77705->irq); + + enable_irq(max77705->irq); + + return 0; +} +DEFINE_SIMPLE_DEV_PM_OPS(max77705_pm_ops, max77705_suspend, max77705_resume); + +static const struct of_device_id max77705_i2c_of_match[] = { + { .compatible = "maxim,max77705" }, + { } +}; +MODULE_DEVICE_TABLE(of, max77705_i2c_of_match); + +static struct i2c_driver max77705_i2c_driver = { + .driver = { + .name = "max77705", + .of_match_table = max77705_i2c_of_match, + .pm = pm_sleep_ptr(&max77705_pm_ops), + .suppress_bind_attrs = true, + }, + .probe = max77705_i2c_probe +}; +module_i2c_driver(max77705_i2c_driver); + +MODULE_DESCRIPTION("Maxim MAX77705 PMIC core driver"); +MODULE_AUTHOR("Dzmitry Sankouski "); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/max77693-common.h b/include/linux/mfd/max77693-common.h index a5bce099f1ed..ec2e1b2dceb8 100644 --- a/include/linux/mfd/max77693-common.h +++ b/include/linux/mfd/max77693-common.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Common data shared between Maxim 77693 and 77843 drivers + * Common data shared between Maxim 77693, 77705 and 77843 drivers * * Copyright (C) 2015 Samsung Electronics */ @@ -11,6 +11,7 @@ enum max77693_types { TYPE_MAX77693_UNKNOWN, TYPE_MAX77693, + TYPE_MAX77705, TYPE_MAX77843, TYPE_MAX77693_NUM, @@ -32,6 +33,7 @@ struct max77693_dev { struct regmap *regmap_muic; struct regmap *regmap_haptic; /* Only MAX77693 */ struct regmap *regmap_chg; /* Only MAX77843 */ + struct regmap *regmap_leds; /* Only MAX77705 */ struct regmap_irq_chip_data *irq_data_led; struct regmap_irq_chip_data *irq_data_topsys; diff --git a/include/linux/mfd/max77705-private.h b/include/linux/mfd/max77705-private.h new file mode 100644 index 000000000000..e4309d3b6f2a --- /dev/null +++ b/include/linux/mfd/max77705-private.h @@ -0,0 +1,178 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Maxim MAX77705 definitions. + * + * Copyright (C) 2015 Samsung Electronics, Inc. + * Copyright (C) 2024 Dzmitry Sankouski + */ + +#ifndef __LINUX_MFD_MAX77705_PRIV_H +#define __LINUX_MFD_MAX77705_PRIV_H + +#define MAX77705_SRC_IRQ_CHG BIT(0) +#define MAX77705_SRC_IRQ_TOP BIT(1) +#define MAX77705_SRC_IRQ_FG BIT(2) +#define MAX77705_SRC_IRQ_USBC BIT(3) +#define MAX77705_SRC_IRQ_ALL (MAX77705_SRC_IRQ_CHG | MAX77705_SRC_IRQ_TOP | \ + MAX77705_SRC_IRQ_FG | MAX77705_SRC_IRQ_USBC) + +/* MAX77705_PMIC_REG_PMICREV register */ +#define MAX77705_VERSION_SHIFT 3 +#define MAX77705_REVISION_MASK GENMASK(2, 0) +#define MAX77705_VERSION_MASK GENMASK(7, MAX77705_VERSION_SHIFT) +/* MAX77705_PMIC_REG_MAINCTRL1 register */ +#define MAX77705_MAINCTRL1_BIASEN_SHIFT 7 +#define MAX77705_MAINCTRL1_BIASEN_MASK BIT(MAX77705_MAINCTRL1_BIASEN_SHIFT) +/* MAX77705_PMIC_REG_MCONFIG2 (haptics) register */ +#define MAX77705_CONFIG2_MEN_SHIFT 6 +#define MAX77705_CONFIG2_MODE_SHIFT 7 +#define MAX77705_CONFIG2_HTYP_SHIFT 5 +/* MAX77705_PMIC_REG_SYSTEM_INT_MASK register */ +#define MAX77705_SYSTEM_IRQ_BSTEN_INT BIT(3) +#define MAX77705_SYSTEM_IRQ_SYSUVLO_INT BIT(4) +#define MAX77705_SYSTEM_IRQ_SYSOVLO_INT BIT(5) +#define MAX77705_SYSTEM_IRQ_TSHDN_INT BIT(6) +#define MAX77705_SYSTEM_IRQ_TM_INT BIT(7) + +enum max77705_hw_rev { + MAX77705_PASS1 = 1, + MAX77705_PASS2, + MAX77705_PASS3 +}; + +enum max77705_reg { + MAX77705_PMIC_REG_PMICID1 = 0x00, + MAX77705_PMIC_REG_PMICREV = 0x01, + MAX77705_PMIC_REG_MAINCTRL1 = 0x02, + MAX77705_PMIC_REG_BSTOUT_MASK = 0x03, + MAX77705_PMIC_REG_FORCE_EN_MASK = 0x08, + MAX77705_PMIC_REG_MCONFIG = 0x10, + MAX77705_PMIC_REG_MCONFIG2 = 0x11, + MAX77705_PMIC_REG_INTSRC = 0x22, + MAX77705_PMIC_REG_INTSRC_MASK = 0x23, + MAX77705_PMIC_REG_SYSTEM_INT = 0x24, + MAX77705_PMIC_REG_RESERVED_25 = 0x25, + MAX77705_PMIC_REG_SYSTEM_INT_MASK = 0x26, + MAX77705_PMIC_REG_RESERVED_27 = 0x27, + MAX77705_PMIC_REG_RESERVED_28 = 0x28, + MAX77705_PMIC_REG_RESERVED_29 = 0x29, + MAX77705_PMIC_REG_BOOSTCONTROL1 = 0x4C, + MAX77705_PMIC_REG_BOOSTCONTROL2 = 0x4F, + MAX77705_PMIC_REG_SW_RESET = 0x50, + MAX77705_PMIC_REG_USBC_RESET = 0x51, + + MAX77705_PMIC_REG_END +}; + +enum max77705_chg_reg { + MAX77705_CHG_REG_BASE = 0xB0, + MAX77705_CHG_REG_INT = 0, + MAX77705_CHG_REG_INT_MASK, + MAX77705_CHG_REG_INT_OK, + MAX77705_CHG_REG_DETAILS_00, + MAX77705_CHG_REG_DETAILS_01, + MAX77705_CHG_REG_DETAILS_02, + MAX77705_CHG_REG_DTLS_03, + MAX77705_CHG_REG_CNFG_00, + MAX77705_CHG_REG_CNFG_01, + MAX77705_CHG_REG_CNFG_02, + MAX77705_CHG_REG_CNFG_03, + MAX77705_CHG_REG_CNFG_04, + MAX77705_CHG_REG_CNFG_05, + MAX77705_CHG_REG_CNFG_06, + MAX77705_CHG_REG_CNFG_07, + MAX77705_CHG_REG_CNFG_08, + MAX77705_CHG_REG_CNFG_09, + MAX77705_CHG_REG_CNFG_10, + MAX77705_CHG_REG_CNFG_11, + + MAX77705_CHG_REG_CNFG_12, + MAX77705_CHG_REG_CNFG_13, + MAX77705_CHG_REG_CNFG_14, + MAX77705_CHG_REG_SAFEOUT_CTRL +}; + +enum max77705_fuelgauge_reg { + STATUS_REG = 0x00, + VALRT_THRESHOLD_REG = 0x01, + TALRT_THRESHOLD_REG = 0x02, + SALRT_THRESHOLD_REG = 0x03, + REMCAP_REP_REG = 0x05, + SOCREP_REG = 0x06, + TEMPERATURE_REG = 0x08, + VCELL_REG = 0x09, + TIME_TO_EMPTY_REG = 0x11, + FULLSOCTHR_REG = 0x13, + CURRENT_REG = 0x0A, + AVG_CURRENT_REG = 0x0B, + SOCMIX_REG = 0x0D, + SOCAV_REG = 0x0E, + REMCAP_MIX_REG = 0x0F, + FULLCAP_REG = 0x10, + RFAST_REG = 0x15, + AVR_TEMPERATURE_REG = 0x16, + CYCLES_REG = 0x17, + DESIGNCAP_REG = 0x18, + AVR_VCELL_REG = 0x19, + TIME_TO_FULL_REG = 0x20, + CONFIG_REG = 0x1D, + ICHGTERM_REG = 0x1E, + REMCAP_AV_REG = 0x1F, + FULLCAP_NOM_REG = 0x23, + LEARN_CFG_REG = 0x28, + FILTER_CFG_REG = 0x29, + MISCCFG_REG = 0x2B, + QRTABLE20_REG = 0x32, + FULLCAP_REP_REG = 0x35, + RCOMP_REG = 0x38, + VEMPTY_REG = 0x3A, + FSTAT_REG = 0x3D, + DISCHARGE_THRESHOLD_REG = 0x40, + QRTABLE30_REG = 0x42, + ISYS_REG = 0x43, + DQACC_REG = 0x45, + DPACC_REG = 0x46, + AVGISYS_REG = 0x4B, + QH_REG = 0x4D, + VSYS_REG = 0xB1, + TALRTTH2_REG = 0xB2, + VBYP_REG = 0xB3, + CONFIG2_REG = 0xBB, + IIN_REG = 0xD0, + OCV_REG = 0xEE, + VFOCV_REG = 0xFB, + VFSOC_REG = 0xFF, + + MAX77705_FG_END +}; + +enum max77705_led_reg { + MAX77705_RGBLED_REG_BASE = 0x30, + MAX77705_RGBLED_REG_LEDEN = 0, + MAX77705_RGBLED_REG_LED0BRT, + MAX77705_RGBLED_REG_LED1BRT, + MAX77705_RGBLED_REG_LED2BRT, + MAX77705_RGBLED_REG_LED3BRT, + MAX77705_RGBLED_REG_LEDRMP, + MAX77705_RGBLED_REG_LEDBLNK, + MAX77705_LED_REG_END +}; + +enum max77705_charger_battery_state { + MAX77705_BATTERY_NOBAT, + MAX77705_BATTERY_PREQUALIFICATION, + MAX77705_BATTERY_DEAD, + MAX77705_BATTERY_GOOD, + MAX77705_BATTERY_LOWVOLTAGE, + MAX77705_BATTERY_OVERVOLTAGE, + MAX77705_BATTERY_RESERVED +}; + +enum max77705_charger_charge_type { + MAX77705_CHARGER_CONSTANT_CURRENT = 1, + MAX77705_CHARGER_CONSTANT_VOLTAGE, + MAX77705_CHARGER_END_OF_CHARGE, + MAX77705_CHARGER_DONE +}; + +#endif /* __LINUX_MFD_MAX77705_PRIV_H */ From patchwork Wed Jan 8 14:13:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dzmitry Sankouski X-Patchwork-Id: 855868 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 1AC751FECD4; Wed, 8 Jan 2025 14:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345663; cv=none; b=MWgYuoGHT87BjVpokO6wXpfCoIG+Kjw3kUHTkHl9iJgu2MkoyiCN06a7nctPHgk4RUxAdgfWn2ShOHCOFpokIfrNiLGMImEkYXG4uQUkdK3ysLpiTe3iEQXjKF4mwDcpwFsBltwX6L7dZvSLJEerku5nQoMAOEqgNVfcMYiVLHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736345663; c=relaxed/simple; bh=8tiL9gYxosgDGJy5CegOZ2k8C1ERDVZ0anDBBusV6lo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DPzGSL8ZOHBhTfk94K3rzYBToAs7ufGENu1fzMp7A+pLrWwbW9MZH+/n0JZoGUdsaor0ifuilPE5ij1JmXW3pzYMl895dD0RnD++BiuYu4pGq9AuGOshoQfHRt/eh6xMzLJJ4mmln1Sa05cvL1HWeTqHMzgn1GjkZFcd2IBwLSQ= 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=BI/i1Pt+; arc=none smtp.client-ip=209.85.218.43 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="BI/i1Pt+" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aaeecbb7309so517595766b.0; Wed, 08 Jan 2025 06:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736345656; x=1736950456; 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=AFNHeHsI4W8KDDXKoBZPMpG1EACtJr6dX29X+XrkhzM=; b=BI/i1Pt+XNrBWoeexQzKYBqEI3Km5jZIRh47lv2fVOFXqaGXMSOzDjm3kKlM4U1Wqj /u219Nb2qYFUd8dQNEbpPgQKnsSUTwFqzus5S8aeW/0MlQWUkxOrDX2KOyw0qza8QUHL 3AlKgQyPEpfPi6Jr57UXyu77dcSzGN8hmaBJYLzvPeZE1XaBu1bqzUGJi1liA3OKRjwL aKowsLWrQTMZMeykxFLUP+ZpTX/gzpDakoyZjrOruC2c9OOYQ43UXp1Va+MhB1z0zQly 5zt19vgTmVE4IGYz7BCoOetrI3dge4sLtmrrUdU9u7xDzsHhlqvK/qVJXoeUrzwI7ouH lfvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736345656; x=1736950456; 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=AFNHeHsI4W8KDDXKoBZPMpG1EACtJr6dX29X+XrkhzM=; b=lJdAcwOXWFRdclXuwYlLKG0zASHjqD2YVY+1EvkyaxYJO7UkUFtJAF/uaSFYMzCvQR hwynbNuZuTnC1ssDSqM2DZD06AI6pjSXA+OQzz9Z38czBFVSsn8HMACOmIfm6Nq2frU+ Uj1sl16Z+lt2EAQD7fpKYflkajM0WxOOWois07Z/isPkkMr3qeZhVIg7212RU/FIAO+r IqfF4UU56SQGISj9h25VugYbJHE1kM0LGMw7CHRrl+57GX3+3mx+P08fPRWh/c46BuG8 /Z5+tBRvn2L8GSkmeplDltUNQzdYZBQal1uflxolQOoKbe2dP+dsCnvEFmYRaICKJXly wFYg== X-Forwarded-Encrypted: i=1; AJvYcCVjRjNHIjux8ogOGOCGwjkBy4aVM+uJyTeRuSbt9fMGlOCSAlfjE/mZT7eDd9PytNeph7DGPtOmn9I/@vger.kernel.org, AJvYcCWFTvRs4i99qKb/k/w6s7GQ2RDGQjOsP1UTbgfoU9CDAN+MIr/Q+WogLxUh1Pj2KkSMalBMggT03hkIX0zR@vger.kernel.org, AJvYcCWGKOFjV5a+ooGpgnUwwusqajUurF0OEjLayxhw0gg7m0IjG4ITjdcrXrAvrtM2PPnh8UZj3R03tt3wINw=@vger.kernel.org, AJvYcCXdIFMmoWIIHTnPg9eRlbdla9g+zjz0joAbDAl5fyl3/4vmoqnjiDJHTCmqoYEBcb9CxYnVDYmpnGEW/g==@vger.kernel.org X-Gm-Message-State: AOJu0YwzETHkf0N8/3pd16LEEs0pg/Ext0Rr/zyqngW1/nFenpApnBBP zLj+qB70/isWsNAzh7W967QZsEJMa8Aaqtrh/T+yTtxTaV60AYqR X-Gm-Gg: ASbGncscETTJQFaCalu1oPbJ4+1g+N+vARWoIZvJU+XKOwbuX0kjU68On1lykXw2SFz 4IoOiQAtOwkVAJaFj+BUJcwP6HUs/9ru93TfyrKwnwn2isf2ipXzu87LpuQ83OZlWGyiME2WY1x VyOVvXRYynEOZrrKNyyVJdhONmc+PpAeaFNu3sq2GyghNf1xk2DujTK5k2oRiVCoEBiuly/Lp35 ry1KZ6YBQOrzpJc61n3PsZOMLl39uKZYsjd5yVRD+zFMSXsYFLcI+Pq0bZsvbqYKJKZrQz5uIg9 0FNwFHup/UZsv4nZZaTAg0HgAQ== X-Google-Smtp-Source: AGHT+IEzSX1lQhwRH/FMUCi09g2t0wBsvJ4BxxnOugLWzrylG5cuApHzYRjaAJ6x5y3ET+pU/5eB5w== X-Received: by 2002:a17:907:1c22:b0:aa6:80fa:f692 with SMTP id a640c23a62f3a-ab2abcb0a84mr263044666b.49.1736345655988; Wed, 08 Jan 2025 06:14:15 -0800 (PST) Received: from [127.0.1.1] (nat6-minsk-pool-46-53-210-232.telecom.by. [46.53.210.232]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-aac0efe4941sm2500562666b.95.2025.01.08.06.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:14:15 -0800 (PST) From: Dzmitry Sankouski Date: Wed, 08 Jan 2025 17:13:53 +0300 Subject: [PATCH v14 09/10] input: max77693: add max77705 haptic support Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250108-starqltechn_integration_upstream-v14-9-f6e84ec20d96@gmail.com> References: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> In-Reply-To: <20250108-starqltechn_integration_upstream-v14-0-f6e84ec20d96@gmail.com> To: Sebastian Reichel , Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Dmitry Torokhov , Pavel Machek , Hans de Goede , Marek Szyprowski , Sebastian Krzyszkowiak , Purism Kernel Team , Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736345640; l=4280; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=8tiL9gYxosgDGJy5CegOZ2k8C1ERDVZ0anDBBusV6lo=; b=7/GEzX57OzrPukTfTeIpYZV028IETUWDB+wwFFVGbTYiCyijhx67orgEIpdYKZfNi5SU6D45s sRGIB2rdgwsCvvVke0gScl94IID7+IP+HD//9iSq+lTzTW9Tt6AuU12 X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add support for haptic controller on MAX77705 Multifunction device. This driver supports external pwm and LRA (Linear Resonant Actuator) motor. User can control the haptic device via force feedback framework. Acked-by: Dmitry Torokhov Signed-off-by: Dzmitry Sankouski --- Changes in v4: - add max77705 haptic support to max77693 driver - delete max77705-haptic --- drivers/input/misc/Kconfig | 4 ++-- drivers/input/misc/Makefile | 1 + drivers/input/misc/max77693-haptic.c | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 13d135257e06..b9db5abcde08 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -241,11 +241,11 @@ config INPUT_MAX77650_ONKEY config INPUT_MAX77693_HAPTIC tristate "MAXIM MAX77693/MAX77843 haptic controller support" - depends on (MFD_MAX77693 || MFD_MAX77843) && PWM + depends on (MFD_MAX77693 || MFD_MAX77705 || MFD_MAX77843) && PWM select INPUT_FF_MEMLESS help This option enables support for the haptic controller on - MAXIM MAX77693 and MAX77843 chips. + MAXIM MAX77693, MAX77705 and MAX77843 chips. To compile this driver as module, choose M here: the module will be called max77693-haptic. diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index 6d91804d0a6f..e70164dd73c2 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o obj-$(CONFIG_INPUT_MAX77650_ONKEY) += max77650-onkey.o obj-$(CONFIG_INPUT_MAX77693_HAPTIC) += max77693-haptic.o +obj-$(CONFIG_INPUT_MAX77705_HAPTIC) += max77705-haptic.o obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o obj-$(CONFIG_INPUT_MAX8997_HAPTIC) += max8997_haptic.o obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c index 0e646f1b257b..c3b9d33608d7 100644 --- a/drivers/input/misc/max77693-haptic.c +++ b/drivers/input/misc/max77693-haptic.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #define MAX_MAGNITUDE_SHIFT 16 @@ -115,6 +116,13 @@ static int max77693_haptic_configure(struct max77693_haptic *haptic, MAX77693_HAPTIC_PWM_DIVISOR_128); config_reg = MAX77693_HAPTIC_REG_CONFIG2; break; + case TYPE_MAX77705: + value = ((haptic->type << MAX77693_CONFIG2_MODE) | + (enable << MAX77693_CONFIG2_MEN) | + (haptic->mode << MAX77693_CONFIG2_HTYP) | + MAX77693_HAPTIC_PWM_DIVISOR_128); + config_reg = MAX77705_PMIC_REG_MCONFIG; + break; case TYPE_MAX77843: value = (haptic->type << MCONFIG_MODE_SHIFT) | (enable << MCONFIG_MEN_SHIFT) | @@ -312,6 +320,9 @@ static int max77693_haptic_probe(struct platform_device *pdev) case TYPE_MAX77693: haptic->regmap_haptic = max77693->regmap_haptic; break; + case TYPE_MAX77705: + haptic->regmap_haptic = max77693->regmap; + break; case TYPE_MAX77843: haptic->regmap_haptic = max77693->regmap; break; @@ -407,6 +418,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, static const struct platform_device_id max77693_haptic_id[] = { { "max77693-haptic", }, + { "max77705-haptic", }, { "max77843-haptic", }, {}, }; @@ -414,6 +426,7 @@ MODULE_DEVICE_TABLE(platform, max77693_haptic_id); static const struct of_device_id of_max77693_haptic_dt_match[] = { { .compatible = "maxim,max77693-haptic", }, + { .compatible = "maxim,max77705-haptic", }, { .compatible = "maxim,max77843-haptic", }, { /* sentinel */ }, }; @@ -432,5 +445,5 @@ module_platform_driver(max77693_haptic_driver); MODULE_AUTHOR("Jaewon Kim "); MODULE_AUTHOR("Krzysztof Kozlowski "); -MODULE_DESCRIPTION("MAXIM 77693/77843 Haptic driver"); +MODULE_DESCRIPTION("MAXIM 77693/77705/77843 Haptic driver"); MODULE_LICENSE("GPL");