All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: Paul Walmsley <paul@pwsan.com>,
	"Franklin S Cooper Jr." <fcooper@ti.com>,
	"Kristo, Tero" <t-kristo@ti.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Benoit Cousson <bcousson@baylibre.com>,
	Tony Lindgren <tony@atomide.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Linux PWM List <linux-pwm@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Vignesh R <vigneshr@ti.com>
Subject: Re: [PATCH v5 1/6] pwms: pwm-ti*: Get the clock from the PWMSS (parent)
Date: Tue, 12 Apr 2016 13:40:44 +0530	[thread overview]
Message-ID: <570CAD84.2090701@ti.com> (raw)
In-Reply-To: <CAL_JsqLkpQzVb6bzpsH5NwfLLWEtf3o6LezrL1hCejsw65J=Bw@mail.gmail.com>

On Monday 11 April 2016 06:15 PM, Rob Herring wrote:
> On Mon, Apr 11, 2016 at 6:49 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> On Monday 11 April 2016 02:21 AM, Paul Walmsley wrote:
>>> On Tue, 5 Apr 2016, Franklin S Cooper Jr. wrote:
>>>> On 04/05/2016 01:08 AM, Sekhar Nori wrote:
>>>>> On Tuesday 08 March 2016 06:53 AM, Franklin S Cooper Jr wrote:
>>>>>> The eCAP and ePWM doesn't have their own separate clocks. They simply
>>>>>> utilize the clock provided directly by the PWMSS. Therefore, they simply
>>>>>> need to grab a reference to their parent's clock.
>>>>>>
>>>>>> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
>>>>>
>>>>> So this assumes that eCAP and eHRPWM are always under the PWMSS
>>>>> umbrella. But on TI AM18x, thats not true. These IPs exist independently
>>>>> and receive functional clock from PLL sysclk outputs.
>>>>>
>>>>>> ---
>>>>>>  drivers/pwm/pwm-tiecap.c   | 2 +-
>>>>>>  drivers/pwm/pwm-tiehrpwm.c | 2 +-
>>>>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c
>>>>>> index 616af76..9418159 100644
>>>>>> --- a/drivers/pwm/pwm-tiecap.c
>>>>>> +++ b/drivers/pwm/pwm-tiecap.c
>>>>>> @@ -212,7 +212,7 @@ static int ecap_pwm_probe(struct platform_device *pdev)
>>>>>>      if (!pc)
>>>>>>          return -ENOMEM;
>>>>>>
>>>>>> -    clk = devm_clk_get(&pdev->dev, "fck");
>>>>>> +    clk = devm_clk_get(pdev->dev.parent, "fck");
>>>>>
>>>>> Even keeping the AM18x usecase aside, this seems to be pushing too much
>>>>> platform information into the driver. The "fck" is a valid connection id
>>>>> for the eCAP IP. Whether its valid for the parent device too is not
>>>>> something this driver should need to know.
>>>>>
>>>>> So it looks like what you need is for the clock hierarchy for the
>>>>> platform to have clocks for eHRPWM and eCAP derived out of PWMSS clock?
>>>>
>>>> So I believe this is a question on if we want to hide the minor
>>>> delta between AM18 vs AM335x, AM437x and AM57x/DRA7 in the driver
>>>> or within the DT.
>>>>
>>>> Note that handling this by defining new clocks in DT will then
>>>> result in older DTBs not working. I don't think its worth breaking
>>>> backwards compatibility for AM335x and AM437x DTBs for fixing support
>>>> for AM18 based SOCs. Especially since those SOCs haven't worked with
>>>> this driver for several years. By handling things within the driver rather
>>>> than DT we can atleast insure that we can get everything working while
>>>> avoiding breaking backwards compatibility.
>>>
>>> I agree with Sekhar that we shouldn't embed this parent clock quirk
>>> into the driver.
>>>
>>> Can you just define a new compatibility string such that the driver can be
>>> written with no embedded integration quirks?  Then add a workaround in the
>>> driver that will use pdev->dev.parent for the old (deprecated)
>>> compatibility string and log a warning to the kernel console that the DT
>>> needs to be updated.
>>
>> Thanks Paul! Although not sure if adding a new compatible for the IP is
>> the best way (since that would denote a different version of the IP).
>> How about checking for parent clock iff clk_get() on own device fails
>> and of_machine_is_compatible() matches the platforms where backward
>> compatibility needs to be maintained?
> 
> New compatible strings are acceptable.

Alright, thanks for clarifying that.

Regards,
Sekhar

WARNING: multiple messages have this Message-ID (diff)
From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/6] pwms: pwm-ti*: Get the clock from the PWMSS (parent)
Date: Tue, 12 Apr 2016 13:40:44 +0530	[thread overview]
Message-ID: <570CAD84.2090701@ti.com> (raw)
In-Reply-To: <CAL_JsqLkpQzVb6bzpsH5NwfLLWEtf3o6LezrL1hCejsw65J=Bw@mail.gmail.com>

