Received: by 10.223.185.116 with SMTP id b49csp6945282wrg; Wed, 28 Feb 2018 19:29:05 -0800 (PST) X-Google-Smtp-Source: AG47ELu4AKgkn24XC7PpJ8e/U/p739ogJ33jikYOLesslkI1BTxccLWGt54H8YwCpAM0+ZJA06Yr X-Received: by 2002:a17:902:20c2:: with SMTP id v2-v6mr477612plg.82.1519874945020; Wed, 28 Feb 2018 19:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519874944; cv=none; d=google.com; s=arc-20160816; b=zkupNffphPgC5bUfVNlJz4jC5ZVxfVuSZvufR9C6DsFy1kVQMkMD1Fi4SZA4gPUBpo 3irjVZSJpO9z8ktNTMwmV0MtTqy6iiSdfAj+SryBlgWBlJ42VgWz+TE63c65wuyfjg/c cAAdvfih4GWwTJYEXJrSEO+ZJkDxrnAC5lM+L+9e1NUJv0N6OtPIUmO7lJCiRryIiyo0 vIhNVaggy+lEWH2P4ln70Ap3OPyLGRSMawXudViw+CkDfba4YQG6wrcjAUgyoxgtQiot XAtqnzBE8d7PycRbJe+tAf7lKYGop18LjInHNF4r8LTZotvPFM0XD8c8+G6qXoQl5en+ wrew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=bpbWqZgEW6/lRrd7nRK6A4x0w5TYDkra4X+3VeZcD0U=; b=H48sc5g1JhygI9J9XSHLp2rybndfCOyXn3PrVimgnfG9FGOLfxYT2uyevXcfj7dTta OUGsl8weD4tFMQxDU4GKBD+E+on3rXVIcWatG5F9hLJhCAqPuEte06QOkm6OvfufwJAs yBhUDnJHE4DheK9GFMX1fGTYL6UomUgMlTeMYt7nL6f2fsK9g3FKRX4zlp5D7Z94cEvz +oo/hvf6SOztWw/x3Rqz2TZkqFN0ViUbhr5aG2w0Q0o7yzWJY2QsIXANQxVVBRQlIzEn D53NF0gWdNOtO0Dh6j8eSltdp8YRwI38+hNGfgF9XdeC/JnDxA2xB8DjqGlsd9Vhr7Dd Ddpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si1851978pgu.423.2018.02.28.19.28.50; Wed, 28 Feb 2018 19:29:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965699AbeCAD2N (ORCPT + 99 others); Wed, 28 Feb 2018 22:28:13 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:41244 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S965644AbeCAD2A (ORCPT ); Wed, 28 Feb 2018 22:28:00 -0500 X-UUID: 4c70ceb87bcd48bfa738cb7738f0245d-20180301 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 763250351; Thu, 01 Mar 2018 11:27:56 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 1 Mar 2018 11:27:54 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 1 Mar 2018 11:27:54 +0800 From: To: , , , , , CC: , , , , , Sean Wang , Subject: [PATCH 2/2] clk: mediatek: fix PWM clock source by adding a fixed-factor clock Date: Thu, 1 Mar 2018 11:27:51 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang The clock for which all PWM devices on MT7623 or MT2701 actually depending on has to be divided by four from its parent clock axi_sel in the clock path prior to PWM devices. Consequently, adding a fixed-factor clock axisel_d4 as one-fourth of clock axi_sel allows that PWM devices can have the correct resolution calculation. Cc: stable@vger.kernel.org Fixes: e9862118272a ("clk: mediatek: Add MT2701 clock support") Signed-off-by: Sean Wang --- drivers/clk/mediatek/clk-mt2701.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c index 8e7f16f..deca752 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -148,6 +148,7 @@ static const struct mtk_fixed_factor top_fixed_divs[] = { FACTOR(CLK_TOP_CLK26M_D8, "clk26m_d8", "clk26m", 1, 8), FACTOR(CLK_TOP_32K_INTERNAL, "32k_internal", "clk26m", 1, 793), FACTOR(CLK_TOP_32K_EXTERNAL, "32k_external", "rtc32k", 1, 1), + FACTOR(CLK_TOP_AXISEL_D4, "axisel_d4", "axi_sel", 1, 4), }; static const char * const axi_parents[] = { @@ -857,13 +858,13 @@ static const struct mtk_gate peri_clks[] = { GATE_PERI0(CLK_PERI_USB1, "usb1_ck", "usb20_sel", 11), GATE_PERI0(CLK_PERI_USB0, "usb0_ck", "usb20_sel", 10), GATE_PERI0(CLK_PERI_PWM, "pwm_ck", "axi_sel", 9), - GATE_PERI0(CLK_PERI_PWM7, "pwm7_ck", "axi_sel", 8), - GATE_PERI0(CLK_PERI_PWM6, "pwm6_ck", "axi_sel", 7), - GATE_PERI0(CLK_PERI_PWM5, "pwm5_ck", "axi_sel", 6), - GATE_PERI0(CLK_PERI_PWM4, "pwm4_ck", "axi_sel", 5), - GATE_PERI0(CLK_PERI_PWM3, "pwm3_ck", "axi_sel", 4), - GATE_PERI0(CLK_PERI_PWM2, "pwm2_ck", "axi_sel", 3), - GATE_PERI0(CLK_PERI_PWM1, "pwm1_ck", "axi_sel", 2), + GATE_PERI0(CLK_PERI_PWM7, "pwm7_ck", "axisel_d4", 8), + GATE_PERI0(CLK_PERI_PWM6, "pwm6_ck", "axisel_d4", 7), + GATE_PERI0(CLK_PERI_PWM5, "pwm5_ck", "axisel_d4", 6), + GATE_PERI0(CLK_PERI_PWM4, "pwm4_ck", "axisel_d4", 5), + GATE_PERI0(CLK_PERI_PWM3, "pwm3_ck", "axisel_d4", 4), + GATE_PERI0(CLK_PERI_PWM2, "pwm2_ck", "axisel_d4", 3), + GATE_PERI0(CLK_PERI_PWM1, "pwm1_ck", "axisel_d4", 2), GATE_PERI0(CLK_PERI_THERM, "therm_ck", "axi_sel", 1), GATE_PERI0(CLK_PERI_NFI, "nfi_ck", "nfi2x_sel", 0), -- 2.7.4