Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp194457iob; Mon, 2 May 2022 16:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSyIK3ByQPM1i0cRrOH6XB2jH5yuSF1/JIIZKhreqixepS2+Sg3PlnaZWryFvmFuKGAXx3 X-Received: by 2002:a17:902:d48a:b0:15e:a142:a9e8 with SMTP id c10-20020a170902d48a00b0015ea142a9e8mr8555537plg.129.1651535565814; Mon, 02 May 2022 16:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535565; cv=none; d=google.com; s=arc-20160816; b=SST5MVgX8t+PmfpjKhyE6qB8Y9dqQZUXkLCPQAacV75hQLswjzXqGSwmofLO0a6KDV Wrmtl6hbLa1etAyMjvbiZsp0OdBZ1Prm14IPhKBvweTuk4CoUaOaOEFDr956Swi+fjtt TrZM0VYp6qlPtFKPKEL9zp9O/i+rN/bUZmJBhKJNHUv/dUK5fKyTlZ6Pz6tRZQf6T+Ni pYN+evZDM/F4rrtgcuUWoOu5OkDN6Y85taUUHxlGEwbs+YsOiCu6+wKefe4esTo3mvQ9 JOYdP4SCK4YBVw03Ki7UU+r7UsPjieVeOOpqEVUiVWYGPiu2ea08dGpUsBy3/BkurIKq zxBw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gQXl+j1kk6wIf6rqveQh6ZauGdEcC6AoV5xa7H7vJ8M=; b=T/UDEmZN467rpY2XkauIO6UIDWaC03wOj+jLvmQVUH9aw1SvVNM/pL0Te/BnslH6xH /NuPCT7oQBY2M+4hxUzM62+Xur80S+0ZGYbN65tDwz03gZ6ozf0oilxtUWVQNUKNOJq1 zgkqs1S4IDHOiAE8TXi/WG8FgjIKZrU17jd4FMR954QuclWx1RdwpACQc3foNEGcT6Yu SsQ2cJ++iiecyp30/KsPZNFWlsiGBYYFDY0ijbTVSTD7ND9IL7KxYcrsbUETJw8070iC JQCyZg4PVWUBp+B9ToesrKOSsPFp+akqemdsYPdsGy/CbQJkD/T3YbsPuc3ADC8mPdXZ W9Zg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id gj16-20020a17090b109000b001d2dc5fc896si548210pjb.64.2022.05.02.16.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:52:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 04F4633E9B; Mon, 2 May 2022 16:52:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382895AbiD3OzZ (ORCPT + 99 others); Sat, 30 Apr 2022 10:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242575AbiD3OzM (ORCPT ); Sat, 30 Apr 2022 10:55:12 -0400 Received: from relay07.th.seeweb.it (relay07.th.seeweb.it [5.144.164.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC3A33E0C; Sat, 30 Apr 2022 07:51:49 -0700 (PDT) Received: from SoMainline.org (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id E34F23F685; Sat, 30 Apr 2022 16:51:46 +0200 (CEST) Date: Sat, 30 Apr 2022 16:51:45 +0200 From: Marijn Suijten To: Bjorn Andersson Cc: Pavel Machek , Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Lee Jones , Luca Weiss , Doug Anderson , Rob Herring , Jonathan Corbet , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v14 2/2] leds: Add driver for Qualcomm LPG Message-ID: <20220430145145.2zlxahmtjwyzezkg@SoMainline.org> References: <20220303214300.59468-1-bjorn.andersson@linaro.org> <20220303214300.59468-2-bjorn.andersson@linaro.org> <20220430123502.7od55knvxkw3sv6s@SoMainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220430123502.7od55knvxkw3sv6s@SoMainline.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On 2022-04-30 14:35:04, Marijn Suijten wrote: [..] > > +static int lpg_add_led(struct lpg *lpg, struct device_node *np) > > +{ > > + struct led_init_data init_data = {}; > > + struct led_classdev *cdev; > > + struct device_node *child; > > + struct mc_subled *info; > > + struct lpg_led *led; > > + const char *state; > > + int num_channels; > > + u32 color = 0; > > + int ret; > > + int i; > > + > > + ret = of_property_read_u32(np, "color", &color); > > + if (ret < 0 && ret != -EINVAL) { > > + dev_err(lpg->dev, "failed to parse \"color\" of %pOF\n", np); > > + return ret; > > + } > > + > > + if (color == LED_COLOR_ID_RGB) > > + num_channels = of_get_available_child_count(np); > > + else > > + num_channels = 1; > > + > > + led = devm_kzalloc(lpg->dev, struct_size(led, channels, num_channels), GFP_KERNEL); > > + if (!led) > > + return -ENOMEM; > > + > > + led->lpg = lpg; > > + led->num_channels = num_channels; > > + > > + if (color == LED_COLOR_ID_RGB) { > > + info = devm_kcalloc(lpg->dev, num_channels, sizeof(*info), GFP_KERNEL); > > + if (!info) > > + return -ENOMEM; > > + i = 0; > > + for_each_available_child_of_node(np, child) { > > + ret = lpg_parse_channel(lpg, child, &led->channels[i]); > > + if (ret < 0) > > + return ret; > > + > > + info[i].color_index = led->channels[i]->color; > > + info[i].intensity = 0; > > This struct also has a "channel" field that doesn't seem to be used > anywhere. Should we still initialize it to something sensible, or is it > better reported upstream for removal? Never mind the second bit: lp552[13] uses the `channel` field internally to store a custom index. This LPG driver simply iterates over all the led channels (stored in the LPG struct, with all necessary info) in the same order as the subleds in the multicolor led device, so it's most likely of no use for us. - Marijn