#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/system.h>
+#include <asm/arch/mcp.h>
#include <asm/arch/assabet.h>
static int mcp_sa11x0_probe(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
+ struct mcp_plat_data *data = pdev->dev.platform_data;
struct mcp *mcp;
int ret;
- if (!machine_is_adsbitsy() && !machine_is_assabet() &&
- !machine_is_cerf() && !machine_is_flexanet() &&
- !machine_is_freebird() && !machine_is_graphicsclient() &&
- !machine_is_graphicsmaster() && !machine_is_lart() &&
- !machine_is_omnimeter() && !machine_is_pfs168() &&
- !machine_is_shannon() && !machine_is_simpad() &&
- !machine_is_yopy())
+ if (!data)
return -ENODEV;
if (!request_mem_region(0x80060000, 0x60, "sa11x0-mcp"))
mcp->owner = THIS_MODULE;
mcp->ops = &mcp_sa11x0;
- mcp->sclk_rate = 11981000,
+ mcp->sclk_rate = data->sclk_rate;
mcp->dma_audio_rd = DMA_Ser4MCP0Rd;
mcp->dma_audio_wr = DMA_Ser4MCP0Wr;
mcp->dma_telco_rd = DMA_Ser4MCP1Rd;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+ /*
+ * Initialise device. Note that we initially
+ * set the sampling rate to minimum.
+ */
Ser4MCSR = -1;
- Ser4MCCR1 = 0;
- Ser4MCCR0 = 0x00007f7f | MCCR0_ADM;
+ Ser4MCCR1 = data->mccr1;
+ Ser4MCCR0 = data->mccr0 | 0x7f7f;
/*
* Calculate the read/write timeout (us) from the bit clock
return 0;
}
-static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state, u32 level)
+static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state)
{
struct mcp *mcp = dev_get_drvdata(dev);
- if (level == SUSPEND_DISABLE) {
- priv(mcp)->mccr0 = Ser4MCCR0;
- priv(mcp)->mccr1 = Ser4MCCR1;
- Ser4MCCR0 &= ~MCCR0_MCE;
- }
+ priv(mcp)->mccr0 = Ser4MCCR0;
+ priv(mcp)->mccr1 = Ser4MCCR1;
+ Ser4MCCR0 &= ~MCCR0_MCE;
+
return 0;
}
-static int mcp_sa11x0_resume(struct device *dev, u32 level)
+static int mcp_sa11x0_resume(struct device *dev)
{
struct mcp *mcp = dev_get_drvdata(dev);
- if (level == RESUME_RESTORE_STATE) {
- Ser4MCCR1 = priv(mcp)->mccr1;
- Ser4MCCR0 = priv(mcp)->mccr0;
- }
+ Ser4MCCR1 = priv(mcp)->mccr1;
+ Ser4MCCR0 = priv(mcp)->mccr0;
+
return 0;
}