Skip to content
Merged
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
7 changes: 0 additions & 7 deletions drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,7 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
bus->params.curr_dr_freq = bus->params.max_dr_freq;
bus->params.curr_bank = SDW_BANK0;
bus->params.next_bank = SDW_BANK1;
/*
* Set is_present = true by default. It will be set to false when no peripherals
* are attached on the bus.
*/
bus->is_present = true;

init_completion(&bus->enumeration_complete);
return 0;
}
EXPORT_SYMBOL(sdw_bus_master_add);
Expand Down Expand Up @@ -859,7 +853,6 @@ static int sdw_program_device_num(struct sdw_bus *bus, bool *programmed)
if (ret == -ENODATA) { /* end of device id reads */
dev_dbg(bus->dev, "No more devices to enumerate\n");
ret = 0;
complete_all(&bus->enumeration_complete);
break;
}
if (ret < 0) {
Expand Down
5 changes: 0 additions & 5 deletions include/linux/soundwire/sdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,6 @@ struct sdw_stream_runtime {
* transport and port parameters
* @defer_msg: Defer message
* @params: Current bus parameters
* @enumeration_complete: completion utility to control potential races between
* enumeration completion and peripheral presence checks.
* @stream_refcount: number of streams currently using this bus
* @bpt_stream_refcount: number of BTP streams currently using this bus (should
* be zero or one, multiple streams per link is not supported).
Expand Down Expand Up @@ -1032,7 +1030,6 @@ struct sdw_stream_runtime {
* @multi_link: Store bus property that indicates if multi links
* are supported. This flag is populated by drivers after reading
* appropriate firmware (ACPI/DT).
* @is_present: indicates whether any peripheral is present on the bus.
*/
struct sdw_bus {
struct device *dev;
Expand All @@ -1046,7 +1043,6 @@ struct sdw_bus {
struct list_head m_rt_list;
struct sdw_defer defer_msg;
struct sdw_bus_params params;
struct completion enumeration_complete;
int stream_refcount;
int bpt_stream_refcount;
struct sdw_stream_runtime *bpt_stream;
Expand All @@ -1068,7 +1064,6 @@ struct sdw_bus {
struct dentry *debugfs;
#endif
bool multi_link;
bool is_present;
};

struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name, enum sdw_stream_type type);
Expand Down
25 changes: 6 additions & 19 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,37 +1432,24 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
for (i = 0; i < peripherals->num_peripherals; i++) {
slave = peripherals->array[i];

if (!slave->bus->is_present)
continue;

if (link_mask & BIT(slave->bus->link_id)) {
/*
* At least one peripheral is present on the link which means that this
* link has already been enumerated
*/
if (slave->dev_num_sticky)
Comment thread
bardliao marked this conversation as resolved.
Resolved
goto skip_wait_link_enumeration;
}

if (sdw_show_ping_status(slave->bus, true) == 0) {
/* no peripherals attached on this link */
slave->bus->is_present = false;
continue;
}

time = wait_for_completion_timeout(&slave->bus->enumeration_complete,
time = wait_for_completion_timeout(&slave->enumeration_complete,
msecs_to_jiffies(SDW_ENUM_TIMEOUT_MS));
if (!time) {
dev_warn(slave->bus->dev, "No peripheral is present\n");
slave->bus->is_present = false;
dev_warn(&slave->dev, "The peripheral is not present\n");
continue;
}

skip_wait_link_enumeration:
/* Check if the SoundWire peripheral is present */
if (!slave->dev_num_sticky) {
dev_warn(&slave->dev, "SoundWire peripheral is not present\n");
continue;
}

skip_wait_link_enumeration:

/* link_index = the number of used links below the current link */
link_index = hweight32(link_mask & (BIT(slave->bus->link_id) - 1));
links[link_index].adr_d = find_acpi_adr_device(sdev->dev, slave,
Expand Down
Loading