-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loopback mode kcontrol support #26
Conversation
Add a status to track dai ssp lbm. Signed-off-by: Pan Xiuli <[email protected]>
get loopback mode status for dai. Signed-off-by: Pan Xiuli <[email protected]>
Return error value if it is called. Signed-off-by: Pan Xiuli <[email protected]>
Add ssp_get_loopback_mode and refine ssp_set_loopback_mode function to support SSP loopback mode. Signed-off-by: Pan Xiuli <[email protected]>
use dai_cmd to handle ssp dai loopback mode switch support Signed-off-by: Pan Xiuli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor optimizations needed.
@@ -236,6 +236,7 @@ struct ssp_pdata { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will use register value.
@@ -64,6 +64,7 @@ struct dai_ops { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will refine DAI.
@@ -1454,13 +1454,19 @@ static inline int dmic_set_loopback_mode(struct dai *dai, uint32_t lbm) | |||
return -EINVAL; | |||
} | |||
|
|||
static inline int dmic_get_loopback_mode(struct dai *dai) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed with ioctl change.
|
||
trace_ssp("log"); | ||
spin_lock(&ssp->lock); | ||
ret = ssp->lbm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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