Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2773613rwd; Mon, 29 May 2023 00:07:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Uq2SS1KXYw/uQHqcb1DWRRwDxiFaXLKtOHTTTQDprzFmvgK0nBmIzr6jK4OcO2MRElph5 X-Received: by 2002:a17:90a:cf04:b0:250:3bc3:2b09 with SMTP id h4-20020a17090acf0400b002503bc32b09mr10768634pju.12.1685344027603; Mon, 29 May 2023 00:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685344027; cv=none; d=google.com; s=arc-20160816; b=Wl1ZaTWYs1MecXvDFugnz+Pr4GZf1vn7xtzMAhtnCBvYPoJ8/OaNMtESUiYhPt2DVy OEKtVXmrOlz1ribKVKukETSoM51X0kXHn8oVkNK1xkHRkvYUaKdNIlFnfN9/hJ7Xuz+H weuj3MvGV7MidO8tIuhxSJHORPyAp7uO6r1DrhFymiVOPu9GIV7coa6W4Ah6Roafr8Pi X8Iqymp6cnh6A2wrrdsEs/RdkeLxtG+R1wPxW0bPrfwxLCiT4zcCyg0pX5IpnJkLp5HS 9R09AsEAZxaQtBYaBJ/RFk/seYykh1/2llqnYyXllLt2Q/CC7nxzuReSUUHNwwbaxDJf criA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=cJB5+P4xgPilKMJQyTk3eAPDV8GpHyt2fP+7h44nDNs=; b=e7NLAXYheY/pcBQDzUWJLI7kzYqwjYmn6VC0xWkzCaLsEy26xbjdWL7qRjbd/pLZIc CfM+3WySuPJG34gn6HdxQk0djn/IKjjaJ243sMHkY1Q2CTf0yRwyuNeDdxpcZWEigTL3 dcnLMLQmysj2gZsLeiJh/MpIo4wJPkmvzaxjlY5Xu90jrTil2ZfaJvW0BjxTWbovxc68 JX+qTszfmPKra9Z/wwoFWJlnLhmr39ik2hmG2nWewACZE96hiIWy2nQZE3GGP+MUQAR0 FMAaimO48ALBmoZSjogVOSJ8cWPohJ3PWbvaaAtGsm/Q15xtvF4x2KSIO74keCm72M9U n56g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shruggie-ro.20221208.gappssmtp.com header.s=20221208 header.b=FGhKiz8d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a17090aa00700b00250d2935d98si7944391pjp.3.2023.05.29.00.06.55; Mon, 29 May 2023 00:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shruggie-ro.20221208.gappssmtp.com header.s=20221208 header.b=FGhKiz8d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjE2HCl (ORCPT + 99 others); Mon, 29 May 2023 03:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjE2HCj (ORCPT ); Mon, 29 May 2023 03:02:39 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C039EAF for ; Mon, 29 May 2023 00:02:34 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f3bb395e69so3285589e87.2 for ; Mon, 29 May 2023 00:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shruggie-ro.20221208.gappssmtp.com; s=20221208; t=1685343753; x=1687935753; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cJB5+P4xgPilKMJQyTk3eAPDV8GpHyt2fP+7h44nDNs=; b=FGhKiz8dBWwr9/+R+reQipeYxNB1gcmYsJ7bZbWgP8vpD+0Js4lgYwersF0bhlBFfx AoBv3t60BEjDsQ+//F6gNfJL7TKCuKtbj0JZY91qkazqTzob+IFBzGrNq5fvEJgkX67W y+qzGQyohlsogF2BSjAWqXcmUTFY4fEXNADyl2U7gc1c+xNSymu2Tu9tPcquM7DB6a6L riSRw20OAF0VAmq08GHr9Kr2aUzUiKiaI/5QFnc7BO7OqnJgspihpwvULSi1tTJvEBf/ f24Gl6irXXG2dDmzNTQUJOdBeI0zsO6HQViONoOYQkZZs1g9+txWx4YM53xWgvRg43Os Z0xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685343753; x=1687935753; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cJB5+P4xgPilKMJQyTk3eAPDV8GpHyt2fP+7h44nDNs=; b=VoQCJwyJhlgU3lA1AADkKCpSBoXJwGlXQStuXrDN76tCGmpKYKelt0o+qdBEaXgFeG 8DDrjSWKnLOhlHXHHkd5XljClj957axQ9qFoFjNSsBRXsbrI63ogFr/D4ZrXzUS2OnJF m8f6l5lXmYSgTmkoyDABt9P57pOlXPdMoDkY10RjBY5ETh1rPAyHPFdQcs13JiHOu6hS B1t113aZ5iqP56NC/Mxl/HE4+/dyNOe5NdzKIGrA1VZZgCdStw77O9TtzDatNDnPuhR3 j+4MBmcICwIpvv96zENZ0Gx1KAsH3mzUCw8pgU6PIuJ6DnzqH1JOqQsHpBUxJ13cBIPT z9yA== X-Gm-Message-State: AC+VfDzwt74wwxz0YrWp+97B6JX8TdqBknGTjAtDFM7MEQz+72fP+8v5 EWabsRF0qoTLt+wN42Ju91xEWdSuhWYPJu3s5pmvXQ== X-Received: by 2002:a05:6512:40b:b0:4f4:d710:12d4 with SMTP id u11-20020a056512040b00b004f4d71012d4mr3426221lfk.17.1685343752776; Mon, 29 May 2023 00:02:32 -0700 (PDT) MIME-Version: 1.0 References: <20230519200520.10657-1-alex@shruggie.ro> In-Reply-To: From: Alexandru Ardelean Date: Mon, 29 May 2023 10:02:21 +0300 Message-ID: Subject: Re: [PATCH 1/2] backlight: gpio_backlight: add new property default-brightness-level To: Philippe CORNU Cc: dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, pavel@ucw.cz, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, deller@gmx.de, Yannick Fertre Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2023 at 3:04=E2=80=AFPM Philippe CORNU wrote: > > > On 5/19/23 22:05, Alexandru Ardelean wrote: > > From: Yannick Fertre > > > > Add new property to set a brightness by default at probe. > > > > Reviewed-by: Philippe CORNU > > Hi Alexandru, > > Many thanks for your patch. > > You have sent a patch originally pushed on the STMicroelectronics github > as mentioned in your commit message (no problem with that :-). But, the > "Reviewed-by" inside this github patch is linked to our gerrit STM > internal server so you can not use it directly for mainlining this patch. > > So please, re-send your this patch without my "Reviewed-by". ack will do > > Many thanks > Philippe :-) > > > > Signed-off-by: Yannick Fertre > > Signed-off-by: Alexandru Ardelean > > --- > > > > Link to original patch: > > https://github.com/STMicroelectronics/linux/commit/c4067d7bd883c6fa1= 4ffd49892c4ce663cdafe98 > > > > drivers/video/backlight/gpio_backlight.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/b= acklight/gpio_backlight.c > > index 6f78d928f054..d3fa3a8bef4d 100644 > > --- a/drivers/video/backlight/gpio_backlight.c > > +++ b/drivers/video/backlight/gpio_backlight.c > > @@ -53,6 +53,7 @@ static int gpio_backlight_probe(struct platform_devic= e *pdev) > > struct backlight_device *bl; > > struct gpio_backlight *gbl; > > int ret, init_brightness, def_value; > > + u32 value; > > > > gbl =3D devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); > > if (gbl =3D=3D NULL) > > @@ -93,7 +94,11 @@ static int gpio_backlight_probe(struct platform_devi= ce *pdev) > > else > > bl->props.power =3D FB_BLANK_UNBLANK; > > > > - bl->props.brightness =3D 1; > > + ret =3D device_property_read_u32(dev, "default-brightness-level",= &value); > > + if (!ret && value <=3D props.max_brightness) > > + bl->props.brightness =3D value; > > + else > > + bl->props.brightness =3D 1; > > > > init_brightness =3D backlight_get_brightness(bl); > > ret =3D gpiod_direction_output(gbl->gpiod, init_brightness);