From: Vishwanath Sripathy <vishwanath.bs@ti.com>
To: Nishanth Menon <nm@ti.com>, linux-omap <linux-omap@vger.kernel.org>
Cc: Tony Lindgren <tony@atomide.com>, Kevin Hilman <khilman@ti.com>
Subject: RE: [PATCH 15/19] omap3+: sr: introduce notifier_control
Date: Sat, 19 Feb 2011 19:10:55 +0530 [thread overview]
Message-ID: <765c3f6e8053293455100f296fb76ae5@mail.gmail.com> (raw)
In-Reply-To: <1298116918-30744-16-git-send-email-nm@ti.com>
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Nishanth Menon
> Sent: Saturday, February 19, 2011 5:32 PM
> To: linux-omap
> Cc: Tony Lindgren; Kevin Hilman; Nishanth Menon
> Subject: [PATCH 15/19] omap3+: sr: introduce notifier_control
>
> We need some mechanism from class drivers to control when notifiers
> should be triggered and when not, currently we have none, which makes
> Class driver usage of the interrupt events almost impossible.
> Introduce an smartreflex driver api for doing the same.
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
> arch/arm/mach-omap2/smartreflex.c | 57
> +++++++++++++++++++++++++
> arch/arm/plat-omap/include/plat/smartreflex.h | 8 ++++
> 2 files changed, 65 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-
> omap2/smartreflex.c
> index 165f6f3..ad23b8d 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -704,6 +704,63 @@ void sr_disable(struct voltagedomain *voltdm)
> }
>
> /**
> + * sr_notifier_control() - control the notifier mechanism
> + * @voltdm: VDD pointer to which the SR module to be configured
> belongs to.
> + * @enable: true to enable notifiers and false to disable the same
> + *
> + * SR modules allow an MCU interrupt mechanism that vary based on
> the IP
> + * revision, we allow the system to generate interrupt if the class
driver
> + * has capability to handle the same. it is upto the class driver to
> ensure
> + * the proper sequencing and handling for a clean implementation.
> returns
> + * 0 if all goes fine, else returns failure results
> + */
> +int sr_notifier_control(struct voltagedomain *voltdm, bool enable)
> +{
> + struct omap_sr *sr = _sr_lookup(voltdm);
> + u32 value = 0;
> + if (IS_ERR_OR_NULL(sr)) {
> + pr_warning("%s: sr corresponding to domain not found\n",
> + __func__);
> + return -EINVAL;
> + }
> + if (!sr->autocomp_active)
> + return -EINVAL;
Why you do you return here? Class driver should still be able to place
it's request even if sr is disabled though it will be effective only after
sr is enabled.
Vishwa
> +
> + /* if I could never register an isr, why bother?? */
> + if (!(sr_class && sr_class->notify && sr_class->notify_flags &&
> + sr->irq)) {
> + dev_warn(&sr->pdev->dev,
> + "%s: unable to setup irq without handling
> mechanism\n",
> + __func__);
> + return -EINVAL;
> + }
> +
> + switch (sr->ip_type) {
> + case SR_TYPE_V1:
> + value = notifier_to_irqen_v1(sr_class->notify_flags);
> + sr_modify_reg(sr, ERRCONFIG_V1, value,
> + (enable) ? value : 0);
> + break;
> + case SR_TYPE_V2:
> + value = notifier_to_irqen_v2(sr_class->notify_flags);
> + sr_write_reg(sr, (enable) ? IRQENABLE_SET :
> IRQENABLE_CLR,
> + value);
> + break;
> + default:
> + dev_warn(&sr->pdev->dev, "%s: unknown type of
> sr??\n",
> + __func__);
> + return -EINVAL;
> + }
> +
> + if (enable)
> + enable_irq(sr->irq);
> + else
> + disable_irq_nosync(sr->irq);
> +
> + return 0;
> +}
> +
> +/**
> * sr_register_class() - API to register a smartreflex class
parameters.
> * @class_data: The structure containing various sr class specific
> data.
> *
> diff --git a/arch/arm/plat-omap/include/plat/smartreflex.h
> b/arch/arm/plat-omap/include/plat/smartreflex.h
> index ff07d1e..d420f44 100644
> --- a/arch/arm/plat-omap/include/plat/smartreflex.h
> +++ b/arch/arm/plat-omap/include/plat/smartreflex.h
> @@ -242,6 +242,7 @@ void omap_sr_register_pmic(struct
> omap_sr_pmic_data *pmic_data);
> /* Smartreflex driver hooks to be called from Smartreflex class driver
*/
> int sr_enable(struct voltagedomain *voltdm, unsigned long volt);
> void sr_disable(struct voltagedomain *voltdm);
> +int sr_notifier_control(struct voltagedomain *voltdm, bool enable);
> int sr_configure_errgen(struct voltagedomain *voltdm);
> int sr_configure_minmax(struct voltagedomain *voltdm);
>
> @@ -250,6 +251,13 @@ int sr_register_class(struct
> omap_sr_class_data *class_data);
> #else
> static inline void omap_sr_enable(struct voltagedomain *voltdm) {}
> static inline void omap_sr_disable(struct voltagedomain *voltdm) {}
> +
> +static inline int sr_notifier_control(struct voltagedomain *voltdm,
> + bool enable)
> +{
> + return -EINVAL;
> +}
> +
> static inline void omap_sr_disable_reset_volt(
> struct voltagedomain *voltdm) {}
> static inline void omap_sr_register_pmic(
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-02-19 13:41 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-19 12:01 [PATCH 00/19] OMAP3+: introduce SR class 1.5 Nishanth Menon
2011-02-19 12:01 ` [PATCH 01/19] omap3: hwmod: add smartreflex irqs Nishanth Menon
2011-03-02 23:48 ` Kevin Hilman
2011-03-03 0:43 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 02/19] omap3630: hwmod: sr: enable for higher ES Nishanth Menon
2011-02-19 13:22 ` Vishwanath Sripathy
2011-02-20 5:26 ` Nishanth Menon
2011-02-20 5:38 ` do we need CHIP_GE_OMAP3630ES1in .oc? (was Re: [PATCH 02/19] omap3630: hwmod: sr: enable for higher ES) Nishanth Menon
2011-02-21 5:50 ` Anand Gadiyar
2011-02-19 12:01 ` [PATCH 03/19] omap3+: voltage: remove initial voltage Nishanth Menon
2011-02-19 13:24 ` Vishwanath Sripathy
2011-02-20 5:12 ` Nishanth Menon
2011-02-23 6:54 ` Vishwanath Sripathy
2011-02-23 8:18 ` Menon, Nishanth
2011-02-23 8:59 ` Vishwanath Sripathy
2011-02-23 9:08 ` Menon, Nishanth
2011-03-02 23:52 ` Kevin Hilman
2011-03-03 0:35 ` Nishanth Menon
2011-03-03 0:53 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 04/19] omap3+: voltage: remove spurious pr_notice for debugfs Nishanth Menon
2011-02-19 12:01 ` [PATCH 05/19] omap3+: voltage: use IS_ERR_OR_NULL Nishanth Menon
2011-02-19 12:01 ` [PATCH 06/19] omap3+: voltage: use volt_data pointer instead values Nishanth Menon
2011-02-24 5:28 ` Gulati, Shweta
2011-02-24 8:29 ` Gulati, Shweta
2011-02-24 17:22 ` Menon, Nishanth
2011-02-19 12:01 ` [PATCH 07/19] omap3+: voltage: add transdone apis Nishanth Menon
2011-02-19 12:01 ` [PATCH 08/19] omap3+: sr: make notify independent of class Nishanth Menon
2011-03-03 0:05 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 09/19] omap3+: sr: introduce class init,deinit and priv data Nishanth Menon
2011-03-03 0:08 ` Kevin Hilman
2011-03-03 0:41 ` Nishanth Menon
2011-03-03 0:57 ` Kevin Hilman
2011-03-03 1:22 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 10/19] omap3+: sr: fix cosmetic indentation Nishanth Menon
2011-03-03 0:09 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 11/19] omap3+: sr: call handler with interrupt disabled Nishanth Menon
2011-03-03 0:11 ` Kevin Hilman
2011-03-03 0:46 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 12/19] omap3+: sr: disable interrupt by default Nishanth Menon
2011-03-03 0:15 ` Kevin Hilman
2011-03-03 0:26 ` Nishanth Menon
2011-03-03 0:59 ` Kevin Hilman
2011-03-03 1:23 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 13/19] omap3+: sr: enable/disable SR only on need Nishanth Menon
2011-02-19 12:01 ` [PATCH 14/19] omap3+: sr: introduce notifiers flags Nishanth Menon
2011-03-03 0:17 ` Kevin Hilman
2011-03-03 0:47 ` Nishanth Menon
2011-02-19 12:01 ` [PATCH 15/19] omap3+: sr: introduce notifier_control Nishanth Menon
2011-02-19 13:40 ` Vishwanath Sripathy [this message]
2011-02-20 4:50 ` Nishanth Menon
2011-02-23 6:46 ` Vishwanath Sripathy
2011-02-23 8:14 ` Menon, Nishanth
2011-02-19 12:01 ` [PATCH 16/19] omap3+: sr: disable spamming interrupts Nishanth Menon
2011-03-03 0:21 ` Kevin Hilman
2011-02-19 12:01 ` [PATCH 17/19] omap3+: sr: make enable path use volt_data pointer Nishanth Menon
2011-02-19 12:01 ` [PATCH 18/19] omap3630+: sr: add support for class 1.5 Nishanth Menon
2011-03-01 9:53 ` Gulati, Shweta
2011-03-01 10:17 ` Menon, Nishanth
2011-03-01 12:20 ` Gulati, Shweta
2011-02-19 12:01 ` [PATCH 19/19] omap3430: sr: class3: restrict cpu to run on Nishanth Menon
2011-03-03 0:33 ` [PATCH 00/19] OMAP3+: introduce SR class 1.5 Kevin Hilman
2011-03-03 0:37 ` Nishanth Menon
2011-03-03 1:00 ` Kevin Hilman
2011-03-03 1:30 ` Nishanth Menon
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=765c3f6e8053293455100f296fb76ae5@mail.gmail.com \
--to=vishwanath.bs@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=tony@atomide.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