Merge "coresight: use instance id from device tree"

This commit is contained in:
Linux Build Service Account 2014-12-16 01:42:46 -08:00 committed by Gerrit - the friendly Code Review server
commit fd2e03a244
4 changed files with 37 additions and 9 deletions

View File

@ -196,6 +196,7 @@ Optional properties:
-qcom,cmb-elem-size: specifies the CMB element size supported by each monitor
connected to the aggregator on each port. Should be specified
in pairs (port, cmb element size).
-qcom,inst-id : QMI instance id for remote ETMs.
Examples:
1. Sinks

View File

@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_coresight.h>
#include <linux/coresight.h>
#include "coresight-qmi.h"
@ -43,6 +44,7 @@ struct audio_etm_drvdata {
struct work_struct work_svc_exit;
struct work_struct work_rcv_msg;
struct notifier_block nb;
uint32_t inst_id;
};
static int audio_etm_enable(struct coresight_device *csdev)
@ -207,7 +209,7 @@ static void audio_etm_svc_arrive(struct work_struct *work)
if (qmi_connect_to_service(drvdata->handle, CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_AUDIO_V01) < 0) {
drvdata->inst_id) < 0) {
dev_err(drvdata->dev,
"%s: Could not connect handle to service\n", __func__);
qmi_handle_destroy(drvdata->handle);
@ -272,6 +274,13 @@ static int audio_etm_probe(struct platform_device *pdev)
if (!desc)
return -ENOMEM;
if (pdev->dev.of_node) {
ret = of_property_read_u32(pdev->dev.of_node, "qcom,inst-id",
&drvdata->inst_id);
if (ret)
drvdata->inst_id = CORESIGHT_SVC_INST_ID_AUDIO_V01;
}
mutex_init(&drvdata->mutex);
drvdata->nb.notifier_call = audio_etm_svc_event_notify;
@ -284,7 +293,7 @@ static int audio_etm_probe(struct platform_device *pdev)
INIT_WORK(&drvdata->work_rcv_msg, audio_etm_rcv_msg);
ret = qmi_svc_event_notifier_register(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_AUDIO_V01,
drvdata->inst_id,
&drvdata->nb);
if (ret < 0)
goto err0;
@ -308,7 +317,7 @@ static int audio_etm_probe(struct platform_device *pdev)
err1:
qmi_svc_event_notifier_unregister(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_AUDIO_V01,
drvdata->inst_id,
&drvdata->nb);
err0:
destroy_workqueue(drvdata->wq);

View File

@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_coresight.h>
#include <linux/coresight.h>
#include "coresight-qmi.h"
@ -43,6 +44,7 @@ struct modem_etm_drvdata {
struct work_struct work_svc_exit;
struct work_struct work_rcv_msg;
struct notifier_block nb;
uint32_t inst_id;
};
static int modem_etm_enable(struct coresight_device *csdev)
@ -207,7 +209,7 @@ static void modem_etm_svc_arrive(struct work_struct *work)
if (qmi_connect_to_service(drvdata->handle, CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_MODEM_V01) < 0) {
drvdata->inst_id) < 0) {
dev_err(drvdata->dev,
"%s: Could not connect handle to service\n", __func__);
qmi_handle_destroy(drvdata->handle);
@ -272,6 +274,13 @@ static int modem_etm_probe(struct platform_device *pdev)
if (!desc)
return -ENOMEM;
if (pdev->dev.of_node) {
ret = of_property_read_u32(pdev->dev.of_node, "qcom,inst-id",
&drvdata->inst_id);
if (ret)
drvdata->inst_id = CORESIGHT_SVC_INST_ID_MODEM_V01;
}
mutex_init(&drvdata->mutex);
drvdata->nb.notifier_call = modem_etm_svc_event_notify;
@ -284,7 +293,7 @@ static int modem_etm_probe(struct platform_device *pdev)
INIT_WORK(&drvdata->work_rcv_msg, modem_etm_rcv_msg);
ret = qmi_svc_event_notifier_register(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_MODEM_V01,
drvdata->inst_id,
&drvdata->nb);
if (ret < 0)
goto err0;
@ -308,7 +317,7 @@ static int modem_etm_probe(struct platform_device *pdev)
err1:
qmi_svc_event_notifier_unregister(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_MODEM_V01,
drvdata->inst_id,
&drvdata->nb);
err0:
destroy_workqueue(drvdata->wq);

View File

@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/sysfs.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_coresight.h>
#include <linux/coresight.h>
#include "coresight-qmi.h"
@ -43,6 +44,7 @@ struct rpm_etm_drvdata {
struct work_struct work_svc_exit;
struct work_struct work_rcv_msg;
struct notifier_block nb;
uint32_t inst_id;
};
static int rpm_etm_enable(struct coresight_device *csdev)
@ -207,7 +209,7 @@ static void rpm_etm_svc_arrive(struct work_struct *work)
if (qmi_connect_to_service(drvdata->handle, CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_RPM_V01) < 0) {
drvdata->inst_id) < 0) {
dev_err(drvdata->dev,
"%s: Could not connect handle to service\n", __func__);
qmi_handle_destroy(drvdata->handle);
@ -272,6 +274,13 @@ static int rpm_etm_probe(struct platform_device *pdev)
if (!desc)
return -ENOMEM;
if (pdev->dev.of_node) {
ret = of_property_read_u32(pdev->dev.of_node, "qcom,inst-id",
&drvdata->inst_id);
if (ret)
drvdata->inst_id = CORESIGHT_SVC_INST_ID_RPM_V01;
}
mutex_init(&drvdata->mutex);
drvdata->nb.notifier_call = rpm_etm_svc_event_notify;
@ -284,7 +293,7 @@ static int rpm_etm_probe(struct platform_device *pdev)
INIT_WORK(&drvdata->work_rcv_msg, rpm_etm_rcv_msg);
ret = qmi_svc_event_notifier_register(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_RPM_V01,
drvdata->inst_id,
&drvdata->nb);
if (ret < 0)
goto err0;
@ -309,7 +318,7 @@ static int rpm_etm_probe(struct platform_device *pdev)
err1:
qmi_svc_event_notifier_unregister(CORESIGHT_QMI_SVC_ID,
CORESIGHT_QMI_VERSION,
CORESIGHT_SVC_INST_ID_RPM_V01,
drvdata->inst_id,
&drvdata->nb);
err0:
destroy_workqueue(drvdata->wq);