Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6260911imb; Fri, 8 Mar 2019 13:09:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwxkk4z2MwbcTxTIH3QFj685APCg1ikCikqWD/Iwad6NqlmJfnv/xAlFE282ZsdMi2iVdsz X-Received: by 2002:a62:ea10:: with SMTP id t16mr20154491pfh.3.1552079397801; Fri, 08 Mar 2019 13:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552079397; cv=none; d=google.com; s=arc-20160816; b=PjEE2jvH+ZPpJ05u724AfA/hMpJ3tGzKiUoCL50FIyOK2RVT4PG+Xc79Ug8hfT7rj3 1I6m9V7BKIHBBHWssg5eYJa0SLLKbhTYBY/LmflXQGLQoGGN3PY9D6ECof7jgGLSyYP6 wVwsb+HSyl8++gZAMC3ARs9wxZ4ATGPGG3bFOsMAm/QcC3GQTnVoEZLpT3wKomzm+XN5 4KTZ2D8lOVYAZwQ7zKMipKQhxCRsP5aZ+gqMXwuVhqTrA/kwwZF3Na9Tt6iHEq+3JoBG QE5bv/L58zEsKL7M+yMex6n2MyD/49mo17gj11QWKX0qzMvM99ap+5F5L1d0ToVFveF/ UhNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4Qh1XRaqw+fAWwEcEdb5UH0zgHHQZdxQHvWz9n28mR4=; b=SYNaZ6179zXalJmBYC+DCSlMCyBOCdD9Q/V9ptEIBxSLokeol2F983rrZKEJqUVZ75 XABJz32YS3hH9veM9KLP60eleJqmJ6KSYOonqILVuliR/djjq/bzdmTnb4AnevQSeUkO +A/PDvKo+bLH8ZDF2Fmq8g2E5GW+0BjSv4fnht8Ltq3mcZjoTLhpdmWrjIJSV59mzs/x uheT9kvald8svW5qmbXzNXxrfiFHFdFnTBUPV18EwvxTXxajvN0j9j0PGuC2evcOgtwj wNtlTUxce6/2q+edYjJAAG77GwpOJarU8Xt0Ytr2PG9OWd8Ew+BQBzbPalSnWD7i6DpU 6dmA== 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 n10si7105308pgi.95.2019.03.08.13.09.42; Fri, 08 Mar 2019 13:09:57 -0800 (PST) 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 S1726660AbfCHVIp (ORCPT + 99 others); Fri, 8 Mar 2019 16:08:45 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:50459 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726258AbfCHVIp (ORCPT ); Fri, 8 Mar 2019 16:08:45 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 79618801E9; Fri, 8 Mar 2019 22:08:36 +0100 (CET) Date: Fri, 8 Mar 2019 22:08:43 +0100 From: Pavel Machek To: Nick Crews Cc: enric.balletbo@collabora.com, bleung@chromium.org, linux-leds@vger.kernel.org, jacek.anaszewski@gmail.com, linux-kernel@vger.kernel.org, dlaurie@chromium.org, derat@google.com, groeck@google.com, dtor@google.com Subject: Re: [PATCH] platform/chrome: Add Wilco EC keyboard backlight LEDs support Message-ID: <20190308210843.GA16125@amd> References: <20190308203801.57920-1-ncrews@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <20190308203801.57920-1-ncrews@chromium.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2019-03-08 13:38:02, Nick Crews wrote: > This patch is meant to be applied on top of the for-next > branch of the platform/chrome repository, as it uses some of > the code staged there. >=20 > The EC is in charge of controlling the keyboard backlight on > the Wilco platform. We expose a standard LED class device at > /sys/class/leds/wilco::kbd_backlight. This driver is modeled > after the standard Chrome OS keyboard backlight driver at > drivers/platform/chrome/cros_kbd_led_backlight.c Can you make it "platform::kbd_backlight"? We want some consistency there. > Some Wilco devices do not support a keyboard backlight. This > is checked in probe(), and in this case the sysfs entry will > not appear, and everything will behave normally. Good. > When the EC is reset (loses all AC and battery power), it will > restart in some unpredictable state. The brightness on the > keyboard could be anything, and reading the brightness > from the EC is undefined behavior. Therefore, at startup the > brightness should be set, and then everything will work. Really? Undefined behavior?=20 > index e09e4cebe9b4..15b56f5ce090 100644 > --- a/drivers/platform/chrome/wilco_ec/Kconfig > +++ b/drivers/platform/chrome/wilco_ec/Kconfig > @@ -18,3 +18,12 @@ config WILCO_EC_DEBUGFS > manipulation and allow for testing arbitrary commands. This > interface is intended for debug only and will not be present > on production devices. > + > +config WILCO_EC_KBD_BACKLIGHT > + tristate "Enable keyboard led backlight control" Delete "led" or make it "LED". > + depends on WILCO_EC > + help > + If you say Y here, you get support to set the keyboard backlight led Same here. > +#define DRV_NAME "wilco-kbd-backlight" > + > +#define EC_COMMAND_KB_BKLIGHT 0x75 > +#define KBBL_MSG_SIZE 16 > +/* The EC can set the backlight brightness in several different modes. > +The mode we care about is PWM mode, where we separately supply a > +literal percentage to set the brightness to. We need to set the proper > +KBBL_PWM_MODE flag in the KBBL_MODE_INDEX-th byte in the message, and > +then supply the percentage within the KBBL_BRIGHTNESS_INDEX-th byte > +within the message. When we read the brightness, the percentage is > +returned in this same byte location. */ Please use comment style specified in CodingStyle. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlyC2dsACgkQMOfwapXb+vLqDwCfWEk3QW//F3XG6WrdOqGyEUt3 uvAAoIittL7JdDnqPtKLU43LUVzDGBsh =2nf1 -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH--