<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/clk/qcom/common.c, branch v6.6.134</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.134</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.134'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:19:35+00:00</updated>
<entry>
<title>clk: qcom: Return correct error code in qcom_cc_probe_by_index()</title>
<updated>2026-03-04T12:19:35+00:00</updated>
<author>
<name>Haotian Zhang</name>
<email>vulab@iscas.ac.cn</email>
</author>
<published>2025-12-17T04:13:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e15f1e18cdf4565618d1ba79fc6caa0ea97137d9'/>
<id>urn:sha1:e15f1e18cdf4565618d1ba79fc6caa0ea97137d9</id>
<content type='text'>
[ Upstream commit 1e07ebe744fb522983bd52a4a6148601675330c7 ]

When devm_platform_ioremap_resource() fails, it returns various
error codes. Returning a hardcoded -ENOMEM masks the actual
failure reason.

Use PTR_ERR() to propagate the actual error code returned by
devm_platform_ioremap_resource() instead of -ENOMEM.

Fixes: 75e0a1e30191 ("clk: qcom: define probe by index API as common API")
Signed-off-by: Haotian Zhang &lt;vulab@iscas.ac.cn&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251217041338.2432-1-vulab@iscas.ac.cn
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: remove internal arguments from of_property_for_each_u32()</title>
<updated>2025-02-08T08:51:51+00:00</updated>
<author>
<name>Luca Ceresoli</name>
<email>luca.ceresoli@bootlin.com</email>
</author>
<published>2024-07-24T16:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=914ef7d1a702c510d0b59151a9623f9d20c69d2a'/>
<id>urn:sha1:914ef7d1a702c510d0b59151a9623f9d20c69d2a</id>
<content type='text'>
[ Upstream commit 9722c3b66e21ff08aec570d02a97d331087fd70f ]

