]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
soc: qcom: Stub IPCRTR client driver
authorBjorn Andersson <bjorn.andersson@sonymobile.com>
Wed, 10 Dec 2014 19:27:51 +0000 (11:27 -0800)
committerSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 11 Jan 2016 09:55:15 +0000 (09:55 +0000)
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 <bjorn.andersson@sonymobile.com>
Conflicts:
drivers/soc/qcom/Kconfig
drivers/soc/qcom/Makefile

drivers/soc/qcom/Kconfig
drivers/soc/qcom/Makefile
drivers/soc/qcom/ipcrtr_stub.c [new file with mode: 0644]

index b77e2a8bad9b66096fa7ee973fb80b95e1f06813..9f244d633f3b7d474794e9ead629908ec8a0d1b9 100644 (file)
@@ -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.
index efce6ab60a53e748a271b3ff395609324186a1ee..6918a60745338528a239c5d580175366617dc07e 100644 (file)
@@ -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 (file)
index 0000000..6f8d724
--- /dev/null
@@ -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 <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of_platform.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/firmware.h>
+#include <linux/interrupt.h>
+#include <linux/delay.h>
+
+#include <linux/soc/qcom/smd.h>
+
+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 <bjorn.andersson@sonymobile.com>");
+MODULE_DESCRIPTION("Qualcomm IPCRTR stub driver");
+MODULE_LICENSE("GPLv2");
+