On Monday 11 April 2016 06:15 PM, Rob Herring wrote:
> On Mon, Apr 11, 2016 at 6:49 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> On Monday 11 April 2016 02:21 AM, Paul Walmsley wrote:
>>> On Tue, 5 Apr 2016, Franklin S Cooper Jr. wrote:
>>>> On 04/05/2016 01:08 AM, Sekhar Nori wrote:
>>>>> On Tuesday 08 March 2016 06:53 AM, Franklin S Cooper Jr wrote:
>>>>>> The eCAP and ePWM doesn't have their own separate clocks. They simply
>>>>>> utilize the clock provided directly by the PWMSS. Therefore, they simply
>>>>>> need to grab a reference to their parent's clock.
>>>>>>
>>>>>> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
>>>>>
>>>>> So this assumes that eCAP and eHRPWM are always under the PWMSS
>>>>> umbrella. But on TI AM18x, thats not true. These IPs exist independently
>>>>> and receive functional clock from PLL sysclk outputs.
>>>>>
>>>>>> ---
>>>>>>  drivers/pwm/pwm-tiecap.c   | 2 +-
>>>>>>  drivers/pwm/pwm-tiehrpwm.c | 2 +-
>>>>>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c
>>>>>> index 616af76..9418159 100644
>>>>>> --- a/drivers/pwm/pwm-tiecap.c
>>>>>> +++ b/drivers/pwm/pwm-tiecap.c
>>>>>> @@ -212,7 +212,7 @@ static int ecap_pwm_probe(struct platform_device *pdev)
>>>>>>      if (!pc)
>>>>>>          return -ENOMEM;
>>>>>>
>>>>>> -    clk = devm_clk_get(&pdev->dev, "fck");
>>>>>> +    clk = devm_clk_get(pdev->dev.parent, "fck");
>>>>>
>>>>> Even keeping the AM18x usecase aside, this seems to be pushing too much
>>>>> platform information into the driver. The "fck" is a valid connection id
>>>>> for the eCAP IP. Whether its valid for the parent device too is not
>>>>> something this driver should need to know.
>>>>>
>>>>> So it looks like what you need is for the clock hierarchy for the
>>>>> platform to have clocks for eHRPWM and eCAP derived out of PWMSS clock?
>>>>
>>>> So I believe this is a question on if we want to hide the minor
>>>> delta between AM18 vs AM335x, AM437x and AM57x/DRA7 in the driver
>>>> or within the DT.
>>>>
>>>> Note that handling this by defining new clocks in DT will then
>>>> result in older DTBs not working. I don't think its worth breaking
>>>> backwards compatibility for AM335x and AM437x DTBs for fixing support
>>>> for AM18 based SOCs. Especially since those SOCs haven't worked with
>>>> this driver for several years. By handling things within the driver rather
>>>> than DT we can atleast insure that we can get everything working while
>>>> avoiding breaking backwards compatibility.
>>>
>>> I agree with Sekhar that we shouldn't embed this parent clock quirk
>>> into the driver.
>>>
>>> Can you just define a new compatibility string such that the driver can be
>>> written with no embedded integration quirks?  Then add a workaround in the
>>> driver that will use pdev->dev.parent for the old (deprecated)
>>> compatibility string and log a warning to the kernel console that the DT
>>> needs to be updated.
>>
>> Thanks Paul! Although not sure if adding a new compatible for the IP is
>> the best way (since that would denote a different version of the IP).
>> How about checking for parent clock iff clk_get() on own device fails
>> and of_machine_is_compatible() matches the platforms where backward
>> compatibility needs to be maintained?
> 
> New compatible strings are acceptable.

Alright, thanks for clarifying that.

