Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp655110rdf; Tue, 21 Nov 2023 12:29:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaM1uOim0X/m/A+lldagqltPid9sUvOROjw/WjW6iXCQ7NUogQr/2iI12+dVgFBlvdqUD0 X-Received: by 2002:a05:6a21:1a8:b0:187:4118:140 with SMTP id le40-20020a056a2101a800b0018741180140mr5498083pzb.24.1700598573388; Tue, 21 Nov 2023 12:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598573; cv=none; d=google.com; s=arc-20160816; b=VlgHPBrdUGUxdr8rFy0SgFG2UY0060Uql1VfMJxuxGQxZV7E20fDOmAzUWhs8cJyNo U7gGcE/jWKFV5VIS5dbWSn6xCMYIPz7h58C0GxTx+L4zPqQdfMuQtoVhSxgcJnTmnWRb bnlIvc47NvCIPQxl5tDaLTutzuNRNaY5PZxwGc6W8orHyimNTh9AJvKrdxHUQvcRP5OQ WQib1qhMKXo9MGFqFAcCSgoSvEvpJGedtMVr5zuy/ih9TauDNwCjLWTKSogcrwvbXxcl AoViKK2lZKlEiVLL6hbGQXVk7/cZ5zuQEfhWYWjB0awKE7e6/PrVZpS+NOPdAM8DEbMr 8Xzw== 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=TsSFYNyr+qoUBw7DRIDgw/BslXmhZ5hoKWIiFL3fwXAr8fCQ6mSW8Toom3rzczWuqY 0x5rY4Fk9h0RVtDpfokoHvlHPpJHLaFbMrrjwC3jf9TdLaNideQXXFa6kzJbw+lRG/xf WLdaJpTIZT61CKaxHAtQkvjxqP8V5Y9/lRyTIJsz1lqr2o0KFCP3PSkaRzsAaPeTTL55 YAzXNUEIyDVUo+d05zNeZZKePKZgjWtGhnW3tXAzWFO8ByuduYb6cU/bwu2ZHxK1erru aAaD9YHBbIj9ckGv4wXFp1WAWfuLzUy9wBFSuXvjfg0LY7/yf1yP3Ni9G0p0i2L5Me97 EGsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=k8JIheH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bq20-20020a056a02045400b005774978dd75si12792206pgb.175.2023.11.21.12.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=k8JIheH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 945CE8023A3B; Tue, 21 Nov 2023 12:29:24 -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 S234023AbjKUU3C (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A8C1A1; Tue, 21 Nov 2023 12:28:51 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 37CDB100062; Tue, 21 Nov 2023 23:28:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 37CDB100062 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598529; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=k8JIheH9zf/SSZQmKEjs4sIgztOQsz3BmVHgXMMkicVFPVHcACknikwohxJ3gdDYf SytqKWOvJumo5gg3ZP8+Om4L+NHEcyNdraybFBTSJQD4HUWPPq78aIh3LQieUEAU0K X1oORlrRVwTgXLNALk1KZS2lbrxuV9ffhxf+Cwukn5n2UG0JNJLJCleSQ3kUduV8xV YIKdZAMXsWHF5G75zVfVDvWFtkvvqLIGAfKr2b0IiCHDHPzh7XjURBd6PcqZVU7ueY 1T11bu/kXJY5xYasHndZchryDRv08+jBxQ/B8Z0L1GUfKPROL+wmToJ+a8vDAOL5qC KEeXL5mf/ZL3Q== 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; Tue, 21 Nov 2023 23:28:49 +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; Tue, 21 Nov 2023 23:28:48 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v4 01/11] leds: aw200xx: fix write to DIM parameter Date: Tue, 21 Nov 2023 23:28:25 +0300 Message-ID: <20231121202835.28152-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-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-m01.sberdevices.ru (172.16.192.107) 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: 181514 [Nov 21 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: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, 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/21 17:47:00 #22495004 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]); Tue, 21 Nov 2023 12:29:24 -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