ARM: at91: atmel-ssc: add platform device id table

Add platform device id to check whether the SSC controller support
pdc or dam for data transfer

If match "at91rm9200_ssc", which support pdc for data transfer
If match "at91sam9g45_ssc", which support dma for data transfer

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Bo Shen
2012-11-06 13:57:51 +08:00
committed by Mark Brown
parent 90b4d60c61
commit 636036d29a
14 changed files with 54 additions and 26 deletions

View File

@@ -68,6 +68,26 @@ void ssc_free(struct ssc_device *ssc)
}
EXPORT_SYMBOL(ssc_free);
static struct atmel_ssc_platform_data at91rm9200_config = {
.use_dma = 0,
};
static struct atmel_ssc_platform_data at91sam9g45_config = {
.use_dma = 1,
};
static const struct platform_device_id atmel_ssc_devtypes[] = {
{
.name = "at91rm9200_ssc",
.driver_data = (unsigned long) &at91rm9200_config,
}, {
.name = "at91sam9g45_ssc",
.driver_data = (unsigned long) &at91sam9g45_config,
}, {
/* sentinel */
}
};
static int ssc_probe(struct platform_device *pdev)
{
struct resource *regs;
@@ -80,6 +100,8 @@ static int ssc_probe(struct platform_device *pdev)
}
ssc->pdev = pdev;
ssc->pdata = (struct atmel_ssc_platform_data *)
platform_get_device_id(pdev)->driver_data;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
@@ -139,6 +161,7 @@ static struct platform_driver ssc_driver = {
.name = "ssc",
.owner = THIS_MODULE,
},
.id_table = atmel_ssc_devtypes,
.probe = ssc_probe,
.remove = __devexit_p(ssc_remove),
};