All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olliver Schinagl <oliver@schinagl.nl>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Richard Purdie <rpurdie@rpsys.net>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCHv1 0/6] leds: pca9653x: support inverted outputs and cleanups
Date: Tue, 19 Apr 2016 15:27:46 +0200	[thread overview]
Message-ID: <57163252.5090000@schinagl.nl> (raw)
In-Reply-To: <CAPybu_02_5pZ6pMkXwaHtjJAfXiWPniWEHcayRoCMypfgeLD_w@mail.gmail.com>

Hey Ricardo,

On 19-04-16 13:18, Ricardo Ribalda Delgado wrote:
> Hi Ollivier
>
> Sorry to not reply to the patches, but I am not subscribed to linux-leds
>
> Regarding:
> [PATCH 2/6] leds: pca963x: Lock i2c r/w access
>
> I am not sure why this patch is needed. the only thing that should be
> protected is the write to ledout.
>
> It seems that mode2 needs to be set to PCA963X_MODE2_DMBLNK, or at
> least, the driver never clears that bit. Couldnt we just set it at
> probe time and remove the read/write of it? I do not have the hardware
> at the moment, so it should be something that you need to test.
Without actually looking at the code right now, but the driver does a 
read/modify/write on the register, and a register is shared among 
several leds. So in that regard, it makes sense and I don't think it's 
very expensive to move the lock, since we have to lock for the write a 
few lines down anyway.
>
> [PATCH 4/6] leds: pca963x: Reduce magic values
> Maybe you want to create the inverse macro of PCA963X_LEDOUT_LDR, so
> you can do something linke
>
> PCA963X_LEDOUT_LDR_INV(ledout, pca963x->led_num) != PCA963X_LEDOUT_LED_GRP_PWM
Good point, I'll add it, I like it.
>
>
> [PATCH 3/6] leds: pca963x: Add defines and remove some magic values
>
> I am not big fan of defining things that are not used. and the magic
> assigment to n_leds is perfectly fine IMHO
Well i needed some of the defines for the invert part and then I figured 
just add everything that the datasheet defines to make everything 
exlusive/easy to use.

But I can remove unused defines if desired.
>
> For PCA963X_LEDOUT_LDR.  Do not forget the parenthesis around led_num.
> Also replace %4 with &3 to be consisten.t
Yeah, i'll check and fix that.
>
> Regards!
>
> On Tue, Apr 19, 2016 at 11:39 AM, Olliver Schinagl <oliver@schinagl.nl> wrote:
>> On 19-04-16 11:23, Jacek Anaszewski wrote:
>>> Hi Olliver,
>>>
>>> Thanks for the patches.
>>> Adding driver authors on cc.
>> Ah sorry about that, thanks. I guess get_maintainers doesn't do that.
>>
>> As for the compile bug, I'll fix that with v2, it only applies on the
>> intermediate patches, not on the whole set.
>>
>> Olliver
>>
>>> On 04/19/2016 09:40 AM, Olliver Schinagl wrote:
>>>> Using the pca963x for a while, I noticed something that may look like
>>>> some
>>>> i2c accessing issues where sometimes data was incorrectly written to the
>>>> bus,
>>>> possibly because we where not properly locking the i2c reads. Though I'm
>>>> not
>>>> familiar enough with the i2c framework to be certain reads need to be
>>>> locked
>>>> at all. A patch was added to properly lock i2c access more tightly.
>>>>
>>>> Furthermore there was no method to support inverted outputs. This series
>>>> adds a property to the device tree to inform the driver that the output
>>>> is inverted (active-high vs active-low).
>>>>
>>>> Additionally, this patch set does some cleanups to please checkpatch, and
>>>> removes a few magic values.
>>>>
>>>> Olliver Schinagl (6):
>>>>     leds: pca963x: Alphabetize headers
>>>>     leds: pca963x: Lock i2c r/w access
>>>>     leds: pca963x: Add defines and remove some magic values
>>>>     leds: pca963x: Reduce magic values
>>>>     leds: pca963x: Inform the output that it is inverted
>>>>     leds: pca963x: Remove whitespace and checkpatch problems
>>>>
>>>>    Documentation/devicetree/bindings/leds/pca963x.txt |   1 +
>>>>    drivers/leds/leds-pca963x.c                        | 243
>>>> ++++++++++++++-------
>>>>    include/linux/platform_data/leds-pca963x.h         |   1 +
>>>>    3 files changed, 171 insertions(+), 74 deletions(-)
>>>>
>>>
>
>

  reply	other threads:[~2016-04-19 13:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  7:40 [PATCHv1 0/6] leds: pca9653x: support inverted outputs and cleanups Olliver Schinagl
2016-04-19  7:40 ` [PATCH 1/6] leds: pca963x: Alphabetize headers Olliver Schinagl
2016-04-19  7:40 ` [PATCH 2/6] leds: pca963x: Lock i2c r/w access Olliver Schinagl
2016-04-19  7:40 ` [PATCH 3/6] leds: pca963x: Add defines and remove some magic values Olliver Schinagl
2016-04-19  8:16   ` kbuild test robot
2016-04-19  8:16     ` kbuild test robot
2016-04-19  7:40 ` [PATCH 4/6] leds: pca963x: Reduce " Olliver Schinagl
2016-04-19  7:40 ` [PATCH 5/6] leds: pca963x: Inform the output that it is inverted Olliver Schinagl
2016-04-21 15:07   ` Rob Herring
2016-04-22 12:38     ` Olliver Schinagl
2016-04-22 13:09       ` Rob Herring
2016-04-22 15:44         ` Olliver Schinagl
2016-04-19  7:40 ` [PATCH 6/6] leds: pca963x: Remove whitespace and checkpatch problems Olliver Schinagl
2016-04-19  9:23 ` [PATCHv1 0/6] leds: pca9653x: support inverted outputs and cleanups Jacek Anaszewski
2016-04-19  9:39   ` Olliver Schinagl
     [not found]     ` <5715FCE8.7080106-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2016-04-19 11:18       ` Ricardo Ribalda Delgado
2016-04-19 11:18         ` Ricardo Ribalda Delgado
2016-04-19 13:27         ` Olliver Schinagl [this message]
     [not found]           ` <57163252.5090000-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2016-04-19 13:42             ` Ricardo Ribalda Delgado
2016-04-19 13:42               ` Ricardo Ribalda Delgado
2016-04-20  7:21               ` Olliver Schinagl
2016-04-20  8:01                 ` Ricardo Ribalda Delgado
2016-04-20  8:51                   ` Olliver Schinagl
     [not found]                     ` <5717430D.30702-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2016-04-20  8:56                       ` Ricardo Ribalda Delgado
2016-04-20  8:56                         ` Ricardo Ribalda Delgado
2016-04-20  9:06                         ` Olliver Schinagl
2016-04-20  9:17                           ` Ricardo Ribalda Delgado
2016-04-20 10:12                             ` Olliver Schinagl
2016-04-22  7:21                             ` Olliver Schinagl
2016-05-12  9:04                             ` Olliver Schinagl
2016-05-12  9:07                         ` Olliver Schinagl

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=57163252.5090000@schinagl.nl \
    --to=oliver@schinagl.nl \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=ricardo.ribalda@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.