Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp77953rdb; Tue, 31 Oct 2023 00:48:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2HaAD/IaPNMXrHO+uQzZ3uePNko6nKk6ebnvUMrKkbgcCHDpmPywltQGShsnbFPoMJJa3 X-Received: by 2002:a05:6a20:938d:b0:171:c88a:890c with SMTP id x13-20020a056a20938d00b00171c88a890cmr11641416pzh.25.1698738506782; Tue, 31 Oct 2023 00:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698738506; cv=none; d=google.com; s=arc-20160816; b=E5TZWMuOg+eUt9Io9N6LHMmg7hYJSrtJAuoYUHBQcgexulDhWr0SZ/5ihpoTvZGHmB FqMxkKfeC2wgR0jd/Ld+vIVHTeY9Ura48/wwSxtrPH0y9PCVDEXMpzI4/wIKRXhqhcXK vK/Mr1FGnnprgTSO7mSVh7ymcyTurSP1YxFBSuWe9WNmXGlSZtS5vub+bH/CJ6ISvsEr N2KboTiJofstD1huXkIUrq1zxPwb8MyamfWKx5Xw4Z3PCqqGaSIw/kgJ/dxzC4bdJsIA UjVHp7d9+3MAaFfz5f2cAdvGwevNe8ISeZO1o5e/DOveXIYkkkXmRnYRn1sPzfQBuBmc BmfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YETPxIXT1z5ry9+URT92xUzkzYTqQHl2N26FPaDGwjA=; fh=YlvjDs5EiK9R6rWz/XYSnR7i8T1Kr5zAQ76STCFjxOk=; b=cz7F1vwwoXfGUSYUKWrveB8Y/Aon4KjBXVZdhSskDYpWiCEc4YebBmPSXiGhVPO05Y KYliWRK3jQ4EefyMIKjHZPMxZqfxmntbGK3hOVKh8kVdHNyWAKGMBIWwPprSlb+XhSPc WpJAuecDrtu5tiJ3w2/iwhm92uLlBoHO42PbgsPBNKHHkwfYoGUg4E6F3Zs+Lrq+TcZj qwWJyDG4Qs0XzEtIcyhPQQZTtHM64gcsj+Fh3ccNXODB103kUtQ0iNcNyKZRf4LRRzI7 v2h0VKw3nz0U5lkADm9YfjU9VkqPPMKPLzl5OMnOUyjYX8n6CKeBHPwKrwoJR5+jsXdP fK1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cqfsXm/c"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z8-20020a17090a468800b0026b6a7d9e43si605069pjf.14.2023.10.31.00.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:48:26 -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=@kernel.org header.s=k20201202 header.b="cqfsXm/c"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4787D8031D6D; Tue, 31 Oct 2023 00:48:24 -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 S1343733AbjJaHsP (ORCPT + 99 others); Tue, 31 Oct 2023 03:48:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236654AbjJaHsO (ORCPT ); Tue, 31 Oct 2023 03:48:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97000C1; Tue, 31 Oct 2023 00:48:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4C27C433C7; Tue, 31 Oct 2023 07:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698738492; bh=u5OhuMhZzR6JXuvhNC/KDrltMRDZ6tM7BPip6bBNUic=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cqfsXm/cvPDFyWtJcarQZbOA+Ra2DBzhwm1Xm2FVKaBARc8FW0bceA+lQShI5GQAI WvjnPpUor4s7F/lyhTRkAHt5AsHeHRZerxG/pCNDxIPO1YZKs44wLMAi7eaRxQFpZD S4DKTU1kUJPL40Sg8nJ0O8FOgsqxDZeaX3G4TBJA4fuLZpfjl33gBDnADEz9k0B0Hz Rs1Lhpb+rV3QkBO6PkmIGcwIpXUgMBLonhFQNP99k9P+lWbPVyIM3B2RhcW1Q7YprL EqkLUalBBH/LGoJ8U1q5MNcB9oytnJ8ZiEMHb3KDuCp23uUGUDZRg06TWN0Bky/cxQ S55p9ERkgGmBA== Date: Tue, 31 Oct 2023 07:48:07 +0000 From: Lee Jones To: Samuel Holland Cc: Pavel Machek , linux-leds@vger.kernel.org, Chen-Yu Tsai , Jernej Skrabec , linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [RESEND PATCH v7 2/5] leds: sun50i-a100: New driver for the A100 LED controller Message-ID: <20231031074807.GQ8909@google.com> References: <20221231235541.13568-1-samuel@sholland.org> <20221231235541.13568-3-samuel@sholland.org> <20230316133422.GM9667@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 31 Oct 2023 00:48:24 -0700 (PDT) On Sun, 29 Oct 2023, Samuel Holland wrote: > Hi Lee, > > On 10/17/23 19:38, Samuel Holland wrote: > > On 3/16/23 08:34, Lee Jones wrote: > >> On Sat, 31 Dec 2022, Samuel Holland wrote: > >>> + for_each_available_child_of_node(np, child) { > >>> + struct sun50i_a100_ledc_led *led; > >>> + struct led_classdev *cdev; > >>> + u32 addr, color; > >>> + > >>> + ret = of_property_read_u32(child, "reg", &addr); > >>> + if (ret || addr >= count) { > >>> + dev_err(dev, "LED 'reg' values must be from 0 to %d\n", > >> > >> Doesn't sounds like an address. > > > > The one-wire protocol involves the first LED responding to the first 24 > > bits of the transfer, then forwarding the rest to the next LED. The > > address is the ordinal position in the chain. So I don't think there is > > any reason to have gaps in the addresses--the LEDs would still have to > > physically be there, but you would not be able to control them. That > > said, the driver doesn't need to enforce this, so I can remove the check. > > There's actually a reason for the driver enforcing that LED addresses > are contiguous. Removing this check decouples the largest address from > the number of LED class devices. Unfortunately, there's a register field > (LEDC_RESET_TIMING_CTRL_REG_LED_NUM) that must be set to the largest > address for transfers to work correctly. > > This means the driver would need to iterate through the child nodes in > two passes inside the probe function: first to find the largest reg > value, and second to actually register the LED class devices. > > Since I don't think having gaps in the addresses is a realistic use > case, I'd like to keep this restriction for now (with a comment). We > could always pay the complexity cost later if someone really does want > to relax this check. You're replying to a review conducted 7 months ago which in turn was for a patch submitted nearly a year ago! Also the review comment was simple - if it's not an address, rename the variable. -- Lee Jones [李琼斯]