Commit 81ad0f5b authored by Arnd Bergmann's avatar Arnd Bergmann

fbdev: omap: pass irqs as resource

To avoid relying on the mach/irqs.h header, stop using
OMAP_LCDC_IRQ and INT_1610_SoSSI_MATCH directly in the driver
code, but instead pass these as resources.
Acked-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 0768fb67
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/omapfb.h> #include <linux/omapfb.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/irq.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <mach/irqs.h>
#if IS_ENABLED(CONFIG_FB_OMAP) #if IS_ENABLED(CONFIG_FB_OMAP)
static bool omapfb_lcd_configured; static bool omapfb_lcd_configured;
...@@ -27,6 +30,19 @@ static struct omapfb_platform_data omapfb_config; ...@@ -27,6 +30,19 @@ static struct omapfb_platform_data omapfb_config;
static u64 omap_fb_dma_mask = ~(u32)0; static u64 omap_fb_dma_mask = ~(u32)0;
struct resource omap_fb_resources[] = {
{
.name = "irq",
.start = INT_LCD_CTRL,
.flags = IORESOURCE_IRQ,
},
{
.name = "irq",
.start = INT_SOSSI_MATCH,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device omap_fb_device = { static struct platform_device omap_fb_device = {
.name = "omapfb", .name = "omapfb",
.id = -1, .id = -1,
...@@ -35,7 +51,8 @@ static struct platform_device omap_fb_device = { ...@@ -35,7 +51,8 @@ static struct platform_device omap_fb_device = {
.coherent_dma_mask = DMA_BIT_MASK(32), .coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &omapfb_config, .platform_data = &omapfb_config,
}, },
.num_resources = 0, .num_resources = ARRAY_SIZE(omap_fb_resources),
.resource = omap_fb_resources,
}; };
void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
......
...@@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
} }
clk_enable(lcdc.lcd_ck); clk_enable(lcdc.lcd_ck);
r = request_irq(OMAP_LCDC_IRQ, lcdc_irq_handler, 0, MODULE_NAME, fbdev); r = request_irq(fbdev->int_irq, lcdc_irq_handler, 0, MODULE_NAME, fbdev);
if (r) { if (r) {
dev_err(fbdev->dev, "unable to get IRQ\n"); dev_err(fbdev->dev, "unable to get IRQ\n");
goto fail2; goto fail2;
...@@ -744,7 +744,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -744,7 +744,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
fail4: fail4:
omap_free_lcd_dma(); omap_free_lcd_dma();
fail3: fail3:
free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); free_irq(fbdev->int_irq, lcdc.fbdev);
fail2: fail2:
clk_disable(lcdc.lcd_ck); clk_disable(lcdc.lcd_ck);
fail1: fail1:
...@@ -759,7 +759,7 @@ static void omap_lcdc_cleanup(void) ...@@ -759,7 +759,7 @@ static void omap_lcdc_cleanup(void)
free_palette_ram(); free_palette_ram();
free_fbmem(); free_fbmem();
omap_free_lcd_dma(); omap_free_lcd_dma();
free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); free_irq(lcdc.fbdev->int_irq, lcdc.fbdev);
clk_disable(lcdc.lcd_ck); clk_disable(lcdc.lcd_ck);
clk_put(lcdc.lcd_ck); clk_put(lcdc.lcd_ck);
} }
......
...@@ -204,6 +204,8 @@ struct omapfb_device { ...@@ -204,6 +204,8 @@ struct omapfb_device {
struct lcd_panel *panel; /* LCD panel */ struct lcd_panel *panel; /* LCD panel */
const struct lcd_ctrl *ctrl; /* LCD controller */ const struct lcd_ctrl *ctrl; /* LCD controller */
const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */ const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
int ext_irq;
int int_irq;
struct lcd_ctrl_extif *ext_if; /* LCD ctrl external struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
interface */ interface */
struct device *dev; struct device *dev;
......
...@@ -1624,7 +1624,7 @@ static int omapfb_do_probe(struct platform_device *pdev, ...@@ -1624,7 +1624,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
init_state = 0; init_state = 0;
if (pdev->num_resources != 0) { if (pdev->num_resources != 2) {
dev_err(&pdev->dev, "probed for an unknown device\n"); dev_err(&pdev->dev, "probed for an unknown device\n");
r = -ENODEV; r = -ENODEV;
goto cleanup; goto cleanup;
...@@ -1643,6 +1643,20 @@ static int omapfb_do_probe(struct platform_device *pdev, ...@@ -1643,6 +1643,20 @@ static int omapfb_do_probe(struct platform_device *pdev,
r = -ENOMEM; r = -ENOMEM;
goto cleanup; goto cleanup;
} }
fbdev->int_irq = platform_get_irq(pdev, 0);
if (!fbdev->int_irq) {
dev_err(&pdev->dev, "unable to get irq\n");
r = ENXIO;
goto cleanup;
}
fbdev->ext_irq = platform_get_irq(pdev, 1);
if (!fbdev->ext_irq) {
dev_err(&pdev->dev, "unable to get irq\n");
r = ENXIO;
goto cleanup;
}
init_state++; init_state++;
fbdev->dev = &pdev->dev; fbdev->dev = &pdev->dev;
......
...@@ -639,7 +639,7 @@ static int sossi_init(struct omapfb_device *fbdev) ...@@ -639,7 +639,7 @@ static int sossi_init(struct omapfb_device *fbdev)
l &= ~(1 << 31); /* REORDERING */ l &= ~(1 << 31); /* REORDERING */
sossi_write_reg(SOSSI_INIT1_REG, l); sossi_write_reg(SOSSI_INIT1_REG, l);
if ((r = request_irq(INT_1610_SoSSI_MATCH, sossi_match_irq, if ((r = request_irq(fbdev->ext_irq, sossi_match_irq,
IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_EDGE_FALLING,
"sossi_match", sossi.fbdev->dev)) < 0) { "sossi_match", sossi.fbdev->dev)) < 0) {
dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n"); dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n");
......
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