Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2648955ybt; Mon, 22 Jun 2020 03:44:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoTl6B1KoM6KdIkxQVJPs6WI4EfHIO/SOZdy6W2C/BBoL8tM9yJuu0jmWhi+YTDKOmfoHS X-Received: by 2002:a17:906:c102:: with SMTP id do2mr14827640ejc.126.1592822668919; Mon, 22 Jun 2020 03:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592822668; cv=none; d=google.com; s=arc-20160816; b=pBWq3UX6is5ZIvlAec8BN+ez3SvA8Xs67vqaf1fK2z4Rrmbcto3HAENn4GruHzDe35 DnVxzAGbyfg3JLO4ONUsNGT87FCTzjN0CX1Y57edeIh4+gEth8D57ImalnBLez0OA2vy iwAxCBPjjFw7VNhaXE2ZaXwZGTGitp2PTo+R6aS18hoAvzWxoMOAKR1me7Vhc/av7hgf GluaYOdHq+NNR65CjvJ8EvjXk7rnIg+45jyCy/EVgQYwjoRwu5eFDOoOGRiBt1GfQxFm wj46VyNqkE7FExN/CLkOdth+d2BRrL4s/hSCtvS2OzlA1ze7eaywpWOuDY1K2uhICpN8 42Jw== 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 :dkim-signature; bh=ppPSmD0W4LKyxlniJhYfTmLmk2R68Qbvb6wTB52e/f0=; b=WCoQP3+we6NMQZMwXMaFTe6w4ZXmC7vVg3RlL4dZtp13ny/bxqlp4b0Z0itfIeMUZ7 35gPc8cpvU6/y2mvCAOQKvfzO7fxV3RDUpU6NYlvteH+h/TDvexZgCJh6fw8GUrxoPjQ TfV5/gxoLMs52sCChry8VB3ZLPSBE/5wYSvnQDvH+YlGZwThr4W9JdEqx6y7+zxVZrNB 4bpmLoEDeU0s++4Iq21DFnd8uWe5e6nrG+4CdTIJe5ktX4SMHnAH71XcGPLs1kjsoqTY Dp4LEvMa05M4a5YVNhwWwoR73Lft5qNlUA4iZUswyqPm0MtV53GEbPgGTYjQI7BTNiwl jBHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ItMGHHfB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si9112889ejg.418.2020.06.22.03.44.05; Mon, 22 Jun 2020 03:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ItMGHHfB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgFVKjp (ORCPT + 99 others); Mon, 22 Jun 2020 06:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbgFVKjo (ORCPT ); Mon, 22 Jun 2020 06:39:44 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C59C061794 for ; Mon, 22 Jun 2020 03:39:43 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id g18so7072015wrm.2 for ; Mon, 22 Jun 2020 03:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ppPSmD0W4LKyxlniJhYfTmLmk2R68Qbvb6wTB52e/f0=; b=ItMGHHfBn6t+/6rQdOvInje8umTE9Lh/8MQrHN1kBQmODoVSN1eOFW8HFLDcqWjRfz iW7RlpQQYT2m0DQT2L8tJ3Gbnm4FrrA0hZNu5go4Lzxd+kPhaBqaTFY0IdbGKfCHN12r YP6adtx7pTBj07Wd8/4VSZJYaO0d+iQIEliTdTqNbuLF6u1CILqsrtIFVQrBPp+mQWnZ 77UOT6MgZnEhhklMWr44xbkquBvDL8ge3ILunTUUmfMpAACxHi/NSbC/poDK3u/A/9pa Bre5+xqACXaastiIzh4nSPQCMcFTumjfW7jnpw3XlMI2+YyVlzQ0krOo7HPcjQQ3bIh9 S48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ppPSmD0W4LKyxlniJhYfTmLmk2R68Qbvb6wTB52e/f0=; b=J5rtddrm62P0FJCARGXAivBI0hIqL6S/AasYIX1gdNCWgnCUL5UiVgdg8IhdV+FPX+ cZaONmz9Mf9HhwM/ZbKR6W5CNKo4hZD8nm02Rq/hNWpcZ5GzAOfy4Yf1TZQ/gDaktZ0m YgLJXgmn+/8zUctZN/hTdS947Z03AdwzrwRPTKSKt8gfR7DqrqTHUhOdx1guOa3XEeYr nDZTjb8lsKS6Z45XoF65yMzgJOl/kZkfQ9mkprY78TM7Vt7okWLe5/7qhlaX3PYRNjM7 XjsxDRCXTodpuD0FdqfCuHtNH9vJzHgG5CpeLnxE/W+X5bPnj0AZ6MqqVeE9pkstd/Dz czng== X-Gm-Message-State: AOAM530Wnhm2teM0/r4vXBSij0Dgqy7yGu9RMy77H+Cv9GJsYcOWOq29 RNgiUd86Xmf3nLMxqjF5z0KSTg== X-Received: by 2002:adf:ef4d:: with SMTP id c13mr6752284wrp.315.1592822382351; Mon, 22 Jun 2020 03:39:42 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id e12sm17422241wro.52.2020.06.22.03.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 03:39:41 -0700 (PDT) Date: Mon, 22 Jun 2020 11:39:39 +0100 From: Daniel Thompson To: Sam Ravnborg Cc: Rob Herring , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Jingoo Han , Lee Jones , linux-kernel@vger.kernel.org Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema Message-ID: <20200622103939.goqysclrsxps344i@holly.lan> References: <20200618224413.1115849-1-robh@kernel.org> <20200619215341.GA6857@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619215341.GA6857@ravnborg.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19, 2020 at 11:53:41PM +0200, Sam Ravnborg wrote: > Good to have these converted. A few comments in the following. One > comment is for the backlight people as you copied the original text. ... and I've sliced out everything except that in this reply. > On Thu, Jun 18, 2020 at 04:44:13PM -0600, Rob Herring wrote: > > diff --git a/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml > > new file mode 100644 > > index 000000000000..ae50945d2798 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml > > @@ -0,0 +1,58 @@ > > ... > > + > > + default-brightness-level: > > + description: The default brightness level (index into the array defined > > + by the "brightness-levels" property). > > This description does not match my understading. > The description says "index into", but in reality this is a value that > matches somewhere in the range specified by brightness-levels. > So it is not an index. > > Maybe I just read it wrong and the description is fine. But when I read > index the when it says 6 I would look for brightness-levels[6] equals > 128 in the example below. When the brightness-levels array is not present then backlight brightness and led brightness have a 1:1 mapping. In this case the meaning of "default brightness level" is (hopefully) obvious and the parenthetic text does not apply. When the array is present then we have two different scales of brightness and it is important to describe which scale we use for the default brightness. The language about "index into" was adopted to avoid having to introduce extra terminology whilst making it clear that setting the default brightness-level to 128 is invalid (because it is not an acceptable index) and that a value of 6 will result in the LED brightness being set to 128. > And this is not how it is coded. That had me worried for a moment but I think the code and bindings are in agreement. There is some code to map the LED scale (128) to the backlight scale (6) but this used to ensure we supply the correct brightness level to user space when an active backlight is handed over from bootloader to kernel. If a default-brightness-level is provided then the above logic is overridden and the value read from the DT gets placed directly into props.brightness where it will act as in index into the brightness table. Daniel.