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

Commit 19909d28 authored by Sarangdhar Joshi's avatar Sarangdhar Joshi
Browse files

coresight: set clock enable bit for m4m tpdm



Few registers in M4M TPDM are implemented in the core clock domain
instead of APB clock domain. Accessing these registers require
clock enable bit to be set in clock control register. Add support
to set this bit for M4M TPDM.

Change-Id: I67411feaa1315c857bdf5958665a9a90e1497d81
Signed-off-by: default avatarSarangdhar Joshi <spjoshi@codeaurora.org>
parent db13fe99
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@ Optional properties:
- qcom,cmb-elem-size : specifies the CMB element size supported by each monitor
		       connected to the aggregator on each port. Should be specified
		       in pairs (port, cmb element size).
- qcom,clk-enable: specifies whether additional clock bit needs to be set for
		   M4M TPDM.
- qcom,tpda-atid : specifies the ATID for TPDA.
- qcom,inst-id : QMI instance id for remote ETMs.
- qcom,noovrflw-enable : boolean, indicating whether no overflow bit needs to be
+11 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ do { \

/* TPDM Specific Registers */
#define TPDM_ITATBCNTRL		(0xEF0)
#define TPDM_CLK_CTRL		(0x220)

#define TPDM_DATASETS		32
#define TPDM_BC_MAX_COUNTERS	32
@@ -214,6 +215,7 @@ struct tpdm_drvdata {
	struct clk		*clk;
	struct mutex		lock;
	bool			enable;
	bool			clk_enable;
	DECLARE_BITMAP(datasets, TPDM_DATASETS);
	DECLARE_BITMAP(enable_ds, TPDM_DATASETS);
	enum tpdm_support_type	tc_trig_type;
@@ -460,6 +462,9 @@ static void __tpdm_enable(struct tpdm_drvdata *drvdata)
{
	TPDM_UNLOCK(drvdata);

	if (drvdata->clk_enable)
		tpdm_writel(drvdata, 0x1, TPDM_CLK_CTRL);

	if (test_bit(TPDM_DS_BC, drvdata->enable_ds))
		__tpdm_enable_bc(drvdata);

@@ -545,6 +550,9 @@ static void __tpdm_disable(struct tpdm_drvdata *drvdata)
	if (test_bit(TPDM_DS_CMB, drvdata->enable_ds))
		__tpdm_disable_cmb(drvdata);

	if (drvdata->clk_enable)
		tpdm_writel(drvdata, 0x0, TPDM_CLK_CTRL);

	TPDM_LOCK(drvdata);
}

@@ -3346,6 +3354,9 @@ static int tpdm_probe(struct platform_device *pdev)
	if (!drvdata->base)
		return -ENOMEM;

	drvdata->clk_enable = of_property_read_bool(pdev->dev.of_node,
						    "qcom,clk-enable");

	mutex_init(&drvdata->lock);

	drvdata->clk = devm_clk_get(dev, "core_clk");