All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: linux-omap@vger.kernel.org, tony@atomide.com,
	aaro.koskinen@iki.fi, jmkrzyszt@gmail.com
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-fbdev@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Kevin Hilman <khilman@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Helge Deller <deller@gmx.de>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-serial@vger.kernel.org, linux-input@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	Felipe Balbi <balbi@kernel.org>, Paul Walmsley <paul@pwsan.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	linux-usb@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org, alsa-devel@alsa-project.org
Subject: [PATCH 33/41] ARM: OMAP1: clock: Remove unused code
Date: Tue, 19 Apr 2022 15:37:15 +0200	[thread overview]
Message-ID: <20220419133723.1394715-34-arnd@kernel.org> (raw)
In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org>

From: Janusz Krzysztofik <jmkrzyszt@gmail.com>

The code of OMAP1 clocks contains quite a few unused elements:
- functions and function like macros never called: clk_reparent(),
  recalculate_root_clocks(), clk_enable_init_clocks(),
  omap_clk_get_by_name(), omap_clk_disable_autoidle_all(),
  __clk_get_parent(clk), __clk_get_rate(),
- unused structure fields:
  - clkops: .find_idlest(), .find_companion(), .deny_idle(),
  - clk: .src_offset, as well as .clkdm -- no longer present but still
    mentioned in comments,
- definitions of unused flags: INVERT_ENABLE, CLOCK_CLKOUTX2,
- definitions of unused data types: struct clk_functions,
- prototypes of functions with no implementation: clk_init(),
  omap1_watchdog_recalc().
- declarations of never defined global variables: clkops_dummy.
Drop them.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/clock.c | 81 -------------------------------------
 arch/arm/mach-omap1/clock.h | 53 +-----------------------
 2 files changed, 2 insertions(+), 132 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 42e094e781ce..5ea8ec026a85 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -734,17 +734,6 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk)
 	return clk->parent->rate / clk->fixed_div;
 }
 
-void clk_reparent(struct clk *child, struct clk *parent)
-{
-	list_del_init(&child->sibling);
-	if (parent)
-		list_add(&child->sibling, &parent->children);
-	child->parent = parent;
-
-	/* now do the debugfs renaming to reattach the child
-	   to the proper parent */
-}
-
 /* Propagate rate to children */
 void propagate_rate(struct clk *tclk)
 {
@@ -759,24 +748,6 @@ void propagate_rate(struct clk *tclk)
 
 static LIST_HEAD(root_clks);
 
-/**
- * recalculate_root_clocks - recalculate and propagate all root clocks
- *
- * Recalculates all root clocks (clocks with no parent), which if the
- * clock's .recalc is set correctly, should also propagate their rates.
- * Called at init.
- */
-void recalculate_root_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &root_clks, sibling) {
-		if (clkp->recalc)
-			clkp->rate = clkp->recalc(clkp);
-		propagate_rate(clkp);
-	}
-}
-
 /**
  * clk_preinit - initialize any fields in the struct clk before clk init
  * @clk: struct clk * to initialize
@@ -827,42 +798,6 @@ void clk_unregister(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_unregister);
 
-void clk_enable_init_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &clocks, node)
-		if (clkp->flags & ENABLE_ON_INIT)
-			clk_enable(clkp);
-}
-
-/**
- * omap_clk_get_by_name - locate OMAP struct clk by its name
- * @name: name of the struct clk to locate
- *
- * Locate an OMAP struct clk by its name.  Assumes that struct clk
- * names are unique.  Returns NULL if not found or a pointer to the
- * struct clk if found.
- */
-struct clk *omap_clk_get_by_name(const char *name)
-{
-	struct clk *c;
-	struct clk *ret = NULL;
-
-	mutex_lock(&clocks_mutex);
-
-	list_for_each_entry(c, &clocks, node) {
-		if (!strcmp(c->name, name)) {
-			ret = c;
-			break;
-		}
-	}
-
-	mutex_unlock(&clocks_mutex);
-
-	return ret;
-}
-
 int omap_clk_enable_autoidle_all(void)
 {
 	struct clk *c;
@@ -879,22 +814,6 @@ int omap_clk_enable_autoidle_all(void)
 	return 0;
 }
 
