Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 2be2d579 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: acpi: remove hard-coded i2c-device name length



Remove hard-codec [16] array size, replace with clearer description and
dependency on ACPI_ID_LEN
No functionality change

Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3c22a73f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ struct snd_soc_acpi_package_context {
	bool data_valid;
};

/* codec name is used in DAIs is i2c-<HID>:00 with HID being 8 chars */
#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)

#if IS_ENABLED(CONFIG_ACPI)
/* translation fron HID to I2C name, needed for DAI codec_name */
const char *snd_soc_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]);
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static struct snd_soc_card bytcht_da7213_card = {
	.num_dapm_routes = ARRAY_SIZE(audio_map),
};

static char codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
static char codec_name[SND_ACPI_I2C_ID_LEN];

static int bytcht_da7213_probe(struct platform_device *pdev)
{
+1 −1
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ static struct snd_soc_card byt_cht_es8316_card = {
	.fully_routed = true,
};

static char codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
static char codec_name[SND_ACPI_I2C_ID_LEN];

static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
{
+1 −1
Original line number Diff line number Diff line
@@ -713,7 +713,7 @@ static struct snd_soc_card byt_rt5640_card = {
	.fully_routed = true,
};

static char byt_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
static char byt_rt5640_codec_aif_name[12]; /*  = "rt5640-aif[1|2]" */
static char byt_rt5640_cpu_dai_name[10]; /*  = "ssp[0|2]-port" */

+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ static struct snd_soc_card byt_rt5651_card = {
	.fully_routed = true,
};

static char byt_rt5651_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];

static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
{
Loading