From patchwork Tue Mar 12 20:12:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brown X-Patchwork-Id: 2258551 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 8517ADF23A for ; Tue, 12 Mar 2013 20:16:55 +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 1UFVZF-0001SJ-IC; Tue, 12 Mar 2013 20:13:01 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFVZB-0001Rw-8n for linux-arm-kernel@lists.infradead.org; Tue, 12 Mar 2013 20:12:57 +0000 X-IronPort-AV: E=Sophos;i="4.84,832,1355126400"; d="scan'208";a="28877038" Received: from pdmz-ns-snip_115_219.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.115.219]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Mar 2013 13:12:38 -0700 Received: from codeaurora.org (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 9FBD610004B5; Tue, 12 Mar 2013 13:12:38 -0700 (PDT) From: David Brown To: David Brown Subject: [PATCH v2 11/11] RFC: SSBI: Simple pm8058 test driver Date: Tue, 12 Mar 2013 13:12:35 -0700 Message-Id: <1363119155-4682-1-git-send-email-davidb@codeaurora.org> X-Mailer: git-send-email 1.8.1.5 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-20130312_161257_538163_A9ADF77F X-CRM114-Status: GOOD ( 14.46 ) 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.254 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Rob Herring , Grant Likely , Bryan Huntsman , linux-arm-msm@vger.kernel.org, Daniel Walker , linux-arm-kernel@lists.infradead.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. Signed-off-by: David Brown --- Resending due to address error in header 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 38fb70c..dea13c1 100644 --- a/drivers/ssbi/Makefile +++ b/drivers/ssbi/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_SSBI) += ssbi.o +obj-$(CONFIG_SSBI) += ssbi-test.o diff --git a/drivers/ssbi/ssbi-test.c b/drivers/ssbi/ssbi-test.c new file mode 100644 index 0000000..7804cfe --- /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 = 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");