@@ -43,5 +43,9 @@
compatible = "qcom,ssbi";
reg = <0x500000 0x1000>;
qcom,controller-type = "pmic-arbiter";
+
+ qcom,ssbi-test {
+ compatible = "qcom,ssbi-test";
+ };
};
};
@@ -43,5 +43,9 @@
compatible = "qcom,ssbi";
reg = <0x500000 0x1000>;
qcom,controller-type = "pmic-arbiter";
+
+ qcom,ssbi-test {
+ compatible = "qcom,ssbi-test";
+ };
};
};
@@ -2,3 +2,4 @@
# Makefile for the MSM specific device drivers.
#
obj-$(CONFIG_MSM_SSBI) += ssbi.o
+obj-$(CONFIG_MSM_SSBI) += ssbi-test.o
new file mode 100644
@@ -0,0 +1,61 @@
+/* A simple ssbi test device. */
+
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/msm_ssbi.h>
+
+static int __init ssbi_test_probe(struct platform_device *pdev)
+{
+ int ret;
+ char version;
+
+ dev_info(&pdev->dev, "probe, me = %p, parent = %p\n",
+ pdev, pdev->dev.parent);
+
+ /* Let's try reading. */
+ ret = msm_ssbi_read(pdev->dev.parent, 0x02, &version, 1);
+ if (ret != 0)
+ return ret;
+
+ dev_info(&pdev->dev, "Version = %02x\n", version);
+
+ /* Should already be hooked in. */
+ return 0;
+}
+
+static int ssbi_test_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct of_device_id ssbi_test_match_table[] = {
+ { .compatible = "qcom,ssbi-test" },
+ {}
+};
+
+static struct platform_driver ssbi_test_driver = {
+ .remove = ssbi_test_remove,
+ .driver = {
+ .name = "sbbi_test",
+ .owner = THIS_MODULE,
+ .of_match_table = ssbi_test_match_table,
+ },
+};
+
+static int __init ssbi_test_init(void)
+{
+ int ret;
+
+ ret = platform_driver_probe(&ssbi_test_driver, ssbi_test_probe);
+ return ret;
+}
+
+static void __exit ssbi_test_exit(void)
+{
+}
+
+module_init(ssbi_test_init);
+module_exit(ssbi_test_exit);
+
+MODULE_LICENSE("GPL");
A very small ssbi device driver that reads the pm8058 version register ;and prints it out. This isn't really a useful driver, hence the RFC, but it is useful for someone wanting to test the SSBI driver itself. Once the PMIC drivers are finished, this isn't useful at all. Signed-off-by: David Brown <davidb@codeaurora.org> --- arch/arm/boot/dts/msm8660-surf.dts | 4 +++ arch/arm/boot/dts/msm8960-cdp.dts | 4 +++ drivers/ssbi/Makefile | 1 + drivers/ssbi/ssbi-test.c | 61 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 drivers/ssbi/ssbi-test.c