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

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

Merge "coresight: Reset all activated sinks"

parents 26c53257 3ba16815
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -91,6 +91,23 @@ static int coresight_source_is_unique(struct coresight_device *csdev)
				 csdev, coresight_id_match);
}

static int coresight_reset_sink(struct device *dev, void *data)
{
	struct coresight_device *csdev = to_coresight_device(dev);

	if ((csdev->type == CORESIGHT_DEV_TYPE_SINK ||
	     csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) &&
	     csdev->activated)
		csdev->activated = false;

	return 0;
}

static void coresight_reset_all_sink(void)
{
	bus_for_each_dev(&coresight_bustype, NULL, NULL, coresight_reset_sink);
}

static int coresight_find_link_inport(struct coresight_device *csdev,
				      struct coresight_device *parent)
{
@@ -1017,6 +1034,9 @@ static ssize_t reset_source_sink_store(struct bus_type *bus,
		__coresight_disable(csdev);
	}

	/* Reset all activated sinks */
	coresight_reset_all_sink();

	mutex_unlock(&coresight_mutex);
	return size;
}