From patchwork Mon Jan 18 14:28:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 59931 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2029224lbb; Mon, 18 Jan 2016 06:31:19 -0800 (PST) X-Received: by 10.67.7.200 with SMTP id de8mr37180475pad.28.1453127479624; Mon, 18 Jan 2016 06:31:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t64si40058981pfi.43.2016.01.18.06.31.19; Mon, 18 Jan 2016 06:31:19 -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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755419AbcARObK (ORCPT + 29 others); Mon, 18 Jan 2016 09:31:10 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:34438 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755215AbcARObD (ORCPT ); Mon, 18 Jan 2016 09:31:03 -0500 Received: by mail-wm0-f53.google.com with SMTP id u188so106321510wmu.1 for ; Mon, 18 Jan 2016 06:31:02 -0800 (PST) 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=YpxwymUwwMS0sBLUsTphwakYILjIS8lnPhyuXDoIhaY=; b=gEyJc/KWgsONg1D0UKOJy5DdqmGa5mvequK+K8d/vxhzabI7nAMJQYmCspKWODvwUr uJ0XLK7O1i5XMa1P/yVJbwwLiExJTGfQhpbkW1crQxGD3KVoM9bvYMZwXk4nuTRlEi2N JJfJbZZaaibjQ1gkbDE2wgCxxI7BvnU7PqvxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YpxwymUwwMS0sBLUsTphwakYILjIS8lnPhyuXDoIhaY=; b=ZiCkJ7y1FV0pMhqxBKH+rn62lxJsjHSDYDVyJvSLgUkM/9ykTOmF+b36h7VJEcF7n+ StikwpYEZRH7NB6QggDhJCM+WdOyO41nnWFtk09crD3LXWXTIJoB6qAzzXdk45gRjGWG p6UXA8ZOh3qOo2JpJvWioGAudTkZ66ghXEv56yUrP49Ce0Evlgoodx2Ery/M/LyTApLY EEMpbRy6SFfbwuLkWhgot8p9TWMyGytKLL4bDbD64bblx7cEjYAW85Pmqx2tf3BJIOY3 Tm+wcX9S7IgKqiUyr/PpRIS1mhDCwvSX2e6ybCQQkffozAY6xjRTzfdHmU9qlkOvnF2M 068A== X-Gm-Message-State: AG10YOQRsC/zvbh3UeArEARtDectpxTY20bAXp8pR0nBzJh+EbuRzYzNhWdEEH1GsO3dqQNb X-Received: by 10.28.23.5 with SMTP id 5mr14091998wmx.82.1453127461983; Mon, 18 Jan 2016 06:31:01 -0800 (PST) Received: from localhost.localdomain (host81-129-171-44.range81-129.btcentralplus.com. [81.129.171.44]) by smtp.gmail.com with ESMTPSA id e2sm18477554wma.1.2016.01.18.06.31.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 06:31:01 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, mturquette@baylibre.com, sboyd@codeaurora.org, maxime.ripard@free-electrons.com, s.hauer@pengutronix.de, geert@linux-m68k.org, Lee Jones Subject: [PATCH 3/3] clk: Provide OF helper to mark clocks as CRITICAL Date: Mon, 18 Jan 2016 14:28:51 +0000 Message-Id: <1453127331-20616-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453127331-20616-1-git-send-email-lee.jones@linaro.org> References: <1453127331-20616-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This call matches clocks which have been marked as critical in DT and sets the appropriate flag. These flags can then be used to mark the clock core flags appropriately prior to registration. Signed-off-by: Lee Jones --- include/linux/clk-provider.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 1.9.1 diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index ffa0b2e..6f178b7 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -707,6 +707,23 @@ const char *of_clk_get_parent_name(struct device_node *np, int index); void of_clk_init(const struct of_device_id *matches); +static inline int of_clk_mark_if_critical(struct device_node *np, + int index, unsigned long *flags) +{ + struct property *prop; + const __be32 *cur; + uint32_t idx; + + if (!np || !flags) + return -EINVAL; + + of_property_for_each_u32(np, "critical-clock", prop, cur, idx) + if (index == idx) + *flags |= CLK_IS_CRITICAL; + + return 0; +} + #else /* !CONFIG_OF */ static inline int of_clk_add_provider(struct device_node *np, @@ -742,6 +759,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np, { return NULL; } +static inline int of_clk_mark_if_critical(struct device_node *np, int index, + unsigned long *flags) +{ + return 0; +} #define of_clk_init(matches) \ { while (0); } #endif /* CONFIG_OF */