summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2018-12-03 11:15:28 +0100
committerMarco Felsch <m.felsch@pengutronix.de>2018-12-19 08:42:50 +0100
commita9d3e8832dfd73afa9d7cb492abb188f83740061 (patch)
tree4ece40b3596211cef0d6d4a59ee7bfb60f7430b2
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
downloadlinux-0-day-mfe/clk-regmap.tar.gz
clk: regmap: support the clk-regmap wrapper for all devicesmfe/clk-regmap
The meson clk-regmap wrapper api has no dependencies to any architecture code, so we can make it public. This allows regmap devices to use the common clk framework as well. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
-rw-r--r--drivers/clk/Kconfig9
-rw-r--r--drivers/clk/Makefile1
-rw-r--r--drivers/clk/clk-regmap.c (renamed from drivers/clk/meson/clk-regmap.c)2
-rw-r--r--drivers/clk/meson/Kconfig8
-rw-r--r--drivers/clk/meson/Makefile1
-rw-r--r--drivers/clk/meson/axg-aoclk.c2
-rw-r--r--drivers/clk/meson/clkc.h2
-rw-r--r--drivers/clk/meson/gxbb-aoclk.c2
-rw-r--r--drivers/clk/meson/gxbb.c2
-rw-r--r--drivers/clk/meson/meson-aoclk.c2
-rw-r--r--drivers/clk/meson/meson-aoclk.h2
-rw-r--r--drivers/clk/meson/meson8b.c2
-rw-r--r--include/linux/clk-regmap.h (renamed from drivers/clk/meson/clk-regmap.h)0
13 files changed, 20 insertions, 15 deletions
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 81cdb4e..be2f4cf 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -22,6 +22,15 @@ config COMMON_CLK
menu "Common Clock Framework"
depends on COMMON_CLK
+config COMMON_CLK_REGMAP
+ bool
+ select REGMAP
+ help
+ This is a wrapper API around the common clock framework, so
+ you can use the common clock framework on devices supporting
+ only the regmap interface. This is useful for external devices
+ such as several I2C devices which has complex clock structures too.
+
config COMMON_CLK_WM831X
tristate "Clock driver for WM831x/2x PMICs"
depends on MFD_WM831X
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 72be7a3..0bcfc94 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-mux.o
obj-$(CONFIG_COMMON_CLK) += clk-composite.o
obj-$(CONFIG_COMMON_CLK) += clk-fractional-divider.o
obj-$(CONFIG_COMMON_CLK) += clk-gpio.o
+obj-$(CONFIG_COMMON_CLK_REGMAP) += clk-regmap.o
ifeq ($(CONFIG_OF), y)
obj-$(CONFIG_COMMON_CLK) += clk-conf.o
endif
diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/clk-regmap.c
index 305ee30..aabdf81 100644
--- a/drivers/clk/meson/clk-regmap.c
+++ b/drivers/clk/clk-regmap.c
@@ -4,7 +4,7 @@
* Author: Jerome Brunet <jbrunet@baylibre.com>
*/
-#include "clk-regmap.h"
+#include <linux/clk-regmap.h>
static int clk_regmap_gate_endisable(struct clk_hw *hw, int enable)
{
diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig
index efaa70f..9c7f304 100644
--- a/drivers/clk/meson/Kconfig
+++ b/drivers/clk/meson/Kconfig
@@ -1,7 +1,7 @@
config COMMON_CLK_AMLOGIC
bool
depends on ARCH_MESON || COMPILE_TEST
- select COMMON_CLK_REGMAP_MESON
+ select COMMON_CLK_REGMAP
config COMMON_CLK_AMLOGIC_AUDIO
bool
@@ -12,13 +12,9 @@ config COMMON_CLK_MESON_AO
bool
depends on OF
depends on ARCH_MESON || COMPILE_TEST
- select COMMON_CLK_REGMAP_MESON
+ select COMMON_CLK_REGMAP
select RESET_CONTROLLER
-config COMMON_CLK_REGMAP_MESON
- bool
- select REGMAP
-
config COMMON_CLK_MESON8B
bool
select COMMON_CLK_AMLOGIC
diff --git a/drivers/clk/meson/Makefile b/drivers/clk/meson/Makefile
index 72ec8c4..5e18738 100644
--- a/drivers/clk/meson/Makefile
+++ b/drivers/clk/meson/Makefile
@@ -9,4 +9,3 @@ obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-32k.o
obj-$(CONFIG_COMMON_CLK_AXG) += axg.o axg-aoclk.o
obj-$(CONFIG_COMMON_CLK_AXG_AUDIO) += axg-audio.o
-obj-$(CONFIG_COMMON_CLK_REGMAP_MESON) += clk-regmap.o
diff --git a/drivers/clk/meson/axg-aoclk.c b/drivers/clk/meson/axg-aoclk.c
index 29e0885..f91898e 100644
--- a/drivers/clk/meson/axg-aoclk.c
+++ b/drivers/clk/meson/axg-aoclk.c
@@ -9,10 +9,10 @@
* Author: Qiufang Dai <qiufang.dai@amlogic.com>
*/
#include <linux/clk-provider.h>
+#include <linux/clk-regmap.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/mfd/syscon.h>
-#include "clk-regmap.h"
#include "meson-aoclk.h"
#include "axg-aoclk.h"
diff --git a/drivers/clk/meson/clkc.h b/drivers/clk/meson/clkc.h
index 6b96d55..92fb237 100644
--- a/drivers/clk/meson/clkc.h
+++ b/drivers/clk/meson/clkc.h
@@ -8,7 +8,7 @@
#define __CLKC_H
#include <linux/clk-provider.h>
-#include "clk-regmap.h"
+#include <linux/clk-regmap.h>
#define PMASK(width) GENMASK(width - 1, 0)
#define SETPMASK(width, shift) GENMASK(shift + width - 1, shift)
diff --git a/drivers/clk/meson/gxbb-aoclk.c b/drivers/clk/meson/gxbb-aoclk.c
index 42ed61d..5283d04 100644
--- a/drivers/clk/meson/gxbb-aoclk.c
+++ b/drivers/clk/meson/gxbb-aoclk.c
@@ -3,9 +3,9 @@
* Copyright (c) 2016 BayLibre, SAS.
* Author: Neil Armstrong <narmstrong@baylibre.com>
*/
+#include <linux/clk-regmap.h>
#include <linux/platform_device.h>
#include <linux/mfd/syscon.h>
-#include "clk-regmap.h"
#include "meson-aoclk.h"
#include "gxbb-aoclk.h"
diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
index 9309cfa..8db60e0 100644
--- a/drivers/clk/meson/gxbb.c
+++ b/drivers/clk/meson/gxbb.c
@@ -6,6 +6,7 @@
#include <linux/clk.h>
#include <linux/clk-provider.h>
+#include <linux/clk-regmap.h>
#include <linux/init.h>
#include <linux/of_device.h>
#include <linux/mfd/syscon.h>
@@ -14,7 +15,6 @@
#include "clkc.h"
#include "gxbb.h"
-#include "clk-regmap.h"
static DEFINE_SPINLOCK(meson_clk_lock);
diff --git a/drivers/clk/meson/meson-aoclk.c b/drivers/clk/meson/meson-aoclk.c
index f965845..ccf0390 100644
--- a/drivers/clk/meson/meson-aoclk.c
+++ b/drivers/clk/meson/meson-aoclk.c
@@ -10,11 +10,11 @@
* Author: Yixun Lan <yixun.lan@amlogic.com>
*/
+#include <linux/clk-regmap.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/mfd/syscon.h>
#include <linux/of_device.h>
-#include "clk-regmap.h"
#include "meson-aoclk.h"
static int meson_aoclk_do_reset(struct reset_controller_dev *rcdev,
diff --git a/drivers/clk/meson/meson-aoclk.h b/drivers/clk/meson/meson-aoclk.h
index ab2819e..3051da2 100644
--- a/drivers/clk/meson/meson-aoclk.h
+++ b/drivers/clk/meson/meson-aoclk.h
@@ -11,9 +11,9 @@
#ifndef __MESON_AOCLK_H__
#define __MESON_AOCLK_H__
+#include <linux/clk-regmap.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
-#include "clk-regmap.h"
struct meson_aoclk_data {
const unsigned int reset_reg;
diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c
index 346b9e1..3a5c66e 100644
--- a/drivers/clk/meson/meson8b.c
+++ b/drivers/clk/meson/meson8b.c
@@ -9,6 +9,7 @@
#include <linux/clk.h>
#include <linux/clk-provider.h>
+#include <linux/clk-regmap.h>
#include <linux/init.h>
#include <linux/of_address.h>
#include <linux/reset-controller.h>
@@ -17,7 +18,6 @@
#include "clkc.h"
#include "meson8b.h"
-#include "clk-regmap.h"
static DEFINE_SPINLOCK(meson_clk_lock);
diff --git a/drivers/clk/meson/clk-regmap.h b/include/linux/clk-regmap.h
index ed2d434..ed2d434 100644
--- a/drivers/clk/meson/clk-regmap.h
+++ b/include/linux/clk-regmap.h