From patchwork Thu Nov 15 12:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianxin Pan X-Patchwork-Id: 10684241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C40E514D6 for ; Thu, 15 Nov 2018 12:19:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AECB92BED1 for ; Thu, 15 Nov 2018 12:19:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BFE02BF8C; Thu, 15 Nov 2018 12:19:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 491CB2BED1 for ; Thu, 15 Nov 2018 12:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=X0GV8MVSq9YyGX2prSUhQ9/hGo3igi8NkOMOq0fsLo0=; b=s30oNpfvGHTkWU +hXQQT2m8TULYfG8p9s2+NXu9HMr++7bMzoUW+oZkYG7iCZ1FB7eSCKNJ+WecGDgQUdqCwLUaKQkL RPSRzwduAvR90gsDvk8wccg5mBU07r3FTbErscTPTQ0DHfOSk+bwVGpHnf9NOM6PZvQaYpFF66jAA emmiXr7WZhhJ04m8nwAOuOywZkniKcR8P77IJeqs3or0kpcyK0+lynKWPQVTETlChh4jNkIScm5UC 642mm9gS8v1EcWOEnyF4biua15pdRKu1y6D9P+EO0E3POfUvsxgvuJXM5K9sqSDni+nuzbr4THEWV 9rzZVnlX/lCmHKO2UpHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNGcc-0005Xm-0H; Thu, 15 Nov 2018 12:19:46 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNGcZ-0005XC-Ix; Thu, 15 Nov 2018 12:19:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Date:Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vhD34ebznCIpjXCYdR7rjnL9Vy91BJEp5svPSgXN4s4=; b=E1RrJPbO9NfZg+a3M04HJ/m8e8 5BlZtLb13Fr8KUVnZ+f3BbRDdHuoERdoPAgKygAkLmf42eer2TDBLlYcApzK6PbUQ3Dk+AkmHxT8q uTg9fTejcF/yk2cRjpJeulgg0tl0B1xUUfk4R3wY9ANo2eXHymr9IOWu0A240WuTC+JOAUuTjYABG sfl1vpSKCiEsn7/fLDZc7AmSiiEyHJQNtXZTVXje5itQZV0U9hzxTnYiiNwZjg0Ar8WIr7pWrzS5Y DyH65LMi8RNTSxX6f5fJFnKroivqzWboZzy4/Bl4lHo52GtMmD8fz3+Uxb4NXPL0mX81G8D1c5qz9 kI+JUmdw==; Received: from mail-sh2.amlogic.com ([58.32.228.45]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNGcW-0002V5-RC; Thu, 15 Nov 2018 12:19:41 +0000 Received: from localhost.localdomain (10.18.11.217) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server id 15.0.1320.4; Thu, 15 Nov 2018 20:18:49 +0800 From: Jianxin Pan To: Jerome Brunet , Neil Armstrong Subject: [PATCH v7 0/4] clk: meson: add a sub EMMC clock controller support Date: Thu, 15 Nov 2018 20:18:28 +0800 Message-ID: <1542284312-55418-1-git-send-email-jianxin.pan@amlogic.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.18.11.217] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_071940_913118_36D60017 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Hanjie Lin , Victor Wan , Jianxin Pan , devicetree@vger.kernel.org, Stephen Boyd , Kevin Hilman , Michael Turquette , Yixun Lan , linux-kernel@vger.kernel.org, Boris Brezillon , Liang Yang , Jian Hu , Miquel Raynal , Carlo Caione , linux-amlogic@lists.infradead.org, Martin Blumenstingl , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Qiufang Dai Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This driver will add a MMC clock controller driver support. The original idea about adding a clock controller is during the discussion in the NAND driver mainline effort[1]. This driver is tested in the S400 board (AXG platform) with NAND driver. Changes since v6 [7]: - add one based support for sclk divier - alloc sclk in probe for multiple instance - fix coding styles Changes since v5 [6]: - remove divider ops with .init and use sclk_div instead - drop CLK_DIVIDER_ROUND_CLOSEST in mux and div - drop the useless type cast Changes since v4 [5]: - use struct parm in phase delay driver - remove 0 delay releted part in phase delay driver - don't rebuild the parent name once again - add divider ops with .init Changes since v3 [4]: - separate clk-phase-delay driver - replace clk_get_rate() with clk_hw_get_rate() - collect Rob's R-Y - drop 'meson-' prefix from compatible string Changes since v2 [3]: - squash dt-binding clock-id patch - update license - fix alignment - construct a clk register helper() function Changes since v1 [2]: - implement phase clock - update compatible name - adjust file name - divider probe() into small functions, and re-use them [1] https://lkml.kernel.org/r/20180628090034.0637a062@xps13 [2] https://lkml.kernel.org/r/20180703145716.31860-1-yixun.lan@amlogic.com [3] https://lkml.kernel.org/r/20180710163658.6175-1-yixun.lan@amlogic.com [4] https://lkml.kernel.org/r/20180712211244.11428-1-yixun.lan@amlogic.com [5] https://lkml.kernel.org/r/20180809070724.11935-4-yixun.lan@amlogic.com [6] https://lkml.kernel.org/r/1539839245-13793-1-git-send-email-jianxin.pan@amlogic.com [7] https://lkml.kernel.org/r/1541089855-19356-1-git-send-email-jianxin.pan@amlogic.com Yixun Lan (3): clk: meson: add emmc sub clock phase delay driver clk: meson: add DT documentation for emmc clock controller clk: meson: add sub MMC clock controller driver clk: meson: add one based divider support for sclk divider .../devicetree/bindings/clock/amlogic,mmc-clkc.txt | 39 +++ drivers/clk/meson/Kconfig | 10 + drivers/clk/meson/Makefile | 3 +- drivers/clk/meson/clk-phase-delay.c | 64 +++++ drivers/clk/meson/clkc-audio.h | 1 + drivers/clk/meson/clkc.h | 13 + drivers/clk/meson/mmc-clkc.c | 313 +++++++++++++++++++++ drivers/clk/meson/sclk-div.c | 28 +- include/dt-bindings/clock/amlogic,mmc-clkc.h | 17 ++ 9 files changed, 477 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/amlogic,mmc-clkc.txt create mode 100644 drivers/clk/meson/clk-phase-delay.c create mode 100644 drivers/clk/meson/mmc-clkc.c create mode 100644 include/dt-bindings/clock/amlogic,mmc-clkc.h