From nobody Fri Jun 19 19:08:01 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85B35C433EF for ; Wed, 30 Mar 2022 07:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243985AbiC3Hxj (ORCPT ); Wed, 30 Mar 2022 03:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243970AbiC3HxY (ORCPT ); Wed, 30 Mar 2022 03:53:24 -0400 Received: from smtp15.bhosted.nl (smtp15.bhosted.nl [IPv6:2a02:9e0:8000::26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56154CF6 for ; Wed, 30 Mar 2022 00:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonic.nl; s=202111; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=S5Xr/+A+9DZoWIfSpuQs3qtL0ru3AVsUPP4NG1N8m/A=; b=mXoeRDuefGRCYjdSTUs57UnQARsMi+Oh/NK31QtBmITDl8C/y1FjMkziSdEf0dLt98dLnNs124nqT u+7w0gSGvKv3aMs7ZYT8O0msTck7nj3G1QvuoK90wQ+ZYbOR+i82BaEA1AyGfkbuZx3XDNbROPS/Mv 8ZDzav316xKcHocUv08bzWiFcI1yZcDzPa8G5uWui06UV/bYlFhfqp8ZB5hULnUN8K21aIqQDaHYv5 4TGiwV8qIgSNRSgqpGCvWFOfMoZDDgRmBJVWFIESkgPab6NMYvXMz+swpqWRT4QkJhTDeUnh1JljV3 evxMD0fpGMDGyOzvEsLnaw96unP0ryA== X-MSG-ID: f3f28322-affb-11ec-b450-0050569d3a82 From: David Jander To: Robin van der Gracht , Miguel Ojeda Cc: Rob Herring , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Jander Subject: [PATCH 1/2] drivers: auxdisplay: ht16k33.c: Add option to refuse claiming primary fb Date: Wed, 30 Mar 2022 09:34:39 +0200 Message-Id: <20220330073440.3986724-2-david@protonic.nl> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220330073440.3986724-1-david@protonic.nl> References: <20220330073440.3986724-1-david@protonic.nl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In the case there is also a display with a frame-buffer device, the probe order of the auxdisplay fb and the main fb is not predictable, possibly leading to the situation where the holtek auxdisplay becomes /dev/fb0. This is problematic because there is currently no way to automatically rename these devices, and too much user-space software that assumes fb0 to be the main display. In such a situation, adding "holtek,refuse-primary-fb" to the DT, the auxdisplay driver returns -EPROBE_DEFER to wait for the primary fb device to get probed first. Signed-off-by: David Jander --- drivers/auxdisplay/ht16k33.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index 4fab3b2c7023..e8e0c644f2e4 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -581,12 +581,20 @@ static int ht16k33_keypad_probe(struct i2c_client *cl= ient, return input_register_device(keypad->dev); } =20 +extern int num_registered_fb; + static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *pr= iv, uint32_t brightness) { struct ht16k33_fbdev *fbdev =3D &priv->fbdev; struct backlight_device *bl =3D NULL; int err; + bool not_primary; + + not_primary =3D device_property_read_bool(dev, "holtek,refuse-primary-fb"= ); + + if (!num_registered_fb && not_primary) + return -EPROBE_DEFER; =20 if (priv->led.dev) { err =3D ht16k33_brightness_set(priv, brightness); --=20 2.32.0 From nobody Fri Jun 19 19:08:01 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92459C433F5 for ; Wed, 30 Mar 2022 07:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244010AbiC3Hxo (ORCPT ); Wed, 30 Mar 2022 03:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243969AbiC3HxY (ORCPT ); Wed, 30 Mar 2022 03:53:24 -0400 Received: from smtp15.bhosted.nl (smtp15.bhosted.nl [IPv6:2a02:9e0:8000::26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56118CD8 for ; Wed, 30 Mar 2022 00:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonic.nl; s=202111; h=content-transfer-encoding:mime-version:references:in-reply-to:message-id:date: subject:cc:to:from:from; bh=IZkMiRw9WhxMQ9/LVXwDXkE/Ak6TV7yqUEA6+QEqUuk=; b=dPgdouJivxKjAWUeUPpVm3mLyNQVXtMpGsuLMHJSAZUT5VsQXpUqryN5xWss/F/ztZavFRJ76IUnL dsNE63bB8mk1+EgFaNvMTEqU4nDIP5g3UEKfRgkygInIbssczmbk1Uo6A8/yeqvZBapJ1k8vKP1DDn yCjTkEHtN9xOupsRtsKE/+3/JRkZaO33rUT6vGX1/T5ysL6TH+d1jvP96GvyoHDQOfV4O0kr2jFYqr oNIKKZhdkm9PHD0s3IsenWSF6ReBIiuqIAGFmWxAuJeOg42Gx7Iogrv6RWbl2XKyWOx1RcTLbgbN96 R5oebrOce5zCednS+ZSRFhTM55NlOWA== X-MSG-ID: f46e147e-affb-11ec-b450-0050569d3a82 From: David Jander To: Robin van der Gracht , Miguel Ojeda Cc: Rob Herring , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Jander Subject: [PATCH 2/2] dt-bindings: auxdisplay: holtek,ht16k33.yaml: Add holtek,refuse-primary-fb Date: Wed, 30 Mar 2022 09:34:40 +0200 Message-Id: <20220330073440.3986724-3-david@protonic.nl> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220330073440.3986724-1-david@protonic.nl> References: <20220330073440.3986724-1-david@protonic.nl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Document the DT property that will cause the holtek auxdisplay driver to back off if it detects that it is the first driver to probe a framebuffer device. Signed-off-by: David Jander --- .../devicetree/bindings/auxdisplay/holtek,ht16k33.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.ya= ml b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml index fc4873deb76f..4de32c3e26ce 100644 --- a/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml +++ b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml @@ -53,6 +53,9 @@ properties: $ref: /schemas/leds/common.yaml# unevaluatedProperties: false =20 + holtek,refuse-primary-fb: + description: Refuse to claim the first framebuffer device + required: - compatible - reg --=20 2.32.0