public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: lost.distance@yahoo.com (Paul Parsons)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: pxa: hx4700: Fix backlight PWM device number
Date: Wed, 26 Sep 2012 11:39:56 +0100	[thread overview]
Message-ID: <5062DB7C.5050203@yahoo.com> (raw)
In-Reply-To: <CA+E=qVfnjQJrrW-5jYzt8yxEH7t3merHzPH2RVAjD0GbcviTgw@mail.gmail.com>

Hello Vasily,

On 26/09/12 07:40, Vasily Khoruzhick wrote:
> On Wed, Sep 26, 2012 at 5:17 AM, Paul Parsons <lost.distance@yahoo.com> wrote:
>> Recent changes to PXA PWM support changed the PXA27X PWM device
>> numbering scheme.
>>
>> The linux-3.5 PXA PWM driver followed the hardware numbering scheme for
>> the 4 PWMs, while the linux-3.6-rc1 PXA PWM driver has adopted a linear
>> numbering scheme:
>>
>> Address         Hardware        3.5 pwm_id      3.6-rc1 pwm_id
>> 0x40b00000      PWM0            0               0
>> 0x40b00010      PWM2            2               1
>> 0x40c00000      PWM1            1               2
>> 0x40c00010      PWM3            3               3
>
> Looks very weird to me. Maybe it would be better to fix pwm numbering
> scheme to prevent breakage of
> other machines?

I thought the same thing. However the code doesn't make it easy:

1. The definition of pwm_id values moved from the pwm_probe() in
arch/arm/plat-pxa/pwm.c to pwmchip_add() in drivers/pwm/core.c.
Changing the latter generic code would impact all of the PWM drivers,
not just the PXA PWM driver.

2. Changing just the PXA PWM driver would require its pwm_ops handlers
(config(), enable(), disable()) to quietly translate between PWM1 and
PWM2 devices. However PWM1 and PWM2 are on different chips (i.e.
pwm_chip structures). So what would the driver do when there is only
one chip? i.e.:
a) Between the first and second calls to pwm_probe().
b) Between the first and second calls to pwm_remove().
And in any case quietly translating between PWM1 and PWM2 just doesn't
seem like a good idea: sooner or later it will quietly break the
generic code.

On balance it seemed preferable to change the platform code.

Regards,
Paul

  reply	other threads:[~2012-09-26 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5062652A.8070603@yahoo.com>
2012-09-26  2:17 ` [PATCH] ARM: pxa: hx4700: Fix backlight PWM device number Paul Parsons
2012-09-26  6:40   ` Vasily Khoruzhick
2012-09-26 10:39     ` Paul Parsons [this message]
     [not found] ` <20120926060337.GB27855@avionic-0098.mockup.avionic-design.de>
2012-09-26 11:01   ` Paul Parsons
2012-09-26 11:12     ` Vasily Khoruzhick

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=5062DB7C.5050203@yahoo.com \
    --to=lost.distance@yahoo.com \
    --cc=linux-arm-kernel@lists.infradead.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