Message ID | 20180212145846.19380-13-jbrunet@baylibre.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3293781ljc; Mon, 12 Feb 2018 07:04:21 -0800 (PST) X-Google-Smtp-Source: AH8x225sbPoF9DK6d83EEwQ5Z8xgXT/DmHbxLIxe25sr9UL8/5TzMraULtz4i7HxmS+eJRbvYId9 X-Received: by 10.98.156.143 with SMTP id u15mr11819160pfk.170.1518447861165; Mon, 12 Feb 2018 07:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518447861; cv=none; d=google.com; s=arc-20160816; b=P7iemWlYeUT4DmYp1gGmrbWB1ipqt5Kfu8leG5064pnipw5sySE4IFhSfdpx63fmTb bBM/oHlyTrC2nFl3S4Uy0Y8yWmVYSZHAmSlFhzD8ZfFNpODRfswCM5rfSuFF/pQWNdr2 /32LxwLNL2EmC8yddCKcpOyG+wQnJsh5ENmCo67irAeCptxcq8iUZbCzA3KWH9VuYYlq Et46wDnkdw9mjF0GkIXqZ6y5p9VltNzxEXfA98Er0Aq0sNSZVr7xpLA4ylZXstnxUtna EMEwltv6hcG+Mj0QZXGCy0EGPDJM3TfYQE77EMMslo0E4YcQADhuCWNpB1efSGWw1T+i Cx8w== 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=8mTNZTA+NOKvjqgo0IM05ynpCrM/csA/WX64EgsU+Hc=; b=bUSFkSOIYZu72n1vePH9K+sOCSjzJXgWAF2HQ6YUO019Ha5maT+N8QHyTsEr1es7WX RD2M0Nb4EIC+wgmhS2sxGd2HO+jYm9QHDywFlVDM/wKcB1GxgXkN0WK3sH5HYtO2xq+w +fgILYv8FWmXtDZiDsgrU0ppkrm33FGBnoImXOW2MYWzuv3rjSOccW7UPlk4n5pMklKy f/p3bT/bvhHhsAUYGhazcs6OgDMybSo5Q/TxrM+2gMA9OyqpPe1r5sAd1xVMjTSSiRgz 5cnOWpb6+Snl2hj8QFjU8K42VUTxhpVmQ4XnRxysxpLXPcQzB4oUTps7dfj6c/pr3yoh hP4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=g0OtkZdn; 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 k17si4040888pfk.6.2018.02.12.07.04.20; Mon, 12 Feb 2018 07:04:21 -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=g0OtkZdn; 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 S934430AbeBLPDY (ORCPT <rfc822;jens.wiklander@linaro.org> + 15 others); Mon, 12 Feb 2018 10:03:24 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34439 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451AbeBLO7E (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 12 Feb 2018 09:59:04 -0500 Received: by mail-wr0-f196.google.com with SMTP id m5so3434032wrg.1 for <linux-kernel@vger.kernel.org>; Mon, 12 Feb 2018 06:59:04 -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=8mTNZTA+NOKvjqgo0IM05ynpCrM/csA/WX64EgsU+Hc=; b=g0OtkZdn2cRkeqDhVtcW3k43dAh/WnDLBD7gqpUWde9TPjAjnElAQc2ATSdH/YEcw+ SYpL8FgHaf0KLG/J84o4zTv2F8UARX/dkQzyCF4ZdDsPswCVBEI6Vq3detNElqKeApYN 7eW9yAuHWX/OUTgzGlprE7jJ0oa0D3X50PoXBa80Km+wjALIlA4zWEHvpHjr8a1yfV6C xQcCrksCeKAXUYrw5SQyCUt1lavR2hherkTAhG8tPumr2ykE9YBUA/HqlJRRrq2DEg6V ls/XT40VSpe6sgji3xvrh2vuA6ntHAxIm6Aan2qFAsD6oQHwV4BNEpr9t3JiefXAxbIv AgjQ== 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=8mTNZTA+NOKvjqgo0IM05ynpCrM/csA/WX64EgsU+Hc=; b=typBd4uJR06aw1pWqto57JHNdcDp635lAL7QOuy5g4qbiIEl7ZGg/tFXVbcet3agog U6LNZeuUBsmmtplISh7IQnN/OxUvNPw7EvylC+FRkLR1DPqy2KKJ2M/Vlc/kFLCB09wl rUsKVpr9MYXHw9+BLCUNI2+NeWLX3Z4NyVH0xYl5lNOJA8HqnkUCHovufvOXpCQ/7x6Z RpFFEtp1NupQjehi29W+JsC+cL3XvuCBFpwctEJYrvzsufdcUO+K+TxMA5pj40kvkYAz w7gpIQDMLlYay8kBYdcfoI3TIyOr48bdrnFGKod6gEze+n74+vTfZkE93BUllAGwUDOV 2rFw== X-Gm-Message-State: APf1xPC/HA7LDeZLYWWuPvxc3qbxrWOtsr3MYhHoChF2lAYvjS2GnEj2 i9c7dMIkCVfxLrY5oqmeSfBCpA== X-Received: by 10.223.161.77 with SMTP id r13mr7522356wrr.230.1518447543647; Mon, 12 Feb 2018 06:59:03 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id p21sm4633218wmc.28.2018.02.12.06.59.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 06:59:03 -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 v2 12/19] clk: meson: add regmap helpers for parm Date: Mon, 12 Feb 2018 15:58:39 +0100 Message-Id: <20180212145846.19380-13-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180212145846.19380-1-jbrunet@baylibre.com> References: <20180212145846.19380-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 fields with regmap helps to 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