devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Olliver Schinagl <o.schinagl-U3FVU11NWA554TAoqtyWWQ@public.gmane.org>
Cc: Olliver Schinagl <oliver-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Joachim Eastwood
	<manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Alexandre Belloni
	<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Olliver Schinagl
	<oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 08/10] pwm: core: add pulse feature to the PWM framework
Date: Fri, 6 Nov 2015 17:05:47 +0100	[thread overview]
Message-ID: <20151106160547.GF8418@ulmo> (raw)
In-Reply-To: <563CCB6E.2090206-U3FVU11NWA554TAoqtyWWQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2675 bytes --]

On Fri, Nov 06, 2015 at 04:46:54PM +0100, Olliver Schinagl wrote:
> Hey Thierry,
> 
> On 06-11-15 16:18, Thierry Reding wrote:
> >On Mon, Oct 26, 2015 at 10:32:39PM +0100, Olliver Schinagl wrote:
> >>From: Olliver Schinagl <oliver-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
> >>
> >>Some hardware PWM's have the possibility to only send out one (or more)
> >>pulses. This can be quite a useful feature in case one wants or needs
> >>only a single pulse, but at the exact width.
> >>
> >>Additionally, if multiple pulses are possible, outputting a fixed amount
> >>of pulses can be useful for various timing specific purposes.
> >I see how theoretically this would be nice to have. But I'm reluctant to
> >merge this feature if there aren't any users. What drivers in the kernel
> >would want to use this feature? Are there new drivers being worked on
> >that will need this?
> I should have brought this up as to why I added this, I'm working on a
> stepper driver framework (inspired by the pwm framework actually) and
> rotating moters by x degree's you do by sending pulses, using controlled
> pulses (timing wise) you can precisely move stepper motors. Yes we can do
> this reasonably accurate in software, but doing it in hardware is so much
> nicer.

So is this going to be a kernel framework for stepper motors? If you say
you rotate the motors by sending pulses, doesn't that mean that the PWM
framework with pulse support would be enough? Or are there dedicated
stepper chips that you plan to support, with PWM + pulses being the
fallback for when you don't have one of those chips?

> >>* pwm_pulse_done()	an internal function for drivers to call when
> >>			they have completed their pre-configured number
> >>			of pulses
> >>* pwm_is_pulsing()	tells the callers if the pwm is busy pulsing,
> >>			yielding a little more information than just
> >>			pwm_is_enabled()
> >Similarily, I'd think that once the PWM is done executing the series of
> >pulses that it was configured for it would be automatically disabled. A
> >consumer could then simply use pwm_is_enabled() and drivers could call
> >pwm_disable() on their PWM to mark them as disabled when they're done
> >pulsing.
> I agree, pulseating can be dropped too as we know that a) the pulse flag is
> set, b) we are enabled. But I'm not sure now if the flag is exported to
> sysfs, in any case, sysfs should just check the pulseating flag?

Can't you derive that information simply by looking at the enable and
pulses attributes? If enable == 1 and pulses > 0 you know the PWM is
pulsing. If enable == 1 and pulses == 0 you know it's in regular mode.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-11-06 16:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 21:32 [PATCH 00/10] Olliver Schinagl
2015-10-26 21:32 ` [PATCH 01/10] pwm: lpc18xx_pwm: use pwm_set_chip_data Olliver Schinagl
2015-10-26 21:58   ` Ezequiel Garcia
2015-10-27  7:22     ` Olliver Schinagl
2015-10-26 21:32 ` [PATCH 02/10] pwm: sunxi: fix whitespace issue Olliver Schinagl
2015-11-06 16:08   ` Thierry Reding
2015-10-26 21:32 ` [PATCH 03/10] pwm: sunxi: Yield some time to the pwm-block to become ready Olliver Schinagl
2015-11-06 16:12   ` Thierry Reding
2015-11-06 16:34   ` Chen-Yu Tsai
2015-10-26 21:32 ` [PATCH 04/10] pwm: core: use bitops Olliver Schinagl
2015-11-06 14:46   ` Thierry Reding
2015-11-06 14:49     ` Olliver Schinagl
2015-11-06 21:36       ` Andy Shevchenko
2015-10-26 21:32 ` [PATCH 05/10] pwm: sysfs: do not unnecessarily store result in var Olliver Schinagl
2015-11-06 14:51   ` Thierry Reding
2015-10-26 21:32 ` [PATCH 06/10] pwm: sysfs: make use of the DEVICE_ATTR_[RW][WO] macro's Olliver Schinagl
2015-11-06 14:52   ` Thierry Reding
2015-10-26 21:32 ` [PATCH 07/10] pwm: gpio: Add a generic gpio based PWM driver Olliver Schinagl
2015-10-27  7:42   ` Rob Herring
2015-10-27  8:50     ` Olliver Schinagl
2015-11-06 15:57   ` Thierry Reding
2015-10-26 21:32 ` [PATCH 08/10] pwm: core: add pulse feature to the PWM framework Olliver Schinagl
2015-10-26 21:59   ` kbuild test robot
2015-10-26 22:09   ` kbuild test robot
     [not found]   ` <1445895161-2317-9-git-send-email-o.schinagl-U3FVU11NWA554TAoqtyWWQ@public.gmane.org>
2015-10-26 22:10     ` kbuild test robot
2015-10-26 22:11   ` kbuild test robot
2015-10-26 23:06   ` kbuild test robot
2015-11-06 15:18   ` Thierry Reding
2015-11-06 15:46     ` Olliver Schinagl
     [not found]       ` <563CCB6E.2090206-U3FVU11NWA554TAoqtyWWQ@public.gmane.org>
2015-11-06 16:05         ` Thierry Reding [this message]
2015-11-06 16:18           ` Olliver Schinagl
2015-10-26 21:32 ` [PATCH 09/10] pwm: pwm_gpio: add pulse option Olliver Schinagl
2015-10-26 21:32 ` [PATCH 10/10] pwm: sunxi: Add possibility to pulse the sunxi pwm output Olliver Schinagl

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=20151106160547.GF8418@ulmo \
    --to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=o.schinagl-U3FVU11NWA554TAoqtyWWQ@public.gmane.org \
    --cc=oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org \
    --cc=oliver-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).