Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500956

Re: [linux-sunxi] [PATCH 2/5] pwm: sun4i: Add support for PWM controller on sun6i SoCs

From Maxime Ripard <maxime.ripard@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [linux-sunxi] [PATCH 2/5] pwm: sun4i: Add support for PWM controller on sun6i SoCs
Date 2016-10-14 15:10 +0200
Message-ID <ssapj-1FC-9@gated-at.bofh.it> (permalink)
References <srmiS-1dk-21@gated-at.bofh.it> <srmiS-1dk-23@gated-at.bofh.it> <srmiS-1dk-19@gated-at.bofh.it> <ssapj-1FC-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

On Wed, Oct 12, 2016 at 04:10:03PM +0800, Icenowy Zheng wrote:
> > On Wed, Oct 12, 2016 at 12:20 PM, Icenowy Zheng <icenowy@aosc.xyz> wrote:
> > > The PWM controller in A31 is different with other Allwinner SoCs, with
> > > a control register per channel (in other SoCs the control register is
> > > shared), and each channel are allocated 16 bytes of address (but only 8
> > > bytes are used.). The register map in one channel is just like a
> > > single-channel A10 PWM controller, however, A31 have a different
> > > prescaler table than other SoCs.
> > > 
> > > In order to use the driver for all 4 channels, device nodes should be
> > > created per channel.
> > 
> > I think Maxime wants you to support the different register offsets
> > in this driver, and have all 4 channels in the same device (node).
> 
> I think that will make the code much more complex...  And in
> hardware there may also be 4 controllers... as the register is
> aligned at 0x10.

You also have to think about it the other way around. This is exposed
everywhere as a single device. There may be some undocumented
registers hidden somewhere in the memory space of that device. How
would you deal with that without touching the device tree?

Exposing this as a single device is the best solution both from the
philosophical point of view, but also from a maintainance aspect.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [linux-sunxi] [PATCH 2/5] pwm: sun4i: Add support for PWM  controller on sun6i SoCs Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-14 15:10 +0200
  Re: [linux-sunxi] [PATCH 2/5] pwm: sun4i: Add support for PWM  controller on sun6i SoCs Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-17 22:20 +0200

csiph-web