ASoC: rt5645: Set card long_name for GPD win / pocket

The GPD win and pocket devices both use the same codec setup and both
have too generic dmi strings making snd_soc_set_dmi_name() not work.

As these devices have only a single speaker we want a separate ucm
file for them, which requires a unique long_name, use the existing
GPD quirk handling to also provide a unique long_name.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Hans de Goede 2017-12-11 22:26:40 +01:00 committed by Mark Brown
parent 56986b07d1
commit aa9c387c2d
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
2 changed files with 7 additions and 0 deletions

View file

@ -25,6 +25,9 @@ struct rt5645_platform_data {
bool level_trigger_irq; bool level_trigger_irq;
/* Invert JD1_1 status polarity */ /* Invert JD1_1 status polarity */
bool inv_jd1_1; bool inv_jd1_1;
/* Value to asign to snd_soc_card.long_name */
const char *long_name;
}; };
#endif #endif

View file

@ -3394,6 +3394,9 @@ static int rt5645_probe(struct snd_soc_codec *codec)
snd_soc_dapm_sync(dapm); snd_soc_dapm_sync(dapm);
} }
if (rt5645->pdata.long_name)
codec->component.card->long_name = rt5645->pdata.long_name;
rt5645->eq_param = devm_kzalloc(codec->dev, rt5645->eq_param = devm_kzalloc(codec->dev,
RT5645_HWEQ_NUM * sizeof(struct rt5645_eq_param_s), GFP_KERNEL); RT5645_HWEQ_NUM * sizeof(struct rt5645_eq_param_s), GFP_KERNEL);
@ -3624,6 +3627,7 @@ static const struct dmi_system_id dmi_platform_intel_broadwell[] = {
static const struct rt5645_platform_data gpd_win_platform_data = { static const struct rt5645_platform_data gpd_win_platform_data = {
.jd_mode = 3, .jd_mode = 3,
.inv_jd1_1 = true, .inv_jd1_1 = true,
.long_name = "gpd-win-pocket-rt5645",
}; };
static const struct dmi_system_id dmi_platform_gpd_win[] = { static const struct dmi_system_id dmi_platform_gpd_win[] = {