Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abe06082 authored by Russell King's avatar Russell King
Browse files

MFD: mcp/ucb1x00: separate ucb1x00 driver data from the MCP data



Patch taken from 5dd7bf59 (ARM: sa11x0: Implement autoloading of codec
and codec pdata for mcp bus.) by Jochen Friedrich <jochen@scram.de>.

This adds just the codec data part of the patch.

Acked-by: default avatarJochen Friedrich <jochen@scram.de>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent a6aecae2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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>
@@ -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,
};

/*
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ struct mcp_plat_data {
	u32 mccr0;
	u32 mccr1;
	unsigned int sclk_rate;
	int gpio_base;
	void *codec_pdata;
};

#endif
+6 −1
Original line number Diff line number Diff line
@@ -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>
@@ -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,
};


+2 −1
Original line number Diff line number Diff line
@@ -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);
}
+1 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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;

Loading