mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 00:40:03 +00:00
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: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
0768fb6709
commit
81ad0f5bc4
5 changed files with 39 additions and 6 deletions
|
@ -17,9 +17,12 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/omapfb.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_OMAP)
|
||||
|
||||
static bool omapfb_lcd_configured;
|
||||
|
@ -27,6 +30,19 @@ static struct omapfb_platform_data omapfb_config;
|
|||
|
||||
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 = {
|
||||
.name = "omapfb",
|
||||
.id = -1,
|
||||
|
@ -35,7 +51,8 @@ static struct platform_device omap_fb_device = {
|
|||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
.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)
|
||||
|
|
|
@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
|
|||
}
|
||||
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) {
|
||||
dev_err(fbdev->dev, "unable to get IRQ\n");
|
||||
goto fail2;
|
||||
|
@ -744,7 +744,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
|
|||
fail4:
|
||||
omap_free_lcd_dma();
|
||||
fail3:
|
||||
free_irq(OMAP_LCDC_IRQ, lcdc.fbdev);
|
||||
free_irq(fbdev->int_irq, lcdc.fbdev);
|
||||
fail2:
|
||||
clk_disable(lcdc.lcd_ck);
|
||||
fail1:
|
||||
|
@ -759,7 +759,7 @@ static void omap_lcdc_cleanup(void)
|
|||
free_palette_ram();
|
||||
free_fbmem();
|
||||
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_put(lcdc.lcd_ck);
|
||||
}
|
||||
|
|
|
@ -204,6 +204,8 @@ struct omapfb_device {
|
|||
struct lcd_panel *panel; /* LCD panel */
|
||||
const struct lcd_ctrl *ctrl; /* LCD controller */
|
||||
const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
|
||||
int ext_irq;
|
||||
int int_irq;
|
||||
struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
|
||||
interface */
|
||||
struct device *dev;
|
||||
|
|
|
@ -1624,7 +1624,7 @@ static int omapfb_do_probe(struct platform_device *pdev,
|
|||
|
||||
init_state = 0;
|
||||
|
||||
if (pdev->num_resources != 0) {
|
||||
if (pdev->num_resources != 2) {
|
||||
dev_err(&pdev->dev, "probed for an unknown device\n");
|
||||
r = -ENODEV;
|
||||
goto cleanup;
|
||||
|
@ -1643,6 +1643,20 @@ static int omapfb_do_probe(struct platform_device *pdev,
|
|||
r = -ENOMEM;
|
||||
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++;
|
||||
|
||||
fbdev->dev = &pdev->dev;
|
||||
|
|
|
@ -639,7 +639,7 @@ static int sossi_init(struct omapfb_device *fbdev)
|
|||
l &= ~(1 << 31); /* REORDERING */
|
||||
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,
|
||||
"sossi_match", sossi.fbdev->dev)) < 0) {
|
||||
dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n");
|
||||
|
|
Loading…
Reference in a new issue