From patchwork Tue Nov 21 20:28:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp896985vqb; Tue, 21 Nov 2023 12:29:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHII8LVBnIyejXA4VDEzSnWabcm11yZIKSzG5GYdEMh6iPxGpykO2IJiXNHQLYEXpePc8xW X-Received: by 2002:a17:902:a510:b0:1cf:6900:6714 with SMTP id s16-20020a170902a51000b001cf69006714mr528915plq.9.1700598557128; Tue, 21 Nov 2023 12:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598557; cv=none; d=google.com; s=arc-20160816; b=U+Gjzg69A1z0+mqFMiHLXIsJA9LdHD357d8s9Cj/DjYAq+959G4VXdgBLy0OSj2oLC 94MovXY58RrveFdu1fFqReSLQ5i5geQdpOZW0ufl6YuVxoc4EzEzc+oIF9+cGrRBS4IR 17u1mZLOxYv7YLtXdR64n2gBL/pP03LZ1/14cXIPpYWdzCgFFTZgIJmGdztnRI5Nu0hL nHAROjLc6k7Hen5hoFGWNS/itrh5ezOsg9nMMor8nK/I2+4nxuaocSR1mveT4f6Vkg/Q YiWe6HhQKun5MpBx52YpjKlhYfr2cPp5JLKrxfI9taZmt81joSRT1+WLwrw5Uz46n5E6 30TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=TsSFYNyr+qoUBw7DRIDgw/BslXmhZ5hoKWIiFL3fwXAr8fCQ6mSW8Toom3rzczWuqY 0x5rY4Fk9h0RVtDpfokoHvlHPpJHLaFbMrrjwC3jf9TdLaNideQXXFa6kzJbw+lRG/xf WLdaJpTIZT61CKaxHAtQkvjxqP8V5Y9/lRyTIJsz1lqr2o0KFCP3PSkaRzsAaPeTTL55 YAzXNUEIyDVUo+d05zNeZZKePKZgjWtGhnW3tXAzWFO8ByuduYb6cU/bwu2ZHxK1erru aAaD9YHBbIj9ckGv4wXFp1WAWfuLzUy9wBFSuXvjfg0LY7/yf1yP3Ni9G0p0i2L5Me97 EGsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=k8JIheH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j9-20020a17090276c900b001c35864fdbbsi10637131plt.406.2023.11.21.12.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=k8JIheH9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7630C8023187; Tue, 21 Nov 2023 12:29:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbjKUU3C (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A8C1A1; Tue, 21 Nov 2023 12:28:51 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 37CDB100062; Tue, 21 Nov 2023 23:28:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 37CDB100062 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598529; bh=zn+S/RI+VLG0sC38068gPmLqXKUSbREudqkWjxnsPFY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=k8JIheH9zf/SSZQmKEjs4sIgztOQsz3BmVHgXMMkicVFPVHcACknikwohxJ3gdDYf SytqKWOvJumo5gg3ZP8+Om4L+NHEcyNdraybFBTSJQD4HUWPPq78aIh3LQieUEAU0K X1oORlrRVwTgXLNALk1KZS2lbrxuV9ffhxf+Cwukn5n2UG0JNJLJCleSQ3kUduV8xV YIKdZAMXsWHF5G75zVfVDvWFtkvvqLIGAfKr2b0IiCHDHPzh7XjURBd6PcqZVU7ueY 1T11bu/kXJY5xYasHndZchryDRv08+jBxQ/B8Z0L1GUfKPROL+wmToJ+a8vDAOL5qC KEeXL5mf/ZL3Q== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:49 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:48 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v4 01/11] leds: aw200xx: fix write to DIM parameter Date: Tue, 21 Nov 2023 23:28:25 +0300 Message-ID: <20231121202835.28152-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 12:29:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206832363081443 X-GMAIL-MSGID: 1783206832363081443 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 Tue Nov 21 20:28:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897027vqb; Tue, 21 Nov 2023 12:29:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6d75zjjttrf88zvGxt+iGmym+ExezEFdaeku01UqID7nvYlX4xX3rReP67JJ2//K4c6CH X-Received: by 2002:a05:6a20:8f94:b0:187:fe09:272a with SMTP id k20-20020a056a208f9400b00187fe09272amr120848pzj.49.1700598561291; Tue, 21 Nov 2023 12:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598561; cv=none; d=google.com; s=arc-20160816; b=tWzMSgVtQknn4YySSy3A+/ENvSPkPicjB5tFYDh7hQPNfShEslaGR/kt3Nk0199npU PfviTtqbaoUO0FiGXGkTaXWn/F0/4Bm/11EY692fqM6MIucIERGeephlnGKLawo/QEGG 4OFw0Pg9M1/VwCPwjxXjFCDCtPUQ6yTfonNozFNYwu/c4cx23oPUTcThHW5nB9VOID64 i1aRDH+039f5dFwjZdKrcHEiOJThnybAm1oUV0cu16PZMFT+eZsRIJE9PORiFgCX2hd9 Os1rI49rjywTokT21B1pXCbZOXb+euaaIwpcKmLvImn02KE73deMFSWp7xI8FdrYrapq pFqg== 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=UOxTU5KZHbe/+hSkVYfZqZlG2Efk3Ixj1Eia0Y3j9EI=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=xGwSqyhLTVl5w1ZGNUz+BTlkrPZTvsyYAbISMUL5XFDuntTgKVIONz5hbM4rtRHn5m qUzKcPv9ZBu9CMAmLcIDM5laPXojwT0B9f2uWRiUl9zpJIWYxGKxe3LO+4VPhr3oKTsE saMGY2Ln3vhFzo0uDQRP/SVMdWclZC8yDC2b07V1vETJg/eaaEQdwvfLKF4r+LKru8ua 51a+iW9K+WRnji0jkTEhXLu96bgLPgpr1FV4t7cn1UxpgzEm8wR+b9nGkcMZPlWOy3Sv duTqyPTh8IeClFP3sPh6XX/UiN/iChvMTkBJ/6lQNSNBerzCOS5wpEOmgo0kuRpi/miM 7b8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=u2t5LGj8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u24-20020a63df18000000b005b8fb1da631si11547162pgg.897.2023.11.21.12.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=u2t5LGj8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 409A481603B6; Tue, 21 Nov 2023 12:29:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233840AbjKUU3B (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A37001A2; Tue, 21 Nov 2023 12:28:51 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 0E32312005C; Tue, 21 Nov 2023 23:28:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 0E32312005C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598530; bh=UOxTU5KZHbe/+hSkVYfZqZlG2Efk3Ixj1Eia0Y3j9EI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=u2t5LGj8+aAaYRkMbfSvRoBaOwZKeEGe2SK5z3PygnwhvPw5jvMfkeAgQIrQPZGY1 vYw8eVpv4ZHKHF9bDNm5nRD6792z9AYNZdgFE0yO32X2Q+W9uBZV/N5W2YD5tXOFwU LGo3cveyGBOZnM6WXH/Z8CsOUYhEncjla2ZfOtvPYpYRHl+WyexPvFXHKGzceP9equ ZpN2GczuL1mrskBpz3WSA7gOyht/Oabwxs3ebKFcpf7Hgj4zkgySIsk1947cmHMI3Y 67UQbTBAzM+b70IxDGy23UM5LHo0CWVA099XgzsabJWaacJIJI9A9s3jDUgARwLIDZ QrZHleHZK3v6w== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:49 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:49 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v4 02/11] leds: aw200xx: support HWEN hardware control Date: Tue, 21 Nov 2023 23:28:26 +0300 Message-ID: <20231121202835.28152-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 21 Nov 2023 12:29:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206836939845562 X-GMAIL-MSGID: 1783206836939845562 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 Reviewed-by: Andy Shevchenko --- drivers/leds/leds-aw200xx.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 842a22087b16..7762b3a132ac 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,7 @@ struct aw200xx { struct mutex mutex; u32 num_leds; u32 display_rows; + struct gpio_desc *hwen; struct aw200xx_led leds[] __counted_by(num_leds); }; @@ -358,6 +360,25 @@ static int aw200xx_chip_check(const struct aw200xx *const chip) return 0; } +static void aw200xx_enable(const struct aw200xx *const chip) +{ + gpiod_set_value_cansleep(chip->hwen, 1); + + /* + * After HWEN pin set high the chip begins to load the OTP information, + * which takes 200us to complete. About 200us wait time is needed for + * internal oscillator startup and display SRAM initialization. After + * display SRAM initialization, the registers in page1 to page5 can be + * configured via i2c interface. + */ + fsleep(400); +} + +static void aw200xx_disable(const struct aw200xx *const chip) +{ + return gpiod_set_value_cansleep(chip->hwen, 0); +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -517,6 +538,14 @@ static int aw200xx_probe(struct i2c_client *client) if (IS_ERR(chip->regmap)) return PTR_ERR(chip->regmap); + chip->hwen = devm_gpiod_get_optional(&client->dev, "enable", + GPIOD_OUT_HIGH); + if (IS_ERR(chip->hwen)) + return dev_err_probe(&client->dev, PTR_ERR(chip->hwen), + "Cannot get enable gpio"); + + aw200xx_enable(chip); + ret = aw200xx_chip_check(chip); if (ret) return ret; @@ -537,6 +566,9 @@ static int aw200xx_probe(struct i2c_client *client) ret = aw200xx_chip_init(chip); out_unlock: + if (ret) + aw200xx_disable(chip); + mutex_unlock(&chip->mutex); return ret; } @@ -546,6 +578,7 @@ static void aw200xx_remove(struct i2c_client *client) struct aw200xx *chip = i2c_get_clientdata(client); aw200xx_chip_reset(chip); + aw200xx_disable(chip); mutex_destroy(&chip->mutex); } From patchwork Tue Nov 21 20:28:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897051vqb; Tue, 21 Nov 2023 12:29:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEBfWy+sk1V4WKDwSfh6zkjUN4qxAYw8LLt1Rq6gtA1gGzWg9kHJB+9gr2nty/rkc7M6ml X-Received: by 2002:a17:903:124b:b0:1cc:2dad:7ae9 with SMTP id u11-20020a170903124b00b001cc2dad7ae9mr290743plh.32.1700598564660; Tue, 21 Nov 2023 12:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598564; cv=none; d=google.com; s=arc-20160816; b=EUa5yKBS2w/9Rj2xRSMza5Zucz43fbFEX6xrajoAUu/iantDT7XyKre2/N+8TNqyRg wvYKTj2ev2CTSlc0mbgUPsiCOW/Zh0+NgW1sUm4AqKirjLnUmrv7Kuvd3wN1vNt6W5rh mukyDN+BTXDZX0P1xnpe8PqApw2xuqe+GzeJj0Ut/axzpV7HtVx71SJ4t06zx+IAs2fr JRs8n82SeAavVyWlRkQmX/mXJKjv3Y5vtjOUpVHs3bHYr2dXpG+R5l2I1Y/M6lukLga5 QvMKT2l0+T+mfuDw9W49alEYI9MwN1RemVewxZMqNJcCEiEvsh7dKCk7BUV5u629M4Gg /I7g== 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=iWgp85InD2RiZiW224/2cbnJ0YSlsOCJTnm2pRPG0GMhxPX/5ngiTYvfFNoJBMrAX/ T0P/TxHNgHCA0A9rr2TK5//DbEOKbRvlYTn5EKcEOfJHruz2gFTEAVb89PPf7KLmdXku N1Z3ZtWXTzfnEdHNJ0aFflL1iC8Tq/ECiPwh4gV1dBivwwIMUEbZDb7knmDWPVIwaken srtIRHuphpikCT4vyu/AsGS7bypOikbldZh2ZGM/4XYwpFZxOIHf8FW4og08fvhFqbck +/RReuaIiV0w4dUdhp6P2FyU0yHnZHCN2lgJ1lgDHu0B2kehJ1AfZsl1FhXpZ4mxMIiz aHpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=C9QV9gle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b20-20020a170902d89400b001cc59201d1esi10836420plz.172.2023.11.21.12.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=C9QV9gle; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7E0A680486A9; Tue, 21 Nov 2023 12:29:23 -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 S234299AbjKUU3K (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B5001AA; Tue, 21 Nov 2023 12:28:52 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id B6AB7100066; Tue, 21 Nov 2023 23:28:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B6AB7100066 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598530; bh=j/fX6YDIQyQ1VIymrunLH5mwmh/dqGOmhqXkwzfUmIU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=C9QV9gle0BLaMWuyLuCouKtNzA5yyHFlSXuFFqZThCOBSucH0BqhbwLWZEt0mGCJX s/Lg0vATGho8rAdK311A7aEqLbehvzB5lcsLxbWivkx9hQaAwGL3O1ZnJ578RNYf/5 UiBYbBf2/tx7CapUvLoq5q0OJpIKPotgyuFjjWdQCjY+rljLkcdb3dQY1yCt9YPBLK NxwMhCw3f+lJQBLDAXVHCW3OwlKt4dBNy9Vp7ct9Sgb8h3Wizya6pz6Ulyn+EeXUva Aw+1WKhrXcc/PjQXX8/S9fo0I6JeDitvQi18oZT7BdyZVZuR7u+CSC7Kk859kiDYOr nsNLpML8Q0IWw== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:50 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:50 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov , Rob Herring Subject: [PATCH v4 03/11] dt-bindings: leds: aw200xx: introduce optional enable-gpios property Date: Tue, 21 Nov 2023 23:28:27 +0300 Message-ID: <20231121202835.28152-4-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-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]); Tue, 21 Nov 2023 12:29:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206840607897039 X-GMAIL-MSGID: 1783206840607897039 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 Tue Nov 21 20:28:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp898249vqb; Tue, 21 Nov 2023 12:31:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEJif97T00VFxWKLuu58mYlwzmXm5NJVGL9HztXIhnVTGzGgTOP/tTP88xzj5cT/KYEKdD X-Received: by 2002:a17:902:dacd:b0:1ce:6630:1585 with SMTP id q13-20020a170902dacd00b001ce66301585mr706904plx.23.1700598698112; Tue, 21 Nov 2023 12:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598698; cv=none; d=google.com; s=arc-20160816; b=A9nU0Xa1dRhn5PtBZKcT9SVKZD9rE7ysFIpo33vJ1s5qFYS0oUU/AN7STclQv6jQCh KOnk0MgAVU8sa1L4LACjT3NhlgJlTsew+HVLUFPGqxb+/dE0ktjpQod2GOEEMZHZhjRc qXANKA/KQR9rwPA7Rt58TO1VpzJvkRvw8gIh3ObwovqotPaicnWNJsunUVCGBEaGmNfi VXPCLXtA0TwO7jgUeucr6cMt1sCOWuoUsmt0PsC04yelyTXZJp6RDx/pEAXF1GPcvOXn XVq4KlFxCGeZcyXUNCB7PTwv9B5o7L086q+ShsXMQPFdMMbnAKhhtX25ftjptCERVm/D Txqg== 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=Uld1PRLw163IbfjdCAxAA+QDPnnc9y5jXDdioK9+6Pw=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=fHrQGDqR4offYn0NB2p5+SZ4P0tJ/cakb51YYm4c2PFMeUSrvLKRlTgkvdaNwGxDaM MxwAkK2Mj6NRSECLYn8Bu7quSza09zs5mz4AKHNdMPcShnNzolTwiB5pMBj5MiuC4D4x W5GfgkQzaSIUwA6RpXdcJDCuW/Oc2KcwN798ONXHX+7dpNWzZMcYuaPxQXS3ZOgRQbhq XN4riNA0c6jNAisODQM7AyhZYsyUP6IKKJupoKeL0iJxYSy8R45hpBpaT3jg8ZVNvHNj g0B9UD9bu0RcxGFR5z2CyMtUPNlZqC4Rvh2JdgV9aiJMycSybWDrUQwuichtUesbN2g7 u9bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b="nXfnA/jK"; 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 j10-20020a17090276ca00b001bbca0a8393si10798862plt.56.2023.11.21.12.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:31:38 -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="nXfnA/jK"; 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 884FF80740C4; Tue, 21 Nov 2023 12:30:53 -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 S234483AbjKUU3P (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70BC1BB; Tue, 21 Nov 2023 12:28:52 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 63D8812005D; Tue, 21 Nov 2023 23:28:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 63D8812005D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598531; bh=Uld1PRLw163IbfjdCAxAA+QDPnnc9y5jXDdioK9+6Pw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=nXfnA/jKjnnlEbJiRoz3z361AoHnSpagl0oX1EM4KRc6FbOYeleghtPvBW9b6/QzY BMmk7omyc4d9Mjr+H3A7RJ2XdMZZub05YtVBNO5WXk3Gxgo8OjfWN8uF40NZURdL7g cfjOXtJpf/oofRbg4RzyGagGQaewE95nSuCNwjTDcCtzq4Y34+WtpbXEXsNJHRx1V5 vPSJzpgO1a/OAHq/CZhyo75XcVjYE94b6GjnoVKBvxe/vjTwCgI0YpfhjOKQcp9KAC fVYqA26tVhB/FH49ucwKdlB8vH9ekNl4tHX6YdnFWMLwpzikl8VTTpfJLvBbiWo6bp uL7AuZoQx5cOQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:51 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:50 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v4 04/11] leds: aw200xx: calculate dts property display_rows in the driver Date: Tue, 21 Nov 2023 23:28:28 +0300 Message-ID: <20231121202835.28152-5-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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]); Tue, 21 Nov 2023 12:30:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206980533822430 X-GMAIL-MSGID: 1783206980533822430 From: George Stark Get rid of device tree property "awinic,display-rows". The property value actually means number of current switches and depends on how leds are connected to the device. It should be calculated manually by max used led number. In the same way it is computed automatically now. Max used led is taken from led definition subnodes. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 39 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 7762b3a132ac..4bce5e7381c0 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -379,6 +379,30 @@ static void aw200xx_disable(const struct aw200xx *const chip) return gpiod_set_value_cansleep(chip->hwen, 0); } +static bool aw200xx_probe_get_display_rows(struct device *dev, struct aw200xx *chip) +{ + struct fwnode_handle *child; + u32 max_source = 0; + + device_for_each_child_node(dev, child) { + u32 source; + int ret; + + ret = fwnode_property_read_u32(child, "reg", &source); + if (ret || source >= chip->cdef->channels) + continue; + + max_source = max(max_source, source); + } + + if (!max_source) + return false; + + chip->display_rows = max_source / chip->cdef->display_size_columns + 1; + + return true; +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -386,18 +410,9 @@ static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) int ret; int i; - ret = device_property_read_u32(dev, "awinic,display-rows", - &chip->display_rows); - if (ret) - return dev_err_probe(dev, ret, - "Failed to read 'display-rows' property\n"); - - if (!chip->display_rows || - chip->display_rows > chip->cdef->display_size_rows_max) { - return dev_err_probe(dev, ret, - "Invalid leds display size %u\n", - chip->display_rows); - } + if (!aw200xx_probe_get_display_rows(dev, chip)) + return dev_err_probe(dev, -EINVAL, + "No valid led definitions found\n"); current_max = aw200xx_imax_from_global(chip, AW200XX_IMAX_MAX_uA); current_min = aw200xx_imax_from_global(chip, AW200XX_IMAX_MIN_uA); From patchwork Tue Nov 21 20:28:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167928 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897238vqb; Tue, 21 Nov 2023 12:29:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwj4jGs8nABnRlIZo2/yiHLrrjRYsFOdqLJD+/jFwAbahtmsPj507yZfDQSI3AY6UgvLt1 X-Received: by 2002:a05:6a21:32a0:b0:187:d736:8b7d with SMTP id yt32-20020a056a2132a000b00187d7368b7dmr169015pzb.14.1700598592119; Tue, 21 Nov 2023 12:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598592; cv=none; d=google.com; s=arc-20160816; b=hO7N0YP8iJAKG3HQsz9GxZkip253YX/FKW307Vhm5vU3oneS4mS9Crjrlv+nFlJ6Sw xb2uJ/SLzBYfncnHaBXSKlgCJFTG50GliB1K8PV/66AUQaCTRSwDgiV7pI1JRjrQPa6r wW0mNvM35j3hkammKf2qxisvZD+zihWKbAVd5/J/CaB4B+fpqchzXo73epjBPixhqnyL +dEbnrKW+JuVx5DsqZV6KlBZQYQeO7MPnvr+zwzpZsTW7NjWjgkYPeDZTnO7XfT346tW /lCTM8ZwSmR3BpOMxT9VES/YiTV0BpLZzYn/9xpVBJ7hSIXi8N0hra1dE1AT8AVYJhN3 hb7w== 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=JEX+qDrkKvNO88fUkpNk0HfriuVjFAU+vaxKRE6hEUxfRDQZAEdOrWrEFSAUUEfyyA hR+eAXsRJ9W25HfcIJCDRSQEoSqSJgQzYwhjphldPQtha+bXXXjFen6A6fXOGookey+h 3CAOOp15vBPvyx+8Sd2zbibJPLTHcQXE4n3gl6u86jemDiwEWy9RvhziokeW06/1ZF1K /gaI4obtDUoRaqCDTVk0PRp3dHsqeZ7ixbSduS/gH2GaVPkibrgRlqQwUqGLcnE3zVQQ sLbmvElZ5ff37YqdeJ5Pd0uCcJlhWlA+080Bu4NLqo4D8ykLDZfJy5kQ8EiKT3uOqzrp egSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=FT9fNT+B; 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 e12-20020a631e0c000000b0057c2f61474asi10486304pge.290.2023.11.21.12.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:52 -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=FT9fNT+B; 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 5DEA1802ACC5; Tue, 21 Nov 2023 12:29:33 -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 S234567AbjKUU3Y (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjKUU3B (ORCPT ); Tue, 21 Nov 2023 15:29:01 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 554E69D; Tue, 21 Nov 2023 12:28:53 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id EFA5A100067; Tue, 21 Nov 2023 23:28:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru EFA5A100067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598531; bh=9aZqnQoakoRLfMLYgr2wRgT/Br89mjgKuUHrpHJK25M=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=FT9fNT+Bzb6H3uiQOZT/2Kuimxy6ZBkT7k/1/tHHmLDBRKSq8D6rQdTo6NwW4QJk+ MWYklfltjyhqGHjpEwPTUCCc2028pmnNdjnzW2VAbvP4I4+WL5H6TBVgEey2GUlXUz QrT9omf59v5tYU0HhbxgA7S5kHLbE7TbeD3zGCN72iGrmFg9aoULnczcL2flGKh0WQ Pq7Ok1zVudq0g96cO4xsEZ/lDaPqGpVrWiwwfNYvYFTQGZCj8n9Nle4JuC8RcmaQlx PgynadBP41vHDjF7N79WNmsePC1R3I3FbAbOeY0rfqzU8M+owdfjYCZ5eg/FZM8DIF UFgBqewr/lL7Q== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:51 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:51 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Rob Herring Subject: [PATCH v4 05/11] dt-bindings: leds: aw200xx: remove property "awinic,display-rows" Date: Tue, 21 Nov 2023 23:28:29 +0300 Message-ID: <20231121202835.28152-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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]); Tue, 21 Nov 2023 12:29:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206869460487658 X-GMAIL-MSGID: 1783206869460487658 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 Tue Nov 21 20:28:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897152vqb; Tue, 21 Nov 2023 12:29:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEaHaEt3WJXDP2bWE5JvFTZWQU0saCmoVpooqEFDcv8H2BdlK4dbGe1c13n/OC8/Nz9bNI X-Received: by 2002:a17:90b:2684:b0:27d:2d2f:9ca2 with SMTP id pl4-20020a17090b268400b0027d2d2f9ca2mr5228126pjb.24.1700598581636; Tue, 21 Nov 2023 12:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598581; cv=none; d=google.com; s=arc-20160816; b=u/3yPxTpyEvyJv2Oxw0DGiMhxzf5HuUgXfnORwXjiGNxEH9g6PXNSJV5ePqTm87Mfr ctsNBN/qlBePkXc6Ifl3JI4mj5LRrCot3O3nnQa1PLNw/K5eOyQpPHN5EJbf34kCoqRj IWpyOgCGS5uiAmMD6+lA75hsydnB7t+8WvEHCY9dwEVAcrFRYSAAmBF6ELWal1EfSNDb 5D63IzZetTmIUUov+aTnoSlEKCYyIntkVQIhhOUYAVfR19XdZBF532BbWOqSptS+uHco uNCNZ2ywp5WlArIwnC/Jj0hVcbPTV/KoPKmgIAOOdHCTmy7A5OcliYyiKbT5hbAOomdA Va4w== 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=zDEN1X49ulmHegSqy3xkzqddWLCXFjmBONcNuN0iK4E=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=s/5D7BSzWHgso7wq9tnkolfDmnskPfbdV1fkP+/EejewWmlEcjnzNsZ2/aGT1FBD4A JnnIPp4cb2OAgB0ChzR1CLGR/CDb1kfPPv1pXVA/JDoC0p0xAFf4myd7wg6uCZcpOqEg TrqE2YebWtYV9NqVKkUGTaSDl6QRuT9iSrihQPaxIAqVO7RqHkQjA0GZJxSvT7KyGs3o HYcO3Dn5RfSkw/UF05uBI3RvQAsrkVi/7Q8FrdVYs33DVeTKi6TLxE//Pzs3a6yMtnhd 5616A5jR+DslecxSEBBoqRD1a7Ai6dwH6GoNehBShMcQyUJkEc1lfbDzo3/v1olvVG6D XRrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=eEliDDDy; 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 mp20-20020a17090b191400b0028524bbcb31si5187730pjb.37.2023.11.21.12.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:41 -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=eEliDDDy; 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 43B6B811F931; Tue, 21 Nov 2023 12:29:39 -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 S234599AbjKUU32 (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjKUU3B (ORCPT ); Tue, 21 Nov 2023 15:29:01 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EB321BC; Tue, 21 Nov 2023 12:28:54 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id AD4E1120061; Tue, 21 Nov 2023 23:28:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru AD4E1120061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598532; bh=zDEN1X49ulmHegSqy3xkzqddWLCXFjmBONcNuN0iK4E=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=eEliDDDyvP14ssDDgHoc784Q48RbZewG4HqI+TEhX3ZKrJqwAPqrxYmXpBLeINe1/ fdvcOxmXLm6is0719XD2ZnA3XR71oaGNWtIfpTVjHjj4+ArM6UUo1HrOueGpD7Fqrn JMFsDRAKlHngbFMUSVyPvIu4JubcuT0eSKiGnlyYs6cWGpB5bNtTn/2hvGPgY3fQre E2wRlC7Jz9NyqEaITHRBm+YG88jTyFi4Ohl+GNaSwk6ZMIKZK1SVgZfmdEJfjlcavW J23t0R9rLDxsgphaYeXQYpm2QHMfYGjgAhJ0gOWoPAP7cfwZfuz6sHnNY9svlcV9bn FAEbWowd1X1TA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:52 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:52 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v4 06/11] leds: aw200xx: add delay after software reset Date: Tue, 21 Nov 2023 23:28:30 +0300 Message-ID: <20231121202835.28152-7-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-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,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR 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]); Tue, 21 Nov 2023 12:29:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206858079603097 X-GMAIL-MSGID: 1783206858079603097 From: George Stark According to datasheets of aw200xx devices software reset takes at least 1ms so add delay after reset before issuing commands to device. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko --- 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 4bce5e7381c0..bb17e48b3e2a 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -321,6 +321,9 @@ static int aw200xx_chip_reset(const struct aw200xx *const chip) if (ret) return ret; + /* according to datasheet software reset takes at least 1ms */ + fsleep(1000); + regcache_mark_dirty(chip->regmap); return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR); } From patchwork Tue Nov 21 20:28:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897074vqb; Tue, 21 Nov 2023 12:29:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFLi7hTd1sdJD83EWJpvRK/mUXiOMzAIj4waC5XPxJRjKkvZC2Qu/JBTd3rfcR9oSaOqqW X-Received: by 2002:a17:90b:3848:b0:280:3a0e:d34f with SMTP id nl8-20020a17090b384800b002803a0ed34fmr363805pjb.10.1700598566959; Tue, 21 Nov 2023 12:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598566; cv=none; d=google.com; s=arc-20160816; b=ou+mEaey5qCv4OfsRs7sx17ScrrGtYGvbKLSxR7VRQCNpzw+YonfiGaFCXeYDNZ3hj VJAPPLH6ogqVJMl4k22LRmT75HNBFvuyfoI4SXi14DSGLUDKcc4ORlDy7GhnO/hiLvwW vGH3MVWvlgjtuAA+RdtmBwMBZ0OSYVbemvlPFBD71tE45L05RWjODd3MScAaWLemwSR3 q8RV/JrRjONm5BiOakFWj0D3uu9cOeZ5jHOKOiIWIR39P2t0fvvkwnKFRyNGqC64/D9l 0L2jieS8k/s/BaO59G+9MM+dtLFq/0bhJywkz0KR4I2oLkdhf5QDBN75Batb/FaZtreC H8Yg== 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=BgYX2+stSRz4UC4B1i7+MADMeWskKbtgM6xh9R/y7cI=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=tjVy/PZA5X+whtWtq8e/PvZaPmYIjyWzXWvpyotNeDIqzzq10WgUwX0aCAUFpvRqDy HSAfpq/Ir2caaMMMmortdraaWKCpTOuScCvvO5lSY3HYn4mfVLH7866JR0roW3Yve2Uh mB/Eb98D7xZAclBFPm4vttfke8fVilBpjz2sfkG3vGqWnMOozS07W8Ued6rqS8wofZXF CzRT+xHWHQqJ/EE6Xnw4a20lfbJCBg1bv8NDYqxCa3sXJLm33FCRaCilLBO4aUrr/zew u8Yyw5ZmkPMrAsopEhujppJbT4XcSSTt+MVgx8YleE5dbg55L90q/cCNFq9hOZ//OziZ zcRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=e6ICdCyg; 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 lw7-20020a17090b180700b0028054aca992si14343642pjb.56.2023.11.21.12.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:26 -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=e6ICdCyg; 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 B1050802AFEB; Tue, 21 Nov 2023 12:29:09 -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 S234244AbjKUU3F (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD9F9110; Tue, 21 Nov 2023 12:28:54 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 6CC85100068; Tue, 21 Nov 2023 23:28:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 6CC85100068 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598533; bh=BgYX2+stSRz4UC4B1i7+MADMeWskKbtgM6xh9R/y7cI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=e6ICdCyg1h+8RTqRoFBoprOItc6MANLQ6Y4XHsbsTXq+DkOCuiiPfqEt9iPqEoIE2 slbjY74CviyvXLZrve49E5OJIJ9WO1GSMdqGhej/V0ydDTOIMBUrNNpR/2fQIHg0xz UFzcNQuS89fMAtKvMppPJQJX0Fp5W3nTZpcON2gShD/wmtpQwQx00V8Qh3WDPuQJe+ UDu3T21rYlOueT/mpPzTiRqzmNc7f1eDxIHdXxYCDrsFxA7y9MdZNmtyeN2M8AO0YJ BOlaB5boa85ZkLcsdreqOPK3w137oIuvC65GpMPsgFBSq2HpxUQDYcVgR0gEbsL+CY FQ/fsQ8yD5maw== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:53 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:52 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v4 07/11] leds: aw200xx: enable disable_locking flag in regmap config Date: Tue, 21 Nov 2023 23:28:31 +0300 Message-ID: <20231121202835.28152-8-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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]); Tue, 21 Nov 2023 12:29:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206843300600919 X-GMAIL-MSGID: 1783206843300600919 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 bb17e48b3e2a..4c83d4979cf5 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -524,6 +524,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 Tue Nov 21 20:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp898740vqb; Tue, 21 Nov 2023 12:32:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP8H8r9iemBjo769vvOmGli5W2slpFOPqTpIbBe3j1Nc8LIwLODIO69AU9Ef1TX8Adf8pK X-Received: by 2002:a05:6a00:2d95:b0:68e:3f0b:5e6f with SMTP id fb21-20020a056a002d9500b0068e3f0b5e6fmr311876pfb.24.1700598749058; Tue, 21 Nov 2023 12:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598749; cv=none; d=google.com; s=arc-20160816; b=SdqEKBxT1CgcZnpOZTJjxjXsjXS0Qoy6N0O9ZltfaLcIisEhCNsn3L0vikbKx/0cDO elCc/7phrij38TlM5XucVPxMd4Qk/WQ1AKCljQVDMz4UQmjZoPpaehsWsptRKFVyVBEG guymjCIlpVmNFO0Ap8IbhhJP5jUdin2jVWpO10GJWazOi/JII3eG93xhfUBFpNow3zN1 zQvVjkmFCu0ZV9KKEy0UWeQLNOSAClq+DDSf5uILTy4A2egcfLFoL8tmlFtqke8gHU47 IxV/zS3+s4+JHaQu5N/tqL+E7Q3kOT+kvFX3pmGy5uqTpsckfmyrFPZjNhzRC3DSgWtC UbXg== 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=ZssAi5WdNtQCPcb5QdmdyeQtMwsDcqRERVND2eAlJLk=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=iSwvifcoktOP30fAgLGmF1sqCYP+g5YskdCe+tOEoVO3YHcw4i/S0qG1ggC/UsxL5G UhdbHo0bZE0OyecOwcn20arJG9COKwiHNOJH6jmMPChgLBZXwoqu0ZXZ4AvvbNq8TmcN Qn1l4/pWGeEQjhqHSrug13FThVanwtSKzDTmdXy/d4yyF/AATj4l7wKWD2q8nW9Cr2b4 R9ZZ3Z6lqU7+mqpVE67JD3j4DmAY1VgPDPVxgcRCLbepXCUYmW7dNBSXiPDI7BVul9rv RM344ATZxd6BgaiZKAqBaWjaZjV4gCNNcHRd/PAScGb2FGvxbng9dt1zPf3ni5kmSrRq zlvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=bCxCluAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id l189-20020a6388c6000000b0059ccb99a2eesi11625056pgd.173.2023.11.21.12.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=bCxCluAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 597AB8031D16; Tue, 21 Nov 2023 12:29:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234549AbjKUU3W (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjKUU3B (ORCPT ); Tue, 21 Nov 2023 15:29:01 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B8619E; Tue, 21 Nov 2023 12:28:55 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 1CFCC120063; Tue, 21 Nov 2023 23:28:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 1CFCC120063 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598534; bh=ZssAi5WdNtQCPcb5QdmdyeQtMwsDcqRERVND2eAlJLk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=bCxCluAN3CZio71JN1IwWPEdslmCeOIF7AxTkHGxDerSSXU/TSWkXITbd9ZrZXvM9 klro9CnmHMVCgG7CqDt7ghQyEu7M9BcRUkvuInalUusY+1Hs83gS9xPnDb3sbgZ7oN VtVfhIAx6AeLyhm0N9Q9aG4XdBdVVt6IwHdoWG3/d6iWJfRhH1zo7dPzE1M8zYeAG/ k1YmXMYojp5O0RBwT3WVs0lwdrVB6PrURo+sBMe80eQbwMBm82GxbeJ6vyDr6uO5BE AyerZRe79Vlig0Xs25tgua92R05Jb8vEiWHuyw2Q9MMEhEau41VYsIF9T9XajxdoFb /5TPTkZ2WBc1w== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:53 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:53 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v4 08/11] leds: aw200xx: improve autodim calculation method Date: Tue, 21 Nov 2023 23:28:32 +0300 Message-ID: <20231121202835.28152-9-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 12:29:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783207033898015586 X-GMAIL-MSGID: 1783207033898015586 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 4c83d4979cf5..c48aa11fd411 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) @@ -460,6 +460,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 Tue Nov 21 20:28:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp897075vqb; Tue, 21 Nov 2023 12:29:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe04P4QjMO2Oq4KWjfcqmKWIzRfMqF2ble3QZ2EXqco5JAeW4d0sudRYgmgqSC8hLS00Tj X-Received: by 2002:a17:90a:ff15:b0:27d:1339:9176 with SMTP id ce21-20020a17090aff1500b0027d13399176mr392303pjb.25.1700598567087; Tue, 21 Nov 2023 12:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598567; cv=none; d=google.com; s=arc-20160816; b=Hot7J4N7R+ZrSNTb3k3cYCs+VyRMtPW5GsDAXPoJMkN6D+Jr89MV+Tr1RcdMAOhCtf +K4T4QnMb+i7EVVrQ92kf8ecaGRkHkqJqLOjcqvfFphvK2thKE/EkLuRw0Ek4I/34ybd ++CjlRq5Ro+E1l8qlwLcT1n4W7D671E186L3C3R0onNub61xRknbnfmJXFVCYrPBfPT3 zMyjqpYsespR22THMqk7mu3ryk05ZwJVtGSsv9lNzI6XbAwX2L+ckZIQrJ1Qzekpxnif KB5sakpt4CXDF9QejYezC74X4lwpUFLXNMUzjVO1szvjBzwQ7sc3IIRiOgqhORfwb649 l9Ug== 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=76ydPlpjagvRxWC3zBbtfZt+PaH6lVvkPGoancV3mLs=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=bShfbqyGG2rTXq0+yq0ERL9Mx1T9v2VXIPupBXnl73S2wRNhiJyenpKLOxnVNh9/jL aRhZ6MAOZc8b8ubil0PfCpgDSvBdbFdAsSC5UocT2gJQUMwbnPI9RahiDcL1KtHv25Xs 7U90UJdj9leKTkkJSOQ7RdI4boZ1zmUtzhtAV4l0Zhggm1QH1R6lHGtUFBauY0qQOP4E exL2L13K94BsI5Y1ICS+CDUqot9jbqqmJHL+gMwwzDhRejXZHXnMLwqw6Na8jyisVm2y +Vk0VRfMzfrpHGAd1zn2IW1u0l2uchLeWdUlk4peb64MtunY5V7QAERmmp4wdnHagUtR Yqfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=cQo5NRCv; 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 qi9-20020a17090b274900b0027d23073d19si11739823pjb.165.2023.11.21.12.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:29:27 -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=cQo5NRCv; 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 B5A6080DF26E; Tue, 21 Nov 2023 12:29:25 -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 S234445AbjKUU3N (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjKUU3A (ORCPT ); Tue, 21 Nov 2023 15:29:00 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21320D47; Tue, 21 Nov 2023 12:28:56 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id B936E100070; Tue, 21 Nov 2023 23:28:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B936E100070 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598534; bh=76ydPlpjagvRxWC3zBbtfZt+PaH6lVvkPGoancV3mLs=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=cQo5NRCvRh1OdTrDT+zJn2fVFy/H0XkzoFV1hF7yzSdJ8o3dv3rRKglCbok9wOSjk flONL9Jk3I+F1avmt/gytt93lNl7vyF4zw/AW5Op/Ptt9xHwemOoYjC9/+OxFC4LBB zN8JsVG197eDvAGiB6pwItUS0XyimH96LLMo1awEpEdzDWe4PFWNrD/NXZ6yJiRu8c 88CZEJAFrgzvgGmHF9W0QNfGRLBENkuZmCR8w1lhpgvuLxAYh0K4f4R3k35H08gKKs PysgI49Vl8uTiVi71QwefQ6pKMZHCyDPVMn06OIHwq46IAb9ZLEUjwdhsWidrZIKR0 dVbhD6e9SOIHw== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:54 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:54 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v4 09/11] leds: aw200xx: add support for aw20108 device Date: Tue, 21 Nov 2023 23:28:33 +0300 Message-ID: <20231121202835.28152-10-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-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]); Tue, 21 Nov 2023 12:29:25 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206843303663739 X-GMAIL-MSGID: 1783206843303663739 From: George Stark Add support for Awinic aw20108 device from the same LED drivers family. New device supports 108 LEDs using a matrix of 12x9 outputs. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko --- drivers/leds/Kconfig | 14 +++++++++----- drivers/leds/leds-aw200xx.c | 10 +++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 6046dfeca16f..a879628e985c 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -95,14 +95,18 @@ config LEDS_ARIEL Say Y to if your machine is a Dell Wyse 3020 thin client. config LEDS_AW200XX - tristate "LED support for Awinic AW20036/AW20054/AW20072" + tristate "LED support for Awinic AW20036/AW20054/AW20072/AW20108" depends on LEDS_CLASS depends on I2C help - This option enables support for the AW20036/AW20054/AW20072 LED driver. - It is a 3x12/6x9/6x12 matrix LED driver programmed via - an I2C interface, up to 36/54/72 LEDs or 12/18/24 RGBs, - 3 pattern controllers for auto breathing or group dimming control. + This option enables support for Awinic AW200XX LED controller. + It is a matrix LED driver programmed via an I2C interface. Devices have + a set of individually controlled leds and support 3 pattern controllers + for auto breathing or group dimming control. Supported devices: + - AW20036 (3x12) 36 LEDs + - AW20054 (6x9) 54 LEDs + - AW20072 (6x12) 72 LEDs + - AW20108 (9x12) 108 LEDs To compile this driver as a module, choose M here: the module will be called leds-aw200xx. diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index c48aa11fd411..4b5036360887 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. * @@ -620,10 +620,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); @@ -632,6 +639,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 Tue Nov 21 20:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp898148vqb; Tue, 21 Nov 2023 12:31:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfDhpfA5YLeX1SaqU5ltbgXPrc/HmR9d9QNKL7zYor3xN1/vMB7A61Ud3BSk9ScaVaqnYU X-Received: by 2002:a17:90b:3145:b0:281:3a2:80ee with SMTP id ip5-20020a17090b314500b0028103a280eemr337277pjb.14.1700598685102; Tue, 21 Nov 2023 12:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598685; cv=none; d=google.com; s=arc-20160816; b=YYykLZs7EI3DlNObPLCeEPyfwpK5cpacv2MKTyTPExbgQqRgPx9t/9qd6Dn25BDbsc Vhn96shIxEkAnfoC3ZqovVcytPixs+FDFY0PJwjUHTyfngSEM0lRU0DOdyqjX8gCi9fE PG6X3K0sKpMpabC9fYZETFsxPbF4BoqjTTnFrQAZYVeiGRkNEwwi2x9o/7eN/Ov3s8C5 T1OJBFe9gROKrKJ4Tal304R4jcPSj+yVeeRJvh/l4VrqSHCytMmxAumPbzXcZ8lH2j9V dLJYNdtknadJOYh2EXl1/0o12Q5utn7nOaSia/GJJLG0iQtaF56UGVLcAOwFUCeT6quL p4BA== 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=L6FBqxUNa90nd8QwK/8zZv+K90g+diCfOSq8lVaDQn/zCMgKvw32cxMc/38BoTtnZf lHsk3pfn9RpPyM4xkHacVX4rSP1CQqiyvS3k6YSbFVjgMGiWJNfJ23EyoO7vPSnNxNnm sctwPfZr5+kGo5FB8cLkZL5Sr4XoYemAc8fboZ9YTDXnddzD4EPHtQVYyWfPEg3G+MGY M/dg7WT8X2FfXCazyQRsNpHkxahfeYQsZeqi7B3y7GsRNz4/xwrOSnCg1WNH2FDnyB9j COyUkh5yEXLLZzxZwaf1pRbvZpTTzcaUcUJGfSEBhAsp5FO6JqyWn1aLypYRYH03cotr kifw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D4mL8Apx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ok17-20020a17090b1d5100b0028103a8ad9csi11857604pjb.68.2023.11.21.12.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:31:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=D4mL8Apx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E316A8023183; Tue, 21 Nov 2023 12:29:57 -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 S234333AbjKUU3d (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbjKUU3B (ORCPT ); Tue, 21 Nov 2023 15:29:01 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B03D4B; Tue, 21 Nov 2023 12:28:57 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 53579120064; Tue, 21 Nov 2023 23:28:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 53579120064 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598535; bh=/HrW0X+9rW0pBeZMX5Q2JYjOL2DcSt6189XJga8hqTE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=D4mL8ApxT9G0OVS0Ao3pKhHWk3yP0L9H1s5Jl/BXka/iRAlnO7iCbUgpIG0XmrN7Z rjIYKW3w1rsFHjx7S6EnohfaZh9FucVxptHZEU438xSfmkGG5iD+gvkUBWxK21OmlR JG3lxWlADPtaRenJQYQj4OyAp/TW7fE36qlHDAF9maFKrYpj6wdbMwj76A1DcwR2Al MUYpAvJJ9ZmTH73hG7JmNGfraXjgOmhBnIQMRkjXEUgNDuD61PswTLgjuRoSvhMWhE YxBG4Gv5n76quA5aM18csb9dfmwNIRbGHWYe5AZrRzxj62tbWyePa+jQrxzSVuAbt7 LwCH16py3vk/g== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:55 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:54 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Conor Dooley Subject: [PATCH v4 10/11] dt-bindings: leds: awinic,aw200xx: add AW20108 device Date: Tue, 21 Nov 2023 23:28:34 +0300 Message-ID: <20231121202835.28152-11-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;www.awinic.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2023/11/21 19:45:00 X-KSMG-LinksScanning: Clean, bases: 2023/11/21 19:46:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 12:29:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783206966725080162 X-GMAIL-MSGID: 1783206966725080162 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 Tue Nov 21 20:28:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 167934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp898748vqb; Tue, 21 Nov 2023 12:32:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyV8Q+DV7VNmjQhakCCnCXSozobih24OkcU6Jknn6aXMKVGJMc759a7SfLM5u9/Iogg64w X-Received: by 2002:a05:6a00:4ac7:b0:6c3:7978:f82f with SMTP id ds7-20020a056a004ac700b006c37978f82fmr370766pfb.9.1700598749987; Tue, 21 Nov 2023 12:32:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700598749; cv=none; d=google.com; s=arc-20160816; b=m+2JNY0sIsWSz2xQZIGLH5KX1LKP37C2mwPdZ5bofxEnbfsapoO3XKJbbwxfAhiVZ3 eC5Q+qCCdy1TA1wgQilxmmC7V+aXuKTEn/CDR4vlG4cdyiI8PMS+BiR26cCgnrlDsEBu 54I7J0ScUkAzrrPA0tgtWGPVmWJYSCAz9opssGfEeCiBKbLaDcS4d7I6X7yM1SO63Wa5 fY+2JKHFaF81fgwTuJB/7ih7rJfVcw6hDIAtQKRnbwlN3X9auHh4yDePdFo9ccZTYfXc DY+Jgo2/GOhVuEyViue0vpvG+LFkSIk8bw8vtHWu96jpelf6VIn/4dcdNyQ4Q+M9xPJT 1m5g== 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=wJKVXWbGc2QIV+79WCiBRVZqRZksnyEWfl9DmBjkIGd9oENeiQ12ZAtHIBUTSyk5FA iolWcHZ501pn+cjy+BbpaSpEEysdRZzEMw1PJyQCWYLBFg9j9NcPG951J7W7fE/VtV2z uYglf2BdpwFUM8uaj+PeEbbHY2qq6P9OsynA+JqOL4/kiDlrXMdn72pu3SSOvc0OTnXp +l2pQkAB7b6RY4/LxvsL7qtRFPSazHGh7vi6exK5Cy63L1paBGlIz94ivgxnN17F271p fLr5JDjg7OYhEOQIjOYKRhIEF3dpXDhYHFWEygmhv+cshWoozLeU5W5/fC3qHimuOuPB ORCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=egfdggIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ca3-20020a056a02068300b005b930e0b604si12484381pgb.549.2023.11.21.12.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=egfdggIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id B101E80323B4; Tue, 21 Nov 2023 12:30:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234541AbjKUU3S (ORCPT + 99 others); Tue, 21 Nov 2023 15:29:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjKUU3B (ORCPT ); Tue, 21 Nov 2023 15:29:01 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5917FD49; Tue, 21 Nov 2023 12:28:57 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id DFC94100071; Tue, 21 Nov 2023 23:28:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru DFC94100071 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700598535; bh=YEPAVovAT7fOQhJBeFq/4sGvowJqoh7IRxQv9siAkaY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=egfdggIoxtLmc2adnt4Mj3XJh8mp39esubzJDPpJ0i9gKVrMXVLBhtTReKVqJxiGJ pFzNz770d+ksoMuMoBu2BeesmSQuwSU1kcNgxGTRtM/6+BLvni9peP0kdcoN2LX3jR atNt3AaMirmNX8IcEc4e8esX27/6jtVCuUFxQHa6YDebI6sihKhPKkjOE05wMCodTQ phQBdwout94O0NvOomzOMpJSDKBVXZVmvON6otjF66ukhwhvzx2tF5Z8u26zv2UAnO 6nKsnsou4FE4qFjNA5vh59Aj78VGExxCTQu3ph8sNEkLWiPRfzkslhUy0xotXL9OYY 52S//8BKrd7KA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 21 Nov 2023 23:28:55 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 21 Nov 2023 23:28:55 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov , Conor Dooley Subject: [PATCH v4 11/11] dt-bindings: leds: aw200xx: fix led pattern and add reg constraints Date: Tue, 21 Nov 2023 23:28:35 +0300 Message-ID: <20231121202835.28152-12-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231121202835.28152-1-ddrokosov@salutedevices.com> References: <20231121202835.28152-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 181514 [Nov 21 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 3 0.3.3 e5c6a18a9a9bff0226d530c5b790210c0bd117c8, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/21 17:47:00 #22495004 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 12:30:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783207035083422393 X-GMAIL-MSGID: 1783207035083422393 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