Patch "leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     leds-is31fl319x-fix-setting-current-limit-for-is31fl.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c40af7cf1aae7e8fa4808856720dd354def0fce0
Author: Luca Weiss <luca@xxxxxxxxx>
Date:   Tue Nov 29 22:29:01 2022 +0100

    leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}
    
    [ Upstream commit 135780f1048b3f956f5b10bb23dec9c2d2c4ef6d ]
    
    The current setting lives in bits 4:2 (as also defined by the mask) but
    the current limit defines in the driver use bits 2:0 which should be
    shifted over so they don't get masked out completely (except for 17.5mA
    which became 10mA).
    
    Now checking /sys/kernel/debug/regmap/1-0068/registers shows that the
    current limit is applied correctly and doesn't take the default b000 =
    42mA.
    
    Fixes: fa877cf1abb9 ("leds: is31fl319x: Add support for is31fl319{0,1,3} chips")
    Signed-off-by: Luca Weiss <luca@xxxxxxxxx>
    Reviewed-by: Vincent Knecht <vincent.knecht@xxxxxxxxxx>
    Signed-off-by: Pavel Machek <pavel@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c
index 52b59b62f437..b2f4c4ec7c56 100644
--- a/drivers/leds/leds-is31fl319x.c
+++ b/drivers/leds/leds-is31fl319x.c
@@ -38,6 +38,7 @@
 #define IS31FL3190_CURRENT_uA_MIN	5000
 #define IS31FL3190_CURRENT_uA_DEFAULT	42000
 #define IS31FL3190_CURRENT_uA_MAX	42000
+#define IS31FL3190_CURRENT_SHIFT	2
 #define IS31FL3190_CURRENT_MASK		GENMASK(4, 2)
 #define IS31FL3190_CURRENT_5_mA		0x02
 #define IS31FL3190_CURRENT_10_mA	0x01
@@ -553,7 +554,7 @@ static int is31fl319x_probe(struct i2c_client *client)
 			     is31fl3196_db_to_gain(is31->audio_gain_db));
 	else
 		regmap_update_bits(is31->regmap, IS31FL3190_CURRENT, IS31FL3190_CURRENT_MASK,
-				   is31fl3190_microamp_to_cs(dev, aggregated_led_microamp));
+				   is31fl3190_microamp_to_cs(dev, aggregated_led_microamp) << IS31FL3190_CURRENT_SHIFT);
 
 	for (i = 0; i < is31->cdef->num_leds; i++) {
 		struct is31fl319x_led *led = &is31->leds[i];



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux