Commit 88289c80 authored by Shawn Guo's avatar Shawn Guo

dma: ipu: remove the use of ipu_platform_data

The struct ipu_platform_data is used by platform code to pass
MXC_IPU_IRQ_START to ipu-core driver.  We can save it by having
ipu-core driver call irq_alloc_descs to get the irq_base.
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
parent 544496ab
...@@ -42,8 +42,8 @@ extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[]; ...@@ -42,8 +42,8 @@ extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[];
#define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata)
extern const struct imx_ipu_core_data imx31_ipu_core_data; extern const struct imx_ipu_core_data imx31_ipu_core_data;
#define imx31_add_ipu_core(pdata) \ #define imx31_add_ipu_core() \
imx_add_ipu_core(&imx31_ipu_core_data, pdata) imx_add_ipu_core(&imx31_ipu_core_data)
#define imx31_alloc_mx3_camera(pdata) \ #define imx31_alloc_mx3_camera(pdata) \
imx_alloc_mx3_camera(&imx31_ipu_core_data, pdata) imx_alloc_mx3_camera(&imx31_ipu_core_data, pdata)
#define imx31_add_mx3_sdc_fb(pdata) \ #define imx31_add_mx3_sdc_fb(pdata) \
......
...@@ -50,8 +50,8 @@ extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[]; ...@@ -50,8 +50,8 @@ extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[];
#define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata)
extern const struct imx_ipu_core_data imx35_ipu_core_data; extern const struct imx_ipu_core_data imx35_ipu_core_data;
#define imx35_add_ipu_core(pdata) \ #define imx35_add_ipu_core() \
imx_add_ipu_core(&imx35_ipu_core_data, pdata) imx_add_ipu_core(&imx35_ipu_core_data)
#define imx35_alloc_mx3_camera(pdata) \ #define imx35_alloc_mx3_camera(pdata) \
imx_alloc_mx3_camera(&imx35_ipu_core_data, pdata) imx_alloc_mx3_camera(&imx35_ipu_core_data, pdata)
#define imx35_add_mx3_sdc_fb(pdata) \ #define imx35_add_mx3_sdc_fb(pdata) \
......
...@@ -95,10 +95,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -95,10 +95,6 @@ static const struct fb_videomode fb_modedb[] = {
}, },
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "CMO-QVGA", .name = "CMO-QVGA",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -287,7 +283,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void) ...@@ -287,7 +283,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
printk(KERN_ERR "error setting mbimxsd pads !\n"); printk(KERN_ERR "error setting mbimxsd pads !\n");
imx35_add_imx_uart1(&uart_pdata); imx35_add_imx_uart1(&uart_pdata);
imx35_add_ipu_core(&mx3_ipu_data); imx35_add_ipu_core();
imx35_add_mx3_sdc_fb(&mx3fb_pdata); imx35_add_mx3_sdc_fb(&mx3fb_pdata);
imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
......
...@@ -367,10 +367,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -367,10 +367,6 @@ static const struct fb_videomode fb_modedb[] = {
}, },
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "CRT-VGA", .name = "CRT-VGA",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -517,7 +513,7 @@ static void __init armadillo5x0_init(void) ...@@ -517,7 +513,7 @@ static void __init armadillo5x0_init(void)
imx31_add_mxc_mmc(0, &sdhc_pdata); imx31_add_mxc_mmc(0, &sdhc_pdata);
/* Register FB */ /* Register FB */
imx31_add_ipu_core(&mx3_ipu_data); imx31_add_ipu_core();
imx31_add_mx3_sdc_fb(&mx3fb_pdata); imx31_add_mx3_sdc_fb(&mx3fb_pdata);
/* Register NOR Flash */ /* Register NOR Flash */
......
...@@ -274,10 +274,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -274,10 +274,6 @@ static const struct fb_videomode fb_modedb[] = {
}, },
}; };
static struct ipu_platform_data mx3_ipu_data = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "Epson-VGA", .name = "Epson-VGA",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -743,7 +739,7 @@ static void __init mx31_3ds_init(void) ...@@ -743,7 +739,7 @@ static void __init mx31_3ds_init(void)
imx31_add_mxc_mmc(0, &sdhc1_pdata); imx31_add_mxc_mmc(0, &sdhc1_pdata);
imx31_add_spi_imx0(&spi0_pdata); imx31_add_spi_imx0(&spi0_pdata);
imx31_add_ipu_core(&mx3_ipu_data); imx31_add_ipu_core();
imx31_add_mx3_sdc_fb(&mx3fb_pdata); imx31_add_mx3_sdc_fb(&mx3fb_pdata);
/* CSI */ /* CSI */
......
...@@ -473,10 +473,6 @@ static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = { ...@@ -473,10 +473,6 @@ static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
.leds = mx31moboard_leds, .leds = mx31moboard_leds,
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct platform_device *devices[] __initdata = { static struct platform_device *devices[] __initdata = {
&mx31moboard_flash, &mx31moboard_flash,
}; };
...@@ -494,7 +490,7 @@ static int __init mx31moboard_init_cam(void) ...@@ -494,7 +490,7 @@ static int __init mx31moboard_init_cam(void)
int dma, ret = -ENOMEM; int dma, ret = -ENOMEM;
struct platform_device *pdev; struct platform_device *pdev;
imx31_add_ipu_core(&mx3_ipu_data); imx31_add_ipu_core();
pdev = imx31_alloc_mx3_camera(&camera_pdata); pdev = imx31_alloc_mx3_camera(&camera_pdata);
if (IS_ERR(pdev)) if (IS_ERR(pdev))
......
...@@ -80,10 +80,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -80,10 +80,6 @@ static const struct fb_videomode fb_modedb[] = {
}, },
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "Ceramate-CLAA070VC01", .name = "Ceramate-CLAA070VC01",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -297,10 +293,6 @@ static int __init imx35_3ds_init_camera(void) ...@@ -297,10 +293,6 @@ static int __init imx35_3ds_init_camera(void)
return ret; return ret;
} }
static const struct ipu_platform_data mx35_3ds_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct i2c_board_info mx35_3ds_i2c_camera = { static struct i2c_board_info mx35_3ds_i2c_camera = {
I2C_BOARD_INFO("ov2640", 0x30), I2C_BOARD_INFO("ov2640", 0x30),
}; };
...@@ -596,7 +588,7 @@ static void __init mx35_3ds_init(void) ...@@ -596,7 +588,7 @@ static void __init mx35_3ds_init(void)
i2c_register_board_info( i2c_register_board_info(
0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds)); 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds));
imx35_add_ipu_core(&mx35_3ds_ipu_data); imx35_add_ipu_core();
platform_device_register(&mx35_3ds_ov2640); platform_device_register(&mx35_3ds_ov2640);
imx35_3ds_init_camera(); imx35_3ds_init_camera();
......
...@@ -441,10 +441,6 @@ static struct platform_device *devices[] __initdata = { ...@@ -441,10 +441,6 @@ static struct platform_device *devices[] __initdata = {
&pcm037_mt9v022, &pcm037_mt9v022,
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static const struct fb_videomode fb_modedb[] = { static const struct fb_videomode fb_modedb[] = {
{ {
/* 240x320 @ 60 Hz Sharp */ /* 240x320 @ 60 Hz Sharp */
...@@ -648,7 +644,7 @@ static void __init pcm037_init(void) ...@@ -648,7 +644,7 @@ static void __init pcm037_init(void)
imx31_add_mxc_nand(&pcm037_nand_board_info); imx31_add_mxc_nand(&pcm037_nand_board_info);
imx31_add_mxc_mmc(0, &sdhc_pdata); imx31_add_mxc_mmc(0, &sdhc_pdata);
imx31_add_ipu_core(&mx3_ipu_data); imx31_add_ipu_core();
imx31_add_mx3_sdc_fb(&mx3fb_pdata); imx31_add_mx3_sdc_fb(&mx3fb_pdata);
/* CSI */ /* CSI */
......
...@@ -76,10 +76,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -76,10 +76,6 @@ static const struct fb_videomode fb_modedb[] = {
}, },
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "Sharp-LQ035Q7", .name = "Sharp-LQ035Q7",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -376,7 +372,7 @@ static void __init pcm043_init(void) ...@@ -376,7 +372,7 @@ static void __init pcm043_init(void)
imx35_add_imx_i2c0(&pcm043_i2c0_data); imx35_add_imx_i2c0(&pcm043_i2c0_data);
imx35_add_ipu_core(&mx3_ipu_data); imx35_add_ipu_core();
imx35_add_mx3_sdc_fb(&mx3fb_pdata); imx35_add_mx3_sdc_fb(&mx3fb_pdata);
if (otg_mode_host) { if (otg_mode_host) {
......
...@@ -87,10 +87,6 @@ static const struct fb_videomode fb_modedb[] = { ...@@ -87,10 +87,6 @@ static const struct fb_videomode fb_modedb[] = {
} }
}; };
static const struct ipu_platform_data mx3_ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static struct mx3fb_platform_data mx3fb_pdata __initdata = { static struct mx3fb_platform_data mx3fb_pdata __initdata = {
.name = "PT0708048", .name = "PT0708048",
.mode = fb_modedb, .mode = fb_modedb,
...@@ -290,7 +286,7 @@ static void __init vpr200_board_init(void) ...@@ -290,7 +286,7 @@ static void __init vpr200_board_init(void)
imx35_add_imx_uart0(NULL); imx35_add_imx_uart0(NULL);
imx35_add_imx_uart2(NULL); imx35_add_imx_uart2(NULL);
imx35_add_ipu_core(&mx3_ipu_data); imx35_add_ipu_core();
imx35_add_mx3_sdc_fb(&mx3fb_pdata); imx35_add_mx3_sdc_fb(&mx3fb_pdata);
imx35_add_fsl_usb2_udc(&otg_device_pdata); imx35_add_fsl_usb2_udc(&otg_device_pdata);
......
...@@ -162,10 +162,6 @@ static const struct imxmmc_platform_data mmc_pdata __initconst = { ...@@ -162,10 +162,6 @@ static const struct imxmmc_platform_data mmc_pdata __initconst = {
}; };
/* Framebuffer support */ /* Framebuffer support */
static const struct ipu_platform_data ipu_data __initconst = {
.irq_base = MXC_IPU_IRQ_START,
};
static const struct fb_videomode fb_modedb = { static const struct fb_videomode fb_modedb = {
/* 640x480 TFT panel (IPS-056T) */ /* 640x480 TFT panel (IPS-056T) */
.name = "CRT-VGA", .name = "CRT-VGA",
...@@ -199,7 +195,7 @@ static void __init mx31lilly_init_fb(void) ...@@ -199,7 +195,7 @@ static void __init mx31lilly_init_fb(void)
return; return;
} }
imx31_add_ipu_core(&ipu_data); imx31_add_ipu_core();
imx31_add_mx3_sdc_fb(&fb_pdata); imx31_add_mx3_sdc_fb(&fb_pdata);
gpio_direction_output(LCD_VCC_EN_GPIO, 1); gpio_direction_output(LCD_VCC_EN_GPIO, 1);
} }
......
...@@ -30,8 +30,7 @@ const struct imx_ipu_core_data imx35_ipu_core_data __initconst = ...@@ -30,8 +30,7 @@ const struct imx_ipu_core_data imx35_ipu_core_data __initconst =
static struct platform_device *imx_ipu_coredev __initdata; static struct platform_device *imx_ipu_coredev __initdata;
struct platform_device *__init imx_add_ipu_core( struct platform_device *__init imx_add_ipu_core(
const struct imx_ipu_core_data *data, const struct imx_ipu_core_data *data)
const struct ipu_platform_data *pdata)
{ {
/* The resource order is important! */ /* The resource order is important! */
struct resource res[] = { struct resource res[] = {
...@@ -55,7 +54,7 @@ struct platform_device *__init imx_add_ipu_core( ...@@ -55,7 +54,7 @@ struct platform_device *__init imx_add_ipu_core(
}; };
return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1, return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1,
res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); res, ARRAY_SIZE(res), NULL, 0);
} }
struct platform_device *__init imx_alloc_mx3_camera( struct platform_device *__init imx_alloc_mx3_camera(
......
...@@ -183,7 +183,6 @@ struct platform_device *__init imx_add_imx_udc( ...@@ -183,7 +183,6 @@ struct platform_device *__init imx_add_imx_udc(
const struct imx_imx_udc_data *data, const struct imx_imx_udc_data *data,
const struct imxusb_platform_data *pdata); const struct imxusb_platform_data *pdata);
#include <mach/ipu.h>
#include <mach/mx3fb.h> #include <mach/mx3fb.h>
#include <mach/mx3_camera.h> #include <mach/mx3_camera.h>
struct imx_ipu_core_data { struct imx_ipu_core_data {
...@@ -192,8 +191,7 @@ struct imx_ipu_core_data { ...@@ -192,8 +191,7 @@ struct imx_ipu_core_data {
resource_size_t errirq; resource_size_t errirq;
}; };
struct platform_device *__init imx_add_ipu_core( struct platform_device *__init imx_add_ipu_core(
const struct imx_ipu_core_data *data, const struct imx_ipu_core_data *data);
const struct ipu_platform_data *pdata);
struct platform_device *__init imx_alloc_mx3_camera( struct platform_device *__init imx_alloc_mx3_camera(
const struct imx_ipu_core_data *data, const struct imx_ipu_core_data *data,
const struct mx3_camera_pdata *pdata); const struct mx3_camera_pdata *pdata);
......
...@@ -110,10 +110,6 @@ enum ipu_rotate_mode { ...@@ -110,10 +110,6 @@ enum ipu_rotate_mode {
IPU_ROTATE_90_LEFT = 7, IPU_ROTATE_90_LEFT = 7,
}; };
struct ipu_platform_data {
unsigned int irq_base;
};
/* /*
* Enumeration of DI ports for ADC. * Enumeration of DI ports for ADC.
*/ */
......
...@@ -1663,7 +1663,6 @@ static void __exit ipu_idmac_exit(struct ipu *ipu) ...@@ -1663,7 +1663,6 @@ static void __exit ipu_idmac_exit(struct ipu *ipu)
static int __init ipu_probe(struct platform_device *pdev) static int __init ipu_probe(struct platform_device *pdev)
{ {
struct ipu_platform_data *pdata = pdev->dev.platform_data;
struct resource *mem_ipu, *mem_ic; struct resource *mem_ipu, *mem_ic;
int ret; int ret;
...@@ -1671,7 +1670,7 @@ static int __init ipu_probe(struct platform_device *pdev) ...@@ -1671,7 +1670,7 @@ static int __init ipu_probe(struct platform_device *pdev)
mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1); mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!pdata || !mem_ipu || !mem_ic) if (!mem_ipu || !mem_ic)
return -EINVAL; return -EINVAL;
ipu_data.dev = &pdev->dev; ipu_data.dev = &pdev->dev;
...@@ -1688,10 +1687,9 @@ static int __init ipu_probe(struct platform_device *pdev) ...@@ -1688,10 +1687,9 @@ static int __init ipu_probe(struct platform_device *pdev)
goto err_noirq; goto err_noirq;
ipu_data.irq_err = ret; ipu_data.irq_err = ret;
ipu_data.irq_base = pdata->irq_base;
dev_dbg(&pdev->dev, "fn irq %u, err irq %u, irq-base %u\n", dev_dbg(&pdev->dev, "fn irq %u, err irq %u\n",
ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base); ipu_data.irq_fn, ipu_data.irq_err);
/* Remap IPU common registers */ /* Remap IPU common registers */
ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu)); ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu));
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h>
#include <mach/ipu.h> #include <mach/ipu.h>
...@@ -354,10 +355,12 @@ static struct irq_chip ipu_irq_chip = { ...@@ -354,10 +355,12 @@ static struct irq_chip ipu_irq_chip = {
/* Install the IRQ handler */ /* Install the IRQ handler */
int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
{ {
struct ipu_platform_data *pdata = dev->dev.platform_data; unsigned int irq, i;
unsigned int irq, irq_base, i; int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS,
numa_node_id());
irq_base = pdata->irq_base; if (irq_base < 0)
return irq_base;
for (i = 0; i < IPU_IRQ_NR_BANKS; i++) for (i = 0; i < IPU_IRQ_NR_BANKS; i++)
irq_bank[i].ipu = ipu; irq_bank[i].ipu = ipu;
...@@ -387,15 +390,16 @@ int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) ...@@ -387,15 +390,16 @@ int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
irq_set_handler_data(ipu->irq_err, ipu); irq_set_handler_data(ipu->irq_err, ipu);
irq_set_chained_handler(ipu->irq_err, ipu_irq_err); irq_set_chained_handler(ipu->irq_err, ipu_irq_err);
ipu->irq_base = irq_base;
return 0; return 0;
} }
void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev) void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev)
{ {
struct ipu_platform_data *pdata = dev->dev.platform_data;
unsigned int irq, irq_base; unsigned int irq, irq_base;
irq_base = pdata->irq_base; irq_base = ipu->irq_base;
irq_set_chained_handler(ipu->irq_fn, NULL); irq_set_chained_handler(ipu->irq_fn, NULL);
irq_set_handler_data(ipu->irq_fn, NULL); irq_set_handler_data(ipu->irq_fn, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment