/* SPDX-License-Identifier: MIT */ /* * Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. *
*/
switch (state) { case ISP_PERFORMANCE_STATE_HIGH:
xclk = ISP_HIGH_PERFORMANC_XCLK;
iclk = ISP_HIGH_PERFORMANC_ICLK; break; case ISP_PERFORMANCE_STATE_LOW: /* isp runs at default lowest clock-rate on power-on, do nothing */ return 0; default: return -EINVAL;
}
ret = amdgpu_dpm_set_soft_freq_range(adev, PP_ISPXCLK, xclk, 0); if (ret) {
drm_err(&adev->ddev, "failed to set xclk %u to %u: %d\n",
xclk, state, ret); return ret;
}
ret = amdgpu_dpm_set_soft_freq_range(adev, PP_ISPICLK, iclk, 0); if (ret) {
drm_err(&adev->ddev, "failed to set iclk %u to %u: %d\n",
iclk, state, ret); return ret;
}
if (!dev->type->name) {
drm_dbg(&adev->ddev, "Invalid device type to add\n"); gotoexit;
}
if (strcmp(dev->type->name, "mfd_device")) {
drm_dbg(&adev->ddev, "Invalid isp mfd device %s to add\n", pdev->mfd_cell->name); gotoexit;
}
ret = pm_genpd_add_device(gpd, dev); if (ret) {
drm_err(&adev->ddev, "Failed to add dev %s to genpd %d\n",
pdev->mfd_cell->name, ret); return -ENODEV;
}
/* add only amd_isp_capture and amd_isp_i2c_designware to genpd */
r = mfd_add_hotplug_devices(isp->parent, isp->isp_cell, 2); if (r) {
drm_err(&adev->ddev, "add mfd hotplug device failed (%d)\n", r); goto failure;
}
r = device_for_each_child(isp->parent, &isp->ispgpd,
isp_genpd_add_device); if (r) {
drm_err(&adev->ddev, "failed to add devices to genpd (%d)\n", r); goto failure;
}
r = mfd_add_hotplug_devices(isp->parent, &isp->isp_cell[2], 1); if (r) {
drm_err(&adev->ddev, "add pinctl hotplug device failed (%d)\n", r); goto failure;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.