Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
bdfd20b0c4a0d185634e4921794e51b7395e56592bf281cccf19ee8b3a4eb205c79b2f454c46b57b3dcffc3a030429a26eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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); | ||
Uh oh!
There was an error while loading. Please reload this page.
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?