Loading include/soc/soundwire.h +3 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _LINUX_SOUNDWIRE_H Loading Loading @@ -83,6 +84,7 @@ struct swr_port_info { u8 req_ch; u8 num_ch; u32 ch_rate; u64 dev_addr; }; /* Loading @@ -107,6 +109,7 @@ struct swr_params { u32 ch_rate[SWR_MAX_DEV_PORT_NUM]; u8 ch_en[SWR_MAX_DEV_PORT_NUM]; u8 port_type[SWR_MAX_DEV_PORT_NUM]; u64 dev_addr; }; /* Loading soc/soundwire.c +5 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/kernel.h> Loading Loading @@ -363,6 +364,8 @@ int swr_connect_port(struct swr_device *dev, u8 *port_id, u8 num_port, txn->tid = i; txn->dev_num = dev->dev_num; //assign device addr also, as dev_num can dynamically change during device enumeration txn->dev_addr = dev->addr; txn->num_port = num_port; for (i = 0; i < num_port; i++) { txn->port_id[i] = port_id[i]; Loading Loading @@ -442,6 +445,8 @@ int swr_disconnect_port(struct swr_device *dev, u8 *port_id, u8 num_port, txn->tid = i; txn->dev_num = dev->dev_num; //assign device address as dev_num can change dynamically during device enumeration txn->dev_addr = dev->addr; txn->num_port = num_port; for (i = 0; i < num_port; i++) { txn->port_id[i] = port_id[i]; Loading soc/swr-mstr-ctrl.c +6 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/irq.h> Loading Loading @@ -1098,14 +1099,14 @@ static void swrm_switch_frame_shape(struct swr_mstr_ctrl *swrm, int mclk_freq) } static struct swr_port_info *swrm_get_port_req(struct swrm_mports *mport, u8 slv_port, u8 dev_num) u8 slv_port, u8 dev_num, u64 dev_addr) { struct swr_port_info *port_req = NULL; list_for_each_entry(port_req, &mport->port_req_list, list) { /* Store dev_id instead of dev_num if enumeration is changed run_time */ if ((port_req->slave_port_id == slv_port) && (port_req->dev_num == dev_num)) && ((port_req->dev_num == dev_num) || (port_req->dev_addr == dev_addr))) return port_req; } return NULL; Loading Loading @@ -1631,7 +1632,7 @@ static int swrm_connect_port(struct swr_master *master, mport = &(swrm->mport_cfg[mstr_port_id]); /* get port req */ port_req = swrm_get_port_req(mport, portinfo->port_id[i], portinfo->dev_num); portinfo->dev_num, portinfo->dev_addr); if (!port_req) { dev_dbg(&master->dev, "%s: new req:port id %d dev %d\n", __func__, portinfo->port_id[i], Loading @@ -1643,6 +1644,7 @@ static int swrm_connect_port(struct swr_master *master, goto mem_fail; } port_req->dev_num = portinfo->dev_num; port_req->dev_addr = portinfo->dev_addr; port_req->slave_port_id = portinfo->port_id[i]; port_req->num_ch = portinfo->num_ch[i]; port_req->ch_rate = portinfo->ch_rate[i]; Loading Loading @@ -1719,7 +1721,7 @@ static int swrm_disconnect_port(struct swr_master *master, mport = &(swrm->mport_cfg[mstr_port_id]); /* get port req */ port_req = swrm_get_port_req(mport, portinfo->port_id[i], portinfo->dev_num); portinfo->dev_num, portinfo->dev_addr); if (!port_req) { dev_err(&master->dev, "%s:port not enabled : port %d\n", Loading Loading
include/soc/soundwire.h +3 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _LINUX_SOUNDWIRE_H Loading Loading @@ -83,6 +84,7 @@ struct swr_port_info { u8 req_ch; u8 num_ch; u32 ch_rate; u64 dev_addr; }; /* Loading @@ -107,6 +109,7 @@ struct swr_params { u32 ch_rate[SWR_MAX_DEV_PORT_NUM]; u8 ch_en[SWR_MAX_DEV_PORT_NUM]; u8 port_type[SWR_MAX_DEV_PORT_NUM]; u64 dev_addr; }; /* Loading
soc/soundwire.c +5 −0 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/kernel.h> Loading Loading @@ -363,6 +364,8 @@ int swr_connect_port(struct swr_device *dev, u8 *port_id, u8 num_port, txn->tid = i; txn->dev_num = dev->dev_num; //assign device addr also, as dev_num can dynamically change during device enumeration txn->dev_addr = dev->addr; txn->num_port = num_port; for (i = 0; i < num_port; i++) { txn->port_id[i] = port_id[i]; Loading Loading @@ -442,6 +445,8 @@ int swr_disconnect_port(struct swr_device *dev, u8 *port_id, u8 num_port, txn->tid = i; txn->dev_num = dev->dev_num; //assign device address as dev_num can change dynamically during device enumeration txn->dev_addr = dev->addr; txn->num_port = num_port; for (i = 0; i < num_port; i++) { txn->port_id[i] = port_id[i]; Loading
soc/swr-mstr-ctrl.c +6 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/irq.h> Loading Loading @@ -1098,14 +1099,14 @@ static void swrm_switch_frame_shape(struct swr_mstr_ctrl *swrm, int mclk_freq) } static struct swr_port_info *swrm_get_port_req(struct swrm_mports *mport, u8 slv_port, u8 dev_num) u8 slv_port, u8 dev_num, u64 dev_addr) { struct swr_port_info *port_req = NULL; list_for_each_entry(port_req, &mport->port_req_list, list) { /* Store dev_id instead of dev_num if enumeration is changed run_time */ if ((port_req->slave_port_id == slv_port) && (port_req->dev_num == dev_num)) && ((port_req->dev_num == dev_num) || (port_req->dev_addr == dev_addr))) return port_req; } return NULL; Loading Loading @@ -1631,7 +1632,7 @@ static int swrm_connect_port(struct swr_master *master, mport = &(swrm->mport_cfg[mstr_port_id]); /* get port req */ port_req = swrm_get_port_req(mport, portinfo->port_id[i], portinfo->dev_num); portinfo->dev_num, portinfo->dev_addr); if (!port_req) { dev_dbg(&master->dev, "%s: new req:port id %d dev %d\n", __func__, portinfo->port_id[i], Loading @@ -1643,6 +1644,7 @@ static int swrm_connect_port(struct swr_master *master, goto mem_fail; } port_req->dev_num = portinfo->dev_num; port_req->dev_addr = portinfo->dev_addr; port_req->slave_port_id = portinfo->port_id[i]; port_req->num_ch = portinfo->num_ch[i]; port_req->ch_rate = portinfo->ch_rate[i]; Loading Loading @@ -1719,7 +1721,7 @@ static int swrm_disconnect_port(struct swr_master *master, mport = &(swrm->mport_cfg[mstr_port_id]); /* get port req */ port_req = swrm_get_port_req(mport, portinfo->port_id[i], portinfo->dev_num); portinfo->dev_num, portinfo->dev_addr); if (!port_req) { dev_err(&master->dev, "%s:port not enabled : port %d\n", Loading