diff options
Diffstat (limited to 'recipes/linux/linux-mainline')
5 files changed, 482 insertions, 0 deletions
diff --git a/recipes/linux/linux-mainline/0001-AM335x-Adding-SGX-DT-node.patch b/recipes/linux/linux-mainline/0001-AM335x-Adding-SGX-DT-node.patch new file mode 100755 index 0000000..97ce000 --- /dev/null +++ b/recipes/linux/linux-mainline/0001-AM335x-Adding-SGX-DT-node.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 1400fbf3e8e02eb1efd210a892a0d602061c7ca8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prathap M S <msprathap@ti.com> | ||
3 | Date: Mon, 2 Sep 2013 11:42:13 +0530 | ||
4 | Subject: [PATCH 1/3] AM335x : Adding SGX DT node | ||
5 | |||
6 | This adds the SGX DT node for AM335x. | ||
7 | |||
8 | Signed-off-by: Prathap M S <msprathap@ti.com> | ||
9 | --- | ||
10 | arch/arm/boot/dts/am33xx.dtsi | 8 ++++++++ | ||
11 | 1 files changed, 8 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi | ||
14 | index 17e0da8..74c6e41 100644 | ||
15 | --- a/arch/arm/boot/dts/am33xx.dtsi | ||
16 | +++ b/arch/arm/boot/dts/am33xx.dtsi | ||
17 | @@ -96,6 +96,14 @@ | ||
18 | reg = <0x48200000 0x1000>; | ||
19 | }; | ||
20 | |||
21 | + sgx@0x56000000 { | ||
22 | + compatible = "ti,sgx"; | ||
23 | + ti,hwmods = "gfx"; | ||
24 | + clock-frequency = <200000000>; | ||
25 | + reg = <0x56000000 0x1000000>; | ||
26 | + interrupts = <37>; | ||
27 | + }; | ||
28 | + | ||
29 | edma: edma@49000000 { | ||
30 | compatible = "ti,edma3"; | ||
31 | ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; | ||
32 | -- | ||
33 | 1.7.1 | ||
34 | |||
diff --git a/recipes/linux/linux-mainline/0002-AM33XX-Invoke-hwmod-deassert-for-SGX-graphics-device.patch b/recipes/linux/linux-mainline/0002-AM33XX-Invoke-hwmod-deassert-for-SGX-graphics-device.patch new file mode 100755 index 0000000..05672d3 --- /dev/null +++ b/recipes/linux/linux-mainline/0002-AM33XX-Invoke-hwmod-deassert-for-SGX-graphics-device.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | From 4179cd27a2caa23688646e043e2872e89c9a7bc7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prathap M S <msprathap@ti.com> | ||
3 | Date: Mon, 2 Sep 2013 11:52:03 +0530 | ||
4 | Subject: [PATCH 2/3] AM33XX : Invoke hwmod deassert for SGX(graphics device) | ||
5 | |||
6 | By default reset is asserted for SGX. | ||
7 | Adding gpu.c file introducing omap_sgx_init_of() for deasserting SGX reset. | ||
8 | This calls omap_device_deassert_hardreset() for deasserting the reset for SGX. | ||
9 | |||
10 | Signed-off-by: Prathap M S <msprathap@ti.com> | ||
11 | --- | ||
12 | arch/arm/mach-omap2/Makefile | 2 +- | ||
13 | arch/arm/mach-omap2/board-generic.c | 4 +++ | ||
14 | arch/arm/mach-omap2/common.h | 1 + | ||
15 | arch/arm/mach-omap2/gpu.c | 48 +++++++++++++++++++++++++++++++++++ | ||
16 | 4 files changed, 54 insertions(+), 1 deletions(-) | ||
17 | create mode 100644 arch/arm/mach-omap2/gpu.c | ||
18 | |||
19 | diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile | ||
20 | index d4f6715..b65cc56 100644 | ||
21 | --- a/arch/arm/mach-omap2/Makefile | ||
22 | +++ b/arch/arm/mach-omap2/Makefile | ||
23 | @@ -8,7 +8,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ | ||
24 | # Common support | ||
25 | obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ | ||
26 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ | ||
27 | - omap_device.o sram.o | ||
28 | + omap_device.o sram.o gpu.o | ||
29 | |||
30 | omap-2-3-common = irq.o | ||
31 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ | ||
32 | diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c | ||
33 | index be5d005..e2b3981 100644 | ||
34 | --- a/arch/arm/mach-omap2/board-generic.c | ||
35 | +++ b/arch/arm/mach-omap2/board-generic.c | ||
36 | @@ -22,6 +22,7 @@ | ||
37 | #include "common.h" | ||
38 | #include "common-board-devices.h" | ||
39 | #include "dss-common.h" | ||
40 | +#include "soc.h" | ||
41 | |||
42 | #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) | ||
43 | #define intc_of_init NULL | ||
44 | @@ -50,6 +50,8 @@ static void __init omap_generic_init(void) | ||
45 | omap4_panda_display_init_of(); | ||
46 | else if (of_machine_is_compatible("ti,omap4-sdp")) | ||
47 | omap_4430sdp_display_init_of(); | ||
48 | + if (omap3_has_sgx()) | ||
49 | + omap_sgx_init_of(); | ||
50 | } | ||
51 | |||
52 | #ifdef CONFIG_SOC_OMAP2420 | ||
53 | diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h | ||
54 | index dfcc182..7d2f04e 100644 | ||
55 | --- a/arch/arm/mach-omap2/common.h | ||
56 | +++ b/arch/arm/mach-omap2/common.h | ||
57 | @@ -296,6 +296,7 @@ extern void omap_reserve(void); | ||
58 | |||
59 | struct omap_hwmod; | ||
60 | extern int omap_dss_reset(struct omap_hwmod *); | ||
61 | +void __init omap_sgx_init_of(void); | ||
62 | |||
63 | /* SoC specific clock initializer */ | ||
64 | extern int (*omap_clk_init)(void); | ||
65 | diff --git a/arch/arm/mach-omap2/gpu.c b/arch/arm/mach-omap2/gpu.c | ||
66 | new file mode 100644 | ||
67 | index 0000000..98a66cf | ||
68 | --- /dev/null | ||
69 | +++ b/arch/arm/mach-omap2/gpu.c | ||
70 | @@ -0,0 +1,48 @@ | ||
71 | +/* | ||
72 | + * Deassert reset for AM33xx graphics device(SGX) hwmod | ||
73 | + * | ||
74 | + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
75 | + * Prathap MS <msprathap@ti.com> | ||
76 | + * | ||
77 | + * This program is free software; you can redistribute it and/or | ||
78 | + * modify it under the terms of the GNU General Public License as | ||
79 | + * published by the Free Software Foundation version 2. | ||
80 | + * | ||
81 | + * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
82 | + * kind, whether express or implied; without even the implied warranty | ||
83 | + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
84 | + * GNU General Public License for more details. | ||
85 | + */ | ||
86 | +#include <linux/of_platform.h> | ||
87 | +#include "omap_device.h" | ||
88 | + | ||
89 | +void __init omap_sgx_init_of(void) | ||
90 | +{ | ||
91 | + struct device_node *node; | ||
92 | + struct platform_device *pdev; | ||
93 | + int ret = 0; | ||
94 | + node = of_find_compatible_node(NULL, NULL, "ti,sgx"); | ||
95 | + if (!node) | ||
96 | + return; | ||
97 | + pdev = of_find_device_by_node(node); | ||
98 | + if (!pdev) { | ||
99 | + pr_warn("of_find_device_by_node() failed for sgx\n"); | ||
100 | + return; | ||
101 | + } | ||
102 | + ret = omap_device_deassert_hardreset(pdev, "gfx"); | ||
103 | + if (ret != 0) | ||
104 | + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); | ||
105 | + | ||
106 | + node = of_find_compatible_node(NULL, NULL, "ti,am335x-timer"); | ||
107 | + if (!node) | ||
108 | + return; | ||
109 | + pdev = of_find_device_by_node(node); | ||
110 | + if (!pdev) { | ||
111 | + pr_warn("of_find_device_by_node() failed for sgx\n"); | ||
112 | + return; | ||
113 | + } | ||
114 | + ret = omap_device_deassert_hardreset(pdev, "timer7"); | ||
115 | + if (ret != 0) | ||
116 | + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); | ||
117 | +} | ||
118 | + | ||
119 | -- | ||
120 | 1.7.1 | ||
121 | |||
diff --git a/recipes/linux/linux-mainline/0003-video-da8xx-fb-Add-API-to-register-wait-for-vsync-ca.patch b/recipes/linux/linux-mainline/0003-video-da8xx-fb-Add-API-to-register-wait-for-vsync-ca.patch new file mode 100755 index 0000000..c425982 --- /dev/null +++ b/recipes/linux/linux-mainline/0003-video-da8xx-fb-Add-API-to-register-wait-for-vsync-ca.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From 0f4e7d4b7d7314b38a9fd3497d7d4e0c36d19bff Mon Sep 17 00:00:00 2001 | ||
2 | From: Prathap M S <msprathap@ti.com> | ||
3 | Date: Mon, 2 Sep 2013 12:05:23 +0530 | ||
4 | Subject: [PATCH 3/3] video: da8xx-fb: Add API to register wait for vsync callback | ||
5 | |||
6 | This patch adds APIs to register and unregister wait for vsync callback. | ||
7 | This is derived from commit id 2d44302545da24fd22912d964102bc31a7489e97 | ||
8 | This commit id was part of 3.2 kernel sources. | ||
9 | |||
10 | Signed-off-by: Prathap M S <msprathap@ti.com> | ||
11 | --- | ||
12 | drivers/video/da8xx-fb.c | 33 +++++++++++++++++++++++++++++++++ | ||
13 | include/video/da8xx-fb.h | 4 ++++ | ||
14 | 2 files changed, 37 insertions(+), 0 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c | ||
17 | index 131cf4c..ef06b85 100644 | ||
18 | --- a/drivers/video/da8xx-fb.c | ||
19 | +++ b/drivers/video/da8xx-fb.c | ||
20 | @@ -199,6 +199,9 @@ static struct fb_fix_screeninfo da8xx_fb_fix = { | ||
21 | .accel = FB_ACCEL_NONE | ||
22 | }; | ||
23 | |||
24 | +static vsync_callback_t vsync_cb_handler; | ||
25 | +static void *vsync_cb_arg; | ||
26 | + | ||
27 | static struct fb_videomode known_lcd_panels[] = { | ||
28 | /* Sharp LCD035Q3DG01 */ | ||
29 | [0] = { | ||
30 | @@ -806,6 +809,32 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
35 | +{ | ||
36 | + if ((vsync_cb_handler == NULL) && (vsync_cb_arg == NULL)) { | ||
37 | + vsync_cb_arg = arg; | ||
38 | + vsync_cb_handler = handler; | ||
39 | + } else { | ||
40 | + return -EEXIST; | ||
41 | + } | ||
42 | + | ||
43 | + return 0; | ||
44 | +} | ||
45 | +EXPORT_SYMBOL(register_vsync_cb); | ||
46 | + | ||
47 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
48 | +{ | ||
49 | + if ((vsync_cb_handler == handler) && (vsync_cb_arg == arg)) { | ||
50 | + vsync_cb_handler = NULL; | ||
51 | + vsync_cb_arg = NULL; | ||
52 | + } else { | ||
53 | + return -ENXIO; | ||
54 | + } | ||
55 | + | ||
56 | + return 0; | ||
57 | +} | ||
58 | +EXPORT_SYMBOL(unregister_vsync_cb); | ||
59 | + | ||
60 | /* IRQ handler for version 2 of LCDC */ | ||
61 | static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | ||
62 | { | ||
63 | @@ -843,6 +872,8 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | ||
64 | LCD_DMA_FRM_BUF_CEILING_ADDR_0_REG); | ||
65 | par->vsync_flag = 1; | ||
66 | wake_up_interruptible(&par->vsync_wait); | ||
67 | + if (vsync_cb_handler) | ||
68 | + vsync_cb_handler(vsync_cb_arg); | ||
69 | } | ||
70 | |||
71 | if (stat & LCD_END_OF_FRAME1) { | ||
72 | @@ -918,6 +949,8 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg) | ||
73 | LCD_DMA_FRM_BUF_CEILING_ADDR_1_REG); | ||
74 | par->vsync_flag = 1; | ||
75 | wake_up_interruptible(&par->vsync_wait); | ||
76 | + if (vsync_cb_handler) | ||
77 | + vsync_cb_handler(vsync_cb_arg); | ||
78 | } | ||
79 | } | ||
80 | |||
81 | diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h | ||
82 | index efed3c3..a6cc484 100644 | ||
83 | --- a/include/video/da8xx-fb.h | ||
84 | +++ b/include/video/da8xx-fb.h | ||
85 | @@ -91,5 +91,9 @@ struct lcd_sync_arg { | ||
86 | /* Proprietary FB_SYNC_ flags */ | ||
87 | #define FB_SYNC_CLK_INVERT 0x40000000 | ||
88 | |||
89 | +typedef void (*vsync_callback_t)(void *arg); | ||
90 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
91 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
92 | + | ||
93 | #endif /* ifndef DA8XX_FB_H */ | ||
94 | |||
95 | -- | ||
96 | 1.7.1 | ||
97 | |||
diff --git a/recipes/linux/linux-mainline/customer/0001-AM335x-Adding-SGX-DT-node.patch b/recipes/linux/linux-mainline/customer/0001-AM335x-Adding-SGX-DT-node.patch new file mode 100644 index 0000000..97ce000 --- /dev/null +++ b/recipes/linux/linux-mainline/customer/0001-AM335x-Adding-SGX-DT-node.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 1400fbf3e8e02eb1efd210a892a0d602061c7ca8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prathap M S <msprathap@ti.com> | ||
3 | Date: Mon, 2 Sep 2013 11:42:13 +0530 | ||
4 | Subject: [PATCH 1/3] AM335x : Adding SGX DT node | ||
5 | |||
6 | This adds the SGX DT node for AM335x. | ||
7 | |||
8 | Signed-off-by: Prathap M S <msprathap@ti.com> | ||
9 | --- | ||
10 | arch/arm/boot/dts/am33xx.dtsi | 8 ++++++++ | ||
11 | 1 files changed, 8 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi | ||
14 | index 17e0da8..74c6e41 100644 | ||
15 | --- a/arch/arm/boot/dts/am33xx.dtsi | ||
16 | +++ b/arch/arm/boot/dts/am33xx.dtsi | ||
17 | @@ -96,6 +96,14 @@ | ||
18 | reg = <0x48200000 0x1000>; | ||
19 | }; | ||
20 | |||
21 | + sgx@0x56000000 { | ||
22 | + compatible = "ti,sgx"; | ||
23 | + ti,hwmods = "gfx"; | ||
24 | + clock-frequency = <200000000>; | ||
25 | + reg = <0x56000000 0x1000000>; | ||
26 | + interrupts = <37>; | ||
27 | + }; | ||
28 | + | ||
29 | edma: edma@49000000 { | ||
30 | compatible = "ti,edma3"; | ||
31 | ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; | ||
32 | -- | ||
33 | 1.7.1 | ||
34 | |||
diff --git a/recipes/linux/linux-mainline/customer/0002-Changes-accordingtoTIforSGXsupport.patch b/recipes/linux/linux-mainline/customer/0002-Changes-accordingtoTIforSGXsupport.patch new file mode 100644 index 0000000..3287851 --- /dev/null +++ b/recipes/linux/linux-mainline/customer/0002-Changes-accordingtoTIforSGXsupport.patch | |||
@@ -0,0 +1,196 @@ | |||
1 | From 9de290880400c31b727ebc0014da7ccd67867359 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Alexander=20R=C3=B6ssler?= <mail.aroessler@gmail.com> | ||
3 | Date: Fri, 1 Nov 2013 15:35:26 +0100 | ||
4 | Subject: [PATCH] Changes according to TI for SGX support | ||
5 | |||
6 | --- | ||
7 | arch/arm/mach-omap2/Makefile | 2 +- | ||
8 | arch/arm/mach-omap2/board-generic.c | 3 +++ | ||
9 | arch/arm/mach-omap2/common.h | 1 + | ||
10 | arch/arm/mach-omap2/gpu.c | 47 +++++++++++++++++++++++++++++++++++++ | ||
11 | drivers/video/da8xx-fb.c | 33 ++++++++++++++++++++++++++ | ||
12 | include/video/da8xx-fb.h | 4 ++++ | ||
13 | 6 files changed, 89 insertions(+), 1 deletion(-) | ||
14 | create mode 100644 arch/arm/mach-omap2/gpu.c | ||
15 | |||
16 | diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile | ||
17 | index afecbbc..6c253bd 100644 | ||
18 | --- a/arch/arm/mach-omap2/Makefile | ||
19 | +++ b/arch/arm/mach-omap2/Makefile | ||
20 | @@ -5,7 +5,7 @@ | ||
21 | # Common support | ||
22 | obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ | ||
23 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ | ||
24 | - omap_device.o sram.o | ||
25 | + omap_device.o sram.o gpu.o | ||
26 | |||
27 | omap-2-3-common = irq.o | ||
28 | hwmod-common = omap_hwmod.o \ | ||
29 | diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c | ||
30 | index fac00f0..24bdc10 100644 | ||
31 | --- a/arch/arm/mach-omap2/board-generic.c | ||
32 | +++ b/arch/arm/mach-omap2/board-generic.c | ||
33 | @@ -22,6 +22,7 @@ | ||
34 | #include "common.h" | ||
35 | #include "common-board-devices.h" | ||
36 | #include "dss-common.h" | ||
37 | +#include "soc.h" | ||
38 | |||
39 | #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) | ||
40 | #define intc_of_init NULL | ||
41 | @@ -50,6 +51,8 @@ static void __init omap_generic_init(void) | ||
42 | omap4_panda_display_init_of(); | ||
43 | else if (of_machine_is_compatible("ti,omap4-sdp")) | ||
44 | omap_4430sdp_display_init_of(); | ||
45 | + if (omap3_has_sgx()) | ||
46 | + omap_sgx_init_of(); | ||
47 | } | ||
48 | |||
49 | #ifdef CONFIG_SOC_OMAP2420 | ||
50 | diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h | ||
51 | index f077fbd..dca5aca 100644 | ||
52 | --- a/arch/arm/mach-omap2/common.h | ||
53 | +++ b/arch/arm/mach-omap2/common.h | ||
54 | @@ -293,6 +293,7 @@ extern void omap_reserve(void); | ||
55 | |||
56 | struct omap_hwmod; | ||
57 | extern int omap_dss_reset(struct omap_hwmod *); | ||
58 | +void __init omap_sgx_init_of(void); | ||
59 | |||
60 | /* SoC specific clock initializer */ | ||
61 | extern int (*omap_clk_init)(void); | ||
62 | diff --git a/arch/arm/mach-omap2/gpu.c b/arch/arm/mach-omap2/gpu.c | ||
63 | new file mode 100644 | ||
64 | index 0000000..eebb1bd | ||
65 | --- /dev/null | ||
66 | +++ b/arch/arm/mach-omap2/gpu.c | ||
67 | @@ -0,0 +1,47 @@ | ||
68 | +/* | ||
69 | + * Deassert reset for AM33xx graphics device(SGX) hwmod | ||
70 | + * | ||
71 | + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
72 | + * Prathap MS <msprathap@ti.com> | ||
73 | + * | ||
74 | + * This program is free software; you can redistribute it and/or | ||
75 | + * modify it under the terms of the GNU General Public License as | ||
76 | + * published by the Free Software Foundation version 2. | ||
77 | + * | ||
78 | + * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
79 | + * kind, whether express or implied; without even the implied warranty | ||
80 | + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
81 | + * GNU General Public License for more details. | ||
82 | + */ | ||
83 | +#include <linux/of_platform.h> | ||
84 | +#include "omap_device.h" | ||
85 | + | ||
86 | +void __init omap_sgx_init_of(void) | ||
87 | +{ | ||
88 | + struct device_node *node; | ||
89 | + struct platform_device *pdev; | ||
90 | + int ret = 0; | ||
91 | + node = of_find_compatible_node(NULL, NULL, "ti,sgx"); | ||
92 | + if (!node) | ||
93 | + return; | ||
94 | + pdev = of_find_device_by_node(node); | ||
95 | + if (!pdev) { | ||
96 | + pr_warn("of_find_device_by_node() failed for sgx\n"); | ||
97 | + return; | ||
98 | + } | ||
99 | + ret = omap_device_deassert_hardreset(pdev, "gfx"); | ||
100 | + if (ret != 0) | ||
101 | + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); | ||
102 | + | ||
103 | + node = of_find_compatible_node(NULL, NULL, "ti,am335x-timer"); | ||
104 | + if (!node) | ||
105 | + return; | ||
106 | + pdev = of_find_device_by_node(node); | ||
107 | + if (!pdev) { | ||
108 | + pr_warn("of_find_device_by_node() failed for sgx\n"); | ||
109 | + return; | ||
110 | + } | ||
111 | + ret = omap_device_deassert_hardreset(pdev, "timer7"); | ||
112 | + if (ret != 0) | ||
113 | + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); | ||
114 | +} | ||
115 | diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c | ||
116 | index 6723683..6b9720c 100644 | ||
117 | --- a/drivers/video/da8xx-fb.c | ||
118 | +++ b/drivers/video/da8xx-fb.c | ||
119 | @@ -204,6 +204,9 @@ static struct fb_fix_screeninfo da8xx_fb_fix = { | ||
120 | .accel = FB_ACCEL_NONE | ||
121 | }; | ||
122 | |||
123 | +static vsync_callback_t vsync_cb_handler; | ||
124 | +static void *vsync_cb_arg; | ||
125 | + | ||
126 | static struct fb_videomode known_lcd_panels[] = { | ||
127 | /* Sharp LCD035Q3DG01 */ | ||
128 | [0] = { | ||
129 | @@ -814,6 +817,32 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
134 | +{ | ||
135 | + if ((vsync_cb_handler == NULL) && (vsync_cb_arg == NULL)) { | ||
136 | + vsync_cb_arg = arg; | ||
137 | + vsync_cb_handler = handler; | ||
138 | + } else { | ||
139 | + return -EEXIST; | ||
140 | + } | ||
141 | + | ||
142 | + return 0; | ||
143 | +} | ||
144 | +EXPORT_SYMBOL(register_vsync_cb); | ||
145 | + | ||
146 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx) | ||
147 | +{ | ||
148 | + if ((vsync_cb_handler == handler) && (vsync_cb_arg == arg)) { | ||
149 | + vsync_cb_handler = NULL; | ||
150 | + vsync_cb_arg = NULL; | ||
151 | + } else { | ||
152 | + return -ENXIO; | ||
153 | + } | ||
154 | + | ||
155 | + return 0; | ||
156 | +} | ||
157 | +EXPORT_SYMBOL(unregister_vsync_cb); | ||
158 | + | ||
159 | /* IRQ handler for version 2 of LCDC */ | ||
160 | static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | ||
161 | { | ||
162 | @@ -851,6 +880,8 @@ static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg) | ||
163 | LCD_DMA_FRM_BUF_CEILING_ADDR_0_REG); | ||
164 | par->vsync_flag = 1; | ||
165 | wake_up_interruptible(&par->vsync_wait); | ||
166 | + if (vsync_cb_handler) | ||
167 | + vsync_cb_handler(vsync_cb_arg); | ||
168 | } | ||
169 | |||
170 | if (stat & LCD_END_OF_FRAME1) { | ||
171 | @@ -926,6 +957,8 @@ static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg) | ||
172 | LCD_DMA_FRM_BUF_CEILING_ADDR_1_REG); | ||
173 | par->vsync_flag = 1; | ||
174 | wake_up_interruptible(&par->vsync_wait); | ||
175 | + if (vsync_cb_handler) | ||
176 | + vsync_cb_handler(vsync_cb_arg); | ||
177 | } | ||
178 | } | ||
179 | |||
180 | diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h | ||
181 | index f888259..6b1abfd 100644 | ||
182 | --- a/include/video/da8xx-fb.h | ||
183 | +++ b/include/video/da8xx-fb.h | ||
184 | @@ -86,5 +86,9 @@ struct lcd_sync_arg { | ||
185 | /* Proprietary FB_SYNC_ flags */ | ||
186 | #define FB_SYNC_CLK_INVERT 0x40000000 | ||
187 | |||
188 | +typedef void (*vsync_callback_t)(void *arg); | ||
189 | +int register_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
190 | +int unregister_vsync_cb(vsync_callback_t handler, void *arg, int idx); | ||
191 | + | ||
192 | #endif /* ifndef DA8XX_FB_H */ | ||
193 | |||
194 | -- | ||
195 | 1.8.4.2 | ||
196 | |||