]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: proximity: hx9023s: support firmware-name property
authorYasin Lee <yasin.lee.x@gmail.com>
Fri, 13 Feb 2026 15:14:46 +0000 (23:14 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 08:24:22 +0000 (08:24 +0000)
Add an optional firmware-name property to specify the firmware file.
If not provided, the driver falls back to the default firmware name.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/hx9023s.c

index 2918dfc0df547ceaf82e9c9f2a2c532444038a23..5fa3f4b179dd90740c26872e81debfff82432b8b 100644 (file)
@@ -1086,6 +1086,7 @@ static int hx9023s_probe(struct i2c_client *client)
        struct device *dev = &client->dev;
        struct iio_dev *indio_dev;
        struct hx9023s_data *data;
+       const char *fw_name;
        int ret;
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
@@ -1123,7 +1124,9 @@ static int hx9023s_probe(struct i2c_client *client)
        if (ret)
                return dev_err_probe(dev, ret, "channel config failed\n");
 
-       ret = request_firmware_nowait(THIS_MODULE, true, "hx9023s.bin", dev,
+       fw_name = "hx9023s.bin";
+       device_property_read_string(dev, "firmware-name", &fw_name);
+       ret = request_firmware_nowait(THIS_MODULE, true, fw_name, dev,
                                      GFP_KERNEL, data, hx9023s_cfg_update);
        if (ret)
                return dev_err_probe(dev, ret, "reg config failed\n");