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

Commit ab367f23 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: tmc: Fix compilation errors." into msm-next

parents 4b205dc9 8f44c750
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/of_irq.h>
#include <linux/moduleparam.h>
#include <linux/delay.h>
#include <linux/uaccess.h>

#include "coresight-byte-cntr.h"
#include "coresight-priv.h"
+4 −6
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ int tmc_etr_bam_init(struct amba_device *adev,
	return sps_register_bam_device(&bamdata->props, &bamdata->handle);
}

static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev, u32 mode)
static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
{
	int ret = 0;
	bool used = false;
@@ -390,11 +390,9 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev, u32 mode)
			 * enabling tmc; the new selection will be honored from
			 * next tmc enable session.
			 */
			if (drvdata->size != drvdata->mem_size ||
				drvdata->memtype != drvdata->mem_type) {
			if (drvdata->size != drvdata->mem_size) {
				tmc_etr_free_mem(drvdata);
				drvdata->size = drvdata->mem_size;
				drvdata->memtype = drvdata->mem_type;
			}

			ret = tmc_etr_alloc_mem(drvdata);
@@ -449,7 +447,7 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev, u32 mode)
	if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM)
		tmc_etr_enable_hw(drvdata);

	drvdata->enable = true;	828
	drvdata->enable = true;
	drvdata->sticky_enable = true;
out:
	spin_unlock_irqrestore(&drvdata->spinlock, flags);
@@ -524,7 +522,7 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev)
	}

	/* Disable the TMC only if it needs to */
	if (val != CS_MODE_DISABLED) {
	if (drvdata->mode != CS_MODE_DISABLED) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
			__tmc_etr_disable_to_bam(drvdata);
			spin_unlock_irqrestore(&drvdata->spinlock, flags);
+0 −37
Original line number Diff line number Diff line
@@ -421,43 +421,6 @@ static ssize_t available_out_modes_show(struct device *dev,
}
static DEVICE_ATTR_RO(available_out_modes);

static ssize_t mem_type_show(struct device *dev,
			     struct device_attribute *attr,
			     char *buf)
{
	struct tmc_drvdata *drvdata = dev_get_drvdata(dev->parent);

	return scnprintf(buf, PAGE_SIZE, "%s\n",
			str_tmc_etr_mem_type[drvdata->mem_type]);
}

static ssize_t mem_type_store(struct device *dev,
			      struct device_attribute *attr,
			      const char *buf,
			      size_t size)
{
	struct tmc_drvdata *drvdata = dev_get_drvdata(dev->parent);
	char str[10] = "";

	if (strlen(buf) >= 10)
		return -EINVAL;
	if (sscanf(buf, "%10s", str) != 1)
		return -EINVAL;

	mutex_lock(&drvdata->mem_lock);
	if (!strcmp(str, str_tmc_etr_mem_type[TMC_ETR_MEM_TYPE_CONTIG]))
		drvdata->mem_type = TMC_ETR_MEM_TYPE_CONTIG;
	else if (!strcmp(str, str_tmc_etr_mem_type[TMC_ETR_MEM_TYPE_SG]))
		drvdata->mem_type = TMC_ETR_MEM_TYPE_SG;
	else
		size = -EINVAL;

	mutex_unlock(&drvdata->mem_lock);

	return size;
}
static DEVICE_ATTR_RW(mem_type);

static ssize_t block_size_show(struct device *dev,
			     struct device_attribute *attr,
			     char *buf)
+2 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/of_address.h>
#include <linux/amba/bus.h>
#include <linux/usb_bam.h>
#include <linux/msm-sps.h>
#include <linux/usb/usb_qdss.h>
#include <linux/coresight-cti.h>

@@ -210,14 +211,12 @@ struct tmc_drvdata {
	u32			mem_size;
	u32			trigger_cntr;
	u32			etr_caps;
	enum tmc_etr_mem_type	mem_type;
	enum tmc_etr_mem_type	memtype;
	u32			delta_bottom;
	int			sg_blk_num;
	enum tmc_etr_out_mode	out_mode;
	struct usb_qdss_ch	*usbch;
	struct tmc_etr_bam_data	*bamdata;
	bool			sticky_enable;
	bool			enable_to_bam;
	struct coresight_cti	*cti_flush;
	struct coresight_cti	*cti_reset;
	struct byte_cntr	*byte_cntr;