lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f9b920f-1851-4ebe-9054-d32de79d3678@emfend.at>
Date: Fri, 14 Mar 2025 13:38:30 +0100
From: Matthias Fend <matthias.fend@...end.at>
To: Lee Jones <lee@...nel.org>
Cc: Pavel Machek <pavel@....cz>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, linux-leds@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
 bsp-development.geo@...ca-geosystems.com
Subject: Re: [PATCH 2/2] leds: tps6131x: add support for Texas Instruments
 TPS6131X flash LED driver

Hi Lee,

Am 14.03.2025 um 12:45 schrieb Lee Jones:
> 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@...end.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?

tps6131x->fled_cdev.led_cdev.dev: 'white:flash-0'
tps6131x->client->dev: '4-0033'

Best regards
  ~Matthias


> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