Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp683736pxb; Wed, 29 Sep 2021 07:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0Qp/X8wqeJvLM3nZrPiCJTmKaWScar+7e3Onvu9shOgEBbTiOI03Wt+hf2P8oVeBlietA X-Received: by 2002:a50:c949:: with SMTP id p9mr286451edh.326.1632926276433; Wed, 29 Sep 2021 07:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632926276; cv=none; d=google.com; s=arc-20160816; b=pHYACW8NH+Hh/ycm2YG1YcR3TjlxRYT01hla4q3zulSNMK+Bx7sAh/a8orH2YGEOGU mtc/qfipBBYr3YEhGyFJj6shAIHCkMZIVsESmep40WMps18FytyifU5xoWiUDwZIE+Gg TPllE5BZcacpS1XwaCdd3KUo/9l0sQT0nYfNC90J6nllgcT2GMHWI8yFqESNzenswvVk tlyN9cDW44byZ9l0PG7Ljpn/Hs1ajhgLyTaXHtTngZuE4vJK8KPZnDeRFuOVfVVHRStl 6R6rofGJwS1gTHFQsdO3hX76TgjzqrYH1eFLVrohmwGSsm/HphKcML8i6ioyVDmphulq rZMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :message-id:user-agent:references:in-reply-to:reply-to:subject:cc:to :from:date:mime-version; bh=ieiXxxcZitMZ8q26RVQpfXt3rO+guHeObCWEm/kOKtM=; b=j8wbZXVXbpNSbzt6DI8ULiAJ3O5B6rTbdXGrRMWhz7i38lWR7Jd3qNuANDX0MaFCrJ FwpG2nYj8vpuE9Grg1C1wZM69OoznmBWvj6FVY5Ed3cte0RO95hG0uoNvuUcO9bcJHt5 2oyBvgcatv2PR4xXTm/DlTtgta0NCU1WPms9xlErkVqXfwAQJLYywjz5BLNBRQq7H5DS /OOgs6ImaUCXxRjiM/BWHFhkd5lZFYWrYZNq+GvLEa6FNEalLK7CuCtuhk5V4ed0gTPQ 1oav8AJ+rdn8YnlqukX6dOuG5b7sJTllJT+14zayRIFyTI1/N5h9bhJb5fUWGVArQhTq uanw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si40011ejs.28.2021.09.29.07.37.25; Wed, 29 Sep 2021 07:37:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344071AbhI2OWu (ORCPT + 99 others); Wed, 29 Sep 2021 10:22:50 -0400 Received: from protonic.xs4all.nl ([83.163.252.89]:33546 "EHLO protonic.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244206AbhI2OWu (ORCPT ); Wed, 29 Sep 2021 10:22:50 -0400 Received: from fiber.protonic.nl (edge2.prtnl [192.168.1.170]) by sparta.prtnl (Postfix) with ESMTP id 0ED0144A024E; Wed, 29 Sep 2021 16:21:07 +0200 (CEST) MIME-Version: 1.0 Date: Wed, 29 Sep 2021 16:21:07 +0200 From: Robin van der Gracht To: Geert Uytterhoeven Cc: Miguel Ojeda , Rob Herring , Paul Burton , Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 09/19] auxdisplay: ht16k33: Connect backlight to fbdev Reply-To: robin@protonic.nl In-Reply-To: <20210914143835.511051-10-geert@linux-m68k.org> References: <20210914143835.511051-1-geert@linux-m68k.org> <20210914143835.511051-10-geert@linux-m68k.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <50740100a1062b981948e1773574928a@protonic.nl> X-Sender: robin@protonic.nl Organization: Protonic Holland Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Robin van der Gracht On 2021-09-14 16:38, Geert Uytterhoeven wrote: > Currently /sys/class/graphics/fb0/bl_curve is not accessible (-ENODEV), > as the driver does not connect the backlight to the frame buffer device. > Fix this moving backlight initialization up, and filling in > fb_info.bl_dev. > > Fixes: 8992da44c6805d53 ("auxdisplay: ht16k33: Driver for LED controller") > Signed-off-by: Geert Uytterhoeven > --- > v6: > - No changes, > > v5: > - No changes, > > v4: > - No changes, > > v3: > - No changes, > > v2: > - New. > --- > drivers/auxdisplay/ht16k33.c | 56 ++++++++++++++++++------------------ > 1 file changed, 28 insertions(+), 28 deletions(-) > > diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c > index 1e69cc6d21a0dca2..2b630e194570f6e5 100644 > --- a/drivers/auxdisplay/ht16k33.c > +++ b/drivers/auxdisplay/ht16k33.c > @@ -413,6 +413,33 @@ static int ht16k33_probe(struct i2c_client *client, > if (err) > return err; > > + /* Backlight */ > + memset(&bl_props, 0, sizeof(struct backlight_properties)); > + bl_props.type = BACKLIGHT_RAW; > + bl_props.max_brightness = MAX_BRIGHTNESS; > + > + bl = devm_backlight_device_register(&client->dev, DRIVER_NAME"-bl", > + &client->dev, priv, > + &ht16k33_bl_ops, &bl_props); > + if (IS_ERR(bl)) { > + dev_err(&client->dev, "failed to register backlight\n"); > + return PTR_ERR(bl); > + } > + > + err = of_property_read_u32(node, "default-brightness-level", > + &dft_brightness); > + if (err) { > + dft_brightness = MAX_BRIGHTNESS; > + } else if (dft_brightness > MAX_BRIGHTNESS) { > + dev_warn(&client->dev, > + "invalid default brightness level: %u, using %u\n", > + dft_brightness, MAX_BRIGHTNESS); > + dft_brightness = MAX_BRIGHTNESS; > + } > + > + bl->props.brightness = dft_brightness; > + ht16k33_bl_update_status(bl); > + > /* Framebuffer (2 bytes per column) */ > BUILD_BUG_ON(PAGE_SIZE < HT16K33_FB_SIZE); > fbdev->buffer = (unsigned char *) get_zeroed_page(GFP_KERNEL); > @@ -445,6 +472,7 @@ static int ht16k33_probe(struct i2c_client *client, > fbdev->info->screen_size = HT16K33_FB_SIZE; > fbdev->info->fix = ht16k33_fb_fix; > fbdev->info->var = ht16k33_fb_var; > + fbdev->info->bl_dev = bl; > fbdev->info->pseudo_palette = NULL; > fbdev->info->flags = FBINFO_FLAG_DEFAULT; > fbdev->info->par = priv; > @@ -460,34 +488,6 @@ static int ht16k33_probe(struct i2c_client *client, > goto err_fbdev_unregister; > } > > - /* Backlight */ > - memset(&bl_props, 0, sizeof(struct backlight_properties)); > - bl_props.type = BACKLIGHT_RAW; > - bl_props.max_brightness = MAX_BRIGHTNESS; > - > - bl = devm_backlight_device_register(&client->dev, DRIVER_NAME"-bl", > - &client->dev, priv, > - &ht16k33_bl_ops, &bl_props); > - if (IS_ERR(bl)) { > - dev_err(&client->dev, "failed to register backlight\n"); > - err = PTR_ERR(bl); > - goto err_fbdev_unregister; > - } > - > - err = of_property_read_u32(node, "default-brightness-level", > - &dft_brightness); > - if (err) { > - dft_brightness = MAX_BRIGHTNESS; > - } else if (dft_brightness > MAX_BRIGHTNESS) { > - dev_warn(&client->dev, > - "invalid default brightness level: %u, using %u\n", > - dft_brightness, MAX_BRIGHTNESS); > - dft_brightness = MAX_BRIGHTNESS; > - } > - > - bl->props.brightness = dft_brightness; > - ht16k33_bl_update_status(bl); > - > ht16k33_fb_queue(priv); > return 0;