All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: max98390: Add support change dsm param name
@ 2021-08-09 14:21 Steve Lee
  2021-08-09 15:54   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Lee @ 2021-08-09 14:21 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, ckeepax, geert, rf, shumingf,
	srinivas.kandagatla, krzk, dmurphy, jack.yu, nuno.sa, steves.lee,
	linux-kernel, alsa-devel
  Cc: ryan.lee.maxim, steves.lee.maxim

  In case of using different type of speaker, support
 using different dsm parameter bin file for each amp connected.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
---
 sound/soc/codecs/max98390.c | 26 ++++++++++++++++++++------
 sound/soc/codecs/max98390.h |  1 +
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
index 94773ccee9d5..b392567c2b3e 100644
--- a/sound/soc/codecs/max98390.c
+++ b/sound/soc/codecs/max98390.c
@@ -765,17 +765,26 @@ static int max98390_dsm_init(struct snd_soc_component *component)
 	vendor = dmi_get_system_info(DMI_SYS_VENDOR);
 	product = dmi_get_system_info(DMI_PRODUCT_NAME);
 
-	if (vendor && product) {
-		snprintf(filename, sizeof(filename), "dsm_param_%s_%s.bin",
-			vendor, product);
+	if (!strcmp(max98390->dsm_param_name, "default")) {
+		if (vendor && product) {
+			snprintf(filename, sizeof(filename),
+				"dsm_param_%s_%s.bin", vendor, product);
+		} else {
+			sprintf(filename, "dsm_param.bin");
+		}
 	} else {
-		sprintf(filename, "dsm_param.bin");
+		snprintf(filename, sizeof(filename), "%s",
+			max98390->dsm_param_name);
 	}
 	ret = request_firmware(&fw, filename, component->dev);
 	if (ret) {
 		ret = request_firmware(&fw, "dsm_param.bin", component->dev);
-		if (ret)
-			goto err;
+		if (ret) {
+			ret = request_firmware(&fw, "dsmparam.bin",
+				component->dev);
+			if (ret)
+				goto err;
+		}
 	}
 
 	dev_dbg(component->dev,
@@ -1047,6 +1056,11 @@ static int max98390_i2c_probe(struct i2c_client *i2c,
 		__func__, max98390->ref_rdc_value,
 		max98390->ambient_temp_value);
 
+	ret = device_property_read_string(&i2c->dev, "maxim,dsm_param_name",
+				       &max98390->dsm_param_name);
+	if (ret)
+		max98390->dsm_param_name = "default";
+
 	/* voltage/current slot configuration */
 	max98390_slot_config(i2c, max98390);
 
diff --git a/sound/soc/codecs/max98390.h b/sound/soc/codecs/max98390.h
index e31516717d3b..c250740f73a2 100644
--- a/sound/soc/codecs/max98390.h
+++ b/sound/soc/codecs/max98390.h
@@ -662,5 +662,6 @@ struct max98390_priv {
 	unsigned int i_l_slot;
 	unsigned int ref_rdc_value;
 	unsigned int ambient_temp_value;
+	const char *dsm_param_name;
 };
 #endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ASoC: max98390: Add support change dsm param name
  2021-08-09 14:21 [PATCH v2] ASoC: max98390: Add support change dsm param name Steve Lee
@ 2021-08-09 15:54   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-08-09 15:54 UTC (permalink / raw)
  To: jack.yu, geert, Steve Lee, krzk, alsa-devel, srinivas.kandagatla,
	linux-kernel, rf, ckeepax, dmurphy, perex, nuno.sa, shumingf,
	lgirdwood, tiwai
  Cc: Mark Brown, steves.lee.maxim, ryan.lee.maxim

On Mon, 9 Aug 2021 23:21:40 +0900, Steve Lee wrote:
>   In case of using different type of speaker, support
>  using different dsm parameter bin file for each amp connected.
> 
> 
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: max98390: Add support change dsm param name
      commit: a10facb752535c078c914b1910dd72eb2e8d584b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ASoC: max98390: Add support change dsm param name
@ 2021-08-09 15:54   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-08-09 15:54 UTC (permalink / raw)
  To: jack.yu, geert, Steve Lee, krzk, alsa-devel, srinivas.kandagatla,
	linux-kernel, rf, ckeepax, dmurphy, perex, nuno.sa, shumingf,
	lgirdwood, tiwai
  Cc: ryan.lee.maxim, Mark Brown, steves.lee.maxim

On Mon, 9 Aug 2021 23:21:40 +0900, Steve Lee wrote:
>   In case of using different type of speaker, support
>  using different dsm parameter bin file for each amp connected.
> 
> 
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: max98390: Add support change dsm param name
      commit: a10facb752535c078c914b1910dd72eb2e8d584b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-09 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 14:21 [PATCH v2] ASoC: max98390: Add support change dsm param name Steve Lee
2021-08-09 15:54 ` Mark Brown
2021-08-09 15:54   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.