Received: by 10.192.165.148 with SMTP id m20csp2526409imm; Sun, 22 Apr 2018 08:53:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48QxIWVh5MaGfy9FbxtO2ztDHHsMUHGOY63DGiHThPCAI+1WANxVOAJGqcBI8qUpr3lVlaZ X-Received: by 10.99.169.1 with SMTP id u1mr14971036pge.251.1524412385294; Sun, 22 Apr 2018 08:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412385; cv=none; d=google.com; s=arc-20160816; b=RcT95itmU3QXdM5+vx3RZFpt0XVB7Tq3JG1beUwsJWlb1hvzzAFl3BIcdVfVPGIQ5p 41eD4xB+QP9NcZ7ZBDN/+iKutzlKKKGoLl4j0RU6WjYkjO1i0BJ+11x4xtPZtUp/8ij0 Z/QnprE6Flo1lYqV/ZQ7cOSnQBZxJxxgmVefr6qeXwcK/hQl5QOqcisd01kZ1ImmH4ed oiVD7wugGR+pY6V/WkeKw2j2jVU/KfJr/5K9md2tvAMPfR1b0jNZw98Gja6uX3rakOqk y58ypnP6EIyEJ8RGsOhPW6gXDWjTbHI/mdFGXIU2ej4sMmqlo5jdqUO4w+lU2CL+XsZ5 U7Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dq23yj7PLU17FUb4g8P94A0E1FAdfWnsYMrGAs9SXc4=; b=jlrU/B6PG26hZp1HbyO3SE+V4qjhnUGqVk4GbXrqcD0fTI4dzaVSbzyqintS7qBoiy Gff/1v9ggkNe8+vzsfUbBYUzn0NEcBqGPFxdUVzHy17F9JPVqFe2RwivD1xb9kPLquLS AY2WwIJgWZR+dSk19yWb40oO5EuolcWEd1WrhysCaUCx75vyBR6W1Ff+5Amh7GUNzQKQ pG14xNPvbuz48DQe7o2K2MgJCc+X4cuEyou8C2IyLX2+h2w8LTRVcFxdYSUmujrw44J9 EuW8VriZJUwQvsqa6yTSRcimu2nV5N7sZtccWlUwJZuZs5PUR6Q1RWoPvikKjgwkbRel syYQ== 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 p14-v6si4214510pli.250.2018.04.22.08.52.51; Sun, 22 Apr 2018 08:53:05 -0700 (PDT) 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 S1754581AbeDVOAs (ORCPT + 99 others); Sun, 22 Apr 2018 10:00:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47586 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753706AbeDVOAm (ORCPT ); Sun, 22 Apr 2018 10:00:42 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1717C941; Sun, 22 Apr 2018 14:00:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Wang , Stephen Boyd Subject: [PATCH 4.16 141/196] clk: mediatek: fix PWM clock source by adding a fixed-factor clock Date: Sun, 22 Apr 2018 15:52:41 +0200 Message-Id: <20180422135111.539406770@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Wang commit 89cd7aec21af26fd0c117bfc4bfc781724f201de upstream. 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 Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/mediatek/clk-mt2701.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) --- 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 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),