Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8777b0a authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Add an helper function to read DT properties



Now that we are transitioning away from non DT enabled targets we
will start reading properties as needed instead of storing them
in a large struct. This function will do the appropriate
translations for reading an u32 property from the root DT node for
the device.

Change-Id: Ic0dedbad1a8d53a0c50030e55d124969d25a612f
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 64b8f03b
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -729,4 +729,19 @@ static inline int kgsl_cmdbatch_sync_pending(struct kgsl_cmdbatch *cmdbatch)
	return ret;
}

/**
 * kgsl_property_read_u32() - Read a u32 property from the device tree
 * @device: Pointer to the KGSL device
 * @prop: String name of the property to query
 * @ptr: Pointer to the variable to store the property
 */
static inline int kgsl_property_read_u32(struct kgsl_device *device,
	const char *prop, unsigned int *ptr)
{
	struct platform_device *pdev =
		container_of(device->parentdev, struct platform_device, dev);

	return of_property_read_u32(pdev->dev.of_node, prop, ptr);
}

#endif  /* __KGSL_DEVICE_H */