[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191221190240.GB4199@amd>
Date: Sat, 21 Dec 2019 20:02:40 +0100
From: Pavel Machek <pavel@....cz>
To: Zahari Petkov <zahari@...ena.io>
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>,
Dan Murphy <dmurphy@...com>, linux-leds@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] leds: pca963x: Fix open-drain initialization
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
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists