mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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: Shawn Guo <shawn.guo@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
This commit is contained in:
parent
544496ab5c
commit
88289c80d4
@ -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)
|
||||
|
||||
extern const struct imx_ipu_core_data imx31_ipu_core_data;
|
||||
#define imx31_add_ipu_core(pdata) \
|
||||
imx_add_ipu_core(&imx31_ipu_core_data, pdata)
|
||||
#define imx31_add_ipu_core() \
|
||||
imx_add_ipu_core(&imx31_ipu_core_data)
|
||||
#define imx31_alloc_mx3_camera(pdata) \
|
||||
imx_alloc_mx3_camera(&imx31_ipu_core_data, pdata)
|
||||
#define imx31_add_mx3_sdc_fb(pdata) \
|
||||
|
@ -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)
|
||||
|
||||
extern const struct imx_ipu_core_data imx35_ipu_core_data;
|
||||
#define imx35_add_ipu_core(pdata) \
|
||||
imx_add_ipu_core(&imx35_ipu_core_data, pdata)
|
||||
#define imx35_add_ipu_core() \
|
||||
imx_add_ipu_core(&imx35_ipu_core_data)
|
||||
#define imx35_alloc_mx3_camera(pdata) \
|
||||
imx_alloc_mx3_camera(&imx35_ipu_core_data, pdata)
|
||||
#define imx35_add_mx3_sdc_fb(pdata) \
|
||||
|
@ -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 = {
|
||||
.name = "CMO-QVGA",
|
||||
.mode = fb_modedb,
|
||||
@ -287,7 +283,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
|
||||
printk(KERN_ERR "error setting mbimxsd pads !\n");
|
||||
|
||||
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_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
|
||||
|
@ -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 = {
|
||||
.name = "CRT-VGA",
|
||||
.mode = fb_modedb,
|
||||
@ -517,7 +513,7 @@ static void __init armadillo5x0_init(void)
|
||||
imx31_add_mxc_mmc(0, &sdhc_pdata);
|
||||
|
||||
/* Register FB */
|
||||
imx31_add_ipu_core(&mx3_ipu_data);
|
||||
imx31_add_ipu_core();
|
||||
imx31_add_mx3_sdc_fb(&mx3fb_pdata);
|
||||
|
||||
/* Register NOR Flash */
|
||||
|
@ -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 = {
|
||||
.name = "Epson-VGA",
|
||||
.mode = fb_modedb,
|
||||
@ -743,7 +739,7 @@ static void __init mx31_3ds_init(void)
|
||||
imx31_add_mxc_mmc(0, &sdhc1_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);
|
||||
|
||||
/* CSI */
|
||||
|
@ -473,10 +473,6 @@ static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
|
||||
.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 = {
|
||||
&mx31moboard_flash,
|
||||
};
|
||||
@ -494,7 +490,7 @@ static int __init mx31moboard_init_cam(void)
|
||||
int dma, ret = -ENOMEM;
|
||||
struct platform_device *pdev;
|
||||
|
||||
imx31_add_ipu_core(&mx3_ipu_data);
|
||||
imx31_add_ipu_core();
|
||||
|
||||
pdev = imx31_alloc_mx3_camera(&camera_pdata);
|
||||
if (IS_ERR(pdev))
|
||||
|
@ -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 = {
|
||||
.name = "Ceramate-CLAA070VC01",
|
||||
.mode = fb_modedb,
|
||||
@ -297,10 +293,6 @@ err:
|
||||
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 = {
|
||||
I2C_BOARD_INFO("ov2640", 0x30),
|
||||
};
|
||||
@ -596,7 +588,7 @@ static void __init mx35_3ds_init(void)
|
||||
i2c_register_board_info(
|
||||
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);
|
||||
imx35_3ds_init_camera();
|
||||
|
||||
|
@ -441,10 +441,6 @@ static struct platform_device *devices[] __initdata = {
|
||||
&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[] = {
|
||||
{
|
||||
/* 240x320 @ 60 Hz Sharp */
|
||||
@ -648,7 +644,7 @@ static void __init pcm037_init(void)
|
||||
|
||||
imx31_add_mxc_nand(&pcm037_nand_board_info);
|
||||
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);
|
||||
|
||||
/* CSI */
|
||||
|
@ -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 = {
|
||||
.name = "Sharp-LQ035Q7",
|
||||
.mode = fb_modedb,
|
||||
@ -376,7 +372,7 @@ static void __init pcm043_init(void)
|
||||
|
||||
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);
|
||||
|
||||
if (otg_mode_host) {
|
||||
|
@ -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 = {
|
||||
.name = "PT0708048",
|
||||
.mode = fb_modedb,
|
||||
@ -290,7 +286,7 @@ static void __init vpr200_board_init(void)
|
||||
imx35_add_imx_uart0(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_fsl_usb2_udc(&otg_device_pdata);
|
||||
|
@ -162,10 +162,6 @@ static const struct imxmmc_platform_data mmc_pdata __initconst = {
|
||||
};
|
||||
|
||||
/* Framebuffer support */
|
||||
static const struct ipu_platform_data ipu_data __initconst = {
|
||||
.irq_base = MXC_IPU_IRQ_START,
|
||||
};
|
||||
|
||||
static const struct fb_videomode fb_modedb = {
|
||||
/* 640x480 TFT panel (IPS-056T) */
|
||||
.name = "CRT-VGA",
|
||||
@ -199,7 +195,7 @@ static void __init mx31lilly_init_fb(void)
|
||||
return;
|
||||
}
|
||||
|
||||
imx31_add_ipu_core(&ipu_data);
|
||||
imx31_add_ipu_core();
|
||||
imx31_add_mx3_sdc_fb(&fb_pdata);
|
||||
gpio_direction_output(LCD_VCC_EN_GPIO, 1);
|
||||
}
|
||||
|
@ -30,8 +30,7 @@ const struct imx_ipu_core_data imx35_ipu_core_data __initconst =
|
||||
static struct platform_device *imx_ipu_coredev __initdata;
|
||||
|
||||
struct platform_device *__init imx_add_ipu_core(
|
||||
const struct imx_ipu_core_data *data,
|
||||
const struct ipu_platform_data *pdata)
|
||||
const struct imx_ipu_core_data *data)
|
||||
{
|
||||
/* The resource order is important! */
|
||||
struct resource res[] = {
|
||||
@ -55,7 +54,7 @@ struct platform_device *__init imx_add_ipu_core(
|
||||
};
|
||||
|
||||
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(
|
||||
|
@ -183,7 +183,6 @@ struct platform_device *__init imx_add_imx_udc(
|
||||
const struct imx_imx_udc_data *data,
|
||||
const struct imxusb_platform_data *pdata);
|
||||
|
||||
#include <mach/ipu.h>
|
||||
#include <mach/mx3fb.h>
|
||||
#include <mach/mx3_camera.h>
|
||||
struct imx_ipu_core_data {
|
||||
@ -192,8 +191,7 @@ struct imx_ipu_core_data {
|
||||
resource_size_t errirq;
|
||||
};
|
||||
struct platform_device *__init imx_add_ipu_core(
|
||||
const struct imx_ipu_core_data *data,
|
||||
const struct ipu_platform_data *pdata);
|
||||
const struct imx_ipu_core_data *data);
|
||||
struct platform_device *__init imx_alloc_mx3_camera(
|
||||
const struct imx_ipu_core_data *data,
|
||||
const struct mx3_camera_pdata *pdata);
|
||||
|
@ -110,10 +110,6 @@ enum ipu_rotate_mode {
|
||||
IPU_ROTATE_90_LEFT = 7,
|
||||
};
|
||||
|
||||
struct ipu_platform_data {
|
||||
unsigned int irq_base;
|
||||
};
|
||||
|
||||
/*
|
||||
* Enumeration of DI ports for ADC.
|
||||
*/
|
||||
|
@ -1663,7 +1663,6 @@ static void __exit ipu_idmac_exit(struct ipu *ipu)
|
||||
|
||||
static int __init ipu_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct ipu_platform_data *pdata = pdev->dev.platform_data;
|
||||
struct resource *mem_ipu, *mem_ic;
|
||||
int ret;
|
||||
|
||||
@ -1671,7 +1670,7 @@ static int __init ipu_probe(struct platform_device *pdev)
|
||||
|
||||
mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
if (!pdata || !mem_ipu || !mem_ic)
|
||||
if (!mem_ipu || !mem_ic)
|
||||
return -EINVAL;
|
||||
|
||||
ipu_data.dev = &pdev->dev;
|
||||
@ -1688,10 +1687,9 @@ static int __init ipu_probe(struct platform_device *pdev)
|
||||
goto err_noirq;
|
||||
|
||||
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",
|
||||
ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base);
|
||||
dev_dbg(&pdev->dev, "fn irq %u, err irq %u\n",
|
||||
ipu_data.irq_fn, ipu_data.irq_err);
|
||||
|
||||
/* Remap IPU common registers */
|
||||
ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu));
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <mach/ipu.h>
|
||||
|
||||
@ -354,10 +355,12 @@ static struct irq_chip ipu_irq_chip = {
|
||||
/* Install the IRQ handler */
|
||||
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, irq_base, i;
|
||||
unsigned int irq, 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++)
|
||||
irq_bank[i].ipu = ipu;
|
||||
@ -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_chained_handler(ipu->irq_err, ipu_irq_err);
|
||||
|
||||
ipu->irq_base = irq_base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
irq_base = pdata->irq_base;
|
||||
irq_base = ipu->irq_base;
|
||||
|
||||
irq_set_chained_handler(ipu->irq_fn, NULL);
|
||||
irq_set_handler_data(ipu->irq_fn, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user