Received: by 10.192.165.148 with SMTP id m20csp2084139imm; Thu, 26 Apr 2018 06:05:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4962iIe3kMvNwjTtXE9xu4O+j6wqNcixKwxJ4Yc5Uv2/XZ4gRXuJtrbD3h327qRbXl0LQgC X-Received: by 10.99.116.76 with SMTP id e12mr27348200pgn.270.1524747951338; Thu, 26 Apr 2018 06:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524747951; cv=none; d=google.com; s=arc-20160816; b=leb7+hgzT4QmoYt15DnuE3AyKcrVrRA1IC/0A9CLcwvWEr5jtx1gyxEBwnJNrldoUT ugQgSe+KwN1PbrsgHZCcp2nJFdgxBYc1DjSQgkxhP4o3Kd38Z4Snho8W/inWgFEUsuST auKpK2iI8jRpgbVXnJIiNHohSy6Jyz+uxk7xTdB2COi07yE83AlyC3napBgPR5WJR7Eo 88xviQOlvcBeaub6ylrulV2LPfWRjwH7+XSofFqkyUjD2wdtbULT01fnjCRC5klUoBwK N78biIACNXEiE0fbA6L19mK/HjhBdsMY7Wr0AlNN1Z5PH+0ytHo6d5CxmKRMgjB8eHEc 9tEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=P3kQIL9TNFhQ27DkaRrSVKVXIZHqqd2luVFzG+U8VDc=; b=PJbA783ts8nGgyi8AhGtoGdS+YTU4EqTbFUQloRcET44AGY6tUOCVM8IUw8ZOx8jKu 8AXgVNwkuyxnhgdLHO09yzXp5j5qo4efCY2V08CcMGOMEzxE/vh3cedZ3yLoWX1NgrFV yUXXs/kIkgcpZzAWLMGlDDbgSZ9mXZ3P/LRYoiCpwJr2IrOy0kbVUVDpSP9DKF4frveZ 9JKcYMm3K3H18FvXxYMIfG6G9FLPgkfexuSaHUqP8f3z9qqmZ4RgIgyka5SPPoxSHKgS TlWyf86jYs5o66/+C8WLCYV3gbaJSWWqKgzUlaflOHs2kgaPifWwQa4ITsupEDYKHuSS 4MLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o186si5886334pga.350.2018.04.26.06.05.15; Thu, 26 Apr 2018 06:05:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756241AbeDZNEB (ORCPT + 99 others); Thu, 26 Apr 2018 09:04:01 -0400 Received: from bert.emutex.com ([91.103.1.109]:55039 "EHLO bert.emutex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755522AbeDZND5 (ORCPT ); Thu, 26 Apr 2018 09:03:57 -0400 Received: from [92.51.199.138] (helo=statler.emutex.com) by bert.emutex.com with esmtp (Exim 4.84) (envelope-from ) id 1fBgZf-0002Xh-3G; Thu, 26 Apr 2018 14:04:35 +0100 Received: from [79.140.212.107] (helo=localhost) by statler.emutex.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84) (envelope-from ) id 1fBgZ0-0003AX-JJ; Thu, 26 Apr 2018 14:03:54 +0100 Date: Thu, 26 Apr 2018 14:03:54 +0100 From: Javier Arteaga To: Lee Jones Cc: Jacek Anaszewski , Pavel Machek , Dan O'Donovan , Andy Shevchenko , Mika Westerberg , Heikki Krogerus , Linus Walleij , linux-gpio@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH RESEND 2/3] leds: upboard: Add LED support Message-ID: <20180426130354.4kidtdwcsxtn5f2g@localhost> References: <20180421085009.28773-1-javier@emutex.com> <20180421085009.28773-3-javier@emutex.com> <20180426073314.g2ccjjkx6vgbknhm@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180426073314.g2ccjjkx6vgbknhm@dell> X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "statler.emutex.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Lee, On Thu, Apr 26, 2018 at 08:34:05AM +0100, Lee Jones wrote: > > drivers/mfd/upboard.c | 19 ++++++++ > > This change needs to be placed into a separate patch. OK. I'll do ("add driver" -> "add cell") pairs of patches then. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lee, On Thu, Apr 26, 2018 at 08:34:05AM +0100, Lee Jones wrote: > > drivers/mfd/upboard.c | 19 ++++++++ > > This change needs to be placed into a separate patch. OK. I'll do ("add driver" -> "add cell") pairs of patches then. > > +#define UPBOARD_LED_CELL(led_data, n) \ > > + { \ > > + .name = "upboard-led", \ > > + .id = (n), \ > > + .platform_data = &led_data[(n)], \ > > + .pdata_size = sizeof(*(led_data)), \ > > + } > > + > > There is a subsystem-level MACRO currently being reviewed on the list. > > Just use the full format in your structs for now. Will do. > > /* UP Squared */ > > > > static const struct regmap_range upboard_up2_readable_ranges[] = { > > @@ -116,7 +124,18 @@ static const struct regmap_config upboard_up2_regmap_config = { > > .wr_table = &upboard_up2_writable_table, > > }; > > > > +static struct upboard_led_data upboard_up2_led_data[] = { > > + { .id = 0, .color = "blue" }, > > + { .id = 1, .color = "yellow" }, > > + { .id = 2, .color = "green" }, > > + { .id = 3, .color = "red" }, > > +}; > > How is this data used? > > Does it ever change, from board to board? This provides indexes into the LED control register, so the leds driver knows which regmap bits to flip, and maps them to color names, so it can name the led devices accordingly. The mapping does change for each board (UP1 has 3 LEDs, UP Core depends on the carrier board). > > +struct upboard_led_data { > > + unsigned int id; > > + const char *color; > > +}; > > If this is going to stick around, which I'm not sure it should, you > need to document it (using kerneldoc format), since 'id' is quite > ambiguous. True, it's not very clear. Would it help here to also pass the regmap explicitly as platform_data (instead of leds-upboard getting to the regmap through parent driver drvdata)? Thanks for your review!