All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	"Sripathy, Vishwanath" <vishwanath.bs@ti.com>,
	"Sawant, Anand" <sawant@ti.com>,
	"Derrick, David" <dderrick@ti.com>
Subject: Re: [PATCHv2 3/8] OMAP3: PM: Adding smartreflex driver support.
Date: Tue, 14 Sep 2010 10:04:09 -0700	[thread overview]
Message-ID: <874odss1di.fsf@deeprootsystems.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0329441CFC@dbde02.ent.ti.com> (Thara Gopinath's message of "Tue, 14 Sep 2010 21:28:03 +0530")

"Gopinath, Thara" <thara@ti.com> writes:

[...]

>>>> +   sr->is_sr_enable = 0;
>>>> +}
>>>> +
>>>> +/**
>>>> + * omap_smartreflex_enable : API to enable SR clocks and to call into the
>>>> + * registered smartreflex class enable API.
>>>> + * @voltdm - VDD pointer to which the SR module to be configured belongs to.
>>>> + *
>>>> + * This API is to be called from the kernel in order to enable
>>>> + * a particular smartreflex module. This API will do the initial
>>>> + * configurations to turn on the smartreflex module and in turn call
>>>> + * into the registered smartreflex class enable API.
>>>> + */
>>>> +void omap_smartreflex_enable(struct voltagedomain *voltdm)
>>>> +{
>>>> +   struct omap_sr *sr = _sr_lookup(voltdm);
>>>> +
>>>> +   if (IS_ERR(sr)) {
>>>> +           pr_warning("%s: omap_sr struct for sr_%s not found\n",
>>>> +                   __func__, voltdm->name);
>>>> +           return;
>>>> +   }
>>>> +
>>>> +   if (!sr->is_autocomp_active)
>>>> +           return;
>>>
>>>from here
>>>
>>>> +   if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) {
>>>> +           dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not"
>>>> +                   "registered\n", __func__);
>>>> +           return;
>>>> +   }
>>>> +   sr_class->enable(voltdm);
>>>
>>>to here, this looks an awful lot like sr_start_autocomp()
>
> Yes both will enable smartreflex. One is called from user side and other
> from kernel side. Are you suggesting creating a third API to just keep the above
> piece of code ??

No, I'm suggesting you just call sr_start_vddautocomp() here.

[...]

>>>> +};
>>>> +
>>>> +/*
>>>> + * Smartreflex module enable/disable interface.
>>>> + * NOTE: if smartreflex is not enabled from sysfs, these functions will not
>>>> + * do anything.
>>>> + */
>>>> +void omap_smartreflex_enable(struct voltagedomain *voltdm);
>>>> +void omap_smartreflex_disable(struct voltagedomain *voltdm);
>>>> +void omap_smartreflex_disable_reset_volt(struct voltagedomain *voltdm);
>>>> +
>>>> +/* 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_configure_errgen(struct voltagedomain *voltdm);
>>>> +int sr_configure_minmax(struct voltagedomain *voltdm);
>>>> +
>>>> +/* API to register the smartreflex class driver with the smartreflex driver */
>>>> +int omap_sr_register_class(struct omap_smartreflex_class_data *class_data);
>>>> +
>>>> +/* API to register the pmic specific data with the smartreflex driver. */
>>>> +void omap_sr_register_pmic(struct omap_smartreflex_pmic_data *pmic_data);
>>>> +#else
>>>> +static inline void omap_smartreflex_enable(struct voltagedomain *voltdm) {}
>>>> +static inline void omap_smartreflex_disable(struct voltagedomain *voltdm) {}
>>>> +static inline void omap_smartreflex_disable_reset_volt(
>>>> +           struct voltagedomain *voltdm) {}
>>>> +static inline void omap_sr_register_pmic(
>>>> +           struct omap_smartreflex_pmic_data *pmic_data) {}
>>>> +#endif
>>>> +#endif
>>>
>>>These function names could all be unified a bit better.  Some are
>>>'omap_smartreflex_', some are 'sr_' and some are 'omap_sr'.
>>>
>>>How about using 'omap_sr' for all the public functions.
>
> Yes sr_ are the APIs that will be called from smartreflex class driver
> and omap_smartreflex are the ones that will be called from rest of the code.
> I can change omap_smartreflex_ ones to omap_sr.

OK.

Kevin

  reply	other threads:[~2010-09-14 17:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 13:47 [PATCHv2 0/8] OMAP3: Adding Smartreflex and Voltage driver support Thara Gopinath
2010-08-13 13:47 ` [PATCHv2 1/8] OMAP: PM: Allowing an early init of pm debugfs driver Thara Gopinath
2010-08-24 22:16   ` Kevin Hilman
2010-08-24 22:21     ` Kevin Hilman
2010-09-14 14:56       ` Gopinath, Thara
2010-08-13 13:47 ` [PATCHv2 2/8] OMAP3: PM: Adding voltage driver support for OMAP3 Thara Gopinath
2010-08-25  0:01   ` Kevin Hilman
2010-09-14 15:32     ` Gopinath, Thara
2010-08-30 23:06   ` Kevin Hilman
2010-08-30 23:21   ` Kevin Hilman
2010-08-13 13:47 ` [PATCHv2 3/8] OMAP3: PM: Adding smartreflex driver support Thara Gopinath
2010-08-25 22:21   ` Kevin Hilman
2010-09-14 15:58     ` Gopinath, Thara
2010-09-14 17:04       ` Kevin Hilman [this message]
2010-08-13 13:47 ` [PATCHv2 4/8] OMAP3: PM: Adding smartreflex device file Thara Gopinath
2010-08-25 22:26   ` Kevin Hilman
2010-09-14 15:36     ` Gopinath, Thara
2010-09-14 16:03       ` Kevin Hilman
2010-09-15  6:12         ` Gopinath, Thara
2010-08-13 13:47 ` [PATCHv2 5/8] OMAP3: PM: Adding smartreflex hwmod data Thara Gopinath
2010-08-25 22:29   ` Kevin Hilman
2010-08-13 13:47 ` [PATCHv2 6/8] OMAP3: PM: Adding smartreflex class3 driver Thara Gopinath
2010-08-25 22:31   ` Kevin Hilman
2010-09-14 15:58     ` Gopinath, Thara
2010-08-13 13:47 ` [PATCHv2 7/8] OMAP3: PM: Adding T2 enabling of smartreflex support Thara Gopinath
2010-08-13 13:47 ` [PATCHv2 8/8] OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers Thara Gopinath
2010-08-24 23:53   ` Kevin Hilman
2010-09-14 14:58     ` Gopinath, Thara
2010-09-14 16:05       ` 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=874odss1di.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=b-cousson@ti.com \
    --cc=dderrick@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --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.