The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara &lt;andre.przywara@arm.com&gt; # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt; # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt; # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt; # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@baylibre.com&gt; # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner &lt;richard.leitner@linux.dev&gt; # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown &lt;broonie@kernel.org&gt; # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald &lt;rf@opensource.cirrus.com&gt; # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd &lt;sboyd@kernel.org&gt; # clk
Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Stable-dep-of: 28fa3291cad1 ("clk: fix an OF node reference leak in of_clk_get_parent_name()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: regmap-mux: fix parent clock lookup</title>
<updated>2021-12-02T23:07:34+00:00</updated>
<author>
<name>Dmitry Baryshkov</name>
<email>dmitry.baryshkov@linaro.org</email>
</author>
<published>2021-11-15T23:34:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5'/>
<id>urn:sha1:9a61f813fcc8d56d85fcf9ca6119cf2b5ac91dd5</id>
<content type='text'>
The function mux_get_parent() uses qcom_find_src_index() to find the
parent clock index, which is incorrect: qcom_find_src_index() uses src
enum for the lookup, while mux_get_parent() should use cfg field (which
corresponds to the register value). Add qcom_find_cfg_index() function
doing this kind of lookup and use it for mux parent lookup.

Fixes: df964016490b ("clk: qcom: add parent map for regmap mux")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Link: https://lore.kernel.org/r/20211115233407.1046179-1-dmitry.baryshkov@linaro.org
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: common: Make use of the helper function devm_platform_ioremap_resource()</title>
<updated>2021-09-14T21:39:31+00:00</updated>
<author>
<name>Cai Huoqing</name>
<email>caihuoqing@baidu.com</email>
</author>
<published>2021-09-07T08:48:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=437cbbb09be454165b936fa18f9e35506c29924f'/>
<id>urn:sha1:437cbbb09be454165b936fa18f9e35506c29924f</id>
<content type='text'>
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing &lt;caihuoqing@baidu.com&gt;
Link: https://lore.kernel.org/r/20210907084851.4050-1-caihuoqing@baidu.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: Allow constant ratio freq tables for rcg</title>
<updated>2019-11-07T21:43:19+00:00</updated>
<author>
<name>Jeffrey Hugo</name>
<email>jeffrey.l.hugo@gmail.com</email>
</author>
<published>2019-10-31T18:57:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efd164b5520afd6fb2883b68e0d408a7de29c491'/>
<id>urn:sha1:efd164b5520afd6fb2883b68e0d408a7de29c491</id>
<content type='text'>
Some RCGs (the gfx_3d_src_clk in msm8998 for example) are basically just
some constant ratio from the input across the entire frequency range.  It
would be great if we could specify the frequency table as a single entry
constant ratio instead of a long list, ie:

	{ .src = P_GPUPLL0_OUT_EVEN, .pre_div = 3 },
        { }

So, lets support that.

We need to fix a corner case in qcom_find_freq() where if the freq table
is non-null, but has no frequencies, we end up returning an "entry" before
the table array, which is bad.  Then, we need ignore the freq from the
table, and instead base everything on the requested freq.

Suggested-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Jeffrey Hugo &lt;jeffrey.l.hugo@gmail.com&gt;
Link: https://lkml.kernel.org/r/20191031185715.15504-1-jeffrey.l.hugo@gmail.com
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: common: Return NULL from clk_hw OF provider</title>
<updated>2019-11-07T21:10:44+00:00</updated>
<author>
<name>Taniya Das</name>
<email>tdas@codeaurora.org</email>
</author>
<published>2019-10-14T10:23:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ffe37ede0a9eb524162c683f48da8558d5323ddb'/>
<id>urn:sha1:ffe37ede0a9eb524162c683f48da8558d5323ddb</id>
<content type='text'>
Return NULL in the cases where the clk_hw is not registered with the
clock provider, but the clock consumer still requests for a clock id.

Signed-off-by: Taniya Das &lt;tdas@codeaurora.org&gt;
Link: https://lkml.kernel.org/r/20191014102308.27441-3-tdas@codeaurora.org
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: define probe by index API as common API</title>
<updated>2019-08-08T15:20:01+00:00</updated>
<author>
<name>Govind Singh</name>
<email>govinds@codeaurora.org</email>
</author>
<published>2019-07-26T09:23:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=75e0a1e301913b2b5627a69818f2521f48e6be07'/>
<id>urn:sha1:75e0a1e301913b2b5627a69818f2521f48e6be07</id>
<content type='text'>
Extend the probe by index API in common code to be used
by other qcom clock controller.

Signed-off-by: Govind Singh &lt;govinds@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: Make common clk_hw registrations</title>
<updated>2019-02-22T08:06:57+00:00</updated>
<author>
<name>Jeffrey Hugo</name>
<email>jhugo@codeaurora.org</email>
</author>
<published>2019-02-10T20:14:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=760be6586fbcc0a5a3b7892e3fe664a3f0530631'/>
<id>urn:sha1:760be6586fbcc0a5a3b7892e3fe664a3f0530631</id>
<content type='text'>
Several clock controller drivers define a list of clk_hw devices, and then
register those devices in probe() before using common code to process the
rest of initialization.  Extend the common code to accept a list of clk_hw
devices to process, thus eliminating many duplicate implementations.

Signed-off-by: Jeffrey Hugo &lt;jhugo@codeaurora.org&gt;
Suggested-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Reviewed-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Tested-by: Vinod Koul &lt;vkoul@kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: Support 'protected-clocks' property</title>
<updated>2018-11-21T08:59:28+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2018-11-05T19:40:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b181b3b801da8893c8eb706e448dd5111b02de60'/>
<id>urn:sha1:b181b3b801da8893c8eb706e448dd5111b02de60</id>
<content type='text'>
Certain firmware configurations "protect" clks and cause the entire
system to reboot when a non-secure OS such as Linux tries to read or
write protected clk registers. But other firmware configurations allow
reading or writing the same registers, and they may actually require
that the OS use the otherwise locked down clks. Support the
'protected-clocks' property by never registering these protected clks
with the common clk framework. This way, when firmware is protecting
these clks we won't have the chance to ever read or write these
registers and take down the entire system.

Cc: Taniya Das &lt;tdas@codeaurora.org&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
<entry>
<title>clk: qcom: Update SPDX headers for common files</title>
<updated>2018-07-25T16:23:33+00:00</updated>
<author>
<name>Taniya Das</name>
<email>tdas@codeaurora.org</email>
</author>
<published>2018-07-16T05:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9419783a6b45a7198ea22f2997cf1a85fda8458'/>
<id>urn:sha1:f9419783a6b45a7198ea22f2997cf1a85fda8458</id>
<content type='text'>
SPDX headers updated for common/branch/pll/regmap files.

Signed-off-by: Taniya Das &lt;tdas@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
</content>
</entry>
</feed>