-int omap_clk_disable_autoidle_all(void)
-{
-	struct clk *c;
-	unsigned long flags;
-
-	spin_lock_irqsave(&clockfw_lock, flags);
-
-	list_for_each_entry(c, &clocks, node)
-		if (c->ops->deny_idle)
-			c->ops->deny_idle(c);
-
-	spin_unlock_irqrestore(&clockfw_lock, flags);
-
-	return 0;
-}
-
 /*
  * Low level helpers
  */
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index f3b8811f5ac0..7bebd488f1be 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -43,56 +43,28 @@ struct omap_clk {
 
 /* Temporary, needed during the common clock framework conversion */
 #define __clk_get_name(clk)	(clk->name)
-#define __clk_get_parent(clk)	(clk->parent)
-#define __clk_get_rate(clk)	(clk->rate)
 
 /**
  * struct clkops - some clock function pointers
  * @enable: fn ptr that enables the current clock in hardware
  * @disable: fn ptr that enables the current clock in hardware
- * @find_idlest: function returning the IDLEST register for the clock's IP blk
- * @find_companion: function returning the "companion" clk reg for the clock
  * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
- * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
- *
- * A "companion" clk is an accompanying clock to the one being queried
- * that must be enabled for the IP module connected to the clock to
- * become accessible by the hardware.  Neither @find_idlest nor
- * @find_companion should be needed; that information is IP
- * block-specific; the hwmod code has been created to handle this, but
- * until hwmod data is ready and drivers have been converted to use PM
- * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
- * @find_companion must, unfortunately, remain.
  */
 struct clkops {
 	int			(*enable)(struct clk *);
 	void			(*disable)(struct clk *);
-	void			(*find_idlest)(struct clk *, void __iomem **,
-					       u8 *, u8 *);
-	void			(*find_companion)(struct clk *, void __iomem **,
-						  u8 *);
 	void			(*allow_idle)(struct clk *);
-	void			(*deny_idle)(struct clk *);
 };
 
 /*
  * struct clk.flags possibilities
  *
  * XXX document the rest of the clock flags here
- *
- * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
- *     bits share the same register.  This flag allows the
- *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
- *     should be used.  This is a temporary solution - a better approach
- *     would be to associate clock type-specific data with the clock,
- *     similar to the struct dpll_data approach.
  */
 #define ENABLE_REG_32BIT	(1 << 0)	/* Use 32-bit access */
 #define CLOCK_IDLE_CONTROL	(1 << 1)
 #define CLOCK_NO_IDLE_PARENT	(1 << 2)
 #define ENABLE_ON_INIT		(1 << 3)	/* Enable upon framework init */
-#define INVERT_ENABLE		(1 << 4)	/* 0 enables, 1 disables */
-#define CLOCK_CLKOUTX2		(1 << 5)
 
 /**
  * struct clk - OMAP struct clk
@@ -113,9 +85,8 @@ struct clkops {
  * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
  * @flags: see "struct clk.flags possibilities" above
  * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
- * @src_offset: bitshift for source selection bitfield (OMAP1 only)
  *
- * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * XXX @rate_offset should probably be removed and OMAP1
  * clock code converted to use clksel.
  *
  * XXX @usecount is poorly named.  It should be "enable_count" or
@@ -126,7 +97,7 @@ struct clkops {
  * clocks and decremented by the clock code when clk_disable() is
  * called on child clocks.
  *
- * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * XXX @usecount, @children, @sibling should be marked for
  * internal use only.
  *
  * @children and @sibling are used to optimize parent-to-child clock
@@ -153,36 +124,18 @@ struct clk {
 	u8			fixed_div;
 	u8			flags;
 	u8			rate_offset;
-	u8			src_offset;
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 	struct dentry		*dent;	/* For visible tree hierarchy */
 #endif
 };
 
-struct clk_functions {
-	int		(*clk_enable)(struct clk *clk);
-	void		(*clk_disable)(struct clk *clk);
-	long		(*clk_round_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_parent)(struct clk *clk, struct clk *parent);
-	void		(*clk_allow_idle)(struct clk *clk);
-	void		(*clk_deny_idle)(struct clk *clk);
-	void		(*clk_disable_unused)(struct clk *clk);
-};
-
-extern int clk_init(struct clk_functions *custom_clocks);
 extern void clk_preinit(struct clk *clk);
 extern int clk_register(struct clk *clk);
-extern void clk_reparent(struct clk *child, struct clk *parent);
 extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
-extern void recalculate_root_clocks(void);
 extern unsigned long followparent_recalc(struct clk *clk);
-extern void clk_enable_init_clocks(void);
 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern struct clk *omap_clk_get_by_name(const char *name);
 extern int omap_clk_enable_autoidle_all(void);
-extern int omap_clk_disable_autoidle_all(void);
 
 extern const struct clkops clkops_null;
 
@@ -208,7 +161,6 @@ extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
 extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
 extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
 extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
-extern unsigned long omap1_watchdog_recalc(struct clk *clk);
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
 extern void omap1_clk_disable_unused(struct clk *clk);
@@ -278,7 +230,6 @@ extern __u32 arm_idlect1_mask;
 extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
 
 extern const struct clkops clkops_dspck;
-extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_uart_16xx;
 extern const struct clkops clkops_generic;
 
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: linux-omap@vger.kernel.org, tony@atomide.com,
	aaro.koskinen@iki.fi, jmkrzyszt@gmail.com
Cc: Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@armlinux.org.uk>,
	Paul Walmsley <paul@pwsan.com>, Kevin Hilman <khilman@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Vinod Koul <vkoul@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Mark Brown <broonie@kernel.org>, Felipe Balbi <balbi@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	dmaengine@vger.kernel.org, linux-input@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	alsa-devel@alsa-project.org
Subject: [PATCH 33/41] ARM: OMAP1: clock: Remove unused code
Date: Tue, 19 Apr 2022 15:37:15 +0200	[thread overview]
Message-ID: <20220419133723.1394715-34-arnd@kernel.org> (raw)
In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org>

From: Janusz Krzysztofik <jmkrzyszt@gmail.com>

The code of OMAP1 clocks contains quite a few unused elements:
- functions and function like macros never called: clk_reparent(),
  recalculate_root_clocks(), clk_enable_init_clocks(),
  omap_clk_get_by_name(), omap_clk_disable_autoidle_all(),
  __clk_get_parent(clk), __clk_get_rate(),
- unused structure fields:
  - clkops: .find_idlest(), .find_companion(), .deny_idle(),
  - clk: .src_offset, as well as .clkdm -- no longer present but still
    mentioned in comments,
- definitions of unused flags: INVERT_ENABLE, CLOCK_CLKOUTX2,
- definitions of unused data types: struct clk_functions,
- prototypes of functions with no implementation: clk_init(),
  omap1_watchdog_recalc().
- declarations of never defined global variables: clkops_dummy.
Drop them.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/clock.c | 81 -------------------------------------
 arch/arm/mach-omap1/clock.h | 53 +-----------------------
 2 files changed, 2 insertions(+), 132 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 42e094e781ce..5ea8ec026a85 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -734,17 +734,6 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk)
 	return clk->parent->rate / clk->fixed_div;
 }
 
-void clk_reparent(struct clk *child, struct clk *parent)
-{
-	list_del_init(&child->sibling);
-	if (parent)
-		list_add(&child->sibling, &parent->children);
-	child->parent = parent;
-
-	/* now do the debugfs renaming to reattach the child
-	   to the proper parent */
-}
-
 /* Propagate rate to children */
 void propagate_rate(struct clk *tclk)
 {
@@ -759,24 +748,6 @@ void propagate_rate(struct clk *tclk)
 
 static LIST_HEAD(root_clks);
 
-/**
- * recalculate_root_clocks - recalculate and propagate all root clocks
- *
- * Recalculates all root clocks (clocks with no parent), which if the
- * clock's .recalc is set correctly, should also propagate their rates.
- * Called at init.
- */
-void recalculate_root_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &root_clks, sibling) {
-		if (clkp->recalc)
-			clkp->rate = clkp->recalc(clkp);
-		propagate_rate(clkp);
-	}
-}
-
 /**
  * clk_preinit - initialize any fields in the struct clk before clk init
  * @clk: struct clk * to initialize
@@ -827,42 +798,6 @@ void clk_unregister(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_unregister);
 
-void clk_enable_init_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &clocks, node)
-		if (clkp->flags & ENABLE_ON_INIT)
-			clk_enable(clkp);
-}
-
-/**
- * omap_clk_get_by_name - locate OMAP struct clk by its name
- * @name: name of the struct clk to locate
- *
- * Locate an OMAP struct clk by its name.  Assumes that struct clk
- * names are unique.  Returns NULL if not found or a pointer to the
- * struct clk if found.
- */
-struct clk *omap_clk_get_by_name(const char *name)
-{
-	struct clk *c;
-	struct clk *ret = NULL;
-
-	mutex_lock(&clocks_mutex);
-
-	list_for_each_entry(c, &clocks, node) {
-		if (!strcmp(c->name, name)) {
-			ret = c;
-			break;
-		}
-	}
-
-	mutex_unlock(&clocks_mutex);
-
-	return ret;
-}
-
 int omap_clk_enable_autoidle_all(void)
 {
 	struct clk *c;
@@ -879,22 +814,6 @@ int omap_clk_enable_autoidle_all(void)
 	return 0;
 }
 
-int omap_clk_disable_autoidle_all(void)
-{
-	struct clk *c;
-	unsigned long flags;
-
-	spin_lock_irqsave(&clockfw_lock, flags);
-
-	list_for_each_entry(c, &clocks, node)
-		if (c->ops->deny_idle)
-			c->ops->deny_idle(c);
-
-	spin_unlock_irqrestore(&clockfw_lock, flags);
-
-	return 0;
-}
-
 /*
  * Low level helpers
  */
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index f3b8811f5ac0..7bebd488f1be 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -43,56 +43,28 @@ struct omap_clk {
 
 /* Temporary, needed during the common clock framework conversion */
 #define __clk_get_name(clk)	(clk->name)
-#define __clk_get_parent(clk)	(clk->parent)
-#define __clk_get_rate(clk)	(clk->rate)
 
 /**
  * struct clkops - some clock function pointers
  * @enable: fn ptr that enables the current clock in hardware
  * @disable: fn ptr that enables the current clock in hardware
- * @find_idlest: function returning the IDLEST register for the clock's IP blk
- * @find_companion: function returning the "companion" clk reg for the clock
  * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
- * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
- *
- * A "companion" clk is an accompanying clock to the one being queried
- * that must be enabled for the IP module connected to the clock to
- * become accessible by the hardware.  Neither @find_idlest nor
- * @find_companion should be needed; that information is IP
- * block-specific; the hwmod code has been created to handle this, but
- * until hwmod data is ready and drivers have been converted to use PM
- * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
- * @find_companion must, unfortunately, remain.
  */
 struct clkops {
 	int			(*enable)(struct clk *);
 	void			(*disable)(struct clk *);
-	void			(*find_idlest)(struct clk *, void __iomem **,
-					       u8 *, u8 *);
-	void			(*find_companion)(struct clk *, void __iomem **,
-						  u8 *);
 	void			(*allow_idle)(struct clk *);
-	void			(*deny_idle)(struct clk *);
 };
 
 /*
  * struct clk.flags possibilities
  *
  * XXX document the rest of the clock flags here
- *
- * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
- *     bits share the same register.  This flag allows the
- *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
- *     should be used.  This is a temporary solution - a better approach
- *     would be to associate clock type-specific data with the clock,
- *     similar to the struct dpll_data approach.
  */
 #define ENABLE_REG_32BIT	(1 << 0)	/* Use 32-bit access */
 #define CLOCK_IDLE_CONTROL	(1 << 1)
 #define CLOCK_NO_IDLE_PARENT	(1 << 2)
 #define ENABLE_ON_INIT		(1 << 3)	/* Enable upon framework init */
-#define INVERT_ENABLE		(1 << 4)	/* 0 enables, 1 disables */
-#define CLOCK_CLKOUTX2		(1 << 5)
 
 /**
  * struct clk - OMAP struct clk
@@ -113,9 +85,8 @@ struct clkops {
  * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
  * @flags: see "struct clk.flags possibilities" above
  * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
- * @src_offset: bitshift for source selection bitfield (OMAP1 only)
  *
- * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * XXX @rate_offset should probably be removed and OMAP1
  * clock code converted to use clksel.
  *
  * XXX @usecount is poorly named.  It should be "enable_count" or
@@ -126,7 +97,7 @@ struct clkops {
  * clocks and decremented by the clock code when clk_disable() is
  * called on child clocks.
  *
- * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * XXX @usecount, @children, @sibling should be marked for
  * internal use only.
  *
  * @children and @sibling are used to optimize parent-to-child clock
@@ -153,36 +124,18 @@ struct clk {
 	u8			fixed_div;
 	u8			flags;
 	u8			rate_offset;
-	u8			src_offset;
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 	struct dentry		*dent;	/* For visible tree hierarchy */
 #endif
 };
 
-struct clk_functions {
-	int		(*clk_enable)(struct clk *clk);
-	void		(*clk_disable)(struct clk *clk);
-	long		(*clk_round_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_parent)(struct clk *clk, struct clk *parent);
-	void		(*clk_allow_idle)(struct clk *clk);
-	void		(*clk_deny_idle)(struct clk *clk);
-	void		(*clk_disable_unused)(struct clk *clk);
-};
-
-extern int clk_init(struct clk_functions *custom_clocks);
 extern void clk_preinit(struct clk *clk);
 extern int clk_register(struct clk *clk);
-extern void clk_reparent(struct clk *child, struct clk *parent);
 extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
-extern void recalculate_root_clocks(void);
 extern unsigned long followparent_recalc(struct clk *clk);
-extern void clk_enable_init_clocks(void);
 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern struct clk *omap_clk_get_by_name(const char *name);
 extern int omap_clk_enable_autoidle_all(void);
-extern int omap_clk_disable_autoidle_all(void);
 
 extern const struct clkops clkops_null;
 
@@ -208,7 +161,6 @@ extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
 extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
 extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
 extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
-extern unsigned long omap1_watchdog_recalc(struct clk *clk);
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
 extern void omap1_clk_disable_unused(struct clk *clk);
@@ -278,7 +230,6 @@ extern __u32 arm_idlect1_mask;
 extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
 
 extern const struct clkops clkops_dspck;
-extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_uart_16xx;
 extern const struct clkops clkops_generic;
 
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: linux-omap@vger.kernel.org, tony@atomide.com,
	aaro.koskinen@iki.fi, jmkrzyszt@gmail.com
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-fbdev@vger.kernel.org,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Kevin Hilman <khilman@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Helge Deller <deller@gmx.de>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-serial@vger.kernel.org, linux-input@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	Felipe Balbi <balbi@kernel.org>, Paul Walmsley <paul@pwsan.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	linux-usb@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org, alsa-devel@alsa-project.org
Subject: [PATCH 33/41] ARM: OMAP1: clock: Remove unused code
Date: Tue, 19 Apr 2022 15:37:15 +0200	[thread overview]
Message-ID: <20220419133723.1394715-34-arnd@kernel.org> (raw)
In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org>

From: Janusz Krzysztofik <jmkrzyszt@gmail.com>

The code of OMAP1 clocks contains quite a few unused elements:
- functions and function like macros never called: clk_reparent(),
  recalculate_root_clocks(), clk_enable_init_clocks(),
  omap_clk_get_by_name(), omap_clk_disable_autoidle_all(),
  __clk_get_parent(clk), __clk_get_rate(),
- unused structure fields:
  - clkops: .find_idlest(), .find_companion(), .deny_idle(),
  - clk: .src_offset, as well as .clkdm -- no longer present but still
    mentioned in comments,
- definitions of unused flags: INVERT_ENABLE, CLOCK_CLKOUTX2,
- definitions of unused data types: struct clk_functions,
- prototypes of functions with no implementation: clk_init(),
  omap1_watchdog_recalc().
- declarations of never defined global variables: clkops_dummy.
Drop them.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/clock.c | 81 -------------------------------------
 arch/arm/mach-omap1/clock.h | 53 +-----------------------
 2 files changed, 2 insertions(+), 132 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 42e094e781ce..5ea8ec026a85 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -734,17 +734,6 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk)
 	return clk->parent->rate / clk->fixed_div;
 }
 
-void clk_reparent(struct clk *child, struct clk *parent)
-{
-	list_del_init(&child->sibling);
-	if (parent)
-		list_add(&child->sibling, &parent->children);
-	child->parent = parent;
-
-	/* now do the debugfs renaming to reattach the child
-	   to the proper parent */
-}
-
 /* Propagate rate to children */
 void propagate_rate(struct clk *tclk)
 {
@@ -759,24 +748,6 @@ void propagate_rate(struct clk *tclk)
 
 static LIST_HEAD(root_clks);
 
-/**
- * recalculate_root_clocks - recalculate and propagate all root clocks
- *
- * Recalculates all root clocks (clocks with no parent), which if the
- * clock's .recalc is set correctly, should also propagate their rates.
- * Called at init.
- */
-void recalculate_root_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &root_clks, sibling) {
-		if (clkp->recalc)
-			clkp->rate = clkp->recalc(clkp);
-		propagate_rate(clkp);
-	}
-}
-
 /**
  * clk_preinit - initialize any fields in the struct clk before clk init
  * @clk: struct clk * to initialize
@@ -827,42 +798,6 @@ void clk_unregister(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_unregister);
 
-void clk_enable_init_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &clocks, node)
-		if (clkp->flags & ENABLE_ON_INIT)
-			clk_enable(clkp);
-}
-
-/**
- * omap_clk_get_by_name - locate OMAP struct clk by its name
- * @name: name of the struct clk to locate
- *
- * Locate an OMAP struct clk by its name.  Assumes that struct clk
- * names are unique.  Returns NULL if not found or a pointer to the
- * struct clk if found.
- */
-struct clk *omap_clk_get_by_name(const char *name)
-{
-	struct clk *c;
-	struct clk *ret = NULL;
-
-	mutex_lock(&clocks_mutex);
-
-	list_for_each_entry(c, &clocks, node) {
-		if (!strcmp(c->name, name)) {
-			ret = c;
-			break;
-		}
-	}
-
-	mutex_unlock(&clocks_mutex);
-
-	return ret;
-}
-
 int omap_clk_enable_autoidle_all(void)
 {
 	struct clk *c;
@@ -879,22 +814,6 @@ int omap_clk_enable_autoidle_all(void)
 	return 0;
 }
 
