From patchwork Thu May 18 01:50:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 100022 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp503745qge; Wed, 17 May 2017 18:51:30 -0700 (PDT) X-Received: by 10.99.158.82 with SMTP id r18mr1694314pgo.231.1495072290655; Wed, 17 May 2017 18:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495072290; cv=none; d=google.com; s=arc-20160816; b=LfoUb8Me/km7zVE9KVULsQMqQj0/XM+dxLx9F4tSTXG6narUQBeyJfnv0YhVyEi13I he8SiUtXrf6yfBc5/oy8iNLOUjt5FSAtoGBnErqZSv1JRTr57Dvpf68QYWkq6xt9T+1a rN3HWw0fub/aZJ4tA1EN7EAHXtMlOIYNf07Lp5xGEpHGVH4pEtz4bggJUd2p0DU+9Tmm MD7WHH+Hj2JqHewOu/c/4/b9klwm6qW9TmdmV4NMDbpLVOE7VeJnw/a60dVCixp87Gj1 gqYMWeNYJBBANAmwxCcQ80w1Dif9nZ93a5z/6d+KDMEj35JYK8eVOB1XxHusqRuQmOdl 5nCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=f/BioUNu1nB7R6xoD6uu4uPvHLTS35lQ8roMKqyJ/7Y=; b=zNCesdbRztmlMYrSULpaGFttzu4i3V4NF/+5Qx8NYHvjkOe5BCJAgN99y/EIIo6wN7 LzJh+BjZCN6W3Wj0Yf9ubBJ+lddPW6Ys3/B7EVltrFEDLH+vJoCj9xGvZP46d6sgo8uf vJucl4zzE0cXVlLrFfKbVNapOmO97BQXIkqnvxQyZH7XShzmGucSr7WvXbGKJStRRt5H /7WrWTo72XMzHEg6cXnKfhroaEqTdRe3jhYRqzQ2vwvnS7vatuB+iMTKy2n5tpzsdfjN RJTgHUXDaW6SqrwImPMYIToDltF0DrhYjpNiQR1Gdq9V3rYktRcIV1Lof9J5fjqDDVq+ Uzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t135si3609914pgb.156.2017.05.17.18.51.30; Wed, 17 May 2017 18:51:30 -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; dkim=pass header.i=@linaro.org; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754864AbdERBvX (ORCPT + 25 others); Wed, 17 May 2017 21:51:23 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35103 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754777AbdERBvS (ORCPT ); Wed, 17 May 2017 21:51:18 -0400 Received: by mail-pf0-f170.google.com with SMTP id n23so15823351pfb.2 for ; Wed, 17 May 2017 18:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f/BioUNu1nB7R6xoD6uu4uPvHLTS35lQ8roMKqyJ/7Y=; b=fT7hU9vMVQfabiUEasnuCzHJWqtFD59MPEVXIBi1x6THuEnJzI0f8bfqjs+cA3Ns6r q5Hqh03PsCVq1TjhndDpLVsX6Wd0sERphM7EQraMictM2m4gzy0GAz+msbtL6rIo/FnP sj9Def+sUrdN5lad0fGh35zChtDlbnLGsIU/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f/BioUNu1nB7R6xoD6uu4uPvHLTS35lQ8roMKqyJ/7Y=; b=Q9NvahwdLZyputkdlj1b2AvSucWU3TSMWKnBUYoxs/+4p8NBMuorkfyhtWm5PxWHQk 9nQ5OUpU/VldxmwNkImZa7ohHi708J5/CUx4X/AvopC5QNNtREyj9YXhoh6AYFOvUyTN HQialaQo1EnLuslzAToomXCy6/9QpTHMlRr0MSNhq5Yy89RmaP7xD2QY6OdVHsXZyYpy 5b+/zUsx2w+cswcJLYx5jIl+UMa+2Uco+qzMfy2Hf1eWftHzOLD0bbDkusDHS3tjduRV btt5pjFILY6ov4ZAwFPLcwJD6yg5M0DUeXUvHkhHeqvCmt/AosEhgKHxPOkSHGuu6UP4 LQWg== X-Gm-Message-State: AODbwcCOOzPUVjI3SzmMfwOeGEU+8OiwJZFpWgXU9YNeX26DpqY9CG+t S7kD1Zm8Mwh+zAac X-Received: by 10.99.167.75 with SMTP id w11mr1729994pgo.148.1495072278075; Wed, 17 May 2017 18:51:18 -0700 (PDT) Received: from localhost.localdomain (li1627-128.members.linode.com. [172.104.47.128]) by smtp.gmail.com with ESMTPSA id m25sm5801020pfk.15.2017.05.17.18.51.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 May 2017 18:51:16 -0700 (PDT) From: Leo Yan To: Wei Xu , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Guodong Xu , Zhong Kaihua , Chen Jun , Zhangfei Gao , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Daniel Lezcano Cc: Leo Yan Subject: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER Date: Thu, 18 May 2017 09:50:46 +0800 Message-Id: <1495072247-25217-2-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495072247-25217-1-git-send-email-leo.yan@linaro.org> References: <1495072247-25217-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The timer will register into system at very early phase at kernel boot; if timer needs to use clock, the clock should be get ready in function of_clk_init() so later the timer driver probe can retrieve clock successfully. This is finished in below flow on arm64: start_kernel() `-> time_init() `-> of_clk_init(NULL) => register timer's clock `-> clocksource_probe() => register timer On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result, sp804 timer probe returns failure due if cannot bind clock properly. To fix the failure, this patch is to change crgctrl clock registration from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can be registered ahead with function of_clk_init() and then timer driver can use it. Signed-off-by: Leo Yan --- drivers/clk/hisilicon/clk-hi3660.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c index fd5ce7f..4e5713b 100644 --- a/drivers/clk/hisilicon/clk-hi3660.c +++ b/drivers/clk/hisilicon/clk-hi3660.c @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np) ARRAY_SIZE(hi3660_crgctrl_divider_clks), clk_data); } +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl", + hi3660_clk_crgctrl_init); static const struct of_device_id hi3660_clk_match_table[] = { - { .compatible = "hisilicon,hi3660-crgctrl", - .data = hi3660_clk_crgctrl_init }, { .compatible = "hisilicon,hi3660-pctrl", .data = hi3660_clk_pctrl_init }, { .compatible = "hisilicon,hi3660-pmuctrl",