All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Florian Eckert <fe@dev.tdt.de>
Cc: robh+dt@kernel.org, Eckert.Florian@googlemail.com,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: ktd20xx: Add the KTD20xx family of the RGB LEDs driver from Kinetic
Date: Wed, 10 Nov 2021 00:29:31 +0100	[thread overview]
Message-ID: <20211109232930.GB26764@amd> (raw)
In-Reply-To: <20211109100822.5412-2-fe@dev.tdt.de>

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

hi!

> Introduce the KTD2061/58/59/60 RGB LEDs driver. The difference in these
> parts are the address number on the I2C bus the device is listen on.
> 
> All KT20xx device could control up to 12 LEDs. The chip can be operated
> in two variants.

How are the variants selected?

> Variant 1:
> The device has the ability to group LED outputs into two banks so that
> the two LED banks can be controlled with the same color. This could not
> be done via the LEDs 'sysfs' entry because of the limitation on the color
> register count. The color of the two banks can be configured via device
> 'sysfs' entry for all LEDs at once [current_color0|current_color1].
> Which color the LED is to be used can be set via the 'sysfs' of the
> individual LEDs via the 'multi_intensity' file. Valid values for the
> colors (RGB) are 0 | 1. The value 0 selects the color register 0 and the
> value 1 selects the color register 1.

So... you can select two colors (current_color0, current_color1), and
then then each of the 12 LEDs get one of those colors. What about
intensities? Can brightness be set arbitrarily for each LED?

> Variant 2:
> The device can also set the LED color independently. Since the chip only
> has two color registers, but we want to control the 12 LEDs
> independently via the 'led-class-multicolour' sysfs entry,
> the full RGB color depth cannot be used. Due to this limitation, only 7
> colors and the color black (off) can be set. To use this mode the color
> registers must be preset via the device tree or the device 'sysfs'. The
> color registers 0 must be preset with 0x00 (Red=0x00 Green=0x00 Blue=0x00).
> The color register1 should be preset all with the same value. This value
> depends on which light intensity is to be used in the setup.

So now we have 7 colors we can select from. That sounds better than
two colors. Why would we ever want to use variant 1?

Can we simply pretend this is 7 LED RGB driver?

> +/* Device attribute for color0 register
> + *
> + * The device attribute colour1 is intended to adjust the colour space.

Use color, not colour. Plus run this through checkpatch.

> + * The colour strength can be controlled via the current in 125uA steps.

I don't know what "colour strength" is.

> +/*
> + * The chip also offers the option "Fade rate".
> + */
> +static ssize_t faderate_show(struct device *dev, struct device_attribute *a,
> +		char *buf)
> +{
> +	struct i2c_client *client = to_i2c_client(dev);
> +	struct ktd20xx *chip = i2c_get_clientdata(client);
> +	unsigned int value;
> +
> +	mutex_lock(&chip->lock);
> +	regmap_field_read(chip->faderate, &value);
> +	mutex_unlock(&chip->lock);
> +
> +	return sprintf(buf, "%d\n", value);
> +}

That's way too hardware specific.

Best regards,
									Pavel
-- 
http://www.livejournal.com/~pavelmachek

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

  reply	other threads:[~2021-11-09 23:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 10:08 [PATCH 0/2] leds: Add KTD20xx RGB LEDs driver from Kinetic Florian Eckert
2021-11-09 10:08 ` [PATCH 1/2] leds: ktd20xx: Add the KTD20xx family of the " Florian Eckert
2021-11-09 23:29   ` Pavel Machek [this message]
2021-11-09 10:08 ` [PATCH 2/2] dt: bindings: KTD20xx: Introduce the ktd20xx family of RGB drivers Florian Eckert
2021-11-09 23:29 ` [PATCH 0/2] leds: Add KTD20xx RGB LEDs driver from Kinetic Pavel Machek
2021-11-10  9:35   ` Florian Eckert
2021-11-22  7:17   ` Florian Eckert
2021-11-20  6:48 [PATCH 1/2] leds: ktd20xx: Add the KTD20xx family of the " kernel test robot
2021-11-22 10:32 ` Dan Carpenter
2021-11-22 10:32 ` Dan Carpenter

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=20211109232930.GB26764@amd \
    --to=pavel@ucw.cz \
    --cc=Eckert.Florian@googlemail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fe@dev.tdt.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=robh+dt@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 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.