aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/atmel-ssc.c
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2012-11-06 00:57:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-06 04:13:19 -0500
commit636036d29a20154b897571e1d5949faac98bfb7c (patch)
tree4d9516e395ff9952794ad83bfd3e8d8e79930fc0 /drivers/misc/atmel-ssc.c
parent90b4d60c6103105a634c495003c2ce931f075f63 (diff)
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>
Diffstat (limited to 'drivers/misc/atmel-ssc.c')
-rw-r--r--drivers/misc/atmel-ssc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index ac00f83ea86b..f40abd8a6695 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -68,6 +68,26 @@ void ssc_free(struct ssc_device *ssc)
68} 68}
69EXPORT_SYMBOL(ssc_free); 69EXPORT_SYMBOL(ssc_free);
70 70
71static struct atmel_ssc_platform_data at91rm9200_config = {
72 .use_dma = 0,
73};
74
75static struct atmel_ssc_platform_data at91sam9g45_config = {
76 .use_dma = 1,
77};
78
79static const struct platform_device_id atmel_ssc_devtypes[] = {
80 {
81 .name = "at91rm9200_ssc",
82 .driver_data = (unsigned long) &at91rm9200_config,
83 }, {
84 .name = "at91sam9g45_ssc",
85 .driver_data = (unsigned long) &at91sam9g45_config,
86 }, {
87 /* sentinel */
88 }
89};
90
71static int ssc_probe(struct platform_device *pdev) 91static int ssc_probe(struct platform_device *pdev)
72{ 92{
73 struct resource *regs; 93 struct resource *regs;
@@ -80,6 +100,8 @@ static int ssc_probe(struct platform_device *pdev)
80 } 100 }
81 101
82 ssc->pdev = pdev; 102 ssc->pdev = pdev;
103 ssc->pdata = (struct atmel_ssc_platform_data *)
104 platform_get_device_id(pdev)->driver_data;
83 105
84 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 106 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
85 if (!regs) { 107 if (!regs) {
@@ -139,6 +161,7 @@ static struct platform_driver ssc_driver = {
139 .name = "ssc", 161 .name = "ssc",
140 .owner = THIS_MODULE, 162 .owner = THIS_MODULE,
141 }, 163 },
164 .id_table = atmel_ssc_devtypes,
142 .probe = ssc_probe, 165 .probe = ssc_probe,
143 .remove = __devexit_p(ssc_remove), 166 .remove = __devexit_p(ssc_remove),
144}; 167};