Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2818716rdg; Mon, 16 Oct 2023 16:30:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEfru4gEWO4GDFRkfA9h2KpIBl8j/rQhXzfPdiEvQO8HbSnQWvNRyU2qdr1PTb6Mwt/osh X-Received: by 2002:a17:90a:58:b0:27d:b22b:fb89 with SMTP id 24-20020a17090a005800b0027db22bfb89mr487299pjb.35.1697499039522; Mon, 16 Oct 2023 16:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697499039; cv=none; d=google.com; s=arc-20160816; b=w9goprnq3p5LQnzFn++K+x13QA7myZpFflRl5Jiw3k1bkSe7HVLX9EYMWnor+b09Kr DkNqrSUpfPsBlkyfASCTdx3H2fJGhEBGaoqkSPdbOVaW/BCy80NXMz6b/U7AcY0vnJau sGIxIRIBrOpSddTBxk1p1CzzBbDkxOueXy9Ae2A5FApWk7CdTcarvIdylYP+WK8u3Tor GnS51MLyhUbaiq1piDNKd6uKXZRXnEjAkQWhcVMJJU1j3/dP6EN/RAJm93ppU0897k5l Q5IQEMjXA0bIekz9X6DLF5duClc1Bdc01927TvGwMS5NW035fRKuN+Mv+PzdYaxa3zAR BYsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=zD1Tf1IUoIfxanKeL4xArFVYvOpIBhWtdn1cF1qPX+U=; fh=1QgbyT2bYJ91mPToRv4KQRHAhRaykCg6BaW+eic9dbY=; b=YYdN84VQQdlt9f4ql3//xyn+Ridb9slk2bqGvReeRp7XmYGMCqI+N7BxzLdbyOJcP5 lWkOOqNs4COak42k0sJnxriYgUjq9Cbo6r1Lb7aKDM+t+a/z48aVQArRDobJztrLErks upUNWpByO8AEynzX0DajPTslE/9Bw6WWnj4AtjpyKTgUdyCnK+wVexS37S/KuHnZzTIv CmvWyX7KUR6NhL4bfgNRhFytvRIH5rtQPCLRyPsVKaQaDqVnO+GTy/p6RCeJKAEUF3f5 5vOI29MmIrcc+hNLxVEDN+pnn5AmTBmCczS3672z0FnCO47IqtJ63L+smS3vITl5EkUy XK+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Rlpu6FiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e15-20020a17090a9a8f00b0027901ee93fbsi7060206pjp.156.2023.10.16.16.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 16:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Rlpu6FiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6D8CA8076CB7; Mon, 16 Oct 2023 16:30:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233802AbjJPXaN (ORCPT + 99 others); Mon, 16 Oct 2023 19:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbjJPXaM (ORCPT ); Mon, 16 Oct 2023 19:30:12 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929D392; Mon, 16 Oct 2023 16:30:09 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A66EB120005; Tue, 17 Oct 2023 02:30:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A66EB120005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697499005; bh=zD1Tf1IUoIfxanKeL4xArFVYvOpIBhWtdn1cF1qPX+U=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=Rlpu6FiQV6G/ituo61toc105IfKD7lddxrIYrRDu6HmjClMW/VR6Wp4ZUufTE+pRy ENAVcYHtmE1uQOICYi5OU+jfDK856f6Jm09Ciz3AQbN1E1RZxKFhJC74LCyn560L/Y wr8XA/XtXWCNf2Gb118b/Irm9YWZugHkAuKXsEhDYsVaB9+fnChkocpPUyZvYTmTFO PpMkQoqiM/xva+bHyRq5jYgxdb8PA+h8QL3oDhFt+h0rjZwVKLCEqUsWHOzzXWdVe4 ifi20BzDRwjZCS22DJBtWHjk3C9p1Fs/wQEQ4JfxwemTp/QoWT6O0kQjiTKgNodWg5 +Obu3fitPT7sA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 17 Oct 2023 02:30:04 +0300 (MSK) Received: from [192.168.1.127] (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; Tue, 17 Oct 2023 02:30:04 +0300 Message-ID: <00715fd2-a866-9589-cfe1-d93fd6f9ed49@salutedevices.com> Date: Tue, 17 Oct 2023 02:30:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v1 05/11] leds: aw200xx: calculate dts property display_rows in driver Content-Language: en-US To: Dmitry Rokosov , Andy Shevchenko CC: , , , , , , , , , References: <20231006160437.15627-1-ddrokosov@salutedevices.com> <20231006160437.15627-6-ddrokosov@salutedevices.com> <20231009132055.kg2gbbznr63plvm4@CAB-WSD-L081021> From: George Stark In-Reply-To: <20231009132055.kg2gbbznr63plvm4@CAB-WSD-L081021> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180654 [Oct 16 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: gnstark@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: 540 540 2509a3fe0f7fdc802e7154a32be7c2dd394ab987, 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;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/16 22:35:00 #22205315 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 16:30:30 -0700 (PDT) Hello Andy On 10/9/23 16:20, Dmitry Rokosov wrote: > On Fri, Oct 06, 2023 at 08:59:46PM +0300, Andy Shevchenko wrote: >> On Fri, Oct 6, 2023 at 7:05 PM Dmitry Rokosov >> wrote: >>> >>> 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. >> >> So, how do we know that there will be no regressions on the systems >> where this property is used in production? There're two possible cases here if "awinic,display-rows" value is not equal to autocalculated value which is incorrect way of using the driver: 1) "awinic,display-rows" value was less then autocalculated value - it means that some leds never couldn't be turned on even if they are defined in dts. Now all defined leds can be controlled. 2)"awinic,display-rows" value was higher then autocalculated value - it means that leds refresh cycle time was greater then it really needed due to controller spent time powering unconnected pins. It will affect leds' current but I consider it a kind of hack - the driver provides means to control current. > > In the production boards, developers should set up the display-rows > correctly; otherwise, the AW200XX LED controller will not function > properly. In the new implementation, we calculate display-rows > automatically, and I assume that the value will remain unchanged. > >>> + if (max_source < source) >>> + max_source = source; >> >> max() (will need minmax.h)? > > Correct, I will fix it in the v2. > -- Best regards George