From patchwork Fri Aug 5 09:12:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SmlhLXdlaSBDaGFuZyAo5by15L2z5YGJKQ==?= X-Patchwork-Id: 12937117 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 6DC85C00140 for ; Fri, 5 Aug 2022 09:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:CC:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CbxLH1qbjAXgqvvhqqC308XyXELgDrVVZkaW4QSmJjY=; b=YUo3zLesoIVcWiMKkkfjKWenHf GOkJTo0JlZVDKo0YKT9Az8D3exJGdQVhFdtu2o6WUGoDUwShobZUNxMAim/Ub1C2K3uA8F3VbCwQq 3fivEZ5s973A+MUSHqPu4aF7b19w+8eLevfQv7uKwfadzvegS4tQ9WUkO6m9ICuhw30pKTtFl1P5I DqKy+paDAOJQbIdZMYfmDTsDyTllYWuIL1N6s7GP/FHXMft88V8uHNmnPmSlQsEkvSYfwrnsKl1OD if52XcLe8KNQZ+fiv01cktYnElWTOFm9mQ3hbbmua2kVAgs8xXAyoXm1t8/lbX56McsDjc6H8wc8N SNJjKHwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJtrz-00Divx-JF; Fri, 05 Aug 2022 09:43:51 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJtrv-00Diro-Gl; Fri, 05 Aug 2022 09:43:50 +0000 X-UUID: b495a035fa744a1583919662e9004577-20220805 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.8,REQID:182b81d3-e2cf-4c53-af73-3d57e4547d12,OB:0,LO B:0,IP:0,URL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACTI ON:release,TS:0 X-CID-META: VersionHash:0f94e32,CLOUDID:5b40e09b-da39-4e3b-a854-56c7d2111b46,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil ,QS:nil,BEC:nil,COL:0 X-UUID: b495a035fa744a1583919662e9004577-20220805 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 223512692; Fri, 05 Aug 2022 02:43:41 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Fri, 5 Aug 2022 17:12:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 5 Aug 2022 17:12:33 +0800 From: jia-wei.chang To: "Rafael J . Wysocki" , Viresh Kumar , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , Hector Yuan CC: Jia-Wei Chang , , , , , , Subject: [PATCH 2/2] cpufreq: mediatek-hw: add support for mt8188 Date: Fri, 5 Aug 2022 17:12:11 +0800 Message-ID: <20220805091211.2791-3-jia-wei.chang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220805091211.2791-1-jia-wei.chang@mediatek.com> References: <20220805091211.2791-1-jia-wei.chang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_024347_611202_BF1668ED X-CRM114-Status: GOOD ( 11.69 ) 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: Jia-Wei Chang MT8188 mediatek-cpufreq-hw uses different register layout so it requires a new compatible and platform data. Signed-off-by: Jia-Wei Chang --- drivers/cpufreq/mediatek-cpufreq-hw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c index f0e0a35c7f21..83ba87545ee7 100644 --- a/drivers/cpufreq/mediatek-cpufreq-hw.c +++ b/drivers/cpufreq/mediatek-cpufreq-hw.c @@ -50,6 +50,15 @@ static const u16 cpufreq_mtk_offsets[REG_ARRAY_SIZE] = { [REG_FREQ_LATENCY] = 0x110, }; +static const u16 cpufreq_mt8188_offsets[REG_ARRAY_SIZE] = { + [REG_FREQ_LUT_TABLE] = 0x0, + [REG_FREQ_ENABLE] = 0x84, + [REG_FREQ_PERF_STATE] = 0x88, + [REG_FREQ_HW_STATE] = 0x8c, + [REG_EM_POWER_TBL] = 0x90, + [REG_FREQ_LATENCY] = 0x114, +}; + static int __maybe_unused mtk_cpufreq_get_cpu_power(struct device *cpu_dev, unsigned long *uW, unsigned long *KHz) @@ -318,6 +327,7 @@ static int mtk_cpufreq_hw_driver_remove(struct platform_device *pdev) static const struct of_device_id mtk_cpufreq_hw_match[] = { { .compatible = "mediatek,cpufreq-hw", .data = &cpufreq_mtk_offsets }, + { .compatible = "mediatek,mt8188-cpufreq-hw", .data = &cpufreq_mt8188_offsets }, {} };