Re: [PATCH v5 2/2] leds: lm3601x: Introduce the lm3601x LED driver
From: Dan Murphy
Date: Mon May 14 2018 - 15:40:55 EST
Jacek
On 05/11/2018 06:56 AM, Dan Murphy wrote:
<snip>
>>> +ÂÂÂ }
>>> +
>>> +ÂÂÂ if (led->strobe_node) {
>>> +ÂÂÂÂÂÂÂ ret = of_property_read_string(led->strobe_node, "label", &name);
>>> +ÂÂÂÂÂÂÂ if (!ret)
>>> +ÂÂÂÂÂÂÂÂÂÂÂ snprintf(led->strobe, sizeof(led->strobe),
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "%s:%s", led->strobe_node->name, name);
>>> +ÂÂÂÂÂÂÂ else
>>> +ÂÂÂÂÂÂÂÂÂÂÂ snprintf(led->strobe, sizeof(led->strobe),
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "%s::strobe", led->strobe_node->name);
>>> +
>>> +ÂÂÂÂÂÂÂ ret = of_property_read_u32(led->strobe_node,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "flash-max-microamp",
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &led->strobe_current_max);
>>> +ÂÂÂÂÂÂÂ if (ret < 0) {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ led->strobe_current_max = LM3601X_MIN_STROBE_I_MA;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ dev_warn(&led->client->dev,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "flash-max-microamp DT property missing\n");
>>> +ÂÂÂÂÂÂÂ }
>>> +
>>> +ÂÂÂÂÂÂÂ ret = of_property_read_u32(led->strobe_node,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "flash-max-timeout-us",
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &led->max_strobe_timeout);
>>> +ÂÂÂÂÂÂÂ if (ret < 0) {
>>> +ÂÂÂÂÂÂÂÂÂÂÂ led->max_strobe_timeout = strobe_timeouts[0].reg_val;
>>> +ÂÂÂÂÂÂÂÂÂÂÂ dev_warn(&led->client->dev,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ "flash-max-timeout-us DT property missing\n");
>>> +ÂÂÂÂÂÂÂ }
>>
>> Common LED bindings state that flash-max-microamp and
>> flash-max-timeout-us properties are mandatory.
>
> OK.
OK I looked at the max776973 driver and well if the flash-max-microamp and
flash-max-timeout-us nodes are missing it sets a default value for each if the
node is not present.
So should we remove this code from the Max77693 driver too and fail probe as being asked
in this driver?
Dan
>
>>
>>> +
>>> +ÂÂÂÂÂÂÂ lm3601x_init_flash_timeout(led);
<snip>
>>>
>>
>
>
--
------------------
Dan Murphy