1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
From: Mans Rullgard <mans@mansr.com>
Date: Wed, 3 Sep 2008 20:57:59 +0000 (+0100)
Subject: OMAP: Add omapfb_unregister_panel() function
X-Git-Url: http://git.mansr.com/?p=linux-omap;a=commitdiff_plain;h=85b5d3ba7221193cb2315256b69e97f34d2ae3b7
OMAP: Add omapfb_unregister_panel() function
This adds the function omapfb_unregister_panel() for use by LCD
drivers built as modules.
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/mach/omapfb.h
index a4a84f3..3ccb076 100644
--- a/arch/arm/plat-omap/include/mach/omapfb.h
+++ b/arch/arm/plat-omap/include/mach/omapfb.h
@@ -378,6 +378,7 @@ extern struct lcd_ctrl omap2_disp_ctrl;
extern void omapfb_reserve_sdram(void);
extern void omapfb_register_panel(struct lcd_panel *panel);
+extern void omapfb_unregister_panel(struct lcd_panel *panel);
extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval);
extern void omapfb_notify_clients(struct omapfb_device *fbdev,
unsigned long event);
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 912cb0c..6d09e03 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1736,7 +1736,8 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case 7:
omapfb_unregister_sysfs(fbdev);
case 6:
- fbdev->panel->disable(fbdev->panel);
+ if (fbdev->panel)
+ fbdev->panel->disable(fbdev->panel);
case 5:
omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
case 4:
@@ -1744,7 +1745,8 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case 3:
ctrl_cleanup(fbdev);
case 2:
- fbdev->panel->cleanup(fbdev->panel);
+ if (fbdev->panel)
+ fbdev->panel->cleanup(fbdev->panel);
case 1:
dev_set_drvdata(fbdev->dev, NULL);
kfree(fbdev);
@@ -1999,6 +2001,17 @@ void omapfb_register_panel(struct lcd_panel *panel)
}
EXPORT_SYMBOL(omapfb_register_panel);
+void omapfb_unregister_panel(struct lcd_panel *panel)
+{
+ BUG_ON(fbdev_panel != panel);
+
+ panel->disable(panel);
+
+ omapfb_dev->panel = NULL;
+ fbdev_panel = NULL;
+}
+EXPORT_SYMBOL(omapfb_unregister_panel);
+
/* Called when the device is being detached from the driver */
static int omapfb_remove(struct platform_device *pdev)
{
|