Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218592 > unrolled thread

Re: [PATCH] firmware: qcom: scm: Convert to platform driver

Started byStephen Boyd <sboyd@codeaurora.org>
First post2015-09-03 23:40 +0200
Last post2015-09-04 22:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] firmware: qcom: scm: Convert to platform driver Stephen Boyd <sboyd@codeaurora.org> - 2015-09-03 23:40 +0200
    Re: [PATCH] firmware: qcom: scm: Convert to platform driver Andy Gross <agross@codeaurora.org> - 2015-09-04 22:40 +0200

#1218592 — Re: [PATCH] firmware: qcom: scm: Convert to platform driver

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-09-03 23:40 +0200
SubjectRe: [PATCH] firmware: qcom: scm: Convert to platform driver
Message-ID<q4KoJ-7iO-47@gated-at.bofh.it>
On 07/20, Andy Gross wrote:
> This patch creates a platform driver for the SCM so that we can adequately
> manage resources.  This removes clients having to carry the necessary
> clocks to use the SCM resources.
> 
> Signed-off-by: Andy Gross <agross@codeaurora.org>
> ---

It would be nice if we could use this platform device for doing
the DMAish memory allocations that we do in this driver too. I
guess one complication there is that we would need to allocate
memory with the DMA APIs before CPUs are brought up
(early_initcall level).

> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
> index 45c008d..5dd0514 100644
> --- a/drivers/firmware/qcom_scm.c
> +++ b/drivers/firmware/qcom_scm.c
> @@ -15,14 +15,57 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
>   * 02110-1301, USA.
>   */
> -
> +#include <linux/platform_device.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>

This include is here twice.

>  #include <linux/cpumask.h>
>  #include <linux/export.h>
>  #include <linux/types.h>
>  #include <linux/qcom_scm.h>
> +#include <linux/of.h>
> +#include <linux/clk.h>
>  
[...]
> +
> +/**
> + * qcom_scm_is_available() - Checks if SCM is available
> + */
> +bool qcom_scm_is_available(void)
> +{
> +	return !!__scm;
> +}
> +EXPORT_SYMBOL(qcom_scm_is_available);
> +
> +static int qcom_scm_remove(struct platform_device *pdev)
> +{
> +	__scm = NULL;
> +
> +	return 0;
> +}

Maybe we just shouldn't allow this? The firmware isn't going
anywhere at runtime, and this driver is currently marked as
bool in the Kconfig.

> +
> +static const struct of_device_id qcom_scm_dt_match[] = {
> +	{ .compatible = "qcom,scm",},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);
> +
> +static struct platform_driver qcom_scm_driver = {
> +	.driver = {
> +		.name	= "scm",

Maybe 'qcom_scm' ?

> +		.of_match_table = qcom_scm_dt_match,
> +	},
> +	.probe = qcom_scm_probe,
> +	.remove = qcom_scm_remove,
> +};
> +
> +module_platform_driver(qcom_scm_driver);

Isn't there some sort of builtin_platform_driver() macro for
builtin modules?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1219298

FromAndy Gross <agross@codeaurora.org>
Date2015-09-04 22:40 +0200
Message-ID<q55Wa-4s0-7@gated-at.bofh.it>
In reply to#1218592
On Thu, Sep 03, 2015 at 02:33:22PM -0700, Stephen Boyd wrote:
> On 07/20, Andy Gross wrote:
> > This patch creates a platform driver for the SCM so that we can adequately
> > manage resources.  This removes clients having to carry the necessary
> > clocks to use the SCM resources.
> > 
> > Signed-off-by: Andy Gross <agross@codeaurora.org>
> > ---
> 
> It would be nice if we could use this platform device for doing
> the DMAish memory allocations that we do in this driver too. I
> guess one complication there is that we would need to allocate
> memory with the DMA APIs before CPUs are brought up
> (early_initcall level).

Yeah that's one thing we could do but we'd have to defer the memory stuff until
it's used the first time (specific calls require it).

> 
> > diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
> > index 45c008d..5dd0514 100644
> > --- a/drivers/firmware/qcom_scm.c
> > +++ b/drivers/firmware/qcom_scm.c
> > @@ -15,14 +15,57 @@
> >   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> >   * 02110-1301, USA.
> >   */
> > -
> > +#include <linux/platform_device.h>
> > +#include <linux/module.h>
> > +#include <linux/platform_device.h>
> 
> This include is here twice.
> 
> >  #include <linux/cpumask.h>
> >  #include <linux/export.h>
> >  #include <linux/types.h>
> >  #include <linux/qcom_scm.h>
> > +#include <linux/of.h>
> > +#include <linux/clk.h>
> >  
> [...]
> > +
> > +/**
> > + * qcom_scm_is_available() - Checks if SCM is available
> > + */
> > +bool qcom_scm_is_available(void)
> > +{
> > +	return !!__scm;
> > +}
> > +EXPORT_SYMBOL(qcom_scm_is_available);
> > +
> > +static int qcom_scm_remove(struct platform_device *pdev)
> > +{
> > +	__scm = NULL;
> > +
> > +	return 0;
> > +}
> 
> Maybe we just shouldn't allow this? The firmware isn't going
> anywhere at runtime, and this driver is currently marked as
> bool in the Kconfig.

Fair enough.

> 
> > +
> > +static const struct of_device_id qcom_scm_dt_match[] = {
> > +	{ .compatible = "qcom,scm",},
> > +	{},
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);
> > +
> > +static struct platform_driver qcom_scm_driver = {
> > +	.driver = {
> > +		.name	= "scm",
> 
> Maybe 'qcom_scm' ?

yeah i should have used that.

> 
> > +		.of_match_table = qcom_scm_dt_match,
> > +	},
> > +	.probe = qcom_scm_probe,
> > +	.remove = qcom_scm_remove,
> > +};
> > +
> > +module_platform_driver(qcom_scm_driver);
> 
> Isn't there some sort of builtin_platform_driver() macro for
> builtin modules?

I'll take a look and convert.


-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web