net: rfkill: gpio: allow booting in blocked state
authorCatalin Popescu <catalin.popescu@leica-geosystems.com>
Thu, 16 Jan 2025 08:47:02 +0000 (09:47 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Feb 2025 10:55:55 +0000 (11:55 +0100)
By default, rfkill state is unblocked and this behavior is not
configurable. Add support for booting in blocked state based on the
presence of a devicetree property.

Signed-off-by: Catalin Popescu <catalin.popescu@leica-geosystems.com>
Link: https://patch.msgid.link/20250116084702.3473176-2-catalin.popescu@leica-geosystems.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/rfkill/rfkill-gpio.c

index 9fa019e..41e657e 100644 (file)
@@ -162,6 +162,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
        if (!rfkill->rfkill_dev)
                return -ENOMEM;
 
+       if (device_property_present(&pdev->dev, "default-blocked"))
+               rfkill_init_sw_state(rfkill->rfkill_dev, true);
+
        ret = rfkill_register(rfkill->rfkill_dev);
        if (ret < 0)
                goto err_destroy;