Received: by 10.192.165.148 with SMTP id m20csp352478imm; Wed, 25 Apr 2018 00:04:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx49oiLE1hJO7RVwn3lhj8cm221yP4ElgNnwKJnRWc6blLHa9HmZoQfEf9gfbmysee4MHtp5z X-Received: by 10.167.129.10 with SMTP id b10mr26978393pfi.186.1524639860750; Wed, 25 Apr 2018 00:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524639860; cv=none; d=google.com; s=arc-20160816; b=L3iNhSP5QF5LBOJbZ+tx/KPdsG560Zx2m8gTkjjeDDQg3viDU/iwgTktW74Yv41vQN +/Fd3PUr6kf7J9YrQAAMd0VvnrNheNdxUcBKHH49uuKQmt41qsSwJwN1cp2Y7QlrWaE9 J1EEfRCL5Zf9ZT8fIQNUhdglgNe8g5A+wLQJWZJCjZ5o7aJuXn8k9ZxrpW7p+88kGUYN 6ju43q3vd7UNtGMWiH05HF/GvI3oZCvEJh13OK+EpKotnrdq547GduH4UblK9obCqtml hWvel7+b1Nlo9QvSf3ZoJlZyCzFVk8m6q1L9e7wuwt0SzavBD0TvCxpVOnW/y2AsiiIw nOfA== 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=63yqHKcz/YciQMB3SOjxqpxEA5JnLyjCcasJIH1PjTs=; b=ouE1fKt0r39wx3ZbXLnhTCu6Ld905KuGFX5mIfCq6qN54L4DKJaLdSq7TY6UnFgBcs uzr2TEoMYahhMp2kMrl0skl+V8tHvP+uMmhIgqU0/Bxg2FHWUuSx5REcQZPqExK3LPTs 8V6qEK/4yror6ynCa2LOxcSqLm2C5IQZToOeFQr+FrHDCsCts6AERX7WxEHAWE+JO5Fx qdLvVtlYY+/6Eu1UEsXByVWMiRegooTAUUkezuwMP2wplm/4av4Nq6YNpCQJnLvw/vXg pxSOgRyFzS5QTmOi7pbAhwJO+Ap3rQrwLOho8Ir4ON7NfoXvc1p5j+yGXym++4Oc+8KC 6I6Q== 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 w66si15850661pfj.144.2018.04.25.00.04.06; Wed, 25 Apr 2018 00:04:20 -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 S1751439AbeDYHCf (ORCPT + 99 others); Wed, 25 Apr 2018 03:02:35 -0400 Received: from bert.emutex.com ([91.103.1.109]:54629 "EHLO bert.emutex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbeDYHCc (ORCPT ); Wed, 25 Apr 2018 03:02:32 -0400 Received: from [92.51.199.138] (helo=statler.emutex.com) by bert.emutex.com with esmtp (Exim 4.84) (envelope-from ) id 1fBESK-0000or-U0; Wed, 25 Apr 2018 08:03:09 +0100 Received: from 182.red-79-157-43.dynamicip.rima-tde.net ([79.157.43.182] helo=localhost) by statler.emutex.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84) (envelope-from ) id 1fBERg-0007Lg-AI; Wed, 25 Apr 2018 08:02:28 +0100 Date: Wed, 25 Apr 2018 08:02:27 +0100 From: Javier Arteaga To: Pavel Machek Cc: Jacek Anaszewski , Dan O'Donovan , Andy Shevchenko , Mika Westerberg , Heikki Krogerus , Lee Jones , 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: <20180425070227.exixjo64spvt36vo@localhost> References: <20180421085009.28773-1-javier@emutex.com> <20180421085009.28773-3-javier@emutex.com> <20180425064133.GC5352@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180425064133.GC5352@amd> 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 Pavel, On Wed, Apr 25, 2018 at 08:41:33AM +0200, Pavel Machek wrote: > On Sat 2018-04-21 09:50:08, Javier Arteaga wrote: > > Allow userspace to use the on-board LEDs as "upboard::". > > > > Signed-off-by: Javier Arteaga > > > +static enum led_brightness upboard_led_brightness_get(struct led_classdev *cdev) > > +{ > > + struct upboard_led *led = container_of(cdev, struct upboard_led, cdev); > > + int brightness = 0; > > + > > + regmap_field_read(led->field, &brightness); > > + > > + return brightness; > > +}; > > I'm slightly confused here. Is each led controlled by single bit? [...] 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 Pavel, On Wed, Apr 25, 2018 at 08:41:33AM +0200, Pavel Machek wrote: > On Sat 2018-04-21 09:50:08, Javier Arteaga wrote: > > Allow userspace to use the on-board LEDs as "upboard::". > > > > Signed-off-by: Javier Arteaga > > > +static enum led_brightness upboard_led_brightness_get(struct led_classdev *cdev) > > +{ > > + struct upboard_led *led = container_of(cdev, struct upboard_led, cdev); > > + int brightness = 0; > > + > > + regmap_field_read(led->field, &brightness); > > + > > + return brightness; > > +}; > > I'm slightly confused here. Is each led controlled by single bit? Yes. Each regmap field is one bit wide. > What is going on with ";" at end of function? We don't do that. Huh, I totally missed this. It's all throughout the patchset too, and it's going away in v2 of course. > If it is single bit, max_brightness should be one, and != LED_OFF test > should not be needed. Got it. Will do for v2. Thanks for your time!