From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from forward2m.mail.yandex.net ([2a02:6b8:0:2519::3:11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YTFed-0007e2-4T for barebox@lists.infradead.org; Wed, 04 Mar 2015 20:12:28 +0000 Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130]) by forward2m.mail.yandex.net (Yandex) with ESMTP id CF9735CA07BD for ; Wed, 4 Mar 2015 23:12:03 +0300 (MSK) From: Andrey Panov Date: Wed, 4 Mar 2015 23:11:32 +0300 Message-Id: <1425499906-32125-5-git-send-email-rockford@yandex.ru> In-Reply-To: <1425499906-32125-1-git-send-email-rockford@yandex.ru> References: <1425499906-32125-1-git-send-email-rockford@yandex.ru> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 04/18] CLK: clk-mux: Respect CLK_MUX_HIWORD_MASK flag To: barebox@lists.infradead.org It is required for Rockchip SoCs where clock settings registers have write-enable mask in high word. Signed-off-by: Andrey Panov --- drivers/clk/clk-mux.c | 3 +++ include/linux/clk.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 4ce86f4..22e131f 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -45,6 +45,9 @@ static int clk_mux_set_parent(struct clk *clk, u8 idx) val = readl(m->reg); val &= ~(((1 << m->width) - 1) << m->shift); val |= idx << m->shift; + + if (clk->flags & CLK_MUX_HIWORD_MASK) + val |= ((1 << m->width) - 1) << (m->shift + 16); writel(val, m->reg); return 0; diff --git a/include/linux/clk.h b/include/linux/clk.h index de2d4a5..89cb44e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -248,6 +248,8 @@ struct clk_divider { int table_size; }; +#define CLK_MUX_HIWORD_MASK (1 << 2) + extern struct clk_ops clk_divider_ops; struct clk *clk_divider(const char *name, const char *parent, -- 2.1.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox