From 38f515b2f0ee21b27bed1fd36f6710c1ef907765 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Wed, 10 Dec 2014 11:27:51 -0800 Subject: [PATCH] soc: qcom: Stub IPCRTR client driver The IPCRTR channel needs to come up for the pronto block to be happy and continue communication, so this driver does just that (and dumps incoming data in the log). Signed-off-by: Bjorn Andersson Conflicts: drivers/soc/qcom/Kconfig drivers/soc/qcom/Makefile --- drivers/soc/qcom/Kconfig | 5 +++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/ipcrtr_stub.c | 62 ++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 drivers/soc/qcom/ipcrtr_stub.c diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index b77e2a8bad9b..9f244d633f3b 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -108,3 +108,8 @@ config BUS_TOPOLOGY_ADHOC directionality of connections by explicitly listing device connections thus avoiding illegal routes. +config QCOM_IPCRTR_STUB + tristate "Qualcomm IPCRTR stub driver" + depends on QCOM_SMD + help + Stub driver to bring the IPCRTR channel up. diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index efce6ab60a53..6918a6074533 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -11,3 +11,4 @@ obj-$(CONFIG_MFD_QCOM_SMD_RPM) += rpm_log.o obj-$(CONFIG_MSM_BUS_SCALING) += msm_bus/ obj-$(CONFIG_BUS_TOPOLOGY_ADHOC) += msm_bus/ +obj-$(CONFIG_QCOM_IPCRTR_STUB) += ipcrtr_stub.o diff --git a/drivers/soc/qcom/ipcrtr_stub.c b/drivers/soc/qcom/ipcrtr_stub.c new file mode 100644 index 000000000000..6f8d724f4b5e --- /dev/null +++ b/drivers/soc/qcom/ipcrtr_stub.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Sony Mobile Communications AB. + * + * 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 + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static int ipcrtr_stub_callback(struct qcom_smd_device *qsdev, + const void *data, + size_t count) +{ + print_hex_dump(KERN_DEBUG, "IPCRTR <<<: ", DUMP_PREFIX_OFFSET, 16, 1, data, count, true); + + return 0; +} + +static int ipcrtr_stub_probe(struct qcom_smd_device *sdev) +{ + dev_err(&sdev->dev, "ipcrtr initialized\n"); + + return 0; +} + +static const struct of_device_id ipcrtr_stub_of_match[] = { + { .compatible = "qcom,ipcrtr" }, + {} +}; +MODULE_DEVICE_TABLE(of, ipcrtr_stub_of_match); + +static struct qcom_smd_driver ipcrtr_stub_driver = { + .probe = ipcrtr_stub_probe, + .callback = ipcrtr_stub_callback, + .driver = { + .name = "ipcrtr_stub", + .owner = THIS_MODULE, + .of_match_table = ipcrtr_stub_of_match, + }, +}; + +module_qcom_smd_driver(ipcrtr_stub_driver); + +MODULE_AUTHOR("Bjorn Andersson "); +MODULE_DESCRIPTION("Qualcomm IPCRTR stub driver"); +MODULE_LICENSE("GPLv2"); + -- 2.39.2