From patchwork Thu Mar 7 00:29:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brown X-Patchwork-Id: 2229351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5730CDF23A for ; Thu, 7 Mar 2013 00:36:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDOku-0000vY-TF; Thu, 07 Mar 2013 00:32:21 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDOie-0000KD-4K for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2013 00:30:04 +0000 X-IronPort-AV: E=Sophos;i="4.84,798,1355126400"; d="scan'208";a="27969702" Received: from pdmz-ns-snip_115.254.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.115.254]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Mar 2013 16:29:54 -0800 Received: from codeaurora.org (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 92A6610004DF; Wed, 6 Mar 2013 16:29:54 -0800 (PST) From: David Brown To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] RFC: SSBI: Simple pm8058 test driver Date: Wed, 6 Mar 2013 16:29:47 -0800 Message-Id: <1362616187-21089-7-git-send-email-davidb@codeaurora.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1362616187-21089-1-git-send-email-davidb@codeaurora.org> References: <1362616187-21089-1-git-send-email-davidb@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130306_193000_438165_0C08BC35 X-CRM114-Status: GOOD ( 15.56 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [199.106.114.251 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-msm@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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 diff --git a/arch/arm/boot/dts/msm8660-surf.dts b/arch/arm/boot/dts/msm8660-surf.dts index 67f8670..68a0c7c4 100644 --- a/arch/arm/boot/dts/msm8660-surf.dts +++ b/arch/arm/boot/dts/msm8660-surf.dts @@ -43,5 +43,9 @@ compatible = "qcom,ssbi"; reg = <0x500000 0x1000>; qcom,controller-type = "pmic-arbiter"; + + qcom,ssbi-test { + compatible = "qcom,ssbi-test"; + }; }; }; diff --git a/arch/arm/boot/dts/msm8960-cdp.dts b/arch/arm/boot/dts/msm8960-cdp.dts index c9b09a8..60804d7 100644 --- a/arch/arm/boot/dts/msm8960-cdp.dts +++ b/arch/arm/boot/dts/msm8960-cdp.dts @@ -43,5 +43,9 @@ compatible = "qcom,ssbi"; reg = <0x500000 0x1000>; qcom,controller-type = "pmic-arbiter"; + + qcom,ssbi-test { + compatible = "qcom,ssbi-test"; + }; }; }; diff --git a/drivers/ssbi/Makefile b/drivers/ssbi/Makefile index ea8c1e4..3561280 100644 --- a/drivers/ssbi/Makefile +++ b/drivers/ssbi/Makefile @@ -2,3 +2,4 @@ # Makefile for the MSM specific device drivers. # obj-$(CONFIG_MSM_SSBI) += ssbi.o +obj-$(CONFIG_MSM_SSBI) += ssbi-test.o diff --git a/drivers/ssbi/ssbi-test.c b/drivers/ssbi/ssbi-test.c new file mode 100644 index 0000000..dea4dd0 --- /dev/null +++ b/drivers/ssbi/ssbi-test.c @@ -0,0 +1,61 @@ +/* A simple ssbi test device. */ + +#include +#include +#include +#include + +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");