Loopback mode kcontrol support#26
Conversation
Add a status to track dai ssp lbm. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
get loopback mode status for dai. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Return error value if it is called. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Add ssp_get_loopback_mode and refine ssp_set_loopback_mode function to support SSP loopback mode. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
use dai_cmd to handle ssp dai loopback mode switch support Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
lgirdwood
left a comment
There was a problem hiding this comment.
Just minor optimizations needed.
| uint32_t psp; | ||
| spinlock_t lock; | ||
| uint32_t state[2]; /* SSP_STATE_ for each direction */ | ||
| uint32_t lbm; |
There was a problem hiding this comment.
This is platform data, so it cant hold any "status". It can however store a flag that can be used to do a one time configure of the SSP hardware. Please also use a more descriptive name for this, what does it do ?
There was a problem hiding this comment.
Will use register value.
| int (*pm_context_store)(struct dai *dai); | ||
| int (*probe)(struct dai *dai); | ||
| int (*set_loopback_mode)(struct dai *dai, uint32_t lbm); | ||
| int (*get_loopback_mode)(struct dai *dai); |
There was a problem hiding this comment.
Please remove set_loopback_mode and use an int (*ioctl)(*dai, int cmd, void *data) callback for this.
There was a problem hiding this comment.
OK, will refine DAI.
| return -EINVAL; | ||
| } | ||
|
|
||
| static inline int dmic_get_loopback_mode(struct dai *dai) |
There was a problem hiding this comment.
Not needed with ioctl change.
|
|
||
| trace_ssp("log"); | ||
| spin_lock(&ssp->lock); | ||
| ret = ssp->lbm; |
There was a problem hiding this comment.
Do we really need this variable to track state ? cant we just use the SSP LBM bit for this ?
There was a problem hiding this comment.
ok, will use the register value directly,
| case SOF_CTRL_CMD_SWITCH: | ||
| val = cdata->compv[0].uvalue; | ||
| trace_dai("dcs"); | ||
| trace_value(cdata->comp_id); |
There was a problem hiding this comment.
This will flow easier when using ioctl as the cmd can be passed directly in most cases.
Add comp cmd handler for DAI SSP loopback mode switch.
work with:
thesofproject/linux#10
thesofproject/soft#13