Skip to content

Loopback mode kcontrol support - #26

Closed
xiulipan wants to merge 5 commits into
thesofproject:masterfrom
xiulipan:lbm
Closed

Loopback mode kcontrol support#26
xiulipan wants to merge 5 commits into
thesofproject:masterfrom
xiulipan:lbm

Conversation

@xiulipan

@xiulipanxiulipan commented Jun 28, 2018

Copy link
Copy Markdown
Contributor

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 <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>

@lgirdwoodlgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor optimizations needed.

Comment threadsrc/include/sof/ssp.h
uint32_t psp;
spinlock_t lock;
uint32_t state[2]; /* SSP_STATE_ for each direction */
uint32_t lbm;

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will use register value.

Comment threadsrc/include/sof/dai.h
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will refine DAI.

Comment threadsrc/drivers/dmic.c
return -EINVAL;
}

static inline int dmic_get_loopback_mode(struct dai *dai)

Copy link
Copy Markdown
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.

Comment threadsrc/drivers/byt-ssp.c

trace_ssp("log");
spin_lock(&ssp->lock);
ret = ssp->lbm;

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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,

Comment threadsrc/audio/dai.c
case SOF_CTRL_CMD_SWITCH:
val = cdata->compv[0].uvalue;
trace_dai("dcs");
trace_value(cdata->comp_id);

Copy link
Copy Markdown
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.

@lgirdwoodlgirdwood reopened 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 freeto 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

@xiulipan@lgirdwood