Regards,
Sekhar

  reply	other threads:[~2016-04-12  8:10 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  1:23 [PATCH v5 0/6] ARM: am335x/am437x/dra7: Add PWM support for DRA7 Franklin S Cooper Jr
2016-03-08  1:23 ` Franklin S Cooper Jr
2016-03-08  1:23 ` [PATCH v5 1/6] pwms: pwm-ti*: Get the clock from the PWMSS (parent) Franklin S Cooper Jr
2016-03-08  1:23   ` Franklin S Cooper Jr
2016-03-17 22:37   ` Franklin S Cooper Jr.
2016-03-17 22:37     ` Franklin S Cooper Jr.
2016-03-17 22:37     ` Franklin S Cooper Jr.
2016-04-05  6:08   ` Sekhar Nori
2016-04-05  6:08     ` Sekhar Nori
2016-04-05  6:08     ` Sekhar Nori
2016-04-05 11:25     ` Franklin S Cooper Jr.
2016-04-05 11:25       ` Franklin S Cooper Jr.
2016-04-05 11:25       ` Franklin S Cooper Jr.
     [not found]       ` <5703A0C4.6010406-l0cyMroinI0@public.gmane.org>
2016-04-10 20:51         ` Paul Walmsley
2016-04-10 20:51           ` Paul Walmsley
2016-04-10 20:51           ` Paul Walmsley
     [not found]           ` <alpine.DEB.2.02.1604102048380.11457-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2016-04-11 11:49             ` Sekhar Nori
2016-04-11 11:49               ` Sekhar Nori
2016-04-11 11:49               ` Sekhar Nori
2016-04-11 12:45               ` Rob Herring
2016-04-11 12:45                 ` Rob Herring
2016-04-12  8:10                 ` Sekhar Nori [this message]
2016-04-12  8:10                   ` Sekhar Nori
2016-03-08  1:23 ` [PATCH v5 3/6] ARM: AM335x/AM437x: hwmod: Remove eQEP, ePWM and eCAP hwmod entries Franklin S Cooper Jr
2016-03-08  1:23   ` Franklin S Cooper Jr
     [not found]   ` <1457400224-24797-4-git-send-email-fcooper-l0cyMroinI0@public.gmane.org>
2016-03-17 15:06     ` Rob Herring
2016-03-17 15:06       ` Rob Herring
2016-03-17 15:06       ` Rob Herring
2016-03-17 15:45       ` Franklin S Cooper Jr.
2016-03-17 15:45         ` Franklin S Cooper Jr.
2016-03-17 15:45         ` Franklin S Cooper Jr.
2016-03-17 19:04         ` Rob Herring
2016-03-17 19:04           ` Rob Herring
2016-03-08  1:23 ` [PATCH v5 4/6] ARM: OMAP2+: DRA7: Add hwmod entries for PWMSS Franklin S Cooper Jr
2016-03-08  1:23   ` Franklin S Cooper Jr
2016-03-08  6:45   ` Paul Walmsley
2016-03-08  6:45     ` Paul Walmsley
2016-04-10 18:57     ` Paul Walmsley
2016-04-10 18:57       ` Paul Walmsley
2016-03-08  1:23 ` [PATCH v5 5/6] ARM: dts: DRA7: Add TBCLK " Franklin S Cooper Jr
2016-03-08  1:23   ` Franklin S Cooper Jr
2016-04-11 20:21   ` Tony Lindgren
2016-04-11 20:21     ` Tony Lindgren
2016-04-11 20:27     ` Tony Lindgren
2016-04-11 20:27       ` Tony Lindgren
2016-03-08  1:23 ` [PATCH v5 6/6] ARM: dts: DRA7: Add dt nodes " Franklin S Cooper Jr
2016-03-08  1:23   ` Franklin S Cooper Jr
     [not found]   ` <1457400224-24797-7-git-send-email-fcooper-l0cyMroinI0@public.gmane.org>
2016-03-17 15:11     ` Rob Herring
2016-03-17 15:11       ` Rob Herring
2016-03-17 15:11       ` Rob Herring
2016-03-17 15:53       ` Franklin S Cooper Jr.
2016-03-17 15:53         ` Franklin S Cooper Jr.
2016-03-17 15:53         ` Franklin S Cooper Jr.
2016-04-11 20:21         ` Tony Lindgren
2016-04-11 20:21           ` Tony Lindgren
2016-04-19 16:20           ` Franklin S Cooper Jr.
2016-04-19 16:20             ` Franklin S Cooper Jr.
2016-04-19 16:20             ` Franklin S Cooper Jr.
     [not found] ` <1457400224-24797-1-git-send-email-fcooper-l0cyMroinI0@public.gmane.org>
2016-03-08  1:23   ` [PATCH v5 2/6] ARM: dts: am437x/am33xx: Remove eCAP and ePWM hwmod properties Franklin S Cooper Jr
2016-03-08  1:23     ` Franklin S Cooper Jr
2016-03-08  1:23     ` Franklin S Cooper Jr
2016-03-08  6:55   ` [PATCH v5 0/6] ARM: am335x/am437x/dra7: Add PWM support for DRA7 Paul Walmsley
2016-03-08  6:55     ` Paul Walmsley
2016-03-08  6:55     ` Paul Walmsley
2016-03-08 17:04     ` Franklin S Cooper Jr.
2016-03-08 17:04       ` Franklin S Cooper Jr.
2016-03-08 17:04       ` Franklin S Cooper Jr.

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=570CAD84.2090701@ti.com \
    --to=nsekhar@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fcooper@ti.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=paul@pwsan.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    --cc=vigneshr@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.