-int omap_clk_disable_autoidle_all(void)
-{
-	struct clk *c;
-	unsigned long flags;
-
-	spin_lock_irqsave(&clockfw_lock, flags);
-
-	list_for_each_entry(c, &clocks, node)
-		if (c->ops->deny_idle)
-			c->ops->deny_idle(c);
-
-	spin_unlock_irqrestore(&clockfw_lock, flags);
-
-	return 0;
-}
-
 /*
  * Low level helpers
  */
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index f3b8811f5ac0..7bebd488f1be 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -43,56 +43,28 @@ struct omap_clk {
 
 /* Temporary, needed during the common clock framework conversion */
 #define __clk_get_name(clk)	(clk->name)
-#define __clk_get_parent(clk)	(clk->parent)
-#define __clk_get_rate(clk)	(clk->rate)
 
 /**
  * struct clkops - some clock function pointers
  * @enable: fn ptr that enables the current clock in hardware
  * @disable: fn ptr that enables the current clock in hardware
- * @find_idlest: function returning the IDLEST register for the clock's IP blk
- * @find_companion: function returning the "companion" clk reg for the clock
  * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
- * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
- *
- * A "companion" clk is an accompanying clock to the one being queried
- * that must be enabled for the IP module connected to the clock to
- * become accessible by the hardware.  Neither @find_idlest nor
- * @find_companion should be needed; that information is IP
- * block-specific; the hwmod code has been created to handle this, but
- * until hwmod data is ready and drivers have been converted to use PM
- * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
- * @find_companion must, unfortunately, remain.
  */
 struct clkops {
 	int			(*enable)(struct clk *);
 	void			(*disable)(struct clk *);
-	void			(*find_idlest)(struct clk *, void __iomem **,
-					       u8 *, u8 *);
-	void			(*find_companion)(struct clk *, void __iomem **,
-						  u8 *);
 	void			(*allow_idle)(struct clk *);
-	void			(*deny_idle)(struct clk *);
 };
 
 /*
  * struct clk.flags possibilities
  *
  * XXX document the rest of the clock flags here
- *
- * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
- *     bits share the same register.  This flag allows the
- *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
- *     should be used.  This is a temporary solution - a better approach
- *     would be to associate clock type-specific data with the clock,
- *     similar to the struct dpll_data approach.
  */
 #define ENABLE_REG_32BIT	(1 << 0)	/* Use 32-bit access */
 #define CLOCK_IDLE_CONTROL	(1 << 1)
 #define CLOCK_NO_IDLE_PARENT	(1 << 2)
 #define ENABLE_ON_INIT		(1 << 3)	/* Enable upon framework init */
-#define INVERT_ENABLE		(1 << 4)	/* 0 enables, 1 disables */
-#define CLOCK_CLKOUTX2		(1 << 5)
 
 /**
  * struct clk - OMAP struct clk
@@ -113,9 +85,8 @@ struct clkops {
  * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
  * @flags: see "struct clk.flags possibilities" above
  * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
- * @src_offset: bitshift for source selection bitfield (OMAP1 only)
  *
- * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * XXX @rate_offset should probably be removed and OMAP1
  * clock code converted to use clksel.
  *
  * XXX @usecount is poorly named.  It should be "enable_count" or
@@ -126,7 +97,7 @@ struct clkops {
  * clocks and decremented by the clock code when clk_disable() is
  * called on child clocks.
  *
- * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * XXX @usecount, @children, @sibling should be marked for
  * internal use only.
  *
  * @children and @sibling are used to optimize parent-to-child clock
@@ -153,36 +124,18 @@ struct clk {
 	u8			fixed_div;
 	u8			flags;
 	u8			rate_offset;
-	u8			src_offset;
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 	struct dentry		*dent;	/* For visible tree hierarchy */
 #endif
 };
 
-struct clk_functions {
-	int		(*clk_enable)(struct clk *clk);
-	void		(*clk_disable)(struct clk *clk);
-	long		(*clk_round_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_parent)(struct clk *clk, struct clk *parent);
-	void		(*clk_allow_idle)(struct clk *clk);
-	void		(*clk_deny_idle)(struct clk *clk);
-	void		(*clk_disable_unused)(struct clk *clk);
-};
-
-extern int clk_init(struct clk_functions *custom_clocks);
 extern void clk_preinit(struct clk *clk);
 extern int clk_register(struct clk *clk);
-extern void clk_reparent(struct clk *child, struct clk *parent);
 extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
-extern void recalculate_root_clocks(void);
 extern unsigned long followparent_recalc(struct clk *clk);
-extern void clk_enable_init_clocks(void);
 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern struct clk *omap_clk_get_by_name(const char *name);
 extern int omap_clk_enable_autoidle_all(void);
-extern int omap_clk_disable_autoidle_all(void);
 
 extern const struct clkops clkops_null;
 
@@ -208,7 +161,6 @@ extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
 extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
 extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
 extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
-extern unsigned long omap1_watchdog_recalc(struct clk *clk);
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
 extern void omap1_clk_disable_unused(struct clk *clk);
@@ -278,7 +230,6 @@ extern __u32 arm_idlect1_mask;
 extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
 
 extern const struct clkops clkops_dspck;
-extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_uart_16xx;
 extern const struct clkops clkops_generic;
 
-- 
2.29.2


WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: linux-omap@vger.kernel.org, tony@atomide.com,
	aaro.koskinen@iki.fi, jmkrzyszt@gmail.com
Cc: Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@armlinux.org.uk>,
	Paul Walmsley <paul@pwsan.com>, Kevin Hilman <khilman@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>,
	Vinod Koul <vkoul@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Mark Brown <broonie@kernel.org>, Felipe Balbi <balbi@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Lee Jones <lee.jones@linaro.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	dmaengine@vger.kernel.org, linux-input@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	alsa-devel@alsa-project.org
Subject: [PATCH 33/41] ARM: OMAP1: clock: Remove unused code
Date: Tue, 19 Apr 2022 15:37:15 +0200	[thread overview]
Message-ID: <20220419133723.1394715-34-arnd@kernel.org> (raw)
In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org>

From: Janusz Krzysztofik <jmkrzyszt@gmail.com>

The code of OMAP1 clocks contains quite a few unused elements:
- functions and function like macros never called: clk_reparent(),
  recalculate_root_clocks(), clk_enable_init_clocks(),
  omap_clk_get_by_name(), omap_clk_disable_autoidle_all(),
  __clk_get_parent(clk), __clk_get_rate(),
- unused structure fields:
  - clkops: .find_idlest(), .find_companion(), .deny_idle(),
  - clk: .src_offset, as well as .clkdm -- no longer present but still
    mentioned in comments,
- definitions of unused flags: INVERT_ENABLE, CLOCK_CLKOUTX2,
- definitions of unused data types: struct clk_functions,
- prototypes of functions with no implementation: clk_init(),
  omap1_watchdog_recalc().
- declarations of never defined global variables: clkops_dummy.
Drop them.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-omap1/clock.c | 81 -------------------------------------
 arch/arm/mach-omap1/clock.h | 53 +-----------------------
 2 files changed, 2 insertions(+), 132 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 42e094e781ce..5ea8ec026a85 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -734,17 +734,6 @@ unsigned long omap_fixed_divisor_recalc(struct clk *clk)
 	return clk->parent->rate / clk->fixed_div;
 }
 
-void clk_reparent(struct clk *child, struct clk *parent)
-{
-	list_del_init(&child->sibling);
-	if (parent)
-		list_add(&child->sibling, &parent->children);
-	child->parent = parent;
-
-	/* now do the debugfs renaming to reattach the child
-	   to the proper parent */
-}
-
 /* Propagate rate to children */
 void propagate_rate(struct clk *tclk)
 {
@@ -759,24 +748,6 @@ void propagate_rate(struct clk *tclk)
 
 static LIST_HEAD(root_clks);
 
-/**
- * recalculate_root_clocks - recalculate and propagate all root clocks
- *
- * Recalculates all root clocks (clocks with no parent), which if the
- * clock's .recalc is set correctly, should also propagate their rates.
- * Called at init.
- */
-void recalculate_root_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &root_clks, sibling) {
-		if (clkp->recalc)
-			clkp->rate = clkp->recalc(clkp);
-		propagate_rate(clkp);
-	}
-}
-
 /**
  * clk_preinit - initialize any fields in the struct clk before clk init
  * @clk: struct clk * to initialize
@@ -827,42 +798,6 @@ void clk_unregister(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_unregister);
 
-void clk_enable_init_clocks(void)
-{
-	struct clk *clkp;
-
-	list_for_each_entry(clkp, &clocks, node)
-		if (clkp->flags & ENABLE_ON_INIT)
-			clk_enable(clkp);
-}
-
-/**
- * omap_clk_get_by_name - locate OMAP struct clk by its name
- * @name: name of the struct clk to locate
- *
- * Locate an OMAP struct clk by its name.  Assumes that struct clk
- * names are unique.  Returns NULL if not found or a pointer to the
- * struct clk if found.
- */
-struct clk *omap_clk_get_by_name(const char *name)
-{
-	struct clk *c;
-	struct clk *ret = NULL;
-
-	mutex_lock(&clocks_mutex);
-
-	list_for_each_entry(c, &clocks, node) {
-		if (!strcmp(c->name, name)) {
-			ret = c;
-			break;
-		}
-	}
-
-	mutex_unlock(&clocks_mutex);
-
-	return ret;
-}
-
 int omap_clk_enable_autoidle_all(void)
 {
 	struct clk *c;
@@ -879,22 +814,6 @@ int omap_clk_enable_autoidle_all(void)
 	return 0;
 }
 
-int omap_clk_disable_autoidle_all(void)
-{
-	struct clk *c;
-	unsigned long flags;
-
-	spin_lock_irqsave(&clockfw_lock, flags);
-
-	list_for_each_entry(c, &clocks, node)
-		if (c->ops->deny_idle)
-			c->ops->deny_idle(c);
-
-	spin_unlock_irqrestore(&clockfw_lock, flags);
-
-	return 0;
-}
-
 /*
  * Low level helpers
  */
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index f3b8811f5ac0..7bebd488f1be 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -43,56 +43,28 @@ struct omap_clk {
 
 /* Temporary, needed during the common clock framework conversion */
 #define __clk_get_name(clk)	(clk->name)
-#define __clk_get_parent(clk)	(clk->parent)
-#define __clk_get_rate(clk)	(clk->rate)
 
 /**
  * struct clkops - some clock function pointers
  * @enable: fn ptr that enables the current clock in hardware
  * @disable: fn ptr that enables the current clock in hardware
- * @find_idlest: function returning the IDLEST register for the clock's IP blk
- * @find_companion: function returning the "companion" clk reg for the clock
  * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
- * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
- *
- * A "companion" clk is an accompanying clock to the one being queried
- * that must be enabled for the IP module connected to the clock to
- * become accessible by the hardware.  Neither @find_idlest nor
- * @find_companion should be needed; that information is IP
- * block-specific; the hwmod code has been created to handle this, but
- * until hwmod data is ready and drivers have been converted to use PM
- * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
- * @find_companion must, unfortunately, remain.
  */
 struct clkops {
 	int			(*enable)(struct clk *);
 	void			(*disable)(struct clk *);
-	void			(*find_idlest)(struct clk *, void __iomem **,
-					       u8 *, u8 *);
-	void			(*find_companion)(struct clk *, void __iomem **,
-						  u8 *);
 	void			(*allow_idle)(struct clk *);
-	void			(*deny_idle)(struct clk *);
 };
 
 /*
  * struct clk.flags possibilities
  *
  * XXX document the rest of the clock flags here
- *
- * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
- *     bits share the same register.  This flag allows the
- *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
- *     should be used.  This is a temporary solution - a better approach
- *     would be to associate clock type-specific data with the clock,
- *     similar to the struct dpll_data approach.
  */
 #define ENABLE_REG_32BIT	(1 << 0)	/* Use 32-bit access */
 #define CLOCK_IDLE_CONTROL	(1 << 1)
 #define CLOCK_NO_IDLE_PARENT	(1 << 2)
 #define ENABLE_ON_INIT		(1 << 3)	/* Enable upon framework init */
-#define INVERT_ENABLE		(1 << 4)	/* 0 enables, 1 disables */
-#define CLOCK_CLKOUTX2		(1 << 5)
 
 /**
  * struct clk - OMAP struct clk
@@ -113,9 +85,8 @@ struct clkops {
  * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
  * @flags: see "struct clk.flags possibilities" above
  * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
- * @src_offset: bitshift for source selection bitfield (OMAP1 only)
  *
- * XXX @rate_offset, @src_offset should probably be removed and OMAP1
+ * XXX @rate_offset should probably be removed and OMAP1
  * clock code converted to use clksel.
  *
  * XXX @usecount is poorly named.  It should be "enable_count" or
@@ -126,7 +97,7 @@ struct clkops {
  * clocks and decremented by the clock code when clk_disable() is
  * called on child clocks.
  *
- * XXX @clkdm, @usecount, @children, @sibling should be marked for
+ * XXX @usecount, @children, @sibling should be marked for
  * internal use only.
  *
  * @children and @sibling are used to optimize parent-to-child clock
@@ -153,36 +124,18 @@ struct clk {
 	u8			fixed_div;
 	u8			flags;
 	u8			rate_offset;
-	u8			src_offset;
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 	struct dentry		*dent;	/* For visible tree hierarchy */
 #endif
 };
 
