Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296363
b: refs/heads/master
c: abe0608
h: refs/heads/master
i:
  296361: 8c6b02c
  296359: 2c0e831
v: v3
  • Loading branch information
Russell King committed Feb 18, 2012
1 parent 243ecc3 commit d455f34
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 12 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: a6aecae29affdd1a84198afe45ef9e13ecbf9826
refs/heads/master: abe06082d07fcb0673cb93338c1d6f037fdc375b
7 changes: 6 additions & 1 deletion trunk/arch/arm/mach-sa1100/collie.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
Expand Down Expand Up @@ -85,10 +86,14 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {
.num_devs = 1,
};

static struct ucb1x00_plat_data collie_ucb1x00_data = {
.gpio_base = COLLIE_TC35143_GPIO_BASE,
};

static struct mcp_plat_data collie_mcp_data = {
.mccr0 = MCCR0_ADM | MCCR0_ExtClk,
.sclk_rate = 9216000,
.gpio_base = COLLIE_TC35143_GPIO_BASE,
.codec_pdata = &collie_ucb1x00_data,
};

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-sa1100/include/mach/mcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct mcp_plat_data {
u32 mccr0;
u32 mccr1;
unsigned int sclk_rate;
int gpio_base;
void *codec_pdata;
};

#endif
7 changes: 6 additions & 1 deletion trunk/arch/arm/mach-sa1100/simpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/string.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/mfd/ucb1x00.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/io.h>
Expand Down Expand Up @@ -187,10 +188,14 @@ static struct resource simpad_flash_resources [] = {
}
};

static struct ucb1x00_plat_data simpad_ucb1x00_data = {
.gpio_base = SIMPAD_UCB1X00_GPIO_BASE,
};

static struct mcp_plat_data simpad_mcp_data = {
.mccr0 = MCCR0_ADM,
.sclk_rate = 11981000,
.gpio_base = SIMPAD_UCB1X00_GPIO_BASE,
.codec_pdata = &simpad_ucb1x00_data,
};


Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/mfd/mcp-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ struct mcp *mcp_host_alloc(struct device *parent, size_t size)
}
EXPORT_SYMBOL(mcp_host_alloc);

int mcp_host_add(struct mcp *mcp)
int mcp_host_add(struct mcp *mcp, void *pdata)
{
mcp->attached_device.platform_data = pdata;
dev_set_name(&mcp->attached_device, "mcp0");
return device_add(&mcp->attached_device);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/mfd/mcp-sa11x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ static int mcp_sa11x0_probe(struct platform_device *dev)
mcp->owner = THIS_MODULE;
mcp->ops = &mcp_sa11x0;
mcp->sclk_rate = data->sclk_rate;
mcp->gpio_base = data->gpio_base;

m = priv(mcp);
m->mccr0 = data->mccr0 | 0x7f7f;
Expand Down Expand Up @@ -229,7 +228,7 @@ static int mcp_sa11x0_probe(struct platform_device *dev)
mcp->rw_timeout = (64 * 3 * 1000000 + mcp->sclk_rate - 1) /
mcp->sclk_rate;

ret = mcp_host_add(mcp);
ret = mcp_host_add(mcp, data->codec_pdata);
if (ret == 0)
return 0;

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/mfd/ucb1x00-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ static int ucb1x00_probe(struct mcp *mcp)
{
struct ucb1x00 *ucb;
struct ucb1x00_driver *drv;
struct ucb1x00_plat_data *pdata;
unsigned int id;
int ret = -ENODEV;
int temp;
Expand All @@ -551,7 +552,7 @@ static int ucb1x00_probe(struct mcp *mcp)
if (!ucb)
goto err_disable;


pdata = mcp->attached_device.platform_data;
ucb->dev.class = &ucb1x00_class;
ucb->dev.parent = &mcp->attached_device;
dev_set_name(&ucb->dev, "ucb1x00");
Expand All @@ -570,9 +571,9 @@ static int ucb1x00_probe(struct mcp *mcp)
}

ucb->gpio.base = -1;
if (mcp->gpio_base != 0) {
if (pdata && pdata->gpio_base) {
ucb->gpio.label = dev_name(&ucb->dev);
ucb->gpio.base = mcp->gpio_base;
ucb->gpio.base = pdata->gpio_base;
ucb->gpio.ngpio = 10;
ucb->gpio.set = ucb1x00_gpio_set;
ucb->gpio.get = ucb1x00_gpio_get;
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/mfd/mcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ struct mcp {
unsigned int sclk_rate;
unsigned int rw_timeout;
struct device attached_device;
int gpio_base;
};

struct mcp_ops {
Expand All @@ -41,7 +40,7 @@ void mcp_disable(struct mcp *);
#define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate)

struct mcp *mcp_host_alloc(struct device *, size_t);
int mcp_host_add(struct mcp *);
int mcp_host_add(struct mcp *, void *);
void mcp_host_del(struct mcp *);
void mcp_host_free(struct mcp *);

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mfd/ucb1x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)
#define UCB_MODE_AUD_OFF_CAN (1 << 13)

struct ucb1x00_plat_data {
int gpio_base;
};

struct ucb1x00_irq {
void *devid;
Expand Down

0 comments on commit d455f34

Please sign in to comment.