Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2065699rdh; Sat, 25 Nov 2023 12:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWwAay/UvSIJBHHECiPIAHTuEN4DkCQ5KHhyl8DiqabBsRhekebtxDS5FeMY/XQRYa4S5b X-Received: by 2002:a17:902:f68e:b0:1cf:9bd1:aaea with SMTP id l14-20020a170902f68e00b001cf9bd1aaeamr9092417plg.11.1700942804742; Sat, 25 Nov 2023 12:06:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942804; cv=none; d=google.com; s=arc-20160816; b=O3YuJfKtXATIw2Fu/6zW07zoL/StRw6LyD6uduqWkLruGE/IFzoSFjtP/T0DK6xwtn fA8IkmaKiSYI+qFygbf148kBMl3zOhZZSO/n73dJqmSsFP4QZ8cVsoJ3AY/nOurKlSbE oP6BpYCYaozEmXbgPK7YOpJH4QgRQYwU74vB1lrGhuRUpcGvW74u/M00vIXvkSo16E80 rF2d4Yh6f4+3B4+sZD8QqiGEzVl1/2IDqBw/icPx53Gzdhwu2S/a3myf9LOQ3TCxJwQ0 6+iwUaQwZul8aurc7ThwwygGldTolp+2ipKLSjNuOgN7+ZeIG0rBGB6LZNkDXn3Z6Zj6 B80Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=mkwWrSYE8iGwyM0nDydYiIJ33/1CJjkCCTxVGacOTqvHxvRhsjLs4IB671CSqvKhgp Te5pk9SGgzKEEzI0STlIKhUVI/4NxOkdFPPdLniNSUGzAD5DvH2dNbd1vmh+w/YUXOqv +t1klFO2CQdj5FmgXx/eX8gx2GMcVcDye3dC7n347IU8avb+vP6SvzgZDWj2swZT1Xx4 3IQiBmhDlgm+YKntbsS89z1jWgkr0dmLjrQ+QGkkBZ0L0sFapqxXyj+lo/BamcqeeKa8 uqP6O+j9mDy1SYVgV4X6V42NJSKQREGm5PJu3u1vOY+esfFJ7NOrAyZhb/jnu4VGZMKu DZog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Vf3sumlO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id jn9-20020a170903050900b001c3da86939csi5945404plb.546.2023.11.25.12.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Vf3sumlO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DE8E5807C5E4; Sat, 25 Nov 2023 12:05:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231659AbjKYUF3 (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKYUFZ (ORCPT ); Sat, 25 Nov 2023 15:05:25 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC62133; Sat, 25 Nov 2023 12:05:30 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id D24D510001F; Sat, 25 Nov 2023 23:05:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru D24D510001F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942727; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Vf3sumlOgZWhlZy1PHPNxhCcH7oNJzqTz0K9ICC5PboBhNpBJExGtrL7T5KzCyMdT QUoDPm6hSaEoNRciaq0dNp+OVPwjvZViGk8anpjq4RwfZCNAJC4WnOzc2DJ0njyvxF sdMrtEydHigjPwpDiNU2F/vZf4QauenuGxdOJKg+Y0GL7E+0vCjF00R+wMNrDi+mSz Mdxlyc6j4VEC4JNNCtX2QusgiEu1vwgz1e7+kw779jysPC/WqHW1QW4ckR7gK8P1Rv CSogETZkTxr9Y08f31BrauTrSA7a4vIYj2R1g0vZbSaAmKE5sE9j4aPWXP5/5evizj ZUz7eWpd0bFbA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:27 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:27 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v5 01/11] leds: aw200xx: fix write to DIM parameter Date: Sat, 25 Nov 2023 23:05:09 +0300 Message-ID: <20231125200519.1750-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:05:53 -0800 (PST) From: Martin Kurbanov If write only DIM value to the page 4, LED brightness will not be updated, as both DIM and FADE need to be written to the page 4. Therefore, write DIM to the page 1. Fixes: 36a87f371b7a ("leds: Add AW20xx driver") Signed-off-by: Martin Kurbanov Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko --- drivers/leds/leds-aw200xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index ef4eda6a09ee..842a22087b16 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -74,6 +74,10 @@ #define AW200XX_LED2REG(x, columns) \ ((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns)))) +/* DIM current configuration register on page 1 */ +#define AW200XX_REG_DIM_PAGE1(x, columns) \ + AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns)) + /* * DIM current configuration register (page 4). * The even address for current DIM configuration. @@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr, if (dim >= 0) { ret = regmap_write(chip->regmap, - AW200XX_REG_DIM(led->num, columns), dim); + AW200XX_REG_DIM_PAGE1(led->num, columns), + dim); if (ret) goto out_unlock; } -- 2.36.0