From patchwork Wed Oct 18 18:29: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: 155073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4988722vqb; Wed, 18 Oct 2023 11:30:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDi5L07qnV8QGzt7pbKlQazm+y+sCrOfd4hqfZ+geqs6ri2iffgfmK+sC5noaMZO6MmIl4 X-Received: by 2002:a05:6a00:2291:b0:6bd:66ce:21d4 with SMTP id f17-20020a056a00229100b006bd66ce21d4mr6454430pfe.23.1697653824278; Wed, 18 Oct 2023 11:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653824; cv=none; d=google.com; s=arc-20160816; b=kr0jhUAY3jU9CvziUHUdXX0kM9p0PL8X5VnFxP7+Eiu+4vxuv/W+mmGsCHE1yLEf7d 6zO2MdVfCH6XwkqdigPWg5tkDlmdqABBOAp4m7QErSn9oBNCXaZ2YGPx95EjBQdoEhAu 0zctCxrWeBYNd8WEmWo2sQOKlCfDaM3l01SEyFVCyLV1xq32uFKj3PcJu91yNyzOwWFa aBs2OHyvChQ7FwnwzFhthZVvnsOX79oEy+C4l/t2PyYhSzeyy40N6u+Gmo5QhvBLnTWq 68WbuTbZ2Wwl4fChLQIGPUz/4X0Tu9i+pLv/2t6AXG7gaenIKDtyzk1arJV89wyUSM44 X/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=EDXtkoNRVpjH5LBhvvyL/XjN07jDmu1c5hgfKsl1iMI=; fh=kDlMvdXjJ67as7fXJwQpX4exlPqtmzTL4elpL9Zbjrk=; b=JMXJvX+3WVYQxGHqTfH3xat2snme2lBI4ePKcKm/qzmZiWGL/Gd1veEQaCIaeXpB8q 0lvFA8aERe0+w0eRo/vUSS2OE/3x2FxaxF07pDKU2lnRBez9P3r2UdlphFUzHzGnJsEh 4nuCAW13cUfu3XefsWAn0DHbmyerLz4CZtMq3FBT3ee3oWo89RtsjYax/wxmBP1YgL1s Heq289Mz98sriG/OV41tXsaEBv4olqPygQovD3pjXOBBz358pahLhbcSQgurX6eOwCEl gm6kIJa634hattuzMjz9PdL2ilDAgwlWKHzjzspYkpfmO7MUVzgubnnVCY5ckf2HIM3x G3VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=KCJkyjuG; 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 k22-20020a634b56000000b005ae22729b09si2530053pgl.683.2023.10.18.11.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:30:24 -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=KCJkyjuG; 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 755DF8085992; Wed, 18 Oct 2023 11:30:13 -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 S1344767AbjJRS36 (ORCPT + 24 others); Wed, 18 Oct 2023 14:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbjJRS35 (ORCPT ); Wed, 18 Oct 2023 14:29:57 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423D0F7; Wed, 18 Oct 2023 11:29:55 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 48AEE120008; Wed, 18 Oct 2023 21:29:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 48AEE120008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653793; bh=EDXtkoNRVpjH5LBhvvyL/XjN07jDmu1c5hgfKsl1iMI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=KCJkyjuGZVO1euiIjah6GGMutv1ChGEf0tDU8xvilcI30Aiwmra+8w4ZSnkSP3sjy KDvxizVvvGu7s4jQcEjmRz+InoaI03qW0vMvH/kZT6c0erhox/ULlURpWACGFAAVCg tSEE8w0Bz4Wb5BXiBk+VpOqOiJHaW9MlCVYStn9YRoSiY6cr5fcJ9Uu9Hpe3Sc5BeL W4Q4n8qNaYTnpWkDY8tIC0YrZqveBRQsqoM8Hc4GFdtW8F0PKWbVseVkVA3I3hwBdI vbsnvWNF7yYeMzitB5r9TywV9vtldNHa6mHhcWK4zUgUwxzH1UNXFQdzTlUJ8Yd9t+ zKZR4FZKYc1eQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:29:53 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:52 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Martin Kurbanov , Dmitry Rokosov Subject: [PATCH v2 01/11] leds: aw200xx: fix write to DIM parameter Date: Wed, 18 Oct 2023 21:29:33 +0300 Message-ID: <20231018182943.18700-2-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:30:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119056678752568 X-GMAIL-MSGID: 1780119056678752568 From: Martin Kurbanov If write only DIM value to the page 4, LED brightness will not be updated, as both DIM and FADE need to be written to the page 4. Therefore, write DIM to the page 1. Fixes: 36a87f371b7a ("leds: Add AW20xx driver") Signed-off-by: Martin Kurbanov Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index ef4eda6a09ee..842a22087b16 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -74,6 +74,10 @@ #define AW200XX_LED2REG(x, columns) \ ((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns)))) +/* DIM current configuration register on page 1 */ +#define AW200XX_REG_DIM_PAGE1(x, columns) \ + AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns)) + /* * DIM current configuration register (page 4). * The even address for current DIM configuration. @@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr, if (dim >= 0) { ret = regmap_write(chip->regmap, - AW200XX_REG_DIM(led->num, columns), dim); + AW200XX_REG_DIM_PAGE1(led->num, columns), + dim); if (ret) goto out_unlock; } From patchwork Wed Oct 18 18:29: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: 155075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989106vqb; Wed, 18 Oct 2023 11:30:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/hZ1jZ6HVQihI8DJ+Otn46Yco3IVhFBpLdiOqE/oRSqPAAygYK10wQCAAJRNfIzXQfsUw X-Received: by 2002:a17:90a:c405:b0:27d:5cca:9b69 with SMTP id i5-20020a17090ac40500b0027d5cca9b69mr5826984pjt.45.1697653855418; Wed, 18 Oct 2023 11:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653855; cv=none; d=google.com; s=arc-20160816; b=nTJCbMQffMFAWiWPhDqdiZKP0nGMEFRvFH/98cbTDPZfkYn5HeRLIZqm2WWPjtQDWn TtgMGVtR7+FMgvAt4QQAzD1iYsoMXpfyOTZhvSwWqYPXdKWO8Pv55Bf2VByd/byMPxwW PXq/yqV43pPHfqjb77BldeU6et/uA5ERCvJzeEmNOkwSTlVfvXhr/1+G0CcKR/puCc1v g66lih05JZnr8V1oG/E9Di2n4EDQuUTi4T0dbFXpDMlD6znTPdz+PaqWg7WZBy2K0NTQ UeX3KtHzfgaHRSHfERo1mmYJiL04/JPKLLz52I6n01mtYkeaBypA73bXt6xH6ERbX2wp u49g== 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=gUJedlfidw0iNo5WabTRQ7jltNs0msaVOJBzN45ynHc=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=HBZD/7qXFleE+3J6jankRWeabIyKhx/NMgVxuJjh1O9Mdt5Netnk0ieP+XuNXJOLjm ShwmT6BBhTMfD+T3gKsaT2MICBhHz6t6tQUn77kgC41/6XNqb791ci6C0DdFFIoH5PCV LxMcxA+haqJ8ygBoEbHl3VgRghX/0lCmllsrYlf926/i7GYxRROadpeuKit+qKoe9IDw Sya0rnnLfIWU6xlblERdrCeSh2jBdjD+8kFu6RYh0+4iVSF7B9FywuGP/2KzoeP/QO6a DvetJlOBcg91tmiYFaCDlLdtghzFWoQ4tELvRoDJuGUMArDGBM1kQEsL8tzn8mRyf7wu EYVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=BG9E8J1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h24-20020a17090aa89800b0027ced9acac0si443867pjq.2.2023.10.18.11.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=BG9E8J1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3F8BA80557EE; Wed, 18 Oct 2023 11:30:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344837AbjJRSaC (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbjJRS35 (ORCPT ); Wed, 18 Oct 2023 14:29:57 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E39E119; Wed, 18 Oct 2023 11:29:55 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 18DCE10000F; Wed, 18 Oct 2023 21:29:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 18DCE10000F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653794; bh=gUJedlfidw0iNo5WabTRQ7jltNs0msaVOJBzN45ynHc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=BG9E8J1LhLzq0xCVt5jpP98UVy4jHdMUv7ODTtwkWvYKgzd0p2Rbf7UBThUUsGSax TIZAHqRNPcOQtgktbjlgRgncKhgNRVytslU/nFvjePQvKNQvnNUSKKue6qwAz4puVY uZkGLdGja5IrG2gm9JULXgktr9X4gaH9a1kpdj5y3bNVMQ3cbVmCYTnHF0bwyVmfPa 775hCNExo76mVSJhh8EDQU4YupYTsKoFVbn82+OsKSKiLOGYq1HBGrbhbQzEebI2jb nlNf8EV2kfBXT+GLkvUyknGjGe79APMMP/ly5PWDnUTMULfNw+cpmhZnhTOLzKmhJi Eee2vmWXz+peg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:29:53 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:53 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v2 02/11] leds: aw200xx: support HWEN hardware control Date: Wed, 18 Oct 2023 21:29:34 +0300 Message-ID: <20231018182943.18700-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:30:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119089098913446 X-GMAIL-MSGID: 1780119089098913446 HWEN is hardware control, which is used for enable/disable aw200xx chip. It's high active, internally pulled down to GND. After HWEN pin set high the chip begins to load the OTP information, which takes 200us to complete. About 200us wait time is needed for internal oscillator startup and display SRAM initialization. After display SRAM initialization, the registers in page 1 to page 5 can be configured via i2c interface. Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 842a22087b16..911c3154585f 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,7 @@ struct aw200xx { struct mutex mutex; u32 num_leds; u32 display_rows; + struct gpio_desc *hwen; struct aw200xx_led leds[] __counted_by(num_leds); }; @@ -358,6 +360,25 @@ static int aw200xx_chip_check(const struct aw200xx *const chip) return 0; } +static void aw200xx_enable(const struct aw200xx *const chip) +{ + gpiod_set_value_cansleep(chip->hwen, 1); + + /* + * After HWEN pin set high the chip begins to load the OTP information, + * which takes 200us to complete. About 200us wait time is needed for + * internal oscillator startup and display SRAM initialization. After + * display SRAM initialization, the registers in page1 to page5 can be + * configured via i2c interface. + */ + fsleep(400); +} + +static void aw200xx_disable(const struct aw200xx *const chip) +{ + return gpiod_set_value_cansleep(chip->hwen, 0); +} + static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) { struct fwnode_handle *child; @@ -517,6 +538,10 @@ static int aw200xx_probe(struct i2c_client *client) if (IS_ERR(chip->regmap)) return PTR_ERR(chip->regmap); + chip->hwen = devm_gpiod_get_optional(&client->dev, "hwen", GPIOD_OUT_HIGH); + + aw200xx_enable(chip); + ret = aw200xx_chip_check(chip); if (ret) return ret; @@ -537,6 +562,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 +574,7 @@ static void aw200xx_remove(struct i2c_client *client) struct aw200xx *chip = i2c_get_clientdata(client); aw200xx_chip_reset(chip); + aw200xx_disable(chip); mutex_destroy(&chip->mutex); } From patchwork Wed Oct 18 18:29: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: 155083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989770vqb; Wed, 18 Oct 2023 11:31:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHGJbDJPaj7Oi7qSXU08Vx16apHtixagodoYB783DVMgrm3azBDy4w/H3gq41MrdXqbq0z X-Received: by 2002:a17:902:e841:b0:1bd:d510:78fb with SMTP id t1-20020a170902e84100b001bdd51078fbmr9270312plg.3.1697653910537; Wed, 18 Oct 2023 11:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653910; cv=none; d=google.com; s=arc-20160816; b=tkTXA5rf1Hg6irmkzKrvBSwaTJkpNvaZhqTs925wUNUeD93GwMlGF0IFkl0gP1aHTG LZktcxllDT2uCuyA0E1MelM4i3aGORE5PYcr+z4yX8jyOUusDiwZWLQNa+YfugeteKED +VAdJqeVR7kaRNHBn/7IK8jOC+mhBmLzxyBfalUN9vMnfZ8UFz7J40pe+GGQdql4FePK XmVdA4QMVHs/QPd4VEtCg9Gc30ZGZRb47+e2+ZBeKcHEx2U+cs9PapMBSknUqBq5+XJO 46H7CTKIa3x1gpmEfMnG/z6GfzcM+TsAqcGANjHAO/8vuyoGQX+AK3qBZe1YwiZmqpqC 4DBA== 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=Wv20QjlvBmCdA45mmQ3nJQkxxF8QBMnWZ6pL/sYhpt8=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=vI5qoUCAS1hfvhL5Rg6xSoCjqIE+c/6M1shMpXR+3ajXgELtHMlQB5rfDNWyNeveSW f3gVmmIJjtE+tSfKJ7OjWu85HRg05+o+Dq9TytFpYOzjRskJqluWjoXePFAYN02DE52w aHZwIrSikxFi55NyBzaRmtAPQUnyxZ5gykCQlID7zSM8kBREP0naWL194fcw+KIThVJV Q51qC4X6hzGGk5D+PvmxrNxTsOWzmr4Xwhy7L+gaK42HpSeRps6Qln6GdCmwGNzl3KGq GdHvsD7z9Cj+ex8gaHEAE1nb3EIdFC3PdGW3xIAx5Doj0cphRNHxKu8rzEwj+yzKIbHk oemg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=u6GaW7II; 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 e4-20020a170902d38400b001b8a56b9895si395799pld.616.2023.10.18.11.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:50 -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=u6GaW7II; 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 C0A718132A68; Wed, 18 Oct 2023 11:31:41 -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 S1344853AbjJRSaH (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344849AbjJRSaD (ORCPT ); Wed, 18 Oct 2023 14:30:03 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7B3114; Wed, 18 Oct 2023 11:30:01 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id E392112000D; Wed, 18 Oct 2023 21:29:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru E392112000D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653799; bh=Wv20QjlvBmCdA45mmQ3nJQkxxF8QBMnWZ6pL/sYhpt8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=u6GaW7II7GVAZanCuEhShtwDrE64Ls1QsEe29dgltff7tUsFPjaAEdv3Lbbrt9t1f c3rjbB8lQW/deTARbewY0oPoKQxLc/ThS9C0vX1WDKdP/ovKwNuKBMqmHSd9UWGr09 phyBr9PeASPKUhFAiOC4sQ4GB0c5uF0/aj9Pg0eBpx+XlvvytMTUplJLdqYoi8X5cx GTMB763N5TfgW8OSCQWyt3M3WJkFGAa/T1aD3/bodWpjHkCBVbSmNalSUNbsFqqWgc i3rU4t3+bO405Ce1kbAeUGDrKy9hWZFAI24OJLhi7i/+iQplmsAA3OTBs+5FKhrPPS v+h8yR7FobDDQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:29:59 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:54 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v2 03/11] dt-bindings: leds: aw200xx: introduce optional hwen-gpios property Date: Wed, 18 Oct 2023 21:29:35 +0300 Message-ID: <20231018182943.18700-4-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119146671115675 X-GMAIL-MSGID: 1780119146671115675 Property 'hwen-gpios' 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index feb5febaf361..255eb0563737 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 + hwen-gpios: + maxItems: 1 + patternProperties: "^led@[0-9a-f]$": type: object @@ -90,6 +93,7 @@ additionalProperties: false examples: - | + #include #include i2c { @@ -102,6 +106,7 @@ examples: #address-cells = <1>; #size-cells = <0>; awinic,display-rows = <3>; + hwen-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; led@0 { reg = <0x0>; From patchwork Wed Oct 18 18:29: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: 155078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989502vqb; Wed, 18 Oct 2023 11:31:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgEjJ1z6bC544vlFg/LbKiKnl+10SZ/rtcxzpFVh7ofLf2J4l1+t9GqOJeUPXjGDxJAuw2 X-Received: by 2002:a05:6a20:a113:b0:14d:f41c:435a with SMTP id q19-20020a056a20a11300b0014df41c435amr6394469pzk.39.1697653886853; Wed, 18 Oct 2023 11:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653886; cv=none; d=google.com; s=arc-20160816; b=WZFieCJvIlOOoRfDQ4hGbLJ347NoRQ8eBbRB06d1JaMBwO829C/4AtJJsYj0Joc5BD ogtlfl9r417z7D52vAg2F/GCSfkvqIXhg32doeJ6g9Hb5JIEg+VIW1NTj1S9Qs0Ysx3e DQKsnQE1X8HhaIOYvhGYGL5goG05JFin8T6mWlehpL41+m2VXyN08zkQcDDUFIQ31mNl bLpq3Hyf+kkA15guHcniEicL9KCWIwU+4amFjGzggJvgvDZ+vCE0qldZ0RHi2fhCYG77 ZqSka5uaYYSeKaqGxu+DOklcb0N1hKsufdNw8aUW7ZeuS8v9P4f2roJLIUGwUqoT0m4e w5VQ== 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=OfG8v4a23hHDZuUDnotHJWVQQ6vM9oZBqvofP9QPn0s=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=wtOURUEIg3KN3yDDwjooUWoKLF2Soqg8T2pv1A/93ILp/jLSI8N3mscPXRQ1dNu4OX gMhfSEtU4nCfgHF4rJCADxUBYvOedt1eqgyYvlAEw4GGqq+7Jq9BHWqwq+g1h8ZPlCJb g5tm6VkuIFWL8COTpJG8/8VoFtsrmjDnvpwRA7IynfO34JhHoD/cPZj0rzzMJmJ2RQK1 SZ4Fw/yPTQA3fx+hMNP+FKU75GZNT+KRHV/xPYjoLV/L++1G8FnxXk2CuTLMw/e4XdLX f8MKVmCpCposxPhSLIU14YM9UKN1WopZ1Rlr67k7noq/UGFBrBeczoW/4HtrEArwpsVJ 1QQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=FhI1AqwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x23-20020a17090a789700b00276c4e7b5e2si389126pjk.146.2023.10.18.11.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=FhI1AqwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6C35980B5A05; Wed, 18 Oct 2023 11:31:23 -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 S1344907AbjJRSaJ (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbjJRSaE (ORCPT ); Wed, 18 Oct 2023 14:30:04 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8220111C; Wed, 18 Oct 2023 11:30:01 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 16D1212000E; Wed, 18 Oct 2023 21:30:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 16D1212000E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653800; bh=OfG8v4a23hHDZuUDnotHJWVQQ6vM9oZBqvofP9QPn0s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=FhI1AqwLK/GPYBS3bCF7MlEnXxxf0zPrlJOsbr6dQ8BYPNXerpRtdF+D7heYFaZ4/ jl02B9cbZMuRqW5EegSB1Lg0r4zMaQWkIj/BgNdk0TObkBV3OOpFXTk7xcS7ERXd9+ MMSPY/pIXGXsw7LJjyJKaAHmAe7g1KoJ2YbGKwhpQkuw1IK4SCgtPPLE5yVDqcFRTB NGq1RFm7C9HxSGts8A2HctsNbMb4x+GhkS0p8wqvOgPkX+RevIXL7SE2eRvrR3eD2n pmbVgNKeNOMlD2KsL3/PKNLm4Ua4lb7ZQoWALqIM0yVbsnKh0e43vOfCzeg3pXqNX/ 6DOx6XqLCqfvQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:29:59 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:55 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 04/11] leds: aw200xx: calculate dts property display_rows in driver Date: Wed, 18 Oct 2023 21:29:36 +0300 Message-ID: <20231018182943.18700-5-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119121723163046 X-GMAIL-MSGID: 1780119121723163046 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 | 39 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index 911c3154585f..a2a31b8e623e 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -379,6 +379,31 @@ static void aw200xx_disable(const struct aw200xx *const chip) return gpiod_set_value_cansleep(chip->hwen, 0); } +static int aw200xx_probe_get_display_rows(struct device *dev, struct aw200xx *chip) +{ + struct fwnode_handle *child; + u32 max_source = 0; + + device_for_each_child_node(dev, child) { + u32 source; + int ret; + + ret = fwnode_property_read_u32(child, "reg", &source); + if (ret || source >= chip->cdef->channels) + continue; + + max_source = max(max_source, source); + } + + 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; @@ -386,18 +411,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 Wed Oct 18 18:29: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: 155074 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4988763vqb; Wed, 18 Oct 2023 11:30:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMX6QbCerwphtGClA0R/ac/DSE6QWaWXvHt0Y0ugF2JL52d10fT+G/HtvX2J+uyKJo9PRs X-Received: by 2002:a05:6a00:2d1c:b0:68a:4261:ab7f with SMTP id fa28-20020a056a002d1c00b0068a4261ab7fmr5961852pfb.31.1697653827585; Wed, 18 Oct 2023 11:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653827; cv=none; d=google.com; s=arc-20160816; b=nX42Sah9L2Ph1zy41puJA5dC0h3vqHAS2vy4N7YXSwssjiAVM84TRDDX36N9kS0Ouy mA6Kxl5mroEiYWRVOpHccE9hVMUXj1vbgns+G64uO2OmOpcuB/UKBQhjPew4qb/OR95i a1hYvwi+Wg+b29GTxqpdvBMKD61/70XVQ3p94ODdNSrNdZAEUvLzZWzDwZBP6KFXG0Qr nK/EcpDrTf9HcpxDgBTZe5Zl4D+n0zoxs8IbrTIItfpNXVdDNNViIcTG9sEZoi2L6nyZ 87WWAoDFoj/Ibj1gQI8ZwlmRWyDArmnrhGR+MqGXwIuBYIYy5i5XP0x7hYEQSl66t60R bNng== 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=x42CN6EoNoiGexl3epWnckksVwxtGVTszXAefmrZp6s=; fh=q8tJCc+t4xrfHrrWgMpr2d/oH9tyqwMogOKhYs8J8ME=; b=y85HOEjJQuSAqDl3Y2Lk2DbaWSWHhDJ+wIe9CDOHRIQBkKUqkJdSFkzWk0SnYEmGwb ZBQq+wO+0UwaCPTt7HDovAkeYe4mXUkahRw4ttJEDSjVFF9B3g2O7cpUz0lsu5VN1QBO bwMHiyCUux4XiOykz5Rgca9c6f2JHOSgzvI7yuuVsdeQlcLKImE/udDP4Fv+9fyDQJ0U UMchZID/9BWm1Gxw/H2aeJRGjAO0E8c9i58EvtqnBCdxO1VV5JyxnOGKJelsc3K43qaE wRsA1CNYBt7r9G3LKV3TQWFsRx9dXvAUOi7SsB6X4nviw5hUgFX1UMlFMIOD4upLxghW /KBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=lTBO+sQH; 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 i29-20020a056a00005d00b006ba8478b96fsi4303585pfk.30.2023.10.18.11.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:30: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=lTBO+sQH; 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 A607081BAF3F; Wed, 18 Oct 2023 11:30:26 -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 S232779AbjJRSaO (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344824AbjJRSaG (ORCPT ); Wed, 18 Oct 2023 14:30:06 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E32C109; Wed, 18 Oct 2023 11:30:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id E103712000F; Wed, 18 Oct 2023 21:30:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru E103712000F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653802; bh=x42CN6EoNoiGexl3epWnckksVwxtGVTszXAefmrZp6s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=lTBO+sQHC28xKPWlMO/rAnocbp9WQkoxVN5L3RjphB9V8zKAxXIEQSWeJgXQg7rTu csLWOz6NI8AzLbTrSxrt8gBYQJTCEMOwHRqohTt80LTimDee2F5JxCQf6VQP8IaM0c FYM+Bu8X4W7u0L3cSrqNNZcLJPRcDAWn3rcJdyLwBTKDv590hkX08NgAHSXFuf7Rai QBdJ7SvW/XcezHRowH0MuyWdg13nLx1dWFW1tAIHwKiCK+kMhfT6ygYJdR7sBo0xkB iVKi8tFUHFgIzkNtF9RIyJXX16wJ9EU9qWQgT5DYfsH+xrCHLvpT8VaNXziLYzc2uP 4GgFf8nKzTQZQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30: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.37; Wed, 18 Oct 2023 21:29:56 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov , Rob Herring Subject: [PATCH v2 05/11] dt-bindings: leds: aw200xx: remove property "awinic,display-rows" Date: Wed, 18 Oct 2023 21:29:37 +0300 Message-ID: <20231018182943.18700-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 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]); Wed, 18 Oct 2023 11:30:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119059821711514 X-GMAIL-MSGID: 1780119059821711514 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 255eb0563737..ee849ef3236a 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 - hwen-gpios: maxItems: 1 @@ -63,31 +58,17 @@ patternProperties: since the chip has a single global setting. The maximum output current of each LED is calculated by the following formula: - IMAXled = 160000 * (592 / 600.5) * (1 / display-rows) + IMAXled = 160000 * (592 / 600.5) * (1 / max-current-switch-number) And the minimum output current formula: - IMINled = 3300 * (592 / 600.5) * (1 / display-rows) + IMINled = 3300 * (592 / 600.5) * (1 / max-current-switch-number) + where max-current-switch-number is determinated by led configuration + and depends on how leds are physically connected to the led driver. required: - compatible - reg - "#address-cells" - "#size-cells" - - awinic,display-rows - -allOf: - - if: - properties: - compatible: - contains: - const: awinic,aw20036 - then: - properties: - awinic,display-rows: - enum: [1, 2, 3] - else: - properties: - awinic,display-rows: - enum: [1, 2, 3, 4, 5, 6, 7] additionalProperties: false @@ -105,7 +86,6 @@ examples: reg = <0x3a>; #address-cells = <1>; #size-cells = <0>; - awinic,display-rows = <3>; hwen-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; led@0 { From patchwork Wed Oct 18 18:29:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989340vqb; Wed, 18 Oct 2023 11:31:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEl/IgiEvmGDxwxRvC+jwxv5peR1LRtePxS+Zi097mUshQFYdNZULmHMFwE/kokmlbkbi8B X-Received: by 2002:a17:903:11c8:b0:1c3:3363:8aea with SMTP id q8-20020a17090311c800b001c333638aeamr102411plh.61.1697653872900; Wed, 18 Oct 2023 11:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653872; cv=none; d=google.com; s=arc-20160816; b=OEpHIyzh91srXUulJycAOJMZd3c3tFuSWQOd/AciqO7+N9v5/cGUr0Qh8X6AUtLU0Q I5TSy6HUcpvPg2IqTtf4ZhVyKoosvoBO2LaeqSLC2HPZ3K7EFPjfl4+mHxONPBRinlV+ MFRLwY8wiJv4Xz12Rvf7iX2xBqVmoZxZ7Gkjgp/SgmQf8HFW5L8S6fGKySUfOdTbW3Z8 TFgpJNHsBlzHrBwZHmFSraoJhXI4WbUwe/n225EbzRK4ejzx7hQ2Io0lt/DoGIGVHpQh mDK1kI0hvsIATnCEx7yOFsGiHs+OgAsotstkQGGo0lfZxqf6obx2oC4AewbUNIgV7P9Q ZwvQ== 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=WZpnrPUuzlgVUF8g8+DGIMsk+vszli4Ktw5WAkDwyeA=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=0iNlOx8sukBi3KXbEj05yMRcHbjxRa1Z9JYkT1aNhJ8eh4CCUDW72QG2/eh+eb8U8u 9D+IpqMFfQK6kK5sZPPOnI5yxXsinEXg2S/2kFafEUd+6thhh2RaYmp5xpKLGArYat2O /1yiysBK1Oc/him9d/1yOXwOYyUxyRItvluoTwT/AlW4xQYFPIhodIZWpKscTk5Sm5VR tIW/PhJArFA6c6X1N2dFZdm8Dwa/JPGTWl8l/3QrvbjKT8d6yu74sr9AEi1gz1Zpp9BY skgrmCh0RzGJnLJwEfflSl7waBHUEYrLwukVJWvpIIYqmYV4Qh4x0Q9W/uFqyVbHv7hd FcHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=V7wcwg5t; 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 i4-20020a170902eb4400b001c9ad6278ddsi432282pli.96.2023.10.18.11.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:12 -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=V7wcwg5t; 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 6E73F8104989; Wed, 18 Oct 2023 11:31:03 -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 S1344915AbjJRSaT (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344858AbjJRSaH (ORCPT ); Wed, 18 Oct 2023 14:30:07 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C5FF119; Wed, 18 Oct 2023 11:30:04 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 12D41120010; Wed, 18 Oct 2023 21:30:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 12D41120010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653803; bh=WZpnrPUuzlgVUF8g8+DGIMsk+vszli4Ktw5WAkDwyeA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=V7wcwg5tJvPl0duml3R6sJBcKN46ZXVPjbeEL0CjqgTUgkiWylIGJ+zBLONyrU58e 8RV+8m9kvv4+eZyZJFtnYD+GmFOAxh9paCYqYwowqiHiEL+mRzWF1SZt3pBNc579+D LsM4RdwfSE3zaZbNGhZ3GIENHTYh0V2+yO9T7O2KffEFJnzLFBzlZZDmMZBdNIp+8l x98x8P8AnQ+HLFz3ywQijmRrDKAsdXlDHxDy0l2PxI3XfJ2pff5I5RGcnAG6MDk7VO 48As6J9muiQ0e2EeD5C41tbkGrBZBekvjRLt9jk+LPx2Ys0syttvfGUJHNJs7sg1sf JZVdTYtDdittQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:02 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 06/11] leds: aw200xx: add delay after software reset Date: Wed, 18 Oct 2023 21:29:38 +0300 Message-ID: <20231018182943.18700-7-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119107387438794 X-GMAIL-MSGID: 1780119107387438794 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 a2a31b8e623e..77760406abbf 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 1 ms */ + fsleep(1000); + regcache_mark_dirty(chip->regmap); return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR); } From patchwork Wed Oct 18 18:29:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989712vqb; Wed, 18 Oct 2023 11:31:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHiUhGkVnyf0u0KFMBTiL171/mgObsgtDKMY27lRFtKH3RVnfuaUzlR0g0p9hhzWGj54/u X-Received: by 2002:a05:6a00:290f:b0:68f:c1e0:a2c4 with SMTP id cg15-20020a056a00290f00b0068fc1e0a2c4mr8485751pfb.3.1697653905421; Wed, 18 Oct 2023 11:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653905; cv=none; d=google.com; s=arc-20160816; b=toty9UWVH0F/xg5nQOwahq8Vkg8WYaukKFhNYSJJRWqTgXnzANMsbT7UnzWzSwYoz1 OlrJJBQFDaamz8jFzIpt5YlSfNW8h7DyCDkgSRccB6B+Ab4NjiUm+CaIG9RwDnokuqxG 3FrVkWisArBTTWUpqBDkvC5eAPFb8SC3eEPwbqeBCUvAszWLtvJ2uEVzn2v0K/Kfs/zX KMnEKP+X44zbqPujgTQCuuGRnNMCRpBTXhi9z6C9jdwo8uq0fPAc1RqIlphTeCMJ/Nst 8v2i1OFH/Cvn7dGdrNxSTEMAMyDi76wpKneik77SEEzYU1UX3znZJVtH3gcfLJhON5ac 8JmQ== 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=05rq5LupFXlgg38AmpdfNI3O7Bf9EH5HSd0Kh4yrLys=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=B1wCc7dbbhmWjPx9CX5e9YG0ISmnBNU6bIyUY6e4pr7e08ISEMR3gS2TiKunB2CeSl mnJpKpiJFntMWoYYi6AOh01STpIr+HPbLMY+SA6f+T/HvK2v8xOIJImYQM0ZqVlbR+5q cU/Kw8FiBVggoNwrTfVDttBxSjrzmzF72nvn168nH77P1+tDWdR5U5sFCx5OfcwCsIit rgUv/wd/EuEpvG1xH6e8lp9xX1Pd8Y4ppDK9d+PVcA7e26V5ERXMT2U748CRA/yNyl5k 8xB7N4G4TeG8UjaFQqScmMdaUVqCu7DDFx5cSfhKDaPvIHvgby+t8Yu/0OI9ZVE7z6yL OWvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tGdRXwzm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y19-20020aa78f33000000b0069023e4bcb4si877840pfr.114.2023.10.18.11.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tGdRXwzm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D5BE980ABFF0; Wed, 18 Oct 2023 11:31:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344948AbjJRSal (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344924AbjJRSaK (ORCPT ); Wed, 18 Oct 2023 14:30:10 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB518124; Wed, 18 Oct 2023 11:30:07 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A64E012000D; Wed, 18 Oct 2023 21:30:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A64E012000D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653805; bh=05rq5LupFXlgg38AmpdfNI3O7Bf9EH5HSd0Kh4yrLys=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=tGdRXwzm3ThIcBtBCsw96fg8hkl4AC8eJVtZHPbGyJmZpsdEpQO0FMBufMjtPlh7M d3N7ecKcRCYljRQe6WM2Tivojuo6svuz6diJd6zBVHPYJ0kdCmB0OkBw/xQwe9aVMa 6zMAWhaNU/MRZUlSm2JkWAwpEKDz5VK0PTGCGoqqsrxTqlcUp4SZ57/6FuHwi79PkW /U5kpAGkPoFY2F+obuhFz9zxUHIkPy4mvylaEfR9aNjoJa5sGOA5BXZqILIAaFi/ok DFG4mipYJVwdJdAJn2DbynQHOdEEixks6NS2nU6Fj5Im76KPd/GHFeQG+UllaWIkFb PrRfqLKrPnmKw== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:05 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:57 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 07/11] leds: aw200xx: enable disable_locking flag in regmap config Date: Wed, 18 Oct 2023 21:29:39 +0300 Message-ID: <20231018182943.18700-8-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119141465772061 X-GMAIL-MSGID: 1780119141465772061 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 77760406abbf..ad4bfb9f0938 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -524,6 +524,7 @@ static const struct regmap_config aw200xx_regmap_config = { .rd_table = &aw200xx_readable_table, .wr_table = &aw200xx_writeable_table, .cache_type = REGCACHE_MAPLE, + .disable_locking = true, }; static int aw200xx_probe(struct i2c_client *client) From patchwork Wed Oct 18 18:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989508vqb; Wed, 18 Oct 2023 11:31:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEE0T0hQoz4KolS+Ju/njFHjVs0W3vKjSZBTEXCGDAM3R2y3durnK0yDSFSVR/Bm3ol7Ppx X-Received: by 2002:a05:6358:c98:b0:166:cc39:894f with SMTP id o24-20020a0563580c9800b00166cc39894fmr6623429rwj.5.1697653887215; Wed, 18 Oct 2023 11:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653887; cv=none; d=google.com; s=arc-20160816; b=uBYFLbuUWRcE9NkCTk9kyeXy8v9yTNA+oipuIwUKamFIEsMGg3vddbK0GJUgaPXdyX EcgiRC7DngHXmT2jbBc2UHes1+879tVBDyC9n/1TQLBhyJm2Xhy8DEYvtXjkihPh9Q7a U+1MvgY2iG7OU+OqwVTYM77Yh322JyoQRi5h4ji9LUsubSukSLUYIOwLJ8UOV2k0oeWL trlw1PTMvZS95MT+k9PZikhODy3QZk2/FLwWeuxwKqSd0QDdfOAhoxUFUYwsMmKVqzn5 Gat0OoyAas6JsVgaQJl0eWhXM3H0priOmuRxBRgbDTh4l5ebs3y5vy4HEGTd6VISGutP Im1w== 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=/5UiVhsSD5S7UBFKi2NeM/BQQWcB9e4HNthSllcTWiQ=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=hZqmmTJx+XNKh2Xkys23ZOocQGj+VDd5rv+U8iDImaxGmLId/zrRHarGziRpmkOU05 ykJHOCZvMpdO+DVOAhzUwaQA5VUtGusVHUqdOR6yGjX0XDJ4I5/H8Lucv2sJpbJDlmj3 6NAW1cN2ie7FjJOT/49dcKLSerhhCfbv6XUvVnDcUBycdrlvtde3BANpt8JOzIyB3sgC nP86W/DWM1XFroQmHvWUYgMsi1NyIsx/ZXORW+AYZk4iPSn46z6tE3JO7YjykTcWD/Nx s57IXag9JVGiB7mo83jnobM5w58amWMqcXT8R0X/Ucnvk73H70hhgPyNYGU/onitXAiC hJwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=clt5lN4v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b14-20020a63714e000000b005ae03de31cfsi2619100pgn.715.2023.10.18.11.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=clt5lN4v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 90793808DB60; Wed, 18 Oct 2023 11:31:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344919AbjJRSah (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344923AbjJRSaK (ORCPT ); Wed, 18 Oct 2023 14:30:10 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53EAC139; Wed, 18 Oct 2023 11:30:07 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id D6AD3120008; Wed, 18 Oct 2023 21:30:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru D6AD3120008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653805; bh=/5UiVhsSD5S7UBFKi2NeM/BQQWcB9e4HNthSllcTWiQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=clt5lN4vCd2kdgWOgzRBxD5KlkxDiQzROymG/IsEgJJ/ln/5v7zSIAW1PPVu4yqaQ z/elM2oEAND9FoNLX8IvUjFZrCNGM+1I7NVEXgZNijkDQboJeAwT7r9BY+cz8n/mM4 K7yV/VNQI0gTIRji4VYr4JVSVlkhd9iZK3Z4+IpBoaXLnLJbKlBnBqlh4yX+gfgXdv k46oEKWVmJ3baP4ZIw+jYR7yMMcqzuAaIoR5ZjR2jdpTZoC5IQjXmRMq3Sk8pr2TBt EcTC5QhaVG+n6Wvg7H1Gso9xGGCjh8ceNS9Xoo2BypDU8E4uCP6VHdrqpRK+w0IaLN O5tDFhY7iSNSg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:05 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:58 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 08/11] leds: aw200xx: improve autodim calculation method Date: Wed, 18 Oct 2023 21:29:40 +0300 Message-ID: <20231018182943.18700-9-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119122690153409 X-GMAIL-MSGID: 1780119122690153409 From: George Stark It is highly recommended to leverage the DIV_ROUND_UP() function as a more refined and mathematically precise alternative to employing a coarse division method. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov --- drivers/leds/leds-aw200xx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c index ad4bfb9f0938..7b8802bd9497 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -87,6 +87,8 @@ #define AW200XX_REG_DIM(x, columns) \ AW200XX_REG(AW200XX_PAGE4, AW200XX_LED2REG(x, columns) * 2) #define AW200XX_REG_DIM2FADE(x) ((x) + 1) +#define AW200XX_REG_FADE2DIM(fade) \ + DIV_ROUND_UP((fade) * AW200XX_DIM_MAX, AW200XX_FADE_MAX) /* * Duty ratio of display scan (see p.15 of datasheet for formula): @@ -195,9 +197,7 @@ static int aw200xx_brightness_set(struct led_classdev *cdev, dim = led->dim; if (dim < 0) - dim = max_t(int, - brightness / (AW200XX_FADE_MAX / AW200XX_DIM_MAX), - 1); + dim = AW200XX_REG_FADE2DIM(brightness); ret = regmap_write(chip->regmap, reg, dim); if (ret) @@ -460,6 +460,7 @@ static int aw200xx_probe_fw(struct device *dev, struct aw200xx *chip) led->num = source; led->chip = chip; led->cdev.brightness_set_blocking = aw200xx_brightness_set; + led->cdev.max_brightness = AW200XX_FADE_MAX; led->cdev.groups = dim_groups; init_data.fwnode = child; From patchwork Wed Oct 18 18:29:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989385vqb; Wed, 18 Oct 2023 11:31:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiJv9wVzoMe3cs1c6DUS2M3sCpAdwTsWveo3LOyNcuru3wD2xZ+6iKbgYwBeDjQQ4iaDIu X-Received: by 2002:a05:6602:2ace:b0:7a5:a391:73ae with SMTP id m14-20020a0566022ace00b007a5a39173aemr134987iov.17.1697653877788; Wed, 18 Oct 2023 11:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653877; cv=none; d=google.com; s=arc-20160816; b=lx9vsPSZGtS1QE1eDsorKvN3lvT+4fj/mGDXzARNpVxD5/HHgQpF4mmsDGnuDECEYC wXP9v3n/rwSbbhYgveKQf6vch3GcjEhubdhZiE5RRRhVlP1cMF69G2Q3q2ySVgXJCd7g sPrFZMWC4BRuv6raZ4fYCShfuD+ECkvCc7/+Qr88meoub/P9tOtATTC66D7gqNupTYoT 6p5zrw3L35DjvxU3KJLNJeOMuLJdRPIiXkhB+Q53G8KXECnDTE+4z4x8COkWz6eW/Ub9 3PUztn9G8IsESEMm9YU2dGcSi9RAlzh6GIm5go2Mh+o425StHqKezwRYiOJDfSmwMWIX TOEA== 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=14UJ/DJJE29qDpCRN1SrxNjt/yzZB6wyHVfMk5iJ/cE=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=h3jqOAziAtY++pXs3WYEvFhHziUampIMzHcoIrhJIxmkyYw6vbpmrZmmublRhF4AFV XbvnICfVKziO1wHqTcgkBDwHl0EW/SpfKlTi1pOZLkmP2oRAa37e9hzfXdwQWv30J9ZN kFSznpcp8NVDtMUndYq68IGRJCx4aDjrcxU+XkNplhNQd/RekoGXtCKyvEhSbCB867nG tRUiBKnMV+5ICqiztnh1u8sITY1CSjc7YsbYqzOCFsi1aAsqDLWMjTMCAhzziuGa/I1F egaz9S7LfSocKkolH/3ixvdood/z3f2Q1mAdlwv6mqkW4dTnjwaE6udrKzRA6pfYFDhS vdGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=a506zYAU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id o15-20020a656a4f000000b005898e10f9b9si3017078pgu.213.2023.10.18.11.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=a506zYAU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D789C822A494; Wed, 18 Oct 2023 11:31:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344786AbjJRSae (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232603AbjJRSaN (ORCPT ); Wed, 18 Oct 2023 14:30:13 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D624712A; Wed, 18 Oct 2023 11:30:07 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 0A228120011; Wed, 18 Oct 2023 21:30:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 0A228120011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653806; bh=14UJ/DJJE29qDpCRN1SrxNjt/yzZB6wyHVfMk5iJ/cE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=a506zYAUi2OKX2I7PrtDZTa+WPu/QqHN2w/nypgj5FVM51+cQ4bCRVe2DiCqF+Dmf ASHSCFpQqC9XBtd3+HnaySQnp1YFMUVpuQX6dEhPkefDZGK0U5CDrnpBYwn+KiXeXw xAq2Ep0KnAabVeEliGtFrm3t+DHoHphmpr+roLzQhB+dj0zfIJFgMgzzRdQ0Q/8um6 uQtSa+2QxlUxOrnUKPze0IPhGirfj+4apwjbUpkfEId6BdUNzlx+enevifpdFK9wer YgNL9zr/QPOSy9+EYEtZUy1g29RL+qE+qt8cTbfJkmyMBytSuqeF1VWhu+Mdrs6iqf QgHVwdblSBg2g== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:05 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:29:59 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 09/11] leds: aw200xx: add support for aw20108 device Date: Wed, 18 Oct 2023 21:29:41 +0300 Message-ID: <20231018182943.18700-10-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119112332361236 X-GMAIL-MSGID: 1780119112332361236 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 7b8802bd9497..529a4ab9c876 100644 --- a/drivers/leds/leds-aw200xx.c +++ b/drivers/leds/leds-aw200xx.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Awinic AW20036/AW20054/AW20072 LED driver + * Awinic AW20036/AW20054/AW20072/AW20108 LED driver * * Copyright (c) 2023, SberDevices. All Rights Reserved. * @@ -616,10 +616,17 @@ static const struct aw200xx_chipdef aw20072_cdef = { .display_size_columns = 12, }; +static const struct aw200xx_chipdef aw20108_cdef = { + .channels = 108, + .display_size_rows_max = 9, + .display_size_columns = 12, +}; + static const struct i2c_device_id aw200xx_id[] = { { "aw20036" }, { "aw20054" }, { "aw20072" }, + { "aw20108" }, {} }; MODULE_DEVICE_TABLE(i2c, aw200xx_id); @@ -628,6 +635,7 @@ static const struct of_device_id aw200xx_match_table[] = { { .compatible = "awinic,aw20036", .data = &aw20036_cdef, }, { .compatible = "awinic,aw20054", .data = &aw20054_cdef, }, { .compatible = "awinic,aw20072", .data = &aw20072_cdef, }, + { .compatible = "awinic,aw20108", .data = &aw20108_cdef, }, {} }; MODULE_DEVICE_TABLE(of, aw200xx_match_table); From patchwork Wed Oct 18 18:29:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989552vqb; Wed, 18 Oct 2023 11:31:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU1yzc351T5MMWOfkYBmsUrwesP/FjvKys4hunw/+KCK/9N9nvXUC3HZEuZgiF5Dvl17Ns X-Received: by 2002:a17:90a:d3d0:b0:26b:219f:3399 with SMTP id d16-20020a17090ad3d000b0026b219f3399mr5035774pjw.35.1697653891374; Wed, 18 Oct 2023 11:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653891; cv=none; d=google.com; s=arc-20160816; b=RfW8jdVk4/anRufi7iL3DAN0mFE4/plVJbFndaPhzikSd4R6/z9qiwtpqn5dl1sNdt HWIWoh2EmRnCfQ3UpnLaf+nxlxUjX8o886iTDTxDsY0e0dynbI6kADJvlYrbYQiMNSWI ylDKKqzOaymHOyBq/+dXo6eRjSai+2CRInk2joqSMeVpam3JaTtP22yBp89gfx6slObF IoxAzAlkPZQ/yjYwO/rOD+W2uFt0+QFOD/O6SrvLk0eOTgrQVnf6+qtM9b9hq2U0J1mh 58Baz8vXz5QKPqDapzf5F0mSOOk257pL89UvD5wknNTVlADIGQEqClPHcH1xWl9L1Xy2 bqig== 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=Hl7lo5DMCXAMsSqGGcM5LJzbiISt98geW2Neh80Enes=; fh=sORWI5m16YEVk6NuaHBH7AzDgvChSOROlmEzxQvCLqs=; b=PPMo2hqKUW4vXt+en6xF/UOwsymj+MEHtRY90geatIr7y/fmdlwkykRKLjDAAWi96J cUe9GcxSeOIHhiOBsEgqAxaxIlqvkjAc97hlDHlU5hlBazexc/yfxYO2YcnGn1MvqqLY 55n/JAx61fNoZrTkv9dX4OPfrR8iwXdNtgebPWYlhsh63YFCZABM4Ga354cOQmfdxHpd rX3U3ncWyj20X/DmkJSi/u/olbWf7p4asqqTQkWP8CCqhWmnma2dzdVlBRRPvJz5dca/ jDRmFAGUCNSbNIQvGy994jioy/jEMDes02t8bvjqcKFCifnX8sUPbOuPNTMemuo8j/BK paiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tJpKbYwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d8-20020a17090ab30800b00263860e1f4csi394231pjr.16.2023.10.18.11.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tJpKbYwC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F408780557DF; Wed, 18 Oct 2023 11:31:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232672AbjJRSaX (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231562AbjJRSaN (ORCPT ); Wed, 18 Oct 2023 14:30:13 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B5912E; Wed, 18 Oct 2023 11:30:07 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 3BB70120012; Wed, 18 Oct 2023 21:30:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 3BB70120012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653806; bh=Hl7lo5DMCXAMsSqGGcM5LJzbiISt98geW2Neh80Enes=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=tJpKbYwChQfdAaDSf5hw552EjosxVhwGne4Eah04EJM4Z6QqiqsqkvLss93L1/+Fb cDD4phCq4ca30SfSXwisJc/3m5umSQru+IgkOw5exKy3xjZMAqbFEGl8bxfaZbgXPW VyNqOsCcsQPEYA6UJI72ZHluODWz0Cq3o67tw4AGtWn22obhirsA/FZGZ0ocAz1Ogv mwrXLjfb+Jx233G6p2IrXbi9t8Dz1MTJeO8YjCFtm9rOrtKLKqXHhr2oyedDs1/jdQ Pp6K9gZ691E190632FAi50FeigXmWRCiU+2S3uiqQjN2cpFBlhw0Kp/p5zJ6cGCVpE hdsZPiXDyzSwA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:06 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:30:00 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , George Stark , Dmitry Rokosov Subject: [PATCH v2 10/11] dt-bindings: leds: awinic,aw200xx: add AW20108 device Date: Wed, 18 Oct 2023 21:29:42 +0300 Message-ID: <20231018182943.18700-11-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;www.awinic.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2023/10/18 16:37:00 X-KSMG-LinksScanning: Clean, bases: 2023/10/18 16:37:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:31:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119126897538178 X-GMAIL-MSGID: 1780119126897538178 From: George Stark Add aw20108 compatible for Awinic AW20108 led controller. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Acked-by: Conor Dooley --- .../devicetree/bindings/leds/awinic,aw200xx.yaml | 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 ee849ef3236a..efb18ddce383 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 From patchwork Wed Oct 18 18:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 155081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4989624vqb; Wed, 18 Oct 2023 11:31:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGn+4c72tmZl2hGnfN2sOI2++LA7afgp78s9bdDebsI+k1EO/T+tSRocwMP5JjirpJzV7us X-Received: by 2002:a05:6870:288e:b0:1c5:56f:ac08 with SMTP id gy14-20020a056870288e00b001c5056fac08mr238886oab.12.1697653898250; Wed, 18 Oct 2023 11:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697653898; cv=none; d=google.com; s=arc-20160816; b=xVugBzWIiDARNZHccMEeolUk4jlZ0CDe/xW1SdhG9HdrEbi74Wj5VbXB12rWg0OC93 igbQJmy8LHa7/gFLO+On/JOrrrSx8qPwmtaiz3Yet3DcQdeUuih8u+S9v+Wqmw+CCYIS 4Bw6pxa74CPibUj16neVwRdEt/WMeOw52cdiROUP0c3Ffrt6T6fq2qvM99CPDlp5qw06 n0D4DGKvem+k199NdbrVEN1I+dV4mvIornYaFynCRTnN11PUVX1PVXxPic/bICPIpYDH dqadBB4AVMJc/KQUzHTrpZPnVQ43o+n8Fh0oB1DSjEZskxmHmdAmZ9RmrVPYXe7sayXf /vVw== 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=F2RtCFL49u4f1chUWQQeWaGTuLV7xQMAnXLi744tnNQ=; fh=sGimd2ZdVvk8/MILn8/B31HxCT6JTOun9AZJxJGQyuE=; b=0HqAh5vrtZ7U2QQMMC4ElG8LpWWO0zzsvV3tItka1pmorXOlGw7WAcu5Ah7YEqgVa+ HQi2HrG3vGkPPPs2IYTcXkdwP/MXTeF3ST/ftDoHzOIu/VxUQAXLb6+EIr07IkItyMo9 DwNLstv2zvx3ZkYpkk2FXc6QfH0YSYIKJI83IlNqqGxNN23VrmA3JaD/KCoZUTboMWKA UuFd7+e5TvqGDrq9oYvVE4++VPkNdtSQsr2G2YL2Ggk/7uu6GmLH2481dxRxLwoUIZOS CT76XwNyyMCvSpIwqzH70zAZ3LZlTeM2GjfEd8dlPKGbE7q1dfJMKjA2HbS/MCw3JJ0G 4qcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=SJS07sb7; 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 t28-20020a63955c000000b00582dcfe3b41si2684639pgn.374.2023.10.18.11.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:31:38 -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=SJS07sb7; 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 40D928066657; Wed, 18 Oct 2023 11:30:48 -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 S1344824AbjJRSa2 (ORCPT + 24 others); Wed, 18 Oct 2023 14:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232596AbjJRSaN (ORCPT ); Wed, 18 Oct 2023 14:30:13 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30784122; Wed, 18 Oct 2023 11:30:08 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 6FF12120013; Wed, 18 Oct 2023 21:30:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 6FF12120013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697653806; bh=F2RtCFL49u4f1chUWQQeWaGTuLV7xQMAnXLi744tnNQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=SJS07sb7fNooor7nUmSlkiKskrmWW89dKPQaB9O0s2fFsHlzWHeEKpRTE1rzzyAKe jZtkt9knArsyjBJkjSVfon1lwJyQAIOHCug2Xj+vYR7IycZo+mc1myKeOgyGm3duUr u+0f536ZGjCidnRiPTJHuY7si1ku11kaEiCDQWtZFWtJ+GQJ/wSOd8mPYUq1eI0cmy ToM8uD8hJRVA3gsi+lVO50m0PQlOKD1stIy0/4jXGw85NWAvHQnmCiHkstOjJLDozL MVChYsDKrAny5ouw2aUXQgApAav3Jb9CG97qkIxh4eHGf0oAXV6Xi/TIzA/+rVaWDW RLb3Kp2FfiUkA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 18 Oct 2023 21:30:06 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Wed, 18 Oct 2023 21:30:00 +0300 From: Dmitry Rokosov To: , , , , , CC: , , , , , Dmitry Rokosov Subject: [PATCH v2 11/11] dt-bindings: leds: aw200xx: fix led pattern and add reg constraints Date: Wed, 18 Oct 2023 21:29:43 +0300 Message-ID: <20231018182943.18700-12-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20231018182943.18700-1-ddrokosov@salutedevices.com> References: <20231018182943.18700-1-ddrokosov@salutedevices.com> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180713 [Oct 18 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: 541 541 6f62a06a82e8ec968d29b8e7c7bba6aeceb34f57, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/18 17:21:00 #22224798 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]); Wed, 18 Oct 2023 11:30:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780119133634682727 X-GMAIL-MSGID: 1780119133634682727 AW200XX controllers have the capability to declare more than 0xf LEDs, therefore, it is necessary to accept LED names using an appropriate regex pattern. The register offsets can be adjusted within the specified range, with the maximum value corresponding to the highest number of LEDs that can be connected to the controller. Fixes: e338a05e76ca ("dt-bindings: leds: Add binding for AW200xx") Signed-off-by: Dmitry Rokosov --- .../devicetree/bindings/leds/awinic,aw200xx.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml index efb18ddce383..677c73aa6232 100644 --- a/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml +++ b/Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml @@ -42,16 +42,18 @@ properties: maxItems: 1 patternProperties: - "^led@[0-9a-f]$": + "^led@[0-9a-f]+$": type: object $ref: common.yaml# unevaluatedProperties: false properties: reg: - description: - LED number - maxItems: 1 + items: + description: + LED number + minimum: 0 + maximum: 108 led-max-microamp: default: 9780