aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2018-01-11 14:52:09 -0500
committerMark Brown <broonie@kernel.org>2018-01-12 16:05:41 -0500
commit2be2d57986431626e905ee344086affa44c5bb9b (patch)
tree596f8387eb5df595adff10c7f41333002a5f21ab
parent3c22a73fb87366851dcf48d852357a6d808921cc (diff)
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/soc-acpi.h3
-rw-r--r--sound/soc/intel/boards/bytcht_da7213.c2
-rw-r--r--sound/soc/intel/boards/bytcht_es8316.c2
-rw-r--r--sound/soc/intel/boards/bytcr_rt5640.c2
-rw-r--r--sound/soc/intel/boards/bytcr_rt5651.c2
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5645.c4
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5672.c2
7 files changed, 10 insertions, 7 deletions
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index d1aaf876cd26..83320af8def2 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -27,6 +27,9 @@ struct snd_soc_acpi_package_context {
27 bool data_valid; 27 bool data_valid;
28}; 28};
29 29
30/* codec name is used in DAIs is i2c-<HID>:00 with HID being 8 chars */
31#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)
32
30#if IS_ENABLED(CONFIG_ACPI) 33#if IS_ENABLED(CONFIG_ACPI)
31/* translation fron HID to I2C name, needed for DAI codec_name */ 34/* translation fron HID to I2C name, needed for DAI codec_name */
32const char *snd_soc_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]); 35const char *snd_soc_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]);
diff --git a/sound/soc/intel/boards/bytcht_da7213.c b/sound/soc/intel/boards/bytcht_da7213.c
index c4d82ad41bd7..6219c04d4731 100644
--- a/sound/soc/intel/boards/bytcht_da7213.c
+++ b/sound/soc/intel/boards/bytcht_da7213.c
@@ -219,7 +219,7 @@ static struct snd_soc_card bytcht_da7213_card = {
219 .num_dapm_routes = ARRAY_SIZE(audio_map), 219 .num_dapm_routes = ARRAY_SIZE(audio_map),
220}; 220};
221 221
222static char codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ 222static char codec_name[SND_ACPI_I2C_ID_LEN];
223 223
224static int bytcht_da7213_probe(struct platform_device *pdev) 224static int bytcht_da7213_probe(struct platform_device *pdev)
225{ 225{
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index ae24f6205f05..079f35cd4eaf 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -232,7 +232,7 @@ static struct snd_soc_card byt_cht_es8316_card = {
232 .fully_routed = true, 232 .fully_routed = true,
233}; 233};
234 234
235static char codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ 235static char codec_name[SND_ACPI_I2C_ID_LEN];
236 236
237static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) 237static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
238{ 238{
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index f2c0fc415e52..4548f75498d0 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -713,7 +713,7 @@ static struct snd_soc_card byt_rt5640_card = {
713 .fully_routed = true, 713 .fully_routed = true,
714}; 714};
715 715
716static char byt_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ 716static char byt_rt5640_codec_name[SND_ACPI_I2C_ID_LEN];
717static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */ 717static char byt_rt5640_codec_aif_name[12]; /* = "rt5640-aif[1|2]" */
718static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ 718static char byt_rt5640_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
719 719
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
index 22c9cc5d135e..5a6b7dedb773 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -509,7 +509,7 @@ static struct snd_soc_card byt_rt5651_card = {
509 .fully_routed = true, 509 .fully_routed = true,
510}; 510};
511 511
512static char byt_rt5651_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ 512static char byt_rt5651_codec_name[SND_ACPI_I2C_ID_LEN];
513 513
514static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) 514static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
515{ 515{
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 18d129caa974..cef6a8c31c8d 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -49,7 +49,7 @@ struct cht_acpi_card {
49struct cht_mc_private { 49struct cht_mc_private {
50 struct snd_soc_jack jack; 50 struct snd_soc_jack jack;
51 struct cht_acpi_card *acpi_card; 51 struct cht_acpi_card *acpi_card;
52 char codec_name[16]; 52 char codec_name[SND_ACPI_I2C_ID_LEN];
53 struct clk *mclk; 53 struct clk *mclk;
54}; 54};
55 55
@@ -499,7 +499,7 @@ static struct cht_acpi_card snd_soc_cards[] = {
499 {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650}, 499 {"10EC5650", CODEC_TYPE_RT5650, &snd_soc_card_chtrt5650},
500}; 500};
501 501
502static char cht_rt5645_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */ 502static char cht_rt5645_codec_name[SND_ACPI_I2C_ID_LEN];
503static char cht_rt5645_codec_aif_name[12]; /* = "rt5645-aif[1|2]" */ 503static char cht_rt5645_codec_aif_name[12]; /* = "rt5645-aif[1|2]" */
504static char cht_rt5645_cpu_dai_name[10]; /* = "ssp[0|2]-port" */ 504static char cht_rt5645_cpu_dai_name[10]; /* = "ssp[0|2]-port" */
505 505
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c
index f8f21eee9b2d..1f3d38dc4fcb 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -35,7 +35,7 @@
35 35
36struct cht_mc_private { 36struct cht_mc_private {
37 struct snd_soc_jack headset; 37 struct snd_soc_jack headset;
38 char codec_name[16]; 38 char codec_name[SND_ACPI_I2C_ID_LEN];
39 struct clk *mclk; 39 struct clk *mclk;
40}; 40};
41 41