All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: jean.pihet@newoldbits.com
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	J Keerthy <j-keerthy@ti.com>, Jean Pihet <j-pihet@ti.com>
Subject: Re: [PATCH] ARM: OMAP: SmartReflex: pass device dependent data via platform data
Date: Mon, 17 Sep 2012 15:20:50 -0700	[thread overview]
Message-ID: <20120917222048.GH11762@atomide.com> (raw)
In-Reply-To: <1347615554-28351-1-git-send-email-j-pihet@ti.com>

Hi,

* jean.pihet@newoldbits.com <jean.pihet@newoldbits.com> [120914 02:40]:
> From: Jean Pihet <j-pihet@ti.com>
> 
> Remove the device dependent settings (cpu_is_xxx(), IP clock name)
> from the driver code and pass them instead via the platform
> data.
> This allows a clean separation of the driver code and the platform
> code.

Thanks for fixing this. Looks like this should be queued by the
drivers/power/avs maintainers and there should not be merge
conflicts with other omap changes queued.

Maybe do $ scripts/get_maintainer.pl -f drivers/power/avs
and resend both patches to the maintainers?

One comment below on the clocks though..
 
> --- a/arch/arm/mach-omap2/sr_device.c
> +++ b/arch/arm/mach-omap2/sr_device.c
> @@ -122,6 +122,26 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
>  	sr_data->senn_mod = 0x1;
>  	sr_data->senp_mod = 0x1;
>  
> +	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
> +		sr_data->err_weight = OMAP3430_SR_ERRWEIGHT;
> +		sr_data->err_maxlimit = OMAP3430_SR_ERRMAXLIMIT;
> +		sr_data->accum_data = OMAP3430_SR_ACCUMDATA;
> +		if (!(strcmp(sr_data->name, "smartreflex_mpu_iva"))) {
> +			sr_data->senn_avgweight = OMAP3430_SR1_SENNAVGWEIGHT;
> +			sr_data->senp_avgweight = OMAP3430_SR1_SENPAVGWEIGHT;
> +		} else {
> +			sr_data->senn_avgweight = OMAP3430_SR2_SENNAVGWEIGHT;
> +			sr_data->senp_avgweight = OMAP3430_SR2_SENPAVGWEIGHT;
> +		}
> +	}
> +
> +	if (cpu_is_omap34xx())
> +		strncpy(sr_data->sys_clk_name, "sys_ck",
> +			sizeof(sr_data->sys_clk_name));
> +	else
> +		strncpy(sr_data->sys_clk_name, "sys_clkin_ck",
> +			sizeof(sr_data->sys_clk_name));
> +
>  	sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
>  	if (IS_ERR(sr_data->voltdm)) {
>  		pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",

Here you should not pass clocks around. The driver should be able to
clk_get(dev, "fck") as long as you have the proper CLK() aliases set
in the arch/arm/mach-omap2/clock*_data.c files.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP: SmartReflex: pass device dependent data via platform data
Date: Mon, 17 Sep 2012 15:20:50 -0700	[thread overview]
Message-ID: <20120917222048.GH11762@atomide.com> (raw)
In-Reply-To: <1347615554-28351-1-git-send-email-j-pihet@ti.com>

Hi,

* jean.pihet at newoldbits.com <jean.pihet@newoldbits.com> [120914 02:40]:
> From: Jean Pihet <j-pihet@ti.com>
> 
> Remove the device dependent settings (cpu_is_xxx(), IP clock name)
> from the driver code and pass them instead via the platform
> data.
> This allows a clean separation of the driver code and the platform
> code.

Thanks for fixing this. Looks like this should be queued by the
drivers/power/avs maintainers and there should not be merge
conflicts with other omap changes queued.

Maybe do $ scripts/get_maintainer.pl -f drivers/power/avs
and resend both patches to the maintainers?

One comment below on the clocks though..
 
> --- a/arch/arm/mach-omap2/sr_device.c
> +++ b/arch/arm/mach-omap2/sr_device.c
> @@ -122,6 +122,26 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
>  	sr_data->senn_mod = 0x1;
>  	sr_data->senp_mod = 0x1;
>  
> +	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
> +		sr_data->err_weight = OMAP3430_SR_ERRWEIGHT;
> +		sr_data->err_maxlimit = OMAP3430_SR_ERRMAXLIMIT;
> +		sr_data->accum_data = OMAP3430_SR_ACCUMDATA;
> +		if (!(strcmp(sr_data->name, "smartreflex_mpu_iva"))) {
> +			sr_data->senn_avgweight = OMAP3430_SR1_SENNAVGWEIGHT;
> +			sr_data->senp_avgweight = OMAP3430_SR1_SENPAVGWEIGHT;
> +		} else {
> +			sr_data->senn_avgweight = OMAP3430_SR2_SENNAVGWEIGHT;
> +			sr_data->senp_avgweight = OMAP3430_SR2_SENPAVGWEIGHT;
> +		}
> +	}
> +
> +	if (cpu_is_omap34xx())
> +		strncpy(sr_data->sys_clk_name, "sys_ck",
> +			sizeof(sr_data->sys_clk_name));
> +	else
> +		strncpy(sr_data->sys_clk_name, "sys_clkin_ck",
> +			sizeof(sr_data->sys_clk_name));
> +
>  	sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name);
>  	if (IS_ERR(sr_data->voltdm)) {
>  		pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",

Here you should not pass clocks around. The driver should be able to
clk_get(dev, "fck") as long as you have the proper CLK() aliases set
in the arch/arm/mach-omap2/clock*_data.c files.

Regards,

Tony

  reply	other threads:[~2012-09-17 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14  9:39 [PATCH] ARM: OMAP: SmartReflex: pass device dependent data via platform data jean.pihet
2012-09-14  9:39 ` jean.pihet at newoldbits.com
2012-09-17 22:20 ` Tony Lindgren [this message]
2012-09-17 22:20   ` Tony Lindgren

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=20120917222048.GH11762@atomide.com \
    --to=tony@atomide.com \
    --cc=j-keerthy@ti.com \
    --cc=j-pihet@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.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.