-struct clk_functions {
-	int		(*clk_enable)(struct clk *clk);
-	void		(*clk_disable)(struct clk *clk);
-	long		(*clk_round_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_rate)(struct clk *clk, unsigned long rate);
-	int		(*clk_set_parent)(struct clk *clk, struct clk *parent);
-	void		(*clk_allow_idle)(struct clk *clk);
-	void		(*clk_deny_idle)(struct clk *clk);
-	void		(*clk_disable_unused)(struct clk *clk);
-};
-
-extern int clk_init(struct clk_functions *custom_clocks);
 extern void clk_preinit(struct clk *clk);
 extern int clk_register(struct clk *clk);
-extern void clk_reparent(struct clk *child, struct clk *parent);
 extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
-extern void recalculate_root_clocks(void);
 extern unsigned long followparent_recalc(struct clk *clk);
-extern void clk_enable_init_clocks(void);
 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern struct clk *omap_clk_get_by_name(const char *name);
 extern int omap_clk_enable_autoidle_all(void);
-extern int omap_clk_disable_autoidle_all(void);
 
 extern const struct clkops clkops_null;
 
@@ -208,7 +161,6 @@ extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
 extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
 extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
 extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
-extern unsigned long omap1_watchdog_recalc(struct clk *clk);
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
 extern void omap1_clk_disable_unused(struct clk *clk);
@@ -278,7 +230,6 @@ extern __u32 arm_idlect1_mask;
 extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
 
 extern const struct clkops clkops_dspck;
-extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_uart_16xx;
 extern const struct clkops clkops_generic;
 
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-04-19 13:41 UTC|newest]

