From patchwork Thu Oct 13 11:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johnson Wang X-Patchwork-Id: 65 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp217861wrs; Thu, 13 Oct 2022 04:27:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PjR2DvhPk6/STVteEEkaXY61X/LKkwt1c1baq53X53kR0mI5w9DrUgtsYhrF/CcubTvVH X-Received: by 2002:a17:90b:278c:b0:20a:e1e6:5340 with SMTP id pw12-20020a17090b278c00b0020ae1e65340mr10641581pjb.239.1665660467591; Thu, 13 Oct 2022 04:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665660467; cv=none; d=google.com; s=arc-20160816; b=V6xbwQcAb4n22s0Bkr7958vAyZitzvvbHluJ+7hapZGsXmpy6WCDUIrZkovL9RRyPE dfc2efYXuEQkEwAQM307SNupgm8oIhKZaqQxVjYNWuox74bNlG66YJ6n6MXTVPobtEwQ Vi6kVBI/WFxG6McEYTly1+a8tFzUYmv4S1RHPQCZrTdlc/tzRek7jYSiseAiXgPJk+GI f5/46gQi1Z+/NIxl4qPWhbhoJg9AxPcejhWKWv7Gmm/7ztXiv5WOOSZFdC39eWpkkzwT KpzkPASAfhPwZYg/DTLUja0NKBDL2PyR74ZBCMb9vbwoAy3NZjzc6eDj4jvNsu00yXeX JeXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=xHg1H54Fp557c8dP/j/enzMQiG2x94tak33lJ6HXOWU=; b=xolbUkBTtO8OB0HUkyuIRMaDQJkdqkMuTJASw0yHE6kUIxmZhKjbzuip5DbL8ZwF0P 11FiVdM0L8C73WK8ZchoSDtRQqsO8iWrHtebey2GDXMqvEqubVewMCL/xpTtsxjOJPGn P5e9GqpJbKJ5Juu6aUSshoW+H7PAS2juZy7Ze8wbBvXyQvgnoLBVBzThManBnZcYdgg1 u5R+qHJCRO+58FAVLQo8HkB0266ye2dDYiXnYkaW+bUJjqb9pKym9EcdGvcedoZrMGSq LWYR0xIN3nar8JAM4kJaGnwZAweUEyWsrfEhxPz3iAeUwmagaJ/2mJoAZmFUo4oAmRdQ 1lMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Gd7PCQ5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020a637215000000b0043895127033si22714040pgc.335.2022.10.13.04.27.35; Thu, 13 Oct 2022 04:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Gd7PCQ5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbiJMLXu (ORCPT + 99 others); Thu, 13 Oct 2022 07:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbiJMLXs (ORCPT ); Thu, 13 Oct 2022 07:23:48 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD61946864; Thu, 13 Oct 2022 04:23:46 -0700 (PDT) X-UUID: 64896aaa555e4889b3fd3581a49ba0e2-20221013 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=xHg1H54Fp557c8dP/j/enzMQiG2x94tak33lJ6HXOWU=; b=Gd7PCQ5J4SfgjCPjqmAMCxxTyyLHYtGkikggzelr7GUcN9oR4zl5jpLV8LkPDJfEH8l4U8Mi+PdI6Qo7rADOrw5G8ixiU8i0AsU7m+PUijfPJ6pudP9kq7U4jRMwPgC0i9OGnzydjbUsR9qra+qdQoLSgxlkKjZ/3iwwwcoWtKc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:f81f07cb-2a2e-44b7-b76e-c2c408b95bb8,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:39a5ff1,CLOUDID:b0dad5e1-2948-402a-a6e4-b5d31fe11eb7,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 64896aaa555e4889b3fd3581a49ba0e2-20221013 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1162402231; Thu, 13 Oct 2022 19:23:41 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) 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; Thu, 13 Oct 2022 19:23:39 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 13 Oct 2022 19:23:39 +0800 From: Johnson Wang To: , , , CC: , , , , , , , , Johnson Wang Subject: [PATCH v4 0/4] Introduce MediaTek frequency hopping driver Date: Thu, 13 Oct 2022 19:23:32 +0800 Message-ID: <20221013112336.15438-1-johnson.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746571590544633730?= X-GMAIL-MSGID: =?utf-8?q?1746571590544633730?= The purpose of this serie is to enhance frequency hopping and spread spectrum clocking feature for MT8186. We introduce new PLL register APIs and some helpers for FHCTL hardware control. For MT8186 PLL driver, we replace mtk_clk_register_plls() with newly added API to support frequency hopping and SSC function for specific PLLs. Changes in v4: - Fixup iospace error in the binding. - Use GENMASK marco and remove extra line. Changes in v3: - Change binding file name. - Add some constraints for properties. - Rename "mediatek,hopping-ssc-percents" to "mediatek,hopping-ssc-percent". - Add new config symbol. Changes in v2: - Use SoC-specific compatible instead of generic one. - Use standard clocks property and vendor-specific property in dt-binding. - Remove some unused arguments and fix some coding style. Johnson Wang (4): clk: mediatek: Export PLL operations symbols dt-bindings: arm: mediatek: Add new bindings of MediaTek frequency hopping clk: mediatek: Add new clock driver to handle FHCTL hardware clk: mediatek: Change PLL register API for MT8186 .../arm/mediatek/mediatek,mt8186-fhctl.yaml | 53 ++++ drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-fhctl.c | 244 ++++++++++++++++ drivers/clk/mediatek/clk-fhctl.h | 26 ++ drivers/clk/mediatek/clk-mt8186-apmixedsys.c | 66 ++++- drivers/clk/mediatek/clk-pll.c | 84 +++--- drivers/clk/mediatek/clk-pll.h | 55 ++++ drivers/clk/mediatek/clk-pllfh.c | 268 ++++++++++++++++++ drivers/clk/mediatek/clk-pllfh.h | 82 ++++++ 10 files changed, 834 insertions(+), 53 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt8186-fhctl.yaml create mode 100644 drivers/clk/mediatek/clk-fhctl.c create mode 100644 drivers/clk/mediatek/clk-fhctl.h create mode 100644 drivers/clk/mediatek/clk-pllfh.c create mode 100644 drivers/clk/mediatek/clk-pllfh.h