From 323cdfc191b7c1597dc748175062c368568d6af4 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 18 Aug 2005 10:10:46 +0100 Subject: [MFD] Add SA11x0 MCP platform device support Add platform device data for the SA11x0 MCP device. This allows platforms to customise the configuration of the SA11x0 MCP device according to their needs. Signed-off-by: Russell King --- drivers/mfd/mcp-sa11x0.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/mfd') diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index 25699fa37fef..e9806fbbe696 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -140,16 +141,11 @@ static struct mcp_ops mcp_sa11x0 = { 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")) @@ -163,7 +159,7 @@ static int mcp_sa11x0_probe(struct device *dev) 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; @@ -184,9 +180,13 @@ static int mcp_sa11x0_probe(struct device *dev) 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 -- cgit v1.2.3-59-g8ed1b