devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Doug Anderson <dianders@chromium.org>
Cc: caesar <caesar.wang@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Eddie Cai" <cf@rock-chips.com>,
	"Tao Huang" <huangtao@rock-chips.com>,
	"Jianqun Xu" <xjq@rock-chips.com>,
	"Addy Ke" <addy.ke@rock-chips.com>, 陈渐飞 <cjf@rock-chips.com>,
	"han jiang" <hj@rock-chips.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	linux-pwm <linux-pwm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] pwm: rockchip: Added to support for RK3288 SoC
Date: Thu, 7 Aug 2014 08:12:57 +0200	[thread overview]
Message-ID: <20140807061255.GA17340@ulmo> (raw)
In-Reply-To: <CAD=FV=Wuj2_q+iW2EAj7w8TvgS=C2juSu+h_iG24NvPk4UqhKQ@mail.gmail.com>

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

On Wed, Aug 06, 2014 at 08:26:51PM -0700, Doug Anderson wrote:
> caesar,
> 
> On Wed, Aug 6, 2014 at 8:23 PM, caesar <caesar.wang@rock-chips.com> wrote:
> >
> > 在 2014年08月07日 10:16, Doug Anderson 写道:
> >
> >> Caesar,
> >>
> >> On Wed, Aug 6, 2014 at 6:27 PM, caesar <caesar.wang@rock-chips.com> wrote:
> >>>
> >>> Doug,
> >>>
> >>> 在 2014年08月07日 06:46, Doug Anderson 写道:
> >>>
> >>>> Caesar,
> >>>>
> >>>> On Thu, Jul 24, 2014 at 3:21 AM, Caesar Wang
> >>>> <caesar.wang@rock-chips.com>
> >>>> wrote:
> >>>>>
> >>>>> +static const struct rockchip_pwm_data pwm_data_v1 = {
> >>>>> +       .regs.duty = PWM_HRC,
> >>>>> +       .regs.period = PWM_LRC,
> >>>>> +       .regs.cntr = PWM_CNTR,
> >>>>> +       .regs.ctrl = PWM_CTRL,
> >>>>> +       .prescaler = PRESCALER,
> >>>>> +       .set_enable = rockchip_pwm_set_enable_v1,
> >>>>> +};
> >>>>> +
> >>>>> +static const struct rockchip_pwm_data pwm_data_v2 = {
> >>>>> +       .regs.duty = PWM_LRC,
> >>>>> +       .regs.period = PWM_HRC,
> >>>>> +       .regs.cntr = PWM_CNTR,
> >>>>> +       .regs.ctrl = PWM_CTRL,
> >>>>> +       .prescaler = PRESCALER-1,
> >>>>> +       .set_enable = rockchip_pwm_set_enable_v2,
> >>>>> +};
> >>>>> +
> >>>>> +static const struct rockchip_pwm_data pwm_data_vop = {
> >>>>> +       .regs.duty = PWM_LRC,
> >>>>> +       .regs.period = PWM_HRC,
> >>>>> +       .regs.cntr = PWM_CTRL,
> >>>>> +       .regs.ctrl = PWM_CNTR,
> >>>>
> >>>> Did you really mean to flip CTRL and CNTR here?  If so, that's super
> >>>> confusing and deserves a comment.  AKA, I think the above should not
> >>>> be:
> >>>>
> >>>>    +       .regs.cntr = PWM_CTRL,
> >>>>    +       .regs.ctrl = PWM_CNTR,
> >>>>
> >>>> ...but should be
> >>>>
> >>>>    +       .regs.cntr = PWM_CNTR,
> >>>>    +       .regs.ctrl = PWM_CTRL,
> >>>>
> >>>> If you didn't mean to flip CTRL and CNTR here, then just get rid of
> >>>> pwm_data_vop and refer to pwm_data_v2.  In fact, I'd suggest that you
> >>>> totally remove the "rockchip,vop-pwm" since there's nothing different
> >>>> between "rockchip,rk3288-pwm" and "rockchip,vop-pwm".
> >>>
> >>>
> >>> Sorry,I think it's no problem. the  "rockchip,rk3288-pwm" and
> >>> "rockchip,vop-pwm" are seperate PWM controllers.
> >>> They are just different registers address between CNTR and CTRL .
> >>
> >> OK, I looked up in the TRM.  Right, the CNTR and CTRL are flipped on
> >> the vop.  So I think that the only change you need is to add:
> >>
> >> #define PWM_VOP_CTRL  0x00
> >> #define PWM_VOP_CNTR  0x0c
> >>
> >> ...then use these new #defines for the vop structure.
> >>
> >>
> >> As you have the code written right now it's very confusing.  The new
> >> #defines will fix this.
> >>
> > yeah, I think they can be used in the same context.
> >
> > I will fix it in patch v5 if it is really need.
> 
> I think you should fix this, but if Thierry doesn't think so then it's
> really his decision.

Frankly, I'm fine if these don't use symbolic names at all since only
the structure fields are used to refer to them now.

Thierry

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

  parent reply	other threads:[~2014-08-07  6:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 10:21 [PATCH v4 0/2] This series adds support for RK3288 SoC integrated PWM Caesar Wang
2014-07-24 10:21 ` [PATCH v4 1/2] pwm: rockchip: document RK3288 SoC compatible Caesar Wang
2014-07-24 10:21 ` [PATCH v4 2/2] pwm: rockchip: Added to support for RK3288 SoC Caesar Wang
2014-08-06 22:46   ` Doug Anderson
2014-08-07  1:27     ` caesar
2014-08-07  2:16       ` Doug Anderson
2014-08-07  3:23         ` caesar
2014-08-07  3:26           ` Doug Anderson
2014-08-07  3:37             ` caesar
2014-08-07  3:46               ` Doug Anderson
2014-08-07  4:05                 ` caesar
2014-08-07  6:12             ` Thierry Reding [this message]
2014-08-07  6:18   ` Thierry Reding
2014-08-07 13:04     ` caesar
2014-08-07 13:14       ` Thierry Reding
2014-08-07 13:55         ` caesar

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=20140807061255.GA17340@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=addy.ke@rock-chips.com \
    --cc=b.galvani@gmail.com \
    --cc=caesar.wang@rock-chips.com \
    --cc=cf@rock-chips.com \
    --cc=cjf@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=galak@codeaurora.org \
    --cc=heiko@sntech.de \
    --cc=hj@rock-chips.com \
    --cc=huangtao@rock-chips.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=xjq@rock-chips.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 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).