Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

xiulipan
Copy link
Contributor

@xiulipan xiulipan commented Jun 28, 2018

Add comp cmd handler for DAI SSP loopback mode switch.
work with:
thesofproject/linux#10
thesofproject/soft#13

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]>
Copy link
Member

@lgirdwood lgirdwood left a 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;
Copy link
Member

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 ?

Copy link
Contributor Author

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);
Copy link
Member

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.

Copy link
Contributor Author

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)
Copy link
Member

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;
Copy link
Member

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 ?

Copy link
Contributor Author

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);
Copy link
Member

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.

@lgirdwood lgirdwood closed this Sep 6, 2018
@lgirdwood lgirdwood reopened this Sep 6, 2018
@lgirdwood lgirdwood closed this Sep 6, 2018
@xiulipan xiulipan deleted the lbm branch September 19, 2019 09:32
nashif added a commit to nashif/sof that referenced this pull request Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants