Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3965234imm; Mon, 20 Aug 2018 07:38:57 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyIfLm7FQyIWXGp7LcE1DbkMV2XyyTn4bJzt3xpEuScp0x5xjA3l/8xcwXtGgXP4NHF/rV3 X-Received: by 2002:a63:6283:: with SMTP id w125-v6mr10781737pgb.83.1534775937909; Mon, 20 Aug 2018 07:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534775937; cv=none; d=google.com; s=arc-20160816; b=YndWfS7BXB2/mzEfSgrJnjmERl2nTEBKrVXaBFjzMfz4saTV7Qdamzdd1uFwC/m0mj ZX1F7GO/G12xFa/V4do7wmEH98EiLs9eW0mO/5MMlJAUWGhs7BZhcX5qz6hPQ/D3IKOH d4tJhBREzSwxJpeYCdEuJbjRMsL2NscfBXaAOQJU9Mi72sAApxKV9BkIJFH95nSCBJub YhhR+yW3qsq1anF8oQZmmjq+ZULJpxB8hrFVcnEK0q2ntIvsigrWUKLHTpe30CCvezEX 3DvrQ8rkDYx0WCmF7MhUpeAja+HWIzVerhQRAJJp1ymK6QBQjDkjY7E8DywJnQjeaWBE GwQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7rf4rE3sjj352w6d+ckhetuT8N2k0jCFW3L48FtZ7Ao=; b=UWOppYOlgKGg+ZsfaSLgmkGnGAyI6uKsheI8/2FiPwOIuxkjsXCD320rXKfgmUK/KN iV7y4SP3w9ZqHOPWTnmv4yEnQEVxcaV1KBA083uc4oN2b6PyNjFyV2WSh7G09HKq3Lcd uJiQn65+WosNanHEEyluBGiHCR/W+HkNkeN5iFSWGRWsP+nzbVCli9Ai3nNvtcy3aUt1 AVtX0TYFDRXO8gRcyZ4kx+IZ4O563itbr6N787eVou/VlLj1bZDwQnDl/CQSHWMg+/Eo 5lEkx7IhnSaTUtwQNapUL8TdEcBIeu6X4ceOv2MiNCuaWnHWzzxOBhnGL/pvXThgbLeK iWGA== 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 m13-v6si9247487pgk.251.2018.08.20.07.38.41; Mon, 20 Aug 2018 07:38:57 -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 S1727448AbeHTQ7k (ORCPT + 99 others); Mon, 20 Aug 2018 12:59:40 -0400 Received: from hermes.aosc.io ([199.195.250.187]:42173 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbeHTQ7k (ORCPT ); Mon, 20 Aug 2018 12:59:40 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 941D8E0F79; Mon, 20 Aug 2018 13:43:48 +0000 (UTC) From: Icenowy Zheng To: Maxime Ripard , Chen-Yu Tsai Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Icenowy Zheng Subject: [PATCH] clk: sunxi-ng: sun50i: h6: Add 2x fixed post-divider to MMC module clocks Date: Mon, 20 Aug 2018 21:40:13 +0800 Message-Id: <20180820134013.16527-1-icenowy@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the H6, the MMC module clocks are fixed in the new timing mode, i.e. they do not have a bit to select the mode. These clocks have a 2x divider somewhere between the clock and the MMC module. To be consistent with other SoCs supporting the new timing mode, we model the 2x divider as a fixed post-divider on the MMC module clocks. This patch adds the post-dividers to the MMC clocks, following the approach on A64. Fixes: 542353ea ("clk: sunxi-ng: add support for the Allwinner H6 CCU") Signed-off-by: Icenowy Zheng --- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 43 +++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c index bdbfe78fe133..3d60f7978506 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c @@ -408,26 +408,29 @@ static SUNXI_CCU_GATE(bus_nand_clk, "bus-nand", "ahb3", 0x82c, BIT(0), 0); static const char * const mmc_parents[] = { "osc24M", "pll-periph0-2x", "pll-periph1-2x" }; -static SUNXI_CCU_MP_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc_parents, 0x830, - 0, 4, /* M */ - 8, 2, /* N */ - 24, 3, /* mux */ - BIT(31),/* gate */ - 0); - -static SUNXI_CCU_MP_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc_parents, 0x834, - 0, 4, /* M */ - 8, 2, /* N */ - 24, 3, /* mux */ - BIT(31),/* gate */ - 0); - -static SUNXI_CCU_MP_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc_parents, 0x838, - 0, 4, /* M */ - 8, 2, /* N */ - 24, 3, /* mux */ - BIT(31),/* gate */ - 0); +static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", mmc_parents, 0x830, + 0, 4, /* M */ + 8, 2, /* N */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 2, /* post-div */ + 0); + +static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, + 0, 4, /* M */ + 8, 2, /* N */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 2, /* post-div */ + 0); + +static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, + 0, 4, /* M */ + 8, 2, /* N */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 2, /* post-div */ + 0); static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0); static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0); -- 2.18.0