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 drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)
dev_err(&slave->dev,
"SDW_SCP_BUSCLOCK_SCALE_B1 write failed:%d\n", ret);

slave->scale_index = scale_index;
return ret;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/soundwire/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,22 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
if (scale_index < 0)
return scale_index;

if (scale_index == slave->scale_index)
continue;

/* Skip the unattached Peripherals */
if (!completion_done(&slave->enumeration_complete)) {
dev_warn(&slave->dev,
"Not enumerated, skip programming BUSCLOCK_SCALE\n");
continue;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I follow the commit message "The SDW_SCP_BUSCLOCK_SCALE register will be programmed when the
Peripheral is attached", then why do we even need to configure this register during a stream operation, as done below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also typo in commit tile "unattaced"

ret = sdw_write_no_pm(slave, addr1, scale_index);
if (ret < 0) {
dev_err(&slave->dev, "SDW_SCP_BUSCLOCK_SCALE register write failed\n");
return ret;
}
slave->scale_index = scale_index;
}

manager_runtime:
Expand Down
2 changes: 2 additions & 0 deletions include/linux/soundwire/sdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ struct sdw_slave_ops {
* protocol for SoundWire mockup devices
* @sdw_dev_lock: mutex used to protect callbacks/remove races
* @sdca_data: structure containing all device data for SDCA helpers
* @scale_index: current bus clock scaling index
*/
struct sdw_slave {
struct sdw_slave_id id;
Expand All @@ -686,6 +687,7 @@ struct sdw_slave {
bool is_mockup_device;
struct mutex sdw_dev_lock; /* protect callbacks/remove races */
struct sdca_device_data sdca_data;
unsigned int scale_index;
};

#define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)
Expand Down
Loading