aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwtracing/intel_th/core.c6
-rw-r--r--drivers/hwtracing/intel_th/intel_th.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 8f820c182240..da962aa2cef5 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -630,7 +630,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
630 thdev->output.port = -1; 630 thdev->output.port = -1;
631 thdev->output.scratchpad = subdev->scrpd; 631 thdev->output.scratchpad = subdev->scrpd;
632 } else if (subdev->type == INTEL_TH_SWITCH) { 632 } else if (subdev->type == INTEL_TH_SWITCH) {
633 thdev->host_mode = host_mode; 633 thdev->host_mode =
634 INTEL_TH_CAP(th, host_mode_only) ? true : host_mode;
634 th->hub = thdev; 635 th->hub = thdev;
635 } 636 }
636 637
@@ -729,7 +730,8 @@ static int intel_th_populate(struct intel_th *th)
729 struct intel_th_device *thdev; 730 struct intel_th_device *thdev;
730 731
731 /* only allow SOURCE and SWITCH devices in host mode */ 732 /* only allow SOURCE and SWITCH devices in host mode */
732 if (host_mode && subdev->type == INTEL_TH_OUTPUT) 733 if ((INTEL_TH_CAP(th, host_mode_only) || host_mode) &&
734 subdev->type == INTEL_TH_OUTPUT)
733 continue; 735 continue;
734 736
735 /* 737 /*
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index cdeed3b017d0..780206dc9012 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -42,9 +42,11 @@ struct intel_th_output {
42/** 42/**
43 * struct intel_th_drvdata - describes hardware capabilities and quirks 43 * struct intel_th_drvdata - describes hardware capabilities and quirks
44 * @tscu_enable: device needs SW to enable time stamping unit 44 * @tscu_enable: device needs SW to enable time stamping unit
45 * @host_mode_only: device can only operate in 'host debugger' mode
45 */ 46 */
46struct intel_th_drvdata { 47struct intel_th_drvdata {
47 unsigned int tscu_enable : 1; 48 unsigned int tscu_enable : 1,
49 host_mode_only : 1;
48}; 50};
49 51
50#define INTEL_TH_CAP(_th, _cap) ((_th)->drvdata ? (_th)->drvdata->_cap : 0) 52#define INTEL_TH_CAP(_th, _cap) ((_th)->drvdata ? (_th)->drvdata->_cap : 0)