Skip to content
Merged
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
12 changes: 6 additions & 6 deletions src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int volume_params(struct comp_dev *dev,
* \param[in] chan Channel number.
* \param[in] vol Target volume.
*/
static inline int volume_set_chan(struct comp_dev *dev, int chan, uint32_t vol)
static inline int volume_set_chan(struct comp_dev *dev, int chan, int32_t vol)
{
Comment thread
singalsu marked this conversation as resolved.
Resolved
struct comp_data *cd = comp_get_drvdata(dev);
struct sof_ipc_comp_volume *pga =
Expand All @@ -292,17 +292,17 @@ static inline int volume_set_chan(struct comp_dev *dev, int chan, uint32_t vol)
* multiplication overflow with the 32 bit value. Non-zero MIN option
* can be useful to prevent totally muted small volume gain.
*/
if (v <= VOL_MIN) {
if (v < VOL_MIN) {
/* No need to fail, just trace the event. */
trace_volume_error_with_ids(dev, "volume_set_chan: Limited "
"request %d to VOL_MIN.", v);
trace_volume_error_with_ids(dev, "volume_set_chan: Limited request %d"
" to min. %d", v, VOL_MIN);
v = VOL_MIN;
}

if (v > VOL_MAX) {
/* No need to fail, just trace the event. */
trace_volume_error_with_ids(dev, "volume_set_chan: Limited "
"request %d to VOL_MAX.", v);
trace_volume_error_with_ids(dev, "volume_set_chan: Limited request %d"
" to max. %d", v, VOL_MAX);
v = VOL_MAX;
}

Expand Down