public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Gatliff <bgat@billgatliff.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PWM PATCH 1/7] API to consolidate PWM devices behind a common user and kernel interface
Date: Wed, 10 Feb 2010 07:55:04 -0600	[thread overview]
Message-ID: <4B72BAB8.4090008@billgatliff.com> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE190902153279@mi8nycmail19.Mi8.com>

H Hartley Sweeten wrote:
>> +int pwm_set_polarity(struct pwm_channel *p,
>> +		     int active_high)
>> +{
>> +	struct pwm_channel_config c = {
>> +		.config_mask = PWM_CONFIG_POLARITY,
>> +		.polarity = active_high,
>> +	};
>> +	return pwm_config(p, &c);
>> +}
>> +EXPORT_SYMBOL(pwm_set_polarity);
>>     
>
> Has the 'polarity' logic been verified?
>
> pwm_set_polarity takes an active high flag that is passed to pwm_config.
> A write to the sysfs 'polarity' file passes the value directly to pwm_config.
> A read from the sysfs 'polarity' file returns struct pwm_channel ->active_low.
>
> Seems like a mis-match in logic.
>   

It was.  And on top of that, none of the drivers were reflecting their
polarity in their pwm_channel structures.

I renamed the channel structure variable to active_high for consistency,
and updated each of the drivers to set that value consistent with their
actual polarities.

Very good catch.



b.g.

-- 
Bill Gatliff
Embedded systems training and consulting
http://billgatliff.com
bgat@billgatliff.com


  parent reply	other threads:[~2010-02-10 13:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 20:46 [PWM PATCH 0/7] Generic PWM API Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 1/7] API to consolidate PWM devices behind a common user and kernel interface Bill Gatliff
2010-02-10  2:41   ` H Hartley Sweeten
2010-02-10  4:12     ` Bill Gatliff
2010-02-10  4:18       ` Bill Gatliff
2010-02-10 17:34       ` H Hartley Sweeten
2010-02-10 13:55     ` Bill Gatliff [this message]
2010-02-10 18:33   ` H Hartley Sweeten
2010-02-09 20:46 ` [PWM PATCH 2/7] Emulates PWM hardware using a high-resolution timer and a GPIO pin Bill Gatliff
     [not found]   ` <8B7FF140-BE6E-4AD1-86BC-161488675DFB@lvk.cs.msu.su>
2010-02-10 13:42     ` Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 3/7] Expunge old Atmel PWMC driver, replacing it with one that conforms to the PWM API Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 4/7] Implements PWM-based LED control Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 5/7] LED "dim" trigger based on PWM control of the LED Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 6/7] Incorporate PWM API code into KBuild Bill Gatliff
2010-02-09 20:46 ` [PWM PATCH 7/7] PWM API driver for MPC52xx GPT peripheral Bill Gatliff

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=4B72BAB8.4090008@billgatliff.com \
    --to=bgat@billgatliff.com \
    --cc=hartleys@visionengravers.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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