From patchwork Wed Oct 5 14:57:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999312 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 DD127C433FE for ; Wed, 5 Oct 2022 14:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tHTPuhFPX2BXYJ4MrxKj2AO6YUtHDCaCEqhLTab64kI=; b=IudpjEVcPD5GSt AqBVFVwOxS3SkSonebS6JmDu2JPgjr9/6csr+1NM+7YzrWOuIq9mGkneVOIlu0x/La3u/A6LPjpUY fbg3NTOeKVXc5fJF5wKUUoFfjy1v5GZY7Co+ZuqmZijqHjOyh6/MwVz14UUxvvYQ0RaSfkk5vYvyb U6DEDAs1hU0AlD4xw+Aay4ACgDjvD7MSijgHjWiJPUZZqHo8G9xlq7y2JEFKAfl4e7QO76sYq+8RA OR9OIgWcjJ7gGYD0G589OciImL1uW8zvoZQxI5ztA67XvMu4GMFD+4ZwXh88/dX7YS72MfFN/OOxJ oZYm3r93SXopVm0W+OOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qd-00Ehx4-Mf; Wed, 05 Oct 2022 14:58:11 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qC-00Ehk1-4h for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 14:57:47 +0000 Received: by mail-wr1-x42a.google.com with SMTP id b4so19404078wrs.1 for ; Wed, 05 Oct 2022 07:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=GaS744uQPmWBXBI6ZqLder+xi41I4zdp+0x6pn9qEpI=; b=eQ3m/yEidIEhUShS4zxNMiIs8dd6pmamD7CRnjx84zkb5zOiWS5Me+HqrmXl3UjNBC tj5bGw4X+qj+YDp6I1DrYdQ+pvHpKQ5A2g/+4fYZlZ79poiNpLeJcdxVwuF4Qcsf2W5j U2vi7i1uemim1xtxUrprk49kvN6bpyIEUHI6xsb6f1qVnwBzahJaOv1zuD+s8rRZwPBr bJ1HrbtnerFdjCcPVbo9TvkOugpHSEqFE36Y/matOh/mRp4PgbC6uoN0qM0r/na3fSvd 78tG/wZAw/bB4+0l67+IFL395IMPR2p4fOYrpR3HwT5NLOJAb57psy1EdIeu8CkyNjPt sIaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=GaS744uQPmWBXBI6ZqLder+xi41I4zdp+0x6pn9qEpI=; b=ISCXTQ3qrUuoLWZLbGfzc6VnAcMQpmOiCgFxKljmtGd0a3Y69ooAoU+fh0lUMLqWYc ya+fiFUY4ISCSr5XEUIWobirF8QG4xpR9H2GrvF7K0rOv+DftAl2+GhaOJpZkK9u5c+N XBpfiBiQyUgsC9aN2Te543KUUWEkUbCYMr3KE+UPweJy4Hje85urGvW5XTicrYoFSNBZ wCP0Ge7kjgZvuFAcRuLyLHqo3XXhoFpaFOKOmqnuA8urG8/rETgcydGqeGXsAeiXxAws e2h6M2bvtSiP0MaM4StvBM0RNE5AA9LBWbP7efmO/Ux0k1QLYzb34toDWv4IdbM6v3nQ ru8w== X-Gm-Message-State: ACrzQf3YB2W3KdRGtRCLzXvtbYo4NwS0AyX1E4K2Xci/GoMjJZb7ACdG F43suvPHWojn4oqHfpNO3hasvw== X-Google-Smtp-Source: AMsMyM7Zru2v2oy2fc0p4s8WDOI8tV/3xktMI+8FiQsxGObnErT3TAgXT1mSA2pAQcKMOoEsE1Wyow== X-Received: by 2002:a5d:526d:0:b0:22e:4f4d:2546 with SMTP id l13-20020a5d526d000000b0022e4f4d2546mr96570wrc.464.1664981861462; Wed, 05 Oct 2022 07:57:41 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:40 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:21 +0200 Subject: [PATCH v2 1/5] dt-bindings: mfd: mt6397: add binding for MT6357 MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-1-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=882; i=amergnat@baylibre.com; h=from:subject:message-id; bh=uiI/lTRtppBO+0nDIciFuabIoTVXVizM4YxyzOA2AfE=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZtiqsXNeSVNW2Je72n7QruLLMGxh+hxZPVvbf+4 5YOOY1WJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURdebD/ 9RYcYBY/53YUJ9LuhhvvE86q5/Jf97d9LhIpsn8mrj4Wd9tkluXjGbeP/lYK+pQqcHIyRNJGPMTA09 a7JHSyUzS6VsVO51ZIrsWcFjA0HVjTN2unOsP27q6hFVJPDUfI6uviDZaT2KrV2cGJlGvyYNRvb+ml eiSkwsMqMPXon+1ht14uWBHaowVIINJ432/50NjfV34Z0e9xeUQmopUNeOVkstbEPvrd5OpfXTJIfm ad4mbAAU5Rh6aFQx/N/9zS7LPp+nu8orXEUqr+84VQRYalE4F6kF4TqjXcWvOXR3daihVfvYxjyVjm vurRVuxuKfOTBABlEmkV9BG2LjH2PxWZknp+RpDy9FC74DeB35Jy9ydWBzii/2Sol4ZewPIu1PiAQW c7IDx+Sr2qXVmdWNNZLMaK18l6aqWYKCmJ/FROxoDW+nvaJ777CD3dEiUNa/Dl1NGt2gv39d1Duk3b T4peNdtyAtEnaaZmRUEU3GCP9Npi3xDNiOZ4HT3r+xWbgNnd95W4+7Xg94mesZOFdamhi3s1ag8wP6 sRiZnYOLE/8QcNhkh/ckRYuxnucIGWKCdV1cv6qyFxgZ7McQytWq2SfLN2JNjkOBVDMF4cmxE55tqE t15U9Z7yo0D6LLd+PbrvC+lGenwl0d6K23EKsVx0W6vz3TAuJQzjKBJIcBiA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_075744_203937_C2565D51 X-CRM114-Status: GOOD ( 11.39 ) 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: Fabien Parent Add binding documentation for the MT6357 PMIC. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat Acked-by: Rob Herring --- Documentation/devicetree/bindings/mfd/mt6397.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 0088442efca1..518986c44880 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -21,6 +21,7 @@ Required properties: compatible: "mediatek,mt6323" for PMIC MT6323 "mediatek,mt6331" for PMIC MT6331 and MT6332 + "mediatek,mt6357" for PMIC MT6357 "mediatek,mt6358" for PMIC MT6358 and MT6366 "mediatek,mt6359" for PMIC MT6359 "mediatek,mt6397" for PMIC MT6397 From patchwork Wed Oct 5 14:57:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999311 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 0698AC433F5 for ; Wed, 5 Oct 2022 14:59: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mkIFCm6WlsPFElCbwY2Zi0whPBZS66X5I2QXEfJ+XLI=; b=5Giojmc9gwtvMM FyhVqHEMJdXEr6VBPMWC7fIrx/N0txheCNMpyJGvF9lvX0Q/6LTKcIB139FHSBQAMOBEJ1UfTFpI2 gJHxEY5ezPnZ9PQ4IT463/TlkhaORQBXLwqulPHk9ttyiLBbUxxXxbnBjB8kLn3nvvXxXPthZbnVe Ww0YXZziUGPwrpoUJ6+r5ggWmObGxGsAIyv6t6bUrPjrFX7EysWFKdhOmxFc4A8QHRxSKCkiiUsvk YhVhQv5TfkYT8WnLIKLBr5No6v6Yq5AlwTCwh3HH0xXFVwv9edyxvV6RkIwufVoJ05fLr/BMVtfOx +fQlHAexnlyCW7lwN43A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qU-00EhtO-5w; Wed, 05 Oct 2022 14:58:02 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qE-00EhkM-Cj for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 14:57:48 +0000 Received: by mail-wr1-x434.google.com with SMTP id b7so18730171wrq.9 for ; Wed, 05 Oct 2022 07:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=s+CLRBFlSL1ov10J+uevk8iYtEx5Lrr8EaQpxu9a9Lw=; b=4z/dLjviSn7zfqdTN/An5N64z93GP96nvU8QRIvaYA7odlZMjwUHVN6eNxxdrMPrTF zOsLFff+wqUSKIPA4wuRlkMFxK2E4/RZZH9F1mFy9dD6+/rPQa2MeZYYHiTcGggS7YEv ctp693yr5qI6oa4Njx1ye4WdADunUaSaFrKpT8nCZW/C0wW3ZPBFJBPPkk5orqKrpYXc 7PAgEciHcSO9UJrDjUY8VY7Irn/eA0r1la8im9xFi96VbTvxoCVGkEM+BnSfeVMcR6nG ayGpTe52F8676sFV6owNJ07xum0tjvkJ+IAvWh+BA7vXRJTiVZxxvzzKwW98bhJkJrIl UQXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=s+CLRBFlSL1ov10J+uevk8iYtEx5Lrr8EaQpxu9a9Lw=; b=O+aKMS3Pmd7v/bap/s07v8Yt1sjYBTL0NszT+QxO1XDg49AnX8nRu83ptmIArrQcqi 5Fj8U0bTlrLAXXR0+14WGMVuSCK5MFFl+LtvvsjmgiC6mjYNHaZmQSKrkTr1IHr5OZpd mVqw9knrpixD5oTYYrDJvOfzRmPN0JZz63HTNwhbv4+6E+BK1UeJwYwQj504AZcb3N9E es91ugnBpyB3iu2miUzd9ySdeT/VO36OA8vB2VCd7xRWZSmLrpPceEitPwN9VOSecVgF 22Co+02h/HdMlpZHk5dLutAPzU1iXbbtPfP3INgZwYU5evCKrIUUHH+3t90PAx5qdG6N tPYA== X-Gm-Message-State: ACrzQf3iezsxuBvMV661EvGu+vRtYxXYDQmKFltuoaMn9vonYkUSWmT6 IhPUskN9hJC49cvxuQ2jaIMI3A== X-Google-Smtp-Source: AMsMyM4K9uNjIUEU5oRVePb9o4GJMjsAIa3NMyBDwIbvtm4ZY+x3YXOjJGnKtkk8Wpa5pBXt11tq4Q== X-Received: by 2002:a05:6000:144c:b0:22b:dda:eeb0 with SMTP id v12-20020a056000144c00b0022b0ddaeeb0mr73656wrx.335.1664981862771; Wed, 05 Oct 2022 07:57:42 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:42 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:22 +0200 Subject: [PATCH v2 2/5] dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-2-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=868; i=amergnat@baylibre.com; h=from:subject:message-id; bh=Vrvq5OBgHsKlbdllLY5D49KrDviTWoLwSjjxQY9UWKQ=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZti3Z21O1HcABDeF3kwXbl2TleR4abbscroKfXG a0kzo7OJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURTjmEA Ce29Lt9aj+iS11MB92BXYIkIumWqKh5Zn/Ghtco3wKqQz9pd/vOJFQeU2eNpiXVAn+cmwKck3z8JC4 NhVWR4kkGpcauGXddoiXuJQQZiGVBfDlCx1f6y8x+mCdMLlPTNyT1VTuidevjBFJdzm1TcGQ3gaI2l PMIueAByEfHYIOLCEeOFz2RKzMPco2Q7PMJlMKyAx4MsgX35IhE2m7U7tP+pjsSuoHWavHcyUO1THZ pdAGj4CyESudF54PZxIKbVWxmJAi6CbUPjEnl6rrBxhQHuC+K+cwHnpYjZBxdYVyK4Xf+Mx5ElaSx0 C6dgmUEiir3yya5qO7g7zULwYYX3nn+e3jB9/UgdLxa9qxDmZHKYyLd6AxBzhVMEmYY6FaZhiBGI00 hJvcAmw0Dp1+4D9Z1S7ISfl7DTfH5Qeno/5sIJDEtRsSDZqOuWwRnOhChPe+0TKicwfDm0RcvqHkUh a0Jn8pKpd7HiLbrpYc1DAkWP79iBMx1VzppNf2MDiaRhmBAuW7N5V+P+c1iwcS3BV15h9lMS89ZknK WU5C1jvMa6A2V6pGigCQyDM6GxVvvyWwpG5TfTZPh0ETl4SkweipjpPCUR+zc3vM8EzdVyOqGSOP43 3Up2YYYxH0GxqjyLHtgSzpU56en4HPZysFTQ/EbHy42Sm70bsBmSO4zwSt1w== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_075746_465113_04FDEABD X-CRM114-Status: GOOD ( 11.57 ) 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: Fabien Parent Add binding documentation for the PMIC keys on MT6357. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat Acked-by: Rob Herring Acked-by: Dmitry Torokhov --- Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml index 2f72ec418415..037c3ae9f1c3 100644 --- a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml @@ -26,6 +26,7 @@ properties: enum: - mediatek,mt6323-keys - mediatek,mt6331-keys + - mediatek,mt6357-keys - mediatek,mt6358-keys - mediatek,mt6397-keys From patchwork Wed Oct 5 14:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999313 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 D7A20C433FE for ; Wed, 5 Oct 2022 14:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gBw4PGedZe3k7w8k+Dj1lFfGplAR9cnnMucUFztUscY=; b=VjGPsAfte76ZzQ mpgCQJhB7L0vPqacYh0fDvw867RfmYjoCkw8GEJQob1WDI6x6yfnnQi/MNg0EAChdYCymPjJ+frAG GS8C6DMV2wbJXpk/mooWloVCW97hs+ZSHHcrku8HrWrgVLuNAsVh4nyhFjxSz680vT7ltnjYb8jSs FPO1pSQiyFsXPGIAAABEv29OK77IyvdRuzwk41pTWlaZfQBft72el5mMOaIQEwyPQlyRxGmbliuxe 2OntKMN85F1i4JxgmcNNFCCFc1Iky8TfeoqLYgtUTQXI9liFCIdEyiQgt7K6hm3wkSkoNGtkYtMzO ZuiPtgNoeYVR51xcC4QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qy-00Ei7R-KD; Wed, 05 Oct 2022 14:58:33 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qF-00Ehl9-SD for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 14:57:51 +0000 Received: by mail-wr1-x42e.google.com with SMTP id a10so14007244wrm.12 for ; Wed, 05 Oct 2022 07:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=NMBKaD9Twna7IpylLh1Pii+0NHq3Tt+1dQSxsHPnhnI=; b=Hst2MvqV8VevRzE3etMrA6kSMfvgIuiAfaCynzE7IkR9Io0HI8lg7bUg63JfYMWEkK nPO6tiMwmli6JyRLLt0zoF/wdCk3RP14rzZQ3EGaY+NK1Xo88qkhgedjnLlqUqi+Q6xo AkiKqHTmA5awgOAyJxWwdep5tgd3e80NShEstqKqyZt8WbF8gUec//oD+yoqyT9jeMxR BNPWd9JAJiHkJx2Y3dylQmpEkpjIbaOBP0XleP9d1ifAEaehTXUzZszRIaLM8Dju5Ovr tRzEfCSKSPK3NNudofh+2LOo5vLA2tBDXv8c0R9Ssx/XnRvAyBzKomhAPVkIzDTeU15H s98A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=NMBKaD9Twna7IpylLh1Pii+0NHq3Tt+1dQSxsHPnhnI=; b=wLD/5GoLen29KQPo5Ni0OAtWsC716TcGDsZ9vmVFrtKpB0gGBtNxTaz/WHbJvfDxsC MBbZvqR/Rs8PiGSeU+g0AKh03Pi/Zj0Z3fydEPqQRTPfRw8Gxa9Pbjn17Y1kOk20kGCR Zf+UpObth3l9QRlR7vS73oL1w2pX6Y42fQ30qSx6Ww0DisUlGc0+9+EpbZ7nIA3ZsREf 06twXwkbIDAgpj+P1Y+OJOQRUjONYuJIx/uKlaWq3EBdF8yaLcol+Tl5jYMD0YCpHSIa euH6zqDDDFQkcGEeOnGxavglIQ3i3KglfSKFgIIWdyTYsMTbgBSTNXaHecI5/SPzuQ+o 7Q8Q== X-Gm-Message-State: ACrzQf39GLRzEf80PWtvZWaCeTXs2JpyV4oBVm7pWUXDLJzlCyqzzmkk o2+uEOTT7RWzpZJG2bUxClnH3w== X-Google-Smtp-Source: AMsMyM7PsaiJ6VUmwuOx5ZbJ3KP9mS1WG5DE6w4IVyMiekbda0EK5DLj4DlYpim3B+Fi+gXq5Q1BCQ== X-Received: by 2002:a05:6000:2a3:b0:226:dff3:b031 with SMTP id l3-20020a05600002a300b00226dff3b031mr63751wry.495.1664981863950; Wed, 05 Oct 2022 07:57:43 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:43 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:23 +0200 Subject: [PATCH v2 3/5] dt-bindings: regulator: Add binding schema for mt6357 regulators MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-3-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=11067; i=amergnat@baylibre.com; h=from:subject:message-id; bh=Pf7gUUCDiv8w5usm43co0Y+0T3FAWUVmGhPRNAVLSaA=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZtin1UVLC8DUs0zxbpYgrYJ2HRGTyfHMukneGVc 1+lkXGyJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURXTUEA CBH/ywLdtM7OzUVWzude0dzpseK3dSzpwAdtf+0pqFHTHp8l19WEGI+RCEQ0KmmgdSpsQFZuIcxcz6 Nlg+tbWlerIVP8gBKWe1HAnswK3miNF1CmWd+8cWhrFIX0L6/OnFExdQfh2rs1ZZPLbTk5yosmnWYU nU5anB1h6OMK2p1DHZdacn8hy+6td0SfyqKxADu78mK0LBX6KrFrFdQvjkzBpqXpN9di1rNJFGICq+ vst1TP66ytgUEHkYWlOTTfrSvy9xTWcmDTP1HTm3Kj3C5Tff/7kJ80DK+odfe46amJERvWtJAX6zxm PkZijjH+hh1xflLih99pUthdD6uRXRlGfeQ1zMSm0bvIJfC3eMMSl/priZGC4JV+Ju1+ysEgQ1sJDy T9OqMMaAPmVlZj24rmJpPOsNfFN1IMkLFDnb39M5hJD3M3IkkJq2dSSLIApMll8stZyYhDSBo31hja hxpdBheGpbGXJ6jt3BIsgKQsymBktpRBpFIGFRKTYbBnL4xZncVmUjhvtCuZN9n6TkSYPlnxY91zLS c08YU8AKazCUFmIKayMdAZwR0lEPRtOEm0gOg5sutLa6AJqklInog/3Zotp26rF5el1Ig+F4WX8lFH 9LLOz5No03XzJnBA4T3JMYl47R3DV3Ssx5BsUvBx+UOICrKCCvjFve7bUoCA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_075747_988466_A38EAE3B X-CRM114-Status: GOOD ( 14.36 ) 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: Fabien Parent Add YAML schema for the MediaTek MT6357 regulators. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat --- .../regulator/mediatek,mt6357-regulator.yaml | 284 +++++++++++++++++++++ 1 file changed, 284 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml new file mode 100644 index 000000000000..83ce2cf287dd --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml @@ -0,0 +1,284 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6357-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6357 Regulators + +maintainers: + - Fabien Parent + - Alexandre Mergnat + +description: | + The MT6357 PMIC provides 5 BUCK and 29 LDO. + Regulators and nodes are named according to the regulator type: + buck- and ldo-. + MT6357 regulators node should be sub node of the MT6397 MFD node. + +patternProperties: + "^buck-v(core|modem|pa|proc|s1)$": + type: object + $ref: "regulator.yaml#" + + properties: + regulator-name: + pattern: "^v(core|modem|pa|proc|s1)$" + + unevaluatedProperties: false + + "^ldo-v(aud28|aux18|cama|camd|cn18|cn28|cn33-bt|cn33-wifi|dram)$": + type: object + $ref: "regulator.yaml#" + + properties: + regulator-name: + pattern: "^v(aud28|aux18|cama|camd|cn18|cn28|cn33-bt|cn33-wifi|dram)$" + + unevaluatedProperties: false + + "^ldo-v(efuse|emc|ibr|io18|io28|ldo28|mch|rf12|rf18)$": + type: object + $ref: "regulator.yaml#" + + properties: + regulator-name: + pattern: "^v(efuse|emc|ibr|io18|io28|ldo28|mch|rf12|rf18)$" + + unevaluatedProperties: false + + "^ldo-v(xo22|sim1,sim2|sram-others|sram-proc|usb33|xo22)$": + type: object + $ref: "regulator.yaml#" + + properties: + regulator-name: + pattern: "^v(xo22|sim1,sim2|sram-others|sram-proc|usb33|xo22)$" + + unevaluatedProperties: false + +additionalProperties: false + +examples: + - | + pmic { + regulators { + mt6357_vproc_reg: buck-vproc { + regulator-name = "vproc"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + mt6357_vcore_reg: buck-vcore { + regulator-name = "vcore"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + mt6357_vmodem_reg: buck-vmodem { + regulator-name = "vmodem"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1193750>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <220>; + }; + mt6357_vs1_reg: buck-vs1 { + regulator-name = "vs1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <2200000>; + regulator-ramp-delay = <12500>; + regulator-enable-ramp-delay = <220>; + regulator-always-on; + }; + mt6357_vpa_reg: buck-vpa { + regulator-name = "vpa"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3650000>; + regulator-ramp-delay = <50000>; + regulator-enable-ramp-delay = <220>; + }; + mt6357_vfe28_reg: ldo-vfe28 { + compatible = "regulator-fixed"; + regulator-name = "vfe28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vxo22_reg: ldo-vxo22 { + regulator-name = "vxo22"; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <2400000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf18_reg: ldo-vrf18 { + compatible = "regulator-fixed"; + regulator-name = "vrf18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf12_reg: ldo-vrf12 { + compatible = "regulator-fixed"; + regulator-name = "vrf12"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vefuse_reg: ldo-vefuse { + regulator-name = "vefuse"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn33_bt_reg: ldo-vcn33-bt { + regulator-name = "vcn33-bt"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3500000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn33_wifi_reg: ldo-vcn33-wifi { + regulator-name = "vcn33-wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3500000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn28_reg: ldo-vcn28 { + compatible = "regulator-fixed"; + regulator-name = "vcn28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn18_reg: ldo-vcn18 { + compatible = "regulator-fixed"; + regulator-name = "vcn18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcama_reg: ldo-vcama { + regulator-name = "vcama"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcamd_reg: ldo-vcamd { + regulator-name = "vcamd"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcamio_reg: ldo-vcamio18 { + compatible = "regulator-fixed"; + regulator-name = "vcamio"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vldo28_reg: ldo-vldo28 { + regulator-name = "vldo28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vsram_others_reg: ldo-vsram-others { + regulator-name = "vsram-others"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <110>; + regulator-always-on; + }; + mt6357_vsram_proc_reg: ldo-vsram-proc { + regulator-name = "vsram-proc"; + regulator-min-microvolt = <518750>; + regulator-max-microvolt = <1312500>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <110>; + regulator-always-on; + }; + mt6357_vaux18_reg: ldo-vaux18 { + compatible = "regulator-fixed"; + regulator-name = "vaux18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vaud28_reg: ldo-vaud28 { + compatible = "regulator-fixed"; + regulator-name = "vaud28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio28_reg: ldo-vio28 { + compatible = "regulator-fixed"; + regulator-name = "vio28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio18_reg: ldo-vio18 { + compatible = "regulator-fixed"; + regulator-name = "vio18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + regulator-always-on; + }; + mt6357_vdram_reg: ldo-vdram { + regulator-name = "vdram"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1200000>; + regulator-enable-ramp-delay = <3300>; + }; + mt6357_vmc_reg: ldo-vmc { + regulator-name = "vmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vmch_reg: ldo-vmch { + regulator-name = "vmch"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vemc_reg: ldo-vemc { + regulator-name = "vemc"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + regulator-always-on; + }; + mt6357_vsim1_reg: ldo-vsim1 { + regulator-name = "vsim1"; + regulator-min-microvolt = <1700000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vsim2_reg: ldo-vsim2 { + regulator-name = "vsim2"; + regulator-min-microvolt = <1700000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vibr_reg: ldo-vibr { + regulator-name = "vibr"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <44>; + }; + mt6357_vusb33_reg: ldo-vusb33 { + regulator-name = "vusb33"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3100000>; + regulator-enable-ramp-delay = <264>; + }; + }; + }; +... From patchwork Wed Oct 5 14:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999314 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 ABD3CC433FE for ; Wed, 5 Oct 2022 15:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=icw70GKfmoJqBJiZ7ra4sylDo9r2Iua/p263ulAfd2I=; b=ydYWmon0enWUoF POqM2b+28nEWa0B3azmKWyh1Oz/Ie8g2uKcdZB/DYM8Cb+RNqR6xyeCPPIrbfsNSRjcyEgHHGToOw zF90sF5l5+w0rsZXyB6pBlqslRIwwcSgd9aTz7loz5qO8B46CvShU9qBHnUNdwltqmS6TGAP5QQ6k JeOpVyy251fsu5MwQt89FjDuOmLOmxONvPuRKKlMJOHvAFoL/+8zk4HbhwgplSMosV51XJtLxL7tA S6VLGY2HSJx2Jd4ylx3XC33rWhnRsODzbcWykrEwJ+fSVSfZy5+fFkrJlsiGGt53iUFPkr3Fr/Yg9 3a0r5Tj3i2fgBYwS/0VA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5rW-00EiQm-Au; Wed, 05 Oct 2022 14:59:06 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qF-00Ehly-N3 for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 14:57:52 +0000 Received: by mail-wr1-x430.google.com with SMTP id j7so20990201wrr.3 for ; Wed, 05 Oct 2022 07:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=wNowIsRFCpdTy8thAGpB28NdQRlzq6hS3+3pT15MUFM=; b=rnFRDTQ3mkpIqfdpUEtuMFthYlpo9J4jJCFmIB2+a0tjqp4tyba8oBurSzL0AfbkVn Una4wTj1EAH/Hq0RIKbL9GLz2XhGAn97QguQt5tf3OiCuK7t0LGfCrCw+PziBN9iJGpo aEUC8uQLsKD+RMhn+TQfWzXs5KXo4RiRj5TWk55NybIF4fs/TrVGLmxZCOZdhEg9Y59a nBlrUSTMQo70U09iDf6YIf5zWWa+UOnTwIy6vkb/rFvpKz4afPiGN0j6wIWzGUauZuTm qgUZf7gbJZ1ilm+0nj6C48cCJvRiuNrqeoo4ZomIU7WzJjpGi3ivp2fKN63B7o5bTs8a yVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=wNowIsRFCpdTy8thAGpB28NdQRlzq6hS3+3pT15MUFM=; b=kBvY37x5nqqLbb+SGRKWQQ8bLflpAvKq7qEgtnNjpoazWL1ouQCacPffefDBmB7UaP nSZpP5/LySYg9/QfK0MLPR3QLI17bz3y6SfftL/F69JltK0pzAKKNcwGTgeLjrChWfg9 gF++tluMeXfmVaU9SQNzG9dyoVTomr3uDo+SBO1P6WvWbt33PtjCpe11gUSD0jXzfxdZ FSJTAf2aLS6vEmVESSM3DL3HVXkNWnu7ZLbFSGrKTZ5bGHTwbN8aad/BOmIs5vNpv7Uy +qD7fC8l+G5pnQtWwjPEgUL3tKlLzVjvHFjRSDN8XdRRi5heN3iwUok3Z1Y0Ri/1UMm0 aGoQ== X-Gm-Message-State: ACrzQf05GPwa8Y/h4Y86S9DGRJmHubXfGDCXTW3eygPq8jLRntix1Wyl wpa9JV1XpXNkkOpCYH0oQUJcsg== X-Google-Smtp-Source: AMsMyM61T6qNYrUkfEwi3FQ8mWEJdrJ9l5uQFK0jNiBo9/Gnyus3ACHfy25nFqSSeZ0rVClF3sw5fg== X-Received: by 2002:a05:6000:1a8b:b0:22a:cb74:eaea with SMTP id f11-20020a0560001a8b00b0022acb74eaeamr76176wry.253.1664981865048; Wed, 05 Oct 2022 07:57:45 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:44 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:24 +0200 Subject: [PATCH v2 4/5] regulator: add mt6357 regulator MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-4-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=16868; i=amergnat@baylibre.com; h=from:subject:message-id; bh=7m89e7rgerIPtJUkEwKURLiggz85Nh8CJoiONbInp/w=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZtiENgNxuuF2yW4Fl3jCMyRN8eD/t07xLWPy2b7 +++IjNiJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURQ5VD/ 0YWw788pdQlUinJS0kO5iTi5m7W7CZGSZJ+GQgA5MY1YwPowx0Rou5gTIn7FYjb3Hxo58DYi5bNmr8 NHnyOhZ3L3piBFoZqRjftMMKNQ9Lqeg0PwYU7g6abJAYoFzIGps8A6bznlEZ52edb78ypMSWBuHXKg Ifp2/cHStSZ9fwOLVBxviTVrLwhn7xi9HQ3ibKk9heBXBphdd4pvoSwveIk6sVq4yMSIrdf3DmxLPY 0FbNmRJqyG2N7Z+z2ixi5aBbn3xwQ9pWED+oJDeU0FXI4hELgEz4Xpm3dM4tOVrHkcGX3IFA6Ct5gM o2lmuYlV86ewUe5aJY3fn4H3f3RAmgYAnwWgPVDNrIAp/dBur4QGwtoVap5bM1z3ruUnbR35Km4z5K nXJbQnhLo8K4OeUL7hHCjeviRLf05G797iS8sP6G7q3s0UAIdfRKyqQYIlt+mYRvUhbMVJuIxnVUmn SYp2yoR3d6YEfhfGC6QT3IzLcltIqE9Np3s8w8sUKgvk49g3pEG+j6S+UU1Sa0jdPAETFZpdZP/DqJ X12ZEer7kMCZpZodOAyK84aOrbStsvP24PdsWsc93KOb6ybaU6L6udNyAKkshrwJWe5r6bbL3nu1NX Vuh3xlvWrWRL9jqkjlzqD1LJZdARZTlqzWpVBM+ZWiZ+JDqtJ83yxtDheeRw== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_075747_801548_2C362882 X-CRM114-Status: GOOD ( 21.37 ) 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: Fabien Parent Add regulator driver for the MT6357 PMIC. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat --- drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/mt6357-regulator.c | 485 +++++++++++++++++++++++++++++ include/linux/regulator/mt6357-regulator.h | 51 +++ 4 files changed, 546 insertions(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 070e4403c6c2..a659a57438f4 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -805,6 +805,15 @@ config REGULATOR_MT6332 This driver supports the control of different power rails of device through regulator interface +config REGULATOR_MT6357 + tristate "MediaTek MT6357 PMIC" + depends on MFD_MT6397 + help + Say y here to select this option to enable the power regulator of + MediaTek MT6357 PMIC. + This driver supports the control of different power rails of device + through regulator interface. + config REGULATOR_MT6358 tristate "MediaTek MT6358 PMIC" depends on MFD_MT6397 diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 5962307e1130..e4d67b7b1af6 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -97,6 +97,7 @@ obj-$(CONFIG_REGULATOR_MT6315) += mt6315-regulator.o obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o obj-$(CONFIG_REGULATOR_MT6331) += mt6331-regulator.o obj-$(CONFIG_REGULATOR_MT6332) += mt6332-regulator.o +obj-$(CONFIG_REGULATOR_MT6357) += mt6357-regulator.o obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o obj-$(CONFIG_REGULATOR_MT6359) += mt6359-regulator.o obj-$(CONFIG_REGULATOR_MT6360) += mt6360-regulator.o diff --git a/drivers/regulator/mt6357-regulator.c b/drivers/regulator/mt6357-regulator.c new file mode 100644 index 000000000000..4ecd41429448 --- /dev/null +++ b/drivers/regulator/mt6357-regulator.c @@ -0,0 +1,485 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2022 MediaTek Inc. +// Copyright (c) 2022 BayLibre, SAS. +// Author: Chen Zhong +// Author: Fabien Parent +// +// Based on mt6397-regulator.c +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * MT6357 regulators' information + * + * @desc: standard fields of regulator description. + * @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 mt6357_regulator_info { + struct regulator_desc desc; + const u32 *index_table; + unsigned int n_table; + u32 vsel_shift; + u32 da_vsel_reg; + u32 da_vsel_mask; + u32 da_vsel_shift; +}; + +#define MT6357_BUCK(match, vreg, min, max, step, \ + volt_ranges, vosel_reg, vosel_mask, _da_vsel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_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_reg, \ + .vsel_mask = vosel_mask, \ + .enable_reg = MT6357_BUCK_##vreg##_CON0, \ + .enable_mask = BIT(0), \ + }, \ + .da_vsel_reg = MT6357_BUCK_##vreg##_DBG0, \ + .da_vsel_mask = vosel_mask, \ + .da_vsel_shift = 0, \ +} + +#define MT6357_LDO(match, vreg, ldo_volt_table, \ + ldo_index_table, enreg, vosel, \ + vosel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_table_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = ARRAY_SIZE(ldo_volt_table), \ + .volt_table = ldo_volt_table, \ + .vsel_reg = vosel, \ + .vsel_mask = vosel_mask << 8, \ + .enable_reg = enreg, \ + .enable_mask = BIT(0), \ + }, \ + .index_table = ldo_index_table, \ + .n_table = ARRAY_SIZE(ldo_index_table), \ +} + +#define MT6357_LDO1(match, vreg, min, max, step, volt_ranges, \ + enreg, vosel, vosel_mask) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_range_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_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), \ + }, \ + .da_vsel_reg = MT6357_LDO_##vreg##_DBG0, \ + .da_vsel_mask = 0x7f, \ + .da_vsel_shift = 8, \ +} + +#define MT6357_REG_FIXED(match, vreg, volt) \ +[MT6357_ID_##vreg] = { \ + .desc = { \ + .name = #vreg, \ + .of_match = of_match_ptr(match), \ + .regulators_node = "regulators", \ + .ops = &mt6357_volt_fixed_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = MT6357_ID_##vreg, \ + .owner = THIS_MODULE, \ + .n_voltages = 1, \ + .enable_reg = MT6357_LDO_##vreg##_CON0, \ + .enable_mask = BIT(0), \ + .min_uV = volt, \ + }, \ +} + +static int mt6357_set_voltage_sel(struct regulator_dev *rdev, + unsigned int selector) +{ + int idx, ret; + const u32 *pvol; + struct mt6357_regulator_info *info = rdev_get_drvdata(rdev); + + pvol = info->index_table; + + idx = pvol[selector]; + ret = regmap_update_bits(rdev->regmap, info->desc.vsel_reg, + info->desc.vsel_mask, + idx << 8); + + return ret; +} + +static int mt6357_get_voltage_sel(struct regulator_dev *rdev) +{ + int idx, ret; + u32 selector; + struct mt6357_regulator_info *info = rdev_get_drvdata(rdev); + const u32 *pvol; + + ret = regmap_read(rdev->regmap, info->desc.vsel_reg, &selector); + if (ret != 0) { + dev_info(&rdev->dev, + "Failed to get mt6357 %s vsel reg: %d\n", + info->desc.name, ret); + return ret; + } + + selector = (selector & info->desc.vsel_mask) >> 8; + pvol = info->index_table; + for (idx = 0; idx < info->desc.n_voltages; idx++) { + if (pvol[idx] == selector) + return idx; + } + + return -EINVAL; +} + +static int mt6357_get_buck_voltage_sel(struct regulator_dev *rdev) +{ + int ret, regval; + struct mt6357_regulator_info *info = rdev_get_drvdata(rdev); + + ret = regmap_read(rdev->regmap, info->da_vsel_reg, ®val); + if (ret != 0) { + dev_err(&rdev->dev, + "Failed to get mt6357 Buck %s vsel reg: %d\n", + info->desc.name, ret); + return ret; + } + + ret = (regval & info->da_vsel_mask) >> info->da_vsel_shift; + + return ret; +} + +static const struct regulator_ops mt6357_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 = mt6357_get_buck_voltage_sel, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_ops mt6357_volt_table_ops = { + .list_voltage = regulator_list_voltage_table, + .map_voltage = regulator_map_voltage_iterate, + .set_voltage_sel = mt6357_set_voltage_sel, + .get_voltage_sel = mt6357_get_voltage_sel, + .set_voltage_time_sel = regulator_set_voltage_time_sel, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_ops mt6357_volt_fixed_ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const int vxo22_voltages[] = { + 2200000, + 2400000, +}; + +static const int vefuse_voltages[] = { + 1200000, + 1300000, + 1500000, + 1800000, + 2800000, + 2900000, + 3000000, + 3300000, +}; + +static const int vcn33_voltages[] = { + 3300000, + 3400000, + 3500000, +}; + +static const int vcama_voltages[] = { + 2500000, + 2800000, +}; + +static const int vcamd_voltages[] = { + 1000000, + 1100000, + 1200000, + 1300000, + 1500000, + 1800000, +}; + +static const int vldo28_voltages[] = { + 2800000, + 3000000, +}; + +static const int vdram_voltages[] = { + 1100000, + 1200000, +}; + +static const int vsim_voltages[] = { + 1700000, + 1800000, + 2700000, + 3000000, + 3100000, +}; + +static const int vibr_voltages[] = { + 1200000, + 1300000, + 1500000, + 1800000, + 2000000, + 2800000, + 3000000, + 3300000, +}; + +static const int vmc_voltages[] = { + 1800000, + 2900000, + 3000000, + 3300000, +}; + +static const int vmch_voltages[] = { + 2900000, + 3000000, + 3300000, +}; + +static const int vemc_voltages[] = { + 2900000, + 3000000, + 3300000, +}; + +static const int vusb_voltages[] = { + 3000000, + 3100000, +}; + +static const int vmc_idx[] = { + 4, 10, 11, 13, +}; + +static const int vmch_idx[] = { + 2, 3, 5, +}; + +static const int vemc_idx[] = { + 2, 3, 5, +}; + +static const int vusb_idx[] = { + 3, 4, +}; + +static const int vxo22_idx[] = { + 0, 2, +}; + +static const int vefuse_idx[] = { + 0, 1, 2, 4, 9, 10, 11, 13, +}; + +static const int vcn33_idx[] = { + 1, 2, 3, +}; + +static const int vcama_idx[] = { + 7, 10, +}; + +static const int vcamd_idx[] = { + 4, 5, 6, 7, 9, 12, +}; + +static const int vldo28_idx[] = { + 1, 3, +}; + +static const int vdram_idx[] = { + 1, 2, +}; + +static const int vsim_idx[] = { + 3, 4, 8, 11, 12, +}; + +static const int vibr_idx[] = { + 0, 1, 2, 4, 5, 9, 11, 13, +}; + +static const struct linear_range buck_volt_range1[] = { + REGULATOR_LINEAR_RANGE(518750, 0, 0x7f, 6250), +}; + +static const struct linear_range buck_volt_range2[] = { + REGULATOR_LINEAR_RANGE(500000, 0, 0x7f, 6250), +}; + +static const struct linear_range buck_volt_range3[] = { + REGULATOR_LINEAR_RANGE(500000, 0, 0x3f, 50000), +}; + +static const struct linear_range buck_volt_range4[] = { + REGULATOR_LINEAR_RANGE(1200000, 0, 0x7f, 12500), +}; + +/* The array is indexed by id(MT6357_ID_XXX) */ +static struct mt6357_regulator_info mt6357_regulators[] = { + /* Bucks */ + MT6357_BUCK("buck-vcore", VCORE, 518750, 1312500, 6250, + buck_volt_range1, MT6357_BUCK_VCORE_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vproc", VPROC, 518750, 1312500, 6250, + buck_volt_range1, MT6357_BUCK_VPROC_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vmodem", VMODEM, 500000, 1293750, 6250, + buck_volt_range2, MT6357_BUCK_VMODEM_ELR0, 0x7f, 0x7f), + MT6357_BUCK("buck-vpa", VPA, 500000, 3650000, 50000, + buck_volt_range3, MT6357_BUCK_VPA_CON1, 0x3f, 0x3f), + MT6357_BUCK("buck-vs1", VS1, 1200000, 2787500, 12500, + buck_volt_range4, MT6357_BUCK_VS1_ELR0, 0x7f, 0x7f), + + /* LDOs */ + MT6357_LDO("ldo-vcama", VCAMA, vcama_voltages, vcama_idx, + MT6357_LDO_VCAMA_CON0, MT6357_VCAMA_ANA_CON0, 0xf), + MT6357_LDO("ldo-vcamd", VCAMD, vcamd_voltages, vcamd_idx, + MT6357_LDO_VCAMD_CON0, MT6357_VCAMD_ANA_CON0, 0xf), + MT6357_LDO("ldo-vcn33-bt", VCN33_BT, vcn33_voltages, vcn33_idx, + MT6357_LDO_VCN33_CON0_0, MT6357_VCN33_ANA_CON0, 0x3), + MT6357_LDO("ldo-vcn33-wifi", VCN33_WIFI, vcn33_voltages, vcn33_idx, + MT6357_LDO_VCN33_CON0_1, MT6357_VCN33_ANA_CON0, 0x3), + MT6357_LDO("ldo-vdram", VDRAM, vdram_voltages, vdram_idx, + MT6357_LDO_VDRAM_CON0, MT6357_VDRAM_ELR_2, 0x3), + MT6357_LDO("ldo-vefuse", VEFUSE, vefuse_voltages, vefuse_idx, + MT6357_LDO_VEFUSE_CON0, MT6357_VEFUSE_ANA_CON0, 0xf), + MT6357_LDO("ldo-vemc", VEMC, vemc_voltages, vemc_idx, + MT6357_LDO_VEMC_CON0, MT6357_VEMC_ANA_CON0, 0x7), + MT6357_LDO("ldo-vibr", VIBR, vibr_voltages, vibr_idx, + MT6357_LDO_VIBR_CON0, MT6357_VIBR_ANA_CON0, 0xf), + MT6357_LDO("ldo-vldo28", VLDO28, vldo28_voltages, vldo28_idx, + MT6357_LDO_VLDO28_CON0_0, MT6357_VLDO28_ANA_CON0, 0x3), + MT6357_LDO("ldo-vmc", VMC, vmc_voltages, vmc_idx, + MT6357_LDO_VMC_CON0, MT6357_VMC_ANA_CON0, 0xf), + MT6357_LDO("ldo-vmch", VMCH, vmch_voltages, vmch_idx, + MT6357_LDO_VMCH_CON0, MT6357_VMCH_ANA_CON0, 0x7), + MT6357_LDO("ldo-vsim1", VSIM1, vsim_voltages, vsim_idx, + MT6357_LDO_VSIM1_CON0, MT6357_VSIM1_ANA_CON0, 0xf), + MT6357_LDO("ldo-vsim2", VSIM2, vsim_voltages, vsim_idx, + MT6357_LDO_VSIM2_CON0, MT6357_VSIM2_ANA_CON0, 0xf), + MT6357_LDO("ldo-vusb33", VUSB33, vusb_voltages, vusb_idx, + MT6357_LDO_VUSB33_CON0_0, MT6357_VUSB33_ANA_CON0, 0x7), + MT6357_LDO("ldo-vxo22", VXO22, vxo22_voltages, vxo22_idx, + MT6357_LDO_VXO22_CON0, MT6357_VXO22_ANA_CON0, 0x3), + + MT6357_LDO1("ldo-vsram-proc", VSRAM_PROC, 518750, 1312500, 6250, + buck_volt_range1, MT6357_LDO_VSRAM_PROC_CON0, + MT6357_LDO_VSRAM_CON0, 0x7f), + MT6357_LDO1("ldo-vsram-others", VSRAM_OTHERS, 518750, 1312500, 6250, + buck_volt_range1, MT6357_LDO_VSRAM_OTHERS_CON0, + MT6357_LDO_VSRAM_CON1, 0x7f), + + MT6357_REG_FIXED("ldo-vaud28", VAUD28, 2800000), + MT6357_REG_FIXED("ldo-vaux18", VAUX18, 1800000), + MT6357_REG_FIXED("ldo-vcamio18", VCAMIO, 1800000), + MT6357_REG_FIXED("ldo-vcn18", VCN18, 1800000), + MT6357_REG_FIXED("ldo-vcn28", VCN28, 2800000), + MT6357_REG_FIXED("ldo-vfe28", VFE28, 2800000), + MT6357_REG_FIXED("ldo-vio18", VIO18, 1800000), + MT6357_REG_FIXED("ldo-vio28", VIO28, 2800000), + MT6357_REG_FIXED("ldo-vrf12", VRF12, 1200000), + MT6357_REG_FIXED("ldo-vrf18", VRF18, 1800000), +}; + +static int mt6357_regulator_probe(struct platform_device *pdev) +{ + struct mt6397_chip *mt6357 = dev_get_drvdata(pdev->dev.parent); + struct regulator_config config = {}; + struct regulator_dev *rdev; + int i; + + pdev->dev.of_node = pdev->dev.parent->of_node; + + for (i = 0; i < MT6357_MAX_REGULATOR; i++) { + config.dev = &pdev->dev; + config.driver_data = &mt6357_regulators[i]; + config.regmap = mt6357->regmap; + + rdev = devm_regulator_register(&pdev->dev, + &mt6357_regulators[i].desc, + &config); + if (IS_ERR(rdev)) { + dev_err(&pdev->dev, "failed to register %s\n", + mt6357_regulators[i].desc.name); + return PTR_ERR(rdev); + } + } + + return 0; +} + +static const struct platform_device_id mt6357_platform_ids[] = { + { "mt6357-regulator" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(platform, mt6357_platform_ids); + +static struct platform_driver mt6357_regulator_driver = { + .driver = { + .name = "mt6357-regulator", + }, + .probe = mt6357_regulator_probe, + .id_table = mt6357_platform_ids, +}; + +module_platform_driver(mt6357_regulator_driver); + +MODULE_AUTHOR("Fabien Parent "); +MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6357 PMIC"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/regulator/mt6357-regulator.h b/include/linux/regulator/mt6357-regulator.h new file mode 100644 index 000000000000..238b1ee77ea6 --- /dev/null +++ b/include/linux/regulator/mt6357-regulator.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2022 MediaTek Inc. + */ + +#ifndef __LINUX_REGULATOR_MT6357_H +#define __LINUX_REGULATOR_MT6357_H + +enum { + /* Bucks */ + MT6357_ID_VCORE, + MT6357_ID_VMODEM, + MT6357_ID_VPA, + MT6357_ID_VPROC, + MT6357_ID_VS1, + + /* LDOs */ + MT6357_ID_VAUX18, + MT6357_ID_VAUD28, + MT6357_ID_VCAMA, + MT6357_ID_VCAMD, + MT6357_ID_VCAMIO, + MT6357_ID_VCN18, + MT6357_ID_VCN28, + MT6357_ID_VCN33_BT, + MT6357_ID_VCN33_WIFI, + MT6357_ID_VDRAM, + MT6357_ID_VEFUSE, + MT6357_ID_VEMC, + MT6357_ID_VFE28, + MT6357_ID_VIBR, + MT6357_ID_VIO18, + MT6357_ID_VIO28, + MT6357_ID_VLDO28, + MT6357_ID_VMC, + MT6357_ID_VMCH, + MT6357_ID_VRF12, + MT6357_ID_VRF18, + MT6357_ID_VSIM1, + MT6357_ID_VSIM2, + MT6357_ID_VSRAM_OTHERS, + MT6357_ID_VSRAM_PROC, + MT6357_ID_VUSB33, + MT6357_ID_VXO22, + + MT6357_ID_RG_MAX, +}; + +#define MT6357_MAX_REGULATOR MT6357_ID_RG_MAX + +#endif /* __LINUX_REGULATOR_MT6357_H */ From patchwork Wed Oct 5 14:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 12999315 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 50484C433FE for ; Wed, 5 Oct 2022 15:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5Bx7FqB9Z3/lh/R3aYTeexTproQ2rcbRNaX72TfZVVc=; b=Tv1ZRw69iOldWZ x9kXgMa6rGFjiueKf34rMvDHCv6OOnvISpEUEhJNAQpzCTFmWbe6gIvc5uiiETsoiWygwUg87M9Qg xCfa9GzFDfJ/bO+hZrQF+7GFW3Ir5EwfXkcnqiGHylAdNiOw4mJpK6NwdTw8T+nCIlFv5X88vWhea YZsrJOW8a6jlqndEZ8CjSjbUgqtJFKVCb9b49wSOhmLE+p4yrgLQPSvu+6FRjXaX8H6TD31vAJ99t 5MyzyC1M+ayFSvaA9b8lA+lmT92BkBXYrmE3PCwZke4uh8+RlVahODEHXiINxvP69Z1F3qZmtoTO+ ck9a9rnO9iWIj/eV4I0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5s5-00Eijc-3a; Wed, 05 Oct 2022 14:59:41 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1og5qI-00EhnD-F1 for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 14:57:52 +0000 Received: by mail-wr1-x431.google.com with SMTP id f11so23699607wrm.6 for ; Wed, 05 Oct 2022 07:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date; bh=5LEzJ4YCcZTK5iSxuGcCtaKYesf8mH4mh88+OJy8Eek=; b=Z0relTcGaADogcmitxZSOKrdaUpVfsm9MGuGr/CaYAJCr6pD4x6Kuo0vGjhuNUjOR0 m4tRsM2rax7gyedn8FMTUFRuHpRkfDRsSO7ffhEH7Cp9f+n2A1e1xVXP77w8sXMfEh0M xR9n/U8mgmIOVtkd4opFpN0i+NmS+ERxxICjyYnQzFAuk9Vx2XUFS9pchGvJaxj3iYTg adElNm9hkda9I/struStqpEsd7/KkjXiw1iEbU3fGBx8hlfEd/4Q84sWtSPJo87RGwrh 70aYx0hsI2QEtbXc2cU8q/edTx8UzN4hb89M1vn2m5AhneErnQuKBhh3OfUAEhx9SNK4 VHFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date; bh=5LEzJ4YCcZTK5iSxuGcCtaKYesf8mH4mh88+OJy8Eek=; b=8KVAS+VwTssgi/RXEB8S6rMNCDf+2OXzgOj6R2oKC4Wi2SH+jnF3avaPqVnNNIIEKV 5l92x5GQNog+JcePKJ9W9UmpswyiqzgXl12lda3bZWah1NqDnyvvjnAVsLVHPRWKbdd4 9zlbTkekiCte+a0hJkIB+HQT8k2Dynt7AceZi2RiDmr66hmqPJ41UndSpBfnWZJCCnMT 8DhBr58i2pTjxSaJUdjKE/0/vcZgy4IKHlj5GB7rbdEdcbgzqGNrDSXobCdJYqhck1Pr 3hrCSgJhXxbuzMKbflmS9IBx1jWoSNPgmigp+6HGDeiOzM0I8AUjsuxywEGMOTDyUg0g c6EA== X-Gm-Message-State: ACrzQf03CaamBVoYq3oinzD9LiH24W12DiKWvdm/iyrUVcbHXyuPIyQH 5zvYeIp4Vr4KyQD8XfbP5MnQRg== X-Google-Smtp-Source: AMsMyM5RIDOP0SBHTgVz9cIeHQ3xf/675SJ1zg0vkMRJgYQZ0smzOghgKmsChaaTYVdn8lhx3g56VQ== X-Received: by 2002:adf:fb05:0:b0:228:6463:b15d with SMTP id c5-20020adffb05000000b002286463b15dmr95901wrr.534.1664981866717; Wed, 05 Oct 2022 07:57:46 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id k38-20020a05600c1ca600b003a3170a7af9sm2313758wms.4.2022.10.05.07.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:57:45 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 05 Oct 2022 16:57:25 +0200 Subject: [PATCH v2 5/5] Input: mtk-pmic-keys: add MT6357 support MIME-Version: 1.0 Message-Id: <20221005-mt6357-support-v2-5-f17ba2d2d0a9@baylibre.com> References: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> In-Reply-To: <20221005-mt6357-support-v2-0-f17ba2d2d0a9@baylibre.com> To: Lee Jones , Mark Brown , Matthias Brugger , Rob Herring , Liam Girdwood , Krzysztof Kozlowski , Dmitry Torokhov , Chen Zhong Cc: linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=amergnat@baylibre.com; h=from:subject:message-id; bh=K+NtkSoTyty3WNtqny3ZNRZqV9d7SWTjFAQ6sSNyyMw=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjPZtiUzTmaPYNKYUV3W/stU4RFeLEKuVzt2ZzEqp/ Eq6ivv+JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCYz2bYgAKCRArRkmdfjHURUSiD/ 9sA4ZHNufNW0mMKCBepfnBrZ6W30ICWNvG+puYQvyX/jwxtj2IuDK+24Mh1zWfMtIUQeSW0T57XDoi 0ghn+UGPc1bfvlMsd9/XBIEzfqJBNYOsGZDXJekiMu2RnvOsUDnpwTn5f/mvhXLTURVzqDugUc6Oz3 /PHQNz/FNtHEo1vN8BPoGboWkKJf7QsfaQzD6yljthQ86IyLobiFeTS0umNxK3d7YRWLsUUoxNdxA+ 3iLXSyPZc2o1a8bi5CfWL/zvbWSauPcgj3BpN4jY4+GeUSz32+j1PqxE1vkcfO7SAxSPBr3qzUTnC/ IKwuSMqmMNxoD8NiMcH6tX2CXOSxhNHnTHlyvjOGNDv7krLQyVjGORuKvRS9UVXAO/OCqeOpGNZIhQ JciObzKUp3Q1XfnaczjG/Mh3Hk2EDAkCg+lWTC8s6LI9h2kmuJIsomFnAUs5yfqJspDRTPSdYB3u4w oQ5kxjH7JMve0b8aqTPkQ6hz2Nftwl5bGl1aPtQUUG8viXIvRaucyPrZjhEWAUUeqKdcC99BLlRJjM AmyUMcmlvzo2OwGaVEe8Gw3tIsBer+cDkRvEg3vxGM+Hs2awbUPmNjvBiRI3AzF/JJ1kQ2mYPYYneA mrSVR3VxVlZw0HzMwiz0qDW5WY4BVztDoCexJRkFvYB9qLvqWrx1Y+sTWc2A== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_075750_530623_A3AFBF7B X-CRM114-Status: GOOD ( 13.20 ) 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: Fabien Parent Add PMIC Keys support on MT6357 SoC. Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat Reviewed-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno Acked-by: Dmitry Torokhov --- drivers/input/keyboard/mtk-pmic-keys.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c index 9b34da0ec260..2a63e0718eb6 100644 --- a/drivers/input/keyboard/mtk-pmic-keys.c +++ b/drivers/input/keyboard/mtk-pmic-keys.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -90,6 +91,19 @@ static const struct mtk_pmic_regs mt6331_regs = { .rst_lprst_mask = MTK_PMIC_MT6331_RST_DU_MASK, }; +static const struct mtk_pmic_regs mt6357_regs = { + .keys_regs[MTK_PMIC_PWRKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x2, MT6357_PSC_TOP_INT_CON0, 0x5, + MTK_PMIC_PWRKEY_RST), + .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = + MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS, + 0x8, MT6357_PSC_TOP_INT_CON0, 0xa, + MTK_PMIC_HOMEKEY_INDEX), + .pmic_rst_reg = MT6357_TOP_RST_MISC, + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, +}; + static const struct mtk_pmic_regs mt6358_regs = { .keys_regs[MTK_PMIC_PWRKEY_INDEX] = MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, @@ -276,6 +290,9 @@ static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { }, { .compatible = "mediatek,mt6331-keys", .data = &mt6331_regs, + }, { + .compatible = "mediatek,mt6357-keys", + .data = &mt6357_regs, }, { .compatible = "mediatek,mt6358-keys", .data = &mt6358_regs,