[PATCH v2 2/4] iio: proximity: aw96103: use the default configuration without firmware

From: Arnav Kapoor

Date: Sat Nov 28 2026 - 06:52:10 EST


aw96103_cfg_update() falls back to the built-in register defaults when
the aw96103_0.bin configuration file cannot be used, but not when it is
missing: then it only logs "No firmware." and returns. In that case the
chip is never configured, the channel scan and the interrupts are never
enabled (aw96103_channel_scan_start()), and no channel is marked as
used, so the device registers but never reports an event.

Load the defaults when the file is missing as well, as the comment in
aw96103_cfg_update() describes.

Fixes: 07b241262dca ("iio: proximity: aw96103: Add support for aw96103/aw96105 proximity sensor")
Signed-off-by: Arnav Kapoor <kapoorarnav43@xxxxxxxxx>
---
drivers/iio/proximity/aw96103.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/proximity/aw96103.c b/drivers/iio/proximity/aw96103.c
index 483b3bf18d19..4f205d6ea030 100644
--- a/drivers/iio/proximity/aw96103.c
+++ b/drivers/iio/proximity/aw96103.c
@@ -589,12 +589,13 @@ static void aw96103_cfg_update(const struct firmware *fw, void *data)
struct aw96103 *aw96103 = data;
int ret, i;

- if (!fw || !fw->data) {
- dev_err(aw96103->dev, "No firmware.\n");
- return;
+ if (fw && fw->data) {
+ ret = aw96103_cfg_all_loaded(fw, aw96103);
+ } else {
+ release_firmware(fw);
+ dev_warn(aw96103->dev, "No firmware, using the default configuration\n");
+ ret = -ENOENT;
}
-
- ret = aw96103_cfg_all_loaded(fw, aw96103);
/*
* If loading the register configuration file fails,
* load the default register configuration in the driver to
--
2.53.0