aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-07-05 04:40:33 -0400
committerPeter Ujfalusi <peter.ujfalusi@ti.com>2011-07-07 07:23:10 -0400
commit0f962ae2dd8655f0800ff3c4b02d5f5a2ff3899e (patch)
tree55e3e395fa0484702d2f13809251105087fd08f0 /drivers/mfd
parent1a4cdecec7d639ba2891195dc3f5917fb70653db (diff)
MFD: twl6040: Use resource to provide irq number for slaves
Provide the irq number for slaves via resource on the platform device. The irq number configuration is done in the twl6040-core at probe time, so machine drivers do not need to be modified. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6040-core.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index cfaedb5581ad..471f4895fb90 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -435,6 +435,18 @@ unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
435} 435}
436EXPORT_SYMBOL(twl6040_get_sysclk); 436EXPORT_SYMBOL(twl6040_get_sysclk);
437 437
438static struct resource twl6040_vibra_rsrc[] = {
439 {
440 .flags = IORESOURCE_IRQ,
441 },
442};
443
444static struct resource twl6040_codec_rsrc[] = {
445 {
446 .flags = IORESOURCE_IRQ,
447 },
448};
449
438static int __devinit twl6040_probe(struct platform_device *pdev) 450static int __devinit twl6040_probe(struct platform_device *pdev)
439{ 451{
440 struct twl4030_audio_data *pdata = pdev->dev.platform_data; 452 struct twl4030_audio_data *pdata = pdev->dev.platform_data;
@@ -499,16 +511,29 @@ static int __devinit twl6040_probe(struct platform_device *pdev)
499 twl6040_set_bits(twl6040, TWL6040_REG_ACCCTL, TWL6040_I2CSEL); 511 twl6040_set_bits(twl6040, TWL6040_REG_ACCCTL, TWL6040_I2CSEL);
500 512
501 if (pdata->codec) { 513 if (pdata->codec) {
514 int irq = twl6040->irq_base + TWL6040_IRQ_PLUG;
515
502 cell = &twl6040->cells[children]; 516 cell = &twl6040->cells[children];
503 cell->name = "twl6040-codec"; 517 cell->name = "twl6040-codec";
518 twl6040_codec_rsrc[0].start = irq;
519 twl6040_codec_rsrc[0].end = irq;
520 cell->resources = twl6040_codec_rsrc;
521 cell->num_resources = ARRAY_SIZE(twl6040_codec_rsrc);
504 cell->platform_data = pdata->codec; 522 cell->platform_data = pdata->codec;
505 cell->pdata_size = sizeof(*pdata->codec); 523 cell->pdata_size = sizeof(*pdata->codec);
506 children++; 524 children++;
507 } 525 }
508 526
509 if (pdata->vibra) { 527 if (pdata->vibra) {
528 int irq = twl6040->irq_base + TWL6040_IRQ_VIB;
529
510 cell = &twl6040->cells[children]; 530 cell = &twl6040->cells[children];
511 cell->name = "twl6040-vibra"; 531 cell->name = "twl6040-vibra";
532 twl6040_vibra_rsrc[0].start = irq;
533 twl6040_vibra_rsrc[0].end = irq;
534 cell->resources = twl6040_vibra_rsrc;
535 cell->num_resources = ARRAY_SIZE(twl6040_vibra_rsrc);
536
512 cell->platform_data = pdata->vibra; 537 cell->platform_data = pdata->vibra;
513 cell->pdata_size = sizeof(*pdata->vibra); 538 cell->pdata_size = sizeof(*pdata->vibra);
514 children++; 539 children++;