DEFINE_CORESIGHT_DEVLIST(tpdm_devs, "tpdm");
 
+static void tpdm_enable_dsb(struct tpdm_drvdata *drvdata)
+{
+       u32 val;
+
+       /* Set the enable bit of DSB control register to 1 */
+       val = readl_relaxed(drvdata->base + TPDM_DSB_CR);
+       val |= TPDM_DSB_CR_ENA;
+       writel_relaxed(val, drvdata->base + TPDM_DSB_CR);
+}
+
 /* TPDM enable operations */
+static void __tpdm_enable(struct tpdm_drvdata *drvdata)
+{
+       CS_UNLOCK(drvdata->base);
+
+       /* Check if DSB datasets is present for TPDM. */
+       if (drvdata->datasets & TPDM_PIDR0_DS_DSB)
+               tpdm_enable_dsb(drvdata);
+
+       CS_LOCK(drvdata->base);
+}
+
 static int tpdm_enable(struct coresight_device *csdev,
                       struct perf_event *event, u32 mode)
 {
                return -EBUSY;
        }
 
+       __tpdm_enable(drvdata);
        drvdata->enable = true;
        spin_unlock(&drvdata->spinlock);
 
        return 0;
 }
 
+static void tpdm_disable_dsb(struct tpdm_drvdata *drvdata)
+{
+       u32 val;
+
+       /* Set the enable bit of DSB control register to 0 */
+       val = readl_relaxed(drvdata->base + TPDM_DSB_CR);
+       val &= ~TPDM_DSB_CR_ENA;
+       writel_relaxed(val, drvdata->base + TPDM_DSB_CR);
+}
+
 /* TPDM disable operations */
+static void __tpdm_disable(struct tpdm_drvdata *drvdata)
+{
+       CS_UNLOCK(drvdata->base);
+
+       /* Check if DSB datasets is present for TPDM. */
+       if (drvdata->datasets & TPDM_PIDR0_DS_DSB)
+               tpdm_disable_dsb(drvdata);
+
+       CS_LOCK(drvdata->base);
+}
+
 static void tpdm_disable(struct coresight_device *csdev,
                         struct perf_event *event)
 {
                return;
        }
 
+       __tpdm_disable(drvdata);
        drvdata->enable = false;
        spin_unlock(&drvdata->spinlock);
 
        .source_ops     = &tpdm_source_ops,
 };
 
+static void tpdm_init_default_data(struct tpdm_drvdata *drvdata)
+{
+       u32 pidr;
+
+       CS_UNLOCK(drvdata->base);
+       /*  Get the datasets present on the TPDM. */
+       pidr = readl_relaxed(drvdata->base + CORESIGHT_PERIPHIDR0);
+       drvdata->datasets |= pidr & GENMASK(TPDM_DATASETS - 1, 0);
+       CS_LOCK(drvdata->base);
+}
+
 static int tpdm_probe(struct amba_device *adev, const struct amba_id *id)
 {
        void __iomem *base;
                return PTR_ERR(drvdata->csdev);
 
        spin_lock_init(&drvdata->spinlock);
+       tpdm_init_default_data(drvdata);
        /* Decrease pm refcount when probe is done.*/
        pm_runtime_put(&adev->dev);
 
 
 #ifndef _CORESIGHT_CORESIGHT_TPDM_H
 #define _CORESIGHT_CORESIGHT_TPDM_H
 
+/* The max number of the datasets that TPDM supports */
+#define TPDM_DATASETS       7
+
+/* DSB Subunit Registers */
+#define TPDM_DSB_CR            (0x780)
+/* Enable bit for DSB subunit */
+#define TPDM_DSB_CR_ENA                BIT(0)
+
+/**
+ * The bits of PERIPHIDR0 register.
+ * The fields [6:0] of PERIPHIDR0 are used to determine what
+ * interfaces and subunits are present on a given TPDM.
+ *
+ * PERIPHIDR0[0] : Fix to 1 if ImplDef subunit present, else 0
+ * PERIPHIDR0[1] : Fix to 1 if DSB subunit present, else 0
+ */
+
+#define TPDM_PIDR0_DS_IMPDEF   BIT(0)
+#define TPDM_PIDR0_DS_DSB      BIT(1)
+
 /**
  * struct tpdm_drvdata - specifics associated to an TPDM component
  * @base:       memory mapped base address for this component.
  * @csdev:      component vitals needed by the framework.
  * @spinlock:   lock for the drvdata value.
  * @enable:     enable status of the component.
+ * @datasets:   The datasets types present of the TPDM.
  */
 
 struct tpdm_drvdata {
        struct coresight_device *csdev;
        spinlock_t              spinlock;
        bool                    enable;
+       unsigned long           datasets;
 };
 
 #endif  /* _CORESIGHT_CORESIGHT_TPDM_H */