From: tushar.behera@linaro.org (Tushar Behera)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH/RFC V6 2/2] clk: Add handling of clk parent and rate assigned from DT
Date: Tue, 27 May 2014 15:58:05 +0530 [thread overview]
Message-ID: <538468B5.6090505@linaro.org> (raw)
In-Reply-To: <1400520171-6698-3-git-send-email-s.nawrocki@samsung.com>
On 05/19/2014 10:52 PM, Sylwester Nawrocki wrote:
> This patch adds a helper function to configure clock parents and
> rates as specified in clock-parents, clock-rates DT properties
> for a consumer device and a call to it before driver is bound to
> a device.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[ ... ]
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 5b47210..f622733 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -23,6 +23,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/idr.h>
> #include <linux/acpi.h>
> +#include <linux/clk/clk-conf.h>
>
> #include "base.h"
> #include "power/power.h"
> @@ -486,6 +487,10 @@ static int platform_drv_probe(struct device *_dev)
> struct platform_device *dev = to_platform_device(_dev);
> int ret;
>
> + ret = of_clk_set_defaults(_dev->of_node, false);
> + if (ret < 0)
> + return ret;
> +
of_clk_set_defaults() is not getting called when the related driver is
not registered through platform_driver_register().
I came across this issue while testing this patch on peach-pit board with
following dts change. max98090 audio codec driver is registered through
module_i2c_driver().
* arch/arm/boot/dts/exynos5420-peach-pit.dts
&hsi2c_7 {
status = "okay";
max98090: codec at 10 {
compatible = "maxim,max98090";
reg = <0x10>;
interrupts = <2 0>;
interrupt-parent = <&gpx0>;
pinctrl-names = "default";
pinctrl-0 = <&max98090_irq>;
+ clocks = <&pmu_system_controller 0>;
+ clock-names = "mclk";
+ clock-parents = <&clock CLK_FIN_PLL>;
+ clock-rates = <24000000>;
};
};
--
Tushar Behera
WARNING: multiple messages have this Message-ID (diff)
From: Tushar Behera <tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Sylwester Nawrocki
<s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Cc: mark.rutland-5wv7dgnIgG8@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH/RFC V6 2/2] clk: Add handling of clk parent and rate assigned from DT
Date: Tue, 27 May 2014 15:58:05 +0530 [thread overview]
Message-ID: <538468B5.6090505@linaro.org> (raw)
In-Reply-To: <1400520171-6698-3-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
On 05/19/2014 10:52 PM, Sylwester Nawrocki wrote:
> This patch adds a helper function to configure clock parents and
> rates as specified in clock-parents, clock-rates DT properties
> for a consumer device and a call to it before driver is bound to
> a device.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
[ ... ]
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 5b47210..f622733 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -23,6 +23,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/idr.h>
> #include <linux/acpi.h>
> +#include <linux/clk/clk-conf.h>
>
> #include "base.h"
> #include "power/power.h"
> @@ -486,6 +487,10 @@ static int platform_drv_probe(struct device *_dev)
> struct platform_device *dev = to_platform_device(_dev);
> int ret;
>
> + ret = of_clk_set_defaults(_dev->of_node, false);
> + if (ret < 0)
> + return ret;
> +
of_clk_set_defaults() is not getting called when the related driver is
not registered through platform_driver_register().
I came across this issue while testing this patch on peach-pit board with
following dts change. max98090 audio codec driver is registered through
module_i2c_driver().
* arch/arm/boot/dts/exynos5420-peach-pit.dts
&hsi2c_7 {
status = "okay";
max98090: codec@10 {
compatible = "maxim,max98090";
reg = <0x10>;
interrupts = <2 0>;
interrupt-parent = <&gpx0>;
pinctrl-names = "default";
pinctrl-0 = <&max98090_irq>;
+ clocks = <&pmu_system_controller 0>;
+ clock-names = "mclk";
+ clock-parents = <&clock CLK_FIN_PLL>;
+ clock-rates = <24000000>;
};
};
--
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Tushar Behera <tushar.behera@linaro.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
mturquette@linaro.org
Cc: mark.rutland@arm.com, linux@arm.linux.org.uk, pawel.moll@arm.com,
t.figa@samsung.com, sw0312.kim@samsung.com,
linux-kernel@vger.kernel.org, kyungmin.park@samsung.com,
robh+dt@kernel.org, galak@codeaurora.org,
grant.likely@linaro.org, m.szyprowski@samsung.com
Subject: Re: [PATCH/RFC V6 2/2] clk: Add handling of clk parent and rate assigned from DT
Date: Tue, 27 May 2014 15:58:05 +0530 [thread overview]
Message-ID: <538468B5.6090505@linaro.org> (raw)
In-Reply-To: <1400520171-6698-3-git-send-email-s.nawrocki@samsung.com>
On 05/19/2014 10:52 PM, Sylwester Nawrocki wrote:
> This patch adds a helper function to configure clock parents and
> rates as specified in clock-parents, clock-rates DT properties
> for a consumer device and a call to it before driver is bound to
> a device.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[ ... ]
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 5b47210..f622733 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -23,6 +23,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/idr.h>
> #include <linux/acpi.h>
> +#include <linux/clk/clk-conf.h>
>
> #include "base.h"
> #include "power/power.h"
> @@ -486,6 +487,10 @@ static int platform_drv_probe(struct device *_dev)
> struct platform_device *dev = to_platform_device(_dev);
> int ret;
>
> + ret = of_clk_set_defaults(_dev->of_node, false);
> + if (ret < 0)
> + return ret;
> +
of_clk_set_defaults() is not getting called when the related driver is
not registered through platform_driver_register().
I came across this issue while testing this patch on peach-pit board with
following dts change. max98090 audio codec driver is registered through
module_i2c_driver().
* arch/arm/boot/dts/exynos5420-peach-pit.dts
&hsi2c_7 {
status = "okay";
max98090: codec@10 {
compatible = "maxim,max98090";
reg = <0x10>;
interrupts = <2 0>;
interrupt-parent = <&gpx0>;
pinctrl-names = "default";
pinctrl-0 = <&max98090_irq>;
+ clocks = <&pmu_system_controller 0>;
+ clock-names = "mclk";
+ clock-parents = <&clock CLK_FIN_PLL>;
+ clock-rates = <24000000>;
};
};
--
Tushar Behera
next prev parent reply other threads:[~2014-05-27 10:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 17:22 [PATCH/RFC V6 0/2] clk: Default clk parents and rates assigned in DT Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-19 17:22 ` [PATCH/RFC V6 1/2] clk: Add of_clk_get_by_clkspec() helper Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-19 17:22 ` [PATCH/RFC V6 2/2] clk: Add handling of clk parent and rate assigned from DT Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-19 17:22 ` Sylwester Nawrocki
2014-05-20 11:49 ` Sylwester Nawrocki
2014-05-20 11:49 ` Sylwester Nawrocki
2014-05-20 11:49 ` Sylwester Nawrocki
2014-05-23 1:35 ` Mike Turquette
2014-05-23 1:35 ` Mike Turquette
2014-05-23 1:35 ` Mike Turquette
2014-05-27 10:28 ` Tushar Behera [this message]
2014-05-27 10:28 ` Tushar Behera
2014-05-27 10:28 ` Tushar Behera
2014-06-13 15:08 ` Sylwester Nawrocki
2014-06-13 15:08 ` Sylwester Nawrocki
2014-06-13 15:08 ` Sylwester Nawrocki
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=538468B5.6090505@linaro.org \
--to=tushar.behera@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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.