From patchwork Tue May 31 12:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12865547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C37CC433EF for ; Tue, 31 May 2022 12:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=6odSo+rtZVcUu6wHHFvNHepNy6rbgFYVAKVKcbBjT/U=; b=Fcw+dYQdxgP+0U gnDEUqBUXkNO4riG3zDVCQuBbhim4NRntp0WsiCvHgSkGqANfajUmhu8lFFImpdjeZkbDZdNuooR6 B/wJQoxvZL2XMIza4hnhCD3K3dpzrCJBdeOf856C9zm1VxEggmr17J9VzvX0jH6Ai1rUBsrTfcAaz zpZDiOZ6sjmzPiqQY/zXZ5SRxW/rZnIMqvwQqkvaHd4B9svKrt9b++WJTTkj3lvIvSFuP1uQ91OFB gbRr5rG0ehiw1KHruo2ROvPnKU952JdEH5nfSs4eBny11mh0Uk9M+D4bM8/3NfngsFRqF5qh5swyn DAphKyzwNgK+UZvuCCuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nw1Kz-00ArOo-Ex; Tue, 31 May 2022 12:51:05 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nw1KO-00Ar66-IV for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2022 12:50:30 +0000 Received: by mail-wm1-x330.google.com with SMTP id 67-20020a1c1946000000b00397382b44f4so1137270wmz.2 for ; Tue, 31 May 2022 05:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vH18YmztAddzvuuGm66+CYpM63IW/TSQJt/1O1NxYf8=; b=mvAUlLlgWq3s1GHJmM8Ti0FVDe+xL07OqxPOiHqygKOx9iLzqVbGNbUBaMqIS75F/n ZtrI0pWp+siR+HrEjQH6BEZtH4t7MN19kVaMbsXjlQ2eEHr5cXg5QiJ+89r/+1Eontwo ISwF+uIYnlCrUYEzfoUzLYcZpsjIaY1mY70FWxtDMaKzFNm28MFj4DkD1JjojSIvA7bq YGy+vyamBVpY4v09jx8MlCfT+EZW+abjXtr9pNa+rujp1wxUqhqin3NJazrx/+p0G6UG 7Ekx8GidumaYatHriMFCyKVOH5val5StsB/9oASu6zKg68B72/5DpzQzAStVI+jLoaIf DjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vH18YmztAddzvuuGm66+CYpM63IW/TSQJt/1O1NxYf8=; b=oi2mgTVSuViy3WFIAM/AvNNl4fFvZQ+d/IRhfkrF+f2JsyY/HkQzAYCHCeYzLs+IRH lYG6b+f0sf+KSrTF0v7J+Okc4k7mOXeoCQ8L+GcsyJfl8ov29x/IkG3N0v4ZHn2BwNr4 w7g608HUpbwCHYI2T0uWH/8MALii6XIquAdobJ5YsyHNfMpb7bjInhRu2yc/IQSj6FTR beBk/F/MFSOm6xsonhcu2bhgFbMYvXuqwR0dUAxGkAEdm3BkCCRiJXqH0ywWALX2vKo1 /jSoD65knAfuTl2cerm94tSieU45YxAi+URLq/lQ0NnSw0Xd3jxAbgKXS1gRDPf/d8cO /glg== X-Gm-Message-State: AOAM532nJvgf11SCV44qi/VKNQLp2u+0v0BsgJ061NtJQLe2xGTUECAv vnyD3pCWRHI0NyqkSTz1a1J2wg== X-Google-Smtp-Source: ABdhPJwQ38QgkJzAFctHWeekZJuWWVLy/1P/trpuL3oru//3qDkhF0gce5Krlfm/5Z6spoPXwHobJA== X-Received: by 2002:a05:600c:34d1:b0:397:4c0d:598a with SMTP id d17-20020a05600c34d100b003974c0d598amr23295563wmq.36.1654001424541; Tue, 31 May 2022 05:50:24 -0700 (PDT) Received: from helium.lan ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id i13-20020adfaacd000000b0020fc40d006bsm11475019wrc.17.2022.05.31.05.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 05:50:23 -0700 (PDT) From: Fabien Parent To: Lee Jones , Matthias Brugger Cc: Fabien Parent , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] mfd: mt6358-irq: add MT6357 PMIC support Date: Tue, 31 May 2022 14:49:57 +0200 Message-Id: <20220531124959.202787-6-fparent@baylibre.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220531124959.202787-1-fparent@baylibre.com> References: <20220531124959.202787-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_055028_721923_F4D9BCF5 X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add MT6357 PMIC IRQ support. Signed-off-by: Fabien Parent --- drivers/mfd/mt6358-irq.c | 24 ++++++++++++++++++++++++ include/linux/mfd/mt6397/core.h | 1 + 2 files changed, 25 insertions(+) diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c index ea5e452510eb..389756436af6 100644 --- a/drivers/mfd/mt6358-irq.c +++ b/drivers/mfd/mt6358-irq.c @@ -3,6 +3,8 @@ // Copyright (c) 2020 MediaTek Inc. #include +#include +#include #include #include #include @@ -17,6 +19,17 @@ #define MTK_PMIC_REG_WIDTH 16 +static const struct irq_top_t mt6357_ints[] = { + MT6357_TOP_GEN(BUCK), + MT6357_TOP_GEN(LDO), + MT6357_TOP_GEN(PSC), + MT6357_TOP_GEN(SCK), + MT6357_TOP_GEN(BM), + MT6357_TOP_GEN(HK), + MT6357_TOP_GEN(AUD), + MT6357_TOP_GEN(MISC), +}; + static const struct irq_top_t mt6358_ints[] = { MT6358_TOP_GEN(BUCK), MT6358_TOP_GEN(LDO), @@ -39,6 +52,13 @@ static const struct irq_top_t mt6359_ints[] = { MT6359_TOP_GEN(MISC), }; +static struct pmic_irq_data mt6357_irqd = { + .num_top = ARRAY_SIZE(mt6357_ints), + .num_pmic_irqs = MT6357_IRQ_NR, + .top_int_status_reg = MT6357_TOP_INT_STATUS0, + .pmic_ints = mt6357_ints, +}; + static struct pmic_irq_data mt6358_irqd = { .num_top = ARRAY_SIZE(mt6358_ints), .num_pmic_irqs = MT6358_IRQ_NR, @@ -211,6 +231,10 @@ int mt6358_irq_init(struct mt6397_chip *chip) struct pmic_irq_data *irqd; switch (chip->chip_id) { + case MT6357_CHIP_ID: + chip->irq_data = &mt6357_irqd; + break; + case MT6358_CHIP_ID: case MT6366_CHIP_ID: chip->irq_data = &mt6358_irqd; diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h index 1cf78726503b..3fecaffe5019 100644 --- a/include/linux/mfd/mt6397/core.h +++ b/include/linux/mfd/mt6397/core.h @@ -12,6 +12,7 @@ enum chip_id { MT6323_CHIP_ID = 0x23, + MT6357_CHIP_ID = 0x57, MT6358_CHIP_ID = 0x58, MT6359_CHIP_ID = 0x59, MT6366_CHIP_ID = 0x66,