All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Matthias Fend <matthias.fend@emfend.at>
Cc: Pavel Machek <pavel@ucw.cz>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	bsp-development.geo@leica-geosystems.com
Subject: Re: [PATCH 2/2] leds: tps6131x: add support for Texas Instruments TPS6131X flash LED driver
Date: Fri, 14 Mar 2025 11:45:51 +0000	[thread overview]
Message-ID: <20250314114551.GL3890718@google.com> (raw)
In-Reply-To: <8a16c018-8466-4dea-8f1e-e8a65e3ed950@emfend.at>

On Fri, 14 Mar 2025, Matthias Fend wrote:

> Hi Lee,
> 
> Am 14.03.2025 um 11:52 schrieb Lee Jones:
> > On Fri, 14 Mar 2025, Matthias Fend wrote:
> > 
> > > Hi Lee,
> > > 
> > > thanks a lot for your feedback!
> > > 
> > > Am 10.03.2025 um 15:49 schrieb Lee Jones:
> > > > On Fri, 28 Feb 2025, Matthias Fend wrote:
> > > > 
> > > > > The TPS61310/TPS61311 is a flash LED driver with I2C interface. Its power
> > > > > stage is capable of supplying a maximum total current of roughly 1500mA.
> > > > > The TPS6131x provides three constant-current sinks, capable of sinking up
> > > > > to 2 × 400mA (LED1 and LED3) and 800mA (LED2) in flash mode. In torch mode
> > > > > each sink (LED1, LED2, LED3) supports currents up to 175mA.
> > > > > 
> > > > > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
> > > > > ---
> > > > >    MAINTAINERS                        |   7 +
> > > > >    drivers/leds/flash/Kconfig         |  11 +
> > > > >    drivers/leds/flash/Makefile        |   1 +
> > > > >    drivers/leds/flash/leds-tps6131x.c | 798 +++++++++++++++++++++++++++++++++++++
> > > > >    4 files changed, 817 insertions(+)

[...]

> > > > > +static int tps6131x_flash_external_strobe_set(struct v4l2_flash *v4l2_flash, bool enable)
> > > > > +{
> > > > > +	struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev;
> > > > > +	struct tps6131x *tps6131x = fled_cdev_to_tps6131x(fled_cdev);
> > > > > +
> > > > > +	guard(mutex)(&tps6131x->lock);
> > > > > +
> > > > /> +	return tps6131x_set_mode(tps6131x, enable ? TPS6131X_MODE_FLASH : TPS6131X_MODE_SHUTDOWN,
> > > > > +				 false);
> > > > > +}
> > > > > +
> > > > > +static const struct v4l2_flash_ops tps6131x_v4l2_flash_ops = {
> > > > > +	.external_strobe_set = tps6131x_flash_external_strobe_set,
> > > > > +};
> > > > > +
> > > > > +static int tps6131x_v4l2_setup(struct tps6131x *tps6131x)
> > > > > +{
> > > > > +	struct v4l2_flash_config v4l2_cfg = { 0 };
> > > > > +	struct led_flash_setting *intensity = &v4l2_cfg.intensity;
> > > > > +
> > > > > +	intensity->min = tps6131x->step_torch_current_ma;
> > > > > +	intensity->max = tps6131x->max_torch_current_ma;
> > > > > +	intensity->step = tps6131x->step_torch_current_ma;
> > > > > +	intensity->val = intensity->min;
> > > > > +
> > > > > +	strscpy(v4l2_cfg.dev_name, tps6131x->fled_cdev.led_cdev.dev->kobj.name,
> > > > 
> > > > tps6131x->client->dev?
> > > 
> > > Do you mean the name should be taken from the I2C device?
> > > The current name, for example, is 'white:flash-0', while the I2C device name
> > > would be '4-0033'. So I think the current version is appropriate, don't you
> > > think?
> > 
> > No, I'm implying that:
> > 
> >    tps6131x->client->dev == tps6131x->fled_cdev.led_cdev.dev
> > 
> > ... and that the former is shorter / neater.
> 
> Hmm. That's interesting. I thought these were two different devices, which
> seems to be actually the case for me. Hence the different names in the kobj.
> Are the devices really supposed to be identical?

Interesting.  What are their names?

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2025-03-14 11:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 10:31 [PATCH 0/2] Support for Texas Instruments TPS6131X flash LED driver Matthias Fend
2025-02-28 10:31 ` [PATCH 1/2] dt-bindings: leds: add Texas Instruments TPS6131x " Matthias Fend
2025-02-28 18:24   ` Conor Dooley
2025-03-10  7:20     ` Matthias Fend
2025-03-10  7:43       ` Krzysztof Kozlowski
2025-03-10  7:49   ` Krzysztof Kozlowski
2025-03-10  8:40     ` Matthias Fend
2025-03-10 11:45       ` Krzysztof Kozlowski
2025-02-28 10:31 ` [PATCH 2/2] leds: tps6131x: add support for Texas Instruments TPS6131X " Matthias Fend
2025-03-10  7:46   ` Krzysztof Kozlowski
2025-03-10  8:04     ` Matthias Fend
2025-03-10 11:46       ` Krzysztof Kozlowski
2025-03-10 14:49   ` Lee Jones
2025-03-14  8:28     ` Matthias Fend
2025-03-14 10:52       ` Lee Jones
2025-03-14 11:27         ` Matthias Fend
2025-03-14 11:45           ` Lee Jones [this message]
2025-03-14 12:38             ` Matthias Fend
2025-03-14 14:13               ` Lee Jones

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=20250314114551.GL3890718@google.com \
    --to=lee@kernel.org \
    --cc=bsp-development.geo@leica-geosystems.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=matthias.fend@emfend.at \
    --cc=pavel@ucw.cz \
    --cc=robh@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.