From patchwork Mon May 17 17:33:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5AE9C433ED for ; Mon, 17 May 2021 17:34:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 27BE561004 for ; Mon, 17 May 2021 17:34:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27BE561004 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MdEN7gVJFFgbYuxbLKDbyAtva+Tt3+ohLcZdG4k59mI=; b=aLw0FXxVXSyDqJBKiHWEcZkdn 9wHKbq9SZeWSkoF0Vty90GGyufF2jb/1BDbHzGR8b5pAsrfRkIMNhyJW/SnF78DElWCoNy3I4zNPK k80kkBWoPqtudpJWOMJAMEP+FxsQw/TztltBm9X0z9feJspQ5+WgcCWLmNeyk7pWnKj/AyjqsUcDh CFbzZrjLsrXxxMxDEK2GVjXZgJHjGejRTqJXT67RPXlKWfnwBREOg0IIYPUWgGAPoFGZcRKjxrH8B KCcBQEgLDulYcWgsZ5rTfcG2MVUP9gei2nKNnvm7rZAR46r+8xPCMFIMBjvt21s+mvWAKQzHc3byn srTlr7aZw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih7u-00FfEZ-1C; Mon, 17 May 2021 17:33:58 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7Q-00FfA6-2C; Mon, 17 May 2021 17:33:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=2Z4KnEHs7xum8C1o1fyhvi0Rl4fGVgrNoI+acmfQPiU=; b=QcG19imwdZhHjEAh+vvKR1vkUi zffAoDV06O2ddGBaocXrPFVV3fBzdwhjnRsMea9PM6cLMeamy541etW7E7iNlVXv//nTdi6JD1d+2 3lopWxaqTTYyM9N5LAArjsAnQMWH+VP0gWRZrD46Ue77Q/UIQMArpb7fW4TQyV0FwjhD4PvDP6pBe 9gseqZI4sBUPwWS+IsBNtZMX69+m8r0PQxl0VyVb2eFBr7nTIei6pnnaVcmUbibDpD2v0xh4t6nr5 y5MQm0bIE1Q3v0nHp+ON4NZoyiw29ywZ/0Hwk8MMxwTCUfqCfRTejbWpNEOy/pXmtTauvo8EJxDat jklDPOEw==; Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7N-00E1Iu-LO; Mon, 17 May 2021 17:33:26 +0000 Received: by mail-pg1-x536.google.com with SMTP id j12so5132854pgh.7; Mon, 17 May 2021 10:33:25 -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 :mime-version:content-transfer-encoding; bh=2Z4KnEHs7xum8C1o1fyhvi0Rl4fGVgrNoI+acmfQPiU=; b=II4ZQK+Ib6eu6M4ujmFkVGRh0lhlEXGy4OhNYHW/ayWazsn1Tih0VUQVwOoL9OfU1x jM+jnuudXCU2zhOtkwrDv6tVqA9VEJSmJs9Ofbc194+v3PHw9pvovOl8BXA8N2Uj/+eV DeHGsxJeP9fnG5JZeeAz39qR1mvm2BG8ETFLPryR2Ro/GtHqPKdSl45WVubkXVhd4KU+ lOBzKpFSBUlvWd0MXX3+a92eSfb/1xAmfFI792M5guEwtDXHOKw6n8uZJbr+CSfEZgx4 V8xfhWvrCdaPsrqWYkLcyIb07r15eqwXPxiCYZ4TbHPcSY7WTC2YMiA/adHG15Z9w9tG 9rrQ== 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:mime-version:content-transfer-encoding; bh=2Z4KnEHs7xum8C1o1fyhvi0Rl4fGVgrNoI+acmfQPiU=; b=NRXUfdsbNvrITsfFfQP3mjIdGfd/eOJz/rkagGXwR/UMfgD7d5zbp43biYxZMm59bw I0onlSFgdq0cvMqBFveMo6wu5kV5rdMoU3ADUtIQ4n8vhW54N9nT8qwb85Lszie+nTys 8lwMVObPuShmqI7mk68MLLH38Z3CarkLIPxkyh2sSl6T4YGQoYn8U4npNXQuipjlpmwa o1tWxsS6fqjP+aH2jFpY+EEHNGvb0dLalDdjMhUHsFul3ovJVXyiQwJ7+NEZ/sD8PmRe GEyLTEw32B1v/3/sfnpb3CSzKzZuwdl+Ya7+ybCcXooZg3ikAHD6Gr6h9rcxF6He58gy MSGg== X-Gm-Message-State: AOAM530rmkaSzvCJ/DZ0RpuHiIV49wiCKdwJjz3Yzs1uX5nJQssR1EcB drDjK0DnQ3/dEcVyjL5726g= X-Google-Smtp-Source: ABdhPJz4dADr/6tr7cQGaBtlEp7PLgeEo4Ca+xmp6nSpRxKLIsbC8wH1/oh59FR+EwEyQ/tvm874pQ== X-Received: by 2002:a65:558a:: with SMTP id j10mr634666pgs.404.1621272804648; Mon, 17 May 2021 10:33:24 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:24 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 01/10] mfd: mt6360: Rearrange include file Date: Tue, 18 May 2021 01:33:05 +0800 Message-Id: <20210517173314.140912-2-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103325_727253_250CF04B X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 480722acf706..de6cf8edff0c 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -5,14 +5,15 @@ * Author: Gene Chen */ +#include #include #include #include #include #include #include -#include -#include +#include +#include #include From patchwork Mon May 17 17:33:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2648C433B4 for ; Mon, 17 May 2021 17:34:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 569D461002 for ; Mon, 17 May 2021 17:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 569D461002 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NFsTbE7T2CtossihYWULtgNz+rhpF3EOJlq0ZE5GXxI=; b=ToQpBptHuaGlrUM+VBYMjy4TX JDodVTlFkm0agkKxzHm/E+nanXhW3ms0dd0x2lEJe8enk7EDICGk+pBr5Hvb6EB57+Pt6CLCRtR9y oOsaWaM4U6WGWEN+chSt4jjrSQCFzlvl4LUwt+wyOvCTaQOU28YHX0k8U0xEoxXTAidqp88phS3hR LaXhO9LCN6+EBwxG0eeKfoltqfXDp5wCrRxEE3gs3N9JDAs+wbJ4KMEW+Aqz9DS3RpxokIGUZsra7 ieaFnfocT2KJEhGNETAQEWbPjE2HdNqejhMIva4rUJVhxlkSqtep2hcFXFEGL3cxF7lBhOrgh8YHP N4wRHTIvg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih8K-00FfJg-TB; Mon, 17 May 2021 17:34:25 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7V-00FfAo-Cp; Mon, 17 May 2021 17:33:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=GRMn87o11o1SMx53USbTgbBSpcSxmlgqhDqQPiXbuaE=; b=25odfi6RJ4VwjFMaKKeyxo1N+T YcTx9J4Xnk0CUJLjUz76o+8ouPhD8m1C5/Bngo0hnPYXHBuDgKuMjh5HDcQu1FojQ/2Ir8w2agg1f hnl5wHyUzhlmAWYiMCclBXiqA8meVseleB5Fo3BFca9tzw7j/ZPFpA1wO0mDmW4UMhQxxGmASiYz4 GXrePSBGV3NMTkvMqGDR+t/jBKEfhNEqKcEMgflLSMuAmKf+HA6rtLoxaCxTgrlVTJt3N4XY68RWF yHqoaXa1twtEE5TddHOBnNqXeLuvkrmmSTzyHRDOOMQ7f6KF+FukZLgcJ1JCw55QlIrmC65yWO96w bYJY75mw==; Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7R-00E1Jo-FX; Mon, 17 May 2021 17:33:32 +0000 Received: by mail-pj1-x102c.google.com with SMTP id lj11-20020a17090b344bb029015bc3073608so50626pjb.3; Mon, 17 May 2021 10:33:28 -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 :mime-version:content-transfer-encoding; bh=GRMn87o11o1SMx53USbTgbBSpcSxmlgqhDqQPiXbuaE=; b=FTI5xDcI3wT3U0vIdFlSI3bldZSDaepRX8SyaF+OtpZLvS6bQgQZevX/Mg6bDHFFWX lulWFzwpTl8ZpKqtbIHvXyvtUyJ6xQqHKLHN/bttRqUXg45BeL6UYw9AZOG3lNY4UfGh RjQAqZFf+gKyLEwe2ybJNI/1PkK80kwvb9GXLJSmHIqmO2vkxPW4H/CVRRLKS7iZ2/tv ujJ7GBAFWFen8a3uJY07wv9UHTQ2OIAvnBbRCx56HkepISxeOaCnWNdwEn8EtOKhXjv/ leSv6/wf+Vc/4qLADYUCdFsEfkkVUWDi2+vT+78M5IieEjV8Z1Cw6/zDPLGSOrUpL7hP 1ZPw== 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:mime-version:content-transfer-encoding; bh=GRMn87o11o1SMx53USbTgbBSpcSxmlgqhDqQPiXbuaE=; b=Dmeg5Gp5YiS51fFjlJeB6siFbKZna1+ZPOudaocaSQCHppgq+c55wBWr3AW2JW+5lN sU59wleDRw0r2wnWNtaxnNDplns4op46KQFGktIAgN+qfgIBr8eH23DycWqc1PpyFdZV VMbCbMtOMHsLENcANI5n2LcuQdSxR3Uyrt1Rn0B2Duaf1MgVVf+5inmN0ycWSaaBV+s6 aed1KTDNlZzIqOWdcJgcEpyPmu88VgzLPO8TtlcZjodSGdn1JgnFjJ/GLU/72gU5Fmra 7F6jdTlqtgvOP53EOBuS2wQzMX0rMihuY9X+FubGd8CkGKIhZpQw41rBuBMIJaL/hcE5 0g1g== X-Gm-Message-State: AOAM533r0IDLT3bzZbdlAv9PRv5ndwCDfbhHvJgZfJwJY8liey1gEkBK NlcyhIeJ33+kvDI8bQiachs= X-Google-Smtp-Source: ABdhPJy9fTV9uDIjdXfGSh6SbtZfEbR/6R4A/cL7uoYfdipVF9U16uIycnOIeD5B8wku2QUqCKfbgg== X-Received: by 2002:a17:90a:73c7:: with SMTP id n7mr250592pjk.116.1621272808268; Mon, 17 May 2021 10:33:28 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:27 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 02/10] mfd: mt6360: Remove redundant brackets around raw numbers Date: Tue, 18 May 2021 01:33:06 +0800 Message-Id: <20210517173314.140912-3-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103329_559939_25B3A088 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 de6cf8edff0c..c374aa6c4a1b 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -18,107 +18,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 ea1304035d4d..72edf1352229 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 Mon May 17 17:33:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DF86C433ED for ; Mon, 17 May 2021 17:34:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 C784861002 for ; Mon, 17 May 2021 17:34:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C784861002 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FxNQ/O7H3wXPLMsNC6NmacBtbXRDFOAzfzDlwsVBP7U=; b=li45Ungx+/DLlSkrntxW++xI5 qh1uCxGm1gvB96ExvOPRVjPGpyxurf9sIaM2Ru20VFE9mm+dgqUbWoP3pYhTnnW7KmQUc4HEA1+Se KjCgZ5czhn9rSZxk8TgPAGXTKtRaw1WPps93HQJ9SxtepOyF9gh0Qw1v38ijcObxSiDlnuS8E1VIb QlXUhaH19JMmfoYXVeDDmS2mQXLSU+Se08gdjDGPLhywjccbc3PKWTaUo24OmEcYW022gajHak8cN 1BU6fUrtXzeta3260RWe8vCNHPgB8J6dFpePnJet8EIx74PcRvA/SZkPcnyI2PlA4gVP5OqOF1KFQ 2yt+2B1IQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih8R-00FfLS-2Q; Mon, 17 May 2021 17:34:32 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7W-00FfAu-2W; Mon, 17 May 2021 17:33:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4pqFj7Us03V4DKXoPVf/+QTFVKwt46ibq2A620kOL0Q=; b=p24wCiVt+6c4Fw/F5/hmtv0NG/ nflxNNaH6xfcCKHLPBSWHsWAz60eVTxFKUYNmRE9FUlFNEktwKizHarC3Pzmxo2aYVpk2p1h9MZhe jYGig3hvddP/tfqcJj/N6apSkX/lo8cMDxjZpOjKyQTBqeC6fy/Ue+3esjQvoQjDuGceYDRrb1tdn vcS60HPGLiax5tMdUdTErzlJIxQakzX8M77TQo1F6agTzgNJ9ZDDs7H18Zo6/qG6+lWPmzxqjsmSr NW+b0DFG2ex+U/rJ/xtvNfYTE167y85lK+neSIvbX83JO1eZHyvs0xWa65/hsmmJDiMGBoIETP+LO KOQW6/mg==; Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7T-00E1K5-K4; Mon, 17 May 2021 17:33:32 +0000 Received: by mail-pj1-x1035.google.com with SMTP id b9-20020a17090a9909b029015cf9effaeaso2521pjp.5; Mon, 17 May 2021 10:33:31 -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 :mime-version:content-transfer-encoding; bh=4pqFj7Us03V4DKXoPVf/+QTFVKwt46ibq2A620kOL0Q=; b=Zk1D+rU4hW4nerwdzxqplSrneAc1UjS+6fRKnD9kdguNc60rlUaCn9LNfT2hAv46p9 dF1xYF4qKNHTBvJuYbswXGVVriGbDLzwYclqFzYrHlRe9ZEC1xweii+4OW19lLDV2Acc spIbFpDLwVOST6bGN6gpcjK8pBB4iaJ1d/ls4MhYlL39iPIEl2WfAleC4Qzzupnz8nrG A4Fi7STSj759NxwuFGXemxSLuZtdmsAcFP5NpaIH9jHgY6RKzgRKSXge3sbxTIW30M5m LDoH1t/eEy603/aabn0r+65i1t0SILSEQZ1lKb0x5Gj4At7uAJ204ENdHuKy0XxJCGpz SEkQ== 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:mime-version:content-transfer-encoding; bh=4pqFj7Us03V4DKXoPVf/+QTFVKwt46ibq2A620kOL0Q=; b=U3qRjp90kUFNKU3RqhEIZXgsNJMeZXeuKUgoG1wY8x9wkdBEJ3WRauP2NvssVpo3jm ELKrbHC9fLnwshV5tnijZ4jeOr7wEe44yYUs08bYGZfo/Xn+ADqWUc37Hp7fVrun8fYJ z6U+D62oupbw5dCdq/W5oqfJCBLnxSWg1A5NNWlmH7r7Kum1OQMurkaQXsAw+5T5Dfdb TnVdoqFV5ShGsxZ2Dp14QTc/3FG6n0dNrARMRk1TvcZrDtQ17ZMEarlG6W+3objZMI5K 5/RCUZbEItmJwWjEVloAVTCaVSf/uuFzLHrGETvih8zCFI05Xuvs4afpkochMD36wHQU bX4w== X-Gm-Message-State: AOAM531D1YON3FKa5Shvhz2E4f5wttSHBZSekExjpeODwOTxyASTMPtj Wbpe7mUGpG+iQpVmOv+KsS8= X-Google-Smtp-Source: ABdhPJzT50m5T8D4oLIx2u84pBdh0BVHwS15cXOIDNzpnnzNh7QkdPbvXwqZzSnKWeBvVVl4BBczIA== X-Received: by 2002:a17:90a:f87:: with SMTP id 7mr613916pjz.38.1621272811122; Mon, 17 May 2021 10:33:31 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:30 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 03/10] mfd: mt6360: Indicate sub-dev compatible name by using "-" Date: Tue, 18 May 2021 01:33:07 +0800 Message-Id: <20210517173314.140912-4-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103331_679286_BDDA92F8 X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 c374aa6c4a1b..512480f7bd40 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -293,18 +293,18 @@ static const struct resource mt6360_ldo_resources[] = { }; static const struct mfd_cell mt6360_devs[] = { - MFD_CELL_OF("mt6360_adc", mt6360_adc_resources, - NULL, 0, 0, "mediatek,mt6360_adc"), - MFD_CELL_OF("mt6360_chg", mt6360_chg_resources, - NULL, 0, 0, "mediatek,mt6360_chg"), - MFD_CELL_OF("mt6360_led", mt6360_led_resources, - NULL, 0, 0, "mediatek,mt6360_led"), - MFD_CELL_OF("mt6360_pmic", mt6360_pmic_resources, - NULL, 0, 0, "mediatek,mt6360_pmic"), - MFD_CELL_OF("mt6360_ldo", mt6360_ldo_resources, - NULL, 0, 0, "mediatek,mt6360_ldo"), - MFD_CELL_OF("mt6360_tcpc", NULL, - NULL, 0, 0, "mediatek,mt6360_tcpc"), + MFD_CELL_OF("mt6360-adc", mt6360_adc_resources, + NULL, 0, 0, "mediatek,mt6360-adc"), + MFD_CELL_OF("mt6360-chg", mt6360_chg_resources, + NULL, 0, 0, "mediatek,mt6360-chg"), + MFD_CELL_OF("mt6360-led", mt6360_led_resources, + NULL, 0, 0, "mediatek,mt6360-led"), + MFD_CELL_OF("mt6360-pmic", mt6360_pmic_resources, + NULL, 0, 0, "mediatek,mt6360-pmic"), + MFD_CELL_OF("mt6360-ldo", mt6360_ldo_resources, + NULL, 0, 0, "mediatek,mt6360-ldo"), + MFD_CELL_OF("mt6360-tcpc", NULL, + NULL, 0, 0, "mediatek,mt6360-tcpc"), }; static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { From patchwork Mon May 17 17:33:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51095C433ED for ; Mon, 17 May 2021 17:35:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 DA71961002 for ; Mon, 17 May 2021 17:35:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA71961002 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nFugD5KTjj9rL25hpZMGVQ9jbsrYdLeU2REV3pgPqDE=; b=gYD7YkayslSOlnt33FFu6Zdcc FCZ8/UNk0Ica1hZJxx3JRua+CILpERHii7D6fdj8TriNjWexEJ8esMEplhhaynIbwh+LmNDBLp5ZK P3hlRW/h7hXnFhYn3dR0/1ZUgjr9YKf38NBKmj6j7m8mVmAFllN0enEg+zdcF4Qlcd1woQXfjuU3p ySFrFrqBUFX5T2tosn+JaGH93YQduWO+gNUQA4bWzXo3SaazTJaqUf/LwfMV01uGvW4fB0mHAM0c8 QHM+O93W3bsSyZrzIN5wWSjowvqf2xKuXD7V1xPgTzAJhMSryh7tcic4cnBd+EJNBeaRSWOVXMaS9 Fy6UdS6lw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih8i-00FfRm-9m; Mon, 17 May 2021 17:34:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7Z-00FfBO-Fg; Mon, 17 May 2021 17:33:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=isU+R0YtdvBEb/YxNhS8iAmTy3xonfIIdT0KEAXDyUY=; b=MzMF9xxlt2zy4YW0cP9c3TeOIV kgYTEnj/YV36IBQ6SS3x0zratJLyao08dfXK1+DQQQpac5s4CQkzrCUPCt7hDpO+xRibwpfMfVoaU tuXILQUrGNAHHnY9NKPMRL3f9/5Lb4Z6nwpUPZswQM91slH3OQA0XlAmeh7AlYOPo78w+QRBA+eLk DCr7gHij7WIDeYgOiHLNsXf760KEMybUL81CZg196kOTifGjMXyaNWlewJBWuze/C4TH/LfMuTm1g KFv1wwH5X+oFOxYFYR7IhrpNhhz5aKKJbY/hBtXH5Ex6Lz5JNdUt6n6ipjZyclhxsgi44/dhgTWx2 eEfg4X+Q==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7W-00E1KP-VQ; Mon, 17 May 2021 17:33:36 +0000 Received: by mail-pg1-x52d.google.com with SMTP id k15so5118384pgb.10; Mon, 17 May 2021 10:33:34 -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 :mime-version:content-transfer-encoding; bh=isU+R0YtdvBEb/YxNhS8iAmTy3xonfIIdT0KEAXDyUY=; b=bJ4knYa1+wo1bFrOT/oDLvt8veW+tkDk3aEEse8oCipOnmPe7zk+QIRTGkTtZ6KMpK OrjJ8bl7Fejg/ryFRfI2eofAUC0NPqN/pLKzJN+MxmZ17d7J04FsgSgPi7KbaSiH7vgl MS6ckEOpDtfDuBUDe0Ju135s8MOKfCkL8DgGo9n5bMSAxqjcHQS8jL7WX0MiPpCvLmaX TU5Pag4M6BHH/GHuO6IM7NOKGjtq+yN1VF+bETI+9eanXOIQ/6Lu03VM9gES23uH0yip dIBKI+WuIXAs/vSLDJGspzqWnLLTSIlRGJxALemjp4HZeZ0KSYBUYzxEbkESlMGMmZCU DJtg== 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:mime-version:content-transfer-encoding; bh=isU+R0YtdvBEb/YxNhS8iAmTy3xonfIIdT0KEAXDyUY=; b=j3lJqtiO1aMj2MvOa7UPexoljDbbTMjdWGsjGwzr+kT1YW9M6QHhY3Riek7zrc5Zy/ cz1/LglThMERxQSpiBd3L6JxKN4ZD5+T16Q6R6/XbtcHDTTAU4Qtmx4vxpfLHI0buLUL 1hxVmpNlFxe96kqxFEl+CoO9bNl6Y7ZeqZspkIOhFXukUL/CpuQrTMMUkrWoZCnOyfQx 6/luauQxrXozoEtOv6XmM69zSQo/sFVTEZSsvARaGGEe+4C5T5b/AQh1cfBufcPSE1l7 ubM77BFEk6bYaRq9sMTLKIObsu+/IhGjMTeUOM7D38I6+YnBHManMKras8yNQ24RWZgZ 4NMg== X-Gm-Message-State: AOAM530lnNigke0ojQXVqUAP6+sNTnqIps+pk9ytvnV0LxOYkCaZZxyT nj+zCG4zywWxAedETsNPxD4V6bVrwP0= X-Google-Smtp-Source: ABdhPJyaGfGcNWLlYnSVTpg5LA09Jl/79wWm2dvOP0W4GgpoCwv9EBUL1PSpCTOJG+W18AFvfa/Hig== X-Received: by 2002:aa7:9252:0:b029:2ae:bde3:621f with SMTP id 18-20020aa792520000b02902aebde3621fmr725640pfp.18.1621272813968; Mon, 17 May 2021 10:33:33 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:33 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 04/10] mfd: mt6360: Combine mt6360 pmic/ldo resources into mt6360 regulator resources Date: Tue, 18 May 2021 01:33:08 +0800 Message-Id: <20210517173314.140912-5-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103335_032048_7D6B4A9F X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 Acked-for-MFD-by: Lee Jones --- drivers/mfd/mt6360-core.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 512480f7bd40..3553c7045829 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -266,7 +266,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"), @@ -279,9 +279,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"), @@ -299,10 +296,7 @@ static const struct mfd_cell mt6360_devs[] = { NULL, 0, 0, "mediatek,mt6360-chg"), MFD_CELL_OF("mt6360-led", mt6360_led_resources, NULL, 0, 0, "mediatek,mt6360-led"), - MFD_CELL_OF("mt6360-pmic", mt6360_pmic_resources, - NULL, 0, 0, "mediatek,mt6360-pmic"), - MFD_CELL_OF("mt6360-ldo", mt6360_ldo_resources, - NULL, 0, 0, "mediatek,mt6360-ldo"), + MFD_CELL_RES("mt6360-regulator", mt6360_regulator_resources), MFD_CELL_OF("mt6360-tcpc", NULL, NULL, 0, 0, "mediatek,mt6360-tcpc"), }; From patchwork Mon May 17 17:33:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 044EDC433B4 for ; Mon, 17 May 2021 17:35:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7DE5761263 for ; Mon, 17 May 2021 17:35:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DE5761263 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KPiSd/KZ87s+RZ4nJnPgiFDtJOw/+CK6xAXdFajnDGc=; b=Z+bnBQigdqnrhaEzYqmCZb5XV Ijh20yasa0hIhgkWcze4Uay5xtGUGu4v2FALipvqUaoW0R25QJ8+Ed53ehdvCxKWpOeMUF/bQZ2U4 TSk3X1vBg9hPQBhgDeQ4yTkwLgQIwkV7Vc+fZ0fc/Km4R/zA0xFIroVOkj1jnH/1u4GqqzBAllJJ0 t5uasR1UhJiFtvOYJ7LjOnjja8pjZzjZWB+OZ7x1aWN51aaimGxIVVv1OqsP7yCfIt5/oOkgN9Ygp JXzrgrbKjaPpl86dAd3nK9XrYwBmngmlpr5g3t3Nhsgym8jeTeDGzeN3qQKl7p9TrEhKQrAIQQ7W0 TyfpHJl/A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih97-00Ffaq-VK; Mon, 17 May 2021 17:35:14 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7c-00FfBd-6o; Mon, 17 May 2021 17:33:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=0qfc/4x5NUlqMKF6YV5bXi/lMGhfFwLsCdX8LnCxHAU=; b=nugEQW9guHz8rbbx+1efD9/kBR 9wK8I56/n1F22ob0GfCiJnYstL/698bJRYKuiV9xH6VWHKCarbuF9x9xIbyAz8cLtIdcstWRoyxSx SKAm2Knr7ri42xfyeGerIiyDNtS8Ua2UDzccg5m6pBYlvVjJJRSdxx5dovrXf7BanMrk+Kwfx21lK FZtJMQ0vL8fRFZxu8h0aaI0ytDVeYDd2Fo/pgGrZ3wAJ+ytGekLrAnYQdUwJtseNvOUMg/EJ0ZzoX LaYgtayCObJ97hudUZPCvXPVhMBs9bjB4X7OEmwWqnBbf0a7v9jaAQak1fTpONaf4a+oFz/gGJu6w zpPOBSzg==; Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7Z-00E1Kq-Hg; Mon, 17 May 2021 17:33:38 +0000 Received: by mail-pl1-x62f.google.com with SMTP id b21so3589405plz.0; Mon, 17 May 2021 10:33:37 -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 :mime-version:content-transfer-encoding; bh=0qfc/4x5NUlqMKF6YV5bXi/lMGhfFwLsCdX8LnCxHAU=; b=iX+ssj3xwZLEAW+CObvf35JxI7MqutPNzS4sjwIoFtE0WYnrSJxDeyxw6EqzhvNI7C NqJVlMPTrLUrXfWLyQBNPcUgtUVFGrGJ3hUky4g4oiF0lIsrrMtgnMM5E/wc1oyO+Wbb ayKPujkKNdg5132uZTb+LlMw6BZQBV0lqDQgCVHEbWqyeNQqfRh+OkL/hcAXcMa9JxRz UmVGc+w2SIDkA/52zV7cyiExYvg631+OTBzCOKV3dWZEfOudNMkYfCR65s201MY5XEYz esfdgM9EhSYmot1PCaFWuv2JVGQyBAY+K7ODnNuzc7adocHaZii6GM7wk32GlMRubfUd 9Z+Q== 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:mime-version:content-transfer-encoding; bh=0qfc/4x5NUlqMKF6YV5bXi/lMGhfFwLsCdX8LnCxHAU=; b=awm5+QF425VbntL9EWHRHDu/UXqWfg2klUKPbI/FcxXvKoWD/70RRL6nz+ANDOggRs RJ0q5X0Fxv/KKPKviV6t37XBz9nG03NYQlm4lQipTy8o/SGyWK07kLsTxn5PQLf9+ilN NFCdK96inSGgeDuORY9ZKXvk7jTJ90MM6FInpxQlg4vKzboHxWiKbTN0QY3XQg0BdeXc hO4dGHSWi+cvCyL/NiaEQHihUvJthfM9IUmsDrWmoLckeyTKJzSgz5yITooQTMDWZs2q /vJQ66aiBqqaulGx5EIUGl4d3eDl5W8MsX6RKHhwPdT4PnO1qYk0/MX5qajPFO75bCWo G0Mg== X-Gm-Message-State: AOAM532VAJGDDqFoeff2ZwHqFuF44WgcGdqrpR43XPU9rB5SHdtRaT4H bA743Yezg4Ce9Sk9T66b/ZY= X-Google-Smtp-Source: ABdhPJwm5NzIiZyyDDJzX7EMmWURFlbn6tp+cx0QVoBLPJSCbM4AiMEuRdEU2G3mWdQJE9LnV7S+SQ== X-Received: by 2002:a17:90b:1e43:: with SMTP id pi3mr563730pjb.51.1621272817037; Mon, 17 May 2021 10:33:37 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:36 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 05/10] mfd: mt6360: Rename mt6360_pmu_data by mt6360_ddata Date: Tue, 18 May 2021 01:33:09 +0800 Message-Id: <20210517173314.140912-6-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103337_609522_BEF3DAB5 X-CRM114-Status: GOOD ( 15.73 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 3553c7045829..6428160ef19d 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -211,9 +211,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 72edf1352229..81bca7c2ad4d 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 Mon May 17 17:33:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A310BC433B4 for ; Mon, 17 May 2021 17:35:50 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 2221961263 for ; Mon, 17 May 2021 17:35:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2221961263 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A4afavw2p7jO2Dr/CKVBXxrtlr4a4/Z7U/5Nv/tzjZ4=; b=A5N+Qcwm1j4liR3ESmb+R+jr+ JPTzbIf3KdqRF9QsUxhC1r64y5L8MfniDlU75/rLvcsEI9YrdJI0WDWsJ29wdJqNNaWW9Um1QA5Ig uLkG6b5eFPxr+PBTp39VFaZqaQLST3kcWuE4sr9a4IKJf1azf0dSEtWGng9lGoDOjwUGR7KZhC+rh UNArdCCjQtvU68GIr7bpf0rPbv9niiTHDBDBYSCxYbT/7l24WmkQByrx6eVkzkvFwcEooDVyrvbNK gIuJ7puO3AiwMGoFw5NBop9pPch4aZtdVFfSoyRvXN0zzWsPZyTEC4sBWkJYa6DnHYGYwuVcvV/En GEArwad5A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih9U-00FflN-PV; Mon, 17 May 2021 17:35:38 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7f-00FfC3-IW; Mon, 17 May 2021 17:33:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=CB4Au2rqSYHXECUUAhAdaBH6k6u8w52lE27aVDKXkVs=; b=lQG1eYEHAwPzwEPkMy+5sH6d1j N5pYdWf4KXF3Mep6msXkx4iaJH1JMFwER+bu+5p09z4gvwMtGDOFWq6aKHnqBaqZCbNxMcitno4DE haHfb0/Y/VxJKrci/q/hgk+RWEWmSiGFyyiHMreDVGsi4YXBUh9dioVcUT4SNJZmMp+u7we/54FOv bhns25mtWJ6GbRdPZAU/okbBoxiaTu/rI79uxDH7TWWgvyTUHFbJvLR80RZdHKsy8PAsG6OVT4hru UC5YYtP71RmTePi/419rMLuuEhAGJnEPmIm0GkFAtnWSeJ+TN/wk7w9Sf8jlYBvBwWyh5clrGDpUu QjyEIbNQ==; Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7c-00E1LJ-SG; Mon, 17 May 2021 17:33:42 +0000 Received: by mail-pl1-x636.google.com with SMTP id t21so3572507plo.2; Mon, 17 May 2021 10:33:40 -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 :mime-version:content-transfer-encoding; bh=CB4Au2rqSYHXECUUAhAdaBH6k6u8w52lE27aVDKXkVs=; b=jGukvu2dZ/zb7kxFUpN9TTZJzR1v/A/DuNlNnzU1GGSpuBD6Wqv9TAYDju1mGkgOwo Kb7sV29UIR4fbYuqsh/8wZD7xf3d6/N6JWvVCTedYbmXDJQO572LCGwh5EidUMxnTU9b hmV1HHV27a54bh9DU90d2hRVSr5iytr+5IPJq1rwYmAX3BgfE2jDHLSTkME0Vq/RbFUO sfAJzHaMlFnb6BKVeEY46ELlEtoo3vSj3eQieI6SeHp6++x5qOsjK0JJZtsGH2wJbYBP JFRsy/b6bbzRc6FFrWuFW/rYlsJlBv37WJ4gLO1KMOc8HNDLt8Pj1PQpHaJgl3TRKZ0M 4xjg== 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:mime-version:content-transfer-encoding; bh=CB4Au2rqSYHXECUUAhAdaBH6k6u8w52lE27aVDKXkVs=; b=bWawX73W2Si80ESiMoAe5W5O8cyfneR0AywmqwrfYjZI5yVcsDUGi01NwT1fOP9fs2 kEfle1EDWAHHTihHSQ+zJggV17dZjr8kBROxjvRr0IOFuUy+srvOuDsjExQQa9h+KKer mwXzxc94bkTlHNx5CqfXOpb6SQEDcz82TO0td+mAxqXQVqenf+fLZCXhcNlEvKSKgJMC fOYyFpbrJ/5/Fl3IO4cwur2OvQCeqVbUb3qp6vtY4+7eS5oLX/DmWi10452BkEboLjBk JR0dz9+Z12QhE0Odyqy9hnjsUsD6SmV+IeQ7M1DAy3n142rYb+vjRJxv6Ki4+Nk5enrq qhwA== X-Gm-Message-State: AOAM532+Y8QNkGm1TkYE0BVUssBujtJsq3WsXnSCDHHo7jwuPak/W1ti t3rUs+/rtQwodrpWp5LcaNo= X-Google-Smtp-Source: ABdhPJzyfwYjyFvqUbx1tP8+gQlY1S9t/qXdn6EliB5T1FBoMnA8SMd4s7Id2z/vA6KCyrKnKXeKSw== X-Received: by 2002:a17:902:d508:b029:ef:b008:f4ad with SMTP id b8-20020a170902d508b02900efb008f4admr1213047plg.8.1621272819913; Mon, 17 May 2021 10:33:39 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:39 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 06/10] mfd: mt6360: Rename mt6360_pmu by mt6360 Date: Tue, 18 May 2021 01:33:10 +0800 Message-Id: <20210517173314.140912-7-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103340_936519_352D4D7F X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 6428160ef19d..a1d74bb302cd 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -120,7 +120,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), @@ -217,9 +217,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 Mon May 17 17:33:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78231C433ED for ; Mon, 17 May 2021 17:36:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 F1FE161285 for ; Mon, 17 May 2021 17:36:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F1FE161285 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=os2+jHC/PEUITOyj6RTeM29ywrLnNLy12k0f180bnas=; b=eJQf5vqTqCm91Y6gcGyGd0l7+ f8LIS6vCuaM7KyIpVbJtOmqMNv/e1qL1WV1OkzYfP98VzaxhOg0f4zQyHCfeIdI7pPo8Q8CrUPjGP a9A3S1s48LA6Q4YOLT9+29yHw7v+mbUuIg81ku8tG1D+u3ORauwevfA7Hj9rBnT8N+3KkY2IEtvvY FWFsXQ6eFeD1NffGD0ogQQtUopfEAh04yR++FyTbxDE4nKn4eebXaY/sQRh7+/tm9Y5FKH3JDHy2y 1syrQPIX8Y3Jk5TKjzKDu0WKEUSaErdjLLG8J78hYulbAZ+LVQZKtFgXGqPumRePtsZdX20jUCFc3 Vy/6OEJYg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lih9v-00FfzG-Vv; Mon, 17 May 2021 17:36:04 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7i-00FfCX-0m; Mon, 17 May 2021 17:33:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=U2LUwkBCn/UHUIUpN0tGBxlVhEOoLXnQJ9JqYqN767U=; b=IJ5QJmCcrYhJzB7J0qX5uWtrYF wb48m6z+9Wa7U5XaKJeNp51GR1C5Yw4riigvBX5Wlyx2zeUQvcQLA54Zp9DL/XN/9/2fXzSD5Q9dF 71tXpTfVvfOGjjsI2nTMsQbv3bAeRPr3iHptg8Kfq+PNM3BJJvf+xH1Q+VhM2eNQXF9956tdeAuvX UwUk/Buj+3YEyZk9zZslxmxUlKPK3IwwJiU0mzOT89TKV57oxNIL/OZq2VI4qsgTaWvZn6qtsyKpg UQe7V3VtjqAEF5nN2A3p9zgzT6dXJuKM+F0kUPCqnF94Yi3AftDoHkmwSez2gQSU/7oWan0hXxLsh bBAiQorw==; Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7f-00E1Lu-HX; Mon, 17 May 2021 17:33:44 +0000 Received: by mail-pj1-x1035.google.com with SMTP id b9-20020a17090a9909b029015cf9effaeaso2834pjp.5; Mon, 17 May 2021 10:33: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 :mime-version:content-transfer-encoding; bh=U2LUwkBCn/UHUIUpN0tGBxlVhEOoLXnQJ9JqYqN767U=; b=ZFpepfFWH2fZl4tzbb4HErLNIDjmb5y/QqZ3WH9HmqjFiryAPKNEAOhBHLgqGRBqw+ fRm1jK8HXdqzhX0Qm07SGqKlUfwQTp1LHDXolhvChHtIrTMp/B3swomJ9BVDS0SFkWUY 5A5JYHrM3aNeNBIfNVCFnBDVizFf6bJJuTnm1rh6GYubxRFlzLVhIvNaLoKZkF2A6YFJ 0Lx+1JfPQbZNg2paBUdzyz7bkqEPljrYDUvX5Pvds778aVUBYbuPzDNR2/XaMLCPo4Ti +jobzZq75u5L4/Gcb+72nl9F8oUnNbaXTuwgKqI7t2XDysSHmSrvMkLExIxcT6i5jHEx LPmg== 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:mime-version:content-transfer-encoding; bh=U2LUwkBCn/UHUIUpN0tGBxlVhEOoLXnQJ9JqYqN767U=; b=My51Rz24Zyaz9GrDkq/hKcgxKw5v+kuTq8auLXj+rG8njpxncrhsXY8R3H+KEweJFg AiZgn+wbY7oXqiDE7RjyLUTeKdtLC1pkHN52VucjnrczbU1NFCI9DEsG79sQLSvW7zib wa7FmJphA7RtXa6ymrrRfhws0gE9BOOOAogqnItFh+yov6ZTw7KwQ8ZHK7yGhTkS2Z+8 tx2A2VNi8Lhibd2vo/XjxLqKmooUSJ8PR13z6hbNkK1YpSI+bYt+Rz2aMqWx54XLEZEJ uxcaoSSBiPKVNXyYNnYttufcV6YLEOmpD6jzo4eGmtxVwac1T/JANccafEjQhuNLp96U Xkkw== X-Gm-Message-State: AOAM53390lsIDqCJ88+AHgrdqPluHxWf6xCJ0FdqznhX1Ra4FKk5ow1i sxE12odMsn3LSYEPhNDGWWg= X-Google-Smtp-Source: ABdhPJzUNr0X9l/F4LvvQbKVAhQ5hjETNBMVetzvzKHHW1R09teIr6XxNrTxkvngFOCY0PqtC//9OA== X-Received: by 2002:a17:90a:5649:: with SMTP id d9mr243681pji.98.1621272823176; Mon, 17 May 2021 10:33:43 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:42 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 07/10] mfd: mt6360: Remove handle_post_irq callback function Date: Tue, 18 May 2021 01:33:11 +0800 Message-Id: <20210517173314.140912-8-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103343_603267_E2F33B4C X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 a1d74bb302cd..50a170065a98 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -209,15 +209,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, @@ -226,7 +219,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 81bca7c2ad4d..ef8257dffe3f 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 Mon May 17 17:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A202C433B4 for ; Mon, 17 May 2021 17:36:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 98F8C6024A for ; Mon, 17 May 2021 17:36:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98F8C6024A 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MWOhzkv6cjSR4F1fF07Oh7BWOHkuxP/+Cnh7Pv7s9Y4=; b=rDOsBqwhw3TlR3W/RPAz1M39h T6sdLwujdQzMAB2I2YSNWjdxOEc1yxtaVUHmjEl8uyFeI4bXTisdi4X8ADBtJCFcmLQRSrb2LeVRj PQdti9QjPTjEUnQNx8RM7XoHLKOfd7xS8F9FSMP1+U0IU3Z6fgxRHa2ENqfl1F9kAUFXiWoTGndi9 e9Nq4N/AQejl/eR0pwuTOrK1qtwsew0YDI5AmcYcJEqXuY7p/4dO8rNL1zLWdNfVfW/DdPkwG8n0D q2TMuRRftC475bOFdKch6ysLvi8Jngiq1iQHK9XV//79PxR/3gFs2x0nyyiwOZOmpcvlh1JMqymVN gO9iQRkHg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lihAW-00FgFE-14; Mon, 17 May 2021 17:36:40 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7l-00FfD6-3w; Mon, 17 May 2021 17:33:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=+SGZLC9XHUt+lZzTU9RZd8JyaaWpbIPUIXZL+8shzcs=; b=BuBdB/Xk9g9TvLOGAb1gWcdnCn FemfUu7Uvjz6E09P2rCllnENSorPrKQpTb7uI36uqw8oVkWg7JVbetsGcKs8AGPkMEAhlsh/ofvXE md91XI8PswVdcrv6cPmHtFJ9sc9wOA6AwbJBOqaoWvp0mpvv+YRWtPWuwz0nCl7vKGf/EffSvjix3 xQAwy/AnYWJ5fL7U3uGWtBdhnzN7kHJJpJ74kVYOT1HcoP6xy9DtJRJyD9DstgxwykNwYoMwiFwrV NaYogxU7G3yIzZT0BIVeXcH1375v0RxILqKCHPTtPjw3OW4BY9113v2m235lk33jznZxUgiPUE1O+ k768YcoA==; Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7i-00E1MM-KP; Mon, 17 May 2021 17:33:47 +0000 Received: by mail-pg1-x52d.google.com with SMTP id i5so5171678pgm.0; Mon, 17 May 2021 10:33:46 -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 :mime-version:content-transfer-encoding; bh=+SGZLC9XHUt+lZzTU9RZd8JyaaWpbIPUIXZL+8shzcs=; b=kAa3R3VMavzYayCAWbgzmaYp4JMxpY+hSNqopUhEBzFXEHoaFAkofW0qq+74+L+Fn+ 0SCsuMU5FF+ao9/cA9QlnaIMXX+l1lvOEeLQR2RegcYvdaxuaZhVwZy5ka27cfU8MRrw MlivrWclkjQmDQcr0GStDYySsJPyIbIVRe1Xb9tEq/gUln9aSYEf1TgOFlSrRKXzl2D4 +nRmhqzLIymGpxCCpdc4Hr80XCgcuOFjWz96crFnecuDcd04NZExEjig/7rHqTgznSZz dLSObErCpCrZ4OCI8/L29mOBnmzVPa9Ko8EnTSQaMW4OPTtVctuB89hb0row/NwoNmqe 5K7g== 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:mime-version:content-transfer-encoding; bh=+SGZLC9XHUt+lZzTU9RZd8JyaaWpbIPUIXZL+8shzcs=; b=FsWzINTK9CyFpgurzlPb5DviJN1ot9d5Sre07O5XSnM69LI8VtC5igAPZPbnPXtD6V nY+cIbMrgKRKeL6TCht6lWpWCOQF4/pDx3W9OocTjoL4XyO2Iw73jvCJbJlo0NhCO0ym MacOx6Y5nBLGwEb5MB3cfEXQIe9LZiRTeIoLZ44PJ2I1BH7R8eDAnXp3SmLg4o7/3hoC h28uE5/rj45todbQvOo4q2ixAbuI79b8gpFtFVZ3Ya9lzG5CCBZdV3CRwT2FqDxS8OkH 3s6Q2JdzL73b40ntkEr1oPEpk7AzDlw4xpITFaxPXnB1paPeugKmNOB0+++TU3vtAuTG bRGA== X-Gm-Message-State: AOAM533cXKvLu+/9FfSJwvJ/gHVL4Rn5GHz3u35o13CoGYh93172vb5a mAhIbP8dTsou2nQnBPk6ONk= X-Google-Smtp-Source: ABdhPJxtusr0DXLHM6IuD2qWOgDDxxA8Yvo6b0rH9EpdnC7wmWAhSu5aLnE6r6Wv0Ktn+alzLJJaWw== X-Received: by 2002:a65:5248:: with SMTP id q8mr651292pgp.176.1621272826253; Mon, 17 May 2021 10:33:46 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:46 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 08/10] mfd: mt6360: Fix flow which is used to check ic exist Date: Tue, 18 May 2021 01:33:12 +0800 Message-Id: <20210517173314.140912-9-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103346_692886_D835AAE9 X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 50a170065a98..cdd99770f94a 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(ddata->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 Mon May 17 17:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ADD5C433B4 for ; Mon, 17 May 2021 17:38:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 0036B60D07 for ; Mon, 17 May 2021 17:38:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0036B60D07 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ijRi9INTyjv20DsaMvvgeh+aN+EvLIShp4b6fBHu2w4=; b=fCfjaWX+FKPNOasPPZ12cAf/D dAdL+WZsupbZHpxxC+ugImkrP14R27UEsNssf3e+pzWIPMao0MyWiNUGi3egBeMUa0wkViZ9lgiSN JewO/Wt24Esj5xn1/3HzlDBTkZnFF0SwbkrGnpePNBWKZ/IETjZoII58wmR4W41v36G82zzo1NQ54 4yqai6w1eYIUXN7jhBs6lmS/mc+0JTmRERNamsv6YYADaZp1luBQ4A8rnmi4MFR4k815HxRBJZsBT dwC3ix5/sM3+v1fpnPJ4mHT7gr/LseumYKT079Uq5+ani3AYLfBUqwX7KcD9yknXULcfg0Jdn3qXp s8fhLWYQQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lihBg-00FggH-PT; Mon, 17 May 2021 17:37:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7p-00FfDq-KK; Mon, 17 May 2021 17:33:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ZPEvCXQu1FH+pTPVtKNHobWfb2JHedc3Xs5KAJZTv54=; b=xOEiNBDAYXay63tp+LQQq5l95w DKm9txb4fLn3mnYLjRf20e5J/h4mfeFROWyYquHjbdof/I0nGlx1jSEhCg8gg9lNx5asrYubS8AoD vQuxrqXtPmjrDA9sbiZ5Hj8Zd8KTu8aFwFNYD1+NeHa8qrNs/yYSkOfbACG2T6xQwtV7HJMZQ1OH3 Yz50/rgxCQCuekvfVpbqvPfvJ4wNuKZPhb3tHjZoGIElv+HGyaNYmw7SU3fNHHy+EV256AV+T1JG3 ZIFuMnvGpqdYNXxFo/11LruZrcWTlKjOWT9ldDWwESBCnIGV2OJblE0cP2lbG3+lXLylw7PqBEdYI JENcm0Gw==; Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7m-00E1Mx-J1; Mon, 17 May 2021 17:33:52 +0000 Received: by mail-pg1-x531.google.com with SMTP id y32so5112947pga.11; Mon, 17 May 2021 10:33: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 :mime-version:content-transfer-encoding; bh=ZPEvCXQu1FH+pTPVtKNHobWfb2JHedc3Xs5KAJZTv54=; b=kgouZleYlk+xT88A6HSkY2YFjMqsS4/Ru/ECoJrV9OEt2C0E104HqD3qEXESDk9Lq7 d1lrr2oLc4tjN1A3MiP4k6GtLgzg5vml5xQ80r76/MrVCflGbosqmYTIKev4HIUiUpmh bZ9u8d9QgcG7ZP+QbxVYPPsbdJkcpdUuJqCrNdzsQywzSEjgHwOc2U8FOTrkw+29sfs2 T70G2dGE/1lvel5n+OLykdqe/KX3fBDyqBKU95DYdjZXj5fuELqPVlUxgBSCi3IvttOC 0iXQC3+XjF3ttGelBaPD+X4otjtr7UntnSCHLvoj09aaHu/4I7EQIkvixZ3Cm4EtXKLQ XlYA== 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:mime-version:content-transfer-encoding; bh=ZPEvCXQu1FH+pTPVtKNHobWfb2JHedc3Xs5KAJZTv54=; b=RhXSRUPELyvSEJrpCXo5Ooh6DKXKTmRMS3Yeg6bGQlFNP+9B69KWU5b37e1L4wPI7m mPN8RhUIRJ2WJ61LYqowP4r2aCiT/yGrSzXbF9fZJ8AtO6wA70A1OQKGAfqCVOeLtxLw qeXMIYK4l250HICVQq8Zdz6yIEZGDZqDdbFHR8SxyP8RaL3hEejOBUT/h8eQQ6Ncd2s4 V+4TZzt5Afgjs70PWhwRu0Ol8oC+mfnL3aCLLsaaOd3f71Vg24dlkuXLrrKhV9Vn2VBW 218iYOz0SoWKV44PrXChdJh5wTH4YDOfQx+ULmJYUGRToWdGIdGIJGF5BBeNiMC1vI1C Ap4Q== X-Gm-Message-State: AOAM530WbuUSRq5WqxtfsZcki2053TDJ3V7UIP+NqbO0zdsnZM/jLB6t 4he3jjkBVRLzDs8NBcav5nM= X-Google-Smtp-Source: ABdhPJxhoIAPc8VOlR5rzbNymEDZyDOnVMgrWduQT5FeD9wuYf6QDtP5FaW9kN6i7ZIkFGCPeNXA8Q== X-Received: by 2002:a62:e415:0:b029:28e:755d:a4a8 with SMTP id r21-20020a62e4150000b029028e755da4a8mr685970pfh.33.1621272829560; Mon, 17 May 2021 10:33:49 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:49 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 09/10] mfd: mt6360: Merge header file into driver and remove unuse register define Date: Tue, 18 May 2021 01:33:13 +0800 Message-Id: <20210517173314.140912-10-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103350_655843_49363115 X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Gene Chen Merge header file into driver and remove unuse register define Signed-off-by: Gene Chen Acked-for-MFD-by: Lee Jones --- 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 cdd99770f94a..a4c705c8dd68 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -15,7 +15,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 ef8257dffe3f..000000000000 --- 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 Mon May 17 17:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gene Chen X-Patchwork-Id: 12262677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2A6FC433ED for ; Mon, 17 May 2021 17:38:18 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 3840B60FD7 for ; Mon, 17 May 2021 17:38:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3840B60FD7 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+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BUk9D+G+D60bERJEGYITkbcxWgkMnMgiIHWWW0gO36k=; b=YTVkcORcoImd9G67pJV7Mk6wh 9nd2ac6auqHl1iahj6p8aHdWs2sB6N/z0pBDM8ze2AK1nS07xRzW8FlIvgNyUt61SJ/vObby5SIK6 LXqpu4JPg7JIaEr3Q76Mn7WsA9CX+yq/xawDSBStzil6hZGD0Uw+2hUkXNJ30lL8Kn9yR0Duph08c EmXJANqHr2qC6dPadbOyuWTg3WJXc5mYjIRHDNUqbrDY1tNRqkli5G5mdtnmb+e6XSK2qUhD1Veh8 O6GGrFl43fmng1B8NpXUAWbfhvnP3EVjuUw9gCY2NcZcojOkP+Nw+U7BO3MbjxI69DKxwMecj4MIw ZBVmkWXlg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lihBl-00FghM-5X; Mon, 17 May 2021 17:37:58 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7s-00FfDx-9D; Mon, 17 May 2021 17:33:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=SpbIQzkfbixUlRA8bBdjOWnojgoIaGzYZDD6NB2StNA=; b=4qbjnByC0Y/oAgkxBPK67cwB/W lLQM2NVOElSQVjYGYkUNbpUu/fb+M618+L0Jb6h6A5q5z11GFBnNFi9sf/O8EoyWSM2ELMn+prT0p HrhVu1Cn3sF4DMRtoFExTOFv1nFaod0gC0u7H7q187BJEKXox+Sc6ueiZ8uspr3ku9/tuNk/HS5jC oTN3G7S6islRt9rJ2mcgKMk93Q/CkcWkLUtwL8TP55sU/gl+qkGEVcRrpq0PKiJPyqG1UWETHT9tt FhB9Vhgou2J1e7FxXgFviZDszNS8PteuDJNXE45YOb+NmYzbiGy7DuXglTmOW2HrNhGZiHeH5K6HE kzQm/S2g==; Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lih7p-00E1Nc-CV; Mon, 17 May 2021 17:33:55 +0000 Received: by mail-pf1-x42f.google.com with SMTP id g18so3784720pfr.2; Mon, 17 May 2021 10:33: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 :mime-version:content-transfer-encoding; bh=SpbIQzkfbixUlRA8bBdjOWnojgoIaGzYZDD6NB2StNA=; b=MErJUk2YilS2O5yCjGNY6zmAVy9t/FQHdD0Xejlb7DqIpgjNxQXe3sTk/OKiVmFY8t ZgaPVZJdyqYWE3NjyOvl7/1XqmCEvTXHW9qYV/a/UR/e3cpvVLneACsj5K+g1cJI+Bb/ Vg54Jzmlf26YCbFHoR0PiwwnbaH+rnXoet6VmWt9No6pEg4tSb0DL1Mky6pQJE+IAwVS qxlo8/IB5cz8cxgjJvlK6V8fOz6ozZ25+DBMdcNPLZEZZxsRFQauK7oI5VOl7YkvGMcW JRvWolWc1BDAeSF5t1hHCwFxDvzw2Sa4ibJKkwFMCMfiwHdCQxxbZ607ZvGS+7wwWYXj 6fWw== 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:mime-version:content-transfer-encoding; bh=SpbIQzkfbixUlRA8bBdjOWnojgoIaGzYZDD6NB2StNA=; b=Gd/Qy8/N5Zc4Viw9ckNkanpHXViwBgKhwn9byb9Y4414fJ6kwAupiZPS85b86A2MH9 n8I/JEsnOGu6yhRm2wB3zwIsS3PZFEvIHg3nYsYtBFXePOb31CU2yBLDr+WXt6hiWcAJ Zmlz4Ev/J80uw4AU1XqfPQ0xA70SsPKerko5ZLIfqrsnWVwpf12jieKd5YpJ8SMNG8R1 vIwnnNjBMx0Ijh4L2kDXyoqdrgKqEhp9Xcwl2Zn+VawABP/52GzllrHO7vedgJZSRphm SEFGkIEC5hYBavqIYd4+0VrIw65ZWnpavUB2DkyHs2IMXaVmu2ZjZ8PSlNu/ivKpanZ9 /dmA== X-Gm-Message-State: AOAM530GeK2k8mF9LKuo904LJpvzlxjEXZXajI4mOcOqF8XxfVIB21mW vdN7MlbsdGFe6nQ7lxTKEXw= X-Google-Smtp-Source: ABdhPJyCPxqBfiTeb2OagfXjAVy6G3QWCkLAQzqLlg7mSqih2gisSpcxbFjEb90UGLEPw3XVw8RVcg== X-Received: by 2002:a63:4559:: with SMTP id u25mr641581pgk.93.1621272832364; Mon, 17 May 2021 10:33:52 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:47e:c24d:6c72:a52:2c8:7df1]) by smtp.gmail.com with ESMTPSA id c12sm10358296pfr.154.2021.05.17.10.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 10:33:52 -0700 (PDT) From: Gene Chen To: lee.jones@linaro.org, matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, gene_chen@richtek.com, Wilma.Wu@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Subject: [PATCH v8 10/10] mfd: mt6360: Merge different sub-devices I2C read/write Date: Tue, 18 May 2021 01:33:14 +0800 Message-Id: <20210517173314.140912-11-gene.chen.richtek@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517173314.140912-1-gene.chen.richtek@gmail.com> References: <20210517173314.140912-1-gene.chen.richtek@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_103353_454391_3956E961 X-CRM114-Status: GOOD ( 19.76 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.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 Acked-for-MFD-by: Lee Jones --- drivers/mfd/Kconfig | 1 + drivers/mfd/mt6360-core.c | 203 +++++++++++++++++++++++++++++++++----- 2 files changed, 181 insertions(+), 23 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5c7f2b100191..143715e22ca2 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -902,6 +902,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 a4c705c8dd68..e628953548ce 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -63,6 +63,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 @@ -267,12 +279,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"), }; @@ -359,10 +365,160 @@ static int mt6360_check_vendor_info(struct mt6360_ddata *ddata) } static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { - MT6360_PMU_SLAVEID, + 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) @@ -377,7 +533,22 @@ static int mt6360_probe(struct i2c_client *client) 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_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]); + } + } + 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); @@ -395,20 +566,6 @@ static int mt6360_probe(struct i2c_client *client) 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));