-
Notifications
You must be signed in to change notification settings - Fork 140
Upstreaming cleanups to SOF core Part 1 #37
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
Changes from all commits
bdfd20b
0c4a0d1
85634e4
921794e
51b7395
e56592b
f281ccc
f19ee8b
3a4eb20
5c79b2f
454c46b
57b3dcf
fc3a030
429a26e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,20 +157,31 @@ int snd_sof_bytes_get(struct snd_kcontrol *kcontrol, | |
| (struct soc_bytes_ext *)kcontrol->private_value; | ||
| struct snd_sof_control *scontrol = be->dobj.private; | ||
| struct snd_sof_dev *sdev = scontrol->sdev; | ||
| //struct sof_ipc_ctrl_data *cdata = scontrol->control_data; | ||
| //unsigned int i, channels = scontrol->num_channels; | ||
| struct sof_ipc_ctrl_data *cdata = scontrol->control_data; | ||
| struct sof_abi_hdr *data = cdata->data; | ||
| size_t size; | ||
| int ret = 0; | ||
|
|
||
| pm_runtime_get_sync(sdev->dev); | ||
|
|
||
| /* get all the mixer data from DSP */ | ||
| snd_sof_ipc_get_comp_data(sdev->ipc, scontrol, SOF_IPC_COMP_GET_DATA, | ||
| SOF_CTRL_TYPE_DATA_GET, scontrol->cmd); | ||
| size = data->size + sizeof(*data); | ||
| if (size > be->max) { | ||
| dev_err(sdev->dev, "error: DSP sent %ld bytes max is %d\n", | ||
| size, be->max); | ||
| ret = -EINVAL; | ||
| goto out; | ||
| } | ||
|
|
||
| /* TODO: copy back to userspace */ | ||
| /* copy back to kcontrol */ | ||
| memcpy(ucontrol->value.bytes.data, data, size); | ||
|
|
||
| out: | ||
| pm_runtime_mark_last_busy(sdev->dev); | ||
| pm_runtime_put_autosuspend(sdev->dev); | ||
| return 0; | ||
| return ret; | ||
| } | ||
|
|
||
| int snd_sof_bytes_put(struct snd_kcontrol *kcontrol, | ||
|
|
@@ -180,18 +191,28 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol, | |
| (struct soc_bytes_ext *)kcontrol->private_value; | ||
| struct snd_sof_control *scontrol = be->dobj.private; | ||
| struct snd_sof_dev *sdev = scontrol->sdev; | ||
| //struct sof_ipc_ctrl_data *cdata = scontrol->control_data; | ||
| //unsigned int i, channels = scontrol->num_channels; | ||
| struct sof_ipc_ctrl_data *cdata = scontrol->control_data; | ||
| struct sof_abi_hdr *data = cdata->data; | ||
| int ret = 0; | ||
|
|
||
| pm_runtime_get_sync(sdev->dev); | ||
|
|
||
| /* TODO: copy from userspace */ | ||
| if (data->size > be->max) { | ||
| dev_err(sdev->dev, "error: size too big %d bytes max is %d\n", | ||
| data->size, be->max); | ||
| ret = -EINVAL; | ||
| goto out; | ||
| } | ||
|
|
||
| /* copy from kcontrol */ | ||
| memcpy(data, ucontrol->value.bytes.data, data->size); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still looks asymmetrical between put() and get(). put: memcpy(data, ucontrol->value.bytes.data, data->size); |
||
|
|
||
| /* notify DSP of mixer updates */ | ||
| snd_sof_ipc_set_comp_data(sdev->ipc, scontrol, SOF_IPC_COMP_SET_DATA, | ||
| SOF_CTRL_TYPE_DATA_SET, scontrol->cmd); | ||
|
|
||
| out: | ||
| pm_runtime_mark_last_busy(sdev->dev); | ||
| pm_runtime_put_autosuspend(sdev->dev); | ||
| return 0; | ||
| return ret; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,6 +243,7 @@ struct snd_sof_dsp_ops sof_cnl_ops = { | |
| .trace_trigger = hda_dsp_trace_trigger, | ||
|
|
||
| /* DAI drivers */ | ||
| .dai_drv = &hda_dai_drv, | ||
| .drv = skl_dai, | ||
| .num_drv = SOF_SKL_NUM_DAIS, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this define? ARRAY_SIZE(skl_dai) would do, no? |
||
| }; | ||
| EXPORT_SYMBOL(sof_cnl_ops); | ||
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.
Y or m?