mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
drm/amd/amdgpu: Initialize swnode for ISP MFD device
Create amd_isp_capture MFD device with swnode initialized to isp specific software_node part of fwnode graph in amd_isp4 x86/platform driver. The isp driver use this swnode handle to retrieve the critical properties (data-lanes, mipi phyid, link-frequencies etc.) required for camera to work on AMD ISP4 based targets. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2becafc319
commit
e36519f5c8
|
|
@ -1723,7 +1723,7 @@ static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_ISP)
|
||||
int amdgpu_acpi_get_isp4_dev_hid(u8 (*hid)[ACPI_ID_LEN]);
|
||||
int amdgpu_acpi_get_isp4_dev(struct acpi_device **dev);
|
||||
#endif
|
||||
|
||||
void amdgpu_register_gpu_instance(struct amdgpu_device *adev);
|
||||
|
|
|
|||
|
|
@ -1545,7 +1545,7 @@ static int isp_match_acpi_device_ids(struct device *dev, const void *data)
|
|||
return acpi_match_device(data, dev) ? 1 : 0;
|
||||
}
|
||||
|
||||
int amdgpu_acpi_get_isp4_dev_hid(u8 (*hid)[ACPI_ID_LEN])
|
||||
int amdgpu_acpi_get_isp4_dev(struct acpi_device **dev)
|
||||
{
|
||||
struct device *pdev __free(put_device) = NULL;
|
||||
struct acpi_device *acpi_pdev;
|
||||
|
|
@ -1559,7 +1559,7 @@ int amdgpu_acpi_get_isp4_dev_hid(u8 (*hid)[ACPI_ID_LEN])
|
|||
if (!acpi_pdev)
|
||||
return -ENODEV;
|
||||
|
||||
strscpy(*hid, acpi_device_hid(acpi_pdev));
|
||||
*dev = acpi_pdev;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,15 +183,16 @@ static int isp_genpd_remove_device(struct device *dev, void *data)
|
|||
|
||||
static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
|
||||
{
|
||||
const struct software_node *amd_camera_node, *isp4_node;
|
||||
struct amdgpu_device *adev = isp->adev;
|
||||
struct acpi_device *acpi_dev;
|
||||
int idx, int_idx, num_res, r;
|
||||
u8 isp_dev_hid[ACPI_ID_LEN];
|
||||
u64 isp_base;
|
||||
|
||||
if (adev->rmmio_size == 0 || adev->rmmio_size < 0x5289)
|
||||
return -EINVAL;
|
||||
|
||||
r = amdgpu_acpi_get_isp4_dev_hid(&isp_dev_hid);
|
||||
r = amdgpu_acpi_get_isp4_dev(&acpi_dev);
|
||||
if (r) {
|
||||
drm_dbg(&adev->ddev, "Invalid isp platform detected (%d)", r);
|
||||
/* allow GPU init to progress */
|
||||
|
|
@ -199,7 +200,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
|
|||
}
|
||||
|
||||
/* add GPIO resources required for OMNI5C10 sensor */
|
||||
if (!strcmp("OMNI5C10", isp_dev_hid)) {
|
||||
if (!strcmp("OMNI5C10", acpi_device_hid(acpi_dev))) {
|
||||
gpiod_add_lookup_table(&isp_gpio_table);
|
||||
gpiod_add_lookup_table(&isp_sensor_gpio_table);
|
||||
}
|
||||
|
|
@ -241,6 +242,9 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
|
|||
goto failure;
|
||||
}
|
||||
|
||||
amd_camera_node = (const struct software_node *)acpi_dev->driver_data;
|
||||
isp4_node = software_node_find_by_name(amd_camera_node, "isp4");
|
||||
|
||||
/* initialize isp platform data */
|
||||
isp->isp_pdata->adev = (void *)adev;
|
||||
isp->isp_pdata->asic_type = adev->asic_type;
|
||||
|
|
@ -269,6 +273,7 @@ static int isp_v4_1_1_hw_init(struct amdgpu_isp *isp)
|
|||
isp->isp_cell[0].num_resources = num_res;
|
||||
isp->isp_cell[0].resources = &isp->isp_res[0];
|
||||
isp->isp_cell[0].platform_data = isp->isp_pdata;
|
||||
isp->isp_cell[0].swnode = isp4_node;
|
||||
isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data);
|
||||
|
||||
/* initialize isp i2c platform data */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user