Skip to content

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

xiulipan added 5 commits June 27, 2018 23:12
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>
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.

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.

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.

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