linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Zahari Petkov <zahari@balena.io>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Dan Murphy <dmurphy@ti.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] leds: pca963x: Fix open-drain initialization
Date: Sat, 21 Dec 2019 20:02:40 +0100	[thread overview]
Message-ID: <20191221190240.GB4199@amd> (raw)
In-Reply-To: <20191118210255.GA99907@majorz.localdomain>

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

On Mon 2019-11-18 23:02:55, Zahari Petkov wrote:
> Before commit bb29b9cccd95 ("leds: pca963x: Add bindings to invert
> polarity") Mode register 2 was initialized directly with either 0x01
> or 0x05 for open-drain or totem pole (push-pull) configuration.
> 
> Afterwards, MODE2 initialization started using bitwise operations on
> top of the default MODE2 register value (0x05). Using bitwise OR for
> setting OUTDRV with 0x01 and 0x05 does not produce correct results.
> When open-drain is used, instead of setting OUTDRV to 0, the driver
> keeps it as 1:
> 
> Open-drain: 0x05 | 0x01 -> 0x05 (0b101 - incorrect)
> Totem pole: 0x05 | 0x05 -> 0x05 (0b101 - correct but still wrong)
> 
> Now OUTDRV setting uses correct bitwise operations for initialization:
> 
> Open-drain: 0x05 & ~0x04 -> 0x01 (0b001 - correct)
> Totem pole: 0x05 | 0x04 -> 0x05 (0b101 - correct)
> 
> Additional MODE2 register definitions are introduced now as well.

Thanks, applied.
								Pavel
								
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

      reply	other threads:[~2019-12-21 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 21:02 [PATCH v2] leds: pca963x: Fix open-drain initialization Zahari Petkov
2019-12-21 19:02 ` Pavel Machek [this message]

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=20191221190240.GB4199@amd \
    --to=pavel@ucw.cz \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=zahari@balena.io \
    /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).