All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Thara Gopinath <thara@ti.com>
Cc: linux-omap@vger.kernel.org, paul@pwsan.com, nm@ti.com,
	b-cousson@ti.com, vishwanath.bs@ti.com, sawant@ti.com
Subject: Re: [PATCH 12/16] OMAP3: PM: Support for enabling smartreflex autocompensation by default.
Date: Tue, 02 Mar 2010 16:48:51 -0800	[thread overview]
Message-ID: <87d3zmqlfw.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1267003757-22456-13-git-send-email-thara@ti.com> (Thara Gopinath's message of "Wed\, 24 Feb 2010 14\:59\:13 +0530")

Thara Gopinath <thara@ti.com> writes:

> This patch adds support to pdata enable smartreflex autocompenstion
> during init based on init_enable flag passed as pdata.
>
> This patch also adds enabling of autocompensation by
> default (setting init_enable flag to true) in case of ES3.1
> OMAP3430 chip. In the current implementation
> this step is kept in smartreflex.c itself.Later an API can be added
> so that the decision to enable autocompensation by default
> can be passed from the corresponding board files.
>
> Signed-off-by: Thara Gopinath <thara@ti.com>
> ---
>  arch/arm/mach-omap2/smartreflex.c |   32 ++++++++++++++++++++++++++++----
>  1 files changed, 28 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 96dc76b..085dd05 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -477,9 +477,15 @@ void omap_sr_register_class(struct omap_smartreflex_class_data *class_data)
>  
>  	sr_class = class_data;
>  	/*
> -	 * Register the interrupt handler incase requested by the class driver
> +	 * Check if any SR module needs to be enabled as part of init.
> +	 * In case the probe for the SR module is not yet called the enable
> +	 * will not be done here but will be done in the probe whenever
> +	 * it gets called. Also register the interrupt handler incase
> +	 * requested by the class driver.
>  	 */
>  	list_for_each_entry(sr_info, &sr_list, node) {
> +		struct omap_smartreflex_data *pdata =
> +				sr_info->pdev->dev.platform_data;
>  		if (sr_class->class_type == SR_CLASS2 &&
>  				sr_class->notify_flags && sr_info->irq) {
>  			char name[SMARTREFLEX_NAME_LEN];
> @@ -496,6 +502,8 @@ void omap_sr_register_class(struct omap_smartreflex_class_data *class_data)
>  				return;
>  			}
>  		}
> +		if (pdata->init_enable)
> +			sr_start_vddautocomap(sr_info->srid);

I think this flag is better named enable_on_init.  

>  	}
>  }
>  
> @@ -562,11 +570,15 @@ static int __devinit omap_smartreflex_probe(struct platform_device *pdev)
>  	list_add(&sr_info->node, &sr_list);
>  
>  	/*
> -	 * Register interrrupt handler if smartreflex class driver is already
> -	 * registered and has requested for interrupts. This will be attempted
> +	 * Enable the smartreflex module if init_enable flag is set and
> +	 * if the class driver is registered. Also Register interrrupt handler
> +	 * if smartreflex class driver is already registered and has
> +	 * requested for interrupts. This will be attempted
>  	 * in the class driver register again if it does not happen here.
>  	 */
>  	if (sr_class) {
> +		struct omap_smartreflex_data *pdata = pdev->dev.platform_data;
> +
>  		if (sr_class->class_type == SR_CLASS2 &&
>  				sr_class->notify_flags && sr_info->irq) {
>  			sprintf(name, "sr%d", sr_info->srid);
> @@ -580,6 +592,8 @@ static int __devinit omap_smartreflex_probe(struct platform_device *pdev)
>  				return ret;
>  			}
>  		}
> +		if (pdata->init_enable)
> +			sr_start_vddautocomap(sr_info->srid);
>  	}

As with the duplicate request_irq() in previous patch, I don't follow
why it's the start is needed twice.  

