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

Commit 7839efbd authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dt-bindings: arm: coresight: Add qcom,hw-enable-check for tpdm"

parents 548c84fd 7631a136
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -169,6 +169,9 @@ its hardware characteristcs.

	* qcom,tpdm-regs: List of regulators required.

	* qcom,hw-enable-check: Check if the tpdm need to be probed as some tpdms
	  are not enabled in secure device.

* Optional properties for CSRs:

	* qcom,usb-bam-support: boolean, indicates CSR has the ability to operate on
+13 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <linux/of.h>
#include <linux/coresight.h>
#include <linux/regulator/consumer.h>
#include <soc/qcom/scm.h>

#include "coresight-priv.h"

@@ -131,6 +132,8 @@ do { \
#define TPDM_REVISION_A		0
#define TPDM_REVISION_B		1

#define HW_ENABLE_CHECK_VALUE   0x10

enum tpdm_dataset {
	TPDM_DS_IMPLDEF,
	TPDM_DS_DSB,
@@ -4368,12 +4371,22 @@ static int tpdm_probe(struct amba_device *adev, const struct amba_id *id)
	struct coresight_desc *desc;
	static int traceid = TPDM_TRACE_ID_START;
	uint32_t version;
	struct scm_desc des = {0};
	u32 scm_ret = 0;

	pdata = of_get_coresight_platform_data(dev, adev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	adev->dev.platform_data = pdata;

	if (of_property_read_bool(adev->dev.of_node, "qcom,hw-enable-check")) {
		ret = scm_call2(SCM_SIP_FNID(SCM_SVC_UTIL,
				HW_ENABLE_CHECK_VALUE), &des);
		scm_ret = des.ret[0];
		if (scm_ret == 0)
			return -ENXIO;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
		return -ENOMEM;