Message ID | 20180131180945.18025-13-jbrunet@baylibre.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp970212ljc; Wed, 31 Jan 2018 10:12:34 -0800 (PST) X-Google-Smtp-Source: AH8x22529Otnwjmr3e2hlPpcREGXGzsxi94zkh2plJc6rjhhZFJ3DBtc9WTOD9CD4G7qyZRoN1nH X-Received: by 2002:a17:902:402:: with SMTP id 2-v6mr26944551ple.353.1517422353864; Wed, 31 Jan 2018 10:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517422353; cv=none; d=google.com; s=arc-20160816; b=ZJ38XrBgR+kn7CpEQNzVkx6IWN67T+ubmBFwq0HgxQ5oWU+xkzIRElSj+jnd7A95uK VQ0CT8J6TYVEVLeIw7uMeMdS42lmWi8xRc2FDieD/KYmCV/jG6qQcXMVQMVgNpxYF2x6 gOq1nYrpbFPuMiXFA8k7OQFQOCgLVvl3mMh5+BIIPvA23BiD91YPD0ziWFxM0hoTetNy M1lgD+5/ge4u4KbSdQw2mk6IBkWZ+MdyK5uHPonH9GrfsnUhDXM+9qBlfD0GAD7PHa6J 4QAUvGcxx0fBufXpC79PU4ZqAk8KOIqUXiuXw+TRP2j59/WiNB6yGk4vokmCP/liyl8n 9P8w== 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=e+vf1qhS0h4+YgMv+5SHIduirc8O1rMhoPmfHS7bgBg=; b=Qen5htVJisaXxYR4CWG7jzu3kGbQleLIniCzCwy7wbVPVazi6D/62jWHpYJb/TiSfm u9EAdN2UulmCbaXbzoHxUBtZRzJA+V7gAHc5bEVfI3btqhmESloTSSZKDlt1cEGH2qBQ OQUsIiFk0hxl5XSdkuujFTubirxV9m/ucVBLvDCWovWz6BzajehtiP5lehKcBd64uChV 6di/GJxpW3N8hN1d5BcEGcMZ6Hftv8MEzr8dHIh+XTUGDbDjc5M/A/f63kEu8tXOTA1K Y679j+xNxJXUtNSbO04jqEqpcb1Njb2J0UlNoH5U/JgLGk/Zrth2jO/oBjNLnOGPPnzB sd5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=aK2JLlxX; 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: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si291262pgp.790.2018.01.31.10.12.33; Wed, 31 Jan 2018 10:12:33 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=aK2JLlxX; 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 S1753467AbeAaSMc (ORCPT <rfc822; dan.rue@linaro.org> + 28 others); Wed, 31 Jan 2018 13:12:32 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:38554 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbeAaSKD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 31 Jan 2018 13:10:03 -0500 Received: by mail-wr0-f196.google.com with SMTP id t94so4498926wrc.5 for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2018 10:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e+vf1qhS0h4+YgMv+5SHIduirc8O1rMhoPmfHS7bgBg=; b=aK2JLlxX1iq6Vp94zmW/CPbtpZT+Oj5lyi1UXF3J/5u0iWtaAVKhMDT9kF6UKH/vGv wpgzHqP7fJbYU6aY6D1/076Molvch0l5UlTWA1tLUzZBvVDDojOsnkLckyV2MRWuahIu +FCZjeW6NyeX3Xg7TEYNrGwVu1G8tM0T8xzpimiPLBlWTQ5YF8ROTcK+2r4B8NGnJtl3 FHyADtsjaI1GBx87buRH4QgwECK+OtP7VYoat9Cx+5Hc+Fhdw3Q/3apNdIiDxdsmcogS jbNlfbrbdyotFiR/NESthcSMCxrhZaMVIo3z1sPntVHkzA/gO5ZmfFP2zPB8xaFr+YN9 zy/g== 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=e+vf1qhS0h4+YgMv+5SHIduirc8O1rMhoPmfHS7bgBg=; b=hgbnY1qRPvq9Ru9A5R43WtBzeIkc57cvevAjeUWOtlBzUCIzkRvcv+BWoa5axpBkNZ E0S1NPvyCjmmuw+aWlb3C1c8kOmWBdEQ+VYPBn6VVAn0n5zIZlmlpFAfS9UrSKiC3Jaq CCPWaOUQ8EF3icZ7UCwWbl7d77dQeVTAugG8Ejaer8/N9P/HE0COagbJR5auG8ZC3tgu 3CfBcUs4+vTYKMyPci872mbYyutMuK3zecGkM51GME1LXm/qUj2f+C3ig5uvOKtfWIrw T7KuzHUn/xwDeIXO7uDLNmUVbFDE1nmGiWn8UeQCq0ChZrj5JL+Ef54w0ZflAj8lgDQE OYPw== X-Gm-Message-State: AKwxytfNThv3nzz7qcu1kB/0/V6z8qXEVyxp3BZw+8rRAeHhGZtBzVQS a87WRYJiY9whxXwM0/Ho6CqPNtpV X-Received: by 10.223.148.162 with SMTP id 31mr9565993wrr.109.1517422202265; Wed, 31 Jan 2018 10:10:02 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id f8sm341977wmc.3.2018.01.31.10.10.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jan 2018 10:10:01 -0800 (PST) From: Jerome Brunet <jbrunet@baylibre.com> To: Neil Armstrong <narmstrong@baylibre.com>, Kevin Hilman <khilman@baylibre.com> Cc: Jerome Brunet <jbrunet@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Michael Turquette <mturquette@baylibre.com>, Carlo Caione <carlo@caione.org>, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/19] clk: meson: add regmap helpers for parm Date: Wed, 31 Jan 2018 19:09:38 +0100 Message-Id: <20180131180945.18025-13-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180131180945.18025-1-jbrunet@baylibre.com> References: <20180131180945.18025-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
clk: meson: use regmap in clock controllers
|
expand
|
diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h index aa2dfa0ff89f..8edc25297422 100644 --- a/drivers/clk/meson/clkc.h +++ b/drivers/clk/meson/clkc.h @@ -38,6 +38,22 @@ struct parm { u8 width; }; +static inline unsigned int meson_parm_read(struct regmap *map, struct parm *p) +{ + unsigned int val; + + regmap_read(map, p->reg_off, &val); + return PARM_GET(p->width, p->shift, val); +} + +static inline void meson_parm_write(struct regmap *map, struct parm *p, + unsigned int val) +{ + regmap_update_bits(map, p->reg_off, SETPMASK(p->width, p->shift), + val << p->shift); +} + + struct pll_rate_table { unsigned long rate; u16 m;
Meson clock drivers are using struct parm to describe each field of the clock provider. Providing helpers to access these field with regmap helps keep drivers readable Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> --- drivers/clk/meson/clkc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.14.3