From patchwork Wed Nov 1 14:24:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459318vqx; Wed, 1 Nov 2023 07:25:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjeWLyVqmzwfo6z1jA9PPVcmvd7zxkBz1EajldGxZwXYOFZMsO2a2BcGzr8kX6LK2mhfqe X-Received: by 2002:a17:90a:898f:b0:280:215e:8855 with SMTP id v15-20020a17090a898f00b00280215e8855mr9624606pjn.21.1698848722550; Wed, 01 Nov 2023 07:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848722; cv=none; d=google.com; s=arc-20160816; b=gE5IQmch/NbI3xEy5NKW3xZexQ3UhQBFa9L6GVOwli8IYbGuW1SY8rGFxHUue8fpkI CsNlGYNIZzylpmfjMQKVO/EIV/qHkQA3VhUjezm75QPDg5oZHtfgUhrL+AVT4pr/SWCh 4dEhuJCHrmnOrlWCwDI6B4mvaULNxEPp5qhpOZou4gwc6Qfk5/Xm8BnxowPZexr8f4sU 97+Dv8s342WP+vgDL2tEe7g71CHgCsT9AxWC5H+jEE/+Wvh4T0U6dhiyRgsvOdIRQtAE BVlOlK6CufpGb3nTsZHSzKCntyaEnqZXVQwbEcBDB62uVxAiHwuCJ7f/OUMorzp/lBaK 8Slg== 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=EDXtkoNRVpjH5LBhvvyL/XjN07jDmu1c5hgfKsl1iMI=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=qoh37BXqDxLYnUkDrxouwfaAWFC1aiTZSznC1xfM/iKYcNUOff/mqoo/4bisbSNoEJ lCYk5hwglhn+k72+MgYbrsvMrqRiVF6mzwNZIlKeXEyR6PQf9wZUb+mRo0NPJGjjJP8h 0eBB1inVfIEv/RQ93qAEaaq9BXslZLgCP3MPeE7nM7wEax71zdigteUDxp9VaEvQYTrR 8dH56TJXApIiVg3yJmwUGZVwZlqEk/VPdIkp0INrTlY5eNuKQz6FlDloD2Frw6GOOBoT 06fMxdbVXuYuxMglaQpa5IFUonOOR/w3WTfPA5nDfusMaN6agKOGfb62Zpp/wpsueuQx Pyrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W1Eiz05j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h3-20020a17090aa88300b00280cd49099asi612821pjq.46.2023.11.01.07.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W1Eiz05j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 8A2E1810438E; Wed, 1 Nov 2023 07:25:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344407AbjKAOZI (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233678AbjKAOZF (ORCPT ); Wed, 1 Nov 2023 10:25:05 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5677DE; Wed, 1 Nov 2023 07:24:58 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1A63D120032; Wed, 1 Nov 2023 17:24:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1A63D120032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848696; bh=EDXtkoNRVpjH5LBhvvyL/XjN07jDmu1c5hgfKsl1iMI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=W1Eiz05j2s+sFeFDh2iEYctaIwBwO1QFVHxwHTRDGmpq/MEz7OOrxdXMEBimUH8uj YQurAWuHHNlLCRkYsBqAi+rYX31gmXfIeY9QwlpakXh3CchIzTuc80yTpqjpISHmmj ogJfR3itCeVBavur0JG0BoojGXSsRIClseqS6FXkESqmZS+CMU+DKzHaWQV8ej5C9u A/KrJEIn6dmr1OppjblAeUCl+v0SeJEtvo1CGIiB36KjV8+mRRhCy4eyyVcPT3qK/8 eVk3NqXyuGf6gIqacVwGvJ9UH7Q1t/FKps/t/AMeyiuXsqv6yW+5tOzIIy/Wo189Er ERMkw3KKxkKLA== 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; Wed, 1 Nov 2023 17:24:55 +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.37; Wed, 1 Nov 2023 17:24:55 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v3 01/11] leds: aw200xx: fix write to DIM parameter Date: Wed, 1 Nov 2023 17:24:35 +0300 Message-ID: <20231101142445.8753-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781371998232490804 X-GMAIL-MSGID: 1781371998232490804 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 --- 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; } From patchwork Wed Nov 1 14:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459383vqx; Wed, 1 Nov 2023 07:25:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAbh/rwDf73ElTKyacrkNKIgO1tTjJ+NL5Rgftd3PMoIhE/E5AjzlOYBwPO81xagaQUwOB X-Received: by 2002:a05:6870:11d0:b0:1d6:5133:2f37 with SMTP id 16-20020a05687011d000b001d651332f37mr16710536oav.48.1698848728256; Wed, 01 Nov 2023 07:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848728; cv=none; d=google.com; s=arc-20160816; b=CxNgQITpHTiN/TTRMPQqXR0pT55Nz8y6KizvX7y8qc1GfGcn35tKCnIj1gzYwiX7bg H8sV66IrDWWEXxQxvBUTPK1S1AeUY4ZQR6Y9CZ44IxlTu86STsVU2yFb+LWvGb8gC/gG BNUcDOl0e7e+/9UZEO/nBeB/KHB8Ddy37eKMI1mhyiMkf3wnxQCj8/ALwTM3VA53N+Q0 XEPR1bOFvpe8IaEJKbKXO6gYczX4S2aZHaOEaN/ame9+tBuYvHdysQg1HRz0HYdR1igw mrego5PMN8I3dVed0ZQxmFlaA3xTJjD7SHmqRYa0dG4+VWNKQALiJy5ViXmt5Q5l3+bp o7cg== 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=FhktaFkbGHjtccjnmuidDnZiLgQ3GmfFVrHWAf0/zKc=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=eKMWPUWRrdSzr4RSSqmEzqjga48TskbIoPHQuhWVsaqrBqfKqx6+vE2DVzj8cOnkBt 2b0iQlPlCQLr/POM/rR5+23P1qxnSE/K6/CZUP3nzPVLhCDT5agarGUTs6EsjkG1vmd5 iGQaEHItUZg3DKcPm2rhlS6f5VB7Nq8N1LAwsVQfAG1e5hTYcb+KmUaQEDAq2lnGhSJP pDVAiuQGs7pSfuhDBLJbmh3lKMZxFjXDMidI4qnReoYSI89QF1EIgxmNO6KRby4Ruu05 MzqIeClnec9pzNHmWfZjFELbgjeULcQUXp4X94utqiUXhurQE+w30kTT3Qv9fRXsUBjk UA7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=FSDV4DcG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id by29-20020a056a02059d00b005b9a1494637si3339490pgb.317.2023.11.01.07.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=FSDV4DcG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7F04680FA9D4; Wed, 1 Nov 2023 07:25:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344381AbjKAOZH (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233772AbjKAOZF (ORCPT ); Wed, 1 Nov 2023 10:25:05 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5479DC; Wed, 1 Nov 2023 07:24:58 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id B409C100006; Wed, 1 Nov 2023 17:24:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B409C100006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848696; bh=FhktaFkbGHjtccjnmuidDnZiLgQ3GmfFVrHWAf0/zKc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=FSDV4DcGMIliSRh/YfA9la+qGb2PYpjr3JfOsB0hSqeuXbpazE9pzgWFHasPqenB1 gn1SQTF5MlR3QmHqV/HCBTMhq40i32/GtUZI/zoJcow+iccIQf6bxnoCUbl+69Y4J/ GPJy9CQf2MF/JEcWJpIfJmdluUcYi62r6VA7KZ+I4KiFfor42kH83T9j37ucX9xzh9 YDMczGXOTmXk5bQSoQm95BkigYkEhITsSLMq7prQcBqb8fFkmq9rliDzvynNXdFFyb RctM8WC/6zvV0DHv6sJO+gdP6t0VHe691ysaINbDxSX1z24jQSSVoRLpr6vjRxk+H6 O0/bNhm0Zoskg== 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; Wed, 1 Nov 2023 17:24:56 +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.37; Wed, 1 Nov 2023 17:24:56 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v3 02/11] leds: aw200xx: support HWEN hardware control Date: Wed, 1 Nov 2023 17:24:36 +0300 Message-ID: <20231101142445.8753-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372004179894252 X-GMAIL-MSGID: 1781372004179894252 HWEN is hardware control, which is used for enable/disable aw200xx chip. It's high active, internally pulled down to GND. After HWEN pin set high the chip begins to load the OTP information, which takes 200us to complete. About 200us wait time is needed for internal oscillator startup and display SRAM initialization. After display SRAM initialization, the registers in page 1 to page 5 can be configured via i2c interface. Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 842a22087b16..7762b3a132ac 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,7 @@ struct aw200xx { struct mutex mutex; u32 num_leds; u32 display_rows; + struct gpio_desc *hwen; struct aw200xx_led leds[] __counted_by(num_leds); }; @@ -358,6 +360,25 @@ static int aw200xx_chip_check(const struct aw200xx *const chip) return 0; } +static void aw200xx_enable(const struct aw200xx *const chip) +{ + gpiod_set_value_cansleep(chip->hwen, 1); + + /* + * After HWEN pin set high the chip begins to load the OTP information, + * which takes 200us to complete. About 200us wait time is needed for + * internal oscillator startup and display SRAM initialization. After + * display SRAM initialization, the registers in page1 to page5 can be + * configured via i2c interface. + */ + fsleep(400); +} + +static void aw200xx_disable(const struct aw200xx *const chip) +{ + return gpiod_set_value_cansleep(chip->hwen, 0); +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -517,6 +538,14 @@ static int aw200xx_probe(struct i2c_client *client) if (IS_ERR(chip->regmap)) return PTR_ERR(chip->regmap); + chip->hwen = devm_gpiod_get_optional(&client->dev, "enable", + GPIOD_OUT_HIGH); + if (IS_ERR(chip->hwen)) + return dev_err_probe(&client->dev, PTR_ERR(chip->hwen), + "Cannot get enable gpio"); + + aw200xx_enable(chip); + ret = aw200xx_chip_check(chip); if (ret) return ret; @@ -537,6 +566,9 @@ static int aw200xx_probe(struct i2c_client *client) ret = aw200xx_chip_init(chip); out_unlock: + if (ret) + aw200xx_disable(chip); + mutex_unlock(&chip->mutex); return ret; } @@ -546,6 +578,7 @@ static void aw200xx_remove(struct i2c_client *client) struct aw200xx *chip = i2c_get_clientdata(client); aw200xx_chip_reset(chip); + aw200xx_disable(chip); mutex_destroy(&chip->mutex); } From patchwork Wed Nov 1 14:24:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459421vqx; Wed, 1 Nov 2023 07:25:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5V8kaexb4oCY+mhT27EH2l2/IlzIR8qsr0RdofL4OsiKzjmEB7f1umfnnI853og1X9E8T X-Received: by 2002:a05:6a00:2e29:b0:6bd:71e3:b647 with SMTP id fc41-20020a056a002e2900b006bd71e3b647mr15379518pfb.19.1698848731696; Wed, 01 Nov 2023 07:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848731; cv=none; d=google.com; s=arc-20160816; b=xdorFMIFufVgswXLJQln3PAzE4rJRhupv5GYLZ0wjZ1OY+LkFM4Sc2AMO5L6OkDDQN exmSRyyfYeoHZAOU+skOBgfIQsqA0oxpXjf3xaykTzBIbchQMdW574flF6C6+RHIL7M7 nm0OxKj8UT89yPDDE4LrbCpjksNiRByawHKFjtT+I504P44qRqbGGl/XF2R09cYF8s4A f7/pig2pfQyP5nnNHIGVWBss/AgeekmDDC2ltERm30DEPnkXYXHP0ua+Gz8wM+TxqGyY QKFlrBO1ZDJfaspgN81damGCcE291Zia5do9Xa9DbRjY1YuI5El/5+cnYrs+HbNKmZi/ xXfA== 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=Axls6j7FjYgwQZDHrBNQKTEaUgzPNHh03GeTST0E/8g=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=BNcMTKOwSiGsqjZFk8z4C2UNJAK18GNrpri8BLZB26I/lTfi+34wsxxfwHHbX5fe8L N+V2gNOKBoyIHzIa/Ns7BmsDEjhwD30GNugCbfRzvXhVyAZmiWTXIMtij9+rCUgr6Vv2 TeOVrNxBogyf6l2liuoXhLLrIg2uw5CSOLbQAWMriEG3ge0NUNSCGYv+qd7fuX7TD9Iy fCcgLCTmrLQ2sF9lKADCuEFWCuCWy3aK374d/rUAYKrXi9R5gjKWdPlIoY76v9ZqfNla 4rsuosbOGRM1F4MPFAqfvAQMpVIWpMh2CW9qShCHFl7R62NIC20DfvDLcb5rYvIzhrC7 R2tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=QJYUpEXl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t4-20020a63f344000000b00565e7a3342dsi3156994pgj.256.2023.11.01.07.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=QJYUpEXl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id BD3B78104525; Wed, 1 Nov 2023 07:25:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344424AbjKAOZK (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbjKAOZF (ORCPT ); Wed, 1 Nov 2023 10:25:05 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C143310C; Wed, 1 Nov 2023 07:24:58 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 799BC120034; Wed, 1 Nov 2023 17:24:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 799BC120034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848697; bh=Axls6j7FjYgwQZDHrBNQKTEaUgzPNHh03GeTST0E/8g=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=QJYUpEXlizSl96UBdFaG8GG579PTbGYk1P32URtd8TZCWppWtGQ+/kJcpL18+LF0L GY+g9Yfl+vneMxIvrSNQiKTeqzRpsSfUpsoqCTIvzecLp08ad51Yy3E4hH3EF0Zq2m ZxugzEejo1/zzQ8l4I66DWZek2jXj+aIERWzH+sqvcUl/v6bRgUX2pDk9ElN9m7yy9 jmrisR2K2WS5ZZkefmlj5TNsSULNv4OFU38e8U5XaVunQcowC6aezYqOjcbEgYuMb2 UnW+aj1cTRPBMmCF3g1T3hs0vlxoVcR887zq1WYTnhUp2eYp/IqFPBSrA0XF+EoEqp NmsdHzbabTeTw== 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; Wed, 1 Nov 2023 17:24:57 +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.37; Wed, 1 Nov 2023 17:24:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v3 03/11] dt-bindings: leds: aw200xx: introduce optional enable-gpios property Date: Wed, 1 Nov 2023 17:24:37 +0300 Message-ID: <20231101142445.8753-4-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372008094947161 X-GMAIL-MSGID: 1781372008094947161 Property 'enable-gpios' is optional, it can be used by the board developer to connect AW200XX LED controller with appropriate 'enable' GPIO pad. Signed-off-by: Dmitry Rokosov Acked-by: Rob Herring --- Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index feb5febaf361..3da3633a242c 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -41,6 +41,9 @@ properties: description: Leds matrix size + enable-gpios: + maxItems: 1 + patternProperties: "^led@[0-9a-f]$": type: object @@ -90,6 +93,7 @@ additionalProperties: false examples: - | + #include #include i2c { @@ -102,6 +106,7 @@ examples: #address-cells = <1>; #size-cells = <0>; awinic,display-rows = <3>; + enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; led@0 { reg = <0x0>; From patchwork Wed Nov 1 14:24:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459561vqx; Wed, 1 Nov 2023 07:25:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIEEChgGjmYMaRVqNq+cbB5uNp5TYUd216E3nL/EhXCCtf8giCmBOkUu3wS61RhXffqhTo X-Received: by 2002:a17:90a:db92:b0:27f:df1a:caab with SMTP id h18-20020a17090adb9200b0027fdf1acaabmr14340780pjv.21.1698848746524; Wed, 01 Nov 2023 07:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848746; cv=none; d=google.com; s=arc-20160816; b=UlSgLORx8zQcay0ivuZSgTscOLLoUQj/hbG/u7KH1NdMNNIshhZl/ArBVTSml77YtO 44LA1JWPqBNpwiXxUADQsQ3/+kfZGdghNn3CG1Ab75Q069hL6KHtA5dR+TXpqpIJI4AZ gJcayo1T4o4sYdFOJoUitA5mY7PLNxaoVALe2YoFnEOnO5V6MdnPYlEuZFNdVt+KyYt+ JzKKTdsS3XBdeDssCzkZQZupUj25PcpDUA6X+/4fPzACK5aEGEjGERgvPhqM8THDupGe t64wvYh+PH3MUN5rFrZGF+4YJz2M0F30nfeJZd9sK6qZzQJ7Aoblt84HZVTmT8KJJ5gy Onzw== 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=6LKl7eLtMceiITPalU7PJalYT/n5u2oPAhHsbeQUVTs=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=lMwt7nAHGArZ1JJ4RYlzxOQ+M01OsbkVrswf4USGe5fWSOiPvSx6qceyuhHlbH+KPb cDuoe86WZ50jRXh7kMPCgm5/of+CgdmS8zKLvQEcRL5FxhLE9eyiNs4aKc+0i7Z9klXt xdtMTn0a2IakjJBlzfB5/ZMlb07pJ+sItmM+qjQxXbRDVUqahrRLEZNKfwcG9/Aw3+PD Q7y5AxGFjIFkKVbMR5Ij+jTEjFBMpKhnsulZxRw9GCeqJz8FmdsnJKTco3IsJ8yhvzvz g77g/lX6OeZs6MHB0ncO132JFxFRD3L/JjU/MAEgU7yL9zTzsCHjwjhmYpeLXXwdmmi7 0tYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=RPhCWIhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h3-20020a17090aa88300b00280cd49099asi613102pjq.46.2023.11.01.07.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=RPhCWIhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 8B1798106806; Wed, 1 Nov 2023 07:25:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344480AbjKAOZR (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344209AbjKAOZG (ORCPT ); Wed, 1 Nov 2023 10:25:06 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DAE3111; Wed, 1 Nov 2023 07:25:00 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id B165C100024; Wed, 1 Nov 2023 17:24:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B165C100024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848698; bh=6LKl7eLtMceiITPalU7PJalYT/n5u2oPAhHsbeQUVTs=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=RPhCWIhL4l4iyOIcdr+a2E7hmIi21yOeL1c7lAw/BByELi2eSkqtufYYQhZxt4lIQ npuuQnm6R6Tvlul2ghspRi1SauF9X6LPjxxELkT9GnHrURDmrey5KZEZ1GfEz3X2C0 5aEd4yC3QvQo6ZZu5OVo5DGtlpSrzpNc6Wzvr16Mc1R6inixm688zeFlWU6IwE9dwa GsjCd02WavZ9mBOPi92alIrlezGpUe76+3SnzHcz8p5aQnaiBrsyxzG/2SfgqOrR9a QNbmr0QVepH+iAZt/NVQDwFKZ6voJyjkVy1iT7yXMGsnTmXQDF/GTkiY559e5BOuDR nU487UoXBtHiA== 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; Wed, 1 Nov 2023 17:24:58 +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.37; Wed, 1 Nov 2023 17:24:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v3 04/11] leds: aw200xx: calculate dts property display_rows in the driver Date: Wed, 1 Nov 2023 17:24:38 +0300 Message-ID: <20231101142445.8753-5-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372023324377854 X-GMAIL-MSGID: 1781372023324377854 From: George Stark Get rid of device tree property "awinic,display-rows". The property value actually means number of current switches and depends on how leds are connected to the device. It should be calculated manually by max used led number. In the same way it is computed automatically now. Max used led is taken from led definition subnodes. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 7762b3a132ac..aab8898b0330 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -379,6 +379,26 @@ static void aw200xx_disable(const struct aw200xx *const chip) return gpiod_set_value_cansleep(chip->hwen, 0); } +static bool aw200xx_probe_get_display_rows(struct device *dev, struct aw200xx *chip) +{ + struct fwnode_handle *child; + u32 max_source = 0; + + device_for_each_child_node(dev, child) { + u32 source; + int ret; + + ret = fwnode_property_read_u32(child, "reg", &source); + if (ret || source >= chip->cdef->channels) + continue; + + max_source = max(max_source, source); + } + + chip->display_rows = max_source / chip->cdef->display_size_columns + 1; + return !!chip->display_rows; +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -386,18 +406,9 @@ static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) int ret; int i; - ret = device_property_read_u32(dev, "awinic,display-rows", - &chip->display_rows); - if (ret) - return dev_err_probe(dev, ret, - "Failed to read 'display-rows' property\n"); - - if (!chip->display_rows || - chip->display_rows > chip->cdef->display_size_rows_max) { - return dev_err_probe(dev, ret, - "Invalid leds display size %u\n", - chip->display_rows); - } + if (!aw200xx_probe_get_display_rows(dev, chip)) + return dev_err_probe(dev, -EINVAL, + "No valid led definitions found\n"); current_max = aw200xx_imax_from_global(chip, AW200XX_IMAX_MAX_uA); current_min = aw200xx_imax_from_global(chip, AW200XX_IMAX_MIN_uA); From patchwork Wed Nov 1 14:24:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459601vqx; Wed, 1 Nov 2023 07:25:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQFKrvZMvNWQTDqjqOXtjrfKxfgj1LM1oPgCbAl/F0nkOEHmAcSHwzdouQsxM6pbjITUff X-Received: by 2002:a05:6a20:7d9e:b0:180:e2b8:3b05 with SMTP id v30-20020a056a207d9e00b00180e2b83b05mr6442648pzj.52.1698848749124; Wed, 01 Nov 2023 07:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848749; cv=none; d=google.com; s=arc-20160816; b=LiZihsIvudaGFyqxx24J/8QjCam9qTf0h2QLYI2pWYagAhQ5RgMgMVZmLa0EGktewd NweHgyQQTkC7HuGNaX7o/tc5+c/n8TPQNDNtxKV3QzQ4KvA8uYxAJM25FQQuFP/eoCJW atiuW1HhNqvrdxJUP08Si4IItG2pgkzQRDYgUd7Igw2xfJa8e0N3aDTFCzeq2IHLaxtm YzEDPzjvK5DEPlYKAOP4kBLp09hwOGqvDP0YzIED72pBVbeCiFT8qIBpUGXTtzQpg8Qt jO+GsIBxMwiFVDFyOGRuD/SO/tQzy+uVFK8p3czEnDoG4CM0Uzrury9Rpq4f7mYlvixF UtWQ== 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=9aZqnQoakoRLfMLYgr2wRgT/Br89mjgKuUHrpHJK25M=; fh=q8tJCc+t4xrfHrrWgMpr2d/oH9tyqwMogOKhYs8J8ME=; b=mUIj958GBcc9neSMqsRuqfLqDM647zkfnPZv7JMlj4I99dYt4XvxeK6nFMEsVgkulI 7PD4vZp6Pz0KQHZjlr9ttBKUq9m78uf1byytgavcQ+ysCzbMsA6fcp1M1JiuAv46K1cD YSKJjB/pIgoegBLL4BGMqdUF8TIbQoD67juV1FSft/40EJXyoMOwYzMAUCHxZ53sst3V BpN25C+OaPOjlZVU9O2uqyep1K9vnjqjE1/Sh583+UmVgc4vk1CVNXk8WkmHwlGDOkt0 Wsp9apNBK/T8+l3OgxVerinayFd4lirA0/R5jIQkDVtg8emRyiKslwvQ84vz10a10HB0 ZiVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=c7oHvFbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b10-20020a056a000cca00b006910070695fsi1789225pfv.31.2023.11.01.07.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=c7oHvFbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 4D2458106824; Wed, 1 Nov 2023 07:25:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344506AbjKAOZU (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344339AbjKAOZG (ORCPT ); Wed, 1 Nov 2023 10:25:06 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B70115; Wed, 1 Nov 2023 07:25:00 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 27870120035; Wed, 1 Nov 2023 17:24:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 27870120035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848699; bh=9aZqnQoakoRLfMLYgr2wRgT/Br89mjgKuUHrpHJK25M=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=c7oHvFbGNfSgx/hDHPCHD0cR5SCE6n+jVhVVuJo3FBTvkswsbdmYeyYwDt5ekDNFv CbpWU6UNUb+MLcWDpp5W5q3tRn3s3BRyDop+dMdZB44XtYNSj4za1Fx3SC6lv0tTgz jPlbHuoYzyo39POffvybzOS1ZHFAo1squzcjO2oGz/wJxrlNYDXl8uuzsFj/4/Wkwo MqPn/hEd1aaQUWbDbBe90ztz6380iDPPueC3zNA74tD+odT/sKXpVOLY4vtr/1RYO1 evmIh2WrJXjNhfiwjYSnRWIqXQ9KCV0iBxphlCtcQBHDfvcKTY28fTd397F0VhMgpK FJ49D6uGmyWmA== 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; Wed, 1 Nov 2023 17:24:58 +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.37; Wed, 1 Nov 2023 17:24:58 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Rob Herring Subject: [PATCH v3 05/11] dt-bindings: leds: aw200xx: remove property "awinic,display-rows" Date: Wed, 1 Nov 2023 17:24:39 +0300 Message-ID: <20231101142445.8753-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372026008608552 X-GMAIL-MSGID: 1781372026008608552 From: George Stark Get rid of the property "awinic,display-rows" and calculate it in the driver using led definition nodes. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Acked-by: Rob Herring --- .../bindings/leds/awinic,aw200xx.yaml | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index 3da3633a242c..a6dced59599d 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -36,11 +36,6 @@ properties: "#size-cells": const: 0 - awinic,display-rows: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Leds matrix size - enable-gpios: maxItems: 1 @@ -63,31 +58,17 @@ patternProperties: since the chip has a single global setting. The maximum output current of each LED is calculated by the following formula: - IMAXled = 160000 * (592 / 600.5) * (1 / display-rows) + IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number) And the minimum output current formula: - IMINled = 3300 * (592 / 600.5) * (1 / display-rows) + IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number) + where max-current-switch-number is determinated by led configuration + and depends on how leds are physically connected to the led driver. required: - compatible - reg - "#address-cells" - "#size-cells" - - awinic,display-rows - -allOf: - - if: - properties: - compatible: - contains: - const: awinic,aw20036 - then: - properties: - awinic,display-rows: - enum: [1, 2, 3] - else: - properties: - awinic,display-rows: - enum: [1, 2, 3, 4, 5, 6, 7] additionalProperties: false @@ -105,7 +86,6 @@ examples: reg = <0x3a>; #address-cells = <1>; #size-cells = <0>; - awinic,display-rows = <3>; enable-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; led@0 { From patchwork Wed Nov 1 14:24:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459659vqx; Wed, 1 Nov 2023 07:25:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGItR5F3G689yXGnHgqtD3JapXq7T/IvVInZD+h3d8hTgh/w5Jnqq+v4sC7o7YrvaXIelzM X-Received: by 2002:a17:90a:49ca:b0:27c:f309:f381 with SMTP id l10-20020a17090a49ca00b0027cf309f381mr14477006pjm.6.1698848754701; Wed, 01 Nov 2023 07:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848754; cv=none; d=google.com; s=arc-20160816; b=wYua272F03xhSlXR6kV2QuOEAqpa/lVJRjyBk9ygUrX1Xo6SvR25VPrEOXFsg7cQVv sdYMvmFJX00YZcUflzBeSoclxoCE/SPD6A5A2sswc2gFwFZ9Xp9mzcgAubTPH94OAfeZ /QsyAA6fX2MK9af6/DJHJTLtjgb9bEaAoNZ3ukvFo0U/9X0mrDN+QJBNRx+53D2XL+AS prcC5cecop71hMPfv/Wp68/IVC2ImnGMrw7Iu6cjQqe4EYjrdVimh4RTHguMwIW9AODb xV9SuKd1cTL2h+LviPEJFtWU6jIZjvsALoll4qpTSHSe0bt99zNgbiM/Jt24gPyfw2Oc nDJQ== 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=zGbcaAeoOpRXhpYsG9hnKfwX226reF7uQ3cUGwZXb+E=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=XAO8Oj6jG7ecTNflVVsg/CnsBelU4n8qxE89yPQR/vIDrgAWT/P397rRnfSs8T82Wi dcv7LAppYcyZQOPHJ7pIumtABlFCsta7fdzX1GakKPuOhCU4rt80kSfNBXsqKgX9DYqC I7TjfbtH7rvqjJMmudv9Eoiy3U2NBZ74NYyWJY4L6iwD0c703RSS3VloHoxn+4iV/eL+ UCzwY6XH9P7fKBa1m7yaMM6M0ffLnC2KCRwahrJxG0h6RBib2QMhNa5fn70T4idjmAHw hdCItbFBAzY1oXpcb+ft6HjoAN4P+LCEK8pEddMS4+LJQ6Wfc4WtOr8sli6iLkGFI6Mp D5RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=lPijxW4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s12-20020a17090aad8c00b0027ffcd44adasi932479pjq.133.2023.11.01.07.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=lPijxW4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id CFCDA81121E2; Wed, 1 Nov 2023 07:25:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344531AbjKAOZY (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344406AbjKAOZI (ORCPT ); Wed, 1 Nov 2023 10:25:08 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4656D118; Wed, 1 Nov 2023 07:25:01 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id E8D9810002C; Wed, 1 Nov 2023 17:24:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru E8D9810002C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848699; bh=zGbcaAeoOpRXhpYsG9hnKfwX226reF7uQ3cUGwZXb+E=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=lPijxW4YODL7chgvLNjpvWE4X1nlhoslHsYq+Xl1gsY0EUJFM0JHPMNEU3Y8tYmDH TqrjOFw1pnkizEtV5Y/EJJdSLtAG0l2rj0X1v294l/LfjjRVP1oxtFxzTi5WS0urgh +tn0dsPBkkXSOC0mMVqqOaSPraVOciaIMn4PfY+MOLk8WXB2b2Bmadcu3+70mNSzHM OnWsO38VLNRmNXBTlbIEpY+XW8Vbc53oyEmw4eeaWjZsX9Wmo6HWNzDqEMCw/mmO1z tmIhyqelBUwjyX+ijicQf5uS4Nc2Uez3HypHMzTCZU8n85c4LxVr5/Ed8tvZlJV1uv nx6ysT3/skXFQ== 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; Wed, 1 Nov 2023 17:24:59 +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.37; Wed, 1 Nov 2023 17:24:59 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v3 06/11] leds: aw200xx: add delay after software reset Date: Wed, 1 Nov 2023 17:24:40 +0300 Message-ID: <20231101142445.8753-7-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372031764481055 X-GMAIL-MSGID: 1781372031764481055 From: George Stark According to datasheets of aw200xx devices software reset takes at least 1ms so add delay after reset before issuing commands to device. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index aab8898b0330..ae3b4a96c52c 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -321,6 +321,9 @@ static int aw200xx_chip_reset(const struct aw200xx *const chip) if (ret) return ret; + /* according to datasheet software reset takes at least 1ms */ + fsleep(1000); + regcache_mark_dirty(chip->regmap); return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR); } From patchwork Wed Nov 1 14:24:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459790vqx; Wed, 1 Nov 2023 07:26:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENWPjwoIMYXXgKdeaMTxcNFsRsO64hrETovZXyKg7ispi43jWLrD6By3MAJ/R+qP5iistN X-Received: by 2002:a05:6a20:144f:b0:157:d7cd:ebd with SMTP id a15-20020a056a20144f00b00157d7cd0ebdmr21288698pzi.1.1698848768755; Wed, 01 Nov 2023 07:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848768; cv=none; d=google.com; s=arc-20160816; b=k/k0IatR0EEXiJXwlG9kpjNSZGoOCuiOxjozz5XxjzJUXx9Lfn0fkeVjFr11O1l1uG kT7LubI1tGu4MQPElBajbFgvbZF3ypEExoG0lEfIAuaTF1A0SNiMW1xcWIcB/zegnyCy jkIoV5kHtZE2t7zCncxDCVYKlfmP8wRId6J9MDxtheKBzLOr1A1A0Z34o5FxPKtMUDoe Ta5QvmijxCFnlLU6HILKDEthH+cYAGHOEZL+t9Gpp6l00NqWwilcRipKC5G7YDPia3bt qNffgRWyDD7vsj/T0w0pWAVpPoq85HlAk85b1lmJdtW8sZI4UguREI+VS+b9tjEHKd6B z+gw== 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=B8WZ9707tLhAT4qcWsinT/mwN4uaMKqrNK/3FjBnT0Q=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=g265Gg29wVYXqD1CP5HgPry1aRVh1CgDS2FsOLrKLHanwryRXdgXMjYSL1tlv27T9o a21mwfkUvEF/hV6SYBdXM0y/bzITRUsSNl5kx0KhLwY42zI5L+vFMY4pl9AenUM/LDwN TRNC3Uu+q3mHMdl3nI0v8o/SVPcAh5cgdpMWYRTcrkFKRHa04Jt3+XcPfWGlvYpLrBbl Lx6mM+tf1kBCLALG0h9BUu0u8dQYBqZdhGNzVwiExa7IhCWCo6G3q/om3HIUXTD9DmlV fTqcmcf8KpbiVWPlQIpo7COxsV3zOeviMrPvBQq0B20P1ddzt9rIG04vXIpaTHRQ8nYs CI+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=JqxhI688; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id km4-20020a17090327c400b001c9af5305dasi3027123plb.126.2023.11.01.07.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=JqxhI688; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id B774D810662D; Wed, 1 Nov 2023 07:25:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344572AbjKAOZd (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344408AbjKAOZI (ORCPT ); Wed, 1 Nov 2023 10:25:08 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95B87110; Wed, 1 Nov 2023 07:25:02 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 4393F120038; Wed, 1 Nov 2023 17:25:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 4393F120038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848701; bh=B8WZ9707tLhAT4qcWsinT/mwN4uaMKqrNK/3FjBnT0Q=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=JqxhI688PYgmujLn3/rLCXtSTamJcr2m0TZ91OQ7TNydfRg8FpfMyWnKcNZxeChWR hGvcz7Xm5o9ijulsRDmU3QecCY7TOA6j+ot5Xn+hR/4j/XN2wEVm1bT7YAHMx+jYtY qDj3rwLcaZqWxmfeCeh/jDfNrGbvDiV+RVMlcrcjP5OdpvyIFCmzj8VHVJ2V0TBWkY a36l/a9NXJaVYGTUc1NsblfoebmdlGBgw1QBOvRxJUizRVeXqGgsD6x9hZ6lAxjfrs y+/v/994KtJ+V7hmbUR7KO5vMa3rOQAl/LoraG+k0bunELp40/Tc40GkQsWkY3DYcs kNmsh9mspOaVA== 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; Wed, 1 Nov 2023 17:25:01 +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.37; Wed, 1 Nov 2023 17:25:00 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v3 07/11] leds: aw200xx: enable disable_locking flag in regmap config Date: Wed, 1 Nov 2023 17:24:41 +0300 Message-ID: <20231101142445.8753-8-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372046777329521 X-GMAIL-MSGID: 1781372046777329521 From: George Stark In the driver regmap is always used under mutex so regmap's inner lock can be disabled. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index ae3b4a96c52c..b7625f028153 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -520,6 +520,7 @@ static const struct regmap_config aw200xx_regmap_config = { .rd_table = &aw200xx_readable_table, .wr_table = &aw200xx_writeable_table, .cache_type = REGCACHE_MAPLE, + .disable_locking = true, }; static int aw200xx_probe(struct i2c_client *client) From patchwork Wed Nov 1 14:24:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459706vqx; Wed, 1 Nov 2023 07:25:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZngo5JxcPg7flhqyRunWpYL292cLsOyCKuCS/yeeUfEDyJl4Ym9mwJqQNxZBrWsvm9SUX X-Received: by 2002:a17:902:cec4:b0:1cc:5c49:6af8 with SMTP id d4-20020a170902cec400b001cc5c496af8mr8892373plg.25.1698848759115; Wed, 01 Nov 2023 07:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848759; cv=none; d=google.com; s=arc-20160816; b=WdlCr8+eOdUSCfG/rbMMK+X72LAWIITBlJR65nnUGfNBTMHpN5rFH5xF20uC9cY3x2 dgRDcPrCxjOnxThFdv1iQ8CO/jfSFebzqRj/U3hhyHpj0aMFcSyh/Ot2OzvJyvBWI5U7 175PuwYHZ+nOpq5zC/e/TZ1YmwpUm0FvdMkRUbd3zHXzvwFYiV99rr3IVxntda+48Sis /iwezss2fE0abUPWC+Mrps7h1ZFbVdg4o46C4LdHABi5MzboELKQ3SIKGzKaHESVnmwM s1BXKkbn+rP/rxoD+jDQjMkCAoRujI47arWTCusQUKs0n5KagIG5SgiCSQ0ArgN7F3hv 54PQ== 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=5UzFTw0GkjbA5GCoSIxy5Ugy4PogpR26uw1TUsMBOFQ=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=s9msEiBvJ8+E1u7BrvXt3xYQre6nHBo/rJlxz+8wxbIojiKmVMYSWe+djLspbnViht BkuSh963r3m60jx2/jPU0TuJpe6k9nFA7r7YhSncfu2zwXLlyb7lf80Xa4MvVg76bt2C qZcShAozSWYn5CpPAszhCZD1ADEwnasR1FsXXqxzqH+BnWmNe1/YlN1qEYcqoZCjkzWf 9SXd7QjwNUoKcmb+BqPjQu/LZpXx3TFo5pK59F6O8IfTvR78Mu840fvneUb5f7TyUhYp /GrnkbnOpz6kiNaCDwcCkt2SDDp6h0TswZXEFiHLVaKvxGr3kQslagg25g0EoRvGmXYX P1iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=gj1dHCVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i6-20020a170902c94600b001c5f80bf574si3255072pla.487.2023.11.01.07.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=gj1dHCVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 2B41581121F0; Wed, 1 Nov 2023 07:25:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344505AbjKAOZ3 (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344409AbjKAOZI (ORCPT ); Wed, 1 Nov 2023 10:25:08 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4655119; Wed, 1 Nov 2023 07:25:02 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 8806110002D; Wed, 1 Nov 2023 17:25:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 8806110002D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848701; bh=5UzFTw0GkjbA5GCoSIxy5Ugy4PogpR26uw1TUsMBOFQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=gj1dHCVKVIHfvy1ulDvKfG+k0Yln4Z5/P3j/3vWsaSsisNFBnCLbtw1uN9gZaWJhn VpqKW1ZCiuZeuGILDuqAAk6nKFUxRTXlXEdTIxSML7LTwg4q0I3uZ28hFUiIatym0r LyP/rF1UrBYKpAqs7UhpE0r2+CbgeGiqz3aiRepZIB44P3lAPr1H1nYayTFox2RhXk Q45UY3XnfzlV91+ITu3sI1/OGtJ7Uf4WOSp3MtB9pT6gxen4dTkmY7rtr6wKUua8AC N/ukq8BUdMwu5dkyRMPyaTusfMKCRrbNdK4v9XU41IuVbs+0M+V+XNrYhbkGj+gBeU dTmgavh7ZW8Og== 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; Wed, 1 Nov 2023 17:25:01 +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.37; Wed, 1 Nov 2023 17:25:01 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v3 08/11] leds: aw200xx: improve autodim calculation method Date: Wed, 1 Nov 2023 17:24:42 +0300 Message-ID: <20231101142445.8753-9-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372036167688277 X-GMAIL-MSGID: 1781372036167688277 From: George Stark It is highly recommended to leverage the DIV_ROUND_UP() function as a more refined and mathematically precise alternative to employing a coarse division method. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index b7625f028153..899cb1f7ed9b 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -87,6 +87,8 @@ #define AW200XX_REG_DIM(x, columns) \ AW200XX_REG(AW200XX_PAGE4, AW200XX_LED2REG(x, columns) * 2) #define AW200XX_REG_DIM2FADE(x) ((x) + 1) +#define AW200XX_REG_FADE2DIM(fade) \ + DIV_ROUND_UP((fade) * AW200XX_DIM_MAX, AW200XX_FADE_MAX) /* * Duty ratio of display scan (see p.15 of datasheet for formula): @@ -195,9 +197,7 @@ static int aw200xx_brightness_set(struct led_classdev *cdev, dim = led->dim; if (dim < 0) - dim = max_t(int, - brightness / (AW200XX_FADE_MAX / AW200XX_DIM_MAX), - 1); + dim = AW200XX_REG_FADE2DIM(brightness); ret = regmap_write(chip->regmap, reg, dim); if (ret) @@ -456,6 +456,7 @@ static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) led->num = source; led->chip = chip; led->cdev.brightness_set_blocking = aw200xx_brightness_set; + led->cdev.max_brightness = AW200XX_FADE_MAX; led->cdev.groups = dim_groups; init_data.fwnode = child; From patchwork Wed Nov 1 14:24:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459919vqx; Wed, 1 Nov 2023 07:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOqqCsfsGEwoFgf5j6kp39uJ6d7o06L/vgyGY4aH53Nf585qHea2xZoVs5Rwuq6Rgr2Z58 X-Received: by 2002:a17:903:452:b0:1cc:68a5:f388 with SMTP id iw18-20020a170903045200b001cc68a5f388mr4476377plb.33.1698848778434; Wed, 01 Nov 2023 07:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848778; cv=none; d=google.com; s=arc-20160816; b=Covt/r2/gUfxewUDB2AQqXQLse8ivNIZCQwr8EDjxFuDpezHp0cfPOrxLtzxJIz/4F ZvxcuYC+WLyzQdfFEw1YBrO2zPTZMx2hd8IKj1miB3C9PfJhOLUrCFttppW4STNm2626 +lLOdraYgdPgh31UUc777R1PkQ4UGsDsI25GOPtH8zsPhUVH89UbzLr+oAlOTHkebw4K X/t7toWzmx/09n1A0Lol2KXtU58GtLiLuAqf2+CXtOQma8DI5r6TnELVophYoS0nwFCF aOH2EWay3pKMn7Gkk13dE2kHGsd4bSwflc7cytnJRZeqElLjnhp3C5m0j/0fD8uuryxA 4/JA== 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=xnPCIAkCQPNsA1H9p+JVemSqC13HRuIBVmcE4763vdA=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=bJKrRbx8QEmoIGEAh8BfAB5ugMQ8MgB1jOzrLknjw1+ArCX910gfJemB4jvywkAqfr /dWZS6mc7qoiYBCMj+LBypXlU/WAVkPD3AWPwW1knttbK9XcMa3ED1MY1mMib1AczqC/ cHrH5lUDk5saZ9CugD7RbtSlH+M9Odovaq7Syamja49P8HAfeBeczLA7YgkYcRxE12mH 2rKVGwrmF9/MyFAKLKuU/gA5KIMWIaMefiqMKpwJ7mp58iLGGJ+rWAFwb8NldRwGFFWF Lih0cZyCfOVYnuuVHBMnuvF8HGyc46xRvdiI5eKiAFSP9FPWdFg1Cyn8xmtcl08AA1Qa jCIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=eJhpOvSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j5-20020a170902f24500b001ca8e7953besi3019300plc.497.2023.11.01.07.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=eJhpOvSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 1D383811F919; Wed, 1 Nov 2023 07:25:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344467AbjKAOZl (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344422AbjKAOZK (ORCPT ); Wed, 1 Nov 2023 10:25:10 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FFE11C; Wed, 1 Nov 2023 07:25:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 5037A120036; Wed, 1 Nov 2023 17:25:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 5037A120036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848702; bh=xnPCIAkCQPNsA1H9p+JVemSqC13HRuIBVmcE4763vdA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=eJhpOvSYWyxFi2RCo/ha9QkNGkarI2GvAWszgBMzJxqiKNHBqfCKfXxYQhOzd8vMI d3aS/hPRO/md5YYtSMjaFXz9OArTjX79whL97DuiT0jzzW5NrL5QNMMyarTsvIBdq8 jvvw1wWxVD7IjyyMWxPdAZYslnxBi+QOEday0i0vK7msTDUtyUbZQmN4nKHunCj8q3 emRgSNHn1T6xev4HCTbTeTGrqoXS3izR8PuQKaWgDLyW3J2TteQNH62tM2uNqMWIT7 mqBevZ0hS3WgaWotTmDZvE5tm+j8xSQEYE8gR69Pz7M4nOqfDMceGOVF3R8cQK7a0k HAKFNiX3PhsfQ== 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; Wed, 1 Nov 2023 17:25:02 +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.37; Wed, 1 Nov 2023 17:25:01 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v3 09/11] leds: aw200xx: add support for aw20108 device Date: Wed, 1 Nov 2023 17:24:43 +0300 Message-ID: <20231101142445.8753-10-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372056494811554 X-GMAIL-MSGID: 1781372056494811554 From: George Stark Add support for Awinic aw20108 device from the same LED drivers family. New device supports 108 LEDs using a matrix of 12x9 outputs. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/Kconfig | 14 +++++++++----- drivers/leds/leds-aw200xx.c | 10 +++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 6046dfeca16f..a879628e985c 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -95,14 +95,18 @@ config LEDS_ARIEL Say Y to if your machine is a Dell Wyse 3020 thin client. config LEDS_AW200XX - tristate "LED support for Awinic AW20036/AW20054/AW20072" + tristate "LED support for Awinic AW20036/AW20054/AW20072/AW20108" depends on LEDS_CLASS depends on I2C help - This option enables support for the AW20036/AW20054/AW20072 LED driver. - It is a 3x12/6x9/6x12 matrix LED driver programmed via - an I2C interface, up to 36/54/72 LEDs or 12/18/24 RGBs, - 3 pattern controllers for auto breathing or group dimming control. + This option enables support for Awinic AW200XX LED controller. + It is a matrix LED driver programmed via an I2C interface. Devices have + a set of individually controlled leds and support 3 pattern controllers + for auto breathing or group dimming control. Supported devices: + - AW20036 (3x12) 36 LEDs + - AW20054 (6x9) 54 LEDs + - AW20072 (6x12) 72 LEDs + - AW20108 (9x12) 108 LEDs To compile this driver as a module, choose M here: the module will be called leds-aw200xx. diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 899cb1f7ed9b..8b3f560718a0 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Awinic AW20036/AW20054/AW20072 LED driver + * Awinic AW20036/AW20054/AW20072/AW20108 LED driver * * Copyright (c) 2023, SberDevices. All Rights Reserved. * @@ -616,10 +616,17 @@ static const struct aw200xx_chipdef aw20072_cdef = { .display_size_columns = 12, }; +static const struct aw200xx_chipdef aw20108_cdef = { + .channels = 108, + .display_size_rows_max = 9, + .display_size_columns = 12, +}; + static const struct i2c_device_id aw200xx_id[] = { { "aw20036" }, { "aw20054" }, { "aw20072" }, + { "aw20108" }, {} }; MODULE_DEVICE_TABLE(i2c, aw200xx_id); @@ -628,6 +635,7 @@ static const struct of_device_id aw200xx_match_table[] = { { .compatible = "awinic,aw20036", .data = &aw20036_cdef, }, { .compatible = "awinic,aw20054", .data = &aw20054_cdef, }, { .compatible = "awinic,aw20072", .data = &aw20072_cdef, }, + { .compatible = "awinic,aw20108", .data = &aw20108_cdef, }, {} }; MODULE_DEVICE_TABLE(of, aw200xx_match_table); From patchwork Wed Nov 1 14:24:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp459920vqx; Wed, 1 Nov 2023 07:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEn7Dz+XLvTMzgRh+b9vZJvjyQpTNnqNfH5yptKEK6KirdSBevGUAPX7pwx5Rs72eIngqV X-Received: by 2002:a05:6a00:1786:b0:6b6:1216:d8fe with SMTP id s6-20020a056a00178600b006b61216d8femr17551426pfg.27.1698848778311; Wed, 01 Nov 2023 07:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848778; cv=none; d=google.com; s=arc-20160816; b=BGBFjvDOwLZ7OeQ0HvZZuvsbjIxk6QMiLAGmHknED9vYyHFyxdDNPyRh0YhKBcZIqn 0A8DPJMqxX2YCixh+z8u8YsBseLxiALJzydnzHtOjZxUC8crh/P6U0i+JfLvRCEHt/wh tcsZV5ufL0xGIvzyRYpgfN4I3gk1tRRQtgPuR4wwrb+rqNnHIdPqJBLZZv3MpohWDD3t wAzA0uZLJ7I6vgR2K6h3slaQpnfwO2rCLJD1SekDFBBGe5XO8uegHGuLUjZQ3a2W589e R9/hYRk/fcFeN1nZPssohAf2pUIGuQLJHiDC0ZUcTX02QNFTdtdim+EirTgszC3Tkj1+ yjYQ== 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=/HrW0X+9rW0pBeZMX5Q2JYjOL2DcSt6189XJga8hqTE=; fh=ecYjSVsEaQMbTnaTu/+DTwj3c3t9fYUUx5n+FbwgIJA=; b=kbqiGEVy4Zq/fOdPHhEXvEnYCWPs2f0e52ZAYTPa8rDMZmqYUZ8S/uXYow3eT8QTtv 7NWfEzcy70m2nWDdxuNwmULyVXYwvyiI8dblMIa9ZbHjnssfQE7uHCJKV6OOk/TbgP8A rAR4LQthcJE0VvBS4JnvBshv5UqGlfBCCmSb5NqTV12IYL4UNeuKGkR4AnAogV+ItmBA NDP4RcjYBxQV7dOC6hNwHzXYGS18QAG/5HE1u7yc8iLFy8k8ehR6zkqbBFDX1xkgW3HK LIGdidAzDQwukxeAhHjiBpeuCmDWIZreIIij6rbvkTDAJs2cCWpMrHXJbLZIK+016ie8 WbcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Qjlnz5Ru; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u124-20020a637982000000b005b8ee4c9237si3090686pgc.236.2023.11.01.07.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Qjlnz5Ru; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 91229811F906; Wed, 1 Nov 2023 07:25:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344498AbjKAOZg (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344421AbjKAOZK (ORCPT ); Wed, 1 Nov 2023 10:25:10 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7816D10F; Wed, 1 Nov 2023 07:25:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 29A7410002E; Wed, 1 Nov 2023 17:25:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 29A7410002E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848703; bh=/HrW0X+9rW0pBeZMX5Q2JYjOL2DcSt6189XJga8hqTE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Qjlnz5Rux4M5iRYqu/T6EMthSGi6Z68r7a9NEJn85znqnQeZql0P8OVRlcRvHvz2b pYrHAsM1zT9vfaW6LJLgFfMmwy0yBrOVXI5LZgffJpxMnu3Cxkg6Qgf9uAVmP/yX75 hlfTtecfvS13W7dlIUsYpYKXXr0xxkygmi0stS0KYZ4rvWcqtETooPvqVnkoW2AIIy dUfCZpPToMgMxXanzdaahV9TisxVf9wV5bMGWXorUw3YYsvJTCsGZ5njf3u1Kt32fq 9LaDh+KdtzO5ARB0eBRbu+9wXEKIU5hVPpLEVf0+zIEo+hOEJmIDSEiH1aB6NojiRc rb9pBCwUgWKSQ== 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; Wed, 1 Nov 2023 17:25:02 +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.37; Wed, 1 Nov 2023 17:25:02 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Conor Dooley Subject: [PATCH v3 10/11] dt-bindings: leds: awinic,aw200xx: add AW20108 device Date: Wed, 1 Nov 2023 17:24:44 +0300 Message-ID: <20231101142445.8753-11-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;www.awinic.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,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, bases: 2023/11/01 11:35:00 X-KSMG-LinksScanning: Clean, bases: 2023/11/01 11:35:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372056570668728 X-GMAIL-MSGID: 1781372056570668728 From: George Stark Add aw20108 compatible for Awinic AW20108 led controller. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Acked-by: Conor Dooley --- .../devicetree/bindings/leds/awinic,aw200xx.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index a6dced59599d..67c1d960db1d 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -10,15 +10,19 @@ maintainers: - Martin Kurbanov description: | - This controller is present on AW20036/AW20054/AW20072. - It is a 3x12/6x9/6x12 matrix LED programmed via - an I2C interface, up to 36/54/72 LEDs or 12/18/24 RGBs, - 3 pattern controllers for auto breathing or group dimming control. + It is a matrix LED driver programmed via an I2C interface. Devices have + a set of individually controlled leds and support 3 pattern controllers + for auto breathing or group dimming control. Supported devices: + - AW20036 (3x12) 36 LEDs + - AW20054 (6x9) 54 LEDs + - AW20072 (6x12) 72 LEDs + - AW20108 (9x12) 108 LEDs For more product information please see the link below: aw20036 - https://www.awinic.com/en/productDetail/AW20036QNR#tech-docs aw20054 - https://www.awinic.com/en/productDetail/AW20054QNR#tech-docs aw20072 - https://www.awinic.com/en/productDetail/AW20072QNR#tech-docs + aw20108 - https://www.awinic.com/en/productDetail/AW20108QNR#tech-docs properties: compatible: @@ -26,6 +30,7 @@ properties: - awinic,aw20036 - awinic,aw20054 - awinic,aw20072 + - awinic,aw20108 reg: maxItems: 1 From patchwork Wed Nov 1 14:24:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 160562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp460113vqx; Wed, 1 Nov 2023 07:26:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZFcx0ixAlKlKxAUZuyEb/sIOTTfLnHLExmzwevRK8Adptt9aTHiWx6ygqCS7bk9V6Gzmu X-Received: by 2002:a05:6a00:18a6:b0:68b:bf33:2957 with SMTP id x38-20020a056a0018a600b0068bbf332957mr14942162pfh.22.1698848796712; Wed, 01 Nov 2023 07:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698848796; cv=none; d=google.com; s=arc-20160816; b=FcFRT6J6bIq/ouUpbA4Tj+1whXwbJlEFwkOLRRVnJXRQB+bzApCP3lxgQdSttdxtcc lOQLqM3G6xHmc+SxBHtFDUEzF0wRnaDQTvm2mR3WCitLg9gmlbbqgQJvGT4zrL3GiR14 pJOx/lQDHsoc8Yuzx6lisR9o4tEsRaUFQ8A4ntCp7VzKHb2xhMn1nDg/Wqc6+71qkjju D95XYDRpIudxeyHZwm/lMg5cts2vdgSj9Tflpbtaa4aXsRHdbADgrcjtn8wMb3V5KHcL L0flY7muSIFhQsVaN9Mpn2Q2CNGT9ZzEcVkzCKlUaT0lMQXp+KYxxOt1VI8U6x4eG+ZP njXA== 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=UZDYWkxi8+nvXNyxR9IKdfr8PwqZ7IbcsARIkKGC5ys=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=LJtZTNEVFHqyvRMB8L9ubz/54/QjrhRtTVDTewvSA2Yqf7JNV+aCCJ7Dc2jbd38lTf 33WXWGmqHPpwHd+o1JgYiGtEavdZimFMif0yOSeCP1VNQEvu0AydESZwiIYzOy/3/d2N FVtl8tooWTk2Ll9r/MGGadBNc42H//cZR5kQE8QOdpfRep8jOtd/5NRf6JHyVEmO3lPN kap3WFyKacKd0uvVNXEd4Ouf+bYv1Jks2gL5flU/TyR7a81rLzKdwdtDv6tKVZaDk7f3 y5QRQruPSh5E40ThCCWTTjrFPm/07Milxs8cVH/fobmc/F/027fYzzMGFd8wjBgrsaUw bdkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=EF0M8E3c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y13-20020a63494d000000b005b99bfe3301si3197989pgk.462.2023.11.01.07.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:26:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=EF0M8E3c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id BC03B80C9C88; Wed, 1 Nov 2023 07:25:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344449AbjKAOZo (ORCPT + 35 others); Wed, 1 Nov 2023 10:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344444AbjKAOZM (ORCPT ); Wed, 1 Nov 2023 10:25:12 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A1D211F; Wed, 1 Nov 2023 07:25:05 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1383B120032; Wed, 1 Nov 2023 17:25:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1383B120032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1698848704; bh=UZDYWkxi8+nvXNyxR9IKdfr8PwqZ7IbcsARIkKGC5ys=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=EF0M8E3csQIaK7teJ8ijWDcGMAjHnra75G/muh9hXsLQ7OVaT22LwiB6rXGklNd0A 6vDqLiRFSEZY/GqZ90GnA/MeHT8ss9KXRZK7+RjCgTCcLxrIw/xe4jnwHmmyByaJC3 0v5v4EaUtCbxI7c3JjD8EGo6lc4dmqNxGNTp17TLvH9lDrZRZgHn7VZLyf+IAzBUv9 pv5cEUSX4Z3gFpjWePypuZBdzJQqwgeh9VOOC+pfaDibLp/KVekDaWZNIRIaTCHNDJ puvInaFYGxv/6hXJTPoeyK32VPy7sjgWG3Uisnf5vuUzkUQOo3l6vLeUYL06Pu/PRX SyZyGJ3LgttMw== 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; Wed, 1 Nov 2023 17:25:03 +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.37; Wed, 1 Nov 2023 17:25:03 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v3 11/11] dt-bindings: leds: aw200xx: fix led pattern and add reg constraints Date: Wed, 1 Nov 2023 17:24:45 +0300 Message-ID: <20231101142445.8753-12-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231101142445.8753-1-ddrokosov@salutedevices.com> References: <20231101142445.8753-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 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: 181053 [Nov 01 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;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, 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/01 13:00:00 #22378131 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 07:25:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781372075999974417 X-GMAIL-MSGID: 1781372075999974417 AW200XX controllers have the capability to declare more than 0xf LEDs, therefore, it is necessary to accept LED names using an appropriate regex pattern. The register offsets can be adjusted within the specified range, with the maximum value corresponding to the highest number of LEDs that can be connected to the controller. Fixes: e338a05e76ca ("dt-bindings: leds: Add binding for AW200xx") Signed-off-by: Dmitry Rokosov Reviewed-by: Conor Dooley --- .../bindings/leds/awinic,aw200xx.yaml | 64 +++++++++++++++++-- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index 67c1d960db1d..ba4511664fb8 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -45,17 +45,12 @@ properties: maxItems: 1 patternProperties: - "^led@[0-9a-f]$": + "^led@[0-9a-f]+$": type: object $ref: common.yaml# unevaluatedProperties: false properties: - reg: - description: - LED number - maxItems: 1 - led-max-microamp: default: 9780 description: | @@ -69,6 +64,63 @@ patternProperties: where max-current-switch-number is determinated by led configuration and depends on how leds are physically connected to the led driver. +allOf: + - if: + properties: + compatible: + contains: + const: awinic,aw20036 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + items: + minimum: 0 + maximum: 36 + + - if: + properties: + compatible: + contains: + const: awinic,aw20054 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + items: + minimum: 0 + maximum: 54 + + - if: + properties: + compatible: + contains: + const: awinic,aw20072 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + items: + minimum: 0 + maximum: 72 + + - if: + properties: + compatible: + contains: + const: awinic,aw20108 + then: + patternProperties: + "^led@[0-9a-f]+$": + properties: + reg: + items: + minimum: 0 + maximum: 108 + required: - compatible - reg