Is it to handle the case where no class driver is installed?

>  
>  	pr_info("SmartReflex driver initialized\n");
> @@ -782,7 +796,17 @@ static int __init omap_devinit_smartreflex(void)
>  		if (WARN_ON(!sr_data))
>  			return -ENOMEM;
>  
> -		sr_data->init_enable = false;
> +		/*
> +		 * Enable the SR module by default if it is a OMAP3430
> +		 * ES3.1 chip

You should add a comment about why: starting with ES3.1, efuse values can be trusted?

> +		 */
> +		if (cpu_is_omap343x()) {
> +			if (omap_rev() == OMAP3430_REV_ES3_1)
> +				sr_data->init_enable = true;
> +			else
> +				sr_data->init_enable = false;
> +		} else
> +			sr_data->init_enable = false;
>  		sr_data->device_enable = omap_device_enable;
>  		sr_data->device_shutdown = omap_device_shutdown;
>  		sr_data->device_idle = omap_device_idle;

Kevin

  parent reply	other threads:[~2010-03-03  0:48 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  9:29 [PATCH 00/16] OMAP3: PM: Smartreflex and voltage revamp Thara Gopinath
2010-02-24  9:29 ` [PATCH 01/16] OMAP3: PM: Adding hwmod data for Smartreflex Thara Gopinath
2010-02-24  9:29   ` [PATCH 02/16] OMAP3: PM: Create list to keep track of various smartreflex instances Thara Gopinath
2010-02-24  9:29     ` [PATCH 03/16] OMAP3: PM: Convert smartreflex driver into a platform driver using hwmods and omap-device layer Thara Gopinath
2010-02-24  9:29       ` [PATCH 04/16] OMAP3: PM: Move smartreflex autocompensation enable disable hooks to PM debugfs Thara Gopinath
2010-02-24  9:29         ` [PATCH 05/16] OMAP3: PM: Export get_vdd1_opp and get_vdd2_opp from shared resource framework Thara Gopinath
2010-02-24  9:29           ` [PATCH 06/16] OMAP3: PM: Smartreflex class related changes for smartreflex.c Thara Gopinath
2010-02-24  9:29             ` [PATCH 07/16] OMAP3: PM: Adding smartreflex class 3 driver Thara Gopinath
2010-02-24  9:29               ` [PATCH 08/16] OMAP3: PM: Disabling Smartreflex across both frequency and voltage scaling during DVFS Thara Gopinath
2010-02-24  9:29                 ` [PATCH 09/16] OMAP3: PM: Creating separate files for handling OMAP3 voltage related operations Thara Gopinath
2010-02-24  9:29                   ` [PATCH 10/16] OMAP3: PM: Cleaning up of smartreflex header file Thara Gopinath
2010-02-24  9:29                     ` [PATCH 11/16] OMAP3: PM: Configurations for Smartreflex Class 2 and Smartreflex Class 3 Thara Gopinath
2010-02-24  9:29                       ` [PATCH 12/16] OMAP3: PM: Support for enabling smartreflex autocompensation by default Thara Gopinath
2010-02-24  9:29                         ` [PATCH 13/16] OMAP3: PM: Correcting accessing of ERRCONFIG register in smartreflex.c Thara Gopinath
2010-02-24  9:29                           ` [PATCH 14/16] OMAP3: PM: Implement latest h/w recommendations for SR and VP registers and SR VP enable disable sequence Thara Gopinath
2010-02-24  9:29                             ` [PATCH 15/16] OMAP3: PM: VP force update method of voltage scaling Thara Gopinath
2010-02-24  9:29                               ` [PATCH 16/16] OMAP3: PM: Enabling Smartreflex Class 3 driver by default in pm defconfig Thara Gopinath
2010-03-03  0:58                               ` [PATCH 15/16] OMAP3: PM: VP force update method of voltage scaling Kevin Hilman
2010-03-05 15:22                                 ` Gopinath, Thara
2010-03-05 15:26                                   ` Felipe Contreras
2010-03-05 15:30                                     ` Gopinath, Thara
2010-03-05 16:22                                       ` Felipe Contreras
2010-03-05 18:17                                         ` Snipping irrelevant text from a discussion (was: "RE: [PATCH 15/16] OMAP3: PM: VP force update method of voltage scaling") Aguirre, Sergio
2010-03-05 21:18                                           ` Felipe Contreras
2010-03-09  1:42                                             ` Tony Lindgren
2010-03-09  6:51                                               ` Felipe Balbi
2010-03-09 15:21                                                 ` Aguirre, Sergio
2010-03-09 18:21                                                   ` Tony Lindgren
2010-03-03  0:54                             ` [PATCH 14/16] OMAP3: PM: Implement latest h/w recommendations for SR and VP registers and SR VP enable disable sequence Kevin Hilman
2010-03-03  0:48                         ` Kevin Hilman [this message]
2010-03-05 15:20                           ` [PATCH 12/16] OMAP3: PM: Support for enabling smartreflex autocompensation by default Gopinath, Thara
2010-03-03  0:37                       ` [PATCH 11/16] OMAP3: PM: Configurations for Smartreflex Class 2 and Smartreflex Class 3 Kevin Hilman
2010-03-05 15:12                         ` Gopinath, Thara
2010-03-05 19:20                           ` Kevin Hilman
2010-03-02 20:02                   ` [PATCH 09/16] OMAP3: PM: Creating separate files for handling OMAP3 voltage related operations Kevin Hilman
2010-03-05 15:17                     ` Gopinath, Thara
2010-03-02 19:36               ` [PATCH 07/16] OMAP3: PM: Adding smartreflex class 3 driver Kevin Hilman
2010-03-05 15:03                 ` Gopinath, Thara
2010-03-05 19:12                   ` Kevin Hilman
2010-03-02 18:44             ` [PATCH 06/16] OMAP3: PM: Smartreflex class related changes for smartreflex.c Kevin Hilman
2010-03-05 15:00               ` Gopinath, Thara
2010-03-05 18:29                 ` Kevin Hilman
2010-03-02 23:37             ` Kevin Hilman
2010-03-02 23:52             ` Kevin Hilman
2010-03-05 15:18               ` Gopinath, Thara
2010-03-05 18:30                 ` Kevin Hilman
2010-03-02 18:28         ` [PATCH 04/16] OMAP3: PM: Move smartreflex autocompensation enable disable hooks to PM debugfs Kevin Hilman
2010-02-25  2:39       ` [PATCH 03/16] OMAP3: PM: Convert smartreflex driver into a platform driver using hwmods and omap-device layer ambresh
2010-03-02 18:28       ` Kevin Hilman
2010-03-05 14:26         ` Gopinath, Thara
2010-03-12  9:48         ` Gopinath, Thara
2010-03-13  0:36           ` Kevin Hilman
2010-03-15 19:00             ` Tony Lindgren
2010-03-03  0:02       ` Kevin Hilman
2010-02-25  1:42     ` [PATCH 02/16] OMAP3: PM: Create list to keep track of various smartreflex instances ambresh
2010-03-02 17:40       ` Kevin Hilman
2010-02-26 23:21     ` Mike Turquette
2010-03-02 17:39       ` Kevin Hilman
2010-02-24 16:52   ` [PATCH 01/16] OMAP3: PM: Adding hwmod data for Smartreflex Mike Turquette
2010-03-06  0:45   ` Kevin Hilman
2010-03-06  0:58 ` [PATCH 00/16] OMAP3: PM: Smartreflex and voltage revamp Kevin Hilman

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=87d3zmqlfw.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=b-cousson@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=sawant@ti.com \
    --cc=thara@ti.com \
    --cc=vishwanath.bs@ti.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.