Thread overview: 245+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 13:36 [PATCH 00/41] OMAP1 full multiplatform conversion Arnd Bergmann
2022-04-19 13:36 ` Arnd Bergmann
2022-04-19 13:36 ` Arnd Bergmann
2022-04-19 13:36 ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 01/41] video: fbdev: omapfb: lcd_ams_delta: fix unused variable warning Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-20  9:24   ` Sergei Shtylyov
2022-04-20  9:24     ` Sergei Shtylyov
2022-04-20  9:24     ` Sergei Shtylyov
2022-04-20  9:24     ` Sergei Shtylyov
2022-04-20 11:32     ` Arnd Bergmann
2022-04-20 11:32       ` Arnd Bergmann
2022-04-20 11:32       ` Arnd Bergmann
2022-04-20 11:32       ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 02/41] ARM: omap1: innovator: pass lcd control address as pdata Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 03/41] ARM: omap1: move lcd_dma code into omapfb driver Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 04/41] ARM: omap1: declare a dummy omap_set_dma_priority Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 05/41] fbdev: omap: pass irqs as resource Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 06/41] ARM: omap1: ams-delta: remove camera leftovers Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 07/41] ARM: omap1: move mach/usb.h to include/linux/soc Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 08/41] ARM: omap1: move some headers " Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 09/41] ARM: omap1: move perseus spi pinconf to board file Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 10/41] ARM: omap1: move CF chipselect setup " Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 11/41] fbdev: omap: avoid using mach/*.h files Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 12/41] usb: omap: avoid mach/*.h headers Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 13/41] clocksource: ti-dmtimer: avoid using mach/hardware.h Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 14/41] serial: 8250/omap1: include linux/soc/ti/omap1-soc.h Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-20 14:46   ` Greg KH
2022-04-20 14:46     ` Greg KH
2022-04-20 14:46     ` Greg KH
2022-04-20 14:46     ` Greg KH
2022-04-19 13:36 ` [PATCH 15/41] input: omap: void using mach/*.h headers Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-20 20:44   ` Dmitry Torokhov
2022-04-20 20:44     ` Dmitry Torokhov
2022-04-20 20:44     ` Dmitry Torokhov
2022-04-20 20:44     ` Dmitry Torokhov
2022-04-19 13:36 ` [PATCH 16/41] ARM: omap1: innovator: move ohci phy power handling to board file Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36 ` [PATCH 17/41] ARM: omap1: move 32k counter from plat-omap to mach-omap1 Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-19 13:36   ` Arnd Bergmann
2022-04-21  6:17   ` Tony Lindgren
2022-04-21  6:17     ` Tony Lindgren
2022-04-21  6:17     ` Tony Lindgren
2022-04-21  6:17     ` Tony Lindgren
2022-04-19 13:37 ` [PATCH 18/41] ARM: omap: remove debug-leds driver Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 19/41] ARM: omap: dma: make usb support optional Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-29 19:24   ` Péter Ujfalusi
2022-04-29 19:24     ` Péter Ujfalusi
2022-04-29 19:24     ` Péter Ujfalusi
2022-04-19 13:37 ` [PATCH 20/41] dma: omap: hide legacy interface Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-22  5:55   ` Vinod Koul
2022-04-22  5:55     ` Vinod Koul
2022-04-22  5:55     ` Vinod Koul
2022-04-22  5:55     ` Vinod Koul
2022-04-19 13:37 ` [PATCH 21/41] ARM: omap1: dma: remove omap2 specific bits Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-29 19:26   ` Péter Ujfalusi
2022-04-29 19:26     ` Péter Ujfalusi
2022-04-29 19:26     ` Péter Ujfalusi
2022-04-19 13:37 ` [PATCH 22/41] ARM: omap1: move plat/dma.c to mach/omap-dma.c Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-29 19:36   ` Péter Ujfalusi
2022-04-29 19:36     ` Péter Ujfalusi
2022-04-29 19:36     ` Péter Ujfalusi
2022-04-19 13:37 ` [PATCH 23/41] ARM: omap: split up arch/arm/plat-omap/Kconfig Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 24/41] ARM: omap: un-merge plat/sram.c Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-21  6:32   ` Tony Lindgren
2022-04-21  6:32     ` Tony Lindgren
2022-04-21  6:32     ` Tony Lindgren
2022-04-21  6:32     ` Tony Lindgren
2022-04-19 13:37 ` [PATCH 25/41] ARM: omap: remove empty plat-omap directory Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 26/41] ARM: omap1: relocate static I/O mapping Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-20 13:46   ` Aaro Koskinen
2022-04-20 13:46     ` Aaro Koskinen
2022-04-20 13:46     ` Aaro Koskinen
2022-04-20 13:46     ` Aaro Koskinen
2022-04-20 19:20     ` Arnd Bergmann
2022-04-20 19:20       ` Arnd Bergmann
2022-04-20 19:20       ` Arnd Bergmann
2022-04-20 19:20       ` Arnd Bergmann
2022-04-21  5:19       ` Tony Lindgren
2022-04-21  5:19         ` Tony Lindgren
2022-04-21  5:19         ` Tony Lindgren
2022-04-21  5:19         ` Tony Lindgren
2022-04-19 13:37 ` [PATCH 27/41] ARM: omap1: use pci_remap_iospace() for omap_cf Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 28/41] ARM: omap1: move mach/*.h into mach directory Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 29/41] ARM: omap1: fix build with no SoC selected Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 30/41] ARM: OMAP1: Prepare for conversion of OMAP1 clocks to CCF Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 31/41] ARM: OMAP1: clock: Fix early UART rate issues Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 32/41] ARM: OMAP1: clock: Fix UART rate reporting algorithm Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` Arnd Bergmann [this message]
2022-04-19 13:37   ` [PATCH 33/41] ARM: OMAP1: clock: Remove unused code Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 34/41] ARM: OMAP1: clock: Remove noop code Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 35/41] usb: host: ohci-omap: Make it CCF clk API compatible Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 36/41] usb: gadget: omap_udc: " Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 37/41] [MERGED] video: fbdev: omap: " Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 38/41] [MERGED] mmc: " Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 39/41] [MERGED] ASoC: ti: osk5912: " Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37 ` [PATCH 40/41] [TO BE REBASED] ARM: OMAP1: clock: Convert to CCF Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-21  6:24   ` Tony Lindgren
2022-04-21  6:24     ` Tony Lindgren
2022-04-21  6:24     ` Tony Lindgren
2022-04-21  6:24     ` Tony Lindgren
2022-04-19 13:37 ` [PATCH 41/41] [TO BE REBASED] ARM: omap1: enable multiplatform Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 13:37   ` Arnd Bergmann
2022-04-19 14:15 ` [PATCH 00/41] OMAP1 full multiplatform conversion Ulf Hansson
2022-04-19 14:15   ` Ulf Hansson
2022-04-19 14:15   ` Ulf Hansson
2022-04-19 14:15   ` Ulf Hansson
2022-04-21  6:27   ` Tony Lindgren
2022-04-21  6:27     ` Tony Lindgren
2022-04-21  6:27     ` Tony Lindgren
2022-04-21  6:27     ` Tony Lindgren
2022-04-20 17:08 ` Aaro Koskinen
2022-04-20 17:08   ` Aaro Koskinen
2022-04-20 17:08   ` Aaro Koskinen
2022-04-20 17:08   ` Aaro Koskinen
2022-04-20 20:00   ` Arnd Bergmann
2022-04-20 20:00     ` Arnd Bergmann
2022-04-20 20:00     ` Arnd Bergmann
2022-04-20 20:00     ` Arnd Bergmann
2022-04-21 13:34     ` Aaro Koskinen
2022-04-21 13:34       ` Aaro Koskinen
2022-04-21 13:34       ` Aaro Koskinen
2022-04-21 13:34       ` Aaro Koskinen
2022-04-21 14:46       ` Arnd Bergmann
2022-04-21 14:46         ` Arnd Bergmann
2022-04-21 14:46         ` Arnd Bergmann
2022-04-21 14:46         ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220419133723.1394715-34-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=balbi@kernel.org \
    --cc=broonie@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dmaengine@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=jmkrzyszt@gmail.com \
    --cc=khilman@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@dominikbrodowski.net \
    --cc=paul@pwsan.com \
    --cc=peter.ujfalusi@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.