From: Marek Vasut <marex@denx.de>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org,
devicetree@vger.kernel.org, Rob Herring <rob.herring@calxeda.com>,
Thierry Reding <thierry.reding@gmail.com>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Robert Jarzmik <robert.jarzmik@free.fr>
Subject: Re: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Thu, 5 Sep 2013 17:34:40 +0200 [thread overview]
Message-ID: <201309051734.40570.marex@denx.de> (raw)
In-Reply-To: <5228A238.2090202@newsguy.com>
Dear Mike Dunn,
> On 09/04/2013 03:11 PM, Marek Vasut wrote:
>
>
> [...]
>
> >>> What's that "secondary PWM" there? I no longer remember, sorry.
> >>
> >> If pdev->id_entry->driver_data == HAS_SECONDARY_PWM, then
> >> pwm_chip->npwm=2 when pwmchip_add() is called. Otherwise
> >> pwm_chip->npwm=1. The driver knows that the second pwm's registers are
> >> at a fixed offset from the first. For compatibility, the pxa27x maps
> >> the registers for the third pwm at a distant offset, and makes the
> >> offset between 3 and 4 the same as between 1 and 2. Yes, the driver
> >> mkes this unnecessarily complicated. There should just be one device
> >> instance per pwm, and dispense with the whole driver_data thing. I
> >> guess there's some history there.
> >
> > OK, I checked the datasheet. The register block for PWM<n + 2> is at
> > offset of 0x10 from PWM<n> , for n in {0, 1} .
> >
> > Why can we not just register four PWM blocks, each with 0x10 register
> > window size then? I know there's history (maybe), but then, with DT,
> > this might go away.
>
> Indeed. That is what I am also thinking.
>
> >>> The question
> >>> remains still, we can have two entries there (pxa25x and pxa27x) ORR
> >>> have one entry (pxa25x) + mrvl,has-secondary-pwm entry.
> >>
> >> It looks like defining "compatible" properties that mirror the old
> >> platform_device_id names won't fly...
> >
> > Yes of course, this won't work. I didn't know the layout exactly.
> >
> >> wildcards are verboten (see Sergei's
> >> comment). So your inclination to use one value for the "compatible"
> >> property is correct. I think the way to go is to forget the whole
> >> HAS_SECONDARY_PWM in the DT case, have one device instance per pwm, and
> >> use "compatible=marvell,pwm". Other suggestions welcome.
> >
> > compatbile=marvell,pxa25x-pwm , no ? The lowest CPU with the block.
>
> Unless I am missing something, the compatible string does not need to
> replicate any of the existing platform_device_id names, so wouldn't
> "marvell,pxa" be better? Except for register mapping and the number of
> units present on a particular pxa variant, the peripheral is software
> compatible across all pxa processors. Plus there is the problem of the
> 'x' wildcard in "pxa25x-pwm".
So use pxa250 ?
My concern is once marvell comes up with PXA1048576 which will have a different
PWM unit, then what will be the name for this new one?
Best regards,
Marek Vasut
WARNING: multiple messages have this Message-ID (diff)
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Thu, 5 Sep 2013 17:34:40 +0200 [thread overview]
Message-ID: <201309051734.40570.marex@denx.de> (raw)
In-Reply-To: <5228A238.2090202@newsguy.com>
Dear Mike Dunn,
> On 09/04/2013 03:11 PM, Marek Vasut wrote:
>
>
> [...]
>
> >>> What's that "secondary PWM" there? I no longer remember, sorry.
> >>
> >> If pdev->id_entry->driver_data == HAS_SECONDARY_PWM, then
> >> pwm_chip->npwm=2 when pwmchip_add() is called. Otherwise
> >> pwm_chip->npwm=1. The driver knows that the second pwm's registers are
> >> at a fixed offset from the first. For compatibility, the pxa27x maps
> >> the registers for the third pwm at a distant offset, and makes the
> >> offset between 3 and 4 the same as between 1 and 2. Yes, the driver
> >> mkes this unnecessarily complicated. There should just be one device
> >> instance per pwm, and dispense with the whole driver_data thing. I
> >> guess there's some history there.
> >
> > OK, I checked the datasheet. The register block for PWM<n + 2> is at
> > offset of 0x10 from PWM<n> , for n in {0, 1} .
> >
> > Why can we not just register four PWM blocks, each with 0x10 register
> > window size then? I know there's history (maybe), but then, with DT,
> > this might go away.
>
> Indeed. That is what I am also thinking.
>
> >>> The question
> >>> remains still, we can have two entries there (pxa25x and pxa27x) ORR
> >>> have one entry (pxa25x) + mrvl,has-secondary-pwm entry.
> >>
> >> It looks like defining "compatible" properties that mirror the old
> >> platform_device_id names won't fly...
> >
> > Yes of course, this won't work. I didn't know the layout exactly.
> >
> >> wildcards are verboten (see Sergei's
> >> comment). So your inclination to use one value for the "compatible"
> >> property is correct. I think the way to go is to forget the whole
> >> HAS_SECONDARY_PWM in the DT case, have one device instance per pwm, and
> >> use "compatible=marvell,pwm". Other suggestions welcome.
> >
> > compatbile=marvell,pxa25x-pwm , no ? The lowest CPU with the block.
>
> Unless I am missing something, the compatible string does not need to
> replicate any of the existing platform_device_id names, so wouldn't
> "marvell,pxa" be better? Except for register mapping and the number of
> units present on a particular pxa variant, the peripheral is software
> compatible across all pxa processors. Plus there is the problem of the
> 'x' wildcard in "pxa25x-pwm".
So use pxa250 ?
My concern is once marvell comes up with PXA1048576 which will have a different
PWM unit, then what will be the name for this new one?
Best regards,
Marek Vasut
WARNING: multiple messages have this Message-ID (diff)
From: Marek Vasut <marex@denx.de>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Thierry Reding <thierry.reding@gmail.com>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Robert Jarzmik <robert.jarzmik@free.fr>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] pwm: pxa: add device tree support to pwm driver
Date: Thu, 5 Sep 2013 17:34:40 +0200 [thread overview]
Message-ID: <201309051734.40570.marex@denx.de> (raw)
In-Reply-To: <5228A238.2090202@newsguy.com>
Dear Mike Dunn,
> On 09/04/2013 03:11 PM, Marek Vasut wrote:
>
>
> [...]
>
> >>> What's that "secondary PWM" there? I no longer remember, sorry.
> >>
> >> If pdev->id_entry->driver_data == HAS_SECONDARY_PWM, then
> >> pwm_chip->npwm=2 when pwmchip_add() is called. Otherwise
> >> pwm_chip->npwm=1. The driver knows that the second pwm's registers are
> >> at a fixed offset from the first. For compatibility, the pxa27x maps
> >> the registers for the third pwm at a distant offset, and makes the
> >> offset between 3 and 4 the same as between 1 and 2. Yes, the driver
> >> mkes this unnecessarily complicated. There should just be one device
> >> instance per pwm, and dispense with the whole driver_data thing. I
> >> guess there's some history there.
> >
> > OK, I checked the datasheet. The register block for PWM<n + 2> is at
> > offset of 0x10 from PWM<n> , for n in {0, 1} .
> >
> > Why can we not just register four PWM blocks, each with 0x10 register
> > window size then? I know there's history (maybe), but then, with DT,
> > this might go away.
>
> Indeed. That is what I am also thinking.
>
> >>> The question
> >>> remains still, we can have two entries there (pxa25x and pxa27x) ORR
> >>> have one entry (pxa25x) + mrvl,has-secondary-pwm entry.
> >>
> >> It looks like defining "compatible" properties that mirror the old
> >> platform_device_id names won't fly...
> >
> > Yes of course, this won't work. I didn't know the layout exactly.
> >
> >> wildcards are verboten (see Sergei's
> >> comment). So your inclination to use one value for the "compatible"
> >> property is correct. I think the way to go is to forget the whole
> >> HAS_SECONDARY_PWM in the DT case, have one device instance per pwm, and
> >> use "compatible=marvell,pwm". Other suggestions welcome.
> >
> > compatbile=marvell,pxa25x-pwm , no ? The lowest CPU with the block.
>
> Unless I am missing something, the compatible string does not need to
> replicate any of the existing platform_device_id names, so wouldn't
> "marvell,pxa" be better? Except for register mapping and the number of
> units present on a particular pxa variant, the peripheral is software
> compatible across all pxa processors. Plus there is the problem of the
> 'x' wildcard in "pxa25x-pwm".
So use pxa250 ?
My concern is once marvell comes up with PXA1048576 which will have a different
PWM unit, then what will be the name for this new one?
Best regards,
Marek Vasut
next prev parent reply other threads:[~2013-09-05 15:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 19:23 [PATCH] pwm: pxa: add device tree support to pwm driver Mike Dunn
2013-09-03 19:23 ` Mike Dunn
2013-09-03 19:23 ` Mike Dunn
2013-09-03 22:20 ` Marek Vasut
2013-09-03 22:20 ` Marek Vasut
2013-09-03 22:20 ` Marek Vasut
2013-09-04 14:23 ` Mike Dunn
2013-09-04 14:23 ` Mike Dunn
2013-09-04 14:23 ` Mike Dunn
2013-09-04 14:35 ` Marek Vasut
2013-09-04 14:35 ` Marek Vasut
2013-09-04 14:35 ` Marek Vasut
2013-09-04 15:41 ` Mike Dunn
2013-09-04 15:41 ` Mike Dunn
2013-09-04 15:41 ` Mike Dunn
2013-09-04 22:11 ` Marek Vasut
2013-09-04 22:11 ` Marek Vasut
2013-09-04 22:11 ` Marek Vasut
2013-09-05 15:24 ` Mike Dunn
2013-09-05 15:24 ` Mike Dunn
2013-09-05 15:24 ` Mike Dunn
2013-09-05 15:34 ` Marek Vasut [this message]
2013-09-05 15:34 ` Marek Vasut
2013-09-05 15:34 ` Marek Vasut
2013-09-05 16:07 ` Mike Dunn
2013-09-05 16:07 ` Mike Dunn
2013-09-05 16:07 ` Mike Dunn
2013-09-04 14:38 ` Sergei Shtylyov
2013-09-04 14:38 ` Sergei Shtylyov
2013-09-04 15:44 ` Mike Dunn
2013-09-04 15:44 ` Mike Dunn
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=201309051734.40570.marex@denx.de \
--to=marex@denx.de \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=haojian.zhuang@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mikedunn@newsguy.com \
--cc=rob.herring@calxeda.com \
--cc=robert.jarzmik@free.fr \
--cc=thierry.reding@gmail.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.