diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-04-23 03:22:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-04-24 13:48:07 -0400 |
commit | 9f2cf73ed65b598514e4858ca3d602710718ab93 (patch) | |
tree | 7a856acca1f7ad37aed17142403b3e44c8f7f889 | |
parent | 861886d338f7dd802be972e770a695bba62f397a (diff) |
ASoC: bytcr_rt5640: Allow quirk set via module option
The bytcr-rt5640 driver has a few quirk setups depending on the board,
where the quirk value is set by DMI matching. When you have a new
device to add the support, you often experience to try the different
quirk by trial-and-error. Or, you may have a development model that
still has no proper DMI string. In either case, you'd need to compile
the driver at each time.
This patch introduces a module option to override the quirk value on
the fly. User can boot like snd-soc-sst-bytcr-rt5640.quirk=0x4004 to
override the default value without recompilation. It's a raw value,
so user needs to check the source code for the meaning of each bit.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/boards/bytcr_rt5640.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 5c7219fb3aa8..0ac32788f216 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/moduleparam.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/acpi.h> | 24 | #include <linux/acpi.h> |
24 | #include <linux/device.h> | 25 | #include <linux/device.h> |
@@ -58,6 +59,9 @@ struct byt_rt5640_private { | |||
58 | }; | 59 | }; |
59 | 60 | ||
60 | static unsigned long byt_rt5640_quirk = BYT_RT5640_MCLK_EN; | 61 | static unsigned long byt_rt5640_quirk = BYT_RT5640_MCLK_EN; |
62 | static unsigned int quirk_override; | ||
63 | module_param_named(quirk, quirk_override, int, 0444); | ||
64 | MODULE_PARM_DESC(quirk, "Board-specific quirk override"); | ||
61 | 65 | ||
62 | static void log_quirks(struct device *dev) | 66 | static void log_quirks(struct device *dev) |
63 | { | 67 | { |
@@ -806,6 +810,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) | |||
806 | 810 | ||
807 | /* check quirks before creating card */ | 811 | /* check quirks before creating card */ |
808 | dmi_check_system(byt_rt5640_quirk_table); | 812 | dmi_check_system(byt_rt5640_quirk_table); |
813 | if (quirk_override) { | ||
814 | dev_info(&pdev->dev, "Overriding quirk %0x => 0x%x\n", | ||
815 | (unsigned int)byt_rt5640_quirk, quirk_override); | ||
816 | byt_rt5640_quirk = quirk_override; | ||
817 | } | ||
809 | log_quirks(&pdev->dev); | 818 | log_quirks(&pdev->dev); |
810 | 819 | ||
811 | if ((byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) || | 820 | if ((byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) || |