Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363131
b: refs/heads/master
c: ce44bf5
h: refs/heads/master
i:
  363129: 1650b91
  363127: 3f29f85
v: v3
  • Loading branch information
David Brown authored and Greg Kroah-Hartman committed Mar 25, 2013
1 parent 53e9b4c commit 75c9f75
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 37799ef4fa95ceec09b5c214fb281c6e6acddf5b
refs/heads/master: ce44bf5b5544cbe6358abb01f039361a99b80901
2 changes: 1 addition & 1 deletion trunk/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ obj-y += firmware/
obj-$(CONFIG_CRYPTO) += crypto/
obj-$(CONFIG_SUPERH) += sh/
obj-$(CONFIG_ARCH_SHMOBILE) += sh/
obj-$(CONFIG_MSM_SSBI) += ssbi/
obj-$(CONFIG_SSBI) += ssbi/
ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
obj-y += clocksource/
endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ config MFD_PM8XXX

config MFD_PM8921_CORE
tristate "Qualcomm PM8921 PMIC chip"
depends on MSM_SSBI
depends on SSBI
select MFD_CORE
select MFD_PM8XXX
help
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/mfd/pm8921-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/msm_ssbi.h>
#include <linux/ssbi.h>
#include <linux/mfd/core.h>
#include <linux/mfd/pm8xxx/pm8921.h>
#include <linux/mfd/pm8xxx/core.h>
Expand All @@ -35,15 +35,15 @@ static int pm8921_readb(const struct device *dev, u16 addr, u8 *val)
const struct pm8xxx_drvdata *pm8921_drvdata = dev_get_drvdata(dev);
const struct pm8921 *pmic = pm8921_drvdata->pm_chip_data;

return msm_ssbi_read(pmic->dev->parent, addr, val, 1);
return ssbi_read(pmic->dev->parent, addr, val, 1);
}

static int pm8921_writeb(const struct device *dev, u16 addr, u8 val)
{
const struct pm8xxx_drvdata *pm8921_drvdata = dev_get_drvdata(dev);
const struct pm8921 *pmic = pm8921_drvdata->pm_chip_data;

return msm_ssbi_write(pmic->dev->parent, addr, &val, 1);
return ssbi_write(pmic->dev->parent, addr, &val, 1);
}

static int pm8921_read_buf(const struct device *dev, u16 addr, u8 *buf,
Expand All @@ -52,7 +52,7 @@ static int pm8921_read_buf(const struct device *dev, u16 addr, u8 *buf,
const struct pm8xxx_drvdata *pm8921_drvdata = dev_get_drvdata(dev);
const struct pm8921 *pmic = pm8921_drvdata->pm_chip_data;

return msm_ssbi_read(pmic->dev->parent, addr, buf, cnt);
return ssbi_read(pmic->dev->parent, addr, buf, cnt);
}

static int pm8921_write_buf(const struct device *dev, u16 addr, u8 *buf,
Expand All @@ -61,7 +61,7 @@ static int pm8921_write_buf(const struct device *dev, u16 addr, u8 *buf,
const struct pm8xxx_drvdata *pm8921_drvdata = dev_get_drvdata(dev);
const struct pm8921 *pmic = pm8921_drvdata->pm_chip_data;

return msm_ssbi_write(pmic->dev->parent, addr, buf, cnt);
return ssbi_write(pmic->dev->parent, addr, buf, cnt);
}

static int pm8921_read_irq_stat(const struct device *dev, int irq)
Expand Down Expand Up @@ -124,7 +124,7 @@ static int pm8921_probe(struct platform_device *pdev)
}

/* Read PMIC chip revision */
rc = msm_ssbi_read(pdev->dev.parent, REG_HWREV, &val, sizeof(val));
rc = ssbi_read(pdev->dev.parent, REG_HWREV, &val, sizeof(val));
if (rc) {
pr_err("Failed to read hw rev reg %d:rc=%d\n", REG_HWREV, rc);
goto err_read_rev;
Expand All @@ -133,7 +133,7 @@ static int pm8921_probe(struct platform_device *pdev)
rev = val;

/* Read PMIC chip revision 2 */
rc = msm_ssbi_read(pdev->dev.parent, REG_HWREV_2, &val, sizeof(val));
rc = ssbi_read(pdev->dev.parent, REG_HWREV_2, &val, sizeof(val));
if (rc) {
pr_err("Failed to read hw rev 2 reg %d:rc=%d\n",
REG_HWREV_2, rc);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/ssbi/Kconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ssbi/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
obj-$(CONFIG_MSM_SSBI) += ssbi.o
obj-$(CONFIG_SSBI) += ssbi.o
86 changes: 43 additions & 43 deletions trunk/drivers/ssbi/ssbi.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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>
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -140,7 +140,7 @@ msm_ssbi_read_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
}

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;

Expand Down Expand Up @@ -172,7 +172,7 @@ msm_ssbi_write_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
* 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;
Expand All @@ -197,15 +197,15 @@ 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;

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++;
Expand All @@ -217,14 +217,14 @@ msm_ssbi_pa_read_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
}

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++;
Expand All @@ -235,9 +235,9 @@ msm_ssbi_pa_write_bytes(struct msm_ssbi *ssbi, u16 addr, u8 *buf, int len)
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;

Expand All @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -336,9 +336,9 @@ static int msm_ssbi_probe(struct platform_device *pdev)
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);
Expand All @@ -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>");
18 changes: 9 additions & 9 deletions trunk/include/linux/msm_ssbi.h → trunk/include/linux/ssbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
* GNU General Public License for more details.
*/

#ifndef _LINUX_MSM_SSBI_H
#define _LINUX_MSM_SSBI_H
#ifndef _LINUX_SSBI_H
#define _LINUX_SSBI_H

#include <linux/types.h>

struct msm_ssbi_slave_info {
struct ssbi_slave_info {
const char *name;
void *platform_data;
};

enum msm_ssbi_controller_type {
enum ssbi_controller_type {
MSM_SBI_CTRL_SSBI = 0,
MSM_SBI_CTRL_SSBI2,
MSM_SBI_CTRL_PMIC_ARBITER,
};

struct msm_ssbi_platform_data {
struct msm_ssbi_slave_info slave;
enum msm_ssbi_controller_type controller_type;
struct ssbi_platform_data {
struct ssbi_slave_info slave;
enum ssbi_controller_type controller_type;
};

int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
int msm_ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
#endif

0 comments on commit 75c9f75

Please sign in to comment.