ASoC: wcd938x: Update soundwire master channel type

Update soundwire master channel type properly before sending to
soundwire master.

Change-Id: I459c6e8d1cc688c3e6e5a0369e095f0b12fbb7c6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:
Sudheer Papothi
2020-02-07 02:31:25 +05:30
parent 3e2c37d273
commit b2d648baf0
2 changed files with 6 additions and 5 deletions

View File

@@ -267,7 +267,7 @@ static int wcd937x_tx_connect_port(struct snd_soc_component *component,
u8 num_ch; u8 num_ch;
u8 ch_mask; u8 ch_mask;
u32 ch_rate; u32 ch_rate;
u8 ch_type; u8 ch_type = 0;
int slave_port_idx; int slave_port_idx;
u8 num_port = 1; u8 num_port = 1;
int ret = 0; int ret = 0;
@@ -281,7 +281,7 @@ static int wcd937x_tx_connect_port(struct snd_soc_component *component,
slave_ch_idx = wcd937x_slave_get_slave_ch_val(slv_port_type); slave_ch_idx = wcd937x_slave_get_slave_ch_val(slv_port_type);
if (slave_ch_idx != -EINVAL) if (slave_ch_idx != -EINVAL)
ch_type = wcd937x_slave_get_master_ch_val(slave_ch_idx); ch_type = wcd937x->tx_master_ch_map[slave_ch_idx];
dev_dbg(component->dev, "%s slv_ch_idx: %d, mstr_ch_type: %d\n", dev_dbg(component->dev, "%s slv_ch_idx: %d, mstr_ch_type: %d\n",
__func__, slave_ch_idx, ch_type); __func__, slave_ch_idx, ch_type);
@@ -1954,7 +1954,7 @@ static int wcd937x_tx_master_ch_put(struct snd_kcontrol *kcontrol,
wcd937x_tx_get_slave_ch_type_idx(kcontrol->id.name, &slave_ch_idx); wcd937x_tx_get_slave_ch_type_idx(kcontrol->id.name, &slave_ch_idx);
dev_dbg(component->dev, "%s: slave_ch_idx: %d", __func__, slave_ch_idx); dev_dbg(component->dev, "%s: slave_ch_idx: %d", __func__, slave_ch_idx);
dev_dbg(component->dev, "%s: ucontrol->value.enumerated.item[0] = %ld\n", dev_dbg(component->dev, "%s: ucontrol->value.enumerated.item[0] = %ld\n",
__func__, ucontrol->value.enumerated.item[0]); __func__, ucontrol->value.enumerated.item[0]);

View File

@@ -362,7 +362,8 @@ static int wcd938x_tx_connect_port(struct snd_soc_component *component,
u8 slv_port_type, u8 enable) u8 slv_port_type, u8 enable)
{ {
struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component); struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
u8 port_id, num_ch, ch_mask, ch_type; u8 port_id, num_ch, ch_mask;
u8 ch_type = 0;
u32 ch_rate; u32 ch_rate;
int slave_ch_idx; int slave_ch_idx;
u8 num_port = 1; u8 num_port = 1;
@@ -376,7 +377,7 @@ static int wcd938x_tx_connect_port(struct snd_soc_component *component,
slave_ch_idx = wcd938x_slave_get_slave_ch_val(slv_port_type); slave_ch_idx = wcd938x_slave_get_slave_ch_val(slv_port_type);
if (slave_ch_idx != -EINVAL) if (slave_ch_idx != -EINVAL)
ch_type = wcd938x_slave_get_master_ch_val(slave_ch_idx); ch_type = wcd938x->tx_master_ch_map[slave_ch_idx];
dev_dbg(component->dev, "%s slv_ch_idx: %d, mstr_ch_type: %d\n", dev_dbg(component->dev, "%s slv_ch_idx: %d, mstr_ch_type: %d\n",
__func__, slave_ch_idx, ch_type); __func__, slave_ch_idx, ch_type);