All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Andy Gross <agross@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Bjorn Andersson <bjorn.andersson@sonymobile.com>,
	devicetree@vger.kernel.org, Rob Clark <robdclark@gmail.com>
Subject: Re: [PATCH] firmware: qcom: scm: Convert to platform driver
Date: Thu, 3 Sep 2015 14:33:22 -0700	[thread overview]
Message-ID: <20150903213322.GI15099@codeaurora.org> (raw)
In-Reply-To: <1437431152-6730-1-git-send-email-agross@codeaurora.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] firmware: qcom: scm: Convert to platform driver
Date: Thu, 3 Sep 2015 14:33:22 -0700	[thread overview]
Message-ID: <20150903213322.GI15099@codeaurora.org> (raw)
In-Reply-To: <1437431152-6730-1-git-send-email-agross@codeaurora.org>

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

  reply	other threads:[~2015-09-03 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 22:25 [PATCH] firmware: qcom: scm: Convert to platform driver Andy Gross
2015-07-20 22:25 ` Andy Gross
2015-09-03 21:33 ` Stephen Boyd [this message]
2015-09-03 21:33   ` Stephen Boyd
2015-09-04 20:34   ` Andy Gross
2015-09-04 20:34     ` Andy Gross

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=20150903213322.GI15099@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=agross@codeaurora.org \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /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.