]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: tas2562: Fix default digital volume
authorMark Brown <broonie@kernel.org>
Wed, 15 Jul 2026 20:18:11 +0000 (21:18 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 19 Jul 2026 21:03:24 +0000 (22:03 +0100)
The tas2562 digital volume is spread over four registers and is implemented
as lookups into a table so the driver stores the value for the userspace
control in the driver data. This defaults to 0 due to kzalloc() but the
register default is 0x40400000 which maps onto something a bit over the
largest value defined in the lookup table. While it's not an exact match
update the default to the largest value, avoiding user surprise due to a
sudden change on first write.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260715-asoc-tas2562-put-retval-v1-3-97bf467c924e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2562.c

index d3d0aaa0f60788d134700b14a76887c6f57230c4..e5fba2195a2444c449f234712ea92982d3dae47c 100644 (file)
@@ -739,6 +739,8 @@ static int tas2562_probe(struct i2c_client *client)
        data->client = client;
        data->dev = &client->dev;
        data->model_id = (uintptr_t)i2c_get_match_data(client);
+       /* Register default is 0x40400000, this is closest */
+       data->volume_lvl = (ARRAY_SIZE(float_vol_db_lookup) - 1) * 2;
 
        tas2562_parse_dt(data);