From patchwork Sat Nov 25 20:05:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169777 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134495vqx; Sat, 25 Nov 2023 12:06:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhSkO/nw9/1ZaYBuRyqX251tvXzvWkFuB5GpcUG+82/y9ZmfprhAEvxPqM/ymiIpu9Bt59 X-Received: by 2002:a17:90b:1e4b:b0:280:99f0:4234 with SMTP id pi11-20020a17090b1e4b00b0028099f04234mr6903354pjb.7.1700942805687; Sat, 25 Nov 2023 12:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942805; cv=none; d=google.com; s=arc-20160816; b=mPdor8mgqr+051dqkR+vMYdpjCjFbEOpwmkW6U3Fdlu6j8acOsC5qVQLgHvUw+9Fjm FctuKnFQmv44kSVLssmKeFjGdEohPzsS7S8jezvBHNA67gM45RGaYGS9YVMRn5J30GrL 1nM7KuKRS+R2i4cZMWDyGuiTg9weS8TCCg0dJRuBGbNEW6dxsOm9YU6WcOydRwqVzioN uO1YVmkeRQmdse0O0wFqkgHYE1crXgioGNR5e1wTw6BapueMaTWEdu4oebCduk7bPk10 werDd/kDTaKMFF/BMqpbw9Q5L2OZrY2aX6xl7QF83kPneo/SNcjsfaA3Q5nHFHgDnnFc DRCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=mkwWrSYE8iGwyM0nDydYiIJ33/1CJjkCCTxVGacOTqvHxvRhsjLs4IB671CSqvKhgp Te5pk9SGgzKEEzI0STlIKhUVI/4NxOkdFPPdLniNSUGzAD5DvH2dNbd1vmh+w/YUXOqv +t1klFO2CQdj5FmgXx/eX8gx2GMcVcDye3dC7n347IU8avb+vP6SvzgZDWj2swZT1Xx4 3IQiBmhDlgm+YKntbsS89z1jWgkr0dmLjrQ+QGkkBZ0L0sFapqxXyj+lo/BamcqeeKa8 uqP6O+j9mDy1SYVgV4X6V42NJSKQREGm5PJu3u1vOY+esfFJ7NOrAyZhb/jnu4VGZMKu DZog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Vf3sumlO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id jj14-20020a170903048e00b001cf688a2854si6223816plb.371.2023.11.25.12.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Vf3sumlO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 47AF8807C854; Sat, 25 Nov 2023 12:05:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231659AbjKYUF3 (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKYUFZ (ORCPT ); Sat, 25 Nov 2023 15:05:25 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC62133; Sat, 25 Nov 2023 12:05:30 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id D24D510001F; Sat, 25 Nov 2023 23:05:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru D24D510001F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942727; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Vf3sumlOgZWhlZy1PHPNxhCcH7oNJzqTz0K9ICC5PboBhNpBJExGtrL7T5KzCyMdT QUoDPm6hSaEoNRciaq0dNp+OVPwjvZViGk8anpjq4RwfZCNAJC4WnOzc2DJ0njyvxF sdMrtEydHigjPwpDiNU2F/vZf4QauenuGxdOJKg+Y0GL7E+0vCjF00R+wMNrDi+mSz Mdxlyc6j4VEC4JNNCtX2QusgiEu1vwgz1e7+kw779jysPC/WqHW1QW4ckR7gK8P1Rv CSogETZkTxr9Y08f31BrauTrSA7a4vIYj2R1g0vZbSaAmKE5sE9j4aPWXP5/5evizj ZUz7eWpd0bFbA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:27 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:27 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v5 01/11] leds: aw200xx: fix write to DIM parameter Date: Sat, 25 Nov 2023 23:05:09 +0300 Message-ID: <20231125200519.1750-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:05:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567803641430955 X-GMAIL-MSGID: 1783567803641430955 From: Martin Kurbanov If write only DIM value to the page 4, LED brightness will not be updated, as both DIM and FADE need to be written to the page 4. Therefore, write DIM to the page 1. Fixes: 36a87f371b7a ("leds: Add AW20xx driver") Signed-off-by: Martin Kurbanov Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko --- drivers/leds/leds-aw200xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index ef4eda6a09ee..842a22087b16 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -74,6 +74,10 @@ #define AW200XX_LED2REG(x, columns) \ ((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns)))) +/* DIM current configuration register on page 1 */ +#define AW200XX_REG_DIM_PAGE1(x, columns) \ + AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns)) + /* * DIM current configuration register (page 4). * The even address for current DIM configuration. @@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr, if (dim >= 0) { ret = regmap_write(chip->regmap, - AW200XX_REG_DIM(led->num, columns), dim); + AW200XX_REG_DIM_PAGE1(led->num, columns), + dim); if (ret) goto out_unlock; } From patchwork Sat Nov 25 20:05:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169780 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134608vqx; Sat, 25 Nov 2023 12:07:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2mVzo8OmUTWXlZqZb7SqTx+Twv21c6T7NIEj7c/VGshpGbCq8JBU5jm5+Xg49rojfV7GN X-Received: by 2002:a05:6a20:3952:b0:18c:2315:d5a6 with SMTP id r18-20020a056a20395200b0018c2315d5a6mr4707009pzg.51.1700942823789; Sat, 25 Nov 2023 12:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942823; cv=none; d=google.com; s=arc-20160816; b=h4Tk8ibAn+zAjgY8pBNYsB/sNL0306Ab4EGAAmfv0NJbj82Rm9J6egyzSE/WBOzCUW V0beNXFT9jJPOkFVrxenQnkuoOvpsqgt7hnlQ9M1ewUjzce1fsKV3Y2hBJ0fb1KXAwUv /UWbQDwNLimbXaIUC+Fg19BialFp5wG9o9dCZ83oyt86IwVwEcqwkO2u0W0qVhMJKpbf 21DgJyFn+Z6XIVpO09rMesuqngkAq5JTRBr1ruzca35TLaemsYUs13NdxOwH7BwL6tz8 37Tq0Kulh/X35Gv2ftz05dXWEf1gwY9Po+Zg5uUE/BFVZL8Ibe5msxEhZIXNUnYdKNiI kgMg== 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=k2ICLTg3g/YTKg9a+5BAKN9PM/DviSRtbLaUHvSu/7s=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=0tuOGgs4fAeGTQj9sg+2mz+0rh31vcPWo0dp1fIO/h8p6YVxNu2kHf7xixJZ/WQ55B iu/MZi4kezHZQFP+DiOurl2SgEQ7enKFZoTPJS7oyCmqYyeC4GeMVnapdpYaCuA7amcd 3fj7uyfNhEJYoUMWf92ov/YEb4IuqjeO7g3agaU/zwBCGLRVRDu5lpLYJNTWz56hYc1j MO5jN5h4n4rvMIfQEr80BOWha0dzZPXQGw/LiCOom6XRuBGOk0w/g7nyCbJ+BeFa+szQ xxQu8KzoUY6j90nF1n3AfXygU5TYdiIaMbJ0MRdWDUdWXMBu/V/xeK2cbYefCT3ADEvQ QyCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Xtyijmev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id b18-20020a056a000cd200b006cc07022e9fsi1572651pfv.57.2023.11.25.12.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:07:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Xtyijmev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 1E0EB807C5CC; Sat, 25 Nov 2023 12:05:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbjKYUFd (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjKYUFZ (ORCPT ); Sat, 25 Nov 2023 15:05:25 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AD4513A; Sat, 25 Nov 2023 12:05:30 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 70487120017; Sat, 25 Nov 2023 23:05:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 70487120017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942728; bh=k2ICLTg3g/YTKg9a+5BAKN9PM/DviSRtbLaUHvSu/7s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=XtyijmevGQoKjbUC2xSYcctSxiEiB4odz4Smi17w6Xt3n96XzrQV1V3iABtDcJ1UV HxGMUQGbi26wt08hfqEk0CvQ/f4ck8mORxAoxOT7cJO6Sv3y/a3ae2PpoGNtnp1dL6 vmGSOu0CTRPjyiUxcu2T1CL8PR0FPR8KpA/FUpQsvm3xYG2fcng+kDgOC/djvapfqB 6hk8xIJ/JV0r2QiMwXqaoKKTo7Z+HUc6WtOcNDDQjwHX0rJntG/zuPYfZ81kfQKBzg gH7W2ZZ3gQCUP9bseWUz93tIYwOpT8WGjwPnu8LNVhcb3+gvpJs85Luhkd3Eimmz9/ ugoTVHhEUHZbg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:28 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:28 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v5 02/11] leds: aw200xx: support HWEN hardware control Date: Sat, 25 Nov 2023 23:05:10 +0300 Message-ID: <20231125200519.1750-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:05:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567822321925722 X-GMAIL-MSGID: 1783567822321925722 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..d8f2fe57cbb7 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 Sat Nov 25 20:05:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134616vqx; Sat, 25 Nov 2023 12:07:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHa4VoEjAfm6midRgPYLVM07Qu8GsXjs2CKUw4ONixoMjyWRMrnlPzhI8JKf6W9kd6XLOwP X-Received: by 2002:a05:6a20:8403:b0:18a:d7a8:5e5a with SMTP id c3-20020a056a20840300b0018ad7a85e5amr11858059pzd.58.1700942824848; Sat, 25 Nov 2023 12:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942824; cv=none; d=google.com; s=arc-20160816; b=lSTHF20ySdf89G8bFZjAUggnvXasWKmI/fTiULANIETC0vz73vrEZEeUUk4UdvjnW6 oihj7o1pGIkiC94+Xsvsv6FOftWKW2yqszl9051dkMNq5brxIZ6xEhOnVVwpNG2y2Elb iIncY/1BBbRgYs+mWzmkOaTbInzkkwtVGE8l0NugTfU6brSYx2ZajR+x31zZ+Tv/aZTy 1e2VVuXZx19ktEELBdda0dih6i+rJtqnnWZEtzKGWkXb0+KXEfnWBGVS+pd0muWxxODd M48BlscmWbFmV99ecAFTX1CS//I31m7upT/V9LBgwFa4T6PP/WNRVrhXAgczqq756DGU Nv8A== 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=j/fX6YDIQyQ1VIymrunLH5mwmh/dqGOmhqXkwzfUmIU=; fh=ax8ncoCgpVc9VMl0RZ0v/C3TReFJ9roPyLyrcfHqPeI=; b=P+ITVS99qCse03L/JhVfL1KcRTEWnMpJkFHrIbRZlfD4vWR9WtMfyeqVlnAqihH+4t NqSM7E7n7ZSs/3g7VNTbqiTy88iOx7rH3mrQLhW0LQ2MdQpc0ESLnOJJ4yICPoYqIYf9 KpjVv2FdAUTBqGb0W4lhiBfiEcvRVrqp/g3iFWBiqipp0OebX5yrp9veZspIzU4Ai3g/ MBFjG4j7/Uv8MkQUznrDE8yeXKKjrJIpCibFwCehrhHuojmTyj3SDo/omSfLkNZyzNcN /4kZZrE/QcfDah7ALheRnRyUcYwA9n5YeSe46ADOAJmviF35p6fHV0cl50bxjMJp5UFJ NTlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=qY6E0jc8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id s17-20020a635251000000b005bd85b32495si6415546pgl.685.2023.11.25.12.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:07:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=qY6E0jc8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 0ED388087FE8; Sat, 25 Nov 2023 12:06:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232361AbjKYUFv (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjKYUF0 (ORCPT ); Sat, 25 Nov 2023 15:05:26 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED9913E; Sat, 25 Nov 2023 12:05:30 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 015E9100022; Sat, 25 Nov 2023 23:05:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 015E9100022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942729; bh=j/fX6YDIQyQ1VIymrunLH5mwmh/dqGOmhqXkwzfUmIU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=qY6E0jc8xIGFm1MjjrXwby0mkNJtjR5PTe4DAeI8VK/Tb8FI+60ocr9dq4aSmWXFv ZSQQILcUKk6JTHh9MwzSjSinO3WRIA51SD8nReiqslSaaXh7+pyJ55TV1pgv2oHOhS H+Bl3e+XI7vgwtJCbWSbPA3+foJUP7NJK+MrBF/YUaHRiJsCeBjJsWTpdDCLoqM9ty Ec5+IgK9YlYwV8aTc8NGSZDUBDU2wnRvrhvN+OdEJE5iYWSlZVzbNPGhtmguyvfLm0 u3REjKySbzSvwND7UXzX8lVBJj1JjyjANGURp1JQp0+vsy4/yhLKy2FVkk/uffA2ah URFnNmvCbnBww== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:28 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:28 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov , Rob Herring Subject: [PATCH v5 03/11] dt-bindings: leds: aw200xx: introduce optional enable-gpios property Date: Sat, 25 Nov 2023 23:05:11 +0300 Message-ID: <20231125200519.1750-4-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567823288039804 X-GMAIL-MSGID: 1783567823288039804 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 Sat Nov 25 20:05:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134566vqx; Sat, 25 Nov 2023 12:06:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiQEaOv0uVQs2XP9f0tijPxFg3ODcxNTFRxGeXhqouQ9e7994lasv4cjJzfhGQz2+PHHfH X-Received: by 2002:a05:6808:2228:b0:3b8:635f:e4ef with SMTP id bd40-20020a056808222800b003b8635fe4efmr1133528oib.3.1700942818337; Sat, 25 Nov 2023 12:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942818; cv=none; d=google.com; s=arc-20160816; b=tQBBp0GhnnVO73rROZ/3rHZSOa/p+SEQK7NgHGni+vXHNx6JIE16eJqiOQ4VJF76rD Pm82msj9/VPUmU1xEBuM73VuHgwOdYMwY3W8F9AgL8GH5TY8AG+hMbFjeWSHhSeHtAwK sGYKoKX5HetDfntC6279Y8jvNk6utVREn0zMiR0NtOoadbNlHtHkph5URTm7oX3rV7Kt kQcPr6cFSTiGkIzmO72qQXd0iEf2V9M6ViRIHaNgs4AwsRif61JKwavONrww0szqSNRy a45m5jbmYJLNpMLjv3fjJcy/6oTEAio5o28lHbNnJ0cKWV39lOASXyLyVovNSco+gb4R iFeQ== 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=BXsUy6knDdfRassvseCqdaHwjejZFvkBLqoOvbLPVsc=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=tCXcsVgFLv0tMiP4tH3ydKrn9CkKX7Kxx9MOGHbYct3McwX30TlXHqPWK1Riy9XeK+ h4u1S10o0VnkZRI5RzhDyRDWaAj1kjMSVGiMFT6jhqEQlpV+Y2BlHekzzITjSb1w3cs/ JPZlfu6ME02Iy2gfEBbeYZwzVVBO82aIXQYJEJZk93pbA1U1uOzMj8850Gr0+Uafn0f9 vGT2pUpaF9wERSdZjhMtvS+8wUALgm1IQRzt1AGKNjBIrsiIOjbBV+DWIoucS2z1xnpp +33OnwqaxbUpYmeuZCpzYEpfrTepj0q+BJrNIECGvsUtjR0lcaW6m9jwhzA1+H/98HQq CePg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=mq6VVJqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v8-20020a655688000000b005c1cd55beeesi6237249pgs.435.2023.11.25.12.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=mq6VVJqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 3F59C8072A25; Sat, 25 Nov 2023 12:05:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjKYUF1 (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjKYUFZ (ORCPT ); Sat, 25 Nov 2023 15:05:25 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE2EB119; Sat, 25 Nov 2023 12:05:30 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 847E3120019; Sat, 25 Nov 2023 23:05:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 847E3120019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942729; bh=BXsUy6knDdfRassvseCqdaHwjejZFvkBLqoOvbLPVsc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=mq6VVJqwpX8ISnyXUDlWPJHrCHZILiiqQfHI/zeHuCcOV44V37+apPrp2xDSGBqrb VjDPgEzAwT+6nwjVBsS864I22jMrVbHvZdYKedq/rFaULXAOy8mccm8f92UYxAVKJn /cGOab/UDyC4w3K24Y7ADur0mJ5Tjg5gvhL+XQ1xOcA2hR5Bk8/NEnTfMG8M5D1XHY at9enUs0tDBXftrxju/Ms1YaVFRC7mMSHPLJIPBi9oPPGWmY3ARumhZnHPWfpwBMQH JRtdV07cCJkdqXc+4+dWcsxrttGyncE0aTdhzLFkkSZBjKeRVgAoEn1tABfLzsIZFP XHGfbewUorPaA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:29 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:29 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v5 04/11] leds: aw200xx: calculate dts property display_rows in the driver Date: Sat, 25 Nov 2023 23:05:12 +0300 Message-ID: <20231125200519.1750-5-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:05:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567816572338212 X-GMAIL-MSGID: 1783567816572338212 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 Reviewed-by: Andy Shevchenko --- drivers/leds/leds-aw200xx.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index d8f2fe57cbb7..91ba580edf87 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -379,6 +379,31 @@ static void aw200xx_disable(const struct aw200xx *const chip) return gpiod_set_value_cansleep(chip->hwen, 0); } +static int 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); + } + + if (max_source == 0) + return -EINVAL; + + chip->display_rows = max_source / chip->cdef->display_size_columns + 1; + + return 0; +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -386,18 +411,10 @@ 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); + ret = aw200xx_probe_get_display_rows(dev, chip); 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); - } + "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 Sat Nov 25 20:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134424vqx; Sat, 25 Nov 2023 12:06:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9gKHy6tzLSY7VBe3K2JGyXXXDnf2X5gWpzfdsLMPW4sVmRe/qrIGVs1fKmPGkpeukMNiV X-Received: by 2002:a05:6808:2026:b0:3b2:f275:18a8 with SMTP id q38-20020a056808202600b003b2f27518a8mr9176146oiw.22.1700942799326; Sat, 25 Nov 2023 12:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942799; cv=none; d=google.com; s=arc-20160816; b=oxJu5QByJpeK+/QDIo3Ls1DWnRkRuEuwSq7g3ZDVWsgSyy8Fwb7zQPM4IMeenZCJr+ Axi7iRulOveTbOVqtnjIHypZW4SAWG/UUCrcOFpzPbknciuLrC7DChU1kWfLEpYl7VMT t4isnoZG1qa/mInkLD8EwZ7YJBMUVUchDxpWvtL0kOKp9bYqhu4u3vh2GmTrsMR6YCK5 IEkBthpvONzcisOvL6VAY90yhQVEmlGe9/a9lQWdA0hFkCxDpa3kCRajo9UBRSnHPFor JUUKpeeO6E4Vm+sS30vYsiNi46bvFdnDqyo3KeS9N6agOAtukYPCFF1L8rjZIuWHa/vq fW6A== 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=vVKag5AKmiUwIpk+LJ8ppISXcHizMkbzNWnrmqOv0S/+rA97VRsaptbVr0jfbpuOnJ LY7JkDzpnpNLBsatHliF9WFPJCurq3B7DavSPN2xwQTKHjTwb7RtQTPp3qdrDpQMRWmk TQXJ22fNXVHtBTSdNCzkGuQIy6WWBa7pDzpFicfGmF6ABHMregcELm/cxN0XSgub0SBy IhCH0Bp82IfjCiQv8APuOAGRPoe2K5iu7s+kPFK3YmAeHBHZ79rnNIZnCGgdGXtYYT8R BlEc+DZU6AWy+aDm+PIEva1LT/Vt6lEwrh0R0wq2JLW2EdKp8ha0N95v0RHZWh1rkpIt uXEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=psEyE1K7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o66-20020a634145000000b005b8eaeabf49si6890611pga.178.2023.11.25.12.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=psEyE1K7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id F160B801D4AB; Sat, 25 Nov 2023 12:06:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232378AbjKYUFl (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjKYUF0 (ORCPT ); Sat, 25 Nov 2023 15:05:26 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D68FE1; Sat, 25 Nov 2023 12:05:31 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1571C100023; Sat, 25 Nov 2023 23:05:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1571C100023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942730; bh=9aZqnQoakoRLfMLYgr2wRgT/Br89mjgKuUHrpHJK25M=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=psEyE1K77ho8Ff3+T8aehAYJcwzabNUjOiinlKOp/+9AVHC1n7DFmyTkCF7/Jcfsa d98zxvUQwSvGwMLmO9QTQfb5CEkpYjfYMBvOnhurXS3k0iruB8L2+4mNEi2PdMjXLy vSfDa6ZzwXDKhYpOrdBUGB9lytVLv/03wnF0oZMDvGGli6fpnt0rKWHofOOKqBo79k fc+LOZJl5GTsZcOhEyMpM+uax9OlmPE00eIcdony3Vd6cyDq8sULHUNqLQ3NA6IOFH kwIluOYnVXlhK9KoJTl36dslIZq9DlYo9q5UriYReXYdW2bOAAVydrGZUdUFamU+LT 3RHYov8W46WMA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:29 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:29 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Rob Herring Subject: [PATCH v5 05/11] dt-bindings: leds: aw200xx: remove property "awinic,display-rows" Date: Sat, 25 Nov 2023 23:05:13 +0300 Message-ID: <20231125200519.1750-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567796767904700 X-GMAIL-MSGID: 1783567796767904700 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 Sat Nov 25 20:05:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169774 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134352vqx; Sat, 25 Nov 2023 12:06:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+XByjphjtDkoLcfoNJ4VlH6NChJERiZkkkoea01huizW2XWvvt6+CSC1Rm2fb05tS4Wzs X-Received: by 2002:a05:6a20:8401:b0:18b:9f43:7d75 with SMTP id c1-20020a056a20840100b0018b9f437d75mr8382620pzd.17.1700942791001; Sat, 25 Nov 2023 12:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942790; cv=none; d=google.com; s=arc-20160816; b=aklngGMGWXQexGWjD4adYyZY98/1cCtJTCFEBt+U288oG5SjiDHGxyoaYitqMKjtbn weQ3FwcKaRyhysvbwaWFqNGAGERXNKI/ZYxAj9JCSceYIufm2wkq7Ca7FvHn7gvo3Rq6 WVrHspd7nuOrQi0CK+vUrHBBnAu84yjZ+RVmjQarv0CD7ij4porMq9rZ/b0fzFj9k2fO vMld8Dzt2KT3DpWSDqpXGSas7jKau3nwO7JPL4LOx6iSPCq5HjbYTMF/X3H0KG8NhDh8 qfU+Vuov5B64obBivYRYiwm7YEYq+F8HDa8KTpGg1d9JmTa8AkWhqk6/Lo8ONn9FX8XX 9H8g== 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=6zspnyJz+nDF9opMh33IY/7Y1KILTXZl33bwU29eAWw=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=USJkRfckpLUYbF14Vzsq0ZICq0dQF7OugtCPbnxT6fRUKDIA48PGCY+CmIvDep1z/J c4MJRSAEbM4HTYsyxo5qpER99Fb/SWdKSVpwA6gGqcgjdKHfL1hu6AVGIag5IMMMrRuF 4pBFN3vSpVlH6gc9wrrCnfN24xUvPlCa70w+gRzl7H8sXUE3Z4FYGTUFn0I43mu9AV+V l7OMB0mj67AT93a/xjYHdOdWAOhi75p6cMgc6uH8j0m12Ioz3AC9+ClM774BtMssJ/0C +f5GQo/i/2pxGBruQE//NOgZfi+yllaajgy8Dx9rw5sFIjXhT+yO1VuHnje2o05T6JSL +47w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vy201Caa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bo21-20020a17090b091500b00277517b42dasi6403622pjb.35.2023.11.25.12.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vy201Caa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 52DF9803D814; Sat, 25 Nov 2023 12:06:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232484AbjKYUFp (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjKYUF0 (ORCPT ); Sat, 25 Nov 2023 15:05:26 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E59ED189; Sat, 25 Nov 2023 12:05:31 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 90D8812001A; Sat, 25 Nov 2023 23:05:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 90D8812001A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942730; bh=6zspnyJz+nDF9opMh33IY/7Y1KILTXZl33bwU29eAWw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=vy201CaaHAYi3gUgMXp356kXhFKCRay3pa1y43j4CET8B/6q4koeBvvt2Z+CI8P5r UFWFWB02fbPGfJ5qTFF3KXNgklnScMgI5QYEqNxIzzvzVgf4qg3hYXVTpvfFYw5QPV by+qyr8mwng6FrMEH9jixOo7/sQluH3/IqP3OlFX2BfiCfI3Qa35cvcYe4JrBiV3Ns PMjd8WWqGG1r4//nunROYxbwiNURbiMKse8SgV78NRuwxUT2+rMPyG5xLDzmArOxQz f8/7rmS3qViHN0RgJDG/8k9tDdA3+Es7DencD9aNp8dG4jXKsVnBaBEpM7frlajVbH iCA70q77gT/Ow== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:30 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:30 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v5 06/11] leds: aw200xx: add delay after software reset Date: Sat, 25 Nov 2023 23:05:14 +0300 Message-ID: <20231125200519.1750-7-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567787887398613 X-GMAIL-MSGID: 1783567787887398613 From: George Stark According to the datasheets of AW200xx devices, the software reset takes at least 1ms. Therefore, it is required to add a delay after the reset before issuing commands to the 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 91ba580edf87..12c4251211dd 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 the 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 Sat Nov 25 20:05:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169778 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134509vqx; Sat, 25 Nov 2023 12:06:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMyFTnNdWZWoIxluXnmDCWPlNVFGC5MexnVU9MEGPORzqH1FjdBqMRTw30RdZSKGGTnfP5 X-Received: by 2002:a05:6808:144a:b0:3b5:9966:c1b3 with SMTP id x10-20020a056808144a00b003b59966c1b3mr8776987oiv.16.1700942807666; Sat, 25 Nov 2023 12:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942807; cv=none; d=google.com; s=arc-20160816; b=sSHqt/Sd44QNuOnFamGIB5iw2gY1FwmuoBI/3gjN1Mcgcjy3yRfeDtSebTvaaY9Mar Cks4eCtJ+YEVRh5ZXZtvSLZ1s56FMz/vqDq3tfWdQ7xMy/Byuo+xdNQv1EiN8i2bwJnZ L0Fi4JbulQng8p8UwNhhIwA/hUs6Fh1qg1Kv5ywSHmWwcvOoWlG8d+hn6iqfBT4ms2a4 mUt+652ZHbosFPBy8cBRxA30NQMfOoMwi8M3c785cKOyZpQYy+ScKf87JkWMhsQoD7/D lWWwQdS/2p0JVql7ZlM6elJyzHyEpyBZ+lbTVaefbOpFX9QQaMEppnZGsjS4WQz055Am jEnQ== 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=/hGJSPwkR7hPPiegnAMGayQn6U63idcPPJ0I8jrG6lo=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=nMkxEAdKZgVzmjyCMejXWZcovuez8oUPAOftyx2QYjMt+xyYxYA1u4jw7d2+bZTMw3 DKxG0aj9TCU0quIrO81EJFZuRSSdsmmCyhebU3nMzAeUIsLt2Qsp00sm5apcETDZsFdx NWF5+TxZUU8V4zPnHMiOma5O+wOapms1yQIC5DDYlvqlUDjY1407F5fqWAFZlGxC8OIo ZR5/ZMfAKLqdPBwgSXzg5ILSoT7esinIJHOEJ0YGScHO6i7BqBAcVJPEVXSx8pS1Kdtb MN6nXEd0GN0Ec6WtTm5Zclngwu994V2R6shDKZbu78Y0Ta3ROgDh/B8g/kg29ZOuGfc1 EQbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=at97Wer4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bx39-20020a056a02052700b005afc5ea43fdsi7027340pgb.849.2023.11.25.12.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=at97Wer4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 640878053C7B; Sat, 25 Nov 2023 12:06:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbjKYUF4 (ORCPT + 99 others); Sat, 25 Nov 2023 15:05:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjKYUF0 (ORCPT ); Sat, 25 Nov 2023 15:05:26 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81D7E18B; Sat, 25 Nov 2023 12:05:32 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 30C17100024; Sat, 25 Nov 2023 23:05:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 30C17100024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942731; bh=/hGJSPwkR7hPPiegnAMGayQn6U63idcPPJ0I8jrG6lo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=at97Wer4jEixhZFytKdemUJxSa/5lZrb6Lpsd2zdFJKMNdUcZ4wNMKTOmJnAttGS3 J8cm6nGWzTN/E9MYAq6OzacXcSrYfqZRR4RSWblX5d0HwEUtcxObxqAWVuxcZbA0+R PPFtx5KhzCJUW+7rRLIY1JubynbfzEsyMhN20MKH+UObjhRBGU6OiCAB14l2Wozhv5 g3v4L9lJ+9MoMjDbtLCyiHhF3LEVvXtTVoB5PxE5Wzn4+dR2toYWyMkZ+Nq507Pkjn W05MO5pjufVdo7DdcM42FG2y98EyKD5w+MYxS7IhypKjUUHllfW0q9nN4uSCDIxBL7 Q57MlmR95CyxQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:30 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:30 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v5 07/11] leds: aw200xx: enable disable_locking flag in regmap config Date: Sat, 25 Nov 2023 23:05:15 +0300 Message-ID: <20231125200519.1750-8-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567805403516427 X-GMAIL-MSGID: 1783567805403516427 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 Reviewed-by: Andy Shevchenko --- 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 12c4251211dd..c6a51152a494 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -526,6 +526,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 Sat Nov 25 20:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134631vqx; Sat, 25 Nov 2023 12:07:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZl/WuLu4Ni+kXRqNmFTb7qg5xJ9PQRFTq5Ziuhd4hNHgencWx0pD0icJ+POpIuH25ICxk X-Received: by 2002:a05:6a20:158b:b0:18b:985e:8035 with SMTP id h11-20020a056a20158b00b0018b985e8035mr8142980pzj.12.1700942827452; Sat, 25 Nov 2023 12:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942827; cv=none; d=google.com; s=arc-20160816; b=YKNCADVd55HiBbVbjInLQKHrCbxXj9nIlLgUXYRNLx3C1BKdIOiTQV1YKLaTAX6Rzx 2xTE7gWImitpk9zHX5gbgvcqyXaUIA1Xlh5oGq9qBmhXG+Io8UTbl0t71937ywND3dCQ dBq6sW3JPoPIVBt/pEhid5TenILAKAhCKZ47RLxMM2a3xKBTmKenNRUDJvRJek/Lhigu IoaZ8n+WLATrwpH+QvsDFXz84VCJXt6ksYkYKKwjvidE8Cqbk0oq3wWpqrQwc3hBovIo LmhPFKSWIUL3lHj4zQxNLLJKyuCa4x9V5Rnv6MMNjORAe1S//4LtXbKvlLCXrp7lUELX tdDQ== 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=Nz6KMI06TAaOZ9MntU69qR3R1MQfjHcEyVZW5vm7XRg=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=JLx+MThMEQ2NaQznZzLKVHm7CZRtkFZQ3CP2q5F3QqJSsKdn4UFe87zyeEweLnOe0n 1s1GeonwG6mtZgsicmWwNJosvAH4qKPkYFnSCO8xWQ3skk13g2aTf07wm3JdKxxzwE+f pJiQus7Y6EVw5rmRqDpkrc0ScX0/510EPCgcVSIcFNeQdlBhhlqbZv9hmIrF/uUO0DLe al+VnD++T/jIJO4I4QU2AxKsSACc2b9/V49wghQJ0nsLpM9j9IlyqsuljCkbGylPXk9M YCkHJhQsAiHpnDu3cVvdMcUdKHQhQZSVFuOG+RD8MUHoEAPCKj3gDtDjSF6rt09NAG0v NQTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=lQTIvF8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ca2-20020a17090af30200b0027491bac826si6450499pjb.140.2023.11.25.12.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=lQTIvF8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 5D4C680D88FD; Sat, 25 Nov 2023 12:06:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232457AbjKYUGA (ORCPT + 99 others); Sat, 25 Nov 2023 15:06:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjKYUF1 (ORCPT ); Sat, 25 Nov 2023 15:05:27 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2996718C; Sat, 25 Nov 2023 12:05:33 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id C16DE12001D; Sat, 25 Nov 2023 23:05:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru C16DE12001D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942731; bh=Nz6KMI06TAaOZ9MntU69qR3R1MQfjHcEyVZW5vm7XRg=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=lQTIvF8QnLV5wyaSvYRsggp9VWwurc4dhac7y3yQt28HL6ZXQCDPShRFmqCBTFSd+ 7ovtRVrSe0NiEzcYC4GG1PS96N+ekfA+drualE/farafqN37EvTDQ8DxbxEDzjmLXG CyHESYRwN4d64YNOOpdWPoxr+6ndfVfEEnHWCs0BVVM7z9XWFP4LzoB0aWbimbq1Ez h2i2wwUJDMtpGVeWfOo9inU2k4M1vNOZfrly6FAB59ol/0FjuAiOKksRgYMBvrq+XF i8NLMpD+J7ofDUBZwD7U5oqwAfreeh2BpquCQSCB3EE3Lwyar6g5AK8fK9KwtnYdSZ ER3QALOd28nIA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:31 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:31 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v5 08/11] leds: aw200xx: improve autodim calculation method Date: Sat, 25 Nov 2023 23:05:16 +0300 Message-ID: <20231125200519.1750-9-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567826199080100 X-GMAIL-MSGID: 1783567826199080100 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 Reviewed-by: Andy Shevchenko --- 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 c6a51152a494..e125b6c68c23 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) @@ -462,6 +462,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 Sat Nov 25 20:05:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169781 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134613vqx; Sat, 25 Nov 2023 12:07:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOXkOvt3JrypR59k7aMTWfRHO/PNVBB1sXEg5mPNp8nREiO4WtdtYOd9gAVNqLr3OPQ+J5 X-Received: by 2002:a05:6a00:35c7:b0:6cb:cc67:90c2 with SMTP id dc7-20020a056a0035c700b006cbcc6790c2mr7324611pfb.17.1700942824401; Sat, 25 Nov 2023 12:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942824; cv=none; d=google.com; s=arc-20160816; b=abec+6I9vYFRZOmH1DhUnmHSz0t/mMzcCzj/LRG3DrzpL5gYKYedVEIcOCOFHNAqln ChfLd/+Gp4P70Fcf/vwfj5hvi/JP1QvdbNwygnXi52wFwQ4TY+JyurV5cS/ahVQIcAK1 CJZh6dEACxlr/1pvSb29fqTCGR7b18sLHtpHODMciSkIlMoH1SAVT0fA0zeVqiCxayGh oLbeuh7k8nFMFalM8RuX9HWIZHiNSQDVAAZdnLHgKLuQ/GYJ80ZHuOpUK/wElkrI07sH J7MZxyAbMCdGJlXQFTYYXxvDOlRHb5GB0+7fW0dmTqt9RS59iJ0uEBu/NwF2Mnlmt8s2 oIUw== 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=XZaUtJIinZsFjG7oW4EmSM0d0XTPrP4/k2a7efLvsns=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=jRRqKOigACrviHwrqSHtYxL7JJIAykuqYznCnOq7YkKz6pdvOCTCuSlUXbAefNax3G Urh3Ju2NzgzYsLg93rdnhs4AW1v+gONMjfSl5yhFl50iO8kE1RJwdz6aWwBDKIjZiprw OKR5Ewaky1j+iwWNWLjeJnnFUPrj6qmsUsEfWql4dkYCK93TmGajt+w5m/Dwxsj+mC27 mH+dG0X1kDgvCMujX8SLsqgBjbZ5QEm6td5DCY6hXa+6siBL3UMSh1ob2f/ksXMuEGBI GHj6UwXtA9kvu/RchVYbHTkNjWqKMYhkrNoSWA/pGkTGXFOYf6KoxFPO5JUYh2rIhQhT zR5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=aIIu02lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u23-20020a056a00099700b0069347c30c78si6636558pfg.230.2023.11.25.12.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:07:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=aIIu02lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 69B1F808577B; Sat, 25 Nov 2023 12:06:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbjKYUGB (ORCPT + 99 others); Sat, 25 Nov 2023 15:06:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjKYUF1 (ORCPT ); Sat, 25 Nov 2023 15:05:27 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A726318E; Sat, 25 Nov 2023 12:05:33 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 47348100025; Sat, 25 Nov 2023 23:05:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 47348100025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942732; bh=XZaUtJIinZsFjG7oW4EmSM0d0XTPrP4/k2a7efLvsns=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=aIIu02lYdQoypBa3oIs4n5XP/m9sSl6fDFToka7rWIvDq+UpqMjeM06et9IoRIXtG de+EnBcgtYJ7YnA9y0bFjaI5U3hiojfrbeUQpmA/O/sKOT07qFxmD2aBUH9WE8s4OJ S3AxACLsu4/uMzhErtAE8mnJvTzgzy1gBfNykH8FAmTARL2bc1LMie1TlxEqdvmKsg Q2ZBSKZi9xz4W9miGSbFHEgHr5piDXKBnIbjANLFXOtgV4CKsJlzU0LFJxNVVCNceD H7G8t1r2XGNSWH+E1Ppo4DkrYdGj8hVrrF1/nZ2yAqTArSk34Eb+5fcBzMH1rosF9B 4nl14chOKN9dg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:32 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:31 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v5 09/11] leds: aw200xx: add support for aw20108 device Date: Sat, 25 Nov 2023 23:05:17 +0300 Message-ID: <20231125200519.1750-10-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567822846245640 X-GMAIL-MSGID: 1783567822846245640 From: George Stark Add support for the Awinic aw20108 device, which belongs to the same LED drivers family. The 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..a898a8679334 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 the Awinic AW200XX LED controllers. + 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 e125b6c68c23..1d3943f86f7f 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. * @@ -622,10 +622,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); @@ -634,6 +641,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 Sat Nov 25 20:05:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134816vqx; Sat, 25 Nov 2023 12:07:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTaIHKGmcz7JviU9OJymkGyjcf3Wj0upzYW0iK3p9Ch07ER0vfRx7WpFldNOt0lgPi6S9a X-Received: by 2002:a05:6a00:188f:b0:68f:b5cb:ced0 with SMTP id x15-20020a056a00188f00b0068fb5cbced0mr8901242pfh.34.1700942857234; Sat, 25 Nov 2023 12:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942857; cv=none; d=google.com; s=arc-20160816; b=lnAxi4AuGqy64VWhkNrSB0SM38/TCJFgjIvwgPaxUZg8lyNo6eMH/AdK3zwsnITjes Mj6R7FdlAIxZ91DZIwltWTg93b26UN6jtmDKRhyHGkNN0gYnQPO0/ErPbjiH5b4dKUzT IewECkRXXYqiLgJvZlKTyyDqNrAbEgBUTfvFwF5FJUHWqoCRKGZIRDXpXipLCnNfMyWk lyYPlJgCqgigm23xFrurybRRZm45gPzRZsTlrU3IILaJI4VSmIVqGaV1fPlfXVobI57X Lh3VYaC1irsHUKTCFTf0TYQoySTOIQH3S1jTOoKvpAGcsOJhwqFz0HI4OJ8xH3fCo5nN jKmQ== 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=Np03L0WvexEkCn3ULZ9I0y/2DRd0TQt9XiaJeJ5VnwwcpNp/qOv8WLNg5+4ft0DYi4 GyrVHt0BGT0FRDyPoQsq8cr3SpxaT4nRB0ygRQvY1h3QA1Gu311hwqv0YzfkBwdSutkG IjlYV7Oz7eXGJwdawewia7rwq/+577p1CiSNFdfD9JLlp/74F55sHlOO9AKPtbmuBlqW Y1VyDdzOpMiHBWmhnIMnrleOuXfURdRWcY3ytNVRbx27+qP4yMIV8YA2nCzCpbIhqE1c jw7HuTDBVKvo/uWtLmljNjtid9dLHdSB7HuKXl/vdu31zpSkizOEb66Fm8GTnib+MFCu LXsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=pM20NMzQ; 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 29-20020a630c5d000000b005b87df75d54si6474819pgm.83.2023.11.25.12.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:07:37 -0800 (PST) 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=pM20NMzQ; 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 ACBE18068958; Sat, 25 Nov 2023 12:06:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232509AbjKYUGF (ORCPT + 99 others); Sat, 25 Nov 2023 15:06:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjKYUF2 (ORCPT ); Sat, 25 Nov 2023 15:05:28 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551ACEE; Sat, 25 Nov 2023 12:05:34 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 0859512001E; Sat, 25 Nov 2023 23:05:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 0859512001E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942733; bh=/HrW0X+9rW0pBeZMX5Q2JYjOL2DcSt6189XJga8hqTE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=pM20NMzQc2m9ujhSUIV3jSpaTOILc7uyt1WXfOkEdo0iJT6asvS4TXG8WWo36pgLO 5SA8TWA9WKrlCkL5qSFGguqDRG/PtTYymwvUM2EQbJ8qFCR7f7B1J7iBw925havXh9 Gi63TmZUnZne4OkozPVtCU2IbKuf2/UJL+pFDmcJyrZyPhXgGa2mswWLokgEB6BiE2 8d2gnMd/kQT1o2S1/zaHhIBG5nJ2hDNGkplOPSQMGbuXXB++cbuIu6C9MTShNR+8tY ZBVuICSqkcr7A3xGbPPZRdn4XWv8cyEu+QdrEbFR9RzYZzkLBhMWFkqrs2FCOaUV1k wmhmL4HayhUIg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:32 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:32 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Conor Dooley Subject: [PATCH v5 10/11] dt-bindings: leds: awinic,aw200xx: add AW20108 device Date: Sat, 25 Nov 2023 23:05:18 +0300 Message-ID: <20231125200519.1750-11-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;www.awinic.com:7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.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/25 18:50:00 X-KSMG-LinksScanning: Clean, bases: 2023/11/25 18:50:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-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 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]); Sat, 25 Nov 2023 12:06:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567857085948324 X-GMAIL-MSGID: 1783567857085948324 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 Sat Nov 25 20:05:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 169775 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2134404vqx; Sat, 25 Nov 2023 12:06:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4DzkGLfGMlq18g8jKrbTdzAHI8R+VaNXJVoIxB8yqDaMQsE6w4tCtqDJO3cC5V4j1zqJC X-Received: by 2002:a17:903:40cf:b0:1cf:b4a1:5cb8 with SMTP id t15-20020a17090340cf00b001cfb4a15cb8mr3074204pld.51.1700942796406; Sat, 25 Nov 2023 12:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700942796; cv=none; d=google.com; s=arc-20160816; b=MNRLppJcJWBLLQqcsd2Rggtou6yPXO1F73qaAIGhFMk/RBGXwHxVEI4gjQFy8pN/2J 3enhByWjIQi97SdQSZbvjXewjkMo1gmdtA7Yf4ODFsWEIeAJMT/4aJ80nCAtTTK+kGHJ uFX3g+GmWyMYag4TckdqIv4mC99dv4ZN/eJzJDfaYlxUtw6wDW1hONRBRlOhdzwrfC32 RTP09VL9NqMPndFcQ8s56yseN9bpguAugk57n2np1yw1i/GVc3izd63NfgraBu862DGg rlOHsZRWyHTmMDKT5dXer7CobprW3VTiXh55cjGyhvToEPdtFrN4n5g2UnAHArba0qgT Xxug== 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=YEPAVovAT7fOQhJBeFq/4sGvowJqoh7IRxQv9siAkaY=; fh=KRuACLXYNVqvFh3I1Bh14g2ycDP2uITWiIiQ6OGGib8=; b=XDwyfezSGhX7Eem1ZNLp/Q/aS/egaBqFQfV86SLrfYRcT0BfvSvXPTRjPGBKboalNs XfWxYTDCh1GcczXuZa1zRZy/a/U48aWtvHMKtnSupPsN0FeHDJNeMtOHfF7Ope3nbZMt f7N2r4I6lFazWkShjhJuzYVpCH2hWyleC/rAUp0ASwjk9nzQ1s64aEvZlT+tBSFgSqth 6XXK7Vdq347h70eJVCS28RNi5Qlx1wq43qYkZXf2m8Qb6kDT8g88KEWzjGjLosfGyMhE 77NfZNH0LOiTAjSUDkp0liq8G8l4LJx7XjegymcUa+WjYBgIqNrGHbWkCCNXe62eOHqU OXJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=SA06F3cH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n12-20020a170903110c00b001b9c992945fsi6262791plh.555.2023.11.25.12.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 12:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=SA06F3cH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id BCB1B803D820; Sat, 25 Nov 2023 12:06:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232494AbjKYUGD (ORCPT + 99 others); Sat, 25 Nov 2023 15:06:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbjKYUF2 (ORCPT ); Sat, 25 Nov 2023 15:05:28 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E923EE5; Sat, 25 Nov 2023 12:05:34 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 92B4A100026; Sat, 25 Nov 2023 23:05:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 92B4A100026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700942733; bh=YEPAVovAT7fOQhJBeFq/4sGvowJqoh7IRxQv9siAkaY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=SA06F3cHj79CvuWu4fNJh6PqspH0A54BeC5ivg1kfP5tLTSOJps9JfgWXx3N1DTg8 ch6l8ZrPyUgSeNvys4k9HIbwOpLRUbHScFVu3aogzJnqcrooYYsrFz1S6yiAmUqLFP eOMi3KKGL7obRf4H+iIQND6FB3kvIE5D4Ty44R4zA9QWMdtoQ0uLuHfzW08QIf+ltc cScJ+Cw4IClS65PcTKNh03RareddeEI+H6vxagD4qdvIQfxuzXyK0pD9XoJVnp6mJp qGX3vMCrcXb7FnUn1PTIMqpGM+Ym+8L+G/B/Ls3kCbDc/yTFtfz9S2B/UN1+/5Bbmt wwQ2q2tFET6Ug== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 25 Nov 2023 23:05:33 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 25 Nov 2023 23:05:33 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov , Conor Dooley Subject: [PATCH v5 11/11] dt-bindings: leds: aw200xx: fix led pattern and add reg constraints Date: Sat, 25 Nov 2023 23:05:19 +0300 Message-ID: <20231125200519.1750-12-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231125200519.1750-1-ddrokosov@salutedevices.com> References: <20231125200519.1750-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181593 [Nov 25 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 4 0.3.4 720d3c21819df9b72e78f051e300e232316d302a, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/25 18:32:00 #22537065 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 25 Nov 2023 12:06:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783567793831363145 X-GMAIL-MSGID: 1783567793831363145 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 | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index 67c1d960db1d..54d6d1f08e24 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -45,7 +45,7 @@ properties: maxItems: 1 patternProperties: - "^led@[0-9a-f]$": + "^led@[0-9a-f]+$": type: object $ref: common.yaml# unevaluatedProperties: false @@ -69,6 +69,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