max98390.c (320424c7d44f54c18df9812fd7c45f6963524002) | max98390.c (a10facb752535c078c914b1910dd72eb2e8d584b) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * max98390.c -- MAX98390 ALSA Soc Audio driver 4 * 5 * Copyright (C) 2020 Maxim Integrated Products 6 * 7 */ 8 --- 751 unchanged lines hidden (view full) --- 760 struct max98390_priv *max98390 = 761 snd_soc_component_get_drvdata(component); 762 const struct firmware *fw; 763 char *dsm_param; 764 765 vendor = dmi_get_system_info(DMI_SYS_VENDOR); 766 product = dmi_get_system_info(DMI_PRODUCT_NAME); 767 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * max98390.c -- MAX98390 ALSA Soc Audio driver 4 * 5 * Copyright (C) 2020 Maxim Integrated Products 6 * 7 */ 8 --- 751 unchanged lines hidden (view full) --- 760 struct max98390_priv *max98390 = 761 snd_soc_component_get_drvdata(component); 762 const struct firmware *fw; 763 char *dsm_param; 764 765 vendor = dmi_get_system_info(DMI_SYS_VENDOR); 766 product = dmi_get_system_info(DMI_PRODUCT_NAME); 767 |
768 if (vendor && product) { 769 snprintf(filename, sizeof(filename), "dsm_param_%s_%s.bin", 770 vendor, product); | 768 if (!strcmp(max98390->dsm_param_name, "default")) { 769 if (vendor && product) { 770 snprintf(filename, sizeof(filename), 771 "dsm_param_%s_%s.bin", vendor, product); 772 } else { 773 sprintf(filename, "dsm_param.bin"); 774 } |
771 } else { | 775 } else { |
772 sprintf(filename, "dsm_param.bin"); | 776 snprintf(filename, sizeof(filename), "%s", 777 max98390->dsm_param_name); |
773 } 774 ret = request_firmware(&fw, filename, component->dev); 775 if (ret) { 776 ret = request_firmware(&fw, "dsm_param.bin", component->dev); | 778 } 779 ret = request_firmware(&fw, filename, component->dev); 780 if (ret) { 781 ret = request_firmware(&fw, "dsm_param.bin", component->dev); |
777 if (ret) 778 goto err; | 782 if (ret) { 783 ret = request_firmware(&fw, "dsmparam.bin", 784 component->dev); 785 if (ret) 786 goto err; 787 } |
779 } 780 781 dev_dbg(component->dev, 782 "max98390: param fw size %zd\n", 783 fw->size); 784 if (fw->size < MAX98390_DSM_PARAM_MIN_SIZE) { 785 dev_err(component->dev, 786 "param fw is invalid.\n"); --- 255 unchanged lines hidden (view full) --- 1042 "no optional property 'r0_calib' found, default:\n"); 1043 } 1044 1045 dev_info(&i2c->dev, 1046 "%s: r0_calib: 0x%x,temperature_calib: 0x%x", 1047 __func__, max98390->ref_rdc_value, 1048 max98390->ambient_temp_value); 1049 | 788 } 789 790 dev_dbg(component->dev, 791 "max98390: param fw size %zd\n", 792 fw->size); 793 if (fw->size < MAX98390_DSM_PARAM_MIN_SIZE) { 794 dev_err(component->dev, 795 "param fw is invalid.\n"); --- 255 unchanged lines hidden (view full) --- 1051 "no optional property 'r0_calib' found, default:\n"); 1052 } 1053 1054 dev_info(&i2c->dev, 1055 "%s: r0_calib: 0x%x,temperature_calib: 0x%x", 1056 __func__, max98390->ref_rdc_value, 1057 max98390->ambient_temp_value); 1058 |
1059 ret = device_property_read_string(&i2c->dev, "maxim,dsm_param_name", 1060 &max98390->dsm_param_name); 1061 if (ret) 1062 max98390->dsm_param_name = "default"; 1063 |
|
1050 /* voltage/current slot configuration */ 1051 max98390_slot_config(i2c, max98390); 1052 1053 /* regmap initialization */ 1054 max98390->regmap = devm_regmap_init_i2c(i2c, &max98390_regmap); 1055 if (IS_ERR(max98390->regmap)) { 1056 ret = PTR_ERR(max98390->regmap); 1057 dev_err(&i2c->dev, --- 61 unchanged lines hidden --- | 1064 /* voltage/current slot configuration */ 1065 max98390_slot_config(i2c, max98390); 1066 1067 /* regmap initialization */ 1068 max98390->regmap = devm_regmap_init_i2c(i2c, &max98390_regmap); 1069 if (IS_ERR(max98390->regmap)) { 1070 ret = PTR_ERR(max98390->regmap); 1071 dev_err(&i2c->dev, --- 61 unchanged lines hidden --- |