From patchwork Fri Oct 6 16:04: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: 149319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp433455vqo; Fri, 6 Oct 2023 09:05:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxW9YaaChVIqvvj8CmsvN4PzbhCOUF7UnlZ2m9eSXvtRDGmwYrjAm3Hsfr6Yxxndh6lgR8 X-Received: by 2002:a17:902:c3cd:b0:1c6:1cd8:5b59 with SMTP id j13-20020a170902c3cd00b001c61cd85b59mr8347282plj.1.1696608327554; Fri, 06 Oct 2023 09:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608327; cv=none; d=google.com; s=arc-20160816; b=wPWxsgkGPvosYb/n3qfExYKOdyksd2smRse2+hnBkPvGqcZhiFBLGwgXbVKgsKxjpn JZIRYe6INf7Z81Tv2i0ehN1Q16m++sUC7CmrSCdLDGQhH4lesGzRIRtL1tCbQtP+d2Nj E9E1d9p3FSj2RTSmTg3nfNAZ1Iy5Rfd0lEzeVmPmbkFkpVPaBd30aDZvS+EcC6LrCVK3 H8fTAk4QmUGQFQQaDN00xiCcf2Jhv8XWWIzdIDlYVxUiDCJi3D3vY4bYnOrSX86fVWoP 44mbsx7S7j4cJzLZKATiezBdbKMEajBLgKuu312S14GBMfiUfGEDDjKlQ46BZAXIMuT0 hONA== 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=kHbodGBgf5sQJA6py7zjWhCy6Bs6OTAtXOE0QUASalA=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=HfoHADxlKr9Y/Syw+dnsLepnSxX6vaacE56lvQWRbq0oSKgI69h9eceIIPCaFu2Pm8 2FkFD0PkGKsD5JmdWqstvkux7Tl4CNQ72rEgBJWz6zZmCKpdyodVH2PE00HD8g3pLnt7 ceyRRCqaLzOesCLkPYfNlAbFTjbP5cst9OfrTyVo0EGebQYxOQRNTOiBRjXicLhBXoUv dhpxYn+k+D5CJgz7b0FrlOMvewKAX4MryQyO/yC2hgxB/Sie3GdC1f/SOk6iAAeR5AjW yZUPlci+jOA1Ka0VKFVau/4VJm8/S3QVvry9mGPaJZDvhTtiAN1QIEpN+cd3jZJqnu9E GQSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vWkqEGTF; 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 kh8-20020a170903064800b001c42d60b9e6si3805012plb.112.2023.10.06.09.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=vWkqEGTF; 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 4E1D482DD0AB; Fri, 6 Oct 2023 09:05:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232923AbjJFQFC (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232583AbjJFQFB (ORCPT ); Fri, 6 Oct 2023 12:05:01 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A9EA6; Fri, 6 Oct 2023 09:04:59 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 8D026100003; Fri, 6 Oct 2023 19:04:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 8D026100003 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608297; bh=kHbodGBgf5sQJA6py7zjWhCy6Bs6OTAtXOE0QUASalA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=vWkqEGTFSDT/03+RtxcUEPx86eLHUuwNITpDMCN/ED/FFKeaMdMCUaYUN7+uyHw77 IaVlPCcumijd8QOV6W6BtfXaIzqbeJmHCZil/z9sbINEnTqewvZrmh0iKwqsCEHGK2 AxmqDPZ8xmzKDK5gGgXsEVVTeKzlI+fKVkxKBVsyftygBoVxJETywWMMY1wNAXpqbL 6mLohns5GKTjC7LayjhiZTWKICO6ed5FxQ9b+J8AdhrNUmBUTFunziBT4PrQQbQpfH NZy2lfzSNz9vuXEHrFoAxgDIOmC2f1QWv8OCuNNq/rCkSr/HA18PmwCZf6OlgxR79+ HWIe2KyXiWESw== 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; Fri, 6 Oct 2023 19:04:57 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:04:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v1 01/11] leds: aw200xx: fix write to DIM parameter Date: Fri, 6 Oct 2023 19:04:27 +0300 Message-ID: <20231006160437.15627-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;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/10/06 13:25:00 #22070343 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 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]); Fri, 06 Oct 2023 09:05:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022773523207152 X-GMAIL-MSGID: 1779022773523207152 From: Martin Kurbanov If write only DIM value to the page 4, LED brightness will not be updated, as both DIM and FADE need to be written to the page 4. Therefore, write DIM to the page 1. Fixes: 36a87f371b7a ("leds: Add AW20xx driver") Signed-off-by: Martin Kurbanov Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 96979b8e09b7..4c1e7caf8941 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 Fri Oct 6 16:04: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: 149318 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp433251vqo; Fri, 6 Oct 2023 09:05:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGK8LkmUsFLCXN2jcJpaW/Bb3L/rR0ojecF4iIZx7WDYCREtR+t72EsjBEB+1KpdBPYroJ5 X-Received: by 2002:a05:6e02:1d94:b0:351:4bf9:5b02 with SMTP id h20-20020a056e021d9400b003514bf95b02mr10503415ila.7.1696608314305; Fri, 06 Oct 2023 09:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608314; cv=none; d=google.com; s=arc-20160816; b=LvbmAQtDSmzhlJWxrPV61feMC4VbWhimS+Dfbi2DFHT7TTqoVrf88GeOof5qhi8GMY Ectx76AOMQac3e/Mu6ePnKCRrJ3H+XGdQsI5KwX35QrRCN0JH0BgWEl5nQZk1BP7qHGL YmQ8LxZ3ZWKea07vAAKsZTj2nknk+MFdqpKBst2ZGyFnuMWP65WnI12Wwp0BQQf0H3A/ eSarPiVQlHOzMfDf5q5gEria5k33FqL+doMJ3bCBE83TwSup67N9xxtPSm4CacF/zbmZ DRIPnsYWZvuXvt+YvrjB0dIhyTEahWLpzRI5gz8c/uGwtoPOwYfg9zIQTq+zq557+lQ6 X/bw== 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=tTgk3K5xA8w9csRsVGIWe85mmfrm+XajO3H96oGzBLk=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=dn0HF+IQdPGscF6MOULE73+2ZIntZXP3UdRXRicH/pvHPqJ9jZxq72VKbxdKsjSTKs 2geAXTDxC3apv+eA5+Rwxqz3+kkMmWwdDZnxXEcdEC3KtRDGAT48F/FDzOi+zvKOKqlM 5l5EoWH6ocT2t0EQQjaL1PwzVhUCJaS9O+jCN9zrMBaCbDu68kF4jBH+Z5v8NTGa5xa/ OF8NEkLjBPw331gy2l/1canhs1DEEaNJKLCA4XBWVap/7Y7iL41sCImNjG7gEafOaXDc +Ij/JwJmbAyO56fuVhtf2psXRYl+2xxB1Mrpukpfq3JTI0bzNMiDC8x1O6mj0FeTp+eP kWsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=TlZXf5ip; 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 p24-20020a637418000000b0058978136252si3241895pgc.484.2023.10.06.09.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=TlZXf5ip; 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 055DC82E53F7; Fri, 6 Oct 2023 09:05:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbjJFQFL (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232917AbjJFQFC (ORCPT ); Fri, 6 Oct 2023 12:05:02 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36281AD; Fri, 6 Oct 2023 09:05:00 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 62A32120009; Fri, 6 Oct 2023 19:04:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 62A32120009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608298; bh=tTgk3K5xA8w9csRsVGIWe85mmfrm+XajO3H96oGzBLk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=TlZXf5ip2VgKx3p5qPS9UgH3pFlbwwoMAhwEjHBti+Edm3n/jLPzoxYi2mcG3MdkD tawoyZvzp+7RZp4WskJhtm7mh7K02O3VTPsQNNzwif0MtPE9BoA0E+NTnHEn9KsyqG ENJbVdIvBHIfxcC+pJSSvLhdx0zqc9EOSrFRrvjntkCdm/pDdC9MCzxQbIs32zgfr7 W8v8XPLo/Ob0xcroXe0MqieplqkVRN5vZVvEbOdVA1TzGUYhUqaHeGrxFqiusH7GAi 6oZ8M3KjOL8aCJWPU0tfFY2eDJY+DGu1qACur9rSVJTlq0FfWyAVKfydpd2/xHe8Qd X/wYBBoQyb31w== 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; Fri, 6 Oct 2023 19:04:58 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:04:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v1 02/11] dt-bindings: leds: aw200xx: fix led dt node pattern Date: Fri, 6 Oct 2023 19:04:28 +0300 Message-ID: <20231006160437.15627-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180439 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,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/10/06 13:25:00 #22070343 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 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]); Fri, 06 Oct 2023 09:05:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022759528539018 X-GMAIL-MSGID: 1779022759528539018 AW200XX controllers have the capability to declare more than 0xf LEDs, therefore, it is necessary to accept LED names using an appropriate regex pattern. Fixes: e338a05e76ca ("dt-bindings: leds: Add binding for AW200xx") Signed-off-by: Dmitry Rokosov --- Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index feb5febaf361..73b81f7a7258 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -42,7 +42,7 @@ properties: Leds matrix size patternProperties: - "^led@[0-9a-f]$": + "^led@[0-9a-f]+$": type: object $ref: common.yaml# unevaluatedProperties: false From patchwork Fri Oct 6 16:04: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: 149317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp433218vqo; Fri, 6 Oct 2023 09:05:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxBIDTvFBO1ojEaN09PMBr0ryZGHMcftcsyZ8t0rDkhUCOwh/ipUSQLweSvYSIKLQxNpl7 X-Received: by 2002:a05:6a20:7f95:b0:140:3aa:e2ce with SMTP id d21-20020a056a207f9500b0014003aae2cemr10776260pzj.42.1696608312852; Fri, 06 Oct 2023 09:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608312; cv=none; d=google.com; s=arc-20160816; b=SpDGGC5I0Udynrh65Bcwv0yba1MUQKLYeBj9JCGmwQafiS9mE4i63qJQr3d6h8Fi78 PMfx9ItaqcsGUjUYP1xIH+nWIYmU4L96af6mwO9vB4Ft6A0MgD4P6oQdulriWrixK7Eh RBk2dZgfglqB2rLvlFdhGGcafeTSebrasHhQPcarKCqbIwo7VzromSV/0SJ9Pynzr5fh 9OfNUCq/gqB34ohwBprddUwPPjLiO1iH0REpZgqMYSlWVFeHcAezqmxEfL3xlkP7bLA/ DqaKNeOjuM6/HsoOeY3/IWSxPQZwyYB269/ExwmCfmin57FgTpK0Hn+JFcinMNwHly5r PWYQ== 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=1i5KLJDlmR04HZpxnNtNnrQF26X3njVdttX9GpsMovo=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=cRMpG2R8IOk1nAeQ1/jg2oPgQVhPvmKggjgHUa4nlNIpBbTiBveiI8sJQeVcqoQJSF QbQbYZ6X8GsuRYEpcqmgb3YA8JaOdMmedQMENCRXiSF7VtgNrCgzQPMRM+MQXQyj20xx s1O2lxtpdJHvNlpdNDHIRMrQ+0f/c40b9RwkKdG2DEYdhzH4mhycZIurTHyX2BUswLnD uvCF+HeJGPENkdBIjycf+2f5+FHqQ3CRLxRUyM/8TMVLH03UsetQJ7v/SjZ0IT9Y0X7V Us3qWG1+2HHxS4qvOok5xUS9gIeTnbQyzWALJs4utGBpV5c4LqjKi330kw+YtxrK2vNA 5XQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=rgEflgYc; 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 bs5-20020a632805000000b0057745535158si3847416pgb.181.2023.10.06.09.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=rgEflgYc; 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 1A79F82E27E9; Fri, 6 Oct 2023 09:05:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232929AbjJFQFI (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232887AbjJFQFC (ORCPT ); Fri, 6 Oct 2023 12:05:02 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1610CB6; Fri, 6 Oct 2023 09:05:01 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 484C9100004; Fri, 6 Oct 2023 19:04:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 484C9100004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608299; bh=1i5KLJDlmR04HZpxnNtNnrQF26X3njVdttX9GpsMovo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=rgEflgYctyEV6xGQzhHvWnPgVFXkKq4uQxP8p8BHhjVetRTivNaRlec2qBmaqhA2u 8pXejWf5cvrv21tgnfwH9DKShFAGsk9xdjCrLGpjrRhOTelbnA7nMNtM8NTR2tX5ti udujrYd/alZn12TTPvFbfbbiDyEwmni2jYaPpTG7dgIOaAapI5cmZCqHx2MmWo3Vu6 KRP02uv56Oow2T46/Nf35AHdbofWVX9X/6mJE/3IIyKbtmfSWXa3oNQj2rWEryM5Y0 RcEqiDYRHQ1SGYoj9UKgC4O1NW4VM+c7C81eOX36cJgIcm+OAegXy6AXEdLCZxQp0R JmPN7ekdzctjw== 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; Fri, 6 Oct 2023 19:04:59 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:04:58 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v1 03/11] leds: aw200xx: support HWEN hardware control Date: Fri, 6 Oct 2023 19:04:29 +0300 Message-ID: <20231006160437.15627-4-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;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/10/06 13:25:00 #22070343 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 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]); Fri, 06 Oct 2023 09:05:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022757773896546 X-GMAIL-MSGID: 1779022757773896546 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 page1 to page5 can be configured via i2c interface. Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 4c1e7caf8941..d92c082d4ab3 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,7 @@ struct aw200xx { struct mutex mutex; u32 num_leds; u32 display_rows; + int hwen; struct aw200xx_led leds[]; }; @@ -358,6 +360,29 @@ static int aw200xx_chip_check(const struct aw200xx *const chip) return 0; } +static void aw200xx_enable(const struct aw200xx *const chip) +{ + if (!gpio_is_valid(chip->hwen)) + return; + + gpio_set_value(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. + */ + usleep_range(400, 500); +} + +static void aw200xx_disable(const struct aw200xx *const chip) +{ + if (gpio_is_valid(chip->hwen)) + gpio_set_value(chip->hwen, 0); +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -445,6 +470,18 @@ static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) return aw200xx_set_imax(chip, min_uA); } +static void aw200xx_probe_hwen(struct device *dev, struct aw200xx *chip) +{ + chip->hwen = of_get_named_gpio(dev->of_node, "awinic,hwen-gpio", 0); + if (gpio_is_valid(chip->hwen)) + if (devm_gpio_request_one(dev, chip->hwen, GPIOF_OUT_INIT_HIGH, + "AW200XX HWEN")) { + dev_warn(dev, "Can't request gpio %d, tag it invalid\n", + chip->hwen); + chip->hwen = -EINVAL; + } +} + static const struct regmap_range_cfg aw200xx_ranges[] = { { .name = "aw200xx", @@ -517,6 +554,10 @@ static int aw200xx_probe(struct i2c_client *client) if (IS_ERR(chip->regmap)) return PTR_ERR(chip->regmap); + aw200xx_probe_hwen(&client->dev, chip); + + aw200xx_enable(chip); + ret = aw200xx_chip_check(chip); if (ret) return ret; @@ -537,6 +578,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 +590,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 Fri Oct 6 16:04: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: 149320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp433588vqo; Fri, 6 Oct 2023 09:05:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGui7pe/FiIzMEojgHSOhKKq38W8LyuKabek21/loOQ9yY1d5Ip8iaOycUP3VGAmACSgpym X-Received: by 2002:a05:6a00:2d01:b0:68a:6d34:474b with SMTP id fa1-20020a056a002d0100b0068a6d34474bmr6910456pfb.15.1696608336013; Fri, 06 Oct 2023 09:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608335; cv=none; d=google.com; s=arc-20160816; b=rz9FxjWhxgHVkNjGE7ZyOKj2SHGIHanAh3m5qjFlk6at90t3gmT4+J/2WcaLd5tJgH Trkbr1EZvzrPRC3+6H8qG1dpke8FAIefJR0aXUd+BQsOT61VJUANTXDUjUAaTVMoNPvs jOpxS6jiTpNDFUGFNC31+7f6uhBMTMiVhZHWnLiOEb0I3p1k1DpjGuFF+xUnrqfYLwIx xgQdmtDII7ANwW0WYXvG29LaXaCci7CDNnLw1aBQIIRFS2tKgVkHi/j47fQNUUFDqQiH Eiwzup7jiHMGxSylVndVOulB91WTC87lhvalUT3PL0wUvyw77aC8h63ukwMHJlQmibpf THMQ== 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=4J/JIZb8TJ/YBiUfw0G+dDdYJJZD1Z0B5w2YjJsc3UQ=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=b+Wn/3JVW5ampyGmUe/62rNwo5OlIt0QIcAZ0S4IiKDXENHgKHzDq+V4uIGr5QSFss T+3vLAcnSMCwfcfQsX4RJ8SL2oQoPRdiY9H7MqsHFQkHF3LxCM7M1kcLaheEjivTyssA 4ZpOCEaXglZHXyJVt1EC/NUh3b3/r+wwIrch9MxM9UkZIdT+lBhCxpu+p86priYvySBl Uz3K0kuvJIlOmfw6Zkp2a83yGRs7hNOxXaLaVrH+il3+0vUBATg8tqiP9+5qYSXuj8fj dBnnBiPldq9er2JegjZC5nnHKa7jHuvS1Y6Qx+NqWE8JEY6IFEGh0YTTYlbPMGlBtYI7 eXGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=IUlAfyh6; 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 z7-20020a056a00240700b0068fcff1dc3asi1824935pfh.339.2023.10.06.09.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=IUlAfyh6; 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 08F408313344; Fri, 6 Oct 2023 09:05:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbjJFQFO (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232920AbjJFQFC (ORCPT ); Fri, 6 Oct 2023 12:05:02 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE14B9; Fri, 6 Oct 2023 09:05:01 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 0124812000A; Fri, 6 Oct 2023 19:05:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 0124812000A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608300; bh=4J/JIZb8TJ/YBiUfw0G+dDdYJJZD1Z0B5w2YjJsc3UQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=IUlAfyh6YBeRpIT7W3Wc+cTi3YCzz6gkUHMEIpTrsP7OeKxq2brkh5AMOddwjukmY csQ0Z79o+WmQ4URYPRjKCMmEgF/sRiV0Rm0nTzRovNYR5gm9sU6tH4I9lePXACKjE3 TOweyYG+tO74EZ7jwr/KAtd8ONsK4XhlwQwDz4Fri/icGfnsabGqogquYKlf4ZCzxD qsR7M0sPcyhHikisSAjzfubfhlr07V0r7rfaFdEqWaczfA3z+xOAcqx7kgfO5bb+yF TVFVgTLgFCsmMBOutGd3TqipGfrQ7hB8gDgNYKjmZ6+WU8JTEWNUQP+Zw5Z6FkggE9 tTMuA/sA6acXA== 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; Fri, 6 Oct 2023 19:04:59 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:04:59 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v1 04/11] dt-bindings: leds: aw200xx: introduce optional hwen-gpio property Date: Fri, 6 Oct 2023 19:04:30 +0300 Message-ID: <20231006160437.15627-5-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180439 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,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/10/06 13:25:00 #22070343 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 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]); Fri, 06 Oct 2023 09:05:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022782596713432 X-GMAIL-MSGID: 1779022782596713432 Property 'awinic,hwen-gpio' is optional, it can be used by the board developer to connect AW200XX LED controller with appropriate poweron GPIO pad. Signed-off-by: Dmitry Rokosov --- Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index 73b81f7a7258..e3ad11fc7a84 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 + awinic,hwen-gpio: + maxItems: 1 + patternProperties: "^led@[0-9a-f]+$": type: object @@ -90,12 +93,15 @@ additionalProperties: false examples: - | + #include #include i2c { #address-cells = <1>; #size-cells = <0>; + awinic,hwen-gpio = <&gpio 3 GPIO_ACTIVE_HIGH>; + led-controller@3a { compatible = "awinic,aw20036"; reg = <0x3a>; From patchwork Fri Oct 6 16:04: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: 149326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp435471vqo; Fri, 6 Oct 2023 09:07:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZtB71r4kaQ827wLviv2UlTE0/29qRBGXSKPKuSdbJysSE2rMjuncqRU5wIBhUo8Wl4/L4 X-Received: by 2002:a17:902:ef87:b0:1bf:7d3b:4404 with SMTP id iz7-20020a170902ef8700b001bf7d3b4404mr6602633plb.17.1696608463969; Fri, 06 Oct 2023 09:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608463; cv=none; d=google.com; s=arc-20160816; b=DQFnYIZEs1IvOOFARVbP6gmOSFKb5e9CKIcbGNo2EZ472fLHTVaNcLGWnPvQ4L6zMR eq2fACGUluSTxGitYY/ggYvMWlA9bMUIK+LO8qK/pko/GW61Iehf/FcEIsxAZif6FVT7 Fxui30Mr8ROkPe8fyC+fCRNW1ww7j9XFDY2GoctdkEglcUUFJ4kRK/X6zMOZ36WNBi52 rWYPeGnfhyT0S9vsCbTGu7zrCdAxkZ4dgyeRivHrUKT+BbuGCc2BFzK+zN1xQ9fPLidk cN8o9dTXRkzSp4gIDy/DDE2sd3KGhL34GH7PylLL1Nw2wyxJU/lET8gWF59MYp6HtL7n ldmA== 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=5Ufuy/Jjm8EWqaQZSmq4eDmLrQJXNTNImLau+WXmXuQ=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=Y4X5sL8ufjB30lzV56Mvld5xM4aC7L9ifUB+qhYOeJcpCdEHJgvmuwan+6YqRyCTDR QZuNG/L3lPyfu/ZLGPJzS7kOg8Uo3KKrj37OPr5GVut/YUTy20xlFLpTS5KBiuUdpQvN vXmf6TDsP/cuMLDlcoP/2w8QLd2hvxi7KK/4zmOWPTT3hDBlK/TQCF7UrO8rFeESb8tE dWon5V1RuclGOz0gEpqo0uLTLHltmK7V8wLAFx0+C+nKr7ZEtFPNTEvUirn1+uPs3Ldq VYydTxLDRj0IpCA0ebXmbUXazJKFRAaw/Ul/8L0zG1TYe38OG4TA1bHsuOYL0cugzP6G gu6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=EmE3pDxA; 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 a11-20020a170902ee8b00b001c72c893ac9si3989931pld.104.2023.10.06.09.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:07:43 -0700 (PDT) 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=EmE3pDxA; 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 9106280681EC; Fri, 6 Oct 2023 09:05:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233002AbjJFQFf (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232941AbjJFQFH (ORCPT ); Fri, 6 Oct 2023 12:05:07 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96B4FA6; Fri, 6 Oct 2023 09:05:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id BF5EB100006; Fri, 6 Oct 2023 19:05:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru BF5EB100006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608300; bh=5Ufuy/Jjm8EWqaQZSmq4eDmLrQJXNTNImLau+WXmXuQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=EmE3pDxAP5+37QT2BX/JVZBhXigkaBobMIpCmpvDLM8IlTxSh8v6uEaNJ/7DXmwop j6X1rocubh1uNfj9DmeafC8uvaGqnBZAe4mIOn4pW62C7unulmHIHKVkNKzdoEX9Vw 3thXMgm5wZS94Ss8FMG1Nl/L8rZrFK2HDN5dteXCOpcRrRfKzoRw+tCI9yUnEheXyb Ky/YObDmzmz4qm6O3PzEkH/QKTo7lq3YSZOKIAZqjtWUdFKq0UzBdJ4U8UwRyZ7A77 s8Ht7pTjBCYKdvcMhlCPXWq02EP9BA3GOcipJMm18EMl8IrVW03KqYZBmur7kAPdug cY00b2JZVL5vQ== 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; Fri, 6 Oct 2023 19:05:00 +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.30; Fri, 6 Oct 2023 19:05:00 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 05/11] leds: aw200xx: calculate dts property display_rows in driver Date: Fri, 6 Oct 2023 19:04:31 +0300 Message-ID: <20231006160437.15627-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;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/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 09:05:52 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022916630546537 X-GMAIL-MSGID: 1779022916630546537 From: George Stark Get rid of device tree property "awinic,display-rows" and calculate it in driver using led definition nodes. display-row actually means number of current switches and depends on how leds are connected to the device. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 40 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index d92c082d4ab3..5b6907eb6299 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -383,6 +383,32 @@ static void aw200xx_disable(const struct aw200xx *const chip) gpio_set_value(chip->hwen, 0); } +static int aw200xx_probe_get_display_rows(struct device *dev, struct aw200xx *chip) +{ + struct fwnode_handle *child; + u32 max_source = 0; + + device_for_each_child_node(dev, child) { + u32 source; + int ret; + + ret = fwnode_property_read_u32(child, "reg", &source); + if (ret || source >= chip->cdef->channels) + continue; + + if (max_source < source) + max_source = source; + } + + chip->display_rows = max_source / chip->cdef->display_size_columns + 1; + if (!chip->display_rows) { + dev_err(dev, "No valid led definitions found\n"); + return -EINVAL; + } + + return 0; +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -390,18 +416,8 @@ 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 -EINVAL; current_max = aw200xx_imax_from_global(chip, AW200XX_IMAX_MAX_uA); current_min = aw200xx_imax_from_global(chip, AW200XX_IMAX_MIN_uA); From patchwork Fri Oct 6 16:04: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: 149323 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp435012vqo; Fri, 6 Oct 2023 09:07:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpXMkmaQLxltpSr/ESjtpffZmiOazRGMrRl68uz/m1IKBxb/nGcsOCnuAXlh0k0Hqorf7D X-Received: by 2002:a17:902:c40c:b0:1c8:90bf:4234 with SMTP id k12-20020a170902c40c00b001c890bf4234mr2407578plk.61.1696608430651; Fri, 06 Oct 2023 09:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608430; cv=none; d=google.com; s=arc-20160816; b=KK/fyC3jHxLi/k4c07XJcDLQtWmqO1KlPCxI77Balf7/6Os2LhZCoHKuuzaznj08g9 02ajkyqACxZVi0MEXELCXNowMDhtAfhus5l1qyIvdpZpgH1rTe7Qv6V8R15XqMSvyByz d16wPFaX7AUOu2zptmMPGt//tzM+Y8VOsMQ99v4aaYpyFTQgDqILgoDex/EtgW+3rB8I GtI3iYoZgbXgkAf65hR8DdflTnoGamZiPNh6rtTqK8+1jC7PIg8IMvGCNvlCOJNSh0gK NQEB6gaDnQ28yvSTVqz4WbfjsB3v+R04MTV4AF1klzGugDqhd3dsxzuN4sZCDC6tQSvG JM/g== 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=tN35mD0+nTDTwkVuf3TrI4jko6f8nzNCzdD5oWRnoxE=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=gq/HR+5JMD7YVL8ZF2xujtiXtOMiPHfzNBDlbaUFLtC4McnSm11XzBvOszwwfAovSW GCi96J7ZudrjqAIkBwKCS6jlKRFDJYgBcbkgWGcIEU2w8FsOBgrkFN5fkyZC9aTxX3oh uojmiLFOlSp/S1z91VdtKgegFTvqFdNfc/bZdA9BiZKfOsFZgIhsLTWFsXmvKDYY9zfw L74axicRSXVZRi0P3+JnRayO5Gsh3euG9ADaTtMlQ7p724se7mpBvIc1rvwsGWS0WGyN d0eZ7X03q9OSG1dMLWElinTZDQ7Ryb+6No7IkzXk4pTNqhN5dABhXCbYR7w0kQcLOuPP VcgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=RzjLRVaz; 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 l9-20020a170903244900b001c77a0c5a61si4180168pls.551.2023.10.06.09.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:07:10 -0700 (PDT) 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=RzjLRVaz; 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 8EB128090795; Fri, 6 Oct 2023 09:05:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbjJFQFU (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbjJFQFG (ORCPT ); Fri, 6 Oct 2023 12:05:06 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BAB5C5; Fri, 6 Oct 2023 09:05:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 7611312000C; Fri, 6 Oct 2023 19:05:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 7611312000C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608301; bh=tN35mD0+nTDTwkVuf3TrI4jko6f8nzNCzdD5oWRnoxE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=RzjLRVazClEjfF/YL9thBc8/7V29oKt+1JaInCqx04ogYcB/j8wrC6E+edYPBP63B UtCKhO3Ow25ZIkClnDk4bArnO1iVbu1Eu/wuxvWDgYz/zv2If2R68yUeHh3jdvKzqe 05lwmDlQs/nXKTqWGJGijAWaIM2uWUY1qkCLjUnBs2Ahd2T9OACJ0tjIWYyn/c354v oh8Y2aeFbNMpNoM2sno05pjGrHE5AMDYSLwdZR9a7oCbfd5fB0oDJ3m7KtvRXvwCXf M5rIxHKTfp+4QtBUnJkdE0ovkPmdxusduT8P94WFUYDUukxXTmIeEJXtFdxZAIvRVp YqmeQe7IB9idg== 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; Fri, 6 Oct 2023 19:05:01 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:05:01 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 06/11] dt-bindings: leds: aw200xx: remove property "awinic,display-rows" Date: Fri, 6 Oct 2023 19:04:32 +0300 Message-ID: <20231006160437.15627-7-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180439 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;salutedevices.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,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/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 09:05:35 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022881856412543 X-GMAIL-MSGID: 1779022881856412543 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 e3ad11fc7a84..5cd167ab0f04 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 - awinic,hwen-gpio: 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 @@ -107,7 +88,6 @@ examples: reg = <0x3a>; #address-cells = <1>; #size-cells = <0>; - awinic,display-rows = <3>; led@0 { reg = <0x0>; From patchwork Fri Oct 6 16:04: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: 149325 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp435436vqo; Fri, 6 Oct 2023 09:07:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwSfhmkgzQPrq4l+zK+KYQCBdvY7yjKl1E0w8EEJyXC5zg8IjAy1qyFmBiXXYCvpJg/1zZ X-Received: by 2002:a17:90a:4f04:b0:274:77df:50d1 with SMTP id p4-20020a17090a4f0400b0027477df50d1mr8578850pjh.21.1696608461225; Fri, 06 Oct 2023 09:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608461; cv=none; d=google.com; s=arc-20160816; b=BICvDtKhFCcaCN1MhLOQ6YEFaWaNNd53gZ12/iUae6tAfbTlv7yWjkshgRFbp32bev nZMTYXFCiI3Szb3yiU2L60IOd7lUKgfareFSqojxXolbv50HU0agzTKpeXaG2VsTvgml HPQmXDjYxD+R8MguTV3lOZJ3bIFSSLcMDeamGGSllrKgZ7r0d5ixHJ5+LQVDrSzqEbda Mp+Arep9V2jEDb9zXYIzKjEUbe2O33E2mqHvA0gP/Fbmvr8GNTi5zSNsfppa9DLDvpH2 7C8p8HVZVrig8j2rwklv67BRUHO1YOx5N2Xten1sK6iT0nK0ez7AraCwyv6JOiVvdt2m uKhQ== 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=kvcZ+xJnyeYql7Ke/CZt6+RSekM0tFKgAECXglBZbv0=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=H6FwD/2AoZRkFrAP2ks55Jbr8FJC5C4kNir1JZ8xmQ3OrFT5sfHLxdZoJaAKSfSmD/ BVZx/UnHb/QsMcl8FldjcLQpYeSAbIeYIROllVfd+oDDeoqqOsVOQ++mwKBftasaY7wY Im0XmZL4R05zMYEXz0K8syOlHoqZs/r4KQZ2wtTh6mQ2crWiRnUwI8VaZ0tL88LKTNtS /Hi/Z3omQZMP5mLO/Qnd2mVR6r9iKmrE/j9WfwBxUSHXTqYrH1C1gQrzskhFDI9vVU6B ggi8V9f7LQ7SsqWDSkKOFsSLNLGN48v5TwJNgaVu8T9rEWFWH61SFXow8kKWeESxkwVZ 4Ceg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=oog9KlS6; 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 v4-20020a17090a088400b00278fe20df4dsi3901594pjc.43.2023.10.06.09.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:07:41 -0700 (PDT) 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=oog9KlS6; 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 1CC798073855; Fri, 6 Oct 2023 09:05:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232977AbjJFQFS (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbjJFQFF (ORCPT ); Fri, 6 Oct 2023 12:05:05 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E2F29E; Fri, 6 Oct 2023 09:05:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 40D97100007; Fri, 6 Oct 2023 19:05:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 40D97100007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608302; bh=kvcZ+xJnyeYql7Ke/CZt6+RSekM0tFKgAECXglBZbv0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=oog9KlS66Os+OH0P78FrbWJIbW7kf6V/ifmUHeWRWi+TBIPBQhrtminHQOYftafoA /XIKaEIi90/gaH8x0aETiy3GmLaQRxo8wqUdWtbv6vFVgFsveVCz/bdDEOT94vEbQt 7vwJ73/OYZ3v/mXNCw+l74ZATjfrzNd9IIXH50mbb5UzJGvOkwM4rxdtbFY1c5ekK/ PrDV1/7dzioeuF5FrP0G5uC2xOcjWRl3ZjsboaHMOhsfhJrWLt9kIUKWFryEmc3ipe ylyXRRoChkxK3/nM0UFm3PTFFqNazN1pn+hMLgV2KEPzKN6IvNBgOm6Wrdt102eFRr Bp28RtARY73Tg== 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; Fri, 6 Oct 2023 19:05:02 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:05:01 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 07/11] leds: aw200xx: add delay after software reset Date: Fri, 6 Oct 2023 19:04:33 +0300 Message-ID: <20231006160437.15627-8-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;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/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 09:05:36 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022913646588345 X-GMAIL-MSGID: 1779022913646588345 From: George Stark According to datasheets of aw200xx devices software reset takes at least 1 ms so add delay after reset before issuing commands to device. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 5b6907eb6299..a1ef0b0a62fc 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 */ + usleep_range(1000, 2000); + regcache_mark_dirty(chip->regmap); return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR); } From patchwork Fri Oct 6 16:04: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: 149321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp434382vqo; Fri, 6 Oct 2023 09:06:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0HPfh/TIu7NLqHB/SYIyGyE0h859UE41VopVMDBzWiBy/cz5utaduoeZEkS7CcwPSSZYB X-Received: by 2002:a05:6a20:3d11:b0:16b:d137:de59 with SMTP id y17-20020a056a203d1100b0016bd137de59mr2100932pzi.28.1696608385812; Fri, 06 Oct 2023 09:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608385; cv=none; d=google.com; s=arc-20160816; b=RCrmMoDuXUTbMrAaG2LeeWxMA0SyQa1uFo232XBspYMWJczmu10Dll/PLTIYfjrpoC u9O7j8Yo7yaJLBt9/agVnCMe916IPDDHfEVnarLAmOpKcd4f6BRp8kjbhH2QdpVevw+r IzXpa0a08kv8waMC3DBJD+iP1DZJOd4MkwmSX2wmGG3eGBJRh6IxjWEQT7mFsOmcN/0W 6+XPfh+XSAqrplksWCGQyZaa78YC8Gt0s7LXCk+VacurPg7/HNgSd84aAYSDA3JRi9X8 2SN5Hh/JcIm7mtAoTWGQbhX9BDDCEmOsDE1H/oTPmKuhi1ot93LWChdQQOlXiS0FYuen 6ZAw== 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=WaWXADN19ORvBXYMLJECaMTRXaSMTpZYcOLrM7Lv0aQ=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=spyfqzKLCAdz7mL8IS6yp7LMcTScRPYKzzAsPeVXSaukCebHhoNqEx706JW7ARpPI8 Wj09W+nc6aXMFpb4FKKKPFCscMF7QG5g1nXJSKbKbtdnZAhTut15KrDQyV2z9C2Ua2Rd 1kC5ohjHkyE1ZFoulC1Xd3nIL4Soe5CJTpijLkxQcyuQWsN+nh5825KM5IUbTdrlF858 YsvDz5aFr2TaAxviM9j3AusDKqFk7Hne6PR4wq4SzyAyeBfm4+88p6z/DO8Si6jlVRQz smPuHhKeSD3kCvDh/hlpz5gpICh6qfJV4z7ZT5b0g3O9aNchpKa2BqBQjSIKLr+1W1lG yMlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=PmyneMcw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h6-20020a056a001a4600b006910a45a234si1788264pfv.202.2023.10.06.09.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=PmyneMcw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6C6FE82069EB; Fri, 6 Oct 2023 09:06:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232989AbjJFQFY (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232938AbjJFQFG (ORCPT ); Fri, 6 Oct 2023 12:05:06 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380FBCA; Fri, 6 Oct 2023 09:05:05 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 5E5E912000E; Fri, 6 Oct 2023 19:05:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 5E5E912000E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608303; bh=WaWXADN19ORvBXYMLJECaMTRXaSMTpZYcOLrM7Lv0aQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=PmyneMcwDIwgP/VkvXd1A3ZkKJcEPIb7S6mWuLFlyeZxcO7Z+9Bo1B5P5BrHc6+Yx OX3RVim6scjvNm6hadttpzduzbkVYXXrQcliciWhUVzwHJ1z0q+loTnbr5ZxNjxIA7 6OBVirF9LwXDkZHK6rHooH7Cy4ix0EVtUMFXoxSFCP1HxFPTM+vrbXOyTus87hfRn2 FDMXVDNXhFRPu5a//yo8Tnil8l2HRnN7YZRtfEX7qy+zbSsfD2OyXCaLfXd4BnPb6H NDF1IZX9J/XU4sK3g92Z0efqA3bQcLC8gMmdF6nHLhCuwcsSFEECsN5B7DFxoghFwI ym/4Akxc3/TLw== 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; Fri, 6 Oct 2023 19:05:02 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:05:02 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 08/11] leds: aw200xx: enable disable_locking flag in regmap config Date: Fri, 6 Oct 2023 19:04:34 +0300 Message-ID: <20231006160437.15627-9-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180439 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 09:06:05 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022834868552719 X-GMAIL-MSGID: 1779022834868552719 From: George Stark In the driver regmap is always used under mutex so regmap's inner lock can be disabled. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index a1ef0b0a62fc..5a1a93ffe36c 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -541,6 +541,7 @@ static const struct regmap_config aw200xx_regmap_config = { .rd_table = &aw200xx_readable_table, .wr_table = &aw200xx_writeable_table, .cache_type = REGCACHE_RBTREE, + .disable_locking = true, }; static int aw200xx_probe(struct i2c_client *client) From patchwork Fri Oct 6 16:04: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: 149327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp435504vqo; Fri, 6 Oct 2023 09:07:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH15gWo+XucowvNUAb9mUiBdCitH9WY06Cxpy9yl07EVfmx5YRCXqZJMEYHvwceDr458CpV X-Received: by 2002:a17:90b:23d8:b0:267:fba3:ed96 with SMTP id md24-20020a17090b23d800b00267fba3ed96mr7773489pjb.3.1696608465794; Fri, 06 Oct 2023 09:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608465; cv=none; d=google.com; s=arc-20160816; b=nsAWR4WtdJ/Uzi32sNWIZPRQQmFoSLQfMLIHdbE+QFv4ncmAkRgAHK/A69kpX4dK+W Q5m2353jPjy7XVNZJnZy3TC4Xl8Gc7AXLwHVvTXOportA00EOxXOgRtif1WOqNCh8Z9C CUxngbMYli2E0oOzTCjDBZhr3le+pWMoj6oJ/wqhamf/9EiZ06DtP8/sNFod2wlpIAL+ /H4lCKw9c4pVvEgtXUNUUWH3F+H5z4mOtCmxu4cBL81EUD68tsOUBIB4nb82aQeF9xkE tjwTxheMv7j7sj/JTxlV4YdGu0cpdGrXt53pZ7rmJN7fdhoQDL9/CstjVQd+S276bOHZ y0mA== 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=1WCKHX3C2Jio7m/90i7wKEs3GNXifdtSCujv0l+EoC0=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=vjCMLA0Frdpl1FiMRXD6lMQS4Q5l6xPlef/08Yb1ZkJ0MkKzYhnyLsu0zm8V28BCqF BOHnzbKTK0OF8OqCt0lpOgmX0JlDCcXdCnlOpoLdn9GgVv9eLr8LI7A6jyQ2WoH2Dc3P TO/uz6okJC1ZPfVrULSkN94FBEvZpm7F9lz94cLHaK4eApREhUdWMARFH+XWLGG+t/7N Kmvb6CQOguAe31qeet1JNUoMDYmQETkDRU/mIMNmw1/NUHOBJ6gdClO3iNYX8GMc+D0v nDumDwcHRib/I9BTaHA7hC2KV7FbV49/TBExoVNgtFDyfiiUU7YhDVNgm0DpDtaRe7jx repA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W+Er2zc8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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. [23.128.96.33]) by mx.google.com with ESMTPS id nl12-20020a17090b384c00b0025bdaaf0d17si4443826pjb.33.2023.10.06.09.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W+Er2zc8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 62C41806717F; Fri, 6 Oct 2023 09:06:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232976AbjJFQFa (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232940AbjJFQFH (ORCPT ); Fri, 6 Oct 2023 12:05:07 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D5D6AD; Fri, 6 Oct 2023 09:05:05 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 9EC2B100008; Fri, 6 Oct 2023 19:05:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 9EC2B100008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608303; bh=1WCKHX3C2Jio7m/90i7wKEs3GNXifdtSCujv0l+EoC0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=W+Er2zc8A3EpDU53xu9dG0ri1JA2w6Y2zZ+2GS4Ux57vOxirZFrGMvTnTx7/oPYJu bwtp/OBRhj+/Vkv0KLxBixccVR8V4kRnNFjyBa8t4vymgGNWhpoltnsw1AX23BpoxS FEVZA/FvAKUQP5S5pDPPn45sVA3rVD8qRRd2ujEgFNWk7m8iBqd3MO+oiD+bdClb4V DOyaAJ26CFzjMOHF+Hqttsri9Y5QfsmwCezdXnpkC74q6yWh4JiSp+IBJOuAtwebo1 FU0GxvlS4mYKrEmSV0JBZmYzk7YY+iLpy8FNInf6AMCjNMqQINsxKPJi6YSvjeV9+N vxCdaCHBOblCA== 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; Fri, 6 Oct 2023 19:05:03 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 6 Oct 2023 19:05:03 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 09/11] leds: aw200xx: improve autodim calculation method Date: Fri, 6 Oct 2023 19:04:35 +0300 Message-ID: <20231006160437.15627-10-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;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/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 09:06:02 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022918699706494 X-GMAIL-MSGID: 1779022918699706494 From: George Stark use DIV_ROUND_UP instead of coarse div Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 5a1a93ffe36c..09b8bc6724c7 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) From patchwork Fri Oct 6 16:04:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 149322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp434839vqo; Fri, 6 Oct 2023 09:06:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUEcIzy9Ei1oCK8HzJGpYzt2EE6t8IDVfoDJXzikrz0+ayAE3D5oLY3godyP3UPVHGZMhn X-Received: by 2002:a05:6a20:7343:b0:14c:3218:c1bd with SMTP id v3-20020a056a20734300b0014c3218c1bdmr9742334pzc.11.1696608417451; Fri, 06 Oct 2023 09:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608417; cv=none; d=google.com; s=arc-20160816; b=rRdDvNbgea8HChbK9/GoNNgktjBerAcLcBArGldHfIkHbpkqZYELChmo9bV63klN3E dl05dhJ8z9F80uQfo0zff431H5R5rOAAGfO0Jliv98lkjpjdv7o738UZFj4tz1WEqBfc TAXfCY7kW9UxpGTYE5EhZjamsVwueux16p80jsNmAbqt/7xyX2M3b3PcY7MdK8NibcP2 hQgfaBrstBpwC4SuLR4epDhdz3HAdQTdMqXvYQSB7vmtVoK/uRw+bcaAHV6Nw4vjU183 ob9yN/vmFMaTiHIAzcHgxyWcsM+B5U4ERrjjbL+xIV16GAhkZiC4ImREwuGGdM/4jJwa cPoA== 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=J48Vb+KSCyfGEqsOwlqZuxevA+23PB5tA/1+mCQizKo=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=R7kpDRFGcpO0cd4LXHn4C/gHQvGvkywq6xmCdgXrv3KVR20rUxNu+jJjSdu6fnoPSU gMAYET7flX9fxnkbb2INBW39ldhbc1ZdM+VcwurgaEQh1eWaBpgFWTPYBWaH+yqxx/wP MzDBs0J51wCc6QsAezVWJxZRY8ODfugxfR+ef3VW1xvqfDRqrIyBFy48fQ2Yz2Xl0xbe Ix+IYvdi+X2FGFsHpNUUTAzsPO/QUxmTyYob0KM0zq0gIthbSxInXrwS4SnC00FGg7mK /if+Rt7GY0A8dGPga4o5TWsE5eCV+w5o/6YsPyCw0lACl6qVTDrH9cZ5d5+MBFUW8eY4 Sh8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=jQQpHyBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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. [23.128.96.35]) by mx.google.com with ESMTPS id w8-20020a63f508000000b005898d64820esi1694416pgh.322.2023.10.06.09.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:06:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=jQQpHyBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 C29D580AA314; Fri, 6 Oct 2023 09:06:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbjJFQFl (ORCPT + 18 others); Fri, 6 Oct 2023 12:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbjJFQFH (ORCPT ); Fri, 6 Oct 2023 12:05:07 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37364B9; Fri, 6 Oct 2023 09:05:06 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 5CC06120005; Fri, 6 Oct 2023 19:05:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 5CC06120005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608304; bh=J48Vb+KSCyfGEqsOwlqZuxevA+23PB5tA/1+mCQizKo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=jQQpHyBn0ZHrr5PbHHOhBOCB4XUQkykz6640jNpR6m8juysu+8jNf2775PJzVwXwE dxiUPomjrreLwDEg3NKw/hmGpATOqPfKUQlUnCxY0lvle/JXSsehljfs4gWaES0gEe L3FdkSzXmpKGXA2YtO5DJ0/dus8PzJThZncfmqAFxAITEbqsGXMe5xFEiowaRa0upj +2HQ9Jchk2MdQ9YkI7weqqHqISoq2Wk6eEkpgKiSyGzTetYqFDy9o0MwM+OjhKk7IT qHkgIw1I/ze2s48YoNSQh/L/MDuV7/3N65bxCBwdei4AEPNzcbWFz/EPiFbiqus1Uk musVfegIWse0w== 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; Fri, 6 Oct 2023 19:05:04 +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.30; Fri, 6 Oct 2023 19:05:03 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 10/11] leds: aw200xx: add support for aw20108 device Date: Fri, 6 Oct 2023 19:04:36 +0300 Message-ID: <20231006160437.15627-11-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180439 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/06 13:25:00 #22070343 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 09:06:00 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022868216679259 X-GMAIL-MSGID: 1779022868216679259 From: George Stark Add support for Awinic aw20108 device from the same LED drivers famliy. New device supports 108 leds using matrix of 12x9 outputs. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/Kconfig | 8 ++++---- drivers/leds/leds-aw200xx.c | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 6046dfeca16f..40b3f4191cff 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -95,13 +95,13 @@ 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, + This option enables support for the AW20036/AW20054/AW20072/AW20108 + LED driver. It is a 3x12/6x9/6x12/9x12 matrix LED driver programmed via + an I2C interface, up to 36/54/72/108 LEDs or 12/18/24/36 RGBs, 3 pattern controllers for auto breathing or group dimming control. To compile this driver as a module, choose M here: the module diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 09b8bc6724c7..717c6e2e7bb1 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. * @@ -632,10 +632,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); @@ -644,6 +651,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 Fri Oct 6 16:04:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 149324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp435102vqo; Fri, 6 Oct 2023 09:07:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEve/QRClKcYnj+ni4zVtwvk8KVSSYIC2VZV6xcf4ByxYtBEGMX9FZAZX0XBkiCFgtxGBRs X-Received: by 2002:a05:6e02:184f:b0:349:3020:d103 with SMTP id b15-20020a056e02184f00b003493020d103mr10293915ilv.25.1696608437021; Fri, 06 Oct 2023 09:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696608436; cv=none; d=google.com; s=arc-20160816; b=HRGG6tyjr7ZV2Fn5fYWPaDg+jllIpMWoAulWwyicIkrugO+rRx7kPERl2OWmCmEfFN MsW7UAGwFJtsvQVx3NEoOtoAQp9LaHixJuZY9mIy0VdriRuhNPi0nv913zS+hx1LPjTg JpXDl2+9YcwVUGQ9zJNrEoz08e1NKUR1ZhKpVGlSR2N4aNmu0VSE1+1sdTly/lyD8kqp AAA8qDwVza6362e8E7ElCIZAMlATQd+K1DxiRtjwAN+BVzudlcqGkL6YhgqXqwWH9jhS 4+eEDtyvvDjtRC27HOoq0OGVePeAqrvzMeCjEYZESU/zpve4Tj+myK0gaNhO4Lk3WgUQ F2NQ== 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=SHiNeiY8XhPsXkjZdEmqf6B0M+1wIjbeERMyWHXZeG8=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=ewK5P4Nv+I2mDudjEVSyvR7e7xn7+jcZrkz0L2EJGY9nqEjHBo8PTU45htik/MbiiJ Ge3PFsv1QPXElwtsceNBxrPfoTJNnGo8k+/LPB1Nda2H9NDFZmB+UehbSlvgMl7PxJFA 81wBfbVMlEfRX8UGvqc4cTOl7U1CANVSyBs7GIMRBM8Drw/oYuFfNxKo20ajgSiVF8Pm RJq54OVTwMWUGhJEdQbSKeIIsQRbhQ5nN1i97cpRuJWARiMuo1Bk8wpU/ME7C3GkuCcM 9GGTh2IoWTGdvR4z+fJ/EHGFdvJWVxYuwu6SB6/1BS4POF8ycsflYzlhoXy6sUziIk1b GtKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=gibKC2Ll; 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 o15-20020a656a4f000000b005702257f32csi4400555pgu.840.2023.10.06.09.07.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 09:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=gibKC2Ll; 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 BAD6D80A8B4C; Fri, 6 Oct 2023 09:06:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232976AbjJFQGW (ORCPT + 18 others); Fri, 6 Oct 2023 12:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbjJFQFp (ORCPT ); Fri, 6 Oct 2023 12:05:45 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D8CCA; Fri, 6 Oct 2023 09:05:09 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 36E86100009; Fri, 6 Oct 2023 19:05:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 36E86100009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696608305; bh=SHiNeiY8XhPsXkjZdEmqf6B0M+1wIjbeERMyWHXZeG8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=gibKC2LlnbnKqGXixjllbMQWQ3Kcdd2zmLjLXWjb418wC7dtuupQhIs6A695ZwUCA 0j26WLCOb+eH4vDONHjakvGRpaJt0jnihqy0cZrPuhXo2TB0qMyvr4q3BG6OI3s7fm Io88duEDf+oNIFES/iB2bLDMkEkhTOQrSTgDN/LCc1PufI/igrrWY12Xc1+GigxoVK 5TeCWnSxgX+HGsvXjS5ISJ+yT+r34Vq25VpU6zX75/itOtQx5wNdbdose96Y6dWu4W cnCAvVwxxIXVxW84qZwLRx+eQj2EXH3caOVJLmopQ2V60nY+akI2rIAIxG4/uAPWkl Fx6xTNXpXJ6ow== 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; Fri, 6 Oct 2023 19:05:04 +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.30; Fri, 6 Oct 2023 19:05:04 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v1 11/11] dt-bindings: leds: Add binding for AW20108 led driver Date: Fri, 6 Oct 2023 19:04:37 +0300 Message-ID: <20231006160437.15627-12-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231006160437.15627-1-ddrokosov@salutedevices.com> References: <20231006160437.15627-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: 180438 [Oct 06 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;www.awinic.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2, 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/10/06 12:39:00 X-KSMG-LinksScanning: Clean, bases: 2023/10/06 14:01:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/06 13:25:00 #22070343 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 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]); Fri, 06 Oct 2023 09:06:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779022888411753358 X-GMAIL-MSGID: 1779022888411753358 From: George Stark Add aw20108 compatible in devicetree binding for aw200xx led driver. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- .../devicetree/bindings/leds/awinic,aw200xx.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index 5cd167ab0f04..c3abb0f7ded3 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -10,15 +10,16 @@ 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, + This controller is present on AW20036/AW20054/AW20072/AW20108. + It is a 3x12/6x9/6x12/9x12 matrix LED programmed via + an I2C interface, up to 36/54/72/108 LEDs or 12/18/24/36 RGBs, 3 pattern controllers for auto breathing or group dimming control. 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 +27,7 @@ properties: - awinic,aw20036 - awinic,aw20054 - awinic,aw20072 + - awinic,aw20108 reg: maxItems: 1