From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Gopinath, Thara" <thara@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"paul@pwsan.com" <paul@pwsan.com>, "Menon, Nishanth" <nm@ti.com>,
"Cousson, Benoit" <b-cousson@ti.com>,
"Sripathy, Vishwanath" <vishwanath.bs@ti.com>,
"Sawant, Anand" <sawant@ti.com>
Subject: Re: [PATCH 07/16] OMAP3: PM: Adding smartreflex class 3 driver.
Date: Fri, 05 Mar 2010 11:12:16 -0800 [thread overview]
Message-ID: <87d3zi1t2n.fsf@deeprootsystems.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0321CBD2B2@dbde02.ent.ti.com> (Thara Gopinath's message of "Fri\, 5 Mar 2010 20\:33\:58 +0530")
"Gopinath, Thara" <thara@ti.com> writes:
>>>-----Original Message-----
>>>From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
>>>Sent: Wednesday, March 03, 2010 1:07 AM
>>>To: Gopinath, Thara
>>>Cc: linux-omap@vger.kernel.org; paul@pwsan.com; Menon, Nishanth; Cousson, Benoit; Sripathy,
>>>Vishwanath; Sawant, Anand
>>>Subject: Re: [PATCH 07/16] OMAP3: PM: Adding smartreflex class 3 driver.
>>>
>>>Thara Gopinath <thara@ti.com> writes:
>>>
>>>> This patch adds smartreflex class 3 driver. This driver hooks
>>>> up with the generic smartreflex driver smartreflex.c to abstract
>>>> out class specific implementations out of the generic driver.
>>>>
>>>> Signed-off-by: Thara Gopinath <thara@ti.com>
>>>
>>>I like this abstraction, but I don't like that it still uses OPP IDs.
>>>
>>>So, before doing this, we need to get rid of OPP IDs from the
>>>smartreflex layer and keep OPP ID usage isolated to SRF.
>>>
>>>It appears the only reason we need OPP IDs in SR is because the Nvalue
>>>tables are indexed by OPP ID in sr_enable().
>
> Actually this is not true. If you see my patch14 sr err_minlimit and
> vp errorgain are opp dependent. In fact for 3630 for VDD1 there are
> 4 supported OPP's and 4 different values for err_minlimit and
> errorgain - one for each opp. So we might still need the opp id.
Yes, they are related to OPP IDs, but my primary objection is passing
around OPP IDs. Passing around OPP IDs *musb* be removed from the new
SR layer. OPP IDs are deprecated, and create multiple portability
problems.
As I proposed initially, this mapping needs to stay inside
smartreflex. A mapping of voltage to OPP ID (which will give you the
nvalue, err_minlimit and errorgain) should work fine.
Kevin
>>>
>>>One way to fix this is for this SR layer to keep it's own mapping of
>>>voltage to nvalue. So instead of taking OPP ID, sr_enable() should
>>>take a voltage (or frequency) and use that to look up the nvalue.
>>>
>
>>>a couple other minor comments below...
>
> Thank you for these comments and I will fix them in V2
>
> Regards
> Thara
>>>
>>>> ---
>>>> arch/arm/mach-omap2/Makefile | 1 +
>>>> arch/arm/mach-omap2/smartreflex-class3.c | 49 ++++++++++++++++++++++++++++++
>>>> arch/arm/plat-omap/Kconfig | 11 ++++++-
>>>> 3 files changed, 60 insertions(+), 1 deletions(-)
>>>> create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c
>>>>
>>>> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
>>>> index f6f901f..cd8ab86 100644
>>>> --- a/arch/arm/mach-omap2/Makefile
>>>> +++ b/arch/arm/mach-omap2/Makefile
>>>> @@ -52,6 +52,7 @@ obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o
>>>> obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o
>>>> obj-$(CONFIG_PM_DEBUG) += pm-debug.o
>>>> obj-$(CONFIG_OMAP_SMARTREFLEX) += smartreflex.o
>>>> +obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
>>>>
>>>> AFLAGS_sleep24xx.o :=-Wa,-march=armv6
>>>> AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
>>>> diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
>>>> new file mode 100644
>>>> index 0000000..d2e98a5
>>>> --- /dev/null
>>>> +++ b/arch/arm/mach-omap2/smartreflex-class3.c
>>>> @@ -0,0 +1,49 @@
>>>> +/*
>>>> + * Smart reflex Class 3 specific implementations
>>>> + *
>>>> + * Copyright (C) 2009 Texas Instruments, Inc.
>>>
>>>2010
>>>
>>>> + * Thara Gopinath <thara@ti.com>
>>>> + *
>>>> + * This program is free software; you can redistribute it and/or modify
>>>> + * it under the terms of the GNU General Public License version 2 as
>>>> + * published by the Free Software Foundation.
>>>> + */
>>>> +
>>>> +#include "smartreflex.h"
>>>> +
>>>> +static int sr_class3_enable(int id)
>>>> +{
>>>> + int target_opp_no = 0;
>>>
>>>insert blank line
>>>
>>>> + if (id == SR1)
>>>> + target_opp_no = get_vdd1_opp();
>>>> + else if (id == SR2)
>>>> + target_opp_no = get_vdd2_opp();
>>>> + if (!target_opp_no) {
>>>> + pr_warning("Targetopp not known.Cannot enable SR%d\n", id);
>>>> + return false;
>>>> + }
>>>
>>>and here
>>>
>>>> + return sr_enable(id, target_opp_no);
>>>> +}
>>>>
>>>> +static int sr_class3_disable(int id)
>>>> +{
>>>> + int target_opp_no = 0;
>>>
>>>blank line
>>>
>>>> + if (id == SR1)
>>>> + target_opp_no = get_vdd1_opp();
>>>> + else if (id == SR2)
>>>> + target_opp_no = get_vdd2_opp();
>>>> + sr_disable(id);
>>>
>>>blank line
>>>
>>>> + return true;
>>>> +}
>>>> +/* SR class3 structure */
>>>> +struct omap_smartreflex_class_data class3_data = {
>>>> + .enable = sr_class3_enable,
>>>> + .disable = sr_class3_disable,
>>>> +};
>>>> +
>>>> +static int __init sr_class3_init(void)
>>>> +{
>>>> + omap_sr_register_class(&class3_data);
>>>> + return 0;
>>>> +}
>>>> +late_initcall(sr_class3_init);
>>>> diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
>>>> index cef67f3..9d286e6 100644
>>>> --- a/arch/arm/plat-omap/Kconfig
>>>> +++ b/arch/arm/plat-omap/Kconfig
>>>> @@ -54,7 +54,7 @@ config OMAP_DEBUG_LEDS
>>>>
>>>> config OMAP_SMARTREFLEX
>>>> bool "SmartReflex support"
>>>> - depends on ARCH_OMAP3 && TWL4030_CORE && PM
>>>> + depends on ARCH_OMAP3 && PM
>>>> help
>>>> Say Y if you want to enable SmartReflex.
>>>>
>>>> @@ -69,6 +69,15 @@ config OMAP_SMARTREFLEX
>>>> compensation for VDD1 and VDD2, user must write 1 to
>>>> /sys/power/sr_vddX_autocomp, where X is 1 or 2.
>>>>
>>>> +config OMAP_SMARTREFLEX_CLASS3
>>>> + bool "Class 3 mode of Smartreflex Implementation"
>>>> + depends on OMAP_SMARTREFLEX && TWL4030_CORE
>>>> + help
>>>> + Say Y to enable Class 3 implementation of Smartreflex
>>>> +
>>>> + Class 3 implementation of Smartreflex employs continuous hardware
>>>> + voltage caliberation.
>>>> +
>>>> config OMAP_SMARTREFLEX_TESTING
>>>> bool "Smartreflex testing support"
>>>> depends on OMAP_SMARTREFLEX
>>>> --
>>>> 1.7.0.rc1.33.g07cf0f
next prev parent reply other threads:[~2010-03-05 19:12 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 ` [PATCH 12/16] OMAP3: PM: Support for enabling smartreflex autocompensation by default Kevin Hilman
2010-03-05 15:20 ` 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 [this message]
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=87d3zi1t2n.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox