Soundwire: Fix soundwire master port configuration
Existing soundwire master controller driver uses static tables directly for soundwire port configuration. But, this is not scalable to add support for new targets. So, define platform specific soundwire master port configuration from machine driver. Change-Id: I37d499c77914b413e6e16ab2689dbaae8fcd194c Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:

committed by
Karthikeyan Mani

parent
a3e969d6f0
commit
4c322b1c80
@@ -24,11 +24,12 @@
|
||||
#include <dsp/msm-audio-event-notify.h>
|
||||
#include "swrm_registers.h"
|
||||
#include "swr-mstr-ctrl.h"
|
||||
#include "swrm_port_config.h"
|
||||
|
||||
#define SWRM_SYSTEM_RESUME_TIMEOUT_MS 700
|
||||
#define SWRM_SYS_SUSPEND_WAIT 1
|
||||
|
||||
#define SWRM_DSD_PARAMS_PORT 4
|
||||
|
||||
#define SWR_BROADCAST_CMD_ID 0x0F
|
||||
#define SWR_AUTO_SUSPEND_DELAY 3 /* delay in sec */
|
||||
#define SWR_DEV_ID_MASK 0xFFFFFFFFFFFF
|
||||
@@ -378,27 +379,16 @@ static void copy_port_tables(struct swr_mstr_ctrl *swrm,
|
||||
static int swrm_get_port_config(struct swr_mstr_ctrl *swrm)
|
||||
{
|
||||
struct port_params *params;
|
||||
u32 usecase = 0;
|
||||
|
||||
switch (swrm->master_id) {
|
||||
case MASTER_ID_WSA:
|
||||
params = wsa_frame_superset;
|
||||
break;
|
||||
case MASTER_ID_RX:
|
||||
/* Two RX tables for dsd and without dsd enabled */
|
||||
if (swrm->mport_cfg[4].port_en)
|
||||
params = rx_frame_params_dsd;
|
||||
else
|
||||
params = rx_frame_params;
|
||||
break;
|
||||
case MASTER_ID_TX:
|
||||
params = tx_frame_params_superset;
|
||||
break;
|
||||
default: /* MASTER_GENERIC*/
|
||||
/* computer generic frame parameters */
|
||||
return -EINVAL;
|
||||
}
|
||||
/* TODO - Send usecase information to avoid checking for master_id */
|
||||
if (swrm->mport_cfg[SWRM_DSD_PARAMS_PORT].port_en &&
|
||||
(swrm->master_id == MASTER_ID_RX))
|
||||
usecase = 1;
|
||||
|
||||
params = swrm->port_param[usecase];
|
||||
copy_port_tables(swrm, params);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user