diff options
author | Simon Ser <contact@emersion.fr> | 2019-05-26 13:38:26 +0300 |
---|---|---|
committer | Scott Anderson <ascent12@hotmail.com> | 2019-06-02 02:01:11 +0000 |
commit | 8782f1087e16015c25f0aaf23a66ad6b592bd1ff (patch) | |
tree | ab5ea017dd4a259eedd2e4e81ce9f02162a1cc1b /json.c | |
parent | b299cef0def6662b4215d433e6a75eba6750c065 (diff) | |
download | external_drm_info-8782f1087e16015c25f0aaf23a66ad6b592bd1ff.tar.gz external_drm_info-8782f1087e16015c25f0aaf23a66ad6b592bd1ff.tar.bz2 external_drm_info-8782f1087e16015c25f0aaf23a66ad6b592bd1ff.zip |
Add support for platform devices
This is what the Raspberry Pi uses.
Diffstat (limited to 'json.c')
-rw-r--r-- | json.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -162,6 +162,17 @@ static struct json_object *device_info(int fd) json_object_object_add(device_data_obj, "subsystem_device", new_json_object_uint64(pci->subdevice_id)); break; +#if LIBDRM_VERSION >= VERSION(2, 4, 75) + case DRM_BUS_PLATFORM:; + drmPlatformDeviceInfo *platform = dev->deviceinfo.platform; + device_data_obj = json_object_new_object(); + struct json_object *compatible_arr = json_object_new_array(); + for (size_t i = 0; platform->compatible[i]; ++i) + json_object_array_add(compatible_arr, + json_object_new_string(platform->compatible[i])); + json_object_object_add(device_data_obj, "compatible", compatible_arr); + break; +#endif } json_object_object_add(obj, "device_data", device_data_obj); |