From patchwork Tue Sep 22 10:20:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5523A92C for ; Tue, 22 Sep 2020 10:21:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 191AA2395C for ; Tue, 22 Sep 2020 10:21:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tsnj2f7F"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d2xJ/AS0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 191AA2395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=igBTbdkF4IFrTOxuaWOL7ENVmEkX8g8rGyrvNdQxnZ8=; b=tsnj2f7FqnZquH0ZZVe9a77JcW 4trr/oyaOgHTH89WTEnYu01zLKKm+v9C5UJS+1Rk6LidNS+ePE8n93XQlOWlYk6vOyUYuva8jmJdA WKhqJ2z3Wet/EwDXWLmkTxjIwbx+ooOlw5MU0RdwpUw4lI1Va+tOAEqMfUHrqnqxzlL2hqTZ5PKVQ DVN5YOJ5xZCyqJnlOnF225htskkEjmP0fYUUWijmCA5h0/ya85G1a6WTQMcMjvuqO33C9e1oYfz52 whs7djglcSlkhbd1Jb1uiDWRaKVdTN/V0vWyc7zjvSKEPw+TzH3kgiyzap9LsEbgMUvxT5gnHeohv +AKnHX+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQ3-00008r-4t; Tue, 22 Sep 2020 10:21:07 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfPf-0008Ti-Hz; Tue, 22 Sep 2020 10:20:46 +0000 Received: by mail-pf1-x443.google.com with SMTP id o20so11996142pfp.11; Tue, 22 Sep 2020 03:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dBXfFm02ABja54Il3Ns8zFaadLu9ijtBeVpM6C5JJKM=; b=d2xJ/AS0OXnGh0GB5/37HpA/0bJdQ+zvN17J5kMYdFyOBp+Y3cSce21/YWN6gqowRS vzK3SCVQC5FU7KZX6/0Jb89YbaD+CEELfsso8VbeFiyUfz0aKtuCzIA5upTLBi6OHYRE PXC5GbA8XyNbfqDVbC58LghYM7EWPh85bDmPemUdvKb3L+EbieN3Q0lCM/oxCgA9BmRB +1oqJuraJ8DyZV30vfBGDaPaqrvqNetcp/IH88vuTsPdngA1nCxDU8MTcZlV3PxVd09y sMVV1bETd5/HkDmPTOY++vxzOvZptq8Ho6YunDumsiKQiLcpeNmqwB2NwD9GtTs28M/K 2SgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dBXfFm02ABja54Il3Ns8zFaadLu9ijtBeVpM6C5JJKM=; b=r0wfmVyRwPF63QMnJcxNCcB5RhIIezhHVGlwtuuCXAgxc9YPEr+pTH+zsDf89ECxqx /bh3nk9O5dIvPMoPzBLZ7aOla0viF7JhLrxkzwDW3KFGR4wR14LiBWSbcUZxbBYPFOLH 9uwwl9w6Xl7ui2RJhZqXfQqcGU6x7g+c8/q4UGd1XhEb8TG15tTAePQCy3HNVkKg5dOi frtuXzAtImnMtcX389QPMuXPJlaPbfXGAPk+XweIfI6QLEGn7U1IZesFGBxtDBjWtl0u 1Hf4l9duKbXv6kTrIk4pC1GUGHuBd/A8Y5Mnh1tABvYp7mZvjBuKsqIhNtjDDa5NKeHx su1Q== X-Gm-Message-State: AOAM530VE3xFXdnIRD0x7J6bgzf4/ybv2MuNRqXkDzrCvl0J/u0ospCt e7SDuHhHpDUQzhVjoED5IdE= X-Google-Smtp-Source: ABdhPJx+dbzaWf232yxuvjzFKMUa5e9oNikBx07/hKGXRREufBPy4+N/4bRtLIQ5AUPqSiOXGfeXSw== X-Received: by 2002:aa7:8dc9:0:b029:150:e9ad:952 with SMTP id j9-20020aa78dc90000b0290150e9ad0952mr2056365pfr.61.1600770041749; Tue, 22 Sep 2020 03:20:41 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:20:41 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 01/10] mfd: mt6360: Rearrange include file Date: Tue, 22 Sep 2020 18:20:09 +0800 Message-Id: <1600770019-11585-2-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062044_433464_F5344E40 X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Rearrange include file without sorting by alphabet. Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index e9cacc2..c7a955f 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -5,15 +5,14 @@ * Author: Gene Chen */ +#include #include -#include #include #include #include #include -#include -#include -#include +#include +#include #include From patchwork Tue Sep 22 10:20:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792085 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 638F092C for ; Tue, 22 Sep 2020 10:21:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1206A2395C for ; Tue, 22 Sep 2020 10:21:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CUbajIL5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GpVK59zF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1206A2395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=05ujYKA1/z5cia2iQtCO6E1xk1IuHZGcWNyUiWIttzM=; b=CUbajIL5Vda1UtjP4RHBLgtIo+ rseCoCDAysUtw41/ZKLgtkJ/QrhjR9vbw0/O7CgM1AxsjaM1TQav4WNOHtffDZFOSgmRsoV2BMC9o yjXuqtQtRnrH/sIyGxBL/7eN8oEO3Cd6Me98eUVZVP0S2qQ+ft/JeG1f3md+nsbfOvsGncuPVa1V1 X29C2arRGA1iW6UmnIe+eBI7LrTpDHpEiHq0q6XRxUXiORs3pJs0Xbj8ikb5KXWA6uv9h87kJINRB yfYUWO0zI3GtfgCbdOFFY/LlZXoFcaMws7iEMoa/UFCYAqdhShkZDls3lL5GKixFtRJsv48rqjdwD vAvCqjpg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQQ-0000Fi-73; Tue, 22 Sep 2020 10:21:30 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfPl-0008VI-CB; Tue, 22 Sep 2020 10:20:51 +0000 Received: by mail-pf1-x433.google.com with SMTP id n14so12001118pff.6; Tue, 22 Sep 2020 03:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pAL7VJIKxzvdehowDaCmn7j/SyMHBaQCLka41WyDZsU=; b=GpVK59zF7rsQ5Q+weCY2KzZtm6acOTdGqHA2QllvvHXVq6yZ8NR//rPli7P8mwCCxd ZFxrbI6V7hqbkEdbSKbb20D72bVhURKQ9dK8uIDYUwyWOo21NaXrpMhkIkWXOlPbseha 5flBhbdPGGVorq4dyFD5nLeDtw6lN59sJ+b05gR8BjcBQqSIssP6J+5STDya13xPOJAK GHexi0DEh1py42zhXiLR3di01HksFuVgYzuPS6qeSqZN7QD+YStly5+yaTWYeesNLSJx VadkPaDXwmEjFi8J9GpyFSmU0A0cJxKz0yOFRZOw6dWH4fqLE83uZkaaNRIWCRRG1tqG 8yjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pAL7VJIKxzvdehowDaCmn7j/SyMHBaQCLka41WyDZsU=; b=qHSeobxsVxWz1TUzwbpx9V2MQ54/OrEUi+UmEWfNvu4LzYVEEAGmgiJoQmi9O6MhjY oWcyUtH85ZxwJPwfGpD5qDSK4SVbBIMRm3nycn8PFlcnG2GpFSyvUx47SazIUi2RoLny mqFAO6Q+LRy76CMVmXaAkxTPXlD6zgQZ8rAOpQ6mAsi3wgb0C2MVU6YRoZ3uv9x9wvW7 yqJk8lfXUv6FVc194CGsj1zGkvmjNcK5eyPW0c6Uc2E5z7Sr2FLGV9opMuaFkcrgzw26 MRLe4GmT4NIYzH8z1pm+qW7ZX/2SO59sDYCp7LS5asO7zZexp9o+3ilbDuRflHglfQnt ZG1w== X-Gm-Message-State: AOAM530eLzMk1O6II2VUXup9o75Fx3mTPxye0F/U+8qePTF4Iq9SWEDF ZZZLPNLK8ahSO0kSfrIIU7fAcHjanRc= X-Google-Smtp-Source: ABdhPJyoPVwlheRaiMvqw+0y2soGzjT61T8ouJrJYjRf40CQZOWvx83WnHavaQaWXH1I38C4r+/4vw== X-Received: by 2002:a17:902:a402:b029:d2:21a:d994 with SMTP id p2-20020a170902a402b02900d2021ad994mr3876156plq.52.1600770047262; Tue, 22 Sep 2020 03:20:47 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:20:46 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 02/10] mfd: mt6360: Remove redundant brackets around raw numbers Date: Tue, 22 Sep 2020 18:20:10 +0800 Message-Id: <1600770019-11585-3-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062049_569787_19037EC9 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:433 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Remove redundant brackets around raw numbers. Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 172 +++++++++---------- include/linux/mfd/mt6360.h | 410 ++++++++++++++++++++++----------------------- 2 files changed, 291 insertions(+), 291 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index c7a955f..befee70 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -17,107 +17,107 @@ #include /* reg 0 -> 0 ~ 7 */ -#define MT6360_CHG_TREG_EVT (4) -#define MT6360_CHG_AICR_EVT (5) -#define MT6360_CHG_MIVR_EVT (6) -#define MT6360_PWR_RDY_EVT (7) +#define MT6360_CHG_TREG_EVT 4 +#define MT6360_CHG_AICR_EVT 5 +#define MT6360_CHG_MIVR_EVT 6 +#define MT6360_PWR_RDY_EVT 7 /* REG 1 -> 8 ~ 15 */ -#define MT6360_CHG_BATSYSUV_EVT (9) -#define MT6360_FLED_CHG_VINOVP_EVT (11) -#define MT6360_CHG_VSYSUV_EVT (12) -#define MT6360_CHG_VSYSOV_EVT (13) -#define MT6360_CHG_VBATOV_EVT (14) -#define MT6360_CHG_VBUSOV_EVT (15) +#define MT6360_CHG_BATSYSUV_EVT 9 +#define MT6360_FLED_CHG_VINOVP_EVT 11 +#define MT6360_CHG_VSYSUV_EVT 12 +#define MT6360_CHG_VSYSOV_EVT 13 +#define MT6360_CHG_VBATOV_EVT 14 +#define MT6360_CHG_VBUSOV_EVT 15 /* REG 2 -> 16 ~ 23 */ /* REG 3 -> 24 ~ 31 */ -#define MT6360_WD_PMU_DET (25) -#define MT6360_WD_PMU_DONE (26) -#define MT6360_CHG_TMRI (27) -#define MT6360_CHG_ADPBADI (29) -#define MT6360_CHG_RVPI (30) -#define MT6360_OTPI (31) +#define MT6360_WD_PMU_DET 25 +#define MT6360_WD_PMU_DONE 26 +#define MT6360_CHG_TMRI 27 +#define MT6360_CHG_ADPBADI 29 +#define MT6360_CHG_RVPI 30 +#define MT6360_OTPI 31 /* REG 4 -> 32 ~ 39 */ -#define MT6360_CHG_AICCMEASL (32) -#define MT6360_CHGDET_DONEI (34) -#define MT6360_WDTMRI (35) -#define MT6360_SSFINISHI (36) -#define MT6360_CHG_RECHGI (37) -#define MT6360_CHG_TERMI (38) -#define MT6360_CHG_IEOCI (39) +#define MT6360_CHG_AICCMEASL 32 +#define MT6360_CHGDET_DONEI 34 +#define MT6360_WDTMRI 35 +#define MT6360_SSFINISHI 36 +#define MT6360_CHG_RECHGI 37 +#define MT6360_CHG_TERMI 38 +#define MT6360_CHG_IEOCI 39 /* REG 5 -> 40 ~ 47 */ -#define MT6360_PUMPX_DONEI (40) -#define MT6360_BAT_OVP_ADC_EVT (41) -#define MT6360_TYPEC_OTP_EVT (42) -#define MT6360_ADC_WAKEUP_EVT (43) -#define MT6360_ADC_DONEI (44) -#define MT6360_BST_BATUVI (45) -#define MT6360_BST_VBUSOVI (46) -#define MT6360_BST_OLPI (47) +#define MT6360_PUMPX_DONEI 40 +#define MT6360_BAT_OVP_ADC_EVT 41 +#define MT6360_TYPEC_OTP_EVT 42 +#define MT6360_ADC_WAKEUP_EVT 43 +#define MT6360_ADC_DONEI 44 +#define MT6360_BST_BATUVI 45 +#define MT6360_BST_VBUSOVI 46 +#define MT6360_BST_OLPI 47 /* REG 6 -> 48 ~ 55 */ -#define MT6360_ATTACH_I (48) -#define MT6360_DETACH_I (49) -#define MT6360_QC30_STPDONE (51) -#define MT6360_QC_VBUSDET_DONE (52) -#define MT6360_HVDCP_DET (53) -#define MT6360_CHGDETI (54) -#define MT6360_DCDTI (55) +#define MT6360_ATTACH_I 48 +#define MT6360_DETACH_I 49 +#define MT6360_QC30_STPDONE 51 +#define MT6360_QC_VBUSDET_DONE 52 +#define MT6360_HVDCP_DET 53 +#define MT6360_CHGDETI 54 +#define MT6360_DCDTI 55 /* REG 7 -> 56 ~ 63 */ -#define MT6360_FOD_DONE_EVT (56) -#define MT6360_FOD_OV_EVT (57) -#define MT6360_CHRDET_UVP_EVT (58) -#define MT6360_CHRDET_OVP_EVT (59) -#define MT6360_CHRDET_EXT_EVT (60) -#define MT6360_FOD_LR_EVT (61) -#define MT6360_FOD_HR_EVT (62) -#define MT6360_FOD_DISCHG_FAIL_EVT (63) +#define MT6360_FOD_DONE_EVT 56 +#define MT6360_FOD_OV_EVT 57 +#define MT6360_CHRDET_UVP_EVT 58 +#define MT6360_CHRDET_OVP_EVT 59 +#define MT6360_CHRDET_EXT_EVT 60 +#define MT6360_FOD_LR_EVT 61 +#define MT6360_FOD_HR_EVT 62 +#define MT6360_FOD_DISCHG_FAIL_EVT 63 /* REG 8 -> 64 ~ 71 */ -#define MT6360_USBID_EVT (64) -#define MT6360_APWDTRST_EVT (65) -#define MT6360_EN_EVT (66) -#define MT6360_QONB_RST_EVT (67) -#define MT6360_MRSTB_EVT (68) -#define MT6360_OTP_EVT (69) -#define MT6360_VDDAOV_EVT (70) -#define MT6360_SYSUV_EVT (71) +#define MT6360_USBID_EVT 64 +#define MT6360_APWDTRST_EVT 65 +#define MT6360_EN_EVT 66 +#define MT6360_QONB_RST_EVT 67 +#define MT6360_MRSTB_EVT 68 +#define MT6360_OTP_EVT 69 +#define MT6360_VDDAOV_EVT 70 +#define MT6360_SYSUV_EVT 71 /* REG 9 -> 72 ~ 79 */ -#define MT6360_FLED_STRBPIN_EVT (72) -#define MT6360_FLED_TORPIN_EVT (73) -#define MT6360_FLED_TX_EVT (74) -#define MT6360_FLED_LVF_EVT (75) -#define MT6360_FLED2_SHORT_EVT (78) -#define MT6360_FLED1_SHORT_EVT (79) +#define MT6360_FLED_STRBPIN_EVT 72 +#define MT6360_FLED_TORPIN_EVT 73 +#define MT6360_FLED_TX_EVT 74 +#define MT6360_FLED_LVF_EVT 75 +#define MT6360_FLED2_SHORT_EVT 78 +#define MT6360_FLED1_SHORT_EVT 79 /* REG 10 -> 80 ~ 87 */ -#define MT6360_FLED2_STRB_EVT (80) -#define MT6360_FLED1_STRB_EVT (81) -#define MT6360_FLED2_STRB_TO_EVT (82) -#define MT6360_FLED1_STRB_TO_EVT (83) -#define MT6360_FLED2_TOR_EVT (84) -#define MT6360_FLED1_TOR_EVT (85) +#define MT6360_FLED2_STRB_EVT 80 +#define MT6360_FLED1_STRB_EVT 81 +#define MT6360_FLED2_STRB_TO_EVT 82 +#define MT6360_FLED1_STRB_TO_EVT 83 +#define MT6360_FLED2_TOR_EVT 84 +#define MT6360_FLED1_TOR_EVT 85 /* REG 11 -> 88 ~ 95 */ /* REG 12 -> 96 ~ 103 */ -#define MT6360_BUCK1_PGB_EVT (96) -#define MT6360_BUCK1_OC_EVT (100) -#define MT6360_BUCK1_OV_EVT (101) -#define MT6360_BUCK1_UV_EVT (102) +#define MT6360_BUCK1_PGB_EVT 96 +#define MT6360_BUCK1_OC_EVT 100 +#define MT6360_BUCK1_OV_EVT 101 +#define MT6360_BUCK1_UV_EVT 102 /* REG 13 -> 104 ~ 111 */ -#define MT6360_BUCK2_PGB_EVT (104) -#define MT6360_BUCK2_OC_EVT (108) -#define MT6360_BUCK2_OV_EVT (109) -#define MT6360_BUCK2_UV_EVT (110) +#define MT6360_BUCK2_PGB_EVT 104 +#define MT6360_BUCK2_OC_EVT 108 +#define MT6360_BUCK2_OV_EVT 109 +#define MT6360_BUCK2_UV_EVT 110 /* REG 14 -> 112 ~ 119 */ -#define MT6360_LDO1_OC_EVT (113) -#define MT6360_LDO2_OC_EVT (114) -#define MT6360_LDO3_OC_EVT (115) -#define MT6360_LDO5_OC_EVT (117) -#define MT6360_LDO6_OC_EVT (118) -#define MT6360_LDO7_OC_EVT (119) +#define MT6360_LDO1_OC_EVT 113 +#define MT6360_LDO2_OC_EVT 114 +#define MT6360_LDO3_OC_EVT 115 +#define MT6360_LDO5_OC_EVT 117 +#define MT6360_LDO6_OC_EVT 118 +#define MT6360_LDO7_OC_EVT 119 /* REG 15 -> 120 ~ 127 */ -#define MT6360_LDO1_PGB_EVT (121) -#define MT6360_LDO2_PGB_EVT (122) -#define MT6360_LDO3_PGB_EVT (123) -#define MT6360_LDO5_PGB_EVT (125) -#define MT6360_LDO6_PGB_EVT (126) -#define MT6360_LDO7_PGB_EVT (127) +#define MT6360_LDO1_PGB_EVT 121 +#define MT6360_LDO2_PGB_EVT 122 +#define MT6360_LDO3_PGB_EVT 123 +#define MT6360_LDO5_PGB_EVT 125 +#define MT6360_LDO6_PGB_EVT 126 +#define MT6360_LDO7_PGB_EVT 127 static const struct regmap_irq mt6360_pmu_irqs[] = { REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8), diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h index ea13040..72edf13 100644 --- a/include/linux/mfd/mt6360.h +++ b/include/linux/mfd/mt6360.h @@ -16,10 +16,10 @@ enum { MT6360_SLAVE_MAX, }; -#define MT6360_PMU_SLAVEID (0x34) -#define MT6360_PMIC_SLAVEID (0x1A) -#define MT6360_LDO_SLAVEID (0x64) -#define MT6360_TCPC_SLAVEID (0x4E) +#define MT6360_PMU_SLAVEID 0x34 +#define MT6360_PMIC_SLAVEID 0x1A +#define MT6360_LDO_SLAVEID 0x64 +#define MT6360_TCPC_SLAVEID 0x4E struct mt6360_pmu_data { struct i2c_client *i2c[MT6360_SLAVE_MAX]; @@ -30,211 +30,211 @@ struct mt6360_pmu_data { }; /* PMU register defininition */ -#define MT6360_PMU_DEV_INFO (0x00) -#define MT6360_PMU_CORE_CTRL1 (0x01) -#define MT6360_PMU_RST1 (0x02) -#define MT6360_PMU_CRCEN (0x03) -#define MT6360_PMU_RST_PAS_CODE1 (0x04) -#define MT6360_PMU_RST_PAS_CODE2 (0x05) -#define MT6360_PMU_CORE_CTRL2 (0x06) -#define MT6360_PMU_TM_PAS_CODE1 (0x07) -#define MT6360_PMU_TM_PAS_CODE2 (0x08) -#define MT6360_PMU_TM_PAS_CODE3 (0x09) -#define MT6360_PMU_TM_PAS_CODE4 (0x0A) -#define MT6360_PMU_IRQ_IND (0x0B) -#define MT6360_PMU_IRQ_MASK (0x0C) -#define MT6360_PMU_IRQ_SET (0x0D) -#define MT6360_PMU_SHDN_CTRL (0x0E) -#define MT6360_PMU_TM_INF (0x0F) -#define MT6360_PMU_I2C_CTRL (0x10) -#define MT6360_PMU_CHG_CTRL1 (0x11) -#define MT6360_PMU_CHG_CTRL2 (0x12) -#define MT6360_PMU_CHG_CTRL3 (0x13) -#define MT6360_PMU_CHG_CTRL4 (0x14) -#define MT6360_PMU_CHG_CTRL5 (0x15) -#define MT6360_PMU_CHG_CTRL6 (0x16) -#define MT6360_PMU_CHG_CTRL7 (0x17) -#define MT6360_PMU_CHG_CTRL8 (0x18) -#define MT6360_PMU_CHG_CTRL9 (0x19) -#define MT6360_PMU_CHG_CTRL10 (0x1A) -#define MT6360_PMU_CHG_CTRL11 (0x1B) -#define MT6360_PMU_CHG_CTRL12 (0x1C) -#define MT6360_PMU_CHG_CTRL13 (0x1D) -#define MT6360_PMU_CHG_CTRL14 (0x1E) -#define MT6360_PMU_CHG_CTRL15 (0x1F) -#define MT6360_PMU_CHG_CTRL16 (0x20) -#define MT6360_PMU_CHG_AICC_RESULT (0x21) -#define MT6360_PMU_DEVICE_TYPE (0x22) -#define MT6360_PMU_QC_CONTROL1 (0x23) -#define MT6360_PMU_QC_CONTROL2 (0x24) -#define MT6360_PMU_QC30_CONTROL1 (0x25) -#define MT6360_PMU_QC30_CONTROL2 (0x26) -#define MT6360_PMU_USB_STATUS1 (0x27) -#define MT6360_PMU_QC_STATUS1 (0x28) -#define MT6360_PMU_QC_STATUS2 (0x29) -#define MT6360_PMU_CHG_PUMP (0x2A) -#define MT6360_PMU_CHG_CTRL17 (0x2B) -#define MT6360_PMU_CHG_CTRL18 (0x2C) -#define MT6360_PMU_CHRDET_CTRL1 (0x2D) -#define MT6360_PMU_CHRDET_CTRL2 (0x2E) -#define MT6360_PMU_DPDN_CTRL (0x2F) -#define MT6360_PMU_CHG_HIDDEN_CTRL1 (0x30) -#define MT6360_PMU_CHG_HIDDEN_CTRL2 (0x31) -#define MT6360_PMU_CHG_HIDDEN_CTRL3 (0x32) -#define MT6360_PMU_CHG_HIDDEN_CTRL4 (0x33) -#define MT6360_PMU_CHG_HIDDEN_CTRL5 (0x34) -#define MT6360_PMU_CHG_HIDDEN_CTRL6 (0x35) -#define MT6360_PMU_CHG_HIDDEN_CTRL7 (0x36) -#define MT6360_PMU_CHG_HIDDEN_CTRL8 (0x37) -#define MT6360_PMU_CHG_HIDDEN_CTRL9 (0x38) -#define MT6360_PMU_CHG_HIDDEN_CTRL10 (0x39) -#define MT6360_PMU_CHG_HIDDEN_CTRL11 (0x3A) -#define MT6360_PMU_CHG_HIDDEN_CTRL12 (0x3B) -#define MT6360_PMU_CHG_HIDDEN_CTRL13 (0x3C) -#define MT6360_PMU_CHG_HIDDEN_CTRL14 (0x3D) -#define MT6360_PMU_CHG_HIDDEN_CTRL15 (0x3E) -#define MT6360_PMU_CHG_HIDDEN_CTRL16 (0x3F) -#define MT6360_PMU_CHG_HIDDEN_CTRL17 (0x40) -#define MT6360_PMU_CHG_HIDDEN_CTRL18 (0x41) -#define MT6360_PMU_CHG_HIDDEN_CTRL19 (0x42) -#define MT6360_PMU_CHG_HIDDEN_CTRL20 (0x43) -#define MT6360_PMU_CHG_HIDDEN_CTRL21 (0x44) -#define MT6360_PMU_CHG_HIDDEN_CTRL22 (0x45) -#define MT6360_PMU_CHG_HIDDEN_CTRL23 (0x46) -#define MT6360_PMU_CHG_HIDDEN_CTRL24 (0x47) -#define MT6360_PMU_CHG_HIDDEN_CTRL25 (0x48) -#define MT6360_PMU_BC12_CTRL (0x49) -#define MT6360_PMU_CHG_STAT (0x4A) -#define MT6360_PMU_RESV1 (0x4B) -#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEH (0x4E) -#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEL (0x4F) -#define MT6360_PMU_TYPEC_OTP_HYST_TH (0x50) -#define MT6360_PMU_TYPEC_OTP_CTRL (0x51) -#define MT6360_PMU_ADC_BAT_DATA_H (0x52) -#define MT6360_PMU_ADC_BAT_DATA_L (0x53) -#define MT6360_PMU_IMID_BACKBST_ON (0x54) -#define MT6360_PMU_IMID_BACKBST_OFF (0x55) -#define MT6360_PMU_ADC_CONFIG (0x56) -#define MT6360_PMU_ADC_EN2 (0x57) -#define MT6360_PMU_ADC_IDLE_T (0x58) -#define MT6360_PMU_ADC_RPT_1 (0x5A) -#define MT6360_PMU_ADC_RPT_2 (0x5B) -#define MT6360_PMU_ADC_RPT_3 (0x5C) -#define MT6360_PMU_ADC_RPT_ORG1 (0x5D) -#define MT6360_PMU_ADC_RPT_ORG2 (0x5E) -#define MT6360_PMU_BAT_OVP_TH_SEL_CODEH (0x5F) -#define MT6360_PMU_BAT_OVP_TH_SEL_CODEL (0x60) -#define MT6360_PMU_CHG_CTRL19 (0x61) -#define MT6360_PMU_VDDASUPPLY (0x62) -#define MT6360_PMU_BC12_MANUAL (0x63) -#define MT6360_PMU_CHGDET_FUNC (0x64) -#define MT6360_PMU_FOD_CTRL (0x65) -#define MT6360_PMU_CHG_CTRL20 (0x66) -#define MT6360_PMU_CHG_HIDDEN_CTRL26 (0x67) -#define MT6360_PMU_CHG_HIDDEN_CTRL27 (0x68) -#define MT6360_PMU_RESV2 (0x69) -#define MT6360_PMU_USBID_CTRL1 (0x6D) -#define MT6360_PMU_USBID_CTRL2 (0x6E) -#define MT6360_PMU_USBID_CTRL3 (0x6F) -#define MT6360_PMU_FLED_CFG (0x70) -#define MT6360_PMU_RESV3 (0x71) -#define MT6360_PMU_FLED1_CTRL (0x72) -#define MT6360_PMU_FLED_STRB_CTRL (0x73) -#define MT6360_PMU_FLED1_STRB_CTRL2 (0x74) -#define MT6360_PMU_FLED1_TOR_CTRL (0x75) -#define MT6360_PMU_FLED2_CTRL (0x76) -#define MT6360_PMU_RESV4 (0x77) -#define MT6360_PMU_FLED2_STRB_CTRL2 (0x78) -#define MT6360_PMU_FLED2_TOR_CTRL (0x79) -#define MT6360_PMU_FLED_VMIDTRK_CTRL1 (0x7A) -#define MT6360_PMU_FLED_VMID_RTM (0x7B) -#define MT6360_PMU_FLED_VMIDTRK_CTRL2 (0x7C) -#define MT6360_PMU_FLED_PWSEL (0x7D) -#define MT6360_PMU_FLED_EN (0x7E) -#define MT6360_PMU_FLED_Hidden1 (0x7F) -#define MT6360_PMU_RGB_EN (0x80) -#define MT6360_PMU_RGB1_ISNK (0x81) -#define MT6360_PMU_RGB2_ISNK (0x82) -#define MT6360_PMU_RGB3_ISNK (0x83) -#define MT6360_PMU_RGB_ML_ISNK (0x84) -#define MT6360_PMU_RGB1_DIM (0x85) -#define MT6360_PMU_RGB2_DIM (0x86) -#define MT6360_PMU_RGB3_DIM (0x87) -#define MT6360_PMU_RESV5 (0x88) -#define MT6360_PMU_RGB12_Freq (0x89) -#define MT6360_PMU_RGB34_Freq (0x8A) -#define MT6360_PMU_RGB1_Tr (0x8B) -#define MT6360_PMU_RGB1_Tf (0x8C) -#define MT6360_PMU_RGB1_TON_TOFF (0x8D) -#define MT6360_PMU_RGB2_Tr (0x8E) -#define MT6360_PMU_RGB2_Tf (0x8F) -#define MT6360_PMU_RGB2_TON_TOFF (0x90) -#define MT6360_PMU_RGB3_Tr (0x91) -#define MT6360_PMU_RGB3_Tf (0x92) -#define MT6360_PMU_RGB3_TON_TOFF (0x93) -#define MT6360_PMU_RGB_Hidden_CTRL1 (0x94) -#define MT6360_PMU_RGB_Hidden_CTRL2 (0x95) -#define MT6360_PMU_RESV6 (0x97) -#define MT6360_PMU_SPARE1 (0x9A) -#define MT6360_PMU_SPARE2 (0xA0) -#define MT6360_PMU_SPARE3 (0xB0) -#define MT6360_PMU_SPARE4 (0xC0) -#define MT6360_PMU_CHG_IRQ1 (0xD0) -#define MT6360_PMU_CHG_IRQ2 (0xD1) -#define MT6360_PMU_CHG_IRQ3 (0xD2) -#define MT6360_PMU_CHG_IRQ4 (0xD3) -#define MT6360_PMU_CHG_IRQ5 (0xD4) -#define MT6360_PMU_CHG_IRQ6 (0xD5) -#define MT6360_PMU_QC_IRQ (0xD6) -#define MT6360_PMU_FOD_IRQ (0xD7) -#define MT6360_PMU_BASE_IRQ (0xD8) -#define MT6360_PMU_FLED_IRQ1 (0xD9) -#define MT6360_PMU_FLED_IRQ2 (0xDA) -#define MT6360_PMU_RGB_IRQ (0xDB) -#define MT6360_PMU_BUCK1_IRQ (0xDC) -#define MT6360_PMU_BUCK2_IRQ (0xDD) -#define MT6360_PMU_LDO_IRQ1 (0xDE) -#define MT6360_PMU_LDO_IRQ2 (0xDF) -#define MT6360_PMU_CHG_STAT1 (0xE0) -#define MT6360_PMU_CHG_STAT2 (0xE1) -#define MT6360_PMU_CHG_STAT3 (0xE2) -#define MT6360_PMU_CHG_STAT4 (0xE3) -#define MT6360_PMU_CHG_STAT5 (0xE4) -#define MT6360_PMU_CHG_STAT6 (0xE5) -#define MT6360_PMU_QC_STAT (0xE6) -#define MT6360_PMU_FOD_STAT (0xE7) -#define MT6360_PMU_BASE_STAT (0xE8) -#define MT6360_PMU_FLED_STAT1 (0xE9) -#define MT6360_PMU_FLED_STAT2 (0xEA) -#define MT6360_PMU_RGB_STAT (0xEB) -#define MT6360_PMU_BUCK1_STAT (0xEC) -#define MT6360_PMU_BUCK2_STAT (0xED) -#define MT6360_PMU_LDO_STAT1 (0xEE) -#define MT6360_PMU_LDO_STAT2 (0xEF) -#define MT6360_PMU_CHG_MASK1 (0xF0) -#define MT6360_PMU_CHG_MASK2 (0xF1) -#define MT6360_PMU_CHG_MASK3 (0xF2) -#define MT6360_PMU_CHG_MASK4 (0xF3) -#define MT6360_PMU_CHG_MASK5 (0xF4) -#define MT6360_PMU_CHG_MASK6 (0xF5) -#define MT6360_PMU_QC_MASK (0xF6) -#define MT6360_PMU_FOD_MASK (0xF7) -#define MT6360_PMU_BASE_MASK (0xF8) -#define MT6360_PMU_FLED_MASK1 (0xF9) -#define MT6360_PMU_FLED_MASK2 (0xFA) -#define MT6360_PMU_FAULTB_MASK (0xFB) -#define MT6360_PMU_BUCK1_MASK (0xFC) -#define MT6360_PMU_BUCK2_MASK (0xFD) -#define MT6360_PMU_LDO_MASK1 (0xFE) -#define MT6360_PMU_LDO_MASK2 (0xFF) -#define MT6360_PMU_MAXREG (MT6360_PMU_LDO_MASK2) +#define MT6360_PMU_DEV_INFO 0x00 +#define MT6360_PMU_CORE_CTRL1 0x01 +#define MT6360_PMU_RST1 0x02 +#define MT6360_PMU_CRCEN 0x03 +#define MT6360_PMU_RST_PAS_CODE1 0x04 +#define MT6360_PMU_RST_PAS_CODE2 0x05 +#define MT6360_PMU_CORE_CTRL2 0x06 +#define MT6360_PMU_TM_PAS_CODE1 0x07 +#define MT6360_PMU_TM_PAS_CODE2 0x08 +#define MT6360_PMU_TM_PAS_CODE3 0x09 +#define MT6360_PMU_TM_PAS_CODE4 0x0A +#define MT6360_PMU_IRQ_IND 0x0B +#define MT6360_PMU_IRQ_MASK 0x0C +#define MT6360_PMU_IRQ_SET 0x0D +#define MT6360_PMU_SHDN_CTRL 0x0E +#define MT6360_PMU_TM_INF 0x0F +#define MT6360_PMU_I2C_CTRL 0x10 +#define MT6360_PMU_CHG_CTRL1 0x11 +#define MT6360_PMU_CHG_CTRL2 0x12 +#define MT6360_PMU_CHG_CTRL3 0x13 +#define MT6360_PMU_CHG_CTRL4 0x14 +#define MT6360_PMU_CHG_CTRL5 0x15 +#define MT6360_PMU_CHG_CTRL6 0x16 +#define MT6360_PMU_CHG_CTRL7 0x17 +#define MT6360_PMU_CHG_CTRL8 0x18 +#define MT6360_PMU_CHG_CTRL9 0x19 +#define MT6360_PMU_CHG_CTRL10 0x1A +#define MT6360_PMU_CHG_CTRL11 0x1B +#define MT6360_PMU_CHG_CTRL12 0x1C +#define MT6360_PMU_CHG_CTRL13 0x1D +#define MT6360_PMU_CHG_CTRL14 0x1E +#define MT6360_PMU_CHG_CTRL15 0x1F +#define MT6360_PMU_CHG_CTRL16 0x20 +#define MT6360_PMU_CHG_AICC_RESULT 0x21 +#define MT6360_PMU_DEVICE_TYPE 0x22 +#define MT6360_PMU_QC_CONTROL1 0x23 +#define MT6360_PMU_QC_CONTROL2 0x24 +#define MT6360_PMU_QC30_CONTROL1 0x25 +#define MT6360_PMU_QC30_CONTROL2 0x26 +#define MT6360_PMU_USB_STATUS1 0x27 +#define MT6360_PMU_QC_STATUS1 0x28 +#define MT6360_PMU_QC_STATUS2 0x29 +#define MT6360_PMU_CHG_PUMP 0x2A +#define MT6360_PMU_CHG_CTRL17 0x2B +#define MT6360_PMU_CHG_CTRL18 0x2C +#define MT6360_PMU_CHRDET_CTRL1 0x2D +#define MT6360_PMU_CHRDET_CTRL2 0x2E +#define MT6360_PMU_DPDN_CTRL 0x2F +#define MT6360_PMU_CHG_HIDDEN_CTRL1 0x30 +#define MT6360_PMU_CHG_HIDDEN_CTRL2 0x31 +#define MT6360_PMU_CHG_HIDDEN_CTRL3 0x32 +#define MT6360_PMU_CHG_HIDDEN_CTRL4 0x33 +#define MT6360_PMU_CHG_HIDDEN_CTRL5 0x34 +#define MT6360_PMU_CHG_HIDDEN_CTRL6 0x35 +#define MT6360_PMU_CHG_HIDDEN_CTRL7 0x36 +#define MT6360_PMU_CHG_HIDDEN_CTRL8 0x37 +#define MT6360_PMU_CHG_HIDDEN_CTRL9 0x38 +#define MT6360_PMU_CHG_HIDDEN_CTRL10 0x39 +#define MT6360_PMU_CHG_HIDDEN_CTRL11 0x3A +#define MT6360_PMU_CHG_HIDDEN_CTRL12 0x3B +#define MT6360_PMU_CHG_HIDDEN_CTRL13 0x3C +#define MT6360_PMU_CHG_HIDDEN_CTRL14 0x3D +#define MT6360_PMU_CHG_HIDDEN_CTRL15 0x3E +#define MT6360_PMU_CHG_HIDDEN_CTRL16 0x3F +#define MT6360_PMU_CHG_HIDDEN_CTRL17 0x40 +#define MT6360_PMU_CHG_HIDDEN_CTRL18 0x41 +#define MT6360_PMU_CHG_HIDDEN_CTRL19 0x42 +#define MT6360_PMU_CHG_HIDDEN_CTRL20 0x43 +#define MT6360_PMU_CHG_HIDDEN_CTRL21 0x44 +#define MT6360_PMU_CHG_HIDDEN_CTRL22 0x45 +#define MT6360_PMU_CHG_HIDDEN_CTRL23 0x46 +#define MT6360_PMU_CHG_HIDDEN_CTRL24 0x47 +#define MT6360_PMU_CHG_HIDDEN_CTRL25 0x48 +#define MT6360_PMU_BC12_CTRL 0x49 +#define MT6360_PMU_CHG_STAT 0x4A +#define MT6360_PMU_RESV1 0x4B +#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEH 0x4E +#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEL 0x4F +#define MT6360_PMU_TYPEC_OTP_HYST_TH 0x50 +#define MT6360_PMU_TYPEC_OTP_CTRL 0x51 +#define MT6360_PMU_ADC_BAT_DATA_H 0x52 +#define MT6360_PMU_ADC_BAT_DATA_L 0x53 +#define MT6360_PMU_IMID_BACKBST_ON 0x54 +#define MT6360_PMU_IMID_BACKBST_OFF 0x55 +#define MT6360_PMU_ADC_CONFIG 0x56 +#define MT6360_PMU_ADC_EN2 0x57 +#define MT6360_PMU_ADC_IDLE_T 0x58 +#define MT6360_PMU_ADC_RPT_1 0x5A +#define MT6360_PMU_ADC_RPT_2 0x5B +#define MT6360_PMU_ADC_RPT_3 0x5C +#define MT6360_PMU_ADC_RPT_ORG1 0x5D +#define MT6360_PMU_ADC_RPT_ORG2 0x5E +#define MT6360_PMU_BAT_OVP_TH_SEL_CODEH 0x5F +#define MT6360_PMU_BAT_OVP_TH_SEL_CODEL 0x60 +#define MT6360_PMU_CHG_CTRL19 0x61 +#define MT6360_PMU_VDDASUPPLY 0x62 +#define MT6360_PMU_BC12_MANUAL 0x63 +#define MT6360_PMU_CHGDET_FUNC 0x64 +#define MT6360_PMU_FOD_CTRL 0x65 +#define MT6360_PMU_CHG_CTRL20 0x66 +#define MT6360_PMU_CHG_HIDDEN_CTRL26 0x67 +#define MT6360_PMU_CHG_HIDDEN_CTRL27 0x68 +#define MT6360_PMU_RESV2 0x69 +#define MT6360_PMU_USBID_CTRL1 0x6D +#define MT6360_PMU_USBID_CTRL2 0x6E +#define MT6360_PMU_USBID_CTRL3 0x6F +#define MT6360_PMU_FLED_CFG 0x70 +#define MT6360_PMU_RESV3 0x71 +#define MT6360_PMU_FLED1_CTRL 0x72 +#define MT6360_PMU_FLED_STRB_CTRL 0x73 +#define MT6360_PMU_FLED1_STRB_CTRL2 0x74 +#define MT6360_PMU_FLED1_TOR_CTRL 0x75 +#define MT6360_PMU_FLED2_CTRL 0x76 +#define MT6360_PMU_RESV4 0x77 +#define MT6360_PMU_FLED2_STRB_CTRL2 0x78 +#define MT6360_PMU_FLED2_TOR_CTRL 0x79 +#define MT6360_PMU_FLED_VMIDTRK_CTRL1 0x7A +#define MT6360_PMU_FLED_VMID_RTM 0x7B +#define MT6360_PMU_FLED_VMIDTRK_CTRL2 0x7C +#define MT6360_PMU_FLED_PWSEL 0x7D +#define MT6360_PMU_FLED_EN 0x7E +#define MT6360_PMU_FLED_Hidden1 0x7F +#define MT6360_PMU_RGB_EN 0x80 +#define MT6360_PMU_RGB1_ISNK 0x81 +#define MT6360_PMU_RGB2_ISNK 0x82 +#define MT6360_PMU_RGB3_ISNK 0x83 +#define MT6360_PMU_RGB_ML_ISNK 0x84 +#define MT6360_PMU_RGB1_DIM 0x85 +#define MT6360_PMU_RGB2_DIM 0x86 +#define MT6360_PMU_RGB3_DIM 0x87 +#define MT6360_PMU_RESV5 0x88 +#define MT6360_PMU_RGB12_Freq 0x89 +#define MT6360_PMU_RGB34_Freq 0x8A +#define MT6360_PMU_RGB1_Tr 0x8B +#define MT6360_PMU_RGB1_Tf 0x8C +#define MT6360_PMU_RGB1_TON_TOFF 0x8D +#define MT6360_PMU_RGB2_Tr 0x8E +#define MT6360_PMU_RGB2_Tf 0x8F +#define MT6360_PMU_RGB2_TON_TOFF 0x90 +#define MT6360_PMU_RGB3_Tr 0x91 +#define MT6360_PMU_RGB3_Tf 0x92 +#define MT6360_PMU_RGB3_TON_TOFF 0x93 +#define MT6360_PMU_RGB_Hidden_CTRL1 0x94 +#define MT6360_PMU_RGB_Hidden_CTRL2 0x95 +#define MT6360_PMU_RESV6 0x97 +#define MT6360_PMU_SPARE1 0x9A +#define MT6360_PMU_SPARE2 0xA0 +#define MT6360_PMU_SPARE3 0xB0 +#define MT6360_PMU_SPARE4 0xC0 +#define MT6360_PMU_CHG_IRQ1 0xD0 +#define MT6360_PMU_CHG_IRQ2 0xD1 +#define MT6360_PMU_CHG_IRQ3 0xD2 +#define MT6360_PMU_CHG_IRQ4 0xD3 +#define MT6360_PMU_CHG_IRQ5 0xD4 +#define MT6360_PMU_CHG_IRQ6 0xD5 +#define MT6360_PMU_QC_IRQ 0xD6 +#define MT6360_PMU_FOD_IRQ 0xD7 +#define MT6360_PMU_BASE_IRQ 0xD8 +#define MT6360_PMU_FLED_IRQ1 0xD9 +#define MT6360_PMU_FLED_IRQ2 0xDA +#define MT6360_PMU_RGB_IRQ 0xDB +#define MT6360_PMU_BUCK1_IRQ 0xDC +#define MT6360_PMU_BUCK2_IRQ 0xDD +#define MT6360_PMU_LDO_IRQ1 0xDE +#define MT6360_PMU_LDO_IRQ2 0xDF +#define MT6360_PMU_CHG_STAT1 0xE0 +#define MT6360_PMU_CHG_STAT2 0xE1 +#define MT6360_PMU_CHG_STAT3 0xE2 +#define MT6360_PMU_CHG_STAT4 0xE3 +#define MT6360_PMU_CHG_STAT5 0xE4 +#define MT6360_PMU_CHG_STAT6 0xE5 +#define MT6360_PMU_QC_STAT 0xE6 +#define MT6360_PMU_FOD_STAT 0xE7 +#define MT6360_PMU_BASE_STAT 0xE8 +#define MT6360_PMU_FLED_STAT1 0xE9 +#define MT6360_PMU_FLED_STAT2 0xEA +#define MT6360_PMU_RGB_STAT 0xEB +#define MT6360_PMU_BUCK1_STAT 0xEC +#define MT6360_PMU_BUCK2_STAT 0xED +#define MT6360_PMU_LDO_STAT1 0xEE +#define MT6360_PMU_LDO_STAT2 0xEF +#define MT6360_PMU_CHG_MASK1 0xF0 +#define MT6360_PMU_CHG_MASK2 0xF1 +#define MT6360_PMU_CHG_MASK3 0xF2 +#define MT6360_PMU_CHG_MASK4 0xF3 +#define MT6360_PMU_CHG_MASK5 0xF4 +#define MT6360_PMU_CHG_MASK6 0xF5 +#define MT6360_PMU_QC_MASK 0xF6 +#define MT6360_PMU_FOD_MASK 0xF7 +#define MT6360_PMU_BASE_MASK 0xF8 +#define MT6360_PMU_FLED_MASK1 0xF9 +#define MT6360_PMU_FLED_MASK2 0xFA +#define MT6360_PMU_FAULTB_MASK 0xFB +#define MT6360_PMU_BUCK1_MASK 0xFC +#define MT6360_PMU_BUCK2_MASK 0xFD +#define MT6360_PMU_LDO_MASK1 0xFE +#define MT6360_PMU_LDO_MASK2 0xFF +#define MT6360_PMU_MAXREG MT6360_PMU_LDO_MASK2 /* MT6360_PMU_IRQ_SET */ #define MT6360_PMU_IRQ_REGNUM (MT6360_PMU_LDO_IRQ2 - MT6360_PMU_CHG_IRQ1 + 1) #define MT6360_IRQ_RETRIG BIT(2) -#define CHIP_VEN_MASK (0xF0) -#define CHIP_VEN_MT6360 (0x50) -#define CHIP_REV_MASK (0x0F) +#define CHIP_VEN_MASK 0xF0 +#define CHIP_VEN_MT6360 0x50 +#define CHIP_REV_MASK 0x0F #endif /* __MT6360_H__ */ From patchwork Tue Sep 22 10:20:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 906FA92C for ; Tue, 22 Sep 2020 10:22:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 428962395C for ; Tue, 22 Sep 2020 10:22:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nw0I0ybr"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J9uP1cs6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 428962395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qgNKfCh0P/w92GnUOabKezTq9zB31tOHgvqc5WVt5Mo=; b=nw0I0ybrUEqjdY3gFgIExCkDQh H3wKxH8cfFdzkXSZchsUUE+ZoD/VIQcQopCKYNo/F6wbDhwogpSxboLTWkUQjqit6Wu/qY1HGA7G0 qAasgv8dq1Jnm+JTRFa0YbPVJt+kmo+qSz/JP5COVgFimxdnuNTLDrr7ykjhio+n7J/l6C1KaGwH5 7Dnx2hYs4SX/MXzeRzQHqNNX0ea0gX/QvWL+Cqg27SbgSPoaRbo8LY1jJbzZI5QAjB8YkUXlQVeGO yOFGFRyzZpFbglj5BbWEVQ9yhZMA5f4XudLBMpMRvQX248pnRWbCV2+3KczH/U3Abp9VMfeX4K0mE muF3Onzw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQv-0000OG-1T; Tue, 22 Sep 2020 10:22:01 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfPo-0008W6-Tb; Tue, 22 Sep 2020 10:20:57 +0000 Received: by mail-pf1-x444.google.com with SMTP id d6so11998798pfn.9; Tue, 22 Sep 2020 03:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Joo9G8dpZiV+ukJjlPwDuzRh/fKHk3sZ/ezTEfq1J4w=; b=J9uP1cs6+B/YsiudN5S6Ow1nA2gyo0SYtCj2mK62DnuUeMv/VvvC+YSmLlGIojl20c Gdu9Nm8PnopmEUSNGynTglZaEZwEIiEj1p7B2JjcGs/TiSi21/LPe84W58CI864DrA+q uQX/RXyI+cac30GcjAYWG8g/BQCZjCEDZMXgLTvCsAwQR1xmXYdDIxFOXRfCMPzRcRIt BlYZ7gJHK+06GZzgrFRZ+owZmVB2KroPPwIMTBGTxezlcPQCbyC0luCYeNMXwZcB3lhu WzPMf5ZDbtXO4YZAXCr5Kv01vwWcblL5a8xSI/6tfkvqZgNKeOipX4Fq5SjtNxviqCfT Ksuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Joo9G8dpZiV+ukJjlPwDuzRh/fKHk3sZ/ezTEfq1J4w=; b=Fixw/Hfpyr+LxT/duQ/DqKiiB8hwRSnFkrSuXbJwqTna9nx12KNUz2tZ2jKW75Z+NK IyrV2XFLKeJ5m+tq0Wh8Fldj9CCMr87lUpHrdx8ewtBnuZL4NaKL4hjM2QMPFx1jEBR0 NwbHB6qZGR6C32foFS9NEjL/fkRHGpClvguThSwyTCn08AV/5YJJsSuDFaWmNNDS1GLF h8bF15JW9xOVKYJ/UW+7Bz2sBkxfwtyNrzbOZwdgp3C5WzZgws9ch3Lc8+zAgz6yo1O8 ObekTRalWQoXHsAG0nHyd8vNIsi+XUXJnaUOZd/NOch9aLDzOU1KH92f0G3S0oginDiC /mGA== X-Gm-Message-State: AOAM5301ecP6JrdIlU7DLfuvhp8f9hDXFe28znQ+4hvtfwjC8DUJU1Ps jlDeJpKLGWPmO34U/wLmDvk= X-Google-Smtp-Source: ABdhPJy5ak3fqE/fdF88qGdH6s7sOyYpvxXPALqUIUmvI+Ri9RQtt023ptdWx9aqoINk4h9m3DqSXg== X-Received: by 2002:a17:902:b216:b029:d1:e5e7:be05 with SMTP id t22-20020a170902b216b02900d1e5e7be05mr3993925plr.56.1600770051158; Tue, 22 Sep 2020 03:20:51 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:20:50 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 03/10] mfd: mt6360: Indicate sub-dev compatible name by using "-" Date: Tue, 22 Sep 2020 18:20:11 +0800 Message-Id: <1600770019-11585-4-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062057_109616_517C006A X-CRM114-Status: GOOD ( 12.61 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Indicate sub-dev compatible name by using "-". Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index befee70..692e47b 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -292,18 +292,18 @@ static const struct resource mt6360_ldo_resources[] = { }; static const struct mfd_cell mt6360_devs[] = { - OF_MFD_CELL("mt6360_adc", mt6360_adc_resources, - NULL, 0, 0, "mediatek,mt6360_adc"), - OF_MFD_CELL("mt6360_chg", mt6360_chg_resources, - NULL, 0, 0, "mediatek,mt6360_chg"), - OF_MFD_CELL("mt6360_led", mt6360_led_resources, - NULL, 0, 0, "mediatek,mt6360_led"), - OF_MFD_CELL("mt6360_pmic", mt6360_pmic_resources, - NULL, 0, 0, "mediatek,mt6360_pmic"), - OF_MFD_CELL("mt6360_ldo", mt6360_ldo_resources, - NULL, 0, 0, "mediatek,mt6360_ldo"), - OF_MFD_CELL("mt6360_tcpc", NULL, - NULL, 0, 0, "mediatek,mt6360_tcpc"), + OF_MFD_CELL("mt6360-adc", mt6360_adc_resources, + NULL, 0, 0, "mediatek,mt6360-adc"), + OF_MFD_CELL("mt6360-chg", mt6360_chg_resources, + NULL, 0, 0, "mediatek,mt6360-chg"), + OF_MFD_CELL("mt6360-led", mt6360_led_resources, + NULL, 0, 0, "mediatek,mt6360-led"), + OF_MFD_CELL("mt6360-pmic", mt6360_pmic_resources, + NULL, 0, 0, "mediatek,mt6360-pmic"), + OF_MFD_CELL("mt6360-ldo", mt6360_ldo_resources, + NULL, 0, 0, "mediatek,mt6360-ldo"), + OF_MFD_CELL("mt6360-tcpc", NULL, + NULL, 0, 0, "mediatek,mt6360-tcpc"), }; static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { From patchwork Tue Sep 22 10:20:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792089 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1C776CB for ; Tue, 22 Sep 2020 10:22:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 509762395C for ; Tue, 22 Sep 2020 10:22:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vtwbcw2H"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hjzB0Tn+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 509762395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D5VMse8tCiGPFBsoXhy95/VAdu2/VPcFqpldHQw1vW0=; b=vtwbcw2H2naZ1Q70zmvxIQHYHC CsX3hOc2H+yFOA+jPAROaOCWoRE+dfxZAlmAUqWv0uAo0nRLPzOGC11E3X6e0SW690h3PIfs7jlnn +EJ9DBPJZiKZ5Ay0scI/rIGInVN9tBED35k42phT/up0ik8V/mYrEkEi04jmHJj5QxuOsFv+jxRRU jd0FvtMFXQZ4hBjf/CUqmzGP8r/YrmByD7hSHGwXpWKdvQ33exX9Z46lk4d+Tgnr70oZOVn81Jf0U qi1FbvDeEhWckh+rWqnozJpGFyJ4CXrwcqiiN/+TpcSOzM6YbmXWzxI44+aRzC0rSxNSqv6K3OeQ/ A4ZutOEg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQx-0000P7-Cz; Tue, 22 Sep 2020 10:22:03 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfPs-00004t-Sz; Tue, 22 Sep 2020 10:20:58 +0000 Received: by mail-pf1-x441.google.com with SMTP id f18so12003192pfa.10; Tue, 22 Sep 2020 03:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t5bxP7SBsyG/FaxnJHfQjTjpWsNLjhkZMYmiwNpRv5E=; b=hjzB0Tn+e1tqlMWN/8vAurHTJovCYlNFo33wzfKzxK/BSxjT+a6gJwTPsGAWYHvvKP CB2S3Yl2oe410H+Hw3kE2nXCgSX6aG+jJYSGohvOw2GJHHl1B7zp7OpWZGvCeqbqcpMm 5uqt259jXkIexa0/jIwZe7+2VbfFZ1SbvoKLQJdafVOHuYhmNNPaOfluHhPC2WekjwUC Q2Fs1o52Og0j0m67TdEoYON34u6yya46oSjJ2dr37J3ATIhymi3Mv841xcRJbEsH9lDF crXaXYA1HRjd6vXEH0WbnrJc06r9bpDNIDWIiI0ZyJ3too8d0TIWR8o+ssEbFgWMu/RD IBKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t5bxP7SBsyG/FaxnJHfQjTjpWsNLjhkZMYmiwNpRv5E=; b=tguH7FXjMkLHQ46TV+iLxLxZnNxYYa8aUSuZ66UL+9aI5UI0RJN+TCGdsKSOBV503p 1mNv8Jg9AmiZojp/Sfxx6fC/T0gVmAd5qzaEQMeGThOLmUtRMCxxbUly3lHmoIRLMWCW i1xXk/QnUKOLfM0JhMqe7CpI5PbMqPR/uL/P2rNTXD3TXCIMHnXRerFqPzH95Jza/jcr LuWVYpk3pipaH3HMTgkKEEdR1MZNKs2g+cwXfhz5uLW31Pmmwe5hXWvglnmRNGzuK0Ca ZwRujW+tY4cf6nqIpyNhIwIVQnhZWnehP8W6e6j9TNtO+pI0IGD3blTbkzd9CxD9F9Tw AevA== X-Gm-Message-State: AOAM531pZXqCmYJTaI4YbgbeABrmXLJ8F9tuze4mySJaWSFzSqXHoy/D yMKbtEA0lst/XKvRm3Lf2bVOi22gAzM= X-Google-Smtp-Source: ABdhPJyiL8lEbxFoQpmM4mEVqPw7egesz4ShUvdfOUira1TDWuI3zZOafQmiB9Ei2Nr05DRJr1wu4g== X-Received: by 2002:a17:902:d913:b029:d1:f388:9fa6 with SMTP id c19-20020a170902d913b02900d1f3889fa6mr3938165plz.67.1600770054996; Tue, 22 Sep 2020 03:20:54 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:20:54 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 04/10] mfd: mt6360: Combine mt6360 pmic/ldo resources into mt6360 regulator resources Date: Tue, 22 Sep 2020 18:20:12 +0800 Message-Id: <1600770019-11585-5-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062057_330323_0A0D7A4E X-CRM114-Status: GOOD ( 13.40 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Combine mt6360 pmic/ldo resources into mt6360 regulator resources to simplify the similar resources object. Signed-off-by: Gene Chen --- drivers/mfd/mt6360-core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 692e47b..5119e51 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -265,7 +265,7 @@ static const struct resource mt6360_led_resources[] = { DEFINE_RES_IRQ_NAMED(MT6360_FLED1_STRB_TO_EVT, "fled1_strb_to_evt"), }; -static const struct resource mt6360_pmic_resources[] = { +static const struct resource mt6360_regulator_resources[] = { DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_PGB_EVT, "buck1_pgb_evt"), DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_OC_EVT, "buck1_oc_evt"), DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_OV_EVT, "buck1_ov_evt"), @@ -278,9 +278,6 @@ static const struct resource mt6360_pmic_resources[] = { DEFINE_RES_IRQ_NAMED(MT6360_LDO7_OC_EVT, "ldo7_oc_evt"), DEFINE_RES_IRQ_NAMED(MT6360_LDO6_PGB_EVT, "ldo6_pgb_evt"), DEFINE_RES_IRQ_NAMED(MT6360_LDO7_PGB_EVT, "ldo7_pgb_evt"), -}; - -static const struct resource mt6360_ldo_resources[] = { DEFINE_RES_IRQ_NAMED(MT6360_LDO1_OC_EVT, "ldo1_oc_evt"), DEFINE_RES_IRQ_NAMED(MT6360_LDO2_OC_EVT, "ldo2_oc_evt"), DEFINE_RES_IRQ_NAMED(MT6360_LDO3_OC_EVT, "ldo3_oc_evt"), @@ -298,10 +295,8 @@ static const struct mfd_cell mt6360_devs[] = { NULL, 0, 0, "mediatek,mt6360-chg"), OF_MFD_CELL("mt6360-led", mt6360_led_resources, NULL, 0, 0, "mediatek,mt6360-led"), - OF_MFD_CELL("mt6360-pmic", mt6360_pmic_resources, - NULL, 0, 0, "mediatek,mt6360-pmic"), - OF_MFD_CELL("mt6360-ldo", mt6360_ldo_resources, - NULL, 0, 0, "mediatek,mt6360-ldo"), + OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources, + NULL, 0, 0, "mediatek,mt6360-regulator"), OF_MFD_CELL("mt6360-tcpc", NULL, NULL, 0, 0, "mediatek,mt6360-tcpc"), }; From patchwork Tue Sep 22 10:20:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F10C92C for ; Tue, 22 Sep 2020 10:22:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FD122395C for ; Tue, 22 Sep 2020 10:22:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k+DYH6ID"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bKqRy+LM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FD122395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DzNkaQ5W9IxgtPPUaAsVgOnpk1xcRGLsyVDMmexeNCU=; b=k+DYH6IDKVLmyYlbUWeNBfDlOS NL3lCTni/du+bga7f6xzi3kJLBTdODLU0IjQ6G4Cf/BxUkxalNb/r7BqedPTMDXJMpLNGWsEyfiaN ZCoBt9qdm/mmRFr/EeBC5XAJgZ+eLFawDSztadli6K7hyOHH1vz10Dfj1L3XXq4iMKrgZCOVeoqHi +tNG4qqkSwkB80i5hSWNyX/f9as8YKhvS2mMPA0xFXrl7AoKbFbY0ugDk68bN+pOazO1nCzLOe0mU loV5paWQjSaveOkoFYU/MCXEQniwoHZpFRReop4W7VJlrCTV3ZBEm3Q/2v9Tv2n7ONIhLE494hcZB qisJNkPw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfRC-0000VR-Ew; Tue, 22 Sep 2020 10:22:18 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfPw-00006V-S5; Tue, 22 Sep 2020 10:21:02 +0000 Received: by mail-pg1-x541.google.com with SMTP id g29so11588886pgl.2; Tue, 22 Sep 2020 03:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0+hwdde/9osqDF4pD01phKptpQ7KgGy01PbwrfMbdCM=; b=bKqRy+LMO/iDA+ahSlPvzSOBVAQB97uaBDJQoZXGrt+YTZggvFK5tyd+KIBtSeHHos CIwObu4GZ0j/tV4sb4Vg3YItVql6zVRP+lshGWLXGSFzs6DG7D0gpIX3HyhCHCazSsjq qaVo9jSnbYVcY2NEqG7YYwWiTs4uLyS3cgkxo1rSPDeeOrdAVAxc1603Yuz8PUatXLav D/PvwWkzoTTNbl1MX183QEJ15dFANxyS+GvLy+HQzcxD0JS25Biw0Lp6uIFjGnxXNcDa OZbVN73+6AcJmOl8ZQgpeGezeonxNu0muPpfuVc3IKo5LbFJyN2r1bwn9VEO+zbFgFkY /03A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0+hwdde/9osqDF4pD01phKptpQ7KgGy01PbwrfMbdCM=; b=tZGr6wJnpGss/S77aI4nVvLg/u+72yrrEqsieqUJ5Xt2ocZbHfhD+mob5KrsB7UCgQ ATWGPW1CqprxBk934Y2yDgF5CbSxUQp80s2wZ4D/1tfetnwTXSQijid5RIWT7clyThWa 2BfV16rJGVmIJA2Hwf+o8++Hph2abX4ju/+BRY0I8EchyzAmLxNtsvV9oH8fAXOf67RA 1Wv+L+LEaHtFxqVc+4mHeaHv4NzJ3CQgXIcjODpICdI7HDfeAWJ7mnqT3B1AmaEFtF47 dtfQ2iahJxzmx3zOLBLLVtnW8f63o+iTD9qgIVPQEGmMfUBlavxXEQ4+rXacQDcz1c60 AU3w== X-Gm-Message-State: AOAM533hLtjw9j8AiG3e4Bulk9/mSjlUJtBVLFNbgT450DTKK45yvbcr ywOri/xI50UKLoSFQGBuSX0= X-Google-Smtp-Source: ABdhPJywg1ZPRerJN+Bl7Givl4CzGRtlOJxgL96O7QNDYzm6gINGKxSTwe8zIdew4lefJIdzGQ9qOA== X-Received: by 2002:aa7:8ede:0:b029:13e:d13d:a053 with SMTP id b30-20020aa78ede0000b029013ed13da053mr3426165pfr.25.1600770058961; Tue, 22 Sep 2020 03:20:58 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:20:58 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 05/10] mfd: mt6360: Rename mt6360_pmu_data by mt6360_ddata Date: Tue, 22 Sep 2020 18:20:13 +0800 Message-Id: <1600770019-11585-6-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062101_024249_BF164F8A X-CRM114-Status: GOOD ( 17.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Rename mt6360_pmu_data by mt6360_ddata because of including not only PMU part, but also entire MT6360 IC. Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 44 ++++++++++++++++++++++---------------------- include/linux/mfd/mt6360.h | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 5119e51..332eb5d 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -210,9 +210,9 @@ static const struct regmap_irq mt6360_pmu_irqs[] = { static int mt6360_pmu_handle_post_irq(void *irq_drv_data) { - struct mt6360_pmu_data *mpd = irq_drv_data; + struct mt6360_ddata *ddata = irq_drv_data; - return regmap_update_bits(mpd->regmap, + return regmap_update_bits(ddata->regmap, MT6360_PMU_IRQ_SET, MT6360_IRQ_RETRIG, MT6360_IRQ_RETRIG); } @@ -310,61 +310,61 @@ static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { static int mt6360_pmu_probe(struct i2c_client *client) { - struct mt6360_pmu_data *mpd; + struct mt6360_ddata *ddata; unsigned int reg_data; int i, ret; - mpd = devm_kzalloc(&client->dev, sizeof(*mpd), GFP_KERNEL); - if (!mpd) + ddata = devm_kzalloc(&client->dev, sizeof(*ddata), GFP_KERNEL); + if (!ddata) return -ENOMEM; - mpd->dev = &client->dev; - i2c_set_clientdata(client, mpd); + ddata->dev = &client->dev; + i2c_set_clientdata(client, ddata); - mpd->regmap = devm_regmap_init_i2c(client, &mt6360_pmu_regmap_config); - if (IS_ERR(mpd->regmap)) { + ddata->regmap = devm_regmap_init_i2c(client, &mt6360_pmu_regmap_config); + if (IS_ERR(ddata->regmap)) { dev_err(&client->dev, "Failed to register regmap\n"); - return PTR_ERR(mpd->regmap); + return PTR_ERR(ddata->regmap); } - ret = regmap_read(mpd->regmap, MT6360_PMU_DEV_INFO, ®_data); + ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, ®_data); if (ret) { dev_err(&client->dev, "Device not found\n"); return ret; } - mpd->chip_rev = reg_data & CHIP_REV_MASK; - if (mpd->chip_rev != CHIP_VEN_MT6360) { + ddata->chip_rev = reg_data & CHIP_REV_MASK; + if (ddata->chip_rev != CHIP_VEN_MT6360) { dev_err(&client->dev, "Device not supported\n"); return -ENODEV; } - mt6360_pmu_irq_chip.irq_drv_data = mpd; - ret = devm_regmap_add_irq_chip(&client->dev, mpd->regmap, client->irq, + mt6360_pmu_irq_chip.irq_drv_data = ddata; + ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, IRQF_TRIGGER_FALLING, 0, - &mt6360_pmu_irq_chip, &mpd->irq_data); + &mt6360_pmu_irq_chip, &ddata->irq_data); if (ret) { dev_err(&client->dev, "Failed to add Regmap IRQ Chip\n"); return ret; } - mpd->i2c[0] = client; + ddata->i2c[0] = client; for (i = 1; i < MT6360_SLAVE_MAX; i++) { - mpd->i2c[i] = devm_i2c_new_dummy_device(&client->dev, + ddata->i2c[i] = devm_i2c_new_dummy_device(&client->dev, client->adapter, mt6360_slave_addr[i]); - if (IS_ERR(mpd->i2c[i])) { + if (IS_ERR(ddata->i2c[i])) { dev_err(&client->dev, "Failed to get new dummy I2C device for address 0x%x", mt6360_slave_addr[i]); - return PTR_ERR(mpd->i2c[i]); + return PTR_ERR(ddata->i2c[i]); } - i2c_set_clientdata(mpd->i2c[i], mpd); + i2c_set_clientdata(ddata->i2c[i], ddata); } ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_AUTO, mt6360_devs, ARRAY_SIZE(mt6360_devs), NULL, - 0, regmap_irq_get_domain(mpd->irq_data)); + 0, regmap_irq_get_domain(ddata->irq_data)); if (ret) { dev_err(&client->dev, "Failed to register subordinate devices\n"); diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h index 72edf13..81bca7c 100644 --- a/include/linux/mfd/mt6360.h +++ b/include/linux/mfd/mt6360.h @@ -21,7 +21,7 @@ enum { #define MT6360_LDO_SLAVEID 0x64 #define MT6360_TCPC_SLAVEID 0x4E -struct mt6360_pmu_data { +struct mt6360_ddata { struct i2c_client *i2c[MT6360_SLAVE_MAX]; struct device *dev; struct regmap *regmap; From patchwork Tue Sep 22 10:20:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792093 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A31E92C for ; Tue, 22 Sep 2020 10:22:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 442882395C for ; Tue, 22 Sep 2020 10:22:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="onwxlhWg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mI662irK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 442882395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w3LBE0jTONZbeP5AwL/KWRCbtGlXM4Oygh99Mt86fPw=; b=onwxlhWgfF28oC464ZRWLx3ODE qo6H6OqhdqVMiUiJ6QN4r7ZtMgVGtO/djQLonVbzOwEQHfGPd0g0mvTIJ/hViJ79l7QGN1NaPjYXq dpVh9agisFGAfOFQyT3b/IM8oyBDj3xNPUmz2FNPOp+JxVGnm4reDVncCJUj3QcCNdrRFIas14ugl Qm5KRORn7z1aQWVYlW8wvnV7f7hgDr5eXMB9SX3QGK3Vj6YjNIuDPfr+CGMqRz452RdfWxASZ1CJk qcVxbuWwteAPJD535IEGt1E6NdIJmQV3gEj3AmjrnQ4l7q6NHKtVPkhbXXJq63qcuYPdu2eHtJ6yH +bK/ZAoQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfRX-0000cW-23; Tue, 22 Sep 2020 10:22:39 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQ1-000089-9v; Tue, 22 Sep 2020 10:21:08 +0000 Received: by mail-pg1-x544.google.com with SMTP id d13so11574244pgl.6; Tue, 22 Sep 2020 03:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kmywJl/aDPZ8Djl80CkqitFsv9eXGzrnwpaDbuS6TqE=; b=mI662irKaxFvEueeJdbsdIG7iwm29QZNcXoS3egwQZFtKbCscVYzzikwea2PDAxTNp kT7ey1IZ4almugKtcPPe1sZhLHZkC1rOTuBNFGYbOjGUJj9EOY9eJHo0oBCOCpLOBxyw 5UaPNrc3H1BC4uyqQLNmjbidvBmMo+8334cBNDEgoWGr7rSkScnOYxjzuOcDm2Y88c+y RUhXPithN/4vQd2n0KkfgL2bhBrf1T7Mg1pBetVG4zHQ5Odn5A8wYhO9Ukzls931fVto 6hNVk8xw6qr60SLAOtpk/z7xiyprdpttlFbdAISBBI7rTZz/2lz/l9WF/ShWYcIFPuYT aJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kmywJl/aDPZ8Djl80CkqitFsv9eXGzrnwpaDbuS6TqE=; b=aMmTA8A3il74yKu0gzrvg7g2D/pGWgrDPc+eWpdoItsnc159sNtC9FxqEdaAxRqlo9 vKkEKqYrUSjHzpjl/Cl6HjLPa6nwCeeug+cCQNRQexelLQUP44ZOdZRnEoWGIcscE3Rd bWcjUsxPcgJJrLRlSplDJSxbWBPlSsDn5CZ3n2Sowww/s8Uti4C77Rk8KlfcX2gNl7l5 064MuMnT+MuwAP/mvIpdGrMr+Bk023fnq/QA9GKJToU9lR4L10QlpIC+CGbbaTQZLLk3 qEJBpUPGH31bv8LawZDHq+naTQF/0II7uvw9Q/xFzIocOKtHUlGOH7dSB/1e4S64w6fQ mnJw== X-Gm-Message-State: AOAM533ssy+vLA36WQx6lBDVWovvBjJ6AXJfJDa2LxAovQay9CWcq52h dv2/qYq+LGncb6i5B3nXbt8= X-Google-Smtp-Source: ABdhPJzqmoH+ygHv96fg9FV11x+5pVn8jXcAYhzyyoCk/HXS1UxfR1+lR4V1FFPrZMwvNjWEKNylHQ== X-Received: by 2002:a17:902:eeca:b029:d2:1d73:46ba with SMTP id h10-20020a170902eecab02900d21d7346bamr3925814plb.28.1600770063340; Tue, 22 Sep 2020 03:21:03 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.20.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:21:02 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 06/10] mfd: mt6360: Rename mt6360_pmu by mt6360 Date: Tue, 22 Sep 2020 18:20:14 +0800 Message-Id: <1600770019-11585-7-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062105_422808_DBA88529 X-CRM114-Status: GOOD ( 15.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Rename mt6360_pmu by mt6360, because of including not only PMU part, but also entire MT6360 IC Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 332eb5d..f75122b 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -119,7 +119,7 @@ #define MT6360_LDO6_PGB_EVT 126 #define MT6360_LDO7_PGB_EVT 127 -static const struct regmap_irq mt6360_pmu_irqs[] = { +static const struct regmap_irq mt6360_irqs[] = { REGMAP_IRQ_REG_LINE(MT6360_CHG_TREG_EVT, 8), REGMAP_IRQ_REG_LINE(MT6360_CHG_AICR_EVT, 8), REGMAP_IRQ_REG_LINE(MT6360_CHG_MIVR_EVT, 8), @@ -216,9 +216,9 @@ static int mt6360_pmu_handle_post_irq(void *irq_drv_data) MT6360_PMU_IRQ_SET, MT6360_IRQ_RETRIG, MT6360_IRQ_RETRIG); } -static struct regmap_irq_chip mt6360_pmu_irq_chip = { - .irqs = mt6360_pmu_irqs, - .num_irqs = ARRAY_SIZE(mt6360_pmu_irqs), +static struct regmap_irq_chip mt6360_irq_chip = { + .irqs = mt6360_irqs, + .num_irqs = ARRAY_SIZE(mt6360_irqs), .num_regs = MT6360_PMU_IRQ_REGNUM, .mask_base = MT6360_PMU_CHG_MASK1, .status_base = MT6360_PMU_CHG_IRQ1, @@ -308,7 +308,7 @@ static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { MT6360_TCPC_SLAVEID, }; -static int mt6360_pmu_probe(struct i2c_client *client) +static int mt6360_probe(struct i2c_client *client) { struct mt6360_ddata *ddata; unsigned int reg_data; @@ -339,10 +339,10 @@ static int mt6360_pmu_probe(struct i2c_client *client) return -ENODEV; } - mt6360_pmu_irq_chip.irq_drv_data = ddata; + mt6360_irq_chip.irq_drv_data = ddata; ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, IRQF_TRIGGER_FALLING, 0, - &mt6360_pmu_irq_chip, &ddata->irq_data); + &mt6360_irq_chip, &ddata->irq_data); if (ret) { dev_err(&client->dev, "Failed to add Regmap IRQ Chip\n"); return ret; @@ -374,7 +374,7 @@ static int mt6360_pmu_probe(struct i2c_client *client) return 0; } -static int __maybe_unused mt6360_pmu_suspend(struct device *dev) +static int __maybe_unused mt6360_suspend(struct device *dev) { struct i2c_client *i2c = to_i2c_client(dev); @@ -384,7 +384,7 @@ static int __maybe_unused mt6360_pmu_suspend(struct device *dev) return 0; } -static int __maybe_unused mt6360_pmu_resume(struct device *dev) +static int __maybe_unused mt6360_resume(struct device *dev) { struct i2c_client *i2c = to_i2c_client(dev); @@ -395,25 +395,24 @@ static int __maybe_unused mt6360_pmu_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(mt6360_pmu_pm_ops, - mt6360_pmu_suspend, mt6360_pmu_resume); +static SIMPLE_DEV_PM_OPS(mt6360_pm_ops, mt6360_suspend, mt6360_resume); -static const struct of_device_id __maybe_unused mt6360_pmu_of_id[] = { - { .compatible = "mediatek,mt6360_pmu", }, +static const struct of_device_id __maybe_unused mt6360_of_id[] = { + { .compatible = "mediatek,mt6360", }, {}, }; -MODULE_DEVICE_TABLE(of, mt6360_pmu_of_id); +MODULE_DEVICE_TABLE(of, mt6360_of_id); -static struct i2c_driver mt6360_pmu_driver = { +static struct i2c_driver mt6360_driver = { .driver = { - .name = "mt6360_pmu", - .pm = &mt6360_pmu_pm_ops, - .of_match_table = of_match_ptr(mt6360_pmu_of_id), + .name = "mt6360", + .pm = &mt6360_pm_ops, + .of_match_table = of_match_ptr(mt6360_of_id), }, - .probe_new = mt6360_pmu_probe, + .probe_new = mt6360_probe, }; -module_i2c_driver(mt6360_pmu_driver); +module_i2c_driver(mt6360_driver); MODULE_AUTHOR("Gene Chen "); -MODULE_DESCRIPTION("MT6360 PMU I2C Driver"); +MODULE_DESCRIPTION("MT6360 I2C Driver"); MODULE_LICENSE("GPL v2"); From patchwork Tue Sep 22 10:20:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27E7A92C for ; Tue, 22 Sep 2020 10:23:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9A522395C for ; Tue, 22 Sep 2020 10:23:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kFF+BX5d"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="otWeUcTK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9A522395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mHKeaDWks8MBcTth5IDGD7cJvFMo30p5CDf31QPdDp0=; b=kFF+BX5dwAV/U9eMcjaK+SwPfR ZtYLbR6kpzkg/7U/x2DcRVzzn2nn1p/FDvR+RXXKmuC7OBZw8X8m2iGhMoMxXHkYi5PbdhwkF8d3m QqGj+ljlAJQsOE+2GbmXqG4hWnd86XxS4ExPA+GrWuQ6AX2BNgcMN4g+V4TmjrrEMsywCixu5G4kJ j04xV87kQ0H0MbDQWysQUrem+9VPKJlfzG6mID02Kj84xJ4h+Qhj+5b2euaCyHCCI3lVm+bAbjz6t 0bBuslgiaJlnooJvkfQD5wbB0wiy98eYvzLsLnEINTnCBibq24dskhJAMEMgNzPdGx8QrEwXavHkL nNMNBRtQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfRo-0000kN-7j; Tue, 22 Sep 2020 10:22:56 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQ5-000099-Nk; Tue, 22 Sep 2020 10:21:26 +0000 Received: by mail-pg1-x544.google.com with SMTP id l71so11573928pge.4; Tue, 22 Sep 2020 03:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sie6Ok4mlr9HWDpV1MC03OrgT3qnjwcXYjtFoY6fZME=; b=otWeUcTKx/UNzKWUeg61Z1E3NrT6TBCSkXl028uvXKJgQlGgBuyTzj5hl6sMqm5VfZ KdWZ7nKpPZODjsNDVRS5dTwfT39V3q8QVX5WKkTdO4rXPoDowZ4jNdunjSPjXU52xvD5 sMgHrfwwiT9RilnqQ3J64qwdb0TPkrUej6DbqoQeUx06QevcqsFmftcT+VhMM1v5IiVa QagqXSP68aVaxv2rMNccMKn/8RDTMbit7aF3V/Lg8fuGxP3pjPSZqDht1Ah4oPG1N/wQ FqJ+z/GfGGnYnQFxLPDF6VrzpBuNOtQ3FWo9jMw74oOfI5O5gqmh9cv8hA7F8mYRz2Tq aENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sie6Ok4mlr9HWDpV1MC03OrgT3qnjwcXYjtFoY6fZME=; b=Y736/lqq5XP5V/DJEtLysjPDg2Tw74JQAaseN1U6n6RiSGQ155U0wSl55A3h3/SCIw T9uofGl2nu6BdC1df23kAuxUWyLVTT6YLwG/UDElw/JvVU6P+f0fbAk9prJ/oB+eAb0w TIhU8aoqV3LXOzSqOpN9NZp4EXCIciyhBUjBQjt6mhNf0l2qdbvUKHbX3CD+8ok/uVjd E8iRP4bdWDfMf33XecYUsHghIaMRG1nacrK9ScTVGHboEyO8LbMtW6vvrOOJm6cCLz+b AQsNT7DTA7AdG/K9H55c7l1g1gZYC5O45PXDH1vFTQVmmtRipSJmiHM8aDijQMI+ybV0 YG/g== X-Gm-Message-State: AOAM5339RZ148qiqsl8CpFJiYTOl9h10xfck3QkFoy0jtU43bTTtwtvp IlAQmIZ3yqCaJnNvH3jU9CQ= X-Google-Smtp-Source: ABdhPJwlWzhfwcTkd1VFhdbJOI3bAObjg7ROqG6ZjIFUUt6R2kwuwErRy8IOpI0g2eZOuukSte2leg== X-Received: by 2002:a65:5881:: with SMTP id d1mr2959406pgu.193.1600770067727; Tue, 22 Sep 2020 03:21:07 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.21.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:21:07 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 07/10] mfd: mt6360: Remove handle_post_irq callback function Date: Tue, 22 Sep 2020 18:20:15 +0800 Message-Id: <1600770019-11585-8-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062114_875899_3D5CDBD8 X-CRM114-Status: GOOD ( 17.15 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Remove handle_post_irq which is used to retrigger IRQ. Set IRQ level low trigger in dtsi to keep IRQ always be handled. Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 17 ++++------------- include/linux/mfd/mt6360.h | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index f75122b..2356d99 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -208,15 +208,8 @@ static const struct regmap_irq mt6360_irqs[] = { REGMAP_IRQ_REG_LINE(MT6360_LDO7_PGB_EVT, 8), }; -static int mt6360_pmu_handle_post_irq(void *irq_drv_data) -{ - struct mt6360_ddata *ddata = irq_drv_data; - - return regmap_update_bits(ddata->regmap, - MT6360_PMU_IRQ_SET, MT6360_IRQ_RETRIG, MT6360_IRQ_RETRIG); -} - -static struct regmap_irq_chip mt6360_irq_chip = { +static const struct regmap_irq_chip mt6360_irq_chip = { + .name = "mt6360_irqs", .irqs = mt6360_irqs, .num_irqs = ARRAY_SIZE(mt6360_irqs), .num_regs = MT6360_PMU_IRQ_REGNUM, @@ -225,7 +218,6 @@ static struct regmap_irq_chip mt6360_irq_chip = { .ack_base = MT6360_PMU_CHG_IRQ1, .init_ack_masked = true, .use_ack = true, - .handle_post_irq = mt6360_pmu_handle_post_irq, }; static const struct regmap_config mt6360_pmu_regmap_config = { @@ -339,10 +331,9 @@ static int mt6360_probe(struct i2c_client *client) return -ENODEV; } - mt6360_irq_chip.irq_drv_data = ddata; ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, - IRQF_TRIGGER_FALLING, 0, - &mt6360_irq_chip, &ddata->irq_data); + 0, 0, &mt6360_irq_chip, + &ddata->irq_data); if (ret) { dev_err(&client->dev, "Failed to add Regmap IRQ Chip\n"); return ret; diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h index 81bca7c..ef8257d 100644 --- a/include/linux/mfd/mt6360.h +++ b/include/linux/mfd/mt6360.h @@ -230,7 +230,7 @@ struct mt6360_ddata { #define MT6360_PMU_MAXREG MT6360_PMU_LDO_MASK2 /* MT6360_PMU_IRQ_SET */ -#define MT6360_PMU_IRQ_REGNUM (MT6360_PMU_LDO_IRQ2 - MT6360_PMU_CHG_IRQ1 + 1) +#define MT6360_PMU_IRQ_REGNUM 16 #define MT6360_IRQ_RETRIG BIT(2) #define CHIP_VEN_MASK 0xF0 From patchwork Tue Sep 22 10:20:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3E9092C for ; Tue, 22 Sep 2020 10:23:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74E4F2395C for ; Tue, 22 Sep 2020 10:23:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OY0yaVFS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bQWsrq6u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74E4F2395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wO0BFobni0Qs2kU7zU9mbr1uS4jTakYrIiBJYz9JOAQ=; b=OY0yaVFShbwgj8ZFoBpUeLcibB Whq08/M+nRX/ohsYRmmEAaUL8zPMZyBG9pQ+ZEf+sb+TQ7+dTBXaLeGHO5nEJIFKeOLkCJhGwRtlR gysRHmwr3N2cUGXY0V+H5dXV839kDR8j+HOgZ4Eyg0cpbmghMXUi9OjyhazVKlJOpCVni65Yc8fC5 16cjHZ76WOfFAtv8tIp2PIoLzvTreEGZsnt3Yx6sIwoy36OHukVQidpK8MEC7BtBIRT8S2nRIaj/s 9rgm0SPMCmron2ByuK8mEuZubuGsnEUd8t3XHq0PutncqfBNRTNgZzw5usWxkek60jzUHRO4bafA0 oR4Htv1A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfS7-0000uC-BD; Tue, 22 Sep 2020 10:23:15 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQ9-00009q-4R; Tue, 22 Sep 2020 10:21:27 +0000 Received: by mail-pf1-x442.google.com with SMTP id x22so7192610pfo.12; Tue, 22 Sep 2020 03:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eTozcscQct40BurorhsUtgIPXBxStv+/H/KVS2Q9tCE=; b=bQWsrq6u+hyFzIcLsfxU+jUSQq6Bgm7eQGESQazBKVb9Gmdg8YUmxFZ/RD914DIpXl 9m1hHPDOZxSDcM2znik7ci5uh8wslt5vHtlI8O0OogNSv4Ey5cNbDwVo1ldIjHg4QO8j J6+X+UV+YbR9N1FdxLkE7pxIRpGuYXaBazwsvf5VnmRhdw1O48C6WCbzVbHEBUKC0FTH dJYzPHtK0n0YT33pBJ8gRjywpwEluoz3XpdoBJirTDTa5uYpOzCdiU4N950KhDo6rBkU iZA1JAXnxJKWcjZilwBEVFf6ZyjaCFx+VOqnz7eA3VUrOZaCSBvyGiadUeUxlElIiP9J 5Dqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eTozcscQct40BurorhsUtgIPXBxStv+/H/KVS2Q9tCE=; b=G9zWxVmfCkGbbcV62uOwORuWER+f2abpk2VjX7Xv8KTjozlCc1y0biZd9KghFn8PZq IULb8air6kGPxSNanwZcya/7dX5cQISm+f1zIYe7rDKt6HuL6uwzTzmfhD+vmaxvlQvi VNHm/S7jOvrbe+rGfI4GHH1NxM2t9QaQjo2YQOuJIwoz2ZQh/TYveb7iuw5uj7O0IhYp dG5iwHYiw0U250yDgFkETCRbP58+zXehGxvfmBAWAP7wFWfMD1z2W9pOvlU0qOOO7Ijj 2NQlH00L3RpfM8VV8jmjjqBWqLeaDpQNajvGVKYTR2axhRYBnKaKIGVhLOWA9ZPaB7kL rzBQ== X-Gm-Message-State: AOAM533FR6udzJMTxFt5HsINinRIpE0OYXsO7Dajqhr63ea9GlJvbWAP g4TbMu9fjBXLAn6o1l3yo1U= X-Google-Smtp-Source: ABdhPJypDmOWsT5hKM5KgIgufpr2weGbFukeO4YcsU9r9mwe3wUTFuD1QUS+d8xIJVWG/OnYO4xGcw== X-Received: by 2002:a63:e249:: with SMTP id y9mr2940042pgj.117.1600770071353; Tue, 22 Sep 2020 03:21:11 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.21.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:21:10 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 08/10] mfd: mt6360: Fix flow which is used to check ic exist Date: Tue, 22 Sep 2020 18:20:16 +0800 Message-Id: <1600770019-11585-9-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062115_086813_B705D649 X-CRM114-Status: GOOD ( 16.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Fix flow which is used to check ic exist. Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 2356d99..677c974 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -293,6 +293,25 @@ static const struct mfd_cell mt6360_devs[] = { NULL, 0, 0, "mediatek,mt6360-tcpc"), }; +static int mt6360_check_vendor_info(struct mt6360_ddata *ddata) +{ + u32 info; + int ret; + + ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, &info); + if (ret < 0) + return ret; + + if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) { + dev_err(&client->dev, "Device not supported\n"); + return -ENODEV; + } + + ddata->chip_rev = info & CHIP_REV_MASK; + + return 0; +} + static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { MT6360_PMU_SLAVEID, MT6360_PMIC_SLAVEID, @@ -303,7 +322,6 @@ static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { static int mt6360_probe(struct i2c_client *client) { struct mt6360_ddata *ddata; - unsigned int reg_data; int i, ret; ddata = devm_kzalloc(&client->dev, sizeof(*ddata), GFP_KERNEL); @@ -319,17 +337,9 @@ static int mt6360_probe(struct i2c_client *client) return PTR_ERR(ddata->regmap); } - ret = regmap_read(ddata->regmap, MT6360_PMU_DEV_INFO, ®_data); - if (ret) { - dev_err(&client->dev, "Device not found\n"); + ret = mt6360_check_vendor_info(ddata); + if (ret) return ret; - } - - ddata->chip_rev = reg_data & CHIP_REV_MASK; - if (ddata->chip_rev != CHIP_VEN_MT6360) { - dev_err(&client->dev, "Device not supported\n"); - return -ENODEV; - } ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, 0, 0, &mt6360_irq_chip, From patchwork Tue Sep 22 10:20:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F5A76CB for ; Tue, 22 Sep 2020 10:23:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB8BA2395C for ; Tue, 22 Sep 2020 10:23:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OSnrgwjj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="udYxNjvD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB8BA2395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x8u67r3LuaT3h7qViVAwhURY4YvqufFFXFklgNJeYL8=; b=OSnrgwjjWMFDd3X5f2FeUARfXA JZds7baRugv7P+E1GQU0WsSa8W08YSoksoSHTukZ/PlEM/GAKY8RY5t8x4K93tYFN6hZufwa6iVv+ py9o/XHgOLstW404+OBgR1Lc+Ck0pyN9axGwekSsFslIFKbl0wLUxNUdoLg1Toq0a/mdCWxABFQMt si5/4OB1cTjKONKhZ8lW21rD4rd6dat5rimE28Evntmg5F1S11RfDj+Rf7O/BhWwKuJQlIs7tgIEd SKGTKTpIvIEWUetpBSl7aDyQhYZct2XxaE4yaH/YkMRlRQTNh7nq2n8Mv5MnnZypkn2YszreNkiNM oW+clJ8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfS9-0000vO-9X; Tue, 22 Sep 2020 10:23:17 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQE-0000BZ-4z; Tue, 22 Sep 2020 10:21:30 +0000 Received: by mail-pj1-x1041.google.com with SMTP id jw11so1232073pjb.0; Tue, 22 Sep 2020 03:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8kFpb68GY01Th3w2DM0ucVhzKr5RUf/QH4HjyWEjVnQ=; b=udYxNjvDozIL3XAcOtUS3j8N61lhH1v5oV6FhOfe9fE0LmFh2ndgSsN2wkQRXmGkPG gHmtdYiyO5WUkq1qktY1ilQfpKxQQcCc+OGC6a1HgWGOBdGvyEsqCSDD7xm19oQGHvKo ybCyZPmkqhVe+QHxqQi+uGIbNdfah0gtX2MJX5gd8xAU8MaF6JdYPyhxu4grJTBCHFHJ W7hj/FXJmIn/o8wNFdCmNKWxWxxTNLj3PCs7R16oBcFbl6LyWQnX0+LsBKWk6Wz97Ub+ P4bFl4lEYoQ8HGhqhW2tczleKPu1dHJ41h/jngEc2GnY9i99d35gP392UzFT7LoyjpDT sCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8kFpb68GY01Th3w2DM0ucVhzKr5RUf/QH4HjyWEjVnQ=; b=U55I+yU7cQUi+jiQNvCO75zofXJTt7XSHmrqFKHFPA6GETqMn/TKHEdMGKz0t7SiLf tyTJYBYktryzuMvu89n+e0boNoj8miH+wd9If78wP9IV3Z1W6t343ygCC0i0nrgpcq7P t1VPUnRDd3OZADZAYbVZiXJc3DN1uIzUvENFEed3DNTr7M7NGmswjQAkum7imQdTGxCi avagy+Rx4D4uXE6eUp4dH+Qz5SDRlHJuviKeFEczWT0iUyGqApPrlxFOEnMp7g12F86X M0Brqg2RKF9w4S1+YLTDJdiMPTULJCQwfDjWMfCRRe5BkZ8x5tGQY6SfNaBh2VW62Ox5 qKEg== X-Gm-Message-State: AOAM533Td3cUnRvpk/Re4Ud/ar3NgbA8seTF4lPmIFTijGUtFMlCsK2+ YJwpD1hnLR6eZXiYrAG5gnI= X-Google-Smtp-Source: ABdhPJyxumYyhrHvqg+coXaIW1gWpxfUc+/iaYa0QuluhasJB4aJLKNFNbFdpuhdLs79sxrF7p4PoQ== X-Received: by 2002:a17:90a:d90c:: with SMTP id c12mr3104675pjv.94.1600770076113; Tue, 22 Sep 2020 03:21:16 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.21.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:21:15 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 09/10] mfd: mt6360: Merge header file into driver and remove unuse register define Date: Tue, 22 Sep 2020 18:20:17 +0800 Message-Id: <1600770019-11585-10-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062118_320590_144E8E10 X-CRM114-Status: GOOD ( 15.46 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1041 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Merge header file into driver and remove unuse register define Signed-off-by: Gene Chen --- drivers/mfd/mt6360-core.c | 48 ++++++++- include/linux/mfd/mt6360.h | 240 --------------------------------------------- 2 files changed, 47 insertions(+), 241 deletions(-) delete mode 100644 include/linux/mfd/mt6360.h diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 677c974..075b466 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -14,7 +14,53 @@ #include #include -#include +enum { + MT6360_SLAVE_TCPC = 0, + MT6360_SLAVE_PMIC, + MT6360_SLAVE_LDO, + MT6360_SLAVE_PMU, + MT6360_SLAVE_MAX, +}; + +struct mt6360_ddata { + struct i2c_client *i2c[MT6360_SLAVE_MAX]; + struct device *dev; + struct regmap *regmap; + struct regmap_irq_chip_data *irq_data; + unsigned int chip_rev; + u8 crc8_tbl[CRC8_TABLE_SIZE]; +}; + +#define MT6360_TCPC_SLAVEID 0x4E +#define MT6360_PMIC_SLAVEID 0x1A +#define MT6360_LDO_SLAVEID 0x64 +#define MT6360_PMU_SLAVEID 0x34 + +#define MT6360_REG_TCPCSTART 0x00 +#define MT6360_REG_TCPCEND 0xFF +#define MT6360_REG_PMICSTART 0x100 +#define MT6360_REG_PMICEND 0x13B +#define MT6360_REG_LDOSTART 0x200 +#define MT6360_REG_LDOEND 0x21C +#define MT6360_REG_PMUSTART 0x300 +#define MT6360_PMU_DEV_INFO 0x300 +#define MT6360_PMU_CHG_IRQ1 0x3D0 +#define MT6360_PMU_CHG_MASK1 0x3F0 +#define MT6360_REG_PMUEND 0x3FF + +#define MT6360_PMU_IRQ_REGNUM 16 + +#define CHIP_VEN_MASK 0xF0 +#define CHIP_VEN_MT6360 0x50 +#define CHIP_REV_MASK 0x0F + +#define MT6360_ADDRESS_MASK 0x3F +#define MT6360_DATA_SIZE_1_BYTE 0x00 +#define MT6360_DATA_SIZE_2_BYTES 0x40 +#define MT6360_DATA_SIZE_3_BYTES 0x80 +#define MT6360_DATA_SIZE_4_BYTES 0xC0 + +#define MT6360_CRC8_POLYNOMIAL 0x7 /* reg 0 -> 0 ~ 7 */ #define MT6360_CHG_TREG_EVT 4 diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h deleted file mode 100644 index ef8257d..0000000 --- a/include/linux/mfd/mt6360.h +++ /dev/null @@ -1,240 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2020 MediaTek Inc. - */ - -#ifndef __MT6360_H__ -#define __MT6360_H__ - -#include - -enum { - MT6360_SLAVE_PMU = 0, - MT6360_SLAVE_PMIC, - MT6360_SLAVE_LDO, - MT6360_SLAVE_TCPC, - MT6360_SLAVE_MAX, -}; - -#define MT6360_PMU_SLAVEID 0x34 -#define MT6360_PMIC_SLAVEID 0x1A -#define MT6360_LDO_SLAVEID 0x64 -#define MT6360_TCPC_SLAVEID 0x4E - -struct mt6360_ddata { - struct i2c_client *i2c[MT6360_SLAVE_MAX]; - struct device *dev; - struct regmap *regmap; - struct regmap_irq_chip_data *irq_data; - unsigned int chip_rev; -}; - -/* PMU register defininition */ -#define MT6360_PMU_DEV_INFO 0x00 -#define MT6360_PMU_CORE_CTRL1 0x01 -#define MT6360_PMU_RST1 0x02 -#define MT6360_PMU_CRCEN 0x03 -#define MT6360_PMU_RST_PAS_CODE1 0x04 -#define MT6360_PMU_RST_PAS_CODE2 0x05 -#define MT6360_PMU_CORE_CTRL2 0x06 -#define MT6360_PMU_TM_PAS_CODE1 0x07 -#define MT6360_PMU_TM_PAS_CODE2 0x08 -#define MT6360_PMU_TM_PAS_CODE3 0x09 -#define MT6360_PMU_TM_PAS_CODE4 0x0A -#define MT6360_PMU_IRQ_IND 0x0B -#define MT6360_PMU_IRQ_MASK 0x0C -#define MT6360_PMU_IRQ_SET 0x0D -#define MT6360_PMU_SHDN_CTRL 0x0E -#define MT6360_PMU_TM_INF 0x0F -#define MT6360_PMU_I2C_CTRL 0x10 -#define MT6360_PMU_CHG_CTRL1 0x11 -#define MT6360_PMU_CHG_CTRL2 0x12 -#define MT6360_PMU_CHG_CTRL3 0x13 -#define MT6360_PMU_CHG_CTRL4 0x14 -#define MT6360_PMU_CHG_CTRL5 0x15 -#define MT6360_PMU_CHG_CTRL6 0x16 -#define MT6360_PMU_CHG_CTRL7 0x17 -#define MT6360_PMU_CHG_CTRL8 0x18 -#define MT6360_PMU_CHG_CTRL9 0x19 -#define MT6360_PMU_CHG_CTRL10 0x1A -#define MT6360_PMU_CHG_CTRL11 0x1B -#define MT6360_PMU_CHG_CTRL12 0x1C -#define MT6360_PMU_CHG_CTRL13 0x1D -#define MT6360_PMU_CHG_CTRL14 0x1E -#define MT6360_PMU_CHG_CTRL15 0x1F -#define MT6360_PMU_CHG_CTRL16 0x20 -#define MT6360_PMU_CHG_AICC_RESULT 0x21 -#define MT6360_PMU_DEVICE_TYPE 0x22 -#define MT6360_PMU_QC_CONTROL1 0x23 -#define MT6360_PMU_QC_CONTROL2 0x24 -#define MT6360_PMU_QC30_CONTROL1 0x25 -#define MT6360_PMU_QC30_CONTROL2 0x26 -#define MT6360_PMU_USB_STATUS1 0x27 -#define MT6360_PMU_QC_STATUS1 0x28 -#define MT6360_PMU_QC_STATUS2 0x29 -#define MT6360_PMU_CHG_PUMP 0x2A -#define MT6360_PMU_CHG_CTRL17 0x2B -#define MT6360_PMU_CHG_CTRL18 0x2C -#define MT6360_PMU_CHRDET_CTRL1 0x2D -#define MT6360_PMU_CHRDET_CTRL2 0x2E -#define MT6360_PMU_DPDN_CTRL 0x2F -#define MT6360_PMU_CHG_HIDDEN_CTRL1 0x30 -#define MT6360_PMU_CHG_HIDDEN_CTRL2 0x31 -#define MT6360_PMU_CHG_HIDDEN_CTRL3 0x32 -#define MT6360_PMU_CHG_HIDDEN_CTRL4 0x33 -#define MT6360_PMU_CHG_HIDDEN_CTRL5 0x34 -#define MT6360_PMU_CHG_HIDDEN_CTRL6 0x35 -#define MT6360_PMU_CHG_HIDDEN_CTRL7 0x36 -#define MT6360_PMU_CHG_HIDDEN_CTRL8 0x37 -#define MT6360_PMU_CHG_HIDDEN_CTRL9 0x38 -#define MT6360_PMU_CHG_HIDDEN_CTRL10 0x39 -#define MT6360_PMU_CHG_HIDDEN_CTRL11 0x3A -#define MT6360_PMU_CHG_HIDDEN_CTRL12 0x3B -#define MT6360_PMU_CHG_HIDDEN_CTRL13 0x3C -#define MT6360_PMU_CHG_HIDDEN_CTRL14 0x3D -#define MT6360_PMU_CHG_HIDDEN_CTRL15 0x3E -#define MT6360_PMU_CHG_HIDDEN_CTRL16 0x3F -#define MT6360_PMU_CHG_HIDDEN_CTRL17 0x40 -#define MT6360_PMU_CHG_HIDDEN_CTRL18 0x41 -#define MT6360_PMU_CHG_HIDDEN_CTRL19 0x42 -#define MT6360_PMU_CHG_HIDDEN_CTRL20 0x43 -#define MT6360_PMU_CHG_HIDDEN_CTRL21 0x44 -#define MT6360_PMU_CHG_HIDDEN_CTRL22 0x45 -#define MT6360_PMU_CHG_HIDDEN_CTRL23 0x46 -#define MT6360_PMU_CHG_HIDDEN_CTRL24 0x47 -#define MT6360_PMU_CHG_HIDDEN_CTRL25 0x48 -#define MT6360_PMU_BC12_CTRL 0x49 -#define MT6360_PMU_CHG_STAT 0x4A -#define MT6360_PMU_RESV1 0x4B -#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEH 0x4E -#define MT6360_PMU_TYPEC_OTP_TH_SEL_CODEL 0x4F -#define MT6360_PMU_TYPEC_OTP_HYST_TH 0x50 -#define MT6360_PMU_TYPEC_OTP_CTRL 0x51 -#define MT6360_PMU_ADC_BAT_DATA_H 0x52 -#define MT6360_PMU_ADC_BAT_DATA_L 0x53 -#define MT6360_PMU_IMID_BACKBST_ON 0x54 -#define MT6360_PMU_IMID_BACKBST_OFF 0x55 -#define MT6360_PMU_ADC_CONFIG 0x56 -#define MT6360_PMU_ADC_EN2 0x57 -#define MT6360_PMU_ADC_IDLE_T 0x58 -#define MT6360_PMU_ADC_RPT_1 0x5A -#define MT6360_PMU_ADC_RPT_2 0x5B -#define MT6360_PMU_ADC_RPT_3 0x5C -#define MT6360_PMU_ADC_RPT_ORG1 0x5D -#define MT6360_PMU_ADC_RPT_ORG2 0x5E -#define MT6360_PMU_BAT_OVP_TH_SEL_CODEH 0x5F -#define MT6360_PMU_BAT_OVP_TH_SEL_CODEL 0x60 -#define MT6360_PMU_CHG_CTRL19 0x61 -#define MT6360_PMU_VDDASUPPLY 0x62 -#define MT6360_PMU_BC12_MANUAL 0x63 -#define MT6360_PMU_CHGDET_FUNC 0x64 -#define MT6360_PMU_FOD_CTRL 0x65 -#define MT6360_PMU_CHG_CTRL20 0x66 -#define MT6360_PMU_CHG_HIDDEN_CTRL26 0x67 -#define MT6360_PMU_CHG_HIDDEN_CTRL27 0x68 -#define MT6360_PMU_RESV2 0x69 -#define MT6360_PMU_USBID_CTRL1 0x6D -#define MT6360_PMU_USBID_CTRL2 0x6E -#define MT6360_PMU_USBID_CTRL3 0x6F -#define MT6360_PMU_FLED_CFG 0x70 -#define MT6360_PMU_RESV3 0x71 -#define MT6360_PMU_FLED1_CTRL 0x72 -#define MT6360_PMU_FLED_STRB_CTRL 0x73 -#define MT6360_PMU_FLED1_STRB_CTRL2 0x74 -#define MT6360_PMU_FLED1_TOR_CTRL 0x75 -#define MT6360_PMU_FLED2_CTRL 0x76 -#define MT6360_PMU_RESV4 0x77 -#define MT6360_PMU_FLED2_STRB_CTRL2 0x78 -#define MT6360_PMU_FLED2_TOR_CTRL 0x79 -#define MT6360_PMU_FLED_VMIDTRK_CTRL1 0x7A -#define MT6360_PMU_FLED_VMID_RTM 0x7B -#define MT6360_PMU_FLED_VMIDTRK_CTRL2 0x7C -#define MT6360_PMU_FLED_PWSEL 0x7D -#define MT6360_PMU_FLED_EN 0x7E -#define MT6360_PMU_FLED_Hidden1 0x7F -#define MT6360_PMU_RGB_EN 0x80 -#define MT6360_PMU_RGB1_ISNK 0x81 -#define MT6360_PMU_RGB2_ISNK 0x82 -#define MT6360_PMU_RGB3_ISNK 0x83 -#define MT6360_PMU_RGB_ML_ISNK 0x84 -#define MT6360_PMU_RGB1_DIM 0x85 -#define MT6360_PMU_RGB2_DIM 0x86 -#define MT6360_PMU_RGB3_DIM 0x87 -#define MT6360_PMU_RESV5 0x88 -#define MT6360_PMU_RGB12_Freq 0x89 -#define MT6360_PMU_RGB34_Freq 0x8A -#define MT6360_PMU_RGB1_Tr 0x8B -#define MT6360_PMU_RGB1_Tf 0x8C -#define MT6360_PMU_RGB1_TON_TOFF 0x8D -#define MT6360_PMU_RGB2_Tr 0x8E -#define MT6360_PMU_RGB2_Tf 0x8F -#define MT6360_PMU_RGB2_TON_TOFF 0x90 -#define MT6360_PMU_RGB3_Tr 0x91 -#define MT6360_PMU_RGB3_Tf 0x92 -#define MT6360_PMU_RGB3_TON_TOFF 0x93 -#define MT6360_PMU_RGB_Hidden_CTRL1 0x94 -#define MT6360_PMU_RGB_Hidden_CTRL2 0x95 -#define MT6360_PMU_RESV6 0x97 -#define MT6360_PMU_SPARE1 0x9A -#define MT6360_PMU_SPARE2 0xA0 -#define MT6360_PMU_SPARE3 0xB0 -#define MT6360_PMU_SPARE4 0xC0 -#define MT6360_PMU_CHG_IRQ1 0xD0 -#define MT6360_PMU_CHG_IRQ2 0xD1 -#define MT6360_PMU_CHG_IRQ3 0xD2 -#define MT6360_PMU_CHG_IRQ4 0xD3 -#define MT6360_PMU_CHG_IRQ5 0xD4 -#define MT6360_PMU_CHG_IRQ6 0xD5 -#define MT6360_PMU_QC_IRQ 0xD6 -#define MT6360_PMU_FOD_IRQ 0xD7 -#define MT6360_PMU_BASE_IRQ 0xD8 -#define MT6360_PMU_FLED_IRQ1 0xD9 -#define MT6360_PMU_FLED_IRQ2 0xDA -#define MT6360_PMU_RGB_IRQ 0xDB -#define MT6360_PMU_BUCK1_IRQ 0xDC -#define MT6360_PMU_BUCK2_IRQ 0xDD -#define MT6360_PMU_LDO_IRQ1 0xDE -#define MT6360_PMU_LDO_IRQ2 0xDF -#define MT6360_PMU_CHG_STAT1 0xE0 -#define MT6360_PMU_CHG_STAT2 0xE1 -#define MT6360_PMU_CHG_STAT3 0xE2 -#define MT6360_PMU_CHG_STAT4 0xE3 -#define MT6360_PMU_CHG_STAT5 0xE4 -#define MT6360_PMU_CHG_STAT6 0xE5 -#define MT6360_PMU_QC_STAT 0xE6 -#define MT6360_PMU_FOD_STAT 0xE7 -#define MT6360_PMU_BASE_STAT 0xE8 -#define MT6360_PMU_FLED_STAT1 0xE9 -#define MT6360_PMU_FLED_STAT2 0xEA -#define MT6360_PMU_RGB_STAT 0xEB -#define MT6360_PMU_BUCK1_STAT 0xEC -#define MT6360_PMU_BUCK2_STAT 0xED -#define MT6360_PMU_LDO_STAT1 0xEE -#define MT6360_PMU_LDO_STAT2 0xEF -#define MT6360_PMU_CHG_MASK1 0xF0 -#define MT6360_PMU_CHG_MASK2 0xF1 -#define MT6360_PMU_CHG_MASK3 0xF2 -#define MT6360_PMU_CHG_MASK4 0xF3 -#define MT6360_PMU_CHG_MASK5 0xF4 -#define MT6360_PMU_CHG_MASK6 0xF5 -#define MT6360_PMU_QC_MASK 0xF6 -#define MT6360_PMU_FOD_MASK 0xF7 -#define MT6360_PMU_BASE_MASK 0xF8 -#define MT6360_PMU_FLED_MASK1 0xF9 -#define MT6360_PMU_FLED_MASK2 0xFA -#define MT6360_PMU_FAULTB_MASK 0xFB -#define MT6360_PMU_BUCK1_MASK 0xFC -#define MT6360_PMU_BUCK2_MASK 0xFD -#define MT6360_PMU_LDO_MASK1 0xFE -#define MT6360_PMU_LDO_MASK2 0xFF -#define MT6360_PMU_MAXREG MT6360_PMU_LDO_MASK2 - -/* MT6360_PMU_IRQ_SET */ -#define MT6360_PMU_IRQ_REGNUM 16 -#define MT6360_IRQ_RETRIG BIT(2) - -#define CHIP_VEN_MASK 0xF0 -#define CHIP_VEN_MT6360 0x50 -#define CHIP_REV_MASK 0x0F - -#endif /* __MT6360_H__ */ From patchwork Tue Sep 22 10:20:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 11792107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F06892C for ; Tue, 22 Sep 2020 10:23:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5AEC2396D for ; Tue, 22 Sep 2020 10:23:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TVz2SqjS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mIqGAanA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5AEC2396D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aP4i3xjNvbFXnMpffFcShAjQ5p2vocJCZ+KBrOoJpwQ=; b=TVz2SqjSnny/Pxum9hzdurxFdI hySSBiM2ouh5TsQ18oXeqsyzoWzDrluYj90a7LGJYGcDBPTZzHTiSvfRixzkZgUBSwqqNbLhm7yHa K/89vQ7JQqJUPDUTUfL9jy4u91kT0BgnAUmjseZcUv//Faz+ulf8uyJTLmf9x7JoEaGU2M8iU1AYN P9AziNUXz1VAUxgquknh7k+BWpH7qUMkX+F+AF7KXK1iChq+coclJQTVo7EO8TL4ClreBLFWoWAIk VFXRIFwyvOzAj8IaT3Xj/elTE953bXnIUEdfIgii9ULjerhpN1/Ve40S4GephiGhLqF6FG2sNDSty 83YH12CQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfSG-0000xp-Jw; Tue, 22 Sep 2020 10:23:24 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfQJ-0000DB-Cb; Tue, 22 Sep 2020 10:21:32 +0000 Received: by mail-pf1-x442.google.com with SMTP id k13so11495179pfg.1; Tue, 22 Sep 2020 03:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V9hzjuF0yUErLrhnKbcblV75wxDoRjtOUd/Ws9rOPwM=; b=mIqGAanAACGTwur1n3K8HBdLO7I2eHL7uk74eIsQlYejIhwD85f5vPRs6rumxsqbB2 Teptg/UiElR9YH4qd6vupwsmP3U/yTku4X/bpSAcmlwvb8TlaAwY/RGSJyZ6Y+15LBDh TeNOOsRcBvsE1AiZXjFUDSsSgks+2J6GLIi7TDdIsF2MX7gDcws1YhSFptFUF9HpYW5J +aBLiGa9MePAAKyPre/HuOdykawqSyFTi5sTmcaCLt0YbIVAB2e56hM3gcjiVbFpqPoB QkxBggTqhE46bz+UfLkqopxAcNqrR1DalbI+TWBIjmyH/P/cXqtNRwxRVhlEwPTKDAqG n60g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V9hzjuF0yUErLrhnKbcblV75wxDoRjtOUd/Ws9rOPwM=; b=J5PsBEY+3JV7FB3rg1pFOuXhHJVKXr7X/NAb6UEwA3osJZ1E63bEXKEWzBM2Ws9oA5 yn7w+3JYX4jmccsGzXNBdZHlx2Rudq6BBmMvdgAqx8vnyxJVStymVKggpVpkPQCsrOa9 tmhB50kCi0MnEEWCPiB5DdOpKER66dhv4DcBB8J84HucfrAPuNyKg/gC3TuTPJeSPaKM LW72hA5O+Or1jAZZw2eE3i911P/bUPtpoQ2RNEmZcDUkucusbBDvOiwurZ68FtUPD+nQ s5SJwtpzR/TR/Wge3II9C4SjGOrs9pIBhtSyMvBJTwMemg80EQm4Cbh6yK5EtAXlzUFY mW3Q== X-Gm-Message-State: AOAM530ZxkTvwP81z1IRqVJS5gkuBzHeloYbIUX0mXovUW6r4jpq2PAr 81KMteUkGMjuHwcrXq0mcm4= X-Google-Smtp-Source: ABdhPJxHfqAtsye+L7RXzBzq6HmwTmvZ1Z3IZSeaR+my1Se4Rg5yFyrrkuZOdS69/wOvl6/18fx06Q== X-Received: by 2002:a63:de0a:: with SMTP id f10mr2932846pgg.88.1600770081687; Tue, 22 Sep 2020 03:21:21 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:489:56d9:501b:f524:c013:2733]) by smtp.gmail.com with ESMTPSA id a15sm14859037pfi.119.2020.09.22.03.21.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2020 03:21:21 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Subject: [PATCH v5 10/10] mfd: mt6360: Merge different sub-devices I2C read/write Date: Tue, 22 Sep 2020 18:20:18 +0800 Message-Id: <1600770019-11585-11-git-send-email-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> References: <1600770019-11585-1-git-send-email-gene.chen.richtek@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_062125_734295_98E2FCF2 X-CRM114-Status: GOOD ( 24.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gene.chen.richtek[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, linux-kernel@vger.kernel.org, cy_huang@richtek.com, benjamin.chao@mediatek.com, linux-mediatek@lists.infradead.org, Wilma.Wu@mediatek.com, linux-arm-kernel@lists.infradead.org, shufan_lee@richtek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: Gene Chen Merge different sub-devices I2C read/write functions into one Regmap, because PMIC and LDO part need CRC bits for access protection. Signed-off-by: Gene Chen --- drivers/mfd/Kconfig | 1 + drivers/mfd/mt6360-core.c | 224 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 190 insertions(+), 35 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 33df083..1dfe446 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -913,6 +913,7 @@ config MFD_MT6360 select MFD_CORE select REGMAP_I2C select REGMAP_IRQ + select CRC8 depends on I2C help Say Y here to enable MT6360 PMU/PMIC/LDO functional support. diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 075b466..2ec9559 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -62,6 +62,18 @@ struct mt6360_ddata { #define MT6360_CRC8_POLYNOMIAL 0x7 +#define MT6360_CRC_I2C_ADDR_SIZE 1 +#define MT6360_CRC_REG_ADDR_SIZE 1 +/* prealloca read size = i2c device addr + i2c reg addr + val ... + crc8 */ +#define MT6360_ALLOC_READ_SIZE(_size) (_size + 3) +/* prealloca write size = i2c device addr + i2c reg addr + val ... + crc8 + dummy byte */ +#define MT6360_ALLOC_WRITE_SIZE(_size) (_size + 4) +#define MT6360_CRC_PREDATA_OFFSET (MT6360_CRC_I2C_ADDR_SIZE + MT6360_CRC_REG_ADDR_SIZE) +#define MT6360_CRC_CRC8_SIZE 1 +#define MT6360_CRC_DUMMY_BYTE_SIZE 1 +#define MT6360_REGMAP_REG_BYTE_SIZE 2 +#define I2C_ADDR_XLATE_8BIT(_addr, _rw) (((_addr & 0x7F) << 1) + _rw) + /* reg 0 -> 0 ~ 7 */ #define MT6360_CHG_TREG_EVT 4 #define MT6360_CHG_AICR_EVT 5 @@ -266,12 +278,6 @@ static const struct regmap_irq_chip mt6360_irq_chip = { .use_ack = true, }; -static const struct regmap_config mt6360_pmu_regmap_config = { - .reg_bits = 8, - .val_bits = 8, - .max_register = MT6360_PMU_MAXREG, -}; - static const struct resource mt6360_adc_resources[] = { DEFINE_RES_IRQ_NAMED(MT6360_ADC_DONEI, "adc_donei"), }; @@ -334,7 +340,7 @@ static const struct mfd_cell mt6360_devs[] = { OF_MFD_CELL("mt6360-led", mt6360_led_resources, NULL, 0, 0, "mediatek,mt6360-led"), OF_MFD_CELL("mt6360-regulator", mt6360_regulator_resources, - NULL, 0, 0, "mediatek,mt6360-regulator"), + NULL, 0, 0, NULL), OF_MFD_CELL("mt6360-tcpc", NULL, NULL, 0, 0, "mediatek,mt6360-tcpc"), }; @@ -349,7 +355,7 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata) return ret; if ((info & CHIP_VEN_MASK) != CHIP_VEN_MT6360) { - dev_err(&client->dev, "Device not supported\n"); + dev_err(ddata->dev, "Device not supported\n"); return -ENODEV; } @@ -358,11 +364,161 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata) return 0; } -static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { - MT6360_PMU_SLAVEID, +static const unsigned short mt6360_slave_addrs[MT6360_SLAVE_MAX] = { + MT6360_TCPC_SLAVEID, MT6360_PMIC_SLAVEID, MT6360_LDO_SLAVEID, - MT6360_TCPC_SLAVEID, + MT6360_PMU_SLAVEID, +}; + +static int mt6360_xlate_pmicldo_addr(u8 *addr, int rw_size) +{ + /* Address is already in encoded [5:0] */ + *addr &= MT6360_ADDRESS_MASK; + + switch (rw_size) { + case 1: + *addr |= MT6360_DATA_SIZE_1_BYTE; + break; + case 2: + *addr |= MT6360_DATA_SIZE_2_BYTES; + break; + case 3: + *addr |= MT6360_DATA_SIZE_3_BYTES; + break; + case 4: + *addr |= MT6360_DATA_SIZE_4_BYTES; + break; + default: + return -EINVAL; + } + + return 0; +} + +static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size, + void *val, size_t val_size) +{ + struct mt6360_ddata *ddata = context; + u8 bank = *(u8 *)reg; + u8 reg_addr = *(u8 *)(reg + 1); + struct i2c_client *i2c = ddata->i2c[bank]; + bool crc_needed = false; + u8 *buf; + int buf_len = MT6360_ALLOC_READ_SIZE(val_size); + int read_size = val_size; + u8 crc; + int ret; + + if (bank == MT6360_SLAVE_PMIC || bank == MT6360_SLAVE_LDO) { + crc_needed = true; + ret = mt6360_xlate_pmicldo_addr(®_addr, val_size); + if (ret < 0) + return ret; + read_size += MT6360_CRC_CRC8_SIZE; + } + + buf = kzalloc(buf_len, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + buf[0] = I2C_ADDR_XLATE_8BIT(i2c->addr, I2C_SMBUS_READ); + buf[1] = reg_addr; + + ret = i2c_smbus_read_i2c_block_data(i2c, reg_addr, read_size, + buf + MT6360_CRC_PREDATA_OFFSET); + if (ret < 0) + goto out; + else if (ret != read_size) { + ret = -EIO; + goto out; + } + + if (crc_needed) { + crc = crc8(ddata->crc8_tbl, buf, val_size + MT6360_CRC_PREDATA_OFFSET, 0); + if (crc != buf[val_size + MT6360_CRC_PREDATA_OFFSET]) { + ret = -EIO; + goto out; + } + } + + memcpy(val, buf + MT6360_CRC_PREDATA_OFFSET, val_size); +out: + kfree(buf); + return (ret < 0) ? ret : 0; +} + +static int mt6360_regmap_write(void *context, const void *val, size_t val_size) +{ + struct mt6360_ddata *ddata = context; + u8 bank = *(u8 *)val; + u8 reg_addr = *(u8 *)(val + 1); + struct i2c_client *i2c = ddata->i2c[bank]; + bool crc_needed = false; + u8 *buf; + int buf_len = MT6360_ALLOC_WRITE_SIZE(val_size); + int write_size = val_size - MT6360_REGMAP_REG_BYTE_SIZE; + int ret; + + if (bank == MT6360_SLAVE_PMIC || bank == MT6360_SLAVE_LDO) { + crc_needed = true; + ret = mt6360_xlate_pmicldo_addr(®_addr, val_size - MT6360_REGMAP_REG_BYTE_SIZE); + if (ret < 0) + return ret; + } + + buf = kzalloc(buf_len, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + buf[0] = I2C_ADDR_XLATE_8BIT(i2c->addr, I2C_SMBUS_WRITE); + buf[1] = reg_addr; + memcpy(buf + MT6360_CRC_PREDATA_OFFSET, val + MT6360_REGMAP_REG_BYTE_SIZE, write_size); + + if (crc_needed) { + buf[val_size] = crc8(ddata->crc8_tbl, buf, val_size, 0); + write_size += (MT6360_CRC_CRC8_SIZE + MT6360_CRC_DUMMY_BYTE_SIZE); + } + + ret = i2c_smbus_write_i2c_block_data(i2c, reg_addr, write_size, + buf + MT6360_CRC_PREDATA_OFFSET); + + kfree(buf); + return ret; +} + +static const struct regmap_bus mt6360_regmap_bus = { + .read = mt6360_regmap_read, + .write = mt6360_regmap_write, + + /* Due to PMIC and LDO CRC access size limit */ + .max_raw_read = 4, + .max_raw_write = 4, +}; + +static bool mt6360_is_readwrite_reg(struct device *dev, unsigned int reg) +{ + switch (reg) { + case MT6360_REG_TCPCSTART ... MT6360_REG_TCPCEND: + fallthrough; + case MT6360_REG_PMICSTART ... MT6360_REG_PMICEND: + fallthrough; + case MT6360_REG_LDOSTART ... MT6360_REG_LDOEND: + fallthrough; + case MT6360_REG_PMUSTART ... MT6360_REG_PMUEND: + return true; + } + + return false; +} + +static const struct regmap_config mt6360_regmap_config = { + .reg_bits = 16, + .val_bits = 8, + .reg_format_endian = REGMAP_ENDIAN_BIG, + .max_register = MT6360_REG_PMUEND, + .writeable_reg = mt6360_is_readwrite_reg, + .readable_reg = mt6360_is_readwrite_reg, }; static int mt6360_probe(struct i2c_client *client) @@ -375,9 +531,23 @@ static int mt6360_probe(struct i2c_client *client) return -ENOMEM; ddata->dev = &client->dev; - i2c_set_clientdata(client, ddata); - ddata->regmap = devm_regmap_init_i2c(client, &mt6360_pmu_regmap_config); + for (i = 0; i < MT6360_SLAVE_MAX - 1; i++) { + ddata->i2c[i] = devm_i2c_new_dummy_device(&client->dev, + client->adapter, + mt6360_slave_addrs[i]); + if (IS_ERR(ddata->i2c[i])) { + dev_err(&client->dev, + "Failed to get new dummy I2C device for address 0x%x", + mt6360_slave_addrs[i]); + return PTR_ERR(ddata->i2c[i]); + } + } + ddata->i2c[MT6360_SLAVE_MAX - 1] = client; + + crc8_populate_msb(ddata->crc8_tbl, MT6360_CRC8_POLYNOMIAL); + ddata->regmap = devm_regmap_init(ddata->dev, &mt6360_regmap_bus, ddata, + &mt6360_regmap_config); if (IS_ERR(ddata->regmap)) { dev_err(&client->dev, "Failed to register regmap\n"); return PTR_ERR(ddata->regmap); @@ -387,34 +557,18 @@ static int mt6360_probe(struct i2c_client *client) if (ret) return ret; - ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, - 0, 0, &mt6360_irq_chip, - &ddata->irq_data); + ret = devm_regmap_add_irq_chip(&client->dev, ddata->regmap, client->irq, 0, 0, + &mt6360_irq_chip, &ddata->irq_data); if (ret) { dev_err(&client->dev, "Failed to add Regmap IRQ Chip\n"); return ret; } - ddata->i2c[0] = client; - for (i = 1; i < MT6360_SLAVE_MAX; i++) { - ddata->i2c[i] = devm_i2c_new_dummy_device(&client->dev, - client->adapter, - mt6360_slave_addr[i]); - if (IS_ERR(ddata->i2c[i])) { - dev_err(&client->dev, - "Failed to get new dummy I2C device for address 0x%x", - mt6360_slave_addr[i]); - return PTR_ERR(ddata->i2c[i]); - } - i2c_set_clientdata(ddata->i2c[i], ddata); - } - - ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_AUTO, - mt6360_devs, ARRAY_SIZE(mt6360_devs), NULL, - 0, regmap_irq_get_domain(ddata->irq_data)); + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_AUTO, mt6360_devs, + ARRAY_SIZE(mt6360_devs), NULL, 0, + regmap_irq_get_domain(ddata->irq_data)); if (ret) { - dev_err(&client->dev, - "Failed to register subordinate devices\n"); + dev_err(&client->dev, "Failed to register subordinate devices\n"); return ret; }