aboutsummaryrefslogtreecommitdiff
path: root/drivers/ssbi
diff options
context:
space:
mode:
authorDavid Brown <davidb@codeaurora.org>2013-03-12 11:41:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 10:39:40 -0700
commitce44bf5b5544cbe6358abb01f039361a99b80901 (patch)
treed50ca57efbfa4245d32d2206e42546d02cb2c3cd /drivers/ssbi
parent37799ef4fa95ceec09b5c214fb281c6e6acddf5b (diff)
downloadlinux-ce44bf5b5544cbe6358abb01f039361a99b80901.tar.gz
SSBI: Remove MSM_ prefix from SSBI drivers
Although the SSBI sub is currently only used on MSM SoCs, it is still a bus in its own right. Remove this msm_ prefix from the driver and it's symbols. Clients can now refer directly to ssbi_write() and ssbi_read(). Signed-off-by: David Brown <davidb@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ssbi')
-rw-r--r--drivers/ssbi/Kconfig4
-rw-r--r--drivers/ssbi/Makefile2
-rw-r--r--drivers/ssbi/ssbi.c86
3 files changed, 46 insertions, 46 deletions
diff --git a/drivers/ssbi/Kconfig b/drivers/ssbi/Kconfig
index c7bc534ddf5..1ae4040afed 100644
--- a/drivers/ssbi/Kconfig
+++ b/drivers/ssbi/Kconfig
@@ -1,10 +1,10 @@
#
-# MSM SSBI bus support
+# SSBI bus support
#
menu "Qualcomm MSM SSBI bus support"
-config MSM_SSBI
+config SSBI
tristate "Qualcomm Single-wire Serial Bus Interface (SSBI)"
help
If you say yes to this option, support will be included for the
diff --git a/drivers/ssbi/Makefile b/drivers/ssbi/Makefile
index 22e408f45d6..38fb70c31ca 100644
--- a/drivers/ssbi/Makefile
+++ b/drivers/ssbi/Makefile
@@ -1 +1 @@
-obj-$(CONFIG_MSM_SSBI) += ssbi.o
+obj-$(CONFIG_SSBI) += ssbi.o
diff --git a/drivers/ssbi/ssbi.c b/drivers/ssbi/ssbi.c
index b056a072c3b..f32da0258a8 100644
--- a/drivers/ssbi/ssbi.c
+++ b/drivers/ssbi/ssbi.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
* Copyright (c) 2010, Google Inc.
*
* Original authors: Code Aurora Forum
@@ -24,7 +24,7 @@
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
-#include <linux/msm_ssbi.h>
+#include <linux/ssbi.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
@@ -65,23 +65,23 @@
#define SSBI_TIMEOUT_US 100
-struct msm_ssbi {
+struct ssbi {
struct device *slave;
void __iomem *base;
spinlock_t lock;
- enum msm_ssbi_controller_type controller_type;
- int (*read)(struct msm_ssbi *, u16 addr, u8 *buf, int len);
- int (*write)(struct msm_ssbi *, u16 addr, u8 *buf, int len);
+ enum ssbi_controller_type controller_type;
+ int (*read)(struct ssbi *, u16 addr, u8 *buf, int len);
+ int (*write)(struct ssbi *, u16 addr, u8 *buf, int len);
};
-#define to_msm_ssbi(dev) platform_get_drvdata(to_platform_device(dev))
+#define to_ssbi(dev) platform_get_drvdata(to_platform_device(dev))
-static inline u32 ssbi_readl(struct msm_ssbi *ssbi, u32 reg)
+static inline u32 ssbi_readl(struct ssbi *ssbi, u32 reg)
{
return readl(ssbi->base + reg);
}
-static inline void ssbi_writel(struct msm_ssbi *ssbi, u32 val, u32 reg)
+static inline void ssbi_writel(struct ssbi *ssbi, u32 val, u32 reg)
{
writel(val, ssbi->base + reg);
}
@@ -95,7 +95,7 @@ static inline void ssbi_writel(struct msm_ssbi *ssbi, u32 val, u32 reg)
*
* As such, this wait merely spins, with a udelay.
*/
-static int ssbi_wait_mask(struct msm_ssbi *ssbi, u32 set_mask, u32 clr_mask)
+static int ssbi_wait_mask(struct ssbi *ssbi, u32 set_mask, u32 clr_mask)
{
u32 timeout = SSBI_TIMEOUT_US;
u32 val;
@@ -111,7 +111,7 @@ static int ssbi_wait_mask(struct msm_ssbi *ssbi, u32 set_mask, u32 clr_mask)
}
static int
-msm_ssbi_read_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
+ssbi_read_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{
u32 cmd = SSBI_CMD_RDWRN | ((addr & 0xff) << 16);
int ret = 0;
@@ -140,7 +140,7 @@ err:
}
static int
-msm_ssbi_write_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
+ssbi_write_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{
int ret = 0;
@@ -172,7 +172,7 @@ err:
* busywait.
*/
static inline int
-msm_ssbi_pa_transfer(struct msm_ssbi *ssbi, u32 cmd, u8 *data)
+ssbi_pa_transfer(struct ssbi *ssbi, u32 cmd, u8 *data)
{
u32 timeout = SSBI_TIMEOUT_US;
u32 rd_status = 0;
@@ -197,7 +197,7 @@ msm_ssbi_pa_transfer(struct msm_ssbi *ssbi, u32 cmd, u8 *data)
}
static int
-msm_ssbi_pa_read_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
+ssbi_pa_read_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{
u32 cmd;
int ret = 0;
@@ -205,7 +205,7 @@ msm_ssbi_pa_read_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
cmd = SSBI_PA_CMD_RDWRN | (addr & SSBI_PA_CMD_ADDR_MASK) << 8;
while (len) {
- ret = msm_ssbi_pa_transfer(ssbi, cmd, buf);
+ ret = ssbi_pa_transfer(ssbi, cmd, buf);
if (ret)
goto err;
buf++;
@@ -217,14 +217,14 @@ err:
}
static int
-msm_ssbi_pa_write_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
+ssbi_pa_write_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{
u32 cmd;
int ret = 0;
while (len) {
cmd = (addr & SSBI_PA_CMD_ADDR_MASK) << 8 | *buf;
- ret = msm_ssbi_pa_transfer(ssbi, cmd, NULL);
+ ret = ssbi_pa_transfer(ssbi, cmd, NULL);
if (ret)
goto err;
buf++;
@@ -235,9 +235,9 @@ err:
return ret;
}
-int msm_ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
+int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
{
- struct msm_ssbi *ssbi = to_msm_ssbi(dev);
+ struct ssbi *ssbi = to_ssbi(dev);
unsigned long flags;
int ret;
@@ -247,11 +247,11 @@ int msm_ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
return ret;
}
-EXPORT_SYMBOL_GPL(msm_ssbi_read);
+EXPORT_SYMBOL_GPL(ssbi_read);
-int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
+int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
{
- struct msm_ssbi *ssbi = to_msm_ssbi(dev);
+ struct ssbi *ssbi = to_ssbi(dev);
unsigned long flags;
int ret;
@@ -261,17 +261,17 @@ int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
return ret;
}
-EXPORT_SYMBOL_GPL(msm_ssbi_write);
+EXPORT_SYMBOL_GPL(ssbi_write);
-static int msm_ssbi_probe(struct platform_device *pdev)
+static int ssbi_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct resource *mem_res;
- struct msm_ssbi *ssbi;
+ struct ssbi *ssbi;
int ret = 0;
const char *type;
- ssbi = kzalloc(sizeof(struct msm_ssbi), GFP_KERNEL);
+ ssbi = kzalloc(sizeof(struct ssbi), GFP_KERNEL);
if (!ssbi) {
pr_err("can not allocate ssbi_data\n");
return -ENOMEM;
@@ -312,11 +312,11 @@ static int msm_ssbi_probe(struct platform_device *pdev)
}
if (ssbi->controller_type == MSM_SBI_CTRL_PMIC_ARBITER) {
- ssbi->read = msm_ssbi_pa_read_bytes;
- ssbi->write = msm_ssbi_pa_write_bytes;
+ ssbi->read = ssbi_pa_read_bytes;
+ ssbi->write = ssbi_pa_write_bytes;
} else {
- ssbi->read = msm_ssbi_read_bytes;
- ssbi->write = msm_ssbi_write_bytes;
+ ssbi->read = ssbi_read_bytes;
+ ssbi->write = ssbi_write_bytes;
}
spin_lock_init(&ssbi->lock);
@@ -336,9 +336,9 @@ err_get_mem_res:
return ret;
}
-static int msm_ssbi_remove(struct platform_device *pdev)
+static int ssbi_remove(struct platform_device *pdev)
{
- struct msm_ssbi *ssbi = platform_get_drvdata(pdev);
+ struct ssbi *ssbi = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
iounmap(ssbi->base);
@@ -351,29 +351,29 @@ static struct of_device_id ssbi_match_table[] = {
{}
};
-static struct platform_driver msm_ssbi_driver = {
- .probe = msm_ssbi_probe,
- .remove = msm_ssbi_remove,
+static struct platform_driver ssbi_driver = {
+ .probe = ssbi_probe,
+ .remove = ssbi_remove,
.driver = {
- .name = "msm_ssbi",
+ .name = "ssbi",
.owner = THIS_MODULE,
.of_match_table = ssbi_match_table,
},
};
-static int __init msm_ssbi_init(void)
+static int __init ssbi_init(void)
{
- return platform_driver_register(&msm_ssbi_driver);
+ return platform_driver_register(&ssbi_driver);
}
-module_init(msm_ssbi_init);
+module_init(ssbi_init);
-static void __exit msm_ssbi_exit(void)
+static void __exit ssbi_exit(void)
{
- platform_driver_unregister(&msm_ssbi_driver);
+ platform_driver_unregister(&ssbi_driver);
}
-module_exit(msm_ssbi_exit)
+module_exit(ssbi_exit)
MODULE_LICENSE("GPL v2");
MODULE_VERSION("1.0");
-MODULE_ALIAS("platform:msm_ssbi");
+MODULE_ALIAS("platform:ssbi");
MODULE_AUTHOR("Dima Zavin <dima@android.com>");