From: Thierry Reding <thierry.reding@gmail.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Bart Tanghe <bart.tanghe@thomasmore.be>,
tim.kryger@linaro.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org
Subject: Re: [resend rfc v3] pwm: add BCM2835 PWM driver
Date: Fri, 26 Sep 2014 09:11:10 +0200 [thread overview]
Message-ID: <20140926071109.GA31106@ulmo> (raw)
In-Reply-To: <54088008.9080200@wwwdotorg.org>
[-- Attachment #1: Type: text/plain, Size: 3693 bytes --]
On Thu, Sep 04, 2014 at 09:06:48AM -0600, Stephen Warren wrote:
> On 09/04/2014 04:05 AM, Bart Tanghe wrote:
> >No problem. Thanks for the feedback.
> >I've got some question below.
> >
> >On 2014-08-25 15:19, Thierry Reding wrote:
> >>Sorry for taking so long to reply to this, I had completely forgotten.
> >>
> >>On Mon, Apr 28, 2014 at 02:54:46PM +0200, Bart Tanghe wrote:
> >>> Add some better error handling and Device table support
> >>> Added Documentation/devicetree/bindings/pwm/pwm-bcm2835.txt
> >>>
> >>>Signed-off-by: Bart Tanghe <bart.tanghe@thomasmore.be>
>
> >>>diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> >>>index 22f2f28..20341a3 100644
> >>>--- a/drivers/pwm/Kconfig
> >>>+++ b/drivers/pwm/Kconfig
> >>>@@ -62,6 +62,18 @@ config PWM_ATMEL_TCB
> >>> To compile this driver as a module, choose M here: the module
> >>> will be called pwm-atmel-tcb.
> >>>
> >>>+config PWM_BCM2835
> >>>+ tristate "BCM2835 PWM support"
> >>>+ depends on MACH_BCM2835 || MACH_BCM2708
> >>>+ help
> >>>+ PWM framework driver for BCM2835 controller (raspberry pi)
> >>
> >>I think the correct capitalization would be "Raspberry Pi".
> >>
> >>>+ Only 1 channel is implemented.
> >>
> >>How many can it take? Why haven't all been implemented?
> >
> >BCM2835 can take 2 pwm channels.
> >I can implement 2 channels but can't physically test the second channel. Is that a problem?
>
> I don't think that's a problem; I would expect the channels to be identical,
> so testing 1 should be fine.
Agreed. If it turns out not to work it can always be fixed.
> >>I notice that you never prepare or enable the clock here. Perhaps this
> >>isn't required because it's always on, but I think you should still call
> >>clk_prepare_enable() here (and clk_disable_unprepare() in .remove()) to
> >>make sure the driver is more portable.
> >The frequency can be minimized by a clock_divider ( the pwm clock is default disabled). this has to be done by
> >a clock driver, as mentioned in a previous comment by Stephen Warren.
> >
> >Any clock programming should be performed by a clock driver. We don't
> >have one of those upstream yet, mainly because it would rely on talking
> >to the firmware (running on the VideoCore) to manipulate the clocks, and
> >we don't have a firmware protocol driver either.
> >
> >Nowadays, I'm using a userspace program to change the clock_divider, but would like to implement this in a clock driver.
> >The clock hardware description isn't implemented in the datasheet. I can convert the userspace prog to a clock driver but this is very experimental.
> >If anyone has some suggestions?
>
> Oh dear. It sounds like we need at least some form of clock driver for the
> platform then. I still don't think there's complete documentation for the
> HW, even though a lot of register docs were published which presumably cover
> the clock HW? Equally, given that the VC firmware assumes it owns most of
> the HW, it seems best to manipulate the clocks through the firmware
> interface rather than directly touching the HW. Unfortunately, I don't
> believe there's any ABI guarantee on the firmware interface. Perhaps we can
> get one?
Urgs... this VC firmware seems to be more of a headache that I thought
it was. How is this handled in other drivers? Surely PWM isn't the first
one that needs clocks?
> >>>+static const struct of_device_id bcm2835_pwm_of_match[] = {
> >>>+ { .compatible = "bcrm,pwm-bcm2835", },
> >>
> >>s/bcrm/brcm/
>
> Probably swap the order, so "brcm,bcm2835-pwm". That would be consistent
> with all the other HW on this SoC.
Yes, please.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-09-26 7:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 12:54 [resend rfc v3] pwm: add BCM2835 PWM driver Bart Tanghe
2014-08-25 13:19 ` Thierry Reding
2014-09-04 10:05 ` Bart Tanghe
2014-09-04 15:06 ` Stephen Warren
2014-09-26 7:11 ` Thierry Reding [this message]
2014-09-26 10:06 ` Bart Tanghe
2014-09-26 14:45 ` Stephen Warren
2014-09-29 5:33 ` Thierry Reding
2014-09-29 13:37 ` Bart Tanghe
2014-09-29 14:18 ` Thierry Reding
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=20140926071109.GA31106@ulmo \
--to=thierry.reding@gmail.com \
--cc=bart.tanghe@thomasmore.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=swarren@wwwdotorg.org \
--cc=tim.kryger@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).