[ARM] msm: sdcc: Make slot status irq be a resource
Also, convert all SDCC IRQ resources to be named. No longer pass status_irq in the platform_data Signed-off-by: Dima Zavin <dima@android.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
This commit is contained in:
committed by
Daniel Walker
parent
5d4f77ffef
commit
830d843b75
@@ -165,8 +165,19 @@ static struct resource resources_sdc1[] = {
|
||||
},
|
||||
{
|
||||
.start = INT_SDC1_0,
|
||||
.end = INT_SDC1_0,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "cmd_irq",
|
||||
},
|
||||
{
|
||||
.start = INT_SDC1_1,
|
||||
.end = INT_SDC1_1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "pio_irq",
|
||||
},
|
||||
{
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
||||
.name = "status_irq"
|
||||
},
|
||||
{
|
||||
.start = 8,
|
||||
@@ -183,8 +194,19 @@ static struct resource resources_sdc2[] = {
|
||||
},
|
||||
{
|
||||
.start = INT_SDC2_0,
|
||||
.end = INT_SDC2_0,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "cmd_irq",
|
||||
},
|
||||
{
|
||||
.start = INT_SDC2_1,
|
||||
.end = INT_SDC2_1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "pio_irq",
|
||||
},
|
||||
{
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
||||
.name = "status_irq"
|
||||
},
|
||||
{
|
||||
.start = 8,
|
||||
@@ -201,8 +223,19 @@ static struct resource resources_sdc3[] = {
|
||||
},
|
||||
{
|
||||
.start = INT_SDC3_0,
|
||||
.end = INT_SDC3_0,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "cmd_irq",
|
||||
},
|
||||
{
|
||||
.start = INT_SDC3_1,
|
||||
.end = INT_SDC3_1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "pio_irq",
|
||||
},
|
||||
{
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
||||
.name = "status_irq"
|
||||
},
|
||||
{
|
||||
.start = 8,
|
||||
@@ -219,8 +252,19 @@ static struct resource resources_sdc4[] = {
|
||||
},
|
||||
{
|
||||
.start = INT_SDC4_0,
|
||||
.end = INT_SDC4_0,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "cmd_irq",
|
||||
},
|
||||
{
|
||||
.start = INT_SDC4_1,
|
||||
.end = INT_SDC4_1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.name = "pio_irq",
|
||||
},
|
||||
{
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
||||
.name = "status_irq"
|
||||
},
|
||||
{
|
||||
.start = 8,
|
||||
@@ -276,15 +320,27 @@ static struct platform_device *msm_sdcc_devices[] __initdata = {
|
||||
&msm_device_sdc4,
|
||||
};
|
||||
|
||||
int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
|
||||
int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat,
|
||||
unsigned int stat_irq, unsigned long stat_irq_flags)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
struct resource *res;
|
||||
|
||||
if (controller < 1 || controller > 4)
|
||||
return -EINVAL;
|
||||
|
||||
pdev = msm_sdcc_devices[controller-1];
|
||||
pdev->dev.platform_data = plat;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq");
|
||||
if (!res)
|
||||
return -EINVAL;
|
||||
else if (stat_irq) {
|
||||
res->start = res->end = stat_irq;
|
||||
res->flags &= ~IORESOURCE_DISABLED;
|
||||
res->flags |= stat_irq_flags;
|
||||
}
|
||||
|
||||
return platform_device_register(pdev);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user