diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index 481cd3d..fa91249 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -5069,8 +5069,12 @@
 	CLK_LOOKUP("mem_a_clk",		ebi1_msmbus_a_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_clk",		dfab_msmbus_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_a_clk",	dfab_msmbus_a_clk.c,	"msm_bus"),
-	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_qdss"),
-	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		"msm_qdss"),
+	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		""),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etb.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_tpiu.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_funnel.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_stm.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etm.0"),
 
 	CLK_LOOKUP("ebi1_clk",		ebi1_clk.c,		""),
 	CLK_LOOKUP("mmfpb_clk",		mmfpb_clk.c,		""),
@@ -5395,8 +5399,12 @@
 	CLK_LOOKUP("mem_a_clk",		ebi1_msmbus_a_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_clk",		dfab_msmbus_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_a_clk",	dfab_msmbus_a_clk.c,	"msm_bus"),
-	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_qdss"),
-	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		"msm_qdss"),
+	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		""),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etb.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_tpiu.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_funnel.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_stm.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etm.0"),
 
 	CLK_LOOKUP("ebi1_clk",		ebi1_clk.c,		NULL),
 	CLK_LOOKUP("mmfpb_clk",		mmfpb_clk.c,		NULL),
@@ -5713,8 +5721,12 @@
 	CLK_LOOKUP("mem_a_clk",		ebi1_msmbus_a_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_clk",		dfab_msmbus_clk.c,	"msm_bus"),
 	CLK_LOOKUP("dfab_a_clk",	dfab_msmbus_a_clk.c,	"msm_bus"),
-	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_qdss"),
-	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		"msm_qdss"),
+	CLK_LOOKUP("core_a_clk",	qdss_a_clk.c,		""),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etb.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_tpiu.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_funnel.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_stm.0"),
+	CLK_LOOKUP("core_clk",		qdss_clk.c,		"msm_etm.0"),
 
 	CLK_LOOKUP("ebi1_clk",		ebi1_clk.c,		NULL),
 	CLK_LOOKUP("mmfpb_clk",		mmfpb_clk.c,		NULL),
diff --git a/drivers/cs/cs-etb.c b/drivers/cs/cs-etb.c
index 84d8e72..c4cf19e 100644
--- a/drivers/cs/cs-etb.c
+++ b/drivers/cs/cs-etb.c
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/mutex.h>
+#include <linux/clk.h>
 #include <linux/cs.h>
 
 #include "cs-priv.h"
@@ -74,6 +75,7 @@
 	atomic_t	in_use;
 	struct device	*dev;
 	struct kobject	*kobj;
+	struct clk	*clk;
 	uint32_t	trigger_cntr;
 };
 
@@ -99,15 +101,22 @@
 	ETB_LOCK();
 }
 
-void etb_enable(void)
+int etb_enable(void)
 {
+	int ret;
 	unsigned long flags;
 
+	ret = clk_prepare_enable(etb.clk);
+	if (ret)
+		return ret;
+
 	spin_lock_irqsave(&etb.spinlock, flags);
 	__etb_enable();
 	etb.enabled = true;
 	dev_info(etb.dev, "ETB enabled\n");
 	spin_unlock_irqrestore(&etb.spinlock, flags);
+
+	return 0;
 }
 
 static void __etb_disable(void)
@@ -147,6 +156,8 @@
 	etb.enabled = false;
 	dev_info(etb.dev, "ETB disabled\n");
 	spin_unlock_irqrestore(&etb.spinlock, flags);
+
+	clk_disable_unprepare(etb.clk);
 }
 
 static void __etb_dump(void)
@@ -275,13 +286,16 @@
 	.fops =		&etb_fops,
 };
 
-#define ETB_ATTR(__name)						\
-static struct kobj_attribute __name##_attr =				\
-	__ATTR(__name, S_IRUGO | S_IWUSR, __name##_show, __name##_store)
+static ssize_t etb_show_trigger_cntr(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etb.trigger_cntr;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
-static ssize_t trigger_cntr_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etb_store_trigger_cntr(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -289,16 +303,10 @@
 		return -EINVAL;
 
 	etb.trigger_cntr = val;
-	return n;
+	return size;
 }
-static ssize_t trigger_cntr_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
-{
-	unsigned long val = etb.trigger_cntr;
-	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
-}
-ETB_ATTR(trigger_cntr);
+static DEVICE_ATTR(trigger_cntr, S_IRUGO | S_IWUSR, etb_show_trigger_cntr,
+		   etb_store_trigger_cntr);
 
 static int __devinit etb_sysfs_init(void)
 {
@@ -311,7 +319,7 @@
 		goto err_create;
 	}
 
-	ret = sysfs_create_file(etb.kobj, &trigger_cntr_attr.attr);
+	ret = sysfs_create_file(etb.kobj, &dev_attr_trigger_cntr.attr);
 	if (ret) {
 		dev_err(etb.dev, "failed to create ETB sysfs trigger_cntr"
 		" attribute\n");
@@ -327,7 +335,7 @@
 
 static void __devexit etb_sysfs_exit(void)
 {
-	sysfs_remove_file(etb.kobj, &trigger_cntr_attr.attr);
+	sysfs_remove_file(etb.kobj, &dev_attr_trigger_cntr.attr);
 	kobject_put(etb.kobj);
 }
 
@@ -352,6 +360,16 @@
 
 	spin_lock_init(&etb.spinlock);
 
+	etb.clk = clk_get(etb.dev, "core_clk");
+	if (IS_ERR(etb.clk)) {
+		ret = PTR_ERR(etb.clk);
+		goto err_clk_get;
+	}
+
+	ret = clk_set_rate(etb.clk, CS_CLK_RATE_TRACE);
+	if (ret)
+		goto err_clk_rate;
+
 	ret = misc_register(&etb_misc);
 	if (ret)
 		goto err_misc;
@@ -370,6 +388,9 @@
 err_alloc:
 	misc_deregister(&etb_misc);
 err_misc:
+err_clk_rate:
+	clk_put(etb.clk);
+err_clk_get:
 	iounmap(etb.base);
 err_ioremap:
 err_res:
@@ -384,6 +405,7 @@
 	etb_sysfs_exit();
 	kfree(etb.buf);
 	misc_deregister(&etb_misc);
+	clk_put(etb.clk);
 	iounmap(etb.base);
 
 	return 0;
diff --git a/drivers/cs/cs-etm.c b/drivers/cs/cs-etm.c
index 724cc71..4e409cb 100644
--- a/drivers/cs/cs-etm.c
+++ b/drivers/cs/cs-etm.c
@@ -26,6 +26,7 @@
 #include <linux/pm_qos.h>
 #include <linux/sysfs.h>
 #include <linux/stat.h>
+#include <linux/clk.h>
 #include <linux/cs.h>
 #include <asm/sections.h>
 #include <mach/socinfo.h>
@@ -161,6 +162,7 @@
 	struct mutex			mutex;
 	struct device			*dev;
 	struct kobject			*kobj;
+	struct clk			*clk;
 	uint8_t				arch;
 	uint8_t				nr_addr_cmp;
 	uint8_t				nr_cntr;
@@ -351,6 +353,10 @@
 	 */
 	pm_qos_update_request(&etm.qos_req, 0);
 
+	ret = clk_prepare_enable(etm.clk);
+	if (ret)
+		goto err_clk;
+
 	ret = qdss_enable(etm.src);
 	if (ret)
 		goto err_qdss;
@@ -367,6 +373,8 @@
 	return 0;
 
 err_qdss:
+	clk_disable_unprepare(etm.clk);
+err_clk:
 	pm_qos_update_request(&etm.qos_req, PM_QOS_DEFAULT_VALUE);
 	wake_unlock(&etm.wake_lock);
 err:
@@ -409,9 +417,11 @@
 	for_each_online_cpu(cpu)
 		__etm_disable(cpu);
 
+	etm.enabled = false;
+
 	qdss_disable(etm.src);
 
-	etm.enabled = false;
+	clk_disable_unprepare(etm.clk);
 
 	pm_qos_update_request(&etm.qos_req, PM_QOS_DEFAULT_VALUE);
 	wake_unlock(&etm.wake_lock);
@@ -431,39 +441,16 @@
 	asm("isb\n\t");
 }
 
-#define ETM_STORE(__name, mask)						\
-static ssize_t __name##_store(struct kobject *kobj,			\
-			struct kobj_attribute *attr,			\
-			const char *buf, size_t n)			\
-{									\
-	unsigned long val;						\
-									\
-	if (sscanf(buf, "%lx", &val) != 1)				\
-		return -EINVAL;						\
-									\
-	etm.__name = val & mask;					\
-	return n;							\
+static ssize_t etm_show_enabled(struct device *dev,
+				struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.enabled;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
 
-#define ETM_SHOW(__name)						\
-static ssize_t __name##_show(struct kobject *kobj,			\
-			struct kobj_attribute *attr,			\
-			char *buf)					\
-{									\
-	unsigned long val = etm.__name;					\
-	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);		\
-}
-
-#define ETM_ATTR(__name)						\
-static struct kobj_attribute __name##_attr =				\
-	__ATTR(__name, S_IRUGO | S_IWUSR, __name##_show, __name##_store)
-#define ETM_ATTR_RO(__name)						\
-static struct kobj_attribute __name##_attr =				\
-	__ATTR(__name, S_IRUGO, __name##_show, NULL)
-
-static ssize_t enabled_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_enabled(struct device *dev,
+				 struct device_attribute *attr,
+				 const char *buf, size_t size)
 {
 	int ret = 0;
 	unsigned long val;
@@ -480,22 +467,46 @@
 
 	if (ret)
 		return ret;
-	return n;
+	return size;
 }
-ETM_SHOW(enabled);
-ETM_ATTR(enabled);
+static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, etm_show_enabled,
+		   etm_store_enabled);
 
-ETM_SHOW(nr_addr_cmp);
-ETM_ATTR_RO(nr_addr_cmp);
-ETM_SHOW(nr_cntr);
-ETM_ATTR_RO(nr_cntr);
-ETM_SHOW(nr_ctxid_cmp);
-ETM_ATTR_RO(nr_ctxid_cmp);
+static ssize_t etm_show_nr_addr_cmp(struct device *dev,
+				    struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.nr_addr_cmp;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR(nr_addr_cmp, S_IRUGO, etm_show_nr_addr_cmp, NULL);
+
+static ssize_t etm_show_nr_cntr(struct device *dev,
+				struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.nr_cntr;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR(nr_cntr, S_IRUGO, etm_show_nr_cntr, NULL);
+
+static ssize_t etm_show_nr_ctxid_cmp(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.nr_ctxid_cmp;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR(nr_ctxid_cmp, S_IRUGO, etm_show_nr_ctxid_cmp, NULL);
+
+static ssize_t etm_show_reset(struct device *dev, struct device_attribute *attr,
+			      char *buf)
+{
+	unsigned long val = etm.reset;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
 /* Reset to trace everything i.e. exclude nothing. */
-static ssize_t reset_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_reset(struct device *dev,
+			       struct device_attribute *attr, const char *buf,
+			       size_t size)
 {
 	int i;
 	unsigned long val;
@@ -544,14 +555,19 @@
 		etm.timestamp_event = 0x406F;
 	}
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-ETM_SHOW(reset);
-ETM_ATTR(reset);
+static DEVICE_ATTR(reset, S_IRUGO | S_IWUSR, etm_show_reset, etm_store_reset);
 
-static ssize_t mode_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_show_mode(struct device *dev, struct device_attribute *attr,
+			      char *buf)
+{
+	unsigned long val = etm.mode;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_mode(struct device *dev, struct device_attribute *attr,
+			      const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -586,26 +602,86 @@
 		etm.ctrl &= ~(BIT(14) | BIT(15));
 	mutex_unlock(&etm.mutex);
 
-	return n;
+	return size;
 }
-ETM_SHOW(mode);
-ETM_ATTR(mode);
+static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, etm_show_mode, etm_store_mode);
 
-ETM_STORE(trigger_event, ETM_EVENT_MASK);
-ETM_SHOW(trigger_event);
-ETM_ATTR(trigger_event);
+static ssize_t etm_show_trigger_event(struct device *dev,
+				      struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.trigger_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
-ETM_STORE(enable_event, ETM_EVENT_MASK);
-ETM_SHOW(enable_event);
-ETM_ATTR(enable_event);
+static ssize_t etm_store_trigger_event(struct device *dev,
+				       struct device_attribute *attr,
+				       const char *buf, size_t size)
+{
+	unsigned long val;
 
-ETM_STORE(fifofull_level, ETM_ALL_MASK);
-ETM_SHOW(fifofull_level);
-ETM_ATTR(fifofull_level);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
 
-static ssize_t addr_idx_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+	etm.trigger_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(trigger_event, S_IRUGO | S_IWUSR, etm_show_trigger_event,
+		   etm_store_trigger_event);
+
+static ssize_t etm_show_enable_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.enable_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_enable_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.enable_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(enable_event, S_IRUGO | S_IWUSR, etm_show_enable_event,
+		   etm_store_enable_event);
+
+static ssize_t etm_show_fifofull_level(struct device *dev,
+				       struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.fifofull_level;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_fifofull_level(struct device *dev,
+					struct device_attribute *attr,
+					const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.fifofull_level = val;
+	return size;
+}
+static DEVICE_ATTR(fifofull_level, S_IRUGO | S_IWUSR, etm_show_fifofull_level,
+		   etm_store_fifofull_level);
+
+static ssize_t etm_show_addr_idx(struct device *dev,
+				 struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.addr_idx;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_addr_idx(struct device *dev,
+				  struct device_attribute *attr,
+				  const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -620,14 +696,33 @@
 	mutex_lock(&etm.mutex);
 	etm.addr_idx = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-ETM_SHOW(addr_idx);
-ETM_ATTR(addr_idx);
+static DEVICE_ATTR(addr_idx, S_IRUGO | S_IWUSR, etm_show_addr_idx,
+		   etm_store_addr_idx);
 
-static ssize_t addr_single_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_show_addr_single(struct device *dev,
+				    struct device_attribute *attr, char *buf)
+{
+	unsigned long val;
+	uint8_t idx;
+
+	mutex_lock(&etm.mutex);
+	idx = etm.addr_idx;
+	if (!(etm.addr_type[idx] == ETM_ADDR_TYPE_NONE ||
+	      etm.addr_type[idx] == ETM_ADDR_TYPE_SINGLE)) {
+		mutex_unlock(&etm.mutex);
+		return -EPERM;
+	}
+
+	val = etm.addr_val[idx];
+	mutex_unlock(&etm.mutex);
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_addr_single(struct device *dev,
+				     struct device_attribute *attr,
+				     const char *buf, size_t size)
 {
 	unsigned long val;
 	uint8_t idx;
@@ -646,32 +741,40 @@
 	etm.addr_val[idx] = val;
 	etm.addr_type[idx] = ETM_ADDR_TYPE_SINGLE;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t addr_single_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(addr_single, S_IRUGO | S_IWUSR, etm_show_addr_single,
+		   etm_store_addr_single);
+
+static ssize_t etm_show_addr_range(struct device *dev,
+				   struct device_attribute *attr, char *buf)
 {
-	unsigned long val;
+	unsigned long val1, val2;
 	uint8_t idx;
 
 	mutex_lock(&etm.mutex);
 	idx = etm.addr_idx;
-	if (!(etm.addr_type[idx] == ETM_ADDR_TYPE_NONE ||
-	      etm.addr_type[idx] == ETM_ADDR_TYPE_SINGLE)) {
+	if (idx % 2 != 0) {
+		mutex_unlock(&etm.mutex);
+		return -EPERM;
+	}
+	if (!((etm.addr_type[idx] == ETM_ADDR_TYPE_NONE &&
+	       etm.addr_type[idx + 1] == ETM_ADDR_TYPE_NONE) ||
+	      (etm.addr_type[idx] == ETM_ADDR_TYPE_RANGE &&
+	       etm.addr_type[idx + 1] == ETM_ADDR_TYPE_RANGE))) {
 		mutex_unlock(&etm.mutex);
 		return -EPERM;
 	}
 
-	val = etm.addr_val[idx];
+	val1 = etm.addr_val[idx];
+	val2 = etm.addr_val[idx + 1];
 	mutex_unlock(&etm.mutex);
-	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+	return scnprintf(buf, PAGE_SIZE, "%#lx %#lx\n", val1, val2);
 }
-ETM_ATTR(addr_single);
 
-static ssize_t addr_range_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_addr_range(struct device *dev,
+				    struct device_attribute *attr,
+				    const char *buf, size_t size)
 {
 	unsigned long val1, val2;
 	uint8_t idx;
@@ -702,39 +805,33 @@
 	etm.addr_type[idx + 1] = ETM_ADDR_TYPE_RANGE;
 	etm.enable_ctrl1 |= (1 << (idx/2));
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t addr_range_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(addr_range, S_IRUGO | S_IWUSR, etm_show_addr_range,
+		   etm_store_addr_range);
+
+static ssize_t etm_show_addr_start(struct device *dev,
+				   struct device_attribute *attr, char *buf)
 {
-	unsigned long val1, val2;
+	unsigned long val;
 	uint8_t idx;
 
 	mutex_lock(&etm.mutex);
 	idx = etm.addr_idx;
-	if (idx % 2 != 0) {
-		mutex_unlock(&etm.mutex);
-		return -EPERM;
-	}
-	if (!((etm.addr_type[idx] == ETM_ADDR_TYPE_NONE &&
-	       etm.addr_type[idx + 1] == ETM_ADDR_TYPE_NONE) ||
-	      (etm.addr_type[idx] == ETM_ADDR_TYPE_RANGE &&
-	       etm.addr_type[idx + 1] == ETM_ADDR_TYPE_RANGE))) {
+	if (!(etm.addr_type[idx] == ETM_ADDR_TYPE_NONE ||
+	      etm.addr_type[idx] == ETM_ADDR_TYPE_START)) {
 		mutex_unlock(&etm.mutex);
 		return -EPERM;
 	}
 
-	val1 = etm.addr_val[idx];
-	val2 = etm.addr_val[idx + 1];
+	val = etm.addr_val[idx];
 	mutex_unlock(&etm.mutex);
-	return scnprintf(buf, PAGE_SIZE, "%#lx %#lx\n", val1, val2);
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(addr_range);
 
-static ssize_t addr_start_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_addr_start(struct device *dev,
+				    struct device_attribute *attr,
+				    const char *buf, size_t size)
 {
 	unsigned long val;
 	uint8_t idx;
@@ -755,11 +852,13 @@
 	etm.startstop_ctrl |= (1 << idx);
 	etm.enable_ctrl1 |= BIT(25);
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t addr_start_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(addr_start, S_IRUGO | S_IWUSR, etm_show_addr_start,
+		   etm_store_addr_start);
+
+static ssize_t etm_show_addr_stop(struct device *dev,
+				  struct device_attribute *attr, char *buf)
 {
 	unsigned long val;
 	uint8_t idx;
@@ -767,7 +866,7 @@
 	mutex_lock(&etm.mutex);
 	idx = etm.addr_idx;
 	if (!(etm.addr_type[idx] == ETM_ADDR_TYPE_NONE ||
-	      etm.addr_type[idx] == ETM_ADDR_TYPE_START)) {
+	      etm.addr_type[idx] == ETM_ADDR_TYPE_STOP)) {
 		mutex_unlock(&etm.mutex);
 		return -EPERM;
 	}
@@ -776,11 +875,10 @@
 	mutex_unlock(&etm.mutex);
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(addr_start);
 
-static ssize_t addr_stop_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_addr_stop(struct device *dev,
+				  struct device_attribute *attr,
+				  const char *buf, size_t size)
 {
 	unsigned long val;
 	uint8_t idx;
@@ -801,32 +899,25 @@
 	etm.startstop_ctrl |= (1 << (idx + 16));
 	etm.enable_ctrl1 |= BIT(25);
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t addr_stop_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(addr_stop, S_IRUGO | S_IWUSR, etm_show_addr_stop,
+		   etm_store_addr_stop);
+
+static ssize_t etm_show_addr_acctype(struct device *dev,
+				     struct device_attribute *attr, char *buf)
 {
 	unsigned long val;
-	uint8_t idx;
 
 	mutex_lock(&etm.mutex);
-	idx = etm.addr_idx;
-	if (!(etm.addr_type[idx] == ETM_ADDR_TYPE_NONE ||
-	      etm.addr_type[idx] == ETM_ADDR_TYPE_STOP)) {
-		mutex_unlock(&etm.mutex);
-		return -EPERM;
-	}
-
-	val = etm.addr_val[idx];
+	val = etm.addr_acctype[etm.addr_idx];
 	mutex_unlock(&etm.mutex);
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(addr_stop);
 
-static ssize_t addr_acctype_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_addr_acctype(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -836,24 +927,21 @@
 	mutex_lock(&etm.mutex);
 	etm.addr_acctype[etm.addr_idx] = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t addr_acctype_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
-{
-	unsigned long val;
+static DEVICE_ATTR(addr_acctype, S_IRUGO | S_IWUSR, etm_show_addr_acctype,
+		   etm_store_addr_acctype);
 
-	mutex_lock(&etm.mutex);
-	val = etm.addr_acctype[etm.addr_idx];
-	mutex_unlock(&etm.mutex);
+static ssize_t etm_show_cntr_idx(struct device *dev,
+				 struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.addr_idx;
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(addr_acctype);
 
-static ssize_t cntr_idx_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_cntr_idx(struct device *dev,
+				  struct device_attribute *attr,
+				  const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -868,14 +956,24 @@
 	mutex_lock(&etm.mutex);
 	etm.cntr_idx = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-ETM_SHOW(cntr_idx);
-ETM_ATTR(cntr_idx);
+static DEVICE_ATTR(cntr_idx, S_IRUGO | S_IWUSR, etm_show_cntr_idx,
+		   etm_store_cntr_idx);
 
-static ssize_t cntr_rld_val_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_show_cntr_rld_val(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val;
+	mutex_lock(&etm.mutex);
+	val = etm.cntr_rld_val[etm.cntr_idx];
+	mutex_unlock(&etm.mutex);
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_cntr_rld_val(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -885,23 +983,25 @@
 	mutex_lock(&etm.mutex);
 	etm.cntr_rld_val[etm.cntr_idx] = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t cntr_rld_val_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(cntr_rld_val, S_IRUGO | S_IWUSR, etm_show_cntr_rld_val,
+		   etm_store_cntr_rld_val);
+
+static ssize_t etm_show_cntr_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
 {
 	unsigned long val;
+
 	mutex_lock(&etm.mutex);
-	val = etm.cntr_rld_val[etm.cntr_idx];
+	val = etm.cntr_event[etm.cntr_idx];
 	mutex_unlock(&etm.mutex);
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(cntr_rld_val);
 
-static ssize_t cntr_event_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_cntr_event(struct device *dev,
+				    struct device_attribute *attr,
+				    const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -911,24 +1011,25 @@
 	mutex_lock(&etm.mutex);
 	etm.cntr_event[etm.cntr_idx] = val & ETM_EVENT_MASK;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t cntr_event_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(cntr_event, S_IRUGO | S_IWUSR, etm_show_cntr_event,
+		   etm_store_cntr_event);
+
+static ssize_t etm_show_cntr_rld_event(struct device *dev,
+				       struct device_attribute *attr, char *buf)
 {
 	unsigned long val;
 
 	mutex_lock(&etm.mutex);
-	val = etm.cntr_event[etm.cntr_idx];
+	val = etm.cntr_rld_event[etm.cntr_idx];
 	mutex_unlock(&etm.mutex);
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(cntr_event);
 
-static ssize_t cntr_rld_event_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_cntr_rld_event(struct device *dev,
+					struct device_attribute *attr,
+					const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -938,24 +1039,25 @@
 	mutex_lock(&etm.mutex);
 	etm.cntr_rld_event[etm.cntr_idx] = val & ETM_EVENT_MASK;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t cntr_rld_event_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(cntr_rld_event, S_IRUGO | S_IWUSR, etm_show_cntr_rld_event,
+		   etm_store_cntr_rld_event);
+
+static ssize_t etm_show_cntr_val(struct device *dev,
+				 struct device_attribute *attr, char *buf)
 {
 	unsigned long val;
 
 	mutex_lock(&etm.mutex);
-	val = etm.cntr_rld_event[etm.cntr_idx];
+	val = etm.cntr_val[etm.cntr_idx];
 	mutex_unlock(&etm.mutex);
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(cntr_rld_event);
 
-static ssize_t cntr_val_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_store_cntr_val(struct device *dev,
+				  struct device_attribute *attr,
+				  const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -965,48 +1067,153 @@
 	mutex_lock(&etm.mutex);
 	etm.cntr_val[etm.cntr_idx] = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t cntr_val_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(cntr_val, S_IRUGO | S_IWUSR, etm_show_cntr_val,
+		   etm_store_cntr_val);
+
+static ssize_t etm_show_seq_12_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_12_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_seq_12_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
 {
 	unsigned long val;
 
-	mutex_lock(&etm.mutex);
-	val = etm.cntr_val[etm.cntr_idx];
-	mutex_unlock(&etm.mutex);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.seq_12_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_12_event, S_IRUGO | S_IWUSR, etm_show_seq_12_event,
+		   etm_store_seq_12_event);
+
+static ssize_t etm_show_seq_21_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_21_event;
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(cntr_val);
 
-ETM_STORE(seq_12_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_12_event);
-ETM_ATTR(seq_12_event);
+static ssize_t etm_store_seq_21_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
 
-ETM_STORE(seq_21_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_21_event);
-ETM_ATTR(seq_21_event);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
 
-ETM_STORE(seq_23_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_23_event);
-ETM_ATTR(seq_23_event);
+	etm.seq_21_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_21_event, S_IRUGO | S_IWUSR, etm_show_seq_21_event,
+		   etm_store_seq_21_event);
 
-ETM_STORE(seq_31_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_31_event);
-ETM_ATTR(seq_31_event);
+static ssize_t etm_show_seq_23_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_23_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
-ETM_STORE(seq_32_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_32_event);
-ETM_ATTR(seq_32_event);
+static ssize_t etm_store_seq_23_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
 
-ETM_STORE(seq_13_event, ETM_EVENT_MASK);
-ETM_SHOW(seq_13_event);
-ETM_ATTR(seq_13_event);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
 
-static ssize_t seq_curr_state_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+	etm.seq_23_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_23_event, S_IRUGO | S_IWUSR, etm_show_seq_23_event,
+		   etm_store_seq_23_event);
+
+static ssize_t etm_show_seq_31_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_31_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_seq_31_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.seq_31_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_31_event, S_IRUGO | S_IWUSR, etm_show_seq_31_event,
+		   etm_store_seq_31_event);
+
+static ssize_t etm_show_seq_32_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_32_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_seq_32_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.seq_32_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_32_event, S_IRUGO | S_IWUSR, etm_show_seq_32_event,
+		   etm_store_seq_32_event);
+
+static ssize_t etm_show_seq_13_event(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_13_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_seq_13_event(struct device *dev,
+				      struct device_attribute *attr,
+				      const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.seq_13_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(seq_13_event, S_IRUGO | S_IWUSR, etm_show_seq_13_event,
+		   etm_store_seq_13_event);
+
+static ssize_t etm_show_seq_curr_state(struct device *dev,
+				       struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.seq_curr_state;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_seq_curr_state(struct device *dev,
+					struct device_attribute *attr,
+					const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -1016,14 +1223,21 @@
 		return -EINVAL;
 
 	etm.seq_curr_state = val;
-	return n;
+	return size;
 }
-ETM_SHOW(seq_curr_state);
-ETM_ATTR(seq_curr_state);
+static DEVICE_ATTR(seq_curr_state, S_IRUGO | S_IWUSR, etm_show_seq_curr_state,
+		   etm_store_seq_curr_state);
 
-static ssize_t ctxid_idx_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_show_ctxid_idx(struct device *dev,
+				  struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.ctxid_idx;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_ctxid_idx(struct device *dev,
+				   struct device_attribute *attr,
+				   const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -1038,14 +1252,25 @@
 	mutex_lock(&etm.mutex);
 	etm.ctxid_idx = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-ETM_SHOW(ctxid_idx);
-ETM_ATTR(ctxid_idx);
+static DEVICE_ATTR(ctxid_idx, S_IRUGO | S_IWUSR, etm_show_ctxid_idx,
+		   etm_store_ctxid_idx);
 
-static ssize_t ctxid_val_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t etm_show_ctxid_val(struct device *dev,
+				  struct device_attribute *attr, char *buf)
+{
+	unsigned long val;
+
+	mutex_lock(&etm.mutex);
+	val = etm.ctxid_val[etm.ctxid_idx];
+	mutex_unlock(&etm.mutex);
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_ctxid_val(struct device *dev,
+				   struct device_attribute *attr,
+				   const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -1055,65 +1280,110 @@
 	mutex_lock(&etm.mutex);
 	etm.ctxid_val[etm.ctxid_idx] = val;
 	mutex_unlock(&etm.mutex);
-	return n;
+	return size;
 }
-static ssize_t ctxid_val_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(ctxid_val, S_IRUGO | S_IWUSR, etm_show_ctxid_val,
+		   etm_store_ctxid_val);
+
+static ssize_t etm_show_ctxid_mask(struct device *dev,
+				   struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.ctxid_mask;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_ctxid_mask(struct device *dev,
+				    struct device_attribute *attr,
+				    const char *buf, size_t size)
 {
 	unsigned long val;
 
-	mutex_lock(&etm.mutex);
-	val = etm.ctxid_val[etm.ctxid_idx];
-	mutex_unlock(&etm.mutex);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.ctxid_mask = val;
+	return size;
+}
+static DEVICE_ATTR(ctxid_mask, S_IRUGO | S_IWUSR, etm_show_ctxid_mask,
+		   etm_store_ctxid_mask);
+
+static ssize_t etm_show_sync_freq(struct device *dev,
+				  struct device_attribute *attr, char *buf)
+{
+	unsigned long val = etm.sync_freq;
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-ETM_ATTR(ctxid_val);
 
-ETM_STORE(ctxid_mask, ETM_ALL_MASK);
-ETM_SHOW(ctxid_mask);
-ETM_ATTR(ctxid_mask);
+static ssize_t etm_store_sync_freq(struct device *dev,
+				   struct device_attribute *attr,
+				   const char *buf, size_t size)
+{
+	unsigned long val;
 
-ETM_STORE(sync_freq, ETM_SYNC_MASK);
-ETM_SHOW(sync_freq);
-ETM_ATTR(sync_freq);
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
 
-ETM_STORE(timestamp_event, ETM_EVENT_MASK);
-ETM_SHOW(timestamp_event);
-ETM_ATTR(timestamp_event);
+	etm.sync_freq = val & ETM_SYNC_MASK;
+	return size;
+}
+static DEVICE_ATTR(sync_freq, S_IRUGO | S_IWUSR, etm_show_sync_freq,
+		   etm_store_sync_freq);
+
+static ssize_t etm_show_timestamp_event(struct device *dev,
+					struct device_attribute *attr,
+					char *buf)
+{
+	unsigned long val = etm.timestamp_event;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+
+static ssize_t etm_store_timestamp_event(struct device *dev,
+					 struct device_attribute *attr,
+					 const char *buf, size_t size)
+{
+	unsigned long val;
+
+	if (sscanf(buf, "%lx", &val) != 1)
+		return -EINVAL;
+
+	etm.timestamp_event = val & ETM_EVENT_MASK;
+	return size;
+}
+static DEVICE_ATTR(timestamp_event, S_IRUGO | S_IWUSR, etm_show_timestamp_event,
+		   etm_store_timestamp_event);
 
 static struct attribute *etm_attrs[] = {
-	&nr_addr_cmp_attr.attr,
-	&nr_cntr_attr.attr,
-	&nr_ctxid_cmp_attr.attr,
-	&reset_attr.attr,
-	&mode_attr.attr,
-	&trigger_event_attr.attr,
-	&enable_event_attr.attr,
-	&fifofull_level_attr.attr,
-	&addr_idx_attr.attr,
-	&addr_single_attr.attr,
-	&addr_range_attr.attr,
-	&addr_start_attr.attr,
-	&addr_stop_attr.attr,
-	&addr_acctype_attr.attr,
-	&cntr_idx_attr.attr,
-	&cntr_rld_val_attr.attr,
-	&cntr_event_attr.attr,
-	&cntr_rld_event_attr.attr,
-	&cntr_val_attr.attr,
-	&seq_12_event_attr.attr,
-	&seq_21_event_attr.attr,
-	&seq_23_event_attr.attr,
-	&seq_31_event_attr.attr,
-	&seq_32_event_attr.attr,
-	&seq_13_event_attr.attr,
-	&seq_curr_state_attr.attr,
-	&ctxid_idx_attr.attr,
-	&ctxid_val_attr.attr,
-	&ctxid_mask_attr.attr,
-	&sync_freq_attr.attr,
-	&timestamp_event_attr.attr,
+	&dev_attr_nr_addr_cmp.attr,
+	&dev_attr_nr_cntr.attr,
+	&dev_attr_nr_ctxid_cmp.attr,
+	&dev_attr_reset.attr,
+	&dev_attr_mode.attr,
+	&dev_attr_trigger_event.attr,
+	&dev_attr_enable_event.attr,
+	&dev_attr_fifofull_level.attr,
+	&dev_attr_addr_idx.attr,
+	&dev_attr_addr_single.attr,
+	&dev_attr_addr_range.attr,
+	&dev_attr_addr_start.attr,
+	&dev_attr_addr_stop.attr,
+	&dev_attr_addr_acctype.attr,
+	&dev_attr_cntr_idx.attr,
+	&dev_attr_cntr_rld_val.attr,
+	&dev_attr_cntr_event.attr,
+	&dev_attr_cntr_rld_event.attr,
+	&dev_attr_cntr_val.attr,
+	&dev_attr_seq_12_event.attr,
+	&dev_attr_seq_21_event.attr,
+	&dev_attr_seq_23_event.attr,
+	&dev_attr_seq_31_event.attr,
+	&dev_attr_seq_32_event.attr,
+	&dev_attr_seq_13_event.attr,
+	&dev_attr_seq_curr_state.attr,
+	&dev_attr_ctxid_idx.attr,
+	&dev_attr_ctxid_val.attr,
+	&dev_attr_ctxid_mask.attr,
+	&dev_attr_sync_freq.attr,
+	&dev_attr_timestamp_event.attr,
 	NULL,
 };
 
@@ -1132,7 +1402,7 @@
 		goto err_create;
 	}
 
-	ret = sysfs_create_file(etm.kobj, &enabled_attr.attr);
+	ret = sysfs_create_file(etm.kobj, &dev_attr_enabled.attr);
 	if (ret) {
 		dev_err(etm.dev, "failed to create ETM sysfs enabled"
 		" attribute\n");
@@ -1152,7 +1422,7 @@
 static void __devexit etm_sysfs_exit(void)
 {
 	sysfs_remove_group(etm.kobj, &etm_attr_grp);
-	sysfs_remove_file(etm.kobj, &enabled_attr.attr);
+	sysfs_remove_file(etm.kobj, &dev_attr_enabled.attr);
 	kobject_put(etm.kobj);
 }
 
@@ -1253,9 +1523,19 @@
 		goto err_qdssget;
 	}
 
-	ret = qdss_clk_enable();
+	etm.clk = clk_get(etm.dev, "core_clk");
+	if (IS_ERR(etm.clk)) {
+		ret = PTR_ERR(etm.clk);
+		goto err_clk_get;
+	}
+
+	ret = clk_set_rate(etm.clk, CS_CLK_RATE_TRACE);
 	if (ret)
-		goto err_clk;
+		goto err_clk_rate;
+
+	ret = clk_prepare_enable(etm.clk);
+	if (ret)
+		goto err_clk_enable;
 
 	ret = etm_arch_init();
 	if (ret)
@@ -1267,7 +1547,7 @@
 
 	etm.enabled = false;
 
-	qdss_clk_disable();
+	clk_disable_unprepare(etm.clk);
 
 	dev_info(etm.dev, "ETM initialized\n");
 
@@ -1278,8 +1558,11 @@
 
 err_sysfs:
 err_arch:
-	qdss_clk_disable();
-err_clk:
+	clk_disable_unprepare(etm.clk);
+err_clk_enable:
+err_clk_rate:
+	clk_put(etm.clk);
+err_clk_get:
 	qdss_put(etm.src);
 err_qdssget:
 	pm_qos_remove_request(&etm.qos_req);
@@ -1297,6 +1580,7 @@
 	if (etm.enabled)
 		etm_disable();
 	etm_sysfs_exit();
+	clk_put(etm.clk);
 	qdss_put(etm.src);
 	pm_qos_remove_request(&etm.qos_req);
 	wake_lock_destroy(&etm.wake_lock);
diff --git a/drivers/cs/cs-funnel.c b/drivers/cs/cs-funnel.c
index 2ae8ac9..414023d 100644
--- a/drivers/cs/cs-funnel.c
+++ b/drivers/cs/cs-funnel.c
@@ -18,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/err.h>
+#include <linux/clk.h>
 #include <linux/cs.h>
 
 #include "cs-priv.h"
@@ -56,6 +57,7 @@
 	struct mutex	mutex;
 	struct device	*dev;
 	struct kobject	*kobj;
+	struct clk	*clk;
 	uint32_t	priority;
 };
 
@@ -77,14 +79,22 @@
 	FUNNEL_LOCK(id);
 }
 
-void funnel_enable(uint8_t id, uint32_t port_mask)
+int funnel_enable(uint8_t id, uint32_t port_mask)
 {
+	int ret;
+
+	ret = clk_prepare_enable(funnel.clk);
+	if (ret)
+		return ret;
+
 	mutex_lock(&funnel.mutex);
 	__funnel_enable(id, port_mask);
 	funnel.enabled = true;
 	dev_info(funnel.dev, "FUNNEL port mask 0x%lx enabled\n",
 					(unsigned long) port_mask);
 	mutex_unlock(&funnel.mutex);
+
+	return 0;
 }
 
 static void __funnel_disable(uint8_t id, uint32_t port_mask)
@@ -108,15 +118,20 @@
 	dev_info(funnel.dev, "FUNNEL port mask 0x%lx disabled\n",
 					(unsigned long) port_mask);
 	mutex_unlock(&funnel.mutex);
+
+	clk_disable_unprepare(funnel.clk);
 }
 
-#define FUNNEL_ATTR(__name)						\
-static struct kobj_attribute __name##_attr =				\
-	__ATTR(__name, S_IRUGO | S_IWUSR, __name##_show, __name##_store)
+static ssize_t funnel_show_priority(struct device *dev,
+				    struct device_attribute *attr, char *buf)
+{
+	unsigned long val = funnel.priority;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
-static ssize_t priority_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t funnel_store_priority(struct device *dev,
+				     struct device_attribute *attr,
+				     const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -124,16 +139,10 @@
 		return -EINVAL;
 
 	funnel.priority = val;
-	return n;
+	return size;
 }
-static ssize_t priority_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
-{
-	unsigned long val = funnel.priority;
-	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
-}
-FUNNEL_ATTR(priority);
+static DEVICE_ATTR(priority, S_IRUGO | S_IWUSR, funnel_show_priority,
+		   funnel_store_priority);
 
 static int __devinit funnel_sysfs_init(void)
 {
@@ -146,7 +155,7 @@
 		goto err_create;
 	}
 
-	ret = sysfs_create_file(funnel.kobj, &priority_attr.attr);
+	ret = sysfs_create_file(funnel.kobj, &dev_attr_priority.attr);
 	if (ret) {
 		dev_err(funnel.dev, "failed to create FUNNEL sysfs priority"
 		" attribute\n");
@@ -162,7 +171,7 @@
 
 static void __devexit funnel_sysfs_exit(void)
 {
-	sysfs_remove_file(funnel.kobj, &priority_attr.attr);
+	sysfs_remove_file(funnel.kobj, &dev_attr_priority.attr);
 	kobject_put(funnel.kobj);
 }
 
@@ -187,11 +196,26 @@
 
 	mutex_init(&funnel.mutex);
 
+	funnel.clk = clk_get(funnel.dev, "core_clk");
+	if (IS_ERR(funnel.clk)) {
+		ret = PTR_ERR(funnel.clk);
+		goto err_clk_get;
+	}
+
+	ret = clk_set_rate(funnel.clk, CS_CLK_RATE_TRACE);
+	if (ret)
+		goto err_clk_rate;
+
 	funnel_sysfs_init();
 
 	dev_info(funnel.dev, "FUNNEL initialized\n");
 	return 0;
 
+err_clk_rate:
+	clk_put(funnel.clk);
+err_clk_get:
+	mutex_destroy(&funnel.mutex);
+	iounmap(funnel.base);
 err_ioremap:
 err_res:
 	dev_err(funnel.dev, "FUNNEL init failed\n");
@@ -203,6 +227,7 @@
 	if (funnel.enabled)
 		funnel_disable(0x0, 0xFF);
 	funnel_sysfs_exit();
+	clk_put(funnel.clk);
 	mutex_destroy(&funnel.mutex);
 	iounmap(funnel.base);
 
diff --git a/drivers/cs/cs-priv.h b/drivers/cs/cs-priv.h
index d89f461..a4028f5 100644
--- a/drivers/cs/cs-priv.h
+++ b/drivers/cs/cs-priv.h
@@ -36,11 +36,11 @@
 #define BMVAL(val, lsb, msb)	((val & BM(lsb, msb)) >> lsb)
 #define BVAL(val, n)		((val & BIT(n)) >> n)
 
-void etb_enable(void);
+int etb_enable(void);
 void etb_disable(void);
 void etb_dump(void);
 void tpiu_disable(void);
-void funnel_enable(uint8_t id, uint32_t port_mask);
+int funnel_enable(uint8_t id, uint32_t port_mask);
 void funnel_disable(uint8_t id, uint32_t port_mask);
 
 struct kobject *qdss_get_modulekobj(void);
diff --git a/drivers/cs/cs-stm.c b/drivers/cs/cs-stm.c
index ddc22a3d..8f4b6f8 100644
--- a/drivers/cs/cs-stm.c
+++ b/drivers/cs/cs-stm.c
@@ -22,6 +22,7 @@
 #include <linux/miscdevice.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
+#include <linux/clk.h>
 #include <linux/cs.h>
 #include <linux/cs-stm.h>
 #include <asm/unaligned.h>
@@ -98,6 +99,7 @@
 	struct qdss_source	*src;
 	struct device		*dev;
 	struct kobject		*kobj;
+	struct clk		*clk;
 	uint32_t		entity;
 	struct channel_space	chs;
 };
@@ -129,9 +131,13 @@
 		goto err;
 	}
 
+	ret = clk_prepare_enable(stm.clk);
+	if (ret)
+		goto err_clk;
+
 	ret = qdss_enable(stm.src);
 	if (ret)
-		goto err;
+		goto err_qdss;
 
 	__stm_enable();
 
@@ -140,6 +146,9 @@
 	dev_info(stm.dev, "STM tracing enabled\n");
 	return 0;
 
+err_qdss:
+	clk_disable_unprepare(stm.clk);
+err_clk:
 err:
 	return ret;
 }
@@ -167,9 +176,11 @@
 
 	__stm_disable();
 
+	stm.enabled = false;
+
 	qdss_disable(stm.src);
 
-	stm.enabled = false;
+	clk_disable_unprepare(stm.clk);
 
 	dev_info(stm.dev, "STM tracing disabled\n");
 	return 0;
@@ -386,13 +397,16 @@
 	.fops		= &stm_fops,
 };
 
-#define STM_ATTR(__name)						\
-static struct kobj_attribute __name##_attr =				\
-	__ATTR(__name, S_IRUGO | S_IWUSR, __name##_show, __name##_store)
+static ssize_t stm_show_enabled(struct device *dev,
+				struct device_attribute *attr, char *buf)
+{
+	unsigned long val = stm.enabled;
+	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
 
-static ssize_t enabled_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t stm_store_enabled(struct device *dev,
+				 struct device_attribute *attr,
+				const char *buf, size_t size)
 {
 	int ret = 0;
 	unsigned long val;
@@ -407,20 +421,21 @@
 
 	if (ret)
 		return ret;
-	return n;
+	return size;
 }
-static ssize_t enabled_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
+static DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, stm_show_enabled,
+		   stm_store_enabled);
+
+static ssize_t stm_show_entity(struct device *dev,
+			       struct device_attribute *attr, char *buf)
 {
-	unsigned long val = stm.enabled;
+	unsigned long val = stm.entity;
 	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
-STM_ATTR(enabled);
 
-static ssize_t entity_store(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			const char *buf, size_t n)
+static ssize_t stm_store_entity(struct device *dev,
+				struct device_attribute *attr,
+				const char *buf, size_t size)
 {
 	unsigned long val;
 
@@ -428,16 +443,10 @@
 		return -EINVAL;
 
 	stm.entity = val;
-	return n;
+	return size;
 }
-static ssize_t entity_show(struct kobject *kobj,
-			struct kobj_attribute *attr,
-			char *buf)
-{
-	unsigned long val = stm.entity;
-	return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
-}
-STM_ATTR(entity);
+static DEVICE_ATTR(entity, S_IRUGO | S_IWUSR, stm_show_entity,
+		   stm_store_entity);
 
 static int __devinit stm_sysfs_init(void)
 {
@@ -450,13 +459,13 @@
 		goto err_create;
 	}
 
-	ret = sysfs_create_file(stm.kobj, &enabled_attr.attr);
+	ret = sysfs_create_file(stm.kobj, &dev_attr_enabled.attr);
 	if (ret) {
 		dev_err(stm.dev, "failed to create STM sysfs enabled attr\n");
 		goto err_file;
 	}
 
-	if (sysfs_create_file(stm.kobj, &entity_attr.attr))
+	if (sysfs_create_file(stm.kobj, &dev_attr_entity.attr))
 		dev_err(stm.dev, "failed to create STM sysfs entity attr\n");
 
 	return 0;
@@ -468,8 +477,8 @@
 
 static void __devexit stm_sysfs_exit(void)
 {
-	sysfs_remove_file(stm.kobj, &entity_attr.attr);
-	sysfs_remove_file(stm.kobj, &enabled_attr.attr);
+	sysfs_remove_file(stm.kobj, &dev_attr_entity.attr);
+	sysfs_remove_file(stm.kobj, &dev_attr_enabled.attr);
 	kobject_put(stm.kobj);
 }
 
@@ -531,6 +540,16 @@
 		goto err_qdssget;
 	}
 
+	stm.clk = clk_get(stm.dev, "core_clk");
+	if (IS_ERR(stm.clk)) {
+		ret = PTR_ERR(stm.clk);
+		goto err_clk_get;
+	}
+
+	ret = clk_set_rate(stm.clk, CS_CLK_RATE_TRACE);
+	if (ret)
+		goto err_clk_rate;
+
 	ret = stm_sysfs_init();
 	if (ret)
 		goto err_sysfs;
@@ -542,6 +561,9 @@
 	return 0;
 
 err_sysfs:
+err_clk_rate:
+	clk_put(stm.clk);
+err_clk_get:
 	qdss_put(stm.src);
 err_qdssget:
 	misc_deregister(&stm_misc);
@@ -563,6 +585,7 @@
 	if (stm.enabled)
 		stm_disable();
 	stm_sysfs_exit();
+	clk_put(stm.clk);
 	qdss_put(stm.src);
 	misc_deregister(&stm_misc);
 	iounmap(stm.chs.base);
diff --git a/drivers/cs/cs-tpiu.c b/drivers/cs/cs-tpiu.c
index c5e28eb..8191d2c 100644
--- a/drivers/cs/cs-tpiu.c
+++ b/drivers/cs/cs-tpiu.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/err.h>
+#include <linux/clk.h>
 #include <linux/cs.h>
 
 #include "cs-priv.h"
@@ -60,6 +61,7 @@
 	void __iomem	*base;
 	bool		enabled;
 	struct device	*dev;
+	struct clk	*clk;
 };
 
 static struct tpiu_ctx tpiu;
@@ -100,9 +102,23 @@
 
 	tpiu.dev = &pdev->dev;
 
+	tpiu.clk = clk_get(tpiu.dev, "core_clk");
+	if (IS_ERR(tpiu.clk)) {
+		ret = PTR_ERR(tpiu.clk);
+		goto err_clk_get;
+	}
+
+	ret = clk_set_rate(tpiu.clk, CS_CLK_RATE_TRACE);
+	if (ret)
+		goto err_clk_rate;
+
 	dev_info(tpiu.dev, "TPIU initialized\n");
 	return 0;
 
+err_clk_rate:
+	clk_put(tpiu.clk);
+err_clk_get:
+	iounmap(tpiu.base);
 err_ioremap:
 err_res:
 	dev_err(tpiu.dev, "TPIU init failed\n");
@@ -113,6 +129,7 @@
 {
 	if (tpiu.enabled)
 		tpiu_disable();
+	clk_put(tpiu.clk);
 	iounmap(tpiu.base);
 
 	return 0;
diff --git a/drivers/cs/cs.c b/drivers/cs/cs.c
index acc22a4..ee02f90 100644
--- a/drivers/cs/cs.c
+++ b/drivers/cs/cs.c
@@ -28,11 +28,6 @@
 
 #define MAX_STR_LEN	(65535)
 
-enum {
-	QDSS_CLK_OFF,
-	QDSS_CLK_ON_DBG,
-	QDSS_CLK_ON_HSDBG,
-};
 
 static LIST_HEAD(cs_orph_conns);
 static DEFINE_MUTEX(cs_orph_conns_mutex);
@@ -387,19 +382,12 @@
  */
 int qdss_enable(struct qdss_source *src)
 {
-	int ret;
-
 	if (!src)
 		return -EINVAL;
 
-	ret = qdss_clk_enable();
-	if (ret)
-		goto err;
-
 	if (qdss.afamily) {
 		mutex_lock(&qdss.sink_mutex);
 		if (qdss.sink_count == 0) {
-			etb_disable();
 			tpiu_disable();
 			/* enable ETB first to avoid losing any trace data */
 			etb_enable();
@@ -410,8 +398,6 @@
 
 	funnel_enable(0x0, src->fport_mask);
 	return 0;
-err:
-	return ret;
 }
 EXPORT_SYMBOL(qdss_enable);
 
@@ -443,7 +429,6 @@
 	}
 
 	funnel_disable(0x0, src->fport_mask);
-	qdss_clk_disable();
 	return;
 out:
 	mutex_unlock(&qdss.sink_mutex);
@@ -470,37 +455,6 @@
 }
 EXPORT_SYMBOL(qdss_disable_sink);
 
-/**
- * qdss_clk_enable - enable qdss clocks
- *
- * Enables qdss clocks
- *
- * CONTEXT:
- * Might sleep. Should be called from a non-atomic context.
- *
- * RETURNS:
- * 0 on success, non-zero on failure
- */
-int qdss_clk_enable(void)
-{
-	return clk_prepare_enable(qdss.clk);
-}
-EXPORT_SYMBOL(qdss_clk_enable);
-
-/**
- * qdss_clk_disable - disable qdss clocks
- *
- * Disables qdss clocks
- *
- * CONTEXT:
- * Might sleep. Should be called from a non-atomic context.
- */
-void qdss_clk_disable(void)
-{
-	clk_disable_unprepare(qdss.clk);
-}
-EXPORT_SYMBOL(qdss_clk_disable);
-
 struct kobject *qdss_get_modulekobj(void)
 {
 	return qdss.modulekobj;
@@ -582,27 +536,11 @@
 	if (!pdata)
 		goto err_pdata;
 
-	qdss.clk = clk_get(&pdev->dev, "core_clk");
-	if (IS_ERR(qdss.clk)) {
-		ret = PTR_ERR(qdss.clk);
-		pr_info("clk get failed\n");
-		goto err_clk_get;
-	}
-
-	ret = clk_set_rate(qdss.clk, QDSS_CLK_ON_DBG);
-	if (ret) {
-		pr_info("clk rate failed\n");
-		goto err_clk_rate;
-	}
-
 	qdss.afamily = pdata->afamily;
 	qdss_add_sources(pdata->src_table, pdata->size);
 
 	pr_info("QDSS arch initialized\n");
 	return 0;
-err_clk_rate:
-	clk_put(qdss.clk);
-err_clk_get:
 err_pdata:
 	mutex_destroy(&qdss.sink_mutex);
 	mutex_destroy(&qdss.sources_mutex);
@@ -613,7 +551,6 @@
 static int __devexit qdss_remove(struct platform_device *pdev)
 {
 	qdss_sysfs_exit();
-	clk_put(qdss.clk);
 	mutex_destroy(&qdss.sink_mutex);
 	mutex_destroy(&qdss.sources_mutex);
 
diff --git a/include/linux/cs.h b/include/linux/cs.h
index 1a0094c..0e494b0 100644
--- a/include/linux/cs.h
+++ b/include/linux/cs.h
@@ -38,6 +38,12 @@
 #define ETM_ARCH_V3_3		(0x23)
 #define PFT_ARCH_V1_1		(0x31)
 
+enum cs_clk_rate {
+	CS_CLK_RATE_OFF,
+	CS_CLK_RATE_TRACE,
+	CS_CLK_RATE_HSTRACE,
+};
+
 enum cs_device_type {
 	CS_DEVICE_TYPE_SOURCE,
 	CS_DEVICE_TYPE_LINK,
@@ -114,16 +120,12 @@
 extern int qdss_enable(struct qdss_source *src);
 extern void qdss_disable(struct qdss_source *src);
 extern void qdss_disable_sink(void);
-extern int qdss_clk_enable(void);
-extern void qdss_clk_disable(void);
 #else
 static inline struct qdss_source *qdss_get(const char *name) { return NULL; }
 static inline void qdss_put(struct qdss_source *src) {}
 static inline int qdss_enable(struct qdss_source *src) { return -ENOSYS; }
 static inline void qdss_disable(struct qdss_source *src) {}
 static inline void qdss_disable_sink(void) {}
-static inline int qdss_clk_enable(void) { return -ENOSYS; }
-static inline void qdss_clk_disable(void) {}
 #endif
 
 #endif
