Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sound/sdca.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct sdca_device_data {
enum sdca_quirk {
SDCA_QUIRKS_RT712_VB,
SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
SDCA_QUIRKS_TAS2783_SMART_AMP_FUNC_TYPE,
};

#if IS_ENABLED(CONFIG_SND_SOC_SDCA)
Expand Down
21 changes: 21 additions & 0 deletions sound/soc/sdca/sdca_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,34 @@ static bool sdca_device_quirk_skip_func_type_patching(struct sdw_slave *slave)
return false;
}

/*
* The HP OmniBook Ultra 14 (board 8EB4) firmware declares the Function
* Topology control (0x05) of its TI TAS2783 amplifiers with access mode 3
* and no DisCo constant, so the function type cannot be parsed. The
* TAS2783 only implements a SmartAmp function.
*/
static bool sdca_device_quirk_tas2783_smart_amp_func_type(struct sdw_slave *slave)
{
const char *vendor, *board;

if (slave->id.mfg_id != 0x0102 || slave->id.part_id != 0x0000)
return false;

vendor = dmi_get_system_info(DMI_SYS_VENDOR);
board = dmi_get_system_info(DMI_BOARD_NAME);

return vendor && board && !strcmp(vendor, "HP") && !strcmp(board, "8EB4");
}

bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk)
{
switch (quirk) {
case SDCA_QUIRKS_RT712_VB:
return sdca_device_quirk_rt712_vb(slave);
case SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING:
return sdca_device_quirk_skip_func_type_patching(slave);
case SDCA_QUIRKS_TAS2783_SMART_AMP_FUNC_TYPE:
return sdca_device_quirk_tas2783_smart_amp_func_type(slave);
default:
break;
}
Expand Down
9 changes: 8 additions & 1 deletion sound/soc/sdca/sdca_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
u32 function_type;
int function_index;
u64 addr;
bool has_dc_value;
int i, ret;

if (sdca_data->num_functions >= SDCA_MAX_FUNCTION_COUNT) {
Expand Down Expand Up @@ -132,12 +133,18 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
if (!control5)
return -ENODEV;

has_dc_value = fwnode_property_present(control5,
"mipi-sdca-control-dc-value");
ret = fwnode_property_read_u32(control5, "mipi-sdca-control-dc-value",
&function_type);

fwnode_handle_put(control5);

if (ret < 0) {
if (!has_dc_value &&
sdca_device_quirk_match(slave, SDCA_QUIRKS_TAS2783_SMART_AMP_FUNC_TYPE)) {
dev_warn(dev, FW_BUG "function type not a DisCo constant, assuming SmartAmp\n");
function_type = SDCA_FUNCTION_TYPE_SMART_AMP;
} else if (ret < 0) {
dev_err(dev, "function type only supported as DisCo constant\n");
return ret;
}
Expand Down