Re: [PATCH 0/4] clk: ti: get rid of CLK_IS_BASIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/02/2019 21:50, Stephen Boyd wrote:
Quoting Tero Kristo (2019-01-15 01:15:11)
Hi Stephen,

As requested, this series gets rid of CLK_IS_BASIC flag usage from
TI clock drivers.

Boot tested on am3/am4/am5/omap3/omap4 series of SoCs. Also, ran a quick
suspend/resume test on omap3/omap4/am5.


I'm looking at clk-next now that this is all merged in and I still see
one usage of CLK_IS_BASIC in the omap2 hwmod code.

arch/arm/mach-omap2/omap_hwmod.c:               if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)

Can that also be removed? If not, what clk types are on this platform?
Maybe I can remove CLK_IS_BASIC from every clk type except for the ones
that this code is checking for.


Hmm, I missed this in my update, only looked at the drivers/clk/ti portion of code. However, this can be fixed with the following patch, I would need to export the omap2_clk_is_hw_omap() func from the driver and call it from the omap2 platform code. What do you think? Shall I post this as an official change? This one still has the issue that I am calling __clk_get_hw() though.

---


diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 3a04c73..baadddf 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -648,10 +648,10 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
 	if (oh->clkdm) {
 		return oh->clkdm;
 	} else if (oh->_clk) {
-		if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
+		if (!omap2_clk_is_hw_omap(__clk_get_hw(oh->_clk)))
 			return NULL;
 		clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
-		return  clk->clkdm;
+		return clk->clkdm;
 	}
 	return NULL;
 }
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index 1c0fac5..4223a39 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -303,7 +303,6 @@ long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
 int omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
 				       struct clk_rate_request *req);
 int omap2_clk_for_each(int (*fn)(struct clk_hw_omap *hw));
-bool omap2_clk_is_hw_omap(struct clk_hw *hw);

 extern struct ti_clk_ll_ops *ti_clk_ll_ops;

diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 78872ef..2821f7c 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -243,6 +243,7 @@ struct ti_clk_ll_ops {

 #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)

+bool omap2_clk_is_hw_omap(struct clk_hw *hw);
 int omap2_clk_disable_autoidle_all(void);
 int omap2_clk_enable_autoidle_all(void);
 int omap2_clk_allow_idle(struct clk *clk);
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux