From patchwork Fri Oct 18 08:10:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841390 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 C7969D2F7E1 for ; Fri, 18 Oct 2024 08:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V/zn5scuA4cBnjeDcZDLfq+bKDyVI2Q6beFukEjg47s=; b=sYTJtm4+j7FDvN8A0O5CTIp+Mw SivyQxSsMavv1JEa/u5sJCDt5q4H5mnV01Xywmr0KeMIOEMlka2oWadumnKDG4Orh5GDWJ+z96s0U r8O0dy5hisnetkac5xxNQ7Oqq8qu6iVNQL//xWClbgNbilGrTSxfBp3VJJjEZyO6ccniePYrZQY0S 2uTMZQGucXIFFQrbLVACT9CLR21DJTNsWj51GZt5tapmbi09MJwtqK9DS9eR4buEj6tXbqv8MHr/+ 4Lw/N5XwKauhcnfcbeIHNN++sLQAxYem+tTkUBSWDcrxHp/nuL8qbba8nkL4zub6pNG8TQT+Mssrs qYNCJpog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iMQ-0000000HXfm-37Qk; Fri, 18 Oct 2024 08:29:26 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5I-0000000HSQ4-3X9p; Fri, 18 Oct 2024 08:11:46 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a9a4031f69fso244612466b.0; Fri, 18 Oct 2024 01:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239103; x=1729843903; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V/zn5scuA4cBnjeDcZDLfq+bKDyVI2Q6beFukEjg47s=; b=Jr9RkkR1UMzpav8A93SckzmpsKk+bNiha+KdQcJX1PJhXqFpqLBOtzg79VnJloOIJm xQfXfwcF49O8uFxSseY3fe8lE82Ua1E2fCgaa9yXpBRZqikCq05gZnYVqBli0txDdqEb v/rlRJUQ7SBjCPLs00Qjnbzu3vPAZ0CeP4E/Nlgkzt+B5qojW6RjNP39kTaM6xzjsfUF 27ovpde7QW/ApFdGwbWHVp28KFPvnsi9w+8PGAb+4BUuo6BgIxpeacHzLwvxDivP2pnT 9k+rrGAI7vun/LLR+GBVPNYTs2ayjsF/CdusG8e/ahWGSVEYiwVv9QPmDN8NmjsNH34t iP+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239103; x=1729843903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V/zn5scuA4cBnjeDcZDLfq+bKDyVI2Q6beFukEjg47s=; b=sBFyr+GheBXvJacNeAg/XPcI68gG7u0cQD4z5F5kiZ3Dx3dYOTyw45doWJEV56byuc HiWPeGa8bMlPmK/wZx42JBKY2gfbfAjw1qURjyYDMu/WdVaaKSz5S6nzxVI4M+39I0Yo ys4R64IEUsDGC5IpXNRfk5l0IdHLcTwKwmhGEwe/OqPrGakijgJqaHX6tQeqr2AY9jQL aFgeX/pk6uv8k0U38ijgw74d10nzmIrL9k+P6r/C9bhwztVkr7bNQU4/2trReXTZuqLd UcBWsPkH16d6rGQnn7s3eiNI90y+ArwsRkRNZUOrsKkYXMCIaXVkiKSeX2+ga3oPjzyP H8fQ== X-Forwarded-Encrypted: i=1; AJvYcCVSHNE0O2b/HSQXX8U30UwgGnB6d7GWyVkCFrfJmKCuP6xBv751iC8BuV0YKHiujSWfurLGDNV4HzRvuT9mMQA=@lists.infradead.org, AJvYcCVhgG/+ctK5rF6x5LFewEHfkBjI14S8WCbJDVvelz7DeAJl1CcGKiKvG3LY91JtdK8ATNZAVF+nEF0Uf2/IecVd@lists.infradead.org X-Gm-Message-State: AOJu0Yxx9eAOw6uw514YpQMTo5H6YJ6CwWmXGR3DaguVyxDKY+ayTPCv ZFKVqhQ4azgkAFfluSbLxR15bUjX2V5lt6FjnSmBw9vDd7u0h22Ji9cIBetA X-Google-Smtp-Source: AGHT+IEJndJ7T4QgNQNyzgKQM38xfv83GpmaPCAjcHMYMqbxlqndRz6v+yB2Ezb0u8Tsr5rWSpM9Wg== X-Received: by 2002:a17:906:d551:b0:a9a:13dd:2734 with SMTP id a640c23a62f3a-a9a69bb59acmr139359666b.36.1729239102699; Fri, 18 Oct 2024 01:11:42 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:11:42 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/6] dt-bindings: mediatek: pwrap: Add MT6735 compatible Date: Fri, 18 Oct 2024 11:10:43 +0300 Message-ID: <20241018081050.23592-2-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011144_952110_11CDF80F X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. 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: Yassine Oudjana Add a compatible string for MT6735 PMIC wrapper. Signed-off-by: Yassine Oudjana Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml index 4737e5f45d541..d5965dd38df0e 100644 --- a/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml @@ -31,6 +31,7 @@ properties: - items: - enum: - mediatek,mt2701-pwrap + - mediatek,mt6735-pwrap - mediatek,mt6765-pwrap - mediatek,mt6779-pwrap - mediatek,mt6795-pwrap From patchwork Fri Oct 18 08:10:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841391 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 17651D2127B for ; Fri, 18 Oct 2024 08:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ApvJO6d5QNNF3xPCBagvaYSTGXu+2K2cOSJlqV2xdXM=; b=Y2LcYFZDZdVBM/nEA3cCV4+jG/ AAeiO5KUTCUoNoilEp9OueuO9v5abTUpB1mLoJHG+hyr9Q/4Q/uhg18px3fCrOl+DZTAq2V5cjVB6 h/pz/nQLG604QpsyQpAKV9xDsJzD/psBmHRUysJhJ3nE1HZ7mrXgQcmPe59ytpe+IzezMtvfBLDBM 8wYs14pZ5q2Gvw0Ugv/KEBWyqGQLLnXqdcELoBxhieeCfB9+9PYnIsaVigR7Obh4+Ir2CM8qjXO9L nlyJ3ICoSU2gPxjjf84MOf9W4SCTT2n3Z+Kl+Fl4HyR+6+08PBw1D1C3f+Tzw5JD9a3V/e8m4DIlP BkAHr8nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iNt-0000000HY9p-3Bci; Fri, 18 Oct 2024 08:30:57 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5L-0000000HSRm-37fB; Fri, 18 Oct 2024 08:11:49 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c94c4ad9d8so2546036a12.2; Fri, 18 Oct 2024 01:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239106; x=1729843906; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ApvJO6d5QNNF3xPCBagvaYSTGXu+2K2cOSJlqV2xdXM=; b=OAN/7YIW9kMa+WAEWJZNtyw1a7m6kQN1LYIj1yEhqemzUVaB8XYAiFDaADsLWucKGE N71RKNhfTOEBQeWxU4+08yax5ZA//XHuNmy2TW9D1z/WA3CiQJ5k3wwFJc7eSxZcC9g8 reemsj681LE00HHMNqbNqu6ffG8xdc5V57ZaCTrPKNL5ra1QblrrWPU9xjmU94vrN6Hk h687frdPNbO6brL5k5g39OgbH9//qmjd2B30q+Tt1iA4hBnsFCavcSMTjyW6HB/UZ2xI FYf9ahHLapEGdoXzrCC0bTs9ZIowy8SDQ1pilHg8R2PZUsTt5uO0Fe016fOiazWOtMxD a9iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239106; x=1729843906; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ApvJO6d5QNNF3xPCBagvaYSTGXu+2K2cOSJlqV2xdXM=; b=DDgRhfk0BBAHpEaJHAkB/5uA/acMtaGkpBLUvGvRxxtZzD/EGyVB/5NWuGZF0pyFDY bFvXqkNfzP/8jxScrOk6CBVt1R8ugK13ujAA1J+viKyNiWjgXJF4N35UMWEuGxTIeg/7 KKFeXxuRySRj3YxkrM6VF86J8eQ1NOscxCKrURhNMq6ZoKuaNN1vesbWbMkfGPyZUyUO LxMTURHI7LnciipJNXQVvqlAC0cqq5iZn3qtiU8wt/fhA1XDfucKGVB6cd56IAXosiCP Lwo7wXP/dj2IUO7cmVVb5gVautX4dy/Ny0LJmTDLa47xfS7dPlENZxPGRvKbylDK0Su/ jMlg== X-Forwarded-Encrypted: i=1; AJvYcCUXhGb6sI0EPn2nPTwXkzaPWU7kvf7dCjCRtIB47RAQq/4qQXwsry9Fu6YqsILrMiNwDqd8a8GpPCtVBw/Wdis=@lists.infradead.org, AJvYcCWqBw54h8CSw8jUHbRfd9Yhd5i2ZM8zyhrjJpfLDzXB1lVV1CF4JO4sLT/ikJNzsBxggp+3bYskMfX56xUKkAOG@lists.infradead.org X-Gm-Message-State: AOJu0Yyxh1j8bRfeX07h4oBHbQ1aazaslHhkAlTkg19Xmj9YBUpDDEm6 kLau5WQvodS8cxEDzWgaHD4Wr3S6Z5oJyXIf3s77v05UEYVyQlYP X-Google-Smtp-Source: AGHT+IHpgy+ZvIS+CmXt9F8h8DxgTe7oDeEKUVy4LrsM1AJZIkYp9J3mz10ihMJQWs5+U1Tp5bM3GA== X-Received: by 2002:a17:906:478b:b0:a9a:3705:9ad9 with SMTP id a640c23a62f3a-a9a69c98d93mr129677466b.50.1729239105439; Fri, 18 Oct 2024 01:11:45 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:11:44 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/6] dt-bindings: mfd: mediatek: mt6397: Add bindings for MT6328 Date: Fri, 18 Oct 2024 11:10:44 +0300 Message-ID: <20241018081050.23592-3-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011147_814287_8B718A49 X-CRM114-Status: GOOD ( 10.40 ) 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: Yassine Oudjana Add compatible strings for the MT6328 PMIC. Signed-off-by: Yassine Oudjana Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml | 1 + Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml index 466566ae7f103..6a0e66fba53c4 100644 --- a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml @@ -25,6 +25,7 @@ properties: compatible: enum: - mediatek,mt6323-keys + - mediatek,mt6328-keys - mediatek,mt6331-keys - mediatek,mt6357-keys - mediatek,mt6358-keys diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml index 95e9566fc535d..224b9b1bd629d 100644 --- a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml @@ -35,6 +35,7 @@ properties: - enum: - mediatek,mt6323 - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332. + - mediatek,mt6328 - mediatek,mt6358 - mediatek,mt6359 - mediatek,mt6397 @@ -85,6 +86,7 @@ properties: oneOf: - enum: - mediatek,mt6323-regulator + - mediatek,mt6328-regulator - mediatek,mt6358-regulator - mediatek,mt6397-regulator - items: From patchwork Fri Oct 18 08:10:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841397 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 09FB2D2127B for ; Fri, 18 Oct 2024 08:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sGPuJ1DPbJWD/7aGIkg0kCrcVRwzs5u7uPTAqdlyYD8=; b=n/im6/Vhfy8gaGbDaQWtkRWxNL iZjAKm3SRfmMiPSAEGRkAs5vvDehLsh7UWQpSfoKtJ6tZLB/Qvtte7OCBktPlvSPXl+akH07iUWYg XNMFM2MzNuaCyw3DbEEgbYO+NssWJ6xaW9j/ZdYGA9FazzWVutiG8FLj/QEAsH5JcmxKsUMOseXaU nDZj1eW9HwD/37mF4txyIwPl2LkkmJONWSsc2cHT4ZQOlcp2mCIKAwNFZpp5NFlmHB+NNRe8cxBXM 8k9tKIPRoQbnlQvlydmKN4AuNLtRLhTXfFx6k7H1gj3RTLIpPkaCBqFCpfe2iEFO4e4GfCfvOtO5Q 22WRjCcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iPK-0000000HYWL-0Isd; Fri, 18 Oct 2024 08:32:26 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5P-0000000HSTB-20NB; Fri, 18 Oct 2024 08:11:52 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a9a2cdc6f0cso222204166b.2; Fri, 18 Oct 2024 01:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239109; x=1729843909; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sGPuJ1DPbJWD/7aGIkg0kCrcVRwzs5u7uPTAqdlyYD8=; b=Z9igJ0hcS4hn5k/uZGUTYepiMoiYjzt6ijjT25LtVP2hA4yS3IB95epEAC4NUpMBEj lzShW8CK7dJbj2uCKBS6EUsiteN0Daf3AI7Q2R9bJXSiED1ts0L8mjQ7X/4PDzahNJhq C1kMayhkLhQ49WUi0XNHgSb43GZsZYo8Rq1FkUWUQaVf0Z5p3pxCtwrskA5hlEYXJACv g2rV5AeBL08HgOAV4ZEo5kqCUlqi08ZYZARCq+Hd3bXwxKrN5ao6n+JFQ+QrjJpimm4U cb7l0tqK4pLuaR7a2LaRfqV23cB5PhCoFy0/FKo+RNjCahijr8+QvBWIWpaMkga6M/WM js9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239109; x=1729843909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sGPuJ1DPbJWD/7aGIkg0kCrcVRwzs5u7uPTAqdlyYD8=; b=SRRM048q/TOjP93du+S4FyeZRf9ZcN0sfKXnS+wJg8bdoXqTC8wjYYdoks2JUubzIn NhK7Ey9cvGsFgPUrF4p/pRQUF/Q3opwWunALJhcYjMbjNUJhscuIC6JOMraMr7mJTiFZ e0yngLIdbVjK3A8m5U/QUE1eJeNb8ATiIVncG8GP0WC508vBv89hbVrKQ8v3VnvpY+TM kdOTK5TrF6M/te0wB7ZBc3r3OoCupQpVH1LCVYjq8UREoVX5kYYXB6kU5LHxaqFo5yNT Je/YCAA5+kptwWU/VDF59ceYpCavERyl6JdiWLeSujIjLz6+62sBWHCG12opQpOhpr7a y5lQ== X-Forwarded-Encrypted: i=1; AJvYcCUHrLCL7g9JJsA99VUb7ajDZJb1gYrF2N8BaBOuIL/xI3nR4wQHT9k24Axq7wU9N1abevlQ8vrhEL1nD9KVFi0=@lists.infradead.org, AJvYcCWQFs0YeVnsrYaliaR2jxiYGFZR/U/+60ecBGfbTVZCZPSr3T3aPK72Jv4OXHU7IBc/v1Y/S1TpEpm4Fh8apP2U@lists.infradead.org X-Gm-Message-State: AOJu0Yypm9QPSM0LSisvlGMu7ZBX+vDHsAemdgmUjkZbMpkDHoKU0p6p hQTV43X3bkirGIXQ6WR0/8N+L/ryFmDH99NueS6emipJj7OWQD+1 X-Google-Smtp-Source: AGHT+IEqArqZjw0J6kyMM1EXu/gNsYMUNc/6DPGCzeEwzKw/XdRllF7sK5ixpgM51HOP4jp7jmy1bQ== X-Received: by 2002:a17:907:97d5:b0:a99:ee83:2b19 with SMTP id a640c23a62f3a-a9a69bab048mr127321366b.35.1729239109233; Fri, 18 Oct 2024 01:11:49 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:11:48 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/6] soc: mediatek: pwrap: Add support for MT6735 and MT6328 SoC/PMIC pair Date: Fri, 18 Oct 2024 11:10:45 +0300 Message-ID: <20241018081050.23592-4-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011151_552815_3890BBC8 X-CRM114-Status: GOOD ( 17.83 ) 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: Yassine Oudjana Add register definitions and configuration for the MT6735 SoC and the MT6328 PMIC which are commonly paired and communicate through the PMIC wrapper. Note that the PMIC wrapper on MT6735M has a slightly different register map and is therefore NOT compatible with MT6735. Signed-off-by: Yassine Oudjana --- drivers/soc/mediatek/mtk-pmic-wrap.c | 251 ++++++++++++++++++++++++++- 1 file changed, 248 insertions(+), 3 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 9fdc0ef792026..b9e8dd2a5999d 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -3,6 +3,7 @@ * Copyright (c) 2014 MediaTek Inc. * Author: Flora Fu, MediaTek */ + #include #include #include @@ -100,7 +101,7 @@ enum dew_regs { PWRAP_DEW_CIPHER_MODE, PWRAP_DEW_CIPHER_SWRST, - /* MT6323 only regs */ + /* MT6323 and MT6328 only regs */ PWRAP_DEW_CIPHER_EN, PWRAP_DEW_RDDMY_NO, @@ -121,8 +122,10 @@ enum dew_regs { PWRAP_RG_SPI_CON13, PWRAP_SPISLV_KEY, - /* MT6359 only regs */ + /* MT6359 and MT6328 only regs */ PWRAP_DEW_CRC_SWRST, + + /* MT6359 only regs */ PWRAP_DEW_RG_EN_RECORD, PWRAP_DEW_RECORD_CMD0, PWRAP_DEW_RECORD_CMD1, @@ -171,6 +174,23 @@ static const u32 mt6323_regs[] = { [PWRAP_DEW_RDDMY_NO] = 0x01a4, }; +static const u32 mt6328_regs[] = { + [PWRAP_DEW_DIO_EN] = 0x02d4, + [PWRAP_DEW_READ_TEST] = 0x02d6, + [PWRAP_DEW_WRITE_TEST] = 0x02d8, + [PWRAP_DEW_CRC_SWRST] = 0x02da, + [PWRAP_DEW_CRC_EN] = 0x02dc, + [PWRAP_DEW_CRC_VAL] = 0x02de, + [PWRAP_DEW_MON_GRP_SEL] = 0x02e0, + [PWRAP_DEW_CIPHER_KEY_SEL] = 0x02e2, + [PWRAP_DEW_CIPHER_IV_SEL] = 0x02e4, + [PWRAP_DEW_CIPHER_EN] = 0x02e6, + [PWRAP_DEW_CIPHER_RDY] = 0x02e8, + [PWRAP_DEW_CIPHER_MODE] = 0x02ea, + [PWRAP_DEW_CIPHER_SWRST] = 0x02ec, + [PWRAP_DEW_RDDMY_NO] = 0x02ee, +}; + static const u32 mt6331_regs[] = { [PWRAP_DEW_DIO_EN] = 0x018c, [PWRAP_DEW_READ_TEST] = 0x018e, @@ -394,7 +414,7 @@ enum pwrap_regs { PWRAP_ADC_RDATA_ADDR1, PWRAP_ADC_RDATA_ADDR2, - /* MT7622 only regs */ + /* MT7622 and MT6735 only regs */ PWRAP_STA, PWRAP_CLR, PWRAP_DVFS_ADR8, @@ -417,6 +437,8 @@ enum pwrap_regs { PWRAP_ADC_RDATA_ADDR, PWRAP_GPS_STA, PWRAP_SW_RST, + + /* MT7622 only regs */ PWRAP_DVFS_STEP_CTRL0, PWRAP_DVFS_STEP_CTRL1, PWRAP_DVFS_STEP_CTRL2, @@ -481,6 +503,50 @@ enum pwrap_regs { /* MT8516 only regs */ PWRAP_OP_TYPE, PWRAP_MSB_FIRST, + + /* MT6735 only regs */ + PWRAP_WACS3_EN, + PWRAP_INIT_DONE3, + PWRAP_WACS3_CMD, + PWRAP_WACS3_RDATA, + PWRAP_WACS3_VLDCLR, + PWRAP_MD_ADC_RDATA_ADDR_LATEST, + PWRAP_MD_ADC_RDATA_ADDR_WP, + PWRAP_MD_ADC_RDATA_ADDR_R0, + PWRAP_MD_ADC_RDATA_ADDR_R1, + PWRAP_MD_ADC_RDATA_ADDR_R2, + PWRAP_MD_ADC_RDATA_ADDR_R3, + PWRAP_MD_ADC_RDATA_ADDR_R4, + PWRAP_MD_ADC_RDATA_ADDR_R5, + PWRAP_MD_ADC_RDATA_ADDR_R6, + PWRAP_MD_ADC_RDATA_ADDR_R7, + PWRAP_MD_ADC_RDATA_ADDR_R8, + PWRAP_MD_ADC_RDATA_ADDR_R9, + PWRAP_MD_ADC_RDATA_ADDR_R10, + PWRAP_MD_ADC_RDATA_ADDR_R11, + PWRAP_MD_ADC_RDATA_ADDR_R12, + PWRAP_MD_ADC_RDATA_ADDR_R13, + PWRAP_MD_ADC_RDATA_ADDR_R14, + PWRAP_MD_ADC_RDATA_ADDR_R15, + PWRAP_MD_ADC_RDATA_ADDR_R16, + PWRAP_MD_ADC_RDATA_ADDR_R17, + PWRAP_MD_ADC_RDATA_ADDR_R18, + PWRAP_MD_ADC_RDATA_ADDR_R19, + PWRAP_MD_ADC_RDATA_ADDR_R20, + PWRAP_MD_ADC_RDATA_ADDR_R21, + PWRAP_MD_ADC_RDATA_ADDR_R22, + PWRAP_MD_ADC_RDATA_ADDR_R23, + PWRAP_MD_ADC_RDATA_ADDR_R24, + PWRAP_MD_ADC_RDATA_ADDR_R25, + PWRAP_MD_ADC_RDATA_ADDR_R26, + PWRAP_MD_ADC_RDATA_ADDR_R27, + PWRAP_MD_ADC_RDATA_ADDR_R28, + PWRAP_MD_ADC_RDATA_ADDR_R29, + PWRAP_MD_ADC_RDATA_ADDR_R30, + PWRAP_MD_ADC_RDATA_ADDR_R31, + PWRAP_MD_ADC_STA0, + PWRAP_MD_ADC_STA1, + PWRAP_MD_ADC_STA2, }; static const int mt2701_regs[] = { @@ -569,6 +635,156 @@ static const int mt2701_regs[] = { [PWRAP_ADC_RDATA_ADDR2] = 0x154, }; +static const int mt6735_regs[] = { + [PWRAP_MUX_SEL] = 0x0, + [PWRAP_WRAP_EN] = 0x4, + [PWRAP_DIO_EN] = 0x8, + [PWRAP_SIDLY] = 0xc, + [PWRAP_RDDMY] = 0x10, + [PWRAP_SI_CK_CON] = 0x14, + [PWRAP_CSHEXT_WRITE] = 0x18, + [PWRAP_CSHEXT_READ] = 0x1c, + [PWRAP_CSLEXT_START] = 0x20, + [PWRAP_CSLEXT_END] = 0x24, + [PWRAP_STAUPD_PRD] = 0x28, + [PWRAP_STAUPD_GRPEN] = 0x2c, + [PWRAP_EINT_STA0_ADR] = 0x30, + [PWRAP_EINT_STA1_ADR] = 0x34, + [PWRAP_STA] = 0x38, + [PWRAP_CLR] = 0x3c, + [PWRAP_STAUPD_MAN_TRIG] = 0x40, + [PWRAP_STAUPD_STA] = 0x44, + [PWRAP_WRAP_STA] = 0x48, + [PWRAP_HARB_INIT] = 0x4c, + [PWRAP_HARB_HPRIO] = 0x50, + [PWRAP_HIPRIO_ARB_EN] = 0x54, + [PWRAP_HARB_STA0] = 0x58, + [PWRAP_HARB_STA1] = 0x5c, + [PWRAP_MAN_EN] = 0x60, + [PWRAP_MAN_CMD] = 0x64, + [PWRAP_MAN_RDATA] = 0x68, + [PWRAP_MAN_VLDCLR] = 0x6c, + [PWRAP_WACS0_EN] = 0x70, + [PWRAP_INIT_DONE0] = 0x74, + [PWRAP_WACS0_CMD] = 0x78, + [PWRAP_WACS0_RDATA] = 0x7c, + [PWRAP_WACS0_VLDCLR] = 0x80, + [PWRAP_WACS1_EN] = 0x84, + [PWRAP_INIT_DONE1] = 0x88, + [PWRAP_WACS1_CMD] = 0x8c, + [PWRAP_WACS1_RDATA] = 0x90, + [PWRAP_WACS1_VLDCLR] = 0x94, + [PWRAP_WACS2_EN] = 0x98, + [PWRAP_INIT_DONE2] = 0x9c, + [PWRAP_WACS2_CMD] = 0xa0, + [PWRAP_WACS2_RDATA] = 0xa4, + [PWRAP_WACS2_VLDCLR] = 0xa8, + [PWRAP_WACS3_EN] = 0xac, + [PWRAP_INIT_DONE3] = 0xb0, + [PWRAP_WACS3_CMD] = 0xb4, + [PWRAP_WACS3_RDATA] = 0xb8, + [PWRAP_WACS3_VLDCLR] = 0xbc, + [PWRAP_INT_EN] = 0xc0, + [PWRAP_INT_FLG_RAW] = 0xc4, + [PWRAP_INT_FLG] = 0xc8, + [PWRAP_INT_CLR] = 0xcc, + [PWRAP_SIG_ADR] = 0xd0, + [PWRAP_SIG_MODE] = 0xd4, + [PWRAP_SIG_VALUE] = 0xd8, + [PWRAP_SIG_ERRVAL] = 0xdc, + [PWRAP_CRC_EN] = 0xe0, + [PWRAP_TIMER_EN] = 0xe4, + [PWRAP_TIMER_STA] = 0xe8, + [PWRAP_WDT_UNIT] = 0xec, + [PWRAP_WDT_SRC_EN] = 0xf0, + [PWRAP_WDT_FLG] = 0xf4, + [PWRAP_DEBUG_INT_SEL] = 0xf8, + [PWRAP_DVFS_ADR0] = 0xfc, + [PWRAP_DVFS_WDATA0] = 0x100, + [PWRAP_DVFS_ADR1] = 0x104, + [PWRAP_DVFS_WDATA1] = 0x108, + [PWRAP_DVFS_ADR2] = 0x10c, + [PWRAP_DVFS_WDATA2] = 0x110, + [PWRAP_DVFS_ADR3] = 0x114, + [PWRAP_DVFS_WDATA3] = 0x118, + [PWRAP_DVFS_ADR4] = 0x11c, + [PWRAP_DVFS_WDATA4] = 0x120, + [PWRAP_DVFS_ADR5] = 0x124, + [PWRAP_DVFS_WDATA5] = 0x128, + [PWRAP_DVFS_ADR6] = 0x12c, + [PWRAP_DVFS_WDATA6] = 0x130, + [PWRAP_DVFS_ADR7] = 0x134, + [PWRAP_DVFS_WDATA7] = 0x138, + [PWRAP_DVFS_ADR8] = 0x13c, + [PWRAP_DVFS_WDATA8] = 0x140, + [PWRAP_DVFS_ADR9] = 0x144, + [PWRAP_DVFS_WDATA9] = 0x148, + [PWRAP_DVFS_ADR10] = 0x14c, + [PWRAP_DVFS_WDATA10] = 0x150, + [PWRAP_DVFS_ADR11] = 0x154, + [PWRAP_DVFS_WDATA11] = 0x158, + [PWRAP_DVFS_ADR12] = 0x15c, + [PWRAP_DVFS_WDATA12] = 0x160, + [PWRAP_DVFS_ADR13] = 0x164, + [PWRAP_DVFS_WDATA13] = 0x168, + [PWRAP_DVFS_ADR14] = 0x16c, + [PWRAP_DVFS_WDATA14] = 0x170, + [PWRAP_DVFS_ADR15] = 0x174, + [PWRAP_DVFS_WDATA15] = 0x178, + [PWRAP_SPMINF_STA] = 0x17c, + [PWRAP_CIPHER_KEY_SEL] = 0x180, + [PWRAP_CIPHER_IV_SEL] = 0x184, + [PWRAP_CIPHER_EN] = 0x188, + [PWRAP_CIPHER_RDY] = 0x18c, + [PWRAP_CIPHER_MODE] = 0x190, + [PWRAP_CIPHER_SWRST] = 0x194, + [PWRAP_DCM_EN] = 0x198, + [PWRAP_DCM_DBC_PRD] = 0x19c, + [PWRAP_EXT_CK] = 0x1a0, + [PWRAP_ADC_CMD_ADDR] = 0x1a4, + [PWRAP_PWRAP_ADC_CMD] = 0x1a8, + [PWRAP_ADC_RDATA_ADDR] = 0x1ac, + [PWRAP_GPS_STA] = 0x1b0, + [PWRAP_SW_RST] = 0x1b4, + [PWRAP_MD_ADC_RDATA_ADDR_LATEST] = 0x1b8, + [PWRAP_MD_ADC_RDATA_ADDR_WP] = 0x1bc, + [PWRAP_MD_ADC_RDATA_ADDR_R0] = 0x1c0, + [PWRAP_MD_ADC_RDATA_ADDR_R1] = 0x1c4, + [PWRAP_MD_ADC_RDATA_ADDR_R2] = 0x1c8, + [PWRAP_MD_ADC_RDATA_ADDR_R3] = 0x1cc, + [PWRAP_MD_ADC_RDATA_ADDR_R4] = 0x1d0, + [PWRAP_MD_ADC_RDATA_ADDR_R5] = 0x1d4, + [PWRAP_MD_ADC_RDATA_ADDR_R6] = 0x1d8, + [PWRAP_MD_ADC_RDATA_ADDR_R7] = 0x1dc, + [PWRAP_MD_ADC_RDATA_ADDR_R8] = 0x1e0, + [PWRAP_MD_ADC_RDATA_ADDR_R9] = 0x1e4, + [PWRAP_MD_ADC_RDATA_ADDR_R10] = 0x1e8, + [PWRAP_MD_ADC_RDATA_ADDR_R11] = 0x1ec, + [PWRAP_MD_ADC_RDATA_ADDR_R12] = 0x1f0, + [PWRAP_MD_ADC_RDATA_ADDR_R13] = 0x1f4, + [PWRAP_MD_ADC_RDATA_ADDR_R14] = 0x1f8, + [PWRAP_MD_ADC_RDATA_ADDR_R15] = 0x1fc, + [PWRAP_MD_ADC_RDATA_ADDR_R16] = 0x200, + [PWRAP_MD_ADC_RDATA_ADDR_R17] = 0x204, + [PWRAP_MD_ADC_RDATA_ADDR_R18] = 0x208, + [PWRAP_MD_ADC_RDATA_ADDR_R19] = 0x20c, + [PWRAP_MD_ADC_RDATA_ADDR_R20] = 0x210, + [PWRAP_MD_ADC_RDATA_ADDR_R21] = 0x214, + [PWRAP_MD_ADC_RDATA_ADDR_R22] = 0x218, + [PWRAP_MD_ADC_RDATA_ADDR_R23] = 0x21c, + [PWRAP_MD_ADC_RDATA_ADDR_R24] = 0x220, + [PWRAP_MD_ADC_RDATA_ADDR_R25] = 0x224, + [PWRAP_MD_ADC_RDATA_ADDR_R26] = 0x228, + [PWRAP_MD_ADC_RDATA_ADDR_R27] = 0x22c, + [PWRAP_MD_ADC_RDATA_ADDR_R28] = 0x230, + [PWRAP_MD_ADC_RDATA_ADDR_R29] = 0x234, + [PWRAP_MD_ADC_RDATA_ADDR_R30] = 0x238, + [PWRAP_MD_ADC_RDATA_ADDR_R31] = 0x23c, + [PWRAP_MD_ADC_STA0] = 0x240, + [PWRAP_MD_ADC_STA1] = 0x244, + [PWRAP_MD_ADC_STA2] = 0x248, +}; + static const int mt6765_regs[] = { [PWRAP_MUX_SEL] = 0x0, [PWRAP_WRAP_EN] = 0x4, @@ -1302,6 +1518,7 @@ static const int mt8186_regs[] = { enum pmic_type { PMIC_MT6323, + PMIC_MT6328, PMIC_MT6331, PMIC_MT6332, PMIC_MT6351, @@ -1314,6 +1531,7 @@ enum pmic_type { enum pwrap_type { PWRAP_MT2701, + PWRAP_MT6735, PWRAP_MT6765, PWRAP_MT6779, PWRAP_MT6795, @@ -1733,6 +1951,10 @@ static void pwrap_init_chip_select_ext(struct pmic_wrapper *wrp, u8 hext_write, static int pwrap_common_init_reg_clock(struct pmic_wrapper *wrp) { switch (wrp->master->type) { + case PWRAP_MT6735: + pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_RDDMY_NO], 0x8); + pwrap_init_chip_select_ext(wrp, 0, 6, 0, 0); + break; case PWRAP_MT6795: if (wrp->slave->type == PMIC_MT6331) { const u32 *dew_regs = wrp->slave->dew_regs; @@ -1839,6 +2061,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) pwrap_writel(wrp, 1, PWRAP_CIPHER_START); break; case PWRAP_MT2701: + case PWRAP_MT6735: case PWRAP_MT6765: case PWRAP_MT6779: case PWRAP_MT6795: @@ -2194,6 +2417,14 @@ static const struct pwrap_slv_type pmic_mt6323 = { PWRAP_SLV_CAP_SECURITY, }; +static const struct pwrap_slv_type pmic_mt6328 = { + .dew_regs = mt6328_regs, + .type = PMIC_MT6328, + .regops = &pwrap_regops16, + .caps = PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO | + PWRAP_SLV_CAP_SECURITY, +}; + static const struct pwrap_slv_type pmic_mt6331 = { .dew_regs = mt6331_regs, .type = PMIC_MT6331, @@ -2249,6 +2480,7 @@ static const struct pwrap_slv_type pmic_mt6397 = { static const struct of_device_id of_slave_match_tbl[] = { { .compatible = "mediatek,mt6323", .data = &pmic_mt6323 }, + { .compatible = "mediatek,mt6328", .data = &pmic_mt6328 }, { .compatible = "mediatek,mt6331", .data = &pmic_mt6331 }, { .compatible = "mediatek,mt6351", .data = &pmic_mt6351 }, { .compatible = "mediatek,mt6357", .data = &pmic_mt6357 }, @@ -2277,6 +2509,18 @@ static const struct pmic_wrapper_type pwrap_mt2701 = { .init_soc_specific = pwrap_mt2701_init_soc_specific, }; +static const struct pmic_wrapper_type pwrap_mt6735 = { + .regs = mt6735_regs, + .type = PWRAP_MT6735, + .arb_en_all = GENMASK(9, 0), + .int_en_all = GENMASK(31, 0), + .spi_w = PWRAP_MAN_CMD_SPI_WRITE, + .wdt_src = PWRAP_WDT_SRC_MASK_ALL, + .caps = PWRAP_CAP_RESET | PWRAP_CAP_DCM, + .init_reg_clock = pwrap_common_init_reg_clock, + .init_soc_specific = NULL, +}; + static const struct pmic_wrapper_type pwrap_mt6765 = { .regs = mt6765_regs, .type = PWRAP_MT6765, @@ -2446,6 +2690,7 @@ static const struct pmic_wrapper_type pwrap_mt8186 = { static const struct of_device_id of_pwrap_match_tbl[] = { { .compatible = "mediatek,mt2701-pwrap", .data = &pwrap_mt2701 }, + { .compatible = "mediatek,mt6735-pwrap", .data = &pwrap_mt6735 }, { .compatible = "mediatek,mt6765-pwrap", .data = &pwrap_mt6765 }, { .compatible = "mediatek,mt6779-pwrap", .data = &pwrap_mt6779 }, { .compatible = "mediatek,mt6795-pwrap", .data = &pwrap_mt6795 }, From patchwork Fri Oct 18 08:10:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841398 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 3B9F7D2F7E8 for ; Fri, 18 Oct 2024 08:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nGuP/zFFlYXQUzOuZtnRn+KPD+Bw2sRLFfQgZRN9r+Y=; b=0vkQU4mMSLGkFUe17CTGgtv9gI 10rPkueX46rhX86YG1tVCf7zUcaegR0Lkl7n1Ty9+TgOgn3r7QPIf4hZDycsNLvwJYygpXM2FQgtf IZKWUuFVrcq0kOh2tSpciVwm9wtJJsZVKP14FUhFsPM63jT1UL9TvWjntwf5KVAdU7YKoZWaY+Qdr fsfJDryOLiarR0cWWVLPxoAByk2Zen7Qe/oabJ+3e0oR4VbOHAmVTc6BlZ9AHdPdazuNfTgeTi0hZ idqRhao3jb13mWetajGoqbgXhukkab9gsuEKMyWNrI3p6msgCUBEaERsIUgikR3UgN/tOcJuUU5ZN aKAyHO6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iQk-0000000HYxf-3pT1; Fri, 18 Oct 2024 08:33:54 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5U-0000000HSUB-1rxb; Fri, 18 Oct 2024 08:12:00 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5c9362c26d8so4833231a12.1; Fri, 18 Oct 2024 01:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239114; x=1729843914; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nGuP/zFFlYXQUzOuZtnRn+KPD+Bw2sRLFfQgZRN9r+Y=; b=ULjEwlEDpNeoBrexr4+0XUL1y8HzQlaZpiBSa/Z4/vWRfCqMVAmKqdSmrPQxltbj0T Nt8LYavrXnZkAQdaYduxhPs4d1g35Wvie3gF85kXFs/kHC0MGkrwlV3IJokmNKX4de7V Cy8mleTarIsOUiPr7KVG6hZew9xqQRMc6Ri3c6HTKKNU8QEXSbj5QrmMAmYLJ+ebBozr W4P0eY3Z3jRInXXGEzuOcEZUBqSqIak8pT/LQnfr9CIsDJTCaJ2k1u02JDqCZa2m3ne/ FS+4PA8fqoLw596tASVgdW0Ef06OH2Gu98iilPfClYS3AFXbW8KwU2Z8BoJ0AsU5ymPR M+VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239114; x=1729843914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nGuP/zFFlYXQUzOuZtnRn+KPD+Bw2sRLFfQgZRN9r+Y=; b=OWzpNlsFvUyDuG7kgjmXj8qH82auJKqAo4k1qVtuErBOmThV0xBWvM57fyDwzySyYO khwi8i281vda74trY/XNP00rmHQBHF3Gw655J0yKcT5npbekxvt7/2GeKnSDhqKsFizm BHpn2V7gxvalnRIgWVymffaEPN6UsibD6fi8QnNYruiLcFP1jfVE0Gxy0m7GXTOUOjm4 hcfI2Ki+4J0HJxPZxA3J0R5urAZqfUqLwdrk+Qc+jE84Y3ehxJ18XJcX+lTRDuNfZYUf TtEk0/LwXl+BMmTk8ArcU4z2ydPx2u5sD2xdr/7Hul6wzTe1dlpoPkiBD8Mdjh0+azou qNjg== X-Forwarded-Encrypted: i=1; AJvYcCXNdzLsiVhPLOSoTpBhsrOooVmClk3C18xJnguLLAt/IKsJBbBtw/c9+MBqjVFoJ3WPOeGVXOOQ3aDJwiqFT3o=@lists.infradead.org, AJvYcCXh85ReQJ68K0dDfJXDD5IaVNS3EVg419RrGrLGRu7nhDsU6yCt0/LN/F/nDahpBGhG9g7/NrXX85dJ3uvMAsFa@lists.infradead.org X-Gm-Message-State: AOJu0Yy4H5ffN3zt/N56d+7D+R7gTXXwDOKg6oOGkoKPdXf9mEA01R2N JqREwEqCn6YAAB0MBLAmLFfSjn48XT/4pkBtRj0AxhV1Jqi0Q4bV X-Google-Smtp-Source: AGHT+IGuXstOUhIY9MV+s0a3H9vsO5nY5Z++nPMX1di7ADLC09jJCv7DSEApf/erhwO8cj5Jf+Ng1A== X-Received: by 2002:a17:907:7f03:b0:a9a:139:c3de with SMTP id a640c23a62f3a-a9a4cc58156mr608381166b.29.1729239114017; Fri, 18 Oct 2024 01:11:54 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:11:52 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/6] mfd: mt6397: Add initial support for MT6328 Date: Fri, 18 Oct 2024 11:10:46 +0300 Message-ID: <20241018081050.23592-5-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011156_820740_B768B746 X-CRM114-Status: GOOD ( 20.89 ) 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: Yassine Oudjana The MT6328 PMIC is commonly used with the MT6735 SoC. Add initial support for this PMIC. Signed-off-by: Yassine Oudjana Reviewed-by: AngeloGioacchino Del Regno --- drivers/mfd/mt6397-core.c | 32 ++ drivers/mfd/mt6397-irq.c | 23 + include/linux/mfd/mt6328/core.h | 53 ++ include/linux/mfd/mt6328/registers.h | 822 +++++++++++++++++++++++++++ include/linux/mfd/mt6397/core.h | 11 +- 5 files changed, 936 insertions(+), 5 deletions(-) create mode 100644 include/linux/mfd/mt6328/core.h create mode 100644 include/linux/mfd/mt6328/registers.h diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index c2939e785818f..0e5d59ae064a6 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -13,12 +13,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -87,6 +89,13 @@ static const struct resource mt6323_keys_resources[] = { DEFINE_RES_IRQ_NAMED(MT6323_IRQ_STATUS_FCHRKEY, "homekey"), }; +static const struct resource mt6328_keys_resources[] = { + DEFINE_RES_IRQ_NAMED(MT6328_IRQ_STATUS_PWRKEY, "powerkey"), + DEFINE_RES_IRQ_NAMED(MT6328_IRQ_STATUS_HOMEKEY, "homekey"), + DEFINE_RES_IRQ_NAMED(MT6328_IRQ_STATUS_PWRKEY_R, "powerkey_r"), + DEFINE_RES_IRQ_NAMED(MT6328_IRQ_STATUS_HOMEKEY_R, "homekey_r"), +}; + static const struct resource mt6357_keys_resources[] = { DEFINE_RES_IRQ_NAMED(MT6357_IRQ_PWRKEY, "powerkey"), DEFINE_RES_IRQ_NAMED(MT6357_IRQ_HOMEKEY, "homekey"), @@ -133,6 +142,18 @@ static const struct mfd_cell mt6323_devs[] = { }, }; +static const struct mfd_cell mt6328_devs[] = { + { + .name = "mt6328-regulator", + .of_compatible = "mediatek,mt6328-regulator" + }, { + .name = "mtk-pmic-keys", + .num_resources = ARRAY_SIZE(mt6328_keys_resources), + .resources = mt6328_keys_resources, + .of_compatible = "mediatek,mt6328-keys" + }, +}; + static const struct mfd_cell mt6357_devs[] = { { .name = "mt6359-auxadc", @@ -262,6 +283,14 @@ static const struct chip_data mt6323_core = { .irq_init = mt6397_irq_init, }; +static const struct chip_data mt6328_core = { + .cid_addr = MT6328_HWCID, + .cid_shift = 0, + .cells = mt6328_devs, + .cell_size = ARRAY_SIZE(mt6328_devs), + .irq_init = mt6397_irq_init, +}; + static const struct chip_data mt6357_core = { .cid_addr = MT6357_SWCID, .cid_shift = 8, @@ -360,6 +389,9 @@ static const struct of_device_id mt6397_of_match[] = { { .compatible = "mediatek,mt6323", .data = &mt6323_core, + }, { + .compatible = "mediatek,mt6328", + .data = &mt6328_core, }, { .compatible = "mediatek,mt6331", .data = &mt6331_mt6332_core, diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c index 886745b5b607c..1310665200ede 100644 --- a/drivers/mfd/mt6397-irq.c +++ b/drivers/mfd/mt6397-irq.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -31,6 +33,9 @@ static void mt6397_irq_sync_unlock(struct irq_data *data) mt6397->irq_masks_cur[0]); regmap_write(mt6397->regmap, mt6397->int_con[1], mt6397->irq_masks_cur[1]); + if (mt6397->int_con[2]) + regmap_write(mt6397->regmap, mt6397->int_con[2], + mt6397->irq_masks_cur[2]); mutex_unlock(&mt6397->irqlock); } @@ -105,6 +110,8 @@ static irqreturn_t mt6397_irq_thread(int irq, void *data) mt6397_irq_handle_reg(mt6397, mt6397->int_status[0], 0); mt6397_irq_handle_reg(mt6397, mt6397->int_status[1], 16); + if (mt6397->int_status[2]) + mt6397_irq_handle_reg(mt6397, mt6397->int_status[2], 32); return IRQ_HANDLED; } @@ -138,6 +145,9 @@ static int mt6397_irq_pm_notifier(struct notifier_block *notifier, chip->int_con[0], chip->wake_mask[0]); regmap_write(chip->regmap, chip->int_con[1], chip->wake_mask[1]); + if (chip->int_con[2]) + regmap_write(chip->regmap, + chip->int_con[2], chip->wake_mask[2]); enable_irq_wake(chip->irq); break; @@ -146,6 +156,9 @@ static int mt6397_irq_pm_notifier(struct notifier_block *notifier, chip->int_con[0], chip->irq_masks_cur[0]); regmap_write(chip->regmap, chip->int_con[1], chip->irq_masks_cur[1]); + if (chip->int_con[2]) + regmap_write(chip->regmap, + chip->int_con[2], chip->irq_masks_cur[2]); disable_irq_wake(chip->irq); break; @@ -169,6 +182,14 @@ int mt6397_irq_init(struct mt6397_chip *chip) chip->int_status[0] = MT6323_INT_STATUS0; chip->int_status[1] = MT6323_INT_STATUS1; break; + case MT6328_CHIP_ID: + chip->int_con[0] = MT6328_INT_CON0; + chip->int_con[1] = MT6328_INT_CON1; + chip->int_con[2] = MT6328_INT_CON2; + chip->int_status[0] = MT6328_INT_STATUS0; + chip->int_status[1] = MT6328_INT_STATUS1; + chip->int_status[2] = MT6328_INT_STATUS2; + break; case MT6331_CHIP_ID: chip->int_con[0] = MT6331_INT_CON0; chip->int_con[1] = MT6331_INT_CON1; @@ -191,6 +212,8 @@ int mt6397_irq_init(struct mt6397_chip *chip) /* Mask all interrupt sources */ regmap_write(chip->regmap, chip->int_con[0], 0x0); regmap_write(chip->regmap, chip->int_con[1], 0x0); + if (chip->int_con[2]) + regmap_write(chip->regmap, chip->int_con[2], 0x0); chip->pm_nb.notifier_call = mt6397_irq_pm_notifier; chip->irq_domain = irq_domain_add_linear(chip->dev->of_node, diff --git a/include/linux/mfd/mt6328/core.h b/include/linux/mfd/mt6328/core.h new file mode 100644 index 0000000000000..9a08aed72b9fd --- /dev/null +++ b/include/linux/mfd/mt6328/core.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2015 MediaTek Inc. + * Copyright (c) 2022 Yassine Oudjana + */ + +#ifndef __MFD_MT6328_CORE_H__ +#define __MFD_MT6328_CORE_H__ + +enum mt6328_irq_status_numbers { + MT6328_IRQ_STATUS_PWRKEY = 0, + MT6328_IRQ_STATUS_HOMEKEY, + MT6328_IRQ_STATUS_PWRKEY_R, + MT6328_IRQ_STATUS_HOMEKEY_R, + MT6328_IRQ_STATUS_THR_H, + MT6328_IRQ_STATUS_THR_L, + MT6328_IRQ_STATUS_BAT_H, + MT6328_IRQ_STATUS_BAT_L, + MT6328_IRQ_STATUS_RTC, + MT6328_IRQ_STATUS_AUDIO, + MT6328_IRQ_STATUS_ACCDET, + MT6328_IRQ_STATUS_ACCDET_EINT, + MT6328_IRQ_STATUS_ACCDET_NEGV, + MT6328_IRQ_STATUS_NI_LBAT_INT, + MT6328_IRQ_STATUS_VPROC_OC = 16, + MT6328_IRQ_STATUS_VSYS_OC, + MT6328_IRQ_STATUS_VLTE_OC, + MT6328_IRQ_STATUS_VCORE_OC, + MT6328_IRQ_STATUS_VPA_OC, + MT6328_IRQ_STATUS_LDO_OC, + MT6328_IRQ_STATUS_BAT2_H, + MT6328_IRQ_STATUS_BAT2_L, + MT6328_IRQ_STATUS_VISMPS0_H, + MT6328_IRQ_STATUS_VISMPS0_L, + MT6328_IRQ_STATUS_AUXADC_IMP, + MT6328_IRQ_STATUS_OV = 32, + MT6328_IRQ_STATUS_BVALID_DET, + MT6328_IRQ_STATUS_VBATON_HV, + MT6328_IRQ_STATUS_VBATON_UNDET, + MT6328_IRQ_STATUS_WATCHDOG, + MT6328_IRQ_STATUS_PCHR_CM_VDEC, + MT6328_IRQ_STATUS_CHRDET, + MT6328_IRQ_STATUS_PCHR_CM_VINC, + MT6328_IRQ_STATUS_FG_BAT_H, + MT6328_IRQ_STATUS_FG_BAT_L, + MT6328_IRQ_STATUS_FG_CUR_H, + MT6328_IRQ_STATUS_FG_CUR_L, + MT6328_IRQ_STATUS_FG_ZCV, + MT6328_IRQ_STATUS_SPKL_D, + MT6328_IRQ_STATUS_SPKL_AB, +}; + +#endif /* __MFD_MT6323_CORE_H__ */ diff --git a/include/linux/mfd/mt6328/registers.h b/include/linux/mfd/mt6328/registers.h new file mode 100644 index 0000000000000..8199aaea27b96 --- /dev/null +++ b/include/linux/mfd/mt6328/registers.h @@ -0,0 +1,822 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2022 Yassine Oudjana + */ + +#ifndef __MFD_MT6328_REGISTERS_H__ +#define __MFD_MT6328_REGISTERS_H__ + +/* PMIC Registers */ +#define MT6328_STRUP_CON0 0x0000 +#define MT6328_STRUP_CON2 0x0002 +#define MT6328_STRUP_CON3 0x0004 +#define MT6328_STRUP_CON4 0x0006 +#define MT6328_STRUP_CON5 0x0008 +#define MT6328_STRUP_CON6 0x000a +#define MT6328_STRUP_CON7 0x000c +#define MT6328_STRUP_CON8 0x000e +#define MT6328_STRUP_CON9 0x0010 +#define MT6328_STRUP_CON10 0x0012 +#define MT6328_STRUP_CON11 0x0014 +#define MT6328_STRUP_CON12 0x0016 +#define MT6328_STRUP_CON13 0x0018 +#define MT6328_STRUP_CON14 0x001a +#define MT6328_STRUP_CON15 0x001c +#define MT6328_STRUP_CON16 0x001e +#define MT6328_STRUP_CON17 0x0020 +#define MT6328_STRUP_CON18 0x0022 +#define MT6328_STRUP_CON19 0x0024 +#define MT6328_STRUP_CON20 0x0026 +#define MT6328_STRUP_CON21 0x0028 +#define MT6328_STRUP_CON22 0x002a +#define MT6328_STRUP_CON23 0x002c +#define MT6328_STRUP_CON24 0x002e +#define MT6328_STRUP_CON25 0x0030 +#define MT6328_STRUP_CON26 0x0032 +#define MT6328_STRUP_CON27 0x0034 +#define MT6328_STRUP_CON28 0x0036 +#define MT6328_STRUP_CON29 0x0038 +#define MT6328_STRUP_CON30 0x003a +#define MT6328_STRUP_CON31 0x003c +#define MT6328_STRUP_CON32 0x003e +#define MT6328_STRUP_ANA_CON0 0x0040 +#define MT6328_HWCID 0x0200 +#define MT6328_SWCID 0x0202 +#define MT6328_TOP_CON 0x0204 +#define MT6328_TEST_OUT 0x0206 +#define MT6328_TEST_CON0 0x0208 +#define MT6328_TEST_CON1 0x020a +#define MT6328_TESTMODE_SW 0x020c +#define MT6328_EN_STATUS0 0x020e +#define MT6328_EN_STATUS1 0x0210 +#define MT6328_EN_STATUS2 0x0212 +#define MT6328_OCSTATUS0 0x0214 +#define MT6328_OCSTATUS1 0x0216 +#define MT6328_OCSTATUS2 0x0218 +#define MT6328_PGDEBSTATUS 0x021a +#define MT6328_PGSTATUS 0x021c +#define MT6328_THERMALSTATUS 0x021e +#define MT6328_TOPSTATUS 0x0220 +#define MT6328_TDSEL_CON 0x0222 +#define MT6328_RDSEL_CON 0x0224 +#define MT6328_SMT_CON0 0x0226 +#define MT6328_SMT_CON1 0x0228 +#define MT6328_SMT_CON2 0x022a +#define MT6328_DRV_CON0 0x022c +#define MT6328_DRV_CON1 0x022e +#define MT6328_DRV_CON2 0x0230 +#define MT6328_DRV_CON3 0x0232 +#define MT6328_TOP_STATUS 0x0234 +#define MT6328_TOP_STATUS_SET 0x0236 +#define MT6328_TOP_STATUS_CLR 0x0238 +#define MT6328_RGS_ANA_MON 0x023a +#define MT6328_TOP_CKPDN_CON0 0x023c +#define MT6328_TOP_CKPDN_CON0_SET 0x023e +#define MT6328_TOP_CKPDN_CON0_CLR 0x0240 +#define MT6328_TOP_CKPDN_CON1 0x0242 +#define MT6328_TOP_CKPDN_CON1_SET 0x0244 +#define MT6328_TOP_CKPDN_CON1_CLR 0x0246 +#define MT6328_TOP_CKPDN_CON2 0x0248 +#define MT6328_TOP_CKPDN_CON2_SET 0x024a +#define MT6328_TOP_CKPDN_CON2_CLR 0x024c +#define MT6328_TOP_CKPDN_CON3 0x024e +#define MT6328_TOP_CKPDN_CON3_SET 0x0250 +#define MT6328_TOP_CKPDN_CON3_CLR 0x0252 +#define MT6328_TOP_CKPDN_CON4 0x0254 +#define MT6328_TOP_CKPDN_CON4_SET 0x0256 +#define MT6328_TOP_CKPDN_CON4_CLR 0x0258 +#define MT6328_TOP_CKSEL_CON0 0x025a +#define MT6328_TOP_CKSEL_CON0_SET 0x025c +#define MT6328_TOP_CKSEL_CON0_CLR 0x025e +#define MT6328_TOP_CKSEL_CON1 0x0260 +#define MT6328_TOP_CKSEL_CON1_SET 0x0262 +#define MT6328_TOP_CKSEL_CON1_CLR 0x0264 +#define MT6328_TOP_CKSEL_CON2 0x0266 +#define MT6328_TOP_CKSEL_CON2_SET 0x0268 +#define MT6328_TOP_CKSEL_CON2_CLR 0x026a +#define MT6328_TOP_CKDIVSEL_CON0 0x026c +#define MT6328_TOP_CKDIVSEL_CON0_SET 0x026e +#define MT6328_TOP_CKDIVSEL_CON0_CLR 0x0270 +#define MT6328_TOP_CKDIVSEL_CON1 0x0272 +#define MT6328_TOP_CKDIVSEL_CON1_SET 0x0274 +#define MT6328_TOP_CKDIVSEL_CON1_CLR 0x0276 +#define MT6328_TOP_CKHWEN_CON0 0x0278 +#define MT6328_TOP_CKHWEN_CON0_SET 0x027a +#define MT6328_TOP_CKHWEN_CON0_CLR 0x027c +#define MT6328_TOP_CKHWEN_CON1 0x027e +#define MT6328_TOP_CKHWEN_CON1_SET 0x0280 +#define MT6328_TOP_CKHWEN_CON1_CLR 0x0282 +#define MT6328_TOP_CKTST_CON0 0x0284 +#define MT6328_TOP_CKTST_CON1 0x0286 +#define MT6328_TOP_CKTST_CON2 0x0288 +#define MT6328_TOP_CLKSQ 0x028a +#define MT6328_TOP_CLKSQ_SET 0x028c +#define MT6328_TOP_CLKSQ_CLR 0x028e +#define MT6328_TOP_CLKSQ_RTC 0x0290 +#define MT6328_TOP_CLKSQ_RTC_SET 0x0292 +#define MT6328_TOP_CLKSQ_RTC_CLR 0x0294 +#define MT6328_TOP_CLK_TRIM 0x0296 +#define MT6328_TOP_RST_CON0 0x0298 +#define MT6328_TOP_RST_CON0_SET 0x029a +#define MT6328_TOP_RST_CON0_CLR 0x029c +#define MT6328_TOP_RST_CON1 0x029e +#define MT6328_TOP_RST_MISC 0x02a0 +#define MT6328_TOP_RST_MISC_SET 0x02a2 +#define MT6328_TOP_RST_MISC_CLR 0x02a4 +#define MT6328_TOP_RST_STATUS 0x02a6 +#define MT6328_TOP_RST_STATUS_SET 0x02a8 +#define MT6328_TOP_RST_STATUS_CLR 0x02aa +#define MT6328_INT_CON0 0x02ac +#define MT6328_INT_CON0_SET 0x02ae +#define MT6328_INT_CON0_CLR 0x02b0 +#define MT6328_INT_CON1 0x02b2 +#define MT6328_INT_CON1_SET 0x02b4 +#define MT6328_INT_CON1_CLR 0x02b6 +#define MT6328_INT_CON2 0x02b8 +#define MT6328_INT_CON2_SET 0x02ba +#define MT6328_INT_CON2_CLR 0x02bc +#define MT6328_INT_MISC_CON 0x02be +#define MT6328_INT_MISC_CON_SET 0x02c0 +#define MT6328_INT_MISC_CON_CLR 0x02c2 +#define MT6328_INT_STATUS0 0x02c4 +#define MT6328_INT_STATUS1 0x02c6 +#define MT6328_INT_STATUS2 0x02c8 +#define MT6328_OC_GEAR_0 0x02ca +#define MT6328_FQMTR_CON0 0x02cc +#define MT6328_FQMTR_CON1 0x02ce +#define MT6328_FQMTR_CON2 0x02d0 +#define MT6328_RG_SPI_CON 0x02d2 +#define MT6328_DEW_DIO_EN 0x02d4 +#define MT6328_DEW_READ_TEST 0x02d6 +#define MT6328_DEW_WRITE_TEST 0x02d8 +#define MT6328_DEW_CRC_SWRST 0x02da +#define MT6328_DEW_CRC_EN 0x02dc +#define MT6328_DEW_CRC_VAL 0x02de +#define MT6328_DEW_DBG_MON_SEL 0x02e0 +#define MT6328_DEW_CIPHER_KEY_SEL 0x02e2 +#define MT6328_DEW_CIPHER_IV_SEL 0x02e4 +#define MT6328_DEW_CIPHER_EN 0x02e6 +#define MT6328_DEW_CIPHER_RDY 0x02e8 +#define MT6328_DEW_CIPHER_MODE 0x02ea +#define MT6328_DEW_CIPHER_SWRST 0x02ec +#define MT6328_DEW_RDDMY_NO 0x02ee +#define MT6328_INT_TYPE_CON0 0x02f0 +#define MT6328_INT_TYPE_CON0_SET 0x02f2 +#define MT6328_INT_TYPE_CON0_CLR 0x02f4 +#define MT6328_INT_TYPE_CON1 0x02f6 +#define MT6328_INT_TYPE_CON1_SET 0x02f8 +#define MT6328_INT_TYPE_CON1_CLR 0x02fa +#define MT6328_INT_TYPE_CON2 0x02fc +#define MT6328_INT_TYPE_CON2_SET 0x02fe +#define MT6328_INT_TYPE_CON2_CLR 0x0300 +#define MT6328_INT_STA 0x0302 +#define MT6328_BUCK_ALL_CON0 0x0400 +#define MT6328_BUCK_ALL_CON1 0x0402 +#define MT6328_BUCK_ALL_CON2 0x0404 +#define MT6328_BUCK_ALL_CON3 0x0406 +#define MT6328_BUCK_ALL_CON4 0x0408 +#define MT6328_BUCK_ALL_CON5 0x040a +#define MT6328_BUCK_ALL_CON6 0x040c +#define MT6328_BUCK_ALL_CON9 0x040e +#define MT6328_BUCK_ALL_CON12 0x0410 +#define MT6328_BUCK_ALL_CON13 0x0412 +#define MT6328_BUCK_ALL_CON14 0x0414 +#define MT6328_BUCK_ALL_CON16 0x0416 +#define MT6328_BUCK_ALL_CON18 0x0418 +#define MT6328_BUCK_ALL_CON19 0x041a +#define MT6328_BUCK_ALL_CON20 0x041c +#define MT6328_BUCK_ALL_CON21 0x041e +#define MT6328_BUCK_ALL_CON22 0x0420 +#define MT6328_BUCK_ALL_CON23 0x0422 +#define MT6328_BUCK_ALL_CON24 0x0424 +#define MT6328_BUCK_ALL_CON25 0x0426 +#define MT6328_BUCK_ALL_CON26 0x0428 +#define MT6328_BUCK_ALL_CON27 0x042a +#define MT6328_BUCK_ALL_CON28 0x042c +#define MT6328_SMPS_TOP_ANA_CON0 0x042e +#define MT6328_SMPS_TOP_ANA_CON1 0x0430 +#define MT6328_SMPS_TOP_ANA_CON2 0x0432 +#define MT6328_SMPS_TOP_ANA_CON3 0x0434 +#define MT6328_SMPS_TOP_ANA_CON4 0x0436 +#define MT6328_SMPS_TOP_ANA_CON5 0x0438 +#define MT6328_SMPS_TOP_ANA_CON6 0x043a +#define MT6328_SMPS_TOP_ANA_CON7 0x043c +#define MT6328_SMPS_TOP_ANA_CON8 0x043e +#define MT6328_VCORE_ANA_CON0 0x0440 +#define MT6328_VCORE_ANA_CON1 0x0442 +#define MT6328_VCORE_ANA_CON2 0x0444 +#define MT6328_VCORE_ANA_CON3 0x0446 +#define MT6328_VCORE_ANA_CON4 0x0448 +#define MT6328_VSYS22_ANA_CON0 0x044a +#define MT6328_VSYS22_ANA_CON1 0x044c +#define MT6328_VSYS22_ANA_CON2 0x044e +#define MT6328_VSYS22_ANA_CON3 0x0450 +#define MT6328_VSYS22_ANA_CON4 0x0452 +#define MT6328_VPROC_ANA_CON0 0x0454 +#define MT6328_VPROC_ANA_CON1 0x0456 +#define MT6328_VPROC_ANA_CON2 0x0458 +#define MT6328_VPROC_ANA_CON3 0x045a +#define MT6328_VPROC_ANA_CON4 0x045c +#define MT6328_OSC32_ANA_CON0 0x045e +#define MT6328_OSC32_ANA_CON1 0x0460 +#define MT6328_VPA_ANA_CON0 0x0462 +#define MT6328_VPA_ANA_CON1 0x0464 +#define MT6328_VPA_ANA_CON2 0x0466 +#define MT6328_VPA_ANA_CON3 0x0468 +#define MT6328_VLTE_ANA_CON0 0x046a +#define MT6328_VLTE_ANA_CON1 0x046c +#define MT6328_VLTE_ANA_CON2 0x046e +#define MT6328_VLTE_ANA_CON3 0x0470 +#define MT6328_VLTE_ANA_CON4 0x0472 +#define MT6328_VPROC_CON0 0x0474 +#define MT6328_VPROC_CON1 0x0476 +#define MT6328_VPROC_CON2 0x0478 +#define MT6328_VPROC_CON3 0x047a +#define MT6328_VPROC_CON4 0x047c +#define MT6328_VPROC_CON5 0x047e +#define MT6328_VPROC_CON6 0x0480 +#define MT6328_VPROC_CON7 0x0482 +#define MT6328_VPROC_CON8 0x0484 +#define MT6328_VPROC_CON9 0x0486 +#define MT6328_VPROC_CON10 0x0488 +#define MT6328_VPROC_CON11 0x048a +#define MT6328_VPROC_CON12 0x048c +#define MT6328_VPROC_CON13 0x048e +#define MT6328_VPROC_CON14 0x0490 +#define MT6328_VPROC_CON15 0x0492 +#define MT6328_VPROC_CON16 0x0494 +#define MT6328_VPROC_CON17 0x0496 +#define MT6328_VPROC_CON18 0x0498 +#define MT6328_VPROC_CON19 0x049a +#define MT6328_VSRAM_CON0 0x049c +#define MT6328_VSRAM_CON1 0x049e +#define MT6328_VSRAM_CON2 0x04a0 +#define MT6328_VSRAM_CON3 0x04a2 +#define MT6328_VSRAM_CON4 0x04a4 +#define MT6328_VSRAM_CON5 0x04a6 +#define MT6328_VSRAM_CON6 0x04a8 +#define MT6328_VSRAM_CON7 0x04aa +#define MT6328_VSRAM_CON8 0x04ac +#define MT6328_VSRAM_CON9 0x04ae +#define MT6328_VSRAM_CON10 0x04b0 +#define MT6328_VSRAM_CON11 0x04b2 +#define MT6328_VSRAM_CON12 0x04b4 +#define MT6328_VSRAM_CON13 0x04b6 +#define MT6328_VSRAM_CON14 0x04b8 +#define MT6328_VSRAM_CON15 0x04ba +#define MT6328_VSRAM_CON16 0x04bc +#define MT6328_VSRAM_CON17 0x04be +#define MT6328_VSRAM_CON18 0x04c0 +#define MT6328_VSRAM_CON19 0x04c2 +#define MT6328_VLTE_CON0 0x04c4 +#define MT6328_VLTE_CON1 0x04c6 +#define MT6328_VLTE_CON2 0x04c8 +#define MT6328_VLTE_CON3 0x04ca +#define MT6328_VLTE_CON4 0x04cc +#define MT6328_VLTE_CON5 0x04ce +#define MT6328_VLTE_CON6 0x04d0 +#define MT6328_VLTE_CON7 0x04d2 +#define MT6328_VLTE_CON8 0x04d4 +#define MT6328_VLTE_CON9 0x04d6 +#define MT6328_VLTE_CON10 0x04d8 +#define MT6328_VLTE_CON11 0x04da +#define MT6328_VLTE_CON12 0x04dc +#define MT6328_VLTE_CON13 0x04de +#define MT6328_VLTE_CON14 0x04e0 +#define MT6328_VLTE_CON15 0x04e2 +#define MT6328_VLTE_CON16 0x04e4 +#define MT6328_VLTE_CON17 0x04e6 +#define MT6328_VLTE_CON18 0x04e8 +#define MT6328_VLTE_CON19 0x04ea +#define MT6328_VCORE1_CON0 0x0600 +#define MT6328_VCORE1_CON1 0x0602 +#define MT6328_VCORE1_CON2 0x0604 +#define MT6328_VCORE1_CON3 0x0606 +#define MT6328_VCORE1_CON4 0x0608 +#define MT6328_VCORE1_CON5 0x060a +#define MT6328_VCORE1_CON6 0x060c +#define MT6328_VCORE1_CON7 0x060e +#define MT6328_VCORE1_CON8 0x0610 +#define MT6328_VCORE1_CON9 0x0612 +#define MT6328_VCORE1_CON10 0x0614 +#define MT6328_VCORE1_CON11 0x0616 +#define MT6328_VCORE1_CON12 0x0618 +#define MT6328_VCORE1_CON13 0x061a +#define MT6328_VCORE1_CON14 0x061c +#define MT6328_VCORE1_CON15 0x061e +#define MT6328_VCORE1_CON16 0x0620 +#define MT6328_VCORE1_CON17 0x0622 +#define MT6328_VCORE1_CON18 0x0624 +#define MT6328_VCORE1_CON19 0x0626 +#define MT6328_VSYS22_CON0 0x0628 +#define MT6328_VSYS22_CON1 0x062a +#define MT6328_VSYS22_CON2 0x062c +#define MT6328_VSYS22_CON3 0x062e +#define MT6328_VSYS22_CON4 0x0630 +#define MT6328_VSYS22_CON5 0x0632 +#define MT6328_VSYS22_CON6 0x0634 +#define MT6328_VSYS22_CON7 0x0636 +#define MT6328_VSYS22_CON8 0x0638 +#define MT6328_VSYS22_CON9 0x063a +#define MT6328_VSYS22_CON10 0x063c +#define MT6328_VSYS22_CON11 0x063e +#define MT6328_VSYS22_CON12 0x0640 +#define MT6328_VSYS22_CON13 0x0642 +#define MT6328_VSYS22_CON14 0x0644 +#define MT6328_VSYS22_CON15 0x0646 +#define MT6328_VSYS22_CON16 0x0648 +#define MT6328_VSYS22_CON17 0x064a +#define MT6328_VSYS22_CON18 0x064c +#define MT6328_VSYS22_CON19 0x064e +#define MT6328_VPA_CON0 0x0650 +#define MT6328_VPA_CON1 0x0652 +#define MT6328_VPA_CON2 0x0654 +#define MT6328_VPA_CON3 0x0656 +#define MT6328_VPA_CON4 0x0658 +#define MT6328_VPA_CON5 0x065a +#define MT6328_VPA_CON6 0x065c +#define MT6328_VPA_CON7 0x065e +#define MT6328_VPA_CON8 0x0660 +#define MT6328_VPA_CON9 0x0662 +#define MT6328_VPA_CON10 0x0664 +#define MT6328_VPA_CON11 0x0666 +#define MT6328_VPA_CON12 0x0668 +#define MT6328_VPA_CON13 0x066a +#define MT6328_VPA_CON14 0x066c +#define MT6328_VPA_CON15 0x066e +#define MT6328_VPA_CON16 0x0670 +#define MT6328_VPA_CON17 0x0672 +#define MT6328_VPA_CON18 0x0674 +#define MT6328_VPA_CON19 0x0676 +#define MT6328_VPA_CON20 0x0678 +#define MT6328_VPA_CON21 0x067a +#define MT6328_VPA_CON22 0x067c +#define MT6328_VPA_CON23 0x067e +#define MT6328_VPA_CON24 0x0680 +#define MT6328_BUCK_K_CON0 0x0682 +#define MT6328_BUCK_K_CON1 0x0684 +#define MT6328_BUCK_K_CON2 0x0686 +#define MT6328_BUCK_K_CON3 0x0688 +#define MT6328_ZCD_CON0 0x0800 +#define MT6328_ZCD_CON1 0x0802 +#define MT6328_ZCD_CON2 0x0804 +#define MT6328_ZCD_CON3 0x0806 +#define MT6328_ZCD_CON4 0x0808 +#define MT6328_ZCD_CON5 0x080a +#define MT6328_ISINK0_CON0 0x080c +#define MT6328_ISINK0_CON1 0x080e +#define MT6328_ISINK0_CON2 0x0810 +#define MT6328_ISINK0_CON3 0x0812 +#define MT6328_ISINK1_CON0 0x0814 +#define MT6328_ISINK1_CON1 0x0816 +#define MT6328_ISINK1_CON2 0x0818 +#define MT6328_ISINK1_CON3 0x081a +#define MT6328_ISINK2_CON1 0x081c +#define MT6328_ISINK3_CON1 0x081e +#define MT6328_ISINK_ANA0 0x0820 +#define MT6328_ISINK_ANA1 0x0822 +#define MT6328_ISINK_PHASE_DLY 0x0824 +#define MT6328_ISINK_SFSTR 0x0826 +#define MT6328_ISINK_EN_CTRL 0x0828 +#define MT6328_ISINK_MODE_CTRL 0x082a +#define MT6328_VTCXO_0_CON0 0x0a00 +#define MT6328_VTCXO_1_CON0 0x0a02 +#define MT6328_VAUD28_CON0 0x0a04 +#define MT6328_VAUX18_CON0 0x0a06 +#define MT6328_VRF18_0_CON0 0x0a08 +#define MT6328_VRF18_0_CON1 0x0a0a +#define MT6328_VCAMA_CON0 0x0a0c +#define MT6328_VCN28_CON0 0x0a0e +#define MT6328_VCN33_CON0 0x0a10 +#define MT6328_VCN33_CON1 0x0a12 +#define MT6328_VCN33_CON2 0x0a14 +#define MT6328_VRF18_1_CON0 0x0a16 +#define MT6328_VRF18_1_CON1 0x0a18 +#define MT6328_VUSB33_CON0 0x0a1a +#define MT6328_VMCH_CON0 0x0a1c +#define MT6328_VMCH_CON1 0x0a1e +#define MT6328_VMC_CON0 0x0a20 +#define MT6328_VMC_CON1 0x0a22 +#define MT6328_VEMC_3V3_CON0 0x0a24 +#define MT6328_VEMC_3V3_CON1 0x0a26 +#define MT6328_VIO28_CON0 0x0a28 +#define MT6328_VCAMAF_CON0 0x0a2a +#define MT6328_VGP1_CON0 0x0a2c +#define MT6328_VGP1_CON1 0x0a2e +#define MT6328_VEFUSE_CON0 0x0a30 +#define MT6328_VSIM1_CON0 0x0a32 +#define MT6328_VSIM2_CON0 0x0a34 +#define MT6328_VIO18_CON0 0x0a36 +#define MT6328_VIBR_CON0 0x0a38 +#define MT6328_VCN18_CON0 0x0a3a +#define MT6328_VCAM_CON0 0x0a3c +#define MT6328_VCAMIO_CON0 0x0a3e +#define MT6328_LDO_VSRAM_CON0 0x0a40 +#define MT6328_LDO_VSRAM_CON1 0x0a42 +#define MT6328_VTREF_CON0 0x0a44 +#define MT6328_VM_CON0 0x0a46 +#define MT6328_VM_CON1 0x0a48 +#define MT6328_VRTC_CON0 0x0a4a +#define MT6328_LDO_OCFB0 0x0a4c +#define MT6328_ALDO_ANA_CON0 0x0a4e +#define MT6328_ADLDO_ANA_CON1 0x0a50 +#define MT6328_ADLDO_ANA_CON2 0x0a52 +#define MT6328_ADLDO_ANA_CON3 0x0a54 +#define MT6328_ADLDO_ANA_CON4 0x0a56 +#define MT6328_ADLDO_ANA_CON5 0x0a58 +#define MT6328_ADLDO_ANA_CON6 0x0a5a +#define MT6328_ADLDO_ANA_CON7 0x0a5c +#define MT6328_ADLDO_ANA_CON8 0x0a5e +#define MT6328_ADLDO_ANA_CON9 0x0a60 +#define MT6328_ADLDO_ANA_CON10 0x0a62 +#define MT6328_ADLDO_ANA_CON11 0x0a64 +#define MT6328_ADLDO_ANA_CON12 0x0a66 +#define MT6328_ADLDO_ANA_CON13 0x0a68 +#define MT6328_DLDO_ANA_CON0 0x0a6a +#define MT6328_DLDO_ANA_CON1 0x0a6c +#define MT6328_DLDO_ANA_CON2 0x0a6e +#define MT6328_DLDO_ANA_CON3 0x0a70 +#define MT6328_DLDO_ANA_CON4 0x0a72 +#define MT6328_DLDO_ANA_CON5 0x0a74 +#define MT6328_SLDO_ANA_CON0 0x0a76 +#define MT6328_SLDO_ANA_CON1 0x0a78 +#define MT6328_SLDO_ANA_CON2 0x0a7a +#define MT6328_SLDO_ANA_CON3 0x0a7c +#define MT6328_SLDO_ANA_CON4 0x0a7e +#define MT6328_SLDO_ANA_CON5 0x0a80 +#define MT6328_SLDO_ANA_CON6 0x0a82 +#define MT6328_SLDO_ANA_CON7 0x0a84 +#define MT6328_SLDO_ANA_CON8 0x0a86 +#define MT6328_SLDO_ANA_CON9 0x0a88 +#define MT6328_SLDO_ANA_CON10 0x0a8a +#define MT6328_LDO_RSV_CON0 0x0a8c +#define MT6328_LDO_RSV_CON1 0x0a8e +#define MT6328_SPK_CON0 0x0a90 +#define MT6328_SPK_CON1 0x0a92 +#define MT6328_SPK_CON2 0x0a94 +#define MT6328_SPK_CON3 0x0a96 +#define MT6328_SPK_CON4 0x0a98 +#define MT6328_SPK_CON5 0x0a9a +#define MT6328_SPK_CON6 0x0a9c +#define MT6328_SPK_CON7 0x0a9e +#define MT6328_SPK_CON8 0x0aa0 +#define MT6328_SPK_CON9 0x0aa2 +#define MT6328_SPK_CON10 0x0aa4 +#define MT6328_SPK_CON11 0x0aa6 +#define MT6328_SPK_CON12 0x0aa8 +#define MT6328_SPK_CON13 0x0aaa +#define MT6328_SPK_CON14 0x0aac +#define MT6328_SPK_CON15 0x0aae +#define MT6328_SPK_CON16 0x0ab0 +#define MT6328_SPK_ANA_CON0 0x0ab2 +#define MT6328_SPK_ANA_CON1 0x0ab4 +#define MT6328_SPK_ANA_CON3 0x0ab6 +#define MT6328_OTP_CON0 0x0c00 +#define MT6328_OTP_CON1 0x0c02 +#define MT6328_OTP_CON2 0x0c04 +#define MT6328_OTP_CON3 0x0c06 +#define MT6328_OTP_CON4 0x0c08 +#define MT6328_OTP_CON5 0x0c0a +#define MT6328_OTP_CON6 0x0c0c +#define MT6328_OTP_CON7 0x0c0e +#define MT6328_OTP_CON8 0x0c10 +#define MT6328_OTP_CON9 0x0c12 +#define MT6328_OTP_CON10 0x0c14 +#define MT6328_OTP_CON11 0x0c16 +#define MT6328_OTP_CON12 0x0c18 +#define MT6328_OTP_CON13 0x0c1a +#define MT6328_OTP_CON14 0x0c1c +#define MT6328_OTP_DOUT_0_15 0x0c1e +#define MT6328_OTP_DOUT_16_31 0x0c20 +#define MT6328_OTP_DOUT_32_47 0x0c22 +#define MT6328_OTP_DOUT_48_63 0x0c24 +#define MT6328_OTP_DOUT_64_79 0x0c26 +#define MT6328_OTP_DOUT_80_95 0x0c28 +#define MT6328_OTP_DOUT_96_111 0x0c2a +#define MT6328_OTP_DOUT_112_127 0x0c2c +#define MT6328_OTP_DOUT_128_143 0x0c2e +#define MT6328_OTP_DOUT_144_159 0x0c30 +#define MT6328_OTP_DOUT_160_175 0x0c32 +#define MT6328_OTP_DOUT_176_191 0x0c34 +#define MT6328_OTP_DOUT_192_207 0x0c36 +#define MT6328_OTP_DOUT_208_223 0x0c38 +#define MT6328_OTP_DOUT_224_239 0x0c3a +#define MT6328_OTP_DOUT_240_255 0x0c3c +#define MT6328_OTP_DOUT_256_271 0x0c3e +#define MT6328_OTP_DOUT_272_287 0x0c40 +#define MT6328_OTP_DOUT_288_303 0x0c42 +#define MT6328_OTP_DOUT_304_319 0x0c44 +#define MT6328_OTP_DOUT_320_335 0x0c46 +#define MT6328_OTP_DOUT_336_351 0x0c48 +#define MT6328_OTP_DOUT_352_367 0x0c4a +#define MT6328_OTP_DOUT_368_383 0x0c4c +#define MT6328_OTP_DOUT_384_399 0x0c4e +#define MT6328_OTP_DOUT_400_415 0x0c50 +#define MT6328_OTP_DOUT_416_431 0x0c52 +#define MT6328_OTP_DOUT_432_447 0x0c54 +#define MT6328_OTP_DOUT_448_463 0x0c56 +#define MT6328_OTP_DOUT_464_479 0x0c58 +#define MT6328_OTP_DOUT_480_495 0x0c5a +#define MT6328_OTP_DOUT_496_511 0x0c5c +#define MT6328_OTP_VAL_0_15 0x0c5e +#define MT6328_OTP_VAL_16_31 0x0c60 +#define MT6328_OTP_VAL_32_47 0x0c62 +#define MT6328_OTP_VAL_48_63 0x0c64 +#define MT6328_OTP_VAL_64_79 0x0c66 +#define MT6328_OTP_VAL_80_95 0x0c68 +#define MT6328_OTP_VAL_96_111 0x0c6a +#define MT6328_OTP_VAL_112_127 0x0c6c +#define MT6328_OTP_VAL_128_143 0x0c6e +#define MT6328_OTP_VAL_144_159 0x0c70 +#define MT6328_OTP_VAL_160_175 0x0c72 +#define MT6328_OTP_VAL_176_191 0x0c74 +#define MT6328_OTP_VAL_192_207 0x0c76 +#define MT6328_OTP_VAL_208_223 0x0c78 +#define MT6328_OTP_VAL_224_239 0x0c7a +#define MT6328_OTP_VAL_240_255 0x0c7c +#define MT6328_OTP_VAL_256_271 0x0c7e +#define MT6328_OTP_VAL_272_287 0x0c80 +#define MT6328_OTP_VAL_288_303 0x0c82 +#define MT6328_OTP_VAL_304_319 0x0c84 +#define MT6328_OTP_VAL_320_335 0x0c86 +#define MT6328_OTP_VAL_336_351 0x0c88 +#define MT6328_OTP_VAL_352_367 0x0c8a +#define MT6328_OTP_VAL_368_383 0x0c8c +#define MT6328_OTP_VAL_384_399 0x0c8e +#define MT6328_OTP_VAL_400_415 0x0c90 +#define MT6328_OTP_VAL_416_431 0x0c92 +#define MT6328_OTP_VAL_432_447 0x0c94 +#define MT6328_OTP_VAL_448_463 0x0c96 +#define MT6328_OTP_VAL_464_479 0x0c98 +#define MT6328_OTP_VAL_480_495 0x0c9a +#define MT6328_OTP_VAL_496_511 0x0c9c +#define MT6328_RTC_MIX_CON0 0x0c9e +#define MT6328_RTC_MIX_CON1 0x0ca0 +#define MT6328_RTC_MIX_CON2 0x0ca2 +#define MT6328_FGADC_CON0 0x0ca4 +#define MT6328_FGADC_CON1 0x0ca6 +#define MT6328_FGADC_CON2 0x0ca8 +#define MT6328_FGADC_CON3 0x0caa +#define MT6328_FGADC_CON4 0x0cac +#define MT6328_FGADC_CON5 0x0cae +#define MT6328_FGADC_CON6 0x0cb0 +#define MT6328_FGADC_CON7 0x0cb2 +#define MT6328_FGADC_CON8 0x0cb4 +#define MT6328_FGADC_CON9 0x0cb6 +#define MT6328_FGADC_CON10 0x0cb8 +#define MT6328_FGADC_CON11 0x0cba +#define MT6328_FGADC_CON12 0x0cbc +#define MT6328_FGADC_CON13 0x0cbe +#define MT6328_FGADC_CON14 0x0cc0 +#define MT6328_FGADC_CON15 0x0cc2 +#define MT6328_FGADC_CON16 0x0cc4 +#define MT6328_FGADC_CON17 0x0cc6 +#define MT6328_FGADC_CON18 0x0cc8 +#define MT6328_FGADC_CON19 0x0cca +#define MT6328_FGADC_CON20 0x0ccc +#define MT6328_FGADC_CON21 0x0cce +#define MT6328_FGADC_CON22 0x0cd0 +#define MT6328_FGADC_CON23 0x0cd2 +#define MT6328_FGADC_CON24 0x0cd4 +#define MT6328_FGADC_CON25 0x0cd6 +#define MT6328_FGADC_CON26 0x0cd8 +#define MT6328_FGADC_CON27 0x0cda +#define MT6328_AUDDEC_ANA_CON0 0x0cdc +#define MT6328_AUDDEC_ANA_CON1 0x0cde +#define MT6328_AUDDEC_ANA_CON2 0x0ce0 +#define MT6328_AUDDEC_ANA_CON3 0x0ce2 +#define MT6328_AUDDEC_ANA_CON4 0x0ce4 +#define MT6328_AUDDEC_ANA_CON5 0x0ce6 +#define MT6328_AUDDEC_ANA_CON6 0x0ce8 +#define MT6328_AUDDEC_ANA_CON7 0x0cea +#define MT6328_AUDDEC_ANA_CON8 0x0cec +#define MT6328_AUDENC_ANA_CON0 0x0cee +#define MT6328_AUDENC_ANA_CON1 0x0cf0 +#define MT6328_AUDENC_ANA_CON2 0x0cf2 +#define MT6328_AUDENC_ANA_CON3 0x0cf4 +#define MT6328_AUDENC_ANA_CON4 0x0cf6 +#define MT6328_AUDENC_ANA_CON5 0x0cf8 +#define MT6328_AUDENC_ANA_CON6 0x0cfa +#define MT6328_AUDENC_ANA_CON7 0x0cfc +#define MT6328_AUDENC_ANA_CON8 0x0cfe +#define MT6328_AUDENC_ANA_CON9 0x0d00 +#define MT6328_AUDENC_ANA_CON10 0x0d02 +#define MT6328_AUDNCP_CLKDIV_CON0 0x0d04 +#define MT6328_AUDNCP_CLKDIV_CON1 0x0d06 +#define MT6328_AUDNCP_CLKDIV_CON2 0x0d08 +#define MT6328_AUDNCP_CLKDIV_CON3 0x0d0a +#define MT6328_AUDNCP_CLKDIV_CON4 0x0d0c +#define MT6328_AUXADC_ADC0 0x0e00 +#define MT6328_AUXADC_ADC1 0x0e02 +#define MT6328_AUXADC_ADC2 0x0e04 +#define MT6328_AUXADC_ADC3 0x0e06 +#define MT6328_AUXADC_ADC4 0x0e08 +#define MT6328_AUXADC_ADC5 0x0e0a +#define MT6328_AUXADC_ADC6 0x0e0c +#define MT6328_AUXADC_ADC7 0x0e0e +#define MT6328_AUXADC_ADC8 0x0e10 +#define MT6328_AUXADC_ADC9 0x0e12 +#define MT6328_AUXADC_ADC10 0x0e14 +#define MT6328_AUXADC_ADC11 0x0e16 +#define MT6328_AUXADC_ADC12 0x0e18 +#define MT6328_AUXADC_ADC13 0x0e1a +#define MT6328_AUXADC_ADC14 0x0e1c +#define MT6328_AUXADC_ADC15 0x0e1e +#define MT6328_AUXADC_ADC16 0x0e20 +#define MT6328_AUXADC_ADC17 0x0e22 +#define MT6328_AUXADC_ADC18 0x0e24 +#define MT6328_AUXADC_ADC19 0x0e26 +#define MT6328_AUXADC_ADC20 0x0e28 +#define MT6328_AUXADC_ADC21 0x0e2a +#define MT6328_AUXADC_ADC22 0x0e2c +#define MT6328_AUXADC_ADC23 0x0e2e +#define MT6328_AUXADC_ADC24 0x0e30 +#define MT6328_AUXADC_ADC25 0x0e32 +#define MT6328_AUXADC_ADC26 0x0e34 +#define MT6328_AUXADC_ADC27 0x0e36 +#define MT6328_AUXADC_ADC28 0x0e38 +#define MT6328_AUXADC_ADC29 0x0e3a +#define MT6328_AUXADC_ADC30 0x0e3c +#define MT6328_AUXADC_ADC31 0x0e3e +#define MT6328_AUXADC_ADC32 0x0e40 +#define MT6328_AUXADC_ADC33 0x0e42 +#define MT6328_AUXADC_BUF0 0x0e44 +#define MT6328_AUXADC_BUF1 0x0e46 +#define MT6328_AUXADC_BUF2 0x0e48 +#define MT6328_AUXADC_BUF3 0x0e4a +#define MT6328_AUXADC_BUF4 0x0e4c +#define MT6328_AUXADC_BUF5 0x0e4e +#define MT6328_AUXADC_BUF6 0x0e50 +#define MT6328_AUXADC_BUF7 0x0e52 +#define MT6328_AUXADC_BUF8 0x0e54 +#define MT6328_AUXADC_BUF9 0x0e56 +#define MT6328_AUXADC_BUF10 0x0e58 +#define MT6328_AUXADC_BUF11 0x0e5a +#define MT6328_AUXADC_BUF12 0x0e5c +#define MT6328_AUXADC_BUF13 0x0e5e +#define MT6328_AUXADC_BUF14 0x0e60 +#define MT6328_AUXADC_BUF15 0x0e62 +#define MT6328_AUXADC_BUF16 0x0e64 +#define MT6328_AUXADC_BUF17 0x0e66 +#define MT6328_AUXADC_BUF18 0x0e68 +#define MT6328_AUXADC_BUF19 0x0e6a +#define MT6328_AUXADC_BUF20 0x0e6c +#define MT6328_AUXADC_BUF21 0x0e6e +#define MT6328_AUXADC_BUF22 0x0e70 +#define MT6328_AUXADC_BUF23 0x0e72 +#define MT6328_AUXADC_BUF24 0x0e74 +#define MT6328_AUXADC_BUF25 0x0e76 +#define MT6328_AUXADC_BUF26 0x0e78 +#define MT6328_AUXADC_BUF27 0x0e7a +#define MT6328_AUXADC_BUF28 0x0e7c +#define MT6328_AUXADC_BUF29 0x0e7e +#define MT6328_AUXADC_BUF30 0x0e80 +#define MT6328_AUXADC_BUF31 0x0e82 +#define MT6328_AUXADC_STA0 0x0e84 +#define MT6328_AUXADC_STA1 0x0e86 +#define MT6328_AUXADC_RQST0 0x0e88 +#define MT6328_AUXADC_RQST0_SET 0x0e8a +#define MT6328_AUXADC_RQST0_CLR 0x0e8c +#define MT6328_AUXADC_RQST1 0x0e8e +#define MT6328_AUXADC_RQST1_SET 0x0e90 +#define MT6328_AUXADC_RQST1_CLR 0x0e92 +#define MT6328_AUXADC_CON0 0x0e94 +#define MT6328_AUXADC_CON0_SET 0x0e96 +#define MT6328_AUXADC_CON0_CLR 0x0e98 +#define MT6328_AUXADC_CON1 0x0e9a +#define MT6328_AUXADC_CON2 0x0e9c +#define MT6328_AUXADC_CON3 0x0e9e +#define MT6328_AUXADC_CON4 0x0ea0 +#define MT6328_AUXADC_CON5 0x0ea2 +#define MT6328_AUXADC_CON6 0x0ea4 +#define MT6328_AUXADC_CON7 0x0ea6 +#define MT6328_AUXADC_CON8 0x0ea8 +#define MT6328_AUXADC_CON9 0x0eaa +#define MT6328_AUXADC_CON10 0x0eac +#define MT6328_AUXADC_CON11 0x0eae +#define MT6328_AUXADC_CON12 0x0eb0 +#define MT6328_AUXADC_CON13 0x0eb2 +#define MT6328_AUXADC_CON14 0x0eb4 +#define MT6328_AUXADC_CON15 0x0eb6 +#define MT6328_AUXADC_CON16 0x0eb8 +#define MT6328_AUXADC_AUTORPT0 0x0eba +#define MT6328_AUXADC_LBAT0 0x0ebc +#define MT6328_AUXADC_LBAT1 0x0ebe +#define MT6328_AUXADC_LBAT2 0x0ec0 +#define MT6328_AUXADC_LBAT3 0x0ec2 +#define MT6328_AUXADC_LBAT4 0x0ec4 +#define MT6328_AUXADC_LBAT5 0x0ec6 +#define MT6328_AUXADC_LBAT6 0x0ec8 +#define MT6328_AUXADC_ACCDET 0x0eca +#define MT6328_AUXADC_THR0 0x0ecc +#define MT6328_AUXADC_THR1 0x0ece +#define MT6328_AUXADC_THR2 0x0ed0 +#define MT6328_AUXADC_THR3 0x0ed2 +#define MT6328_AUXADC_THR4 0x0ed4 +#define MT6328_AUXADC_THR5 0x0ed6 +#define MT6328_AUXADC_THR6 0x0ed8 +#define MT6328_AUXADC_EFUSE0 0x0eda +#define MT6328_AUXADC_EFUSE1 0x0edc +#define MT6328_AUXADC_EFUSE2 0x0ede +#define MT6328_AUXADC_EFUSE3 0x0ee0 +#define MT6328_AUXADC_EFUSE4 0x0ee2 +#define MT6328_AUXADC_EFUSE5 0x0ee4 +#define MT6328_AUXADC_DBG0 0x0ee6 +#define MT6328_AUXADC_IMP0 0x0ee8 +#define MT6328_AUXADC_IMP1 0x0eea +#define MT6328_AUXADC_VISMPS0_1 0x0eec +#define MT6328_AUXADC_VISMPS0_2 0x0eee +#define MT6328_AUXADC_VISMPS0_3 0x0ef0 +#define MT6328_AUXADC_VISMPS0_4 0x0ef2 +#define MT6328_AUXADC_VISMPS0_5 0x0ef4 +#define MT6328_AUXADC_VISMPS0_6 0x0ef6 +#define MT6328_AUXADC_VISMPS0_7 0x0ef8 +#define MT6328_AUXADC_LBAT2_1 0x0efa +#define MT6328_AUXADC_LBAT2_2 0x0efc +#define MT6328_AUXADC_LBAT2_3 0x0efe +#define MT6328_AUXADC_LBAT2_4 0x0f00 +#define MT6328_AUXADC_LBAT2_5 0x0f02 +#define MT6328_AUXADC_LBAT2_6 0x0f04 +#define MT6328_AUXADC_LBAT2_7 0x0f06 +#define MT6328_AUXADC_MDBG_0 0x0f08 +#define MT6328_AUXADC_MDBG_1 0x0f0a +#define MT6328_AUXADC_MDBG_2 0x0f0c +#define MT6328_AUXADC_MDRT_0 0x0f0e +#define MT6328_AUXADC_MDRT_1 0x0f10 +#define MT6328_AUXADC_MDRT_2 0x0f12 +#define MT6328_ACCDET_CON0 0x0f14 +#define MT6328_ACCDET_CON1 0x0f16 +#define MT6328_ACCDET_CON2 0x0f18 +#define MT6328_ACCDET_CON3 0x0f1a +#define MT6328_ACCDET_CON4 0x0f1c +#define MT6328_ACCDET_CON5 0x0f1e +#define MT6328_ACCDET_CON6 0x0f20 +#define MT6328_ACCDET_CON7 0x0f22 +#define MT6328_ACCDET_CON8 0x0f24 +#define MT6328_ACCDET_CON9 0x0f26 +#define MT6328_ACCDET_CON10 0x0f28 +#define MT6328_ACCDET_CON11 0x0f2a +#define MT6328_ACCDET_CON12 0x0f2c +#define MT6328_ACCDET_CON13 0x0f2e +#define MT6328_ACCDET_CON14 0x0f30 +#define MT6328_ACCDET_CON15 0x0f32 +#define MT6328_ACCDET_CON16 0x0f34 +#define MT6328_ACCDET_CON17 0x0f36 +#define MT6328_ACCDET_CON18 0x0f38 +#define MT6328_ACCDET_CON19 0x0f3a +#define MT6328_ACCDET_CON20 0x0f3c +#define MT6328_ACCDET_CON21 0x0f3e +#define MT6328_ACCDET_CON22 0x0f40 +#define MT6328_ACCDET_CON23 0x0f42 +#define MT6328_ACCDET_CON24 0x0f44 +#define MT6328_ACCDET_CON25 0x0f46 +#define MT6328_CHR_CON0 0x0f48 +#define MT6328_CHR_CON1 0x0f4a +#define MT6328_CHR_CON2 0x0f4c +#define MT6328_CHR_CON3 0x0f4e +#define MT6328_CHR_CON4 0x0f50 +#define MT6328_CHR_CON5 0x0f52 +#define MT6328_CHR_CON6 0x0f54 +#define MT6328_CHR_CON7 0x0f56 +#define MT6328_CHR_CON8 0x0f58 +#define MT6328_CHR_CON9 0x0f5a +#define MT6328_CHR_CON10 0x0f5c +#define MT6328_CHR_CON11 0x0f5e +#define MT6328_CHR_CON12 0x0f60 +#define MT6328_CHR_CON13 0x0f62 +#define MT6328_CHR_CON14 0x0f64 +#define MT6328_CHR_CON15 0x0f66 +#define MT6328_CHR_CON16 0x0f68 +#define MT6328_CHR_CON17 0x0f6a +#define MT6328_CHR_CON18 0x0f6c +#define MT6328_CHR_CON19 0x0f6e +#define MT6328_CHR_CON20 0x0f70 +#define MT6328_CHR_CON21 0x0f72 +#define MT6328_CHR_CON22 0x0f74 +#define MT6328_CHR_CON23 0x0f76 +#define MT6328_CHR_CON24 0x0f78 +#define MT6328_CHR_CON25 0x0f7a +#define MT6328_CHR_CON26 0x0f7c +#define MT6328_CHR_CON27 0x0f7e +#define MT6328_CHR_CON28 0x0f80 +#define MT6328_CHR_CON29 0x0f82 +#define MT6328_CHR_CON30 0x0f84 +#define MT6328_CHR_CON31 0x0f86 +#define MT6328_CHR_CON32 0x0f88 +#define MT6328_CHR_CON33 0x0f8a +#define MT6328_CHR_CON34 0x0f8c +#define MT6328_CHR_CON35 0x0f8e +#define MT6328_CHR_CON36 0x0f90 +#define MT6328_CHR_CON37 0x0f92 +#define MT6328_CHR_CON38 0x0f94 +#define MT6328_CHR_CON39 0x0f96 +#define MT6328_CHR_CON40 0x0f98 +#define MT6328_CHR_CON41 0x0f9a +#define MT6328_CHR_CON42 0x0f9c +#define MT6328_BATON_CON0 0x0f9e +#define MT6328_CHR_CON43 0x0fa0 +#define MT6328_EOSC_CALI_CON0 0x0faa +#define MT6328_EOSC_CALI_CON1 0x0fac +#define MT6328_VRTC_PWM_CON0 0x0fae + +#endif /* __MFD_MT6328_REGISTERS_H__ */ diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h index 627487e262875..b774c3a4bb62e 100644 --- a/include/linux/mfd/mt6397/core.h +++ b/include/linux/mfd/mt6397/core.h @@ -12,6 +12,7 @@ enum chip_id { MT6323_CHIP_ID = 0x23, + MT6328_CHIP_ID = 0x30, MT6331_CHIP_ID = 0x20, MT6332_CHIP_ID = 0x20, MT6357_CHIP_ID = 0x57, @@ -65,11 +66,11 @@ struct mt6397_chip { int irq; struct irq_domain *irq_domain; struct mutex irqlock; - u16 wake_mask[2]; - u16 irq_masks_cur[2]; - u16 irq_masks_cache[2]; - u16 int_con[2]; - u16 int_status[2]; + u16 wake_mask[3]; + u16 irq_masks_cur[3]; + u16 irq_masks_cache[3]; + u16 int_con[3]; + u16 int_status[3]; u16 chip_id; void *irq_data; }; From patchwork Fri Oct 18 08:10:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841399 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 1B0ADD2F7E8 for ; Fri, 18 Oct 2024 08:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OqUOVhxdzllVLNlxhGKe5NvpOTem/doj2222rVZAilg=; b=JEl/tMlz33Gvc453DBVvQMLbF3 6uktfwuoHQTdWEbQha0w2dq7e7GfyZmzPupMzpm87rMFq9ZygUBHC/mWetrkZ8w4ZpJ3FmYws3mqt YAGTprH71gLrq/cSbrCcCwvv2Mwvw+mVa5vqXolfzhHjeFVA+wqNtlPDd+YPd6KHD6mdenasuFukH JOx2THjFm1Q7fjoVqtkzU5p3QwJqRr8zgF2hxyIFf2l0wZeEvX30xZ7LXK0bReRqVyZikSx9lrl1L w0A2Eh/FaBovrngliTwatmRcm1IUEK4mBuVq741S7TruM5ZxibRS3qw6rZP0JJ4mcoq3LxQhSERfj 5j2nHj1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iSE-0000000HZWB-0nrw; Fri, 18 Oct 2024 08:35:26 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5X-0000000HSVP-2b6Y; Fri, 18 Oct 2024 08:12:02 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c9404c0d50so1889067a12.3; Fri, 18 Oct 2024 01:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239118; x=1729843918; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OqUOVhxdzllVLNlxhGKe5NvpOTem/doj2222rVZAilg=; b=lrc7yi90KrjqR4t76p9DN32zDL0bzh94yp+phbusZEQmQHzsiYqYR2q0/lBMffqy6B 6/IOrrI51uWF/xwbKn7a5caWY+fYiqo9P2f6FYRGA1JrNroT5tY3W7NSXmdzn+UR44y5 Nfhtf332+JMNgyG5LUkFWzFwxo65YmTEf2g7EcgbdGBpn4HzwjOr/qmibnc2mJjAf8zA YFWEuqLBpDhMhZCw0WjjDZddkobOXNAh/ikk8UbLpPdFMQE3fpGYH3ZU5fUuZlTf5o+J JUF7jRJae60lLCfsNCVouCTg6iQWwynsS2K1xH5ub72+1oQ26MfRs6zR7RsXp7XEN3g/ iw6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239118; x=1729843918; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OqUOVhxdzllVLNlxhGKe5NvpOTem/doj2222rVZAilg=; b=SoiiL1WW8VOh2wZixnwUtoBCoZQKgYTKKULY/UrdseHYg8Yl73J9/ANKGuM+NGmqV/ NuEE6LWEGeSTVfv7k/dow387grrQxicqqa9FlJHG5DfDrqCMg7brZzH0PijZcF2Muy1J qsjRzQjOERh2RQfidERushSnEhUE5BNSc59RpSdhfQqZvR46SqnieeDmsDwZb0hM7viI Hq5k2sgRLls/N9obZFeXDURpdORFYIVNYhmvoQBu1SVxHA7myycj9rcR23jEoudyqr3W qWThGgxIiXa4B63VVph4yl1OuZ9LGYzB2kMwp9BS4K7jMmnyM3182sHVaxNZjovZ+EQP U1fg== X-Forwarded-Encrypted: i=1; AJvYcCWLibAiOqIdu10/0jXDhHNs02g8bUAr9a+mf5zzBZ3gSTluzuFKhG7AWuuad8kMjZIOqxumE5ENVXWZKk/Bmmw=@lists.infradead.org, AJvYcCWbVp16xog6OOtG8FOta0w0QzVMhIKz14UaiLyC9V7d/vo1b/f+Up/LCxBOqK7DB+mbPn+ZyiPUYL9mTjJk2Eav@lists.infradead.org X-Gm-Message-State: AOJu0YzeCUM2MzOB0Fh4QMyYgbQ6SeGf2q/QJJxDCdGDr7YcYwPgEewm x73pmZ1CkWx5bN4dVW6gb9Y8AHeboMXXwMfPRdw3tuhlUZwpSYH9 X-Google-Smtp-Source: AGHT+IGlE2pfYKfWkF98FM42wnyiPpH6Hq45Vtmhwx5ec0LK9w0F5Rmvp/XllrhbhJ0dPL2xO1aVLA== X-Received: by 2002:a17:907:3f23:b0:a99:eb94:3e37 with SMTP id a640c23a62f3a-a9a69ca058bmr120384566b.58.1729239117450; Fri, 18 Oct 2024 01:11:57 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:11:56 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 5/6] regulator: Add driver for MediaTek MT6328 PMIC regulators Date: Fri, 18 Oct 2024 11:10:47 +0300 Message-ID: <20241018081050.23592-6-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011159_759977_7289128C X-CRM114-Status: GOOD ( 23.33 ) 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: Yassine Oudjana Add a driver for the regulators on the MT6328 PMIC. Signed-off-by: Yassine Oudjana Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/mt6328-regulator.c | 479 +++++++++++++++++++++ include/linux/regulator/mt6328-regulator.h | 49 +++ 4 files changed, 538 insertions(+) create mode 100644 drivers/regulator/mt6328-regulator.c create mode 100644 include/linux/regulator/mt6328-regulator.h diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 249933d6388dd..e9b9faff67f3a 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -862,6 +862,15 @@ config REGULATOR_MT6323 This driver supports the control of different power rails of device through regulator interface. +config REGULATOR_MT6328 + tristate "MediaTek MT6328 PMIC" + depends on MFD_MT6397 + help + Say y here to select this option to enable the power regulator of + MediaTek MT6328 PMIC. + This driver supports the control of different power rails of device + through regulator interface. + config REGULATOR_MT6331 tristate "MediaTek MT6331 PMIC" depends on MFD_MT6397 diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 9b69546fb3f65..c1a5a44413198 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -103,6 +103,7 @@ obj-$(CONFIG_REGULATOR_MPQ7920) += mpq7920.o obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o obj-$(CONFIG_REGULATOR_MT6315) += mt6315-regulator.o obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o +obj-$(CONFIG_REGULATOR_MT6328) += mt6328-regulator.o obj-$(CONFIG_REGULATOR_MT6331) += mt6331-regulator.o obj-$(CONFIG_REGULATOR_MT6332) += mt6332-regulator.o obj-$(CONFIG_REGULATOR_MT6357) += mt6357-regulator.o diff --git a/drivers/regulator/mt6328-regulator.c b/drivers/regulator/mt6328-regulator.c new file mode 100644 index 0000000000000..e15a64404f494 --- /dev/null +++ b/drivers/regulator/mt6328-regulator.c @@ -0,0 +1,479 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * MediaTek MT6328 regulator driver + * Based on MT6323 driver. + * + * Copyright (c) 2016 MediaTek Inc. + * Copyright (c) 2022 Yassine Oudjana + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MT6328_LDO_TABLE_MODE_NORMAL 0 +#define MT6328_LDO_TABLE_MODE_LP 1 + +/* + * MT6328 regulators' information + * + * @desc: standard fields of regulator description. + * @qi: Mask for query enable signal status of regulators + * @vselon_reg: Register sections for hardware control mode of bucks + * @vselctrl_reg: Register for controlling the buck control mode. + * @vselctrl_mask: Mask for query buck's voltage control mode. + */ +struct mt6328_regulator_info { + struct regulator_desc desc; + u32 qi; + u32 vselon_reg; + u32 vselctrl_reg; + u32 vselctrl_mask; + u32 modeset_reg; + u32 modeset_mask; +}; + +#define MT6328_BUCK(match, vreg, min, max, step, volt_ranges, enreg, \ + vosel, vosel_mask, voselon, vosel_ctrl) \ +[MT6328_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .ops = &mt6328_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6328_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = (max - min)/step + 1, \ + .linear_ranges = volt_ranges, \ + .n_linear_ranges = ARRAY_SIZE(volt_ranges), \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask, \ + .enable_reg = enreg, \ + .enable_mask = BIT(0), \ + }, \ + .qi = BIT(13), \ + .vselon_reg = voselon, \ + .vselctrl_reg = vosel_ctrl, \ + .vselctrl_mask = BIT(1), \ +} + +#define MT6328_LDO_RANGE(match, vreg, min, max, step, volt_ranges, \ + enreg, enbit, vosel, vosel_mask, _modeset_reg, \ + _modeset_mask) \ +[MT6328_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .ops = &mt6328_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6328_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = (max - min)/step + 1, \ + .linear_ranges = volt_ranges, \ + .n_linear_ranges = ARRAY_SIZE(volt_ranges), \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask, \ + .enable_reg = enreg, \ + .enable_mask = BIT(enbit), \ + }, \ + .qi = BIT(15), \ + .modeset_reg = _modeset_reg, \ + .modeset_mask = _modeset_mask, \ +} + +#define MT6328_LDO_TABLE(match, vreg, ldo_volt_table, enreg, enbit, \ + vosel, vosel_mask, _modeset_reg, _modeset_mask)\ +[MT6328_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .ops = &mt6328_volt_table_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6328_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = ARRAY_SIZE(ldo_volt_table), \ + .volt_table = ldo_volt_table, \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask, \ + .enable_reg = enreg, \ + .enable_mask = BIT(enbit), \ + }, \ + .qi = BIT(15), \ + .modeset_reg = _modeset_reg, \ + .modeset_mask = _modeset_mask, \ +} + +#define MT6328_REG_FIXED(match, vreg, enreg, enbit, volt, \ + _modeset_reg, _modeset_mask) \ +[MT6328_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .ops = &mt6328_volt_fixed_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6328_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = 1, \ + .enable_reg = enreg, \ + .enable_mask = BIT(enbit), \ + .min_uV = volt, \ + }, \ + .qi = BIT(15), \ + .modeset_reg = _modeset_reg, \ + .modeset_mask = _modeset_mask, \ +} + +static const struct linear_range buck_volt_range1[] = { + REGULATOR_LINEAR_RANGE(500000, 0, 0x3f, 50000) +}; + +static const struct linear_range buck_volt_range2[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 0x7f, 6250) +}; + +static const struct linear_range buck_volt_range3[] = { + REGULATOR_LINEAR_RANGE(1200000, 0, 0x7f, 6250) +}; + +static const unsigned int ldo_volt_table1[] = { + 1500000, 1800000, 2500000, 2800000 +}; + +static const unsigned int ldo_volt_table2[] = { + 3300000, 3400000, 3500000, 3600000 +}; + +static const unsigned int ldo_volt_table3[] = { + 0, 0, 0, 1800000, 1900000, 2000000, 2100000, 2200000 +}; + +static const unsigned int ldo_volt_table4[] = { + 1700000, 1800000, 1860000, 2760000, 3000000, 3100000 +}; + +static const unsigned int ldo_volt_table5[] = { + 1800000, 2900000, 3000000, 3300000 +}; + +static const unsigned int ldo_volt_table6[] = { + 2900000, 3000000, 3300000 +}; + +static const unsigned int ldo_volt_table7[] = { + 2500000, 2900000, 3000000, 3300000 +}; + +static const unsigned int ldo_volt_table8[] = { + 1300000, 1800000, 2900000, 3300000 +}; + +static const unsigned int ldo_volt_table9[] = { + 1200000, 1300000, 1500000, 1800000, 2000000, 2800000, 3000000, 3300000 +}; + +static const unsigned int ldo_volt_table10[] = { + 1200000, 1300000, 1500000, 1800000, 2500000, 2800000, 3000000, 3300000 +}; + +static const unsigned int ldo_volt_table11[] = { + 900000, 1000000, 1100000, 1200000, 1300000, 1500000 +}; + +static const unsigned int ldo_volt_table12[] = { + 1200000, 1300000, 1500000, 1800000, 1825000 +}; + +static const unsigned int ldo_volt_table13[] = { + 1200000, 1300000, 1500000, 1800000 +}; + +static const unsigned int ldo_volt_table14[] = { + 1240000, 1390000, 1540000 +}; + +static const struct linear_range ldo_volt_range1[] = { + REGULATOR_LINEAR_RANGE(700000, 0, 0x7f, 6250) +}; + +static int mt6328_get_status(struct regulator_dev *rdev) +{ + int ret; + u32 regval; + struct mt6328_regulator_info *info = rdev_get_drvdata(rdev); + + ret = regmap_read(rdev->regmap, info->desc.enable_reg, ®val); + if (ret != 0) { + dev_err(&rdev->dev, "Failed to get enable reg: %d\n", ret); + return ret; + } + + return (regval & info->qi) ? REGULATOR_STATUS_ON : REGULATOR_STATUS_OFF; +} + +static int mt6328_ldo_table_set_mode(struct regulator_dev *rdev, unsigned int mode) +{ + int ret, val = 0; + struct mt6328_regulator_info *info = rdev_get_drvdata(rdev); + + if (!info->modeset_mask) { + dev_err(&rdev->dev, "regulator %s doesn't support set_mode\n", + info->desc.name); + return -EINVAL; + } + + switch (mode) { + case REGULATOR_MODE_STANDBY: + val = MT6328_LDO_TABLE_MODE_LP; + break; + case REGULATOR_MODE_NORMAL: + val = MT6328_LDO_TABLE_MODE_NORMAL; + break; + default: + return -EINVAL; + } + + val <<= ffs(info->modeset_mask) - 1; + + ret = regmap_update_bits(rdev->regmap, info->modeset_reg, + info->modeset_mask, val); + + return ret; +} + +static unsigned int mt6328_ldo_table_get_mode(struct regulator_dev *rdev) +{ + unsigned int val; + unsigned int mode; + int ret; + struct mt6328_regulator_info *info = rdev_get_drvdata(rdev); + + if (!info->modeset_mask) { + dev_err(&rdev->dev, "regulator %s doesn't support get_mode\n", + info->desc.name); + return -EINVAL; + } + + ret = regmap_read(rdev->regmap, info->modeset_reg, &val); + if (ret < 0) + return ret; + + val &= info->modeset_mask; + val >>= ffs(info->modeset_mask) - 1; + + if (val & 0x1) + mode = REGULATOR_MODE_STANDBY; + else + mode = REGULATOR_MODE_NORMAL; + + return mode; +} + +static const struct regulator_ops mt6328_volt_range_ops = { + .list_voltage = regulator_list_voltage_linear_range, + .map_voltage = regulator_map_voltage_linear_range, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .get_status = mt6328_get_status, +}; + +static const struct regulator_ops mt6328_volt_table_ops = { + .list_voltage = regulator_list_voltage_table, + .map_voltage = regulator_map_voltage_iterate, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .get_status = mt6328_get_status, + .set_mode = mt6328_ldo_table_set_mode, + .get_mode = mt6328_ldo_table_get_mode, +}; + +static const struct regulator_ops mt6328_volt_fixed_ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .get_status = mt6328_get_status, + .set_mode = mt6328_ldo_table_set_mode, + .get_mode = mt6328_ldo_table_get_mode, +}; + +/* The array is indexed by id(MT6328_ID_XXX) */ +static struct mt6328_regulator_info mt6328_regulators[] = { + MT6328_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, + buck_volt_range1, MT6328_VPA_CON9, MT6328_VPA_CON11, 0x3f, + MT6328_VPA_CON12, MT6328_VPA_CON7), + MT6328_BUCK("buck_vproc", VPROC, 600000, 1393750, 6250, + buck_volt_range2, MT6328_VPROC_CON9, MT6328_VPA_CON11, 0x7f, + MT6328_VPROC_CON12, MT6328_VPROC_CON7), + MT6328_BUCK("buck_vcore1", VCORE1, 600000, 1393750, 6250, + buck_volt_range2, MT6328_VCORE1_CON9, MT6328_VCORE1_CON11, 0x7f, + MT6328_VCORE1_CON12, MT6328_VCORE1_CON7), + MT6328_BUCK("buck_vsys22", VSYS22, 1200000, 1993750, 6250, + buck_volt_range3, MT6328_VSYS22_CON9, MT6328_VSYS22_CON11, 0x7f, + MT6328_VSYS22_CON12, MT6328_VSYS22_CON7), + MT6328_BUCK("buck_vlte", VLTE, 600000, 1393750, 6250, + buck_volt_range2, MT6328_VLTE_CON9, MT6328_VLTE_CON11, 0x7f, + MT6328_VLTE_CON12, MT6328_VLTE_CON7), + MT6328_REG_FIXED("ldo_vaux18", VAUX18, MT6328_VAUX18_CON0, 1, 1800000, + MT6328_VAUX18_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vtcxo_0", VTCXO_0, MT6328_VTCXO_0_CON0, 1, 2800000, + MT6328_VTCXO_0_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vtcxo_1", VTCXO_1, MT6328_VTCXO_1_CON0, 1, 2800000, + MT6328_VTCXO_1_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vaud28", VAUD28, MT6328_VAUD28_CON0, 1, 2800000, + MT6328_VAUD28_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vcn28", VCN28, MT6328_VCN28_CON0, 1, 2800000, + MT6328_VCN28_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcama", VCAMA, ldo_volt_table1, + MT6328_VCAMA_CON0, 1, MT6328_ADLDO_ANA_CON5, 0x30, + 0, 0), + MT6328_LDO_TABLE("ldo_vcn33_bt", VCN33_BT, ldo_volt_table2, + MT6328_VCN33_CON2, 1, MT6328_ADLDO_ANA_CON6, 0x70, + MT6328_VCN33_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcn33_wifi", VCN33_WIFI, ldo_volt_table2, + MT6328_VCN33_CON1, 1, MT6328_ADLDO_ANA_CON6, 0x70, + MT6328_VCN33_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vusb33", VUSB33, MT6328_VUSB33_CON0, 1, 3300000, + MT6328_VUSB33_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vefuse", VEFUSE, ldo_volt_table3, + MT6328_VEFUSE_CON0, 1, MT6328_ADLDO_ANA_CON8, 0x70, + MT6328_VEFUSE_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vsim1", VSIM1, ldo_volt_table4, + MT6328_VSIM1_CON0, 1, MT6328_ADLDO_ANA_CON9, 0x70, + MT6328_VSIM1_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vsim2", VSIM2, ldo_volt_table4, + MT6328_VSIM2_CON0, 1, MT6328_ADLDO_ANA_CON10, 0x70, + MT6328_VSIM2_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vemc_3v3", VEMC_3V3, ldo_volt_table5, + MT6328_VEMC_3V3_CON0, 1, MT6328_ADLDO_ANA_CON11, 0x30, + MT6328_VEMC_3V3_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vmch", VMCH, ldo_volt_table6, + MT6328_VMCH_CON0, 1, MT6328_ADLDO_ANA_CON12, 0x30, + MT6328_VMCH_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vtref", VTREF, MT6328_VTREF_CON0, 1, 1800000, + 0, 0), + MT6328_LDO_TABLE("ldo_vmc", VMC, ldo_volt_table5, + MT6328_VMC_CON0, 1, MT6328_DLDO_ANA_CON0, 0x30, + MT6328_VMC_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcamaf", VCAMAF, ldo_volt_table9, + MT6328_VCAMAF_CON0, 1, MT6328_DLDO_ANA_CON1, 0x70, + MT6328_VCAMAF_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vibr", VIBR, ldo_volt_table9, + MT6328_VIBR_CON0, 1, MT6328_DLDO_ANA_CON2, 0x70, + MT6328_VIBR_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vio28", VIO28, MT6328_VIO28_CON0, 1, 2800000, + MT6328_VIO28_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vgp1", VGP1, ldo_volt_table10, + MT6328_VGP1_CON0, 1, MT6328_DLDO_ANA_CON4, 0x70, + MT6328_VGP1_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcamd", VCAMD, ldo_volt_table11, + MT6328_VCAM_CON0, 1, MT6328_SLDO_ANA_CON2, 0x70, + MT6328_VCAM_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vrf18_0", VRF18_0, MT6328_VRF18_0_CON0, 1, 1825000, + MT6328_VRF18_0_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vrf18_1", VRF18_1, ldo_volt_table12, + MT6328_VRF18_1_CON0, 1, MT6328_SLDO_ANA_CON4, 0x30, + MT6328_VRF18_1_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vio18", VIO18, MT6328_VIO18_CON0, 1, 1800000, + MT6328_VIO18_CON0, BIT(0)), + MT6328_REG_FIXED("ldo_vcn18", VCN18, MT6328_VCN18_CON0, 1, 1800000, + MT6328_VCN18_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcamio", VCAMIO, ldo_volt_table13, + MT6328_VCAMIO_CON0, 1, MT6328_SLDO_ANA_CON7, 0x30, + MT6328_VCAMIO_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vcamio", VCAMIO, ldo_volt_table13, + MT6328_VCAMIO_CON0, 1, MT6328_SLDO_ANA_CON7, 0x30, + MT6328_VCAMIO_CON0, BIT(0)), + MT6328_LDO_RANGE("ldo_vsram", VSRAM, 700000, 1493750, 6250, + ldo_volt_range1, MT6328_VSRAM_CON9, 1, MT6328_SLDO_ANA_CON9, + 0x7f, MT6328_LDO_VSRAM_CON0, BIT(0)), + MT6328_LDO_TABLE("ldo_vm", VM, ldo_volt_table14, + MT6328_VM_CON0, 1, MT6328_SLDO_ANA_CON0, 0x3, + MT6328_VM_CON0, BIT(0)), +}; + +static int mt6328_set_buck_vosel_reg(struct platform_device *pdev) +{ + struct mt6397_chip *mt6328 = dev_get_drvdata(pdev->dev.parent); + int i; + u32 regval; + + for (i = 0; i < MT6328_MAX_REGULATOR; i++) { + if (mt6328_regulators[i].vselctrl_reg) { + if (regmap_read(mt6328->regmap, + mt6328_regulators[i].vselctrl_reg, + ®val) < 0) { + dev_err(&pdev->dev, + "Failed to read buck ctrl\n"); + return -EIO; + } + + if (regval & mt6328_regulators[i].vselctrl_mask) { + mt6328_regulators[i].desc.vsel_reg = + mt6328_regulators[i].vselon_reg; + } + } + } + + return 0; +} + +static int mt6328_regulator_probe(struct platform_device *pdev) +{ + struct mt6397_chip *mt6328 = dev_get_drvdata(pdev->dev.parent); + struct regulator_config config = {}; + struct regulator_dev *rdev; + int i; + + /* Query buck controller to select activated voltage register part */ + if (mt6328_set_buck_vosel_reg(pdev)) + return -EIO; + + for (i = 0; i < MT6328_MAX_REGULATOR; i++) { + config.dev = &pdev->dev; + config.driver_data = &mt6328_regulators[i]; + config.regmap = mt6328->regmap; + rdev = devm_regulator_register(&pdev->dev, + &mt6328_regulators[i].desc, &config); + if (IS_ERR(rdev)) { + dev_err(&pdev->dev, "failed to register %s\n", + mt6328_regulators[i].desc.name); + return PTR_ERR(rdev); + } + } + return 0; +} + +static const struct platform_device_id mt6328_platform_ids[] = { + { "mt6328-regulator" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(platform, mt6328_platform_ids); + +static struct platform_driver mt6328_regulator_driver = { + .driver = { + .name = "mt6328-regulator", + }, + .probe = mt6328_regulator_probe, + .id_table = mt6328_platform_ids, +}; + +module_platform_driver(mt6328_regulator_driver); + +MODULE_AUTHOR("Yassine Oudjana "); +MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6328 PMIC"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/regulator/mt6328-regulator.h b/include/linux/regulator/mt6328-regulator.h new file mode 100644 index 0000000000000..0f82aa88493b0 --- /dev/null +++ b/include/linux/regulator/mt6328-regulator.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2016 MediaTek Inc. + * Copyright (c) 2022 Yassine Oudjana + */ + +#ifndef __LINUX_REGULATOR_MT6328_H +#define __LINUX_REGULATOR_MT6328_H + +enum { + MT6328_ID_VPA = 0, + MT6328_ID_VPROC, + MT6328_ID_VCORE1, + MT6328_ID_VSYS22, + MT6328_ID_VLTE, + MT6328_ID_VAUX18, + MT6328_ID_VTCXO_0, + MT6328_ID_VTCXO_1, + MT6328_ID_VAUD28, + MT6328_ID_VCN28, + MT6328_ID_VCAMA, + MT6328_ID_VCN33_BT, + MT6328_ID_VCN33_WIFI, + MT6328_ID_VUSB33, + MT6328_ID_VEFUSE, + MT6328_ID_VSIM1, + MT6328_ID_VSIM2, + MT6328_ID_VEMC_3V3, + MT6328_ID_VMCH, + MT6328_ID_VTREF, + MT6328_ID_VMC, + MT6328_ID_VCAMAF, + MT6328_ID_VIBR, + MT6328_ID_VIO28, + MT6328_ID_VGP1, + MT6328_ID_VCAMD, + MT6328_ID_VRF18_0, + MT6328_ID_VRF18_1, + MT6328_ID_VIO18, + MT6328_ID_VCN18, + MT6328_ID_VCAMIO, + MT6328_ID_VSRAM, + MT6328_ID_VM, + MT6328_ID_RG_MAX, +}; + +#define MT6328_MAX_REGULATOR MT6328_ID_RG_MAX + +#endif /* __LINUX_REGULATOR_MT6328_H */ From patchwork Fri Oct 18 08:10:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 13841385 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 6C1ACD2F7E1 for ; Fri, 18 Oct 2024 08:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eZjjRK96GfuXcw6nB88pboztj/XL99IucjnOaEslf5E=; b=tIautau9TpFjq1wehxJwLzDIQl I+O8mK9OHvAmGNwdD/yYYo6XMjeorSmlgKUNYNqLSPMqDogMOObNgbcRgoy8SGcGVWLrxUnJY9qy9 j5998UWk37lVtV69fy+b3+H5Zx1dECwDMGC/dy+9uvHV5aN93lCGx75HRzyN6QU5agae65v5dDUXw LNROrTYmyJ5QmZqXOMUHYxw9LmjjxTg7UWQQHctHjTb9FGiR5kBjHA/aGGZqBgokNapNlA9G07LZo LEA3+ohLjCtquGrma0hANXaj0nahfsqJ4gCL/OrQkyhwhqPa7ba32UhQRgsSyvRRTdGtx1Wsxfl+A JVRKSd7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1iJW-0000000HWeP-1TY7; Fri, 18 Oct 2024 08:26:26 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1i5b-0000000HSX7-28pn; Fri, 18 Oct 2024 08:12:04 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-539f58c68c5so2972144e87.3; Fri, 18 Oct 2024 01:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729239121; x=1729843921; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eZjjRK96GfuXcw6nB88pboztj/XL99IucjnOaEslf5E=; b=CErpwI1A+cS98eJHyHZ8yoOM4Q/QUZtIZ+IrOrxDxDTCfsB92NYkoApWSThprNXy09 egk0S6lEPNwyrap5STDbp6jScRGmT3Gq1mgAGT2WiBtRnQr4eIOxc8OPQMYmgvg4Uy9d rgHxe7cwEzETTBFsPxTLQ8XNuIC2e7wOCvvT7EER6MKvvccXGQo9ND5FPXoLxNR46HXv qr0/fn9VHpojHyK6p6VT4KVf/B+5/lLYuE0RR2eOeeDU9MuqaCm720wV3EzQYUyuGhwH 2ZraDJ8sIrZrgCQHDXbv7QM80xanewT9Vv9HBVzjJk2JKzek6bYTlgH/84WL+eg8TKZl tYnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729239121; x=1729843921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZjjRK96GfuXcw6nB88pboztj/XL99IucjnOaEslf5E=; b=Ke6hoXh1SAj3zRW0oYdZGk1Accc2jeVCVY8jxQORrdL8JxBbfotreRTHhcY7usoTuM V6cQLXcMgUMrwK4Ewvo3u2dlla4ZptU+h/onz5IikSr+YLyDZ3QWDNqIT8hJaXtIED7p vdKvDpNrb64sapZfVMWVPgJAJdELtaug7RBc3PJ3WLD3GuDFtkaH8l6qcfIpyOcAR34w uIacJMd1GMKOr7Jusvbs3YZSUPn8XN92mL++75h79t2g2oOK9z7ubvLza0fr1QmLtwOg bgFC+CBjfYT4nf6uFHG20TZG5oQ2D59Rtf87Ma3MQyErueyTqbDvEnhhRPREt1H8WfNo 7d8w== X-Forwarded-Encrypted: i=1; AJvYcCVuyynw0YLHx6bhpwBvE044cBzpL3QciNkOX+RGxJzb21GHFvRWvi7PvSuZR23VrepuSW+wuKz7gJ72djqAhzg=@lists.infradead.org, AJvYcCXW6esg7dqIIPoINiY3ynf+icawNTSfvRIDwTC4ftwUr/VqSvgvGZh1F4+z+HVwGUDhikjuPkgSGHr3QFAJldO9@lists.infradead.org X-Gm-Message-State: AOJu0Yz/bx9yN6GGPkzzwWqM9bS3EyIIrnoFpJw+vw8RLuqKo4lN8vwN OcGkYWEAwXlzPQMpcI44Xx/pYepaKXXa4TjppPmwA8ESPM9W0xFA X-Google-Smtp-Source: AGHT+IHOZo2zIv5xORZ3TfFiF94d8rr6g6N8wyJA6Yi6pZbzCQ0+fj68XKKyXsG1c3g2+PrJqW4LIw== X-Received: by 2002:a05:6512:39cb:b0:538:9e36:7b6a with SMTP id 2adb3069b0e04-53a15494e4emr1432817e87.32.1729239121034; Fri, 18 Oct 2024 01:12:01 -0700 (PDT) Received: from zenbook.agu.edu.tr ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68a8e734sm61129666b.24.2024.10.18.01.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 01:12:00 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sen Chu , Sean Wang , Macpaul Lin , Lee Jones , Matthias Brugger , AngeloGioacchino Del Regno , Liam Girdwood , Mark Brown , jason-ch chen , Chen Zhong , Flora Fu , Alexandre Mergnat Cc: Yassine Oudjana , Yassine Oudjana , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 6/6] Input: mtk-pmic-keys - Add support for MT6328 Date: Fri, 18 Oct 2024 11:10:48 +0300 Message-ID: <20241018081050.23592-7-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241018081050.23592-1-y.oudjana@protonmail.com> References: <20241018081050.23592-1-y.oudjana@protonmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_011203_583777_EF073BC2 X-CRM114-Status: GOOD ( 12.15 ) 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: Yassine Oudjana Add a compatible string and related data for the PMIC keys on the MT6328 PMIC. Signed-off-by: Yassine Oudjana Acked-by: Dmitry Torokhov Reviewed-by: AngeloGioacchino Del Regno --- drivers/input/keyboard/mtk-pmic-keys.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c index 4364c3401ff1c..df1e4147e3365 100644 --- a/drivers/input/keyboard/mtk-pmic-keys.c +++ b/drivers/input/keyboard/mtk-pmic-keys.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,17 @@ static const struct mtk_pmic_regs mt6323_regs = { .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, }; +static const struct mtk_pmic_regs mt6328_regs = { + .keys_regs[MTK_PMIC_PWRKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6328_TOPSTATUS, + 0x2, MT6328_INT_MISC_CON, 0x4, MTK_PMIC_PWRKEY_RST), + .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6328_TOPSTATUS, + 0x4, MT6328_INT_MISC_CON, 0x2, MTK_PMIC_HOMEKEY_RST), + .pmic_rst_reg = MT6328_TOP_RST_MISC, + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, +}; + static const struct mtk_pmic_regs mt6331_regs = { .keys_regs[MTK_PMIC_PWRKEY_INDEX] = MTK_PMIC_KEYS_REGS(MT6331_TOPSTATUS, 0x2, @@ -287,6 +299,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { }, { .compatible = "mediatek,mt6323-keys", .data = &mt6323_regs, + }, { + .compatible = "mediatek,mt6328-keys", + .data = &mt6328_regs, }, { .compatible = "mediatek,mt6331-keys", .data = &mt6331_regs,