From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B299C4363D for ; Fri, 2 Oct 2020 20:42:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23AE8206DB for ; Fri, 2 Oct 2020 20:42:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WulWpA1V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725562AbgJBUmP (ORCPT ); Fri, 2 Oct 2020 16:42:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgJBUmP (ORCPT ); Fri, 2 Oct 2020 16:42:15 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D0D3C0613D0 for ; Fri, 2 Oct 2020 13:42:15 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id r24so1223655vsp.8 for ; Fri, 02 Oct 2020 13:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PyTBFVa3qeZA7kgpm5KMRvZPLGIjXaEZxCGTPzBm8AM=; b=WulWpA1VQK5XnHxFm6BjaZBFSyC5nWp45+BE2BA1U+iQCLy45rOVwBwCNohf/ZSV+f qCW7JmmisW/jA113crFSXVFLFwfsCJNRsfn1vbwz2J2aTIvj2fmdlUv9zF/MFFwkPKMK T8aruwThdjnWsBObai0IHqsXB30sj6jxY6QmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PyTBFVa3qeZA7kgpm5KMRvZPLGIjXaEZxCGTPzBm8AM=; b=l//7t0sG7h5N3TK/vzeGAgf8ZwT4L7OB4ITq0xonySnMUn3iB2iE1GgcxwX1aOChSz d97AadkN+oItl/5yd2rngPk/JjRpXAhW9DyijrzDPTbXll+0VqwRIqbeKh/gIXOoehFl V97rS1q4LBWf5pd4RVd8zRLs5LcyUTeot02EQXOYZawBUhBazJgEQuFI69yxxqGmp4mn U7X+OcI/yKH2bT6rAyuvwPkxI1N61x7JlR/F+Ov5Jgg/PULcZ3gwyuFkVuEnkJgJgFsj /CMPAkh32SIaPziZRmx76dYGCKH8ivx86AUTR43ggrD9j1pJ2jME1I/c7q5DgAcI4v0p +NUQ== X-Gm-Message-State: AOAM530E38Qbz7WAvwsdgNXvGAmbncOO8m+jPbT0CK34arMl6Gz0MY2T q3qtwC8AJeu+DDXVxQsrEGwi30EpKjcQbw== X-Google-Smtp-Source: ABdhPJyDVUM/OkL0vD9QjFtvzXue4mHzXTrPvq/gQTrftWsz0/bd5l+0za4hCwYJU0QHFnJUSXYTYw== X-Received: by 2002:a67:ec89:: with SMTP id h9mr2406212vsp.55.1601671334091; Fri, 02 Oct 2020 13:42:14 -0700 (PDT) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com. [209.85.222.45]) by smtp.gmail.com with ESMTPSA id p2sm402248vkp.34.2020.10.02.13.42.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Oct 2020 13:42:12 -0700 (PDT) Received: by mail-ua1-f45.google.com with SMTP id z1so732095uaa.6 for ; Fri, 02 Oct 2020 13:42:12 -0700 (PDT) X-Received: by 2002:ab0:4542:: with SMTP id r60mr2415711uar.90.1601671332224; Fri, 02 Oct 2020 13:42:12 -0700 (PDT) MIME-Version: 1.0 References: <20200930223532.77755-1-bjorn.andersson@linaro.org> <20200930223532.77755-2-bjorn.andersson@linaro.org> In-Reply-To: <20200930223532.77755-2-bjorn.andersson@linaro.org> From: Doug Anderson Date: Fri, 2 Oct 2020 13:42:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: drm/bridge: ti-sn65dsi86: Replace #pwm-cells To: Bjorn Andersson Cc: David Airlie , Daniel Vetter , Rob Herring , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , dri-devel , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, On Wed, Sep 30, 2020 at 3:40 PM Bjorn Andersson wrote: > > While the signal on GPIO4 to drive the backlight controller indeed is > pulse width modulated its purpose is specifically to control the > brightness of a backlight. I'm a bit on the fence about this. I guess you're doing this because it avoids some -EPROBE_DEFER cycles in Linux? It does seem to have a few downsides, though. 1. It means a bit of re-inventing the wheel. It's not a very big wheel, though, I'll give you. ...but it's still something. 2. I'm not sure why you'd want to, but in theory one could use this PWM for some other purposes. It really is just a generic PWM. Your change prevents that. > Drop the #pwm-cells and instead expose a new property to configure the > granularity of the backlight PWM signal. > > Signed-off-by: Bjorn Andersson > --- > .../devicetree/bindings/display/bridge/ti,sn65dsi86.yaml | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > index f8622bd0f61e..e380218b4646 100644 > --- a/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > +++ b/Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml > @@ -66,9 +66,12 @@ properties: > 1-based to match the datasheet. See ../../gpio/gpio.txt for more > information. > > - '#pwm-cells': > - const: 1 > - description: See ../../pwm/pwm.yaml for description of the cell formats. > + ti,backlight-scale: > + description: > + The granularity of brightness for the PWM signal provided on GPIO4, if > + this property is specified. > + minimum: 0 > + maximum: 65535 A few issues here: 1. Maybe call this "num-steps" instead of backlight-scale. That's essentially what it is, right? Saying how many discrete steps you're allowing in your backlight? 2. IMO you need the PWM frequency specified, since it can actually matter. NOTE: once you have the PWM frequency specified, you could imagine automatically figuring out what "num-steps" was. Really you'd want it to be the largest possible value you could achieve with your hardware at the specified frequency. There's no advantage (is there?) of providing fewer steps to the backlight client. 3. Some backlights are specified inverted. It looks like this maps nicely to the bridge chip, which has a bit for it. Probably nice to expose this? Of course, if we were just exposing the PWM directly to Linux we could just use the PWM backlight driver and it'd all magically work. ;-) -Doug