On 10/10/2016 04:52 PM, Alexander Kurz wrote:
On Mon, 10 Oct 2016, Jacek Anaszewski wrote:
On 10/10/2016 03:24 PM, Alexander Kurz wrote:
On Mon, 10 Oct 2016, Jacek Anaszewski wrote:
Hi Alexander,
It should write value << 3 to the register 52.
According to the documentation [0] LEDKP0, LEDKP1 and LEDKP2
are driven by bits 9,10 and 11 respectively. The calculations
don't seem to be in line with that. Could you point what I
am missing?
LEDKP0, LEDKP1 and LEDKP2 controlles the led current setting, but ...
[0] http://www.nxp.com/files/analog/doc/data_sheet/MC13892.pdf
The numbering mentioned in the DT documentation is used as offset
for the device specific struct mc13xxx_led_devtype.led_min
if (of_property_read_u32(child, "reg", &tmp))
continue;
pdata->led[i].id = leds->devtype->led_min + tmp;
e.g. MC13892_LED_KP = MC13892_LED_MD + 2
Hope this clarifies your question,
Thanks but not entirely - what with the second part of question related
to the register layout?
The LED brightness is controlled via the duty cycle bits allowing
64 brightness values, setting bits/registers like
LED | reg | bits
-----+-----+------
main | 0 | 3..8
aux | 0 | 15..20
kp | 1 | 3..8
red | 2 | 3..8
green| 2 | 15..20
blue | 3 | 3..8
So, I have probably introduced some confusion by
using "LED Control #reg" as "reg" from Table 163-166.
So it doesn't seem to reflect what is shown in the Table 164.
on the site 148 of the document I mentioned in the previous
message. Could you please give a reference to the documentation
you're using?
Exactly the same datasheet.
Again, brightness controlling bits with verbatim Register numbering
LED | Register | LED Control | bits
-----+----------+-------------+-----
main | 51 | 0 | 3..8
aux | 51 | 0 | 15..20
kp | 52 | 1 | 3..8
red | 53 | 2 | 3..8
green| 53 | 2 | 15..20
blue | 54 | 3 | 3..8
OK, now everything is clear, thanks.
I've applied the patch to the for-4.10 branch of linux-leds.git.
--
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html