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

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

Merge "coresight: Reset all activated sinks"

parents 7b07a7e4 1140078e
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -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)
{
@@ -1036,6 +1053,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;
}