ASoC: twl4030: make read-only array ramp_base static const

Don't populate the read-only array ramp_base on the stack but
instead make it static const. Also makes the object code a
little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221018152928.942186-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Colin Ian King 2022-10-18 16:29:28 +01:00 committed by Mark Brown
parent bdde278a77
commit 67860d2a8e
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 4 additions and 2 deletions

View File

@ -700,8 +700,10 @@ static void headset_ramp(struct snd_soc_component *component, int ramp)
struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
struct twl4030_board_params *board_params = twl4030->board_params;
/* Base values for ramp delay calculation: 2^19 - 2^26 */
unsigned int ramp_base[] = {524288, 1048576, 2097152, 4194304,
8388608, 16777216, 33554432, 67108864};
static const unsigned int ramp_base[] = {
524288, 1048576, 2097152, 4194304,
8388608, 16777216, 33554432, 67108864
};
unsigned int delay;
hs_gain = twl4030_read(component, TWL4030_REG_HS_GAIN_SET);