blob: b9c0a8f468d2ab1b49adce59b9786f41a83dc54c [file] [log] [blame]
Tomi Valkeinenb2886272009-08-05 16:18:06 +03001/*
2 * linux/drivers/video/omap2/dss/venc.c
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * VENC settings from TI's DSS driver
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published by
11 * the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#define DSS_SUBSYS_NAME "VENC"
23
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/clk.h>
27#include <linux/err.h>
28#include <linux/io.h>
29#include <linux/mutex.h>
30#include <linux/completion.h>
31#include <linux/delay.h>
32#include <linux/string.h>
33#include <linux/seq_file.h>
34#include <linux/platform_device.h>
35#include <linux/regulator/consumer.h>
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +030036#include <linux/pm_runtime.h>
Tomi Valkeinenb2886272009-08-05 16:18:06 +030037
Tomi Valkeinena0b38cc2011-05-11 14:05:07 +030038#include <video/omapdss.h>
Tomi Valkeinenb2886272009-08-05 16:18:06 +030039
40#include "dss.h"
Tomi Valkeinen525dae62011-05-18 11:59:21 +030041#include "dss_features.h"
Tomi Valkeinenb2886272009-08-05 16:18:06 +030042
Tomi Valkeinenb2886272009-08-05 16:18:06 +030043/* Venc registers */
44#define VENC_REV_ID 0x00
45#define VENC_STATUS 0x04
46#define VENC_F_CONTROL 0x08
47#define VENC_VIDOUT_CTRL 0x10
48#define VENC_SYNC_CTRL 0x14
49#define VENC_LLEN 0x1C
50#define VENC_FLENS 0x20
51#define VENC_HFLTR_CTRL 0x24
52#define VENC_CC_CARR_WSS_CARR 0x28
53#define VENC_C_PHASE 0x2C
54#define VENC_GAIN_U 0x30
55#define VENC_GAIN_V 0x34
56#define VENC_GAIN_Y 0x38
57#define VENC_BLACK_LEVEL 0x3C
58#define VENC_BLANK_LEVEL 0x40
59#define VENC_X_COLOR 0x44
60#define VENC_M_CONTROL 0x48
61#define VENC_BSTAMP_WSS_DATA 0x4C
62#define VENC_S_CARR 0x50
63#define VENC_LINE21 0x54
64#define VENC_LN_SEL 0x58
65#define VENC_L21__WC_CTL 0x5C
66#define VENC_HTRIGGER_VTRIGGER 0x60
67#define VENC_SAVID__EAVID 0x64
68#define VENC_FLEN__FAL 0x68
69#define VENC_LAL__PHASE_RESET 0x6C
70#define VENC_HS_INT_START_STOP_X 0x70
71#define VENC_HS_EXT_START_STOP_X 0x74
72#define VENC_VS_INT_START_X 0x78
73#define VENC_VS_INT_STOP_X__VS_INT_START_Y 0x7C
74#define VENC_VS_INT_STOP_Y__VS_EXT_START_X 0x80
75#define VENC_VS_EXT_STOP_X__VS_EXT_START_Y 0x84
76#define VENC_VS_EXT_STOP_Y 0x88
77#define VENC_AVID_START_STOP_X 0x90
78#define VENC_AVID_START_STOP_Y 0x94
79#define VENC_FID_INT_START_X__FID_INT_START_Y 0xA0
80#define VENC_FID_INT_OFFSET_Y__FID_EXT_START_X 0xA4
81#define VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y 0xA8
82#define VENC_TVDETGP_INT_START_STOP_X 0xB0
83#define VENC_TVDETGP_INT_START_STOP_Y 0xB4
84#define VENC_GEN_CTRL 0xB8
85#define VENC_OUTPUT_CONTROL 0xC4
86#define VENC_OUTPUT_TEST 0xC8
87#define VENC_DAC_B__DAC_C 0xC8
88
89struct venc_config {
90 u32 f_control;
91 u32 vidout_ctrl;
92 u32 sync_ctrl;
93 u32 llen;
94 u32 flens;
95 u32 hfltr_ctrl;
96 u32 cc_carr_wss_carr;
97 u32 c_phase;
98 u32 gain_u;
99 u32 gain_v;
100 u32 gain_y;
101 u32 black_level;
102 u32 blank_level;
103 u32 x_color;
104 u32 m_control;
105 u32 bstamp_wss_data;
106 u32 s_carr;
107 u32 line21;
108 u32 ln_sel;
109 u32 l21__wc_ctl;
110 u32 htrigger_vtrigger;
111 u32 savid__eavid;
112 u32 flen__fal;
113 u32 lal__phase_reset;
114 u32 hs_int_start_stop_x;
115 u32 hs_ext_start_stop_x;
116 u32 vs_int_start_x;
117 u32 vs_int_stop_x__vs_int_start_y;
118 u32 vs_int_stop_y__vs_ext_start_x;
119 u32 vs_ext_stop_x__vs_ext_start_y;
120 u32 vs_ext_stop_y;
121 u32 avid_start_stop_x;
122 u32 avid_start_stop_y;
123 u32 fid_int_start_x__fid_int_start_y;
124 u32 fid_int_offset_y__fid_ext_start_x;
125 u32 fid_ext_start_y__fid_ext_offset_y;
126 u32 tvdetgp_int_start_stop_x;
127 u32 tvdetgp_int_start_stop_y;
128 u32 gen_ctrl;
129};
130
131/* from TRM */
132static const struct venc_config venc_config_pal_trm = {
133 .f_control = 0,
134 .vidout_ctrl = 1,
135 .sync_ctrl = 0x40,
136 .llen = 0x35F, /* 863 */
137 .flens = 0x270, /* 624 */
138 .hfltr_ctrl = 0,
139 .cc_carr_wss_carr = 0x2F7225ED,
140 .c_phase = 0,
141 .gain_u = 0x111,
142 .gain_v = 0x181,
143 .gain_y = 0x140,
144 .black_level = 0x3B,
145 .blank_level = 0x3B,
146 .x_color = 0x7,
147 .m_control = 0x2,
148 .bstamp_wss_data = 0x3F,
149 .s_carr = 0x2A098ACB,
150 .line21 = 0,
151 .ln_sel = 0x01290015,
152 .l21__wc_ctl = 0x0000F603,
153 .htrigger_vtrigger = 0,
154
155 .savid__eavid = 0x06A70108,
156 .flen__fal = 0x00180270,
157 .lal__phase_reset = 0x00040135,
158 .hs_int_start_stop_x = 0x00880358,
159 .hs_ext_start_stop_x = 0x000F035F,
160 .vs_int_start_x = 0x01A70000,
161 .vs_int_stop_x__vs_int_start_y = 0x000001A7,
162 .vs_int_stop_y__vs_ext_start_x = 0x01AF0000,
163 .vs_ext_stop_x__vs_ext_start_y = 0x000101AF,
164 .vs_ext_stop_y = 0x00000025,
165 .avid_start_stop_x = 0x03530083,
166 .avid_start_stop_y = 0x026C002E,
167 .fid_int_start_x__fid_int_start_y = 0x0001008A,
168 .fid_int_offset_y__fid_ext_start_x = 0x002E0138,
169 .fid_ext_start_y__fid_ext_offset_y = 0x01380001,
170
171 .tvdetgp_int_start_stop_x = 0x00140001,
172 .tvdetgp_int_start_stop_y = 0x00010001,
173 .gen_ctrl = 0x00FF0000,
174};
175
176/* from TRM */
177static const struct venc_config venc_config_ntsc_trm = {
178 .f_control = 0,
179 .vidout_ctrl = 1,
180 .sync_ctrl = 0x8040,
181 .llen = 0x359,
182 .flens = 0x20C,
183 .hfltr_ctrl = 0,
184 .cc_carr_wss_carr = 0x043F2631,
185 .c_phase = 0,
186 .gain_u = 0x102,
187 .gain_v = 0x16C,
188 .gain_y = 0x12F,
189 .black_level = 0x43,
190 .blank_level = 0x38,
191 .x_color = 0x7,
192 .m_control = 0x1,
193 .bstamp_wss_data = 0x38,
194 .s_carr = 0x21F07C1F,
195 .line21 = 0,
196 .ln_sel = 0x01310011,
197 .l21__wc_ctl = 0x0000F003,
198 .htrigger_vtrigger = 0,
199
200 .savid__eavid = 0x069300F4,
201 .flen__fal = 0x0016020C,
202 .lal__phase_reset = 0x00060107,
203 .hs_int_start_stop_x = 0x008E0350,
204 .hs_ext_start_stop_x = 0x000F0359,
205 .vs_int_start_x = 0x01A00000,
206 .vs_int_stop_x__vs_int_start_y = 0x020701A0,
207 .vs_int_stop_y__vs_ext_start_x = 0x01AC0024,
208 .vs_ext_stop_x__vs_ext_start_y = 0x020D01AC,
209 .vs_ext_stop_y = 0x00000006,
210 .avid_start_stop_x = 0x03480078,
211 .avid_start_stop_y = 0x02060024,
212 .fid_int_start_x__fid_int_start_y = 0x0001008A,
213 .fid_int_offset_y__fid_ext_start_x = 0x01AC0106,
214 .fid_ext_start_y__fid_ext_offset_y = 0x01060006,
215
216 .tvdetgp_int_start_stop_x = 0x00140001,
217 .tvdetgp_int_start_stop_y = 0x00010001,
218 .gen_ctrl = 0x00F90000,
219};
220
221static const struct venc_config venc_config_pal_bdghi = {
222 .f_control = 0,
223 .vidout_ctrl = 0,
224 .sync_ctrl = 0,
225 .hfltr_ctrl = 0,
226 .x_color = 0,
227 .line21 = 0,
228 .ln_sel = 21,
229 .htrigger_vtrigger = 0,
230 .tvdetgp_int_start_stop_x = 0x00140001,
231 .tvdetgp_int_start_stop_y = 0x00010001,
232 .gen_ctrl = 0x00FB0000,
233
234 .llen = 864-1,
235 .flens = 625-1,
236 .cc_carr_wss_carr = 0x2F7625ED,
237 .c_phase = 0xDF,
238 .gain_u = 0x111,
239 .gain_v = 0x181,
240 .gain_y = 0x140,
241 .black_level = 0x3e,
242 .blank_level = 0x3e,
243 .m_control = 0<<2 | 1<<1,
244 .bstamp_wss_data = 0x42,
245 .s_carr = 0x2a098acb,
246 .l21__wc_ctl = 0<<13 | 0x16<<8 | 0<<0,
247 .savid__eavid = 0x06A70108,
248 .flen__fal = 23<<16 | 624<<0,
249 .lal__phase_reset = 2<<17 | 310<<0,
250 .hs_int_start_stop_x = 0x00920358,
251 .hs_ext_start_stop_x = 0x000F035F,
252 .vs_int_start_x = 0x1a7<<16,
253 .vs_int_stop_x__vs_int_start_y = 0x000601A7,
254 .vs_int_stop_y__vs_ext_start_x = 0x01AF0036,
255 .vs_ext_stop_x__vs_ext_start_y = 0x27101af,
256 .vs_ext_stop_y = 0x05,
257 .avid_start_stop_x = 0x03530082,
258 .avid_start_stop_y = 0x0270002E,
259 .fid_int_start_x__fid_int_start_y = 0x0005008A,
260 .fid_int_offset_y__fid_ext_start_x = 0x002E0138,
261 .fid_ext_start_y__fid_ext_offset_y = 0x01380005,
262};
263
264const struct omap_video_timings omap_dss_pal_timings = {
265 .x_res = 720,
266 .y_res = 574,
267 .pixel_clock = 13500,
268 .hsw = 64,
269 .hfp = 12,
270 .hbp = 68,
271 .vsw = 5,
272 .vfp = 5,
273 .vbp = 41,
Archit Taneja23c8f882012-06-28 11:15:51 +0530274
275 .interlace = true,
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300276};
277EXPORT_SYMBOL(omap_dss_pal_timings);
278
279const struct omap_video_timings omap_dss_ntsc_timings = {
280 .x_res = 720,
281 .y_res = 482,
282 .pixel_clock = 13500,
283 .hsw = 64,
284 .hfp = 16,
285 .hbp = 58,
286 .vsw = 6,
287 .vfp = 6,
288 .vbp = 31,
Archit Taneja23c8f882012-06-28 11:15:51 +0530289
290 .interlace = true,
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300291};
292EXPORT_SYMBOL(omap_dss_ntsc_timings);
293
294static struct {
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000295 struct platform_device *pdev;
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300296 void __iomem *base;
297 struct mutex venc_lock;
298 u32 wss_data;
299 struct regulator *vdda_dac_reg;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300300
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300301 struct clk *tv_dac_clk;
Archit Tanejaa5abf472012-07-20 16:15:44 +0530302
303 struct omap_video_timings timings;
Archit Tanejafebe2902012-08-16 11:55:15 +0530304 enum omap_dss_venc_type type;
Archit Taneja89e71952012-08-16 11:56:31 +0530305 bool invert_polarity;
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300306} venc;
307
308static inline void venc_write_reg(int idx, u32 val)
309{
310 __raw_writel(val, venc.base + idx);
311}
312
313static inline u32 venc_read_reg(int idx)
314{
315 u32 l = __raw_readl(venc.base + idx);
316 return l;
317}
318
319static void venc_write_config(const struct venc_config *config)
320{
321 DSSDBG("write venc conf\n");
322
323 venc_write_reg(VENC_LLEN, config->llen);
324 venc_write_reg(VENC_FLENS, config->flens);
325 venc_write_reg(VENC_CC_CARR_WSS_CARR, config->cc_carr_wss_carr);
326 venc_write_reg(VENC_C_PHASE, config->c_phase);
327 venc_write_reg(VENC_GAIN_U, config->gain_u);
328 venc_write_reg(VENC_GAIN_V, config->gain_v);
329 venc_write_reg(VENC_GAIN_Y, config->gain_y);
330 venc_write_reg(VENC_BLACK_LEVEL, config->black_level);
331 venc_write_reg(VENC_BLANK_LEVEL, config->blank_level);
332 venc_write_reg(VENC_M_CONTROL, config->m_control);
333 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
334 venc.wss_data);
335 venc_write_reg(VENC_S_CARR, config->s_carr);
336 venc_write_reg(VENC_L21__WC_CTL, config->l21__wc_ctl);
337 venc_write_reg(VENC_SAVID__EAVID, config->savid__eavid);
338 venc_write_reg(VENC_FLEN__FAL, config->flen__fal);
339 venc_write_reg(VENC_LAL__PHASE_RESET, config->lal__phase_reset);
340 venc_write_reg(VENC_HS_INT_START_STOP_X, config->hs_int_start_stop_x);
341 venc_write_reg(VENC_HS_EXT_START_STOP_X, config->hs_ext_start_stop_x);
342 venc_write_reg(VENC_VS_INT_START_X, config->vs_int_start_x);
343 venc_write_reg(VENC_VS_INT_STOP_X__VS_INT_START_Y,
344 config->vs_int_stop_x__vs_int_start_y);
345 venc_write_reg(VENC_VS_INT_STOP_Y__VS_EXT_START_X,
346 config->vs_int_stop_y__vs_ext_start_x);
347 venc_write_reg(VENC_VS_EXT_STOP_X__VS_EXT_START_Y,
348 config->vs_ext_stop_x__vs_ext_start_y);
349 venc_write_reg(VENC_VS_EXT_STOP_Y, config->vs_ext_stop_y);
350 venc_write_reg(VENC_AVID_START_STOP_X, config->avid_start_stop_x);
351 venc_write_reg(VENC_AVID_START_STOP_Y, config->avid_start_stop_y);
352 venc_write_reg(VENC_FID_INT_START_X__FID_INT_START_Y,
353 config->fid_int_start_x__fid_int_start_y);
354 venc_write_reg(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X,
355 config->fid_int_offset_y__fid_ext_start_x);
356 venc_write_reg(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y,
357 config->fid_ext_start_y__fid_ext_offset_y);
358
359 venc_write_reg(VENC_DAC_B__DAC_C, venc_read_reg(VENC_DAC_B__DAC_C));
360 venc_write_reg(VENC_VIDOUT_CTRL, config->vidout_ctrl);
361 venc_write_reg(VENC_HFLTR_CTRL, config->hfltr_ctrl);
362 venc_write_reg(VENC_X_COLOR, config->x_color);
363 venc_write_reg(VENC_LINE21, config->line21);
364 venc_write_reg(VENC_LN_SEL, config->ln_sel);
365 venc_write_reg(VENC_HTRIGGER_VTRIGGER, config->htrigger_vtrigger);
366 venc_write_reg(VENC_TVDETGP_INT_START_STOP_X,
367 config->tvdetgp_int_start_stop_x);
368 venc_write_reg(VENC_TVDETGP_INT_START_STOP_Y,
369 config->tvdetgp_int_start_stop_y);
370 venc_write_reg(VENC_GEN_CTRL, config->gen_ctrl);
371 venc_write_reg(VENC_F_CONTROL, config->f_control);
372 venc_write_reg(VENC_SYNC_CTRL, config->sync_ctrl);
373}
374
375static void venc_reset(void)
376{
377 int t = 1000;
378
379 venc_write_reg(VENC_F_CONTROL, 1<<8);
380 while (venc_read_reg(VENC_F_CONTROL) & (1<<8)) {
381 if (--t == 0) {
382 DSSERR("Failed to reset venc\n");
383 return;
384 }
385 }
386
Tomi Valkeinenc6f65e12010-06-02 17:48:22 +0300387#ifdef CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300388 /* the magical sleep that makes things work */
Tomi Valkeinenc6f65e12010-06-02 17:48:22 +0300389 /* XXX more info? What bug this circumvents? */
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300390 msleep(20);
Tomi Valkeinenc6f65e12010-06-02 17:48:22 +0300391#endif
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300392}
393
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300394static int venc_runtime_get(void)
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300395{
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300396 int r;
397
398 DSSDBG("venc_runtime_get\n");
399
400 r = pm_runtime_get_sync(&venc.pdev->dev);
401 WARN_ON(r < 0);
402 return r < 0 ? r : 0;
403}
404
405static void venc_runtime_put(void)
406{
407 int r;
408
409 DSSDBG("venc_runtime_put\n");
410
Tomi Valkeinen0eaf9f52012-01-23 13:23:08 +0200411 r = pm_runtime_put_sync(&venc.pdev->dev);
Tomi Valkeinen5be3aeb2012-06-27 16:37:18 +0300412 WARN_ON(r < 0 && r != -ENOSYS);
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300413}
414
415static const struct venc_config *venc_timings_to_config(
416 struct omap_video_timings *timings)
417{
418 if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
419 return &venc_config_pal_trm;
420
421 if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
422 return &venc_config_ntsc_trm;
423
424 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300425 return NULL;
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300426}
427
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200428static int venc_power_on(struct omap_dss_device *dssdev)
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200429{
430 u32 l;
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200431 int r;
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200432
Archit Taneja156fd992012-07-06 20:52:37 +0530433 r = venc_runtime_get();
434 if (r)
435 goto err0;
436
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200437 venc_reset();
Archit Tanejaa5abf472012-07-20 16:15:44 +0530438 venc_write_config(venc_timings_to_config(&venc.timings));
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200439
Archit Tanejafebe2902012-08-16 11:55:15 +0530440 dss_set_venc_output(venc.type);
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200441 dss_set_dac_pwrdn_bgz(1);
442
443 l = 0;
444
Archit Tanejafebe2902012-08-16 11:55:15 +0530445 if (venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE)
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200446 l |= 1 << 1;
447 else /* S-Video */
448 l |= (1 << 0) | (1 << 2);
449
Archit Taneja89e71952012-08-16 11:56:31 +0530450 if (venc.invert_polarity == false)
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200451 l |= 1 << 3;
452
453 venc_write_reg(VENC_OUTPUT_CONTROL, l);
454
Archit Tanejaa5abf472012-07-20 16:15:44 +0530455 dss_mgr_set_timings(dssdev->manager, &venc.timings);
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200456
Mark Brownec874102012-03-19 14:56:39 +0000457 r = regulator_enable(venc.vdda_dac_reg);
458 if (r)
Archit Taneja156fd992012-07-06 20:52:37 +0530459 goto err1;
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200460
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200461 r = dss_mgr_enable(dssdev->manager);
462 if (r)
Archit Taneja156fd992012-07-06 20:52:37 +0530463 goto err2;
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200464
465 return 0;
466
Archit Taneja156fd992012-07-06 20:52:37 +0530467err2:
468 regulator_disable(venc.vdda_dac_reg);
469err1:
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200470 venc_write_reg(VENC_OUTPUT_CONTROL, 0);
471 dss_set_dac_pwrdn_bgz(0);
472
Archit Taneja156fd992012-07-06 20:52:37 +0530473 venc_runtime_put();
474err0:
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200475 return r;
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200476}
477
478static void venc_power_off(struct omap_dss_device *dssdev)
479{
480 venc_write_reg(VENC_OUTPUT_CONTROL, 0);
481 dss_set_dac_pwrdn_bgz(0);
482
Tomi Valkeinen7797c6d2011-11-04 10:22:46 +0200483 dss_mgr_disable(dssdev->manager);
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200484
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200485 regulator_disable(venc.vdda_dac_reg);
Archit Taneja156fd992012-07-06 20:52:37 +0530486
487 venc_runtime_put();
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200488}
489
Archit Tanejac3dc6a72011-09-13 18:28:41 +0530490unsigned long venc_get_pixel_clock(void)
491{
492 /* VENC Pixel Clock in Mhz */
493 return 13500000;
494}
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300495
Archit Taneja156fd992012-07-06 20:52:37 +0530496int omapdss_venc_display_enable(struct omap_dss_device *dssdev)
Grazvydas Ignotas0aca3c62012-04-24 00:08:54 +0300497{
Archit Taneja156fd992012-07-06 20:52:37 +0530498 int r;
Grazvydas Ignotas0aca3c62012-04-24 00:08:54 +0300499
Archit Taneja156fd992012-07-06 20:52:37 +0530500 DSSDBG("venc_display_enable\n");
Grazvydas Ignotas0aca3c62012-04-24 00:08:54 +0300501
502 mutex_lock(&venc.venc_lock);
503
Archit Taneja156fd992012-07-06 20:52:37 +0530504 if (dssdev->manager == NULL) {
505 DSSERR("Failed to enable display: no manager\n");
506 r = -ENODEV;
507 goto err0;
Grazvydas Ignotas0aca3c62012-04-24 00:08:54 +0300508 }
509
Tomi Valkeinen14572c62010-10-28 16:46:38 +0300510 r = omap_dss_start_device(dssdev);
511 if (r) {
512 DSSERR("failed to start device\n");
513 goto err0;
514 }
515
Archit Taneja156fd992012-07-06 20:52:37 +0530516 if (dssdev->platform_enable)
517 dssdev->platform_enable(dssdev);
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200518
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300519
Tomi Valkeinen33ca2372011-11-21 13:42:58 +0200520 r = venc_power_on(dssdev);
521 if (r)
Archit Taneja156fd992012-07-06 20:52:37 +0530522 goto err1;
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200523
524 venc.wss_data = 0;
525
Tomi Valkeinen14572c62010-10-28 16:46:38 +0300526 mutex_unlock(&venc.venc_lock);
Archit Taneja156fd992012-07-06 20:52:37 +0530527
Tomi Valkeinen14572c62010-10-28 16:46:38 +0300528 return 0;
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200529err1:
Archit Taneja156fd992012-07-06 20:52:37 +0530530 if (dssdev->platform_disable)
531 dssdev->platform_disable(dssdev);
Tomi Valkeinen14572c62010-10-28 16:46:38 +0300532 omap_dss_stop_device(dssdev);
533err0:
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200534 mutex_unlock(&venc.venc_lock);
535 return r;
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300536}
537
Archit Taneja156fd992012-07-06 20:52:37 +0530538void omapdss_venc_display_disable(struct omap_dss_device *dssdev)
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300539{
Archit Taneja156fd992012-07-06 20:52:37 +0530540 DSSDBG("venc_display_disable\n");
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200541
542 mutex_lock(&venc.venc_lock);
543
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200544 venc_power_off(dssdev);
545
Tomi Valkeinen14572c62010-10-28 16:46:38 +0300546 omap_dss_stop_device(dssdev);
Archit Taneja156fd992012-07-06 20:52:37 +0530547
548 if (dssdev->platform_disable)
549 dssdev->platform_disable(dssdev);
550
Tomi Valkeinen37ac60e2010-01-12 15:12:07 +0200551 mutex_unlock(&venc.venc_lock);
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300552}
553
Archit Taneja156fd992012-07-06 20:52:37 +0530554void omapdss_venc_set_timings(struct omap_dss_device *dssdev,
555 struct omap_video_timings *timings)
Tomi Valkeinen69b20482010-01-20 12:11:25 +0200556{
557 DSSDBG("venc_set_timings\n");
558
Archit Taneja156fd992012-07-06 20:52:37 +0530559 mutex_lock(&venc.venc_lock);
560
Tomi Valkeinen69b20482010-01-20 12:11:25 +0200561 /* Reset WSS data when the TV standard changes. */
Archit Tanejaa5abf472012-07-20 16:15:44 +0530562 if (memcmp(&venc.timings, timings, sizeof(*timings)))
Tomi Valkeinen69b20482010-01-20 12:11:25 +0200563 venc.wss_data = 0;
564
Archit Tanejaa5abf472012-07-20 16:15:44 +0530565 venc.timings = *timings;
Archit Taneja156fd992012-07-06 20:52:37 +0530566
Archit Taneja156fd992012-07-06 20:52:37 +0530567 mutex_unlock(&venc.venc_lock);
Tomi Valkeinen69b20482010-01-20 12:11:25 +0200568}
569
Archit Taneja156fd992012-07-06 20:52:37 +0530570int omapdss_venc_check_timings(struct omap_dss_device *dssdev,
571 struct omap_video_timings *timings)
Tomi Valkeinen69b20482010-01-20 12:11:25 +0200572{
573 DSSDBG("venc_check_timings\n");
574
575 if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0)
576 return 0;
577
578 if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0)
579 return 0;
580
581 return -EINVAL;
582}
583
Archit Taneja156fd992012-07-06 20:52:37 +0530584u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev)
Tomi Valkeinen36511312010-01-19 15:53:16 +0200585{
586 /* Invert due to VENC_L21_WC_CTL:INV=1 */
587 return (venc.wss_data >> 8) ^ 0xfffff;
588}
589
Archit Taneja156fd992012-07-06 20:52:37 +0530590int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
Tomi Valkeinen36511312010-01-19 15:53:16 +0200591{
592 const struct venc_config *config;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300593 int r;
Tomi Valkeinen36511312010-01-19 15:53:16 +0200594
595 DSSDBG("venc_set_wss\n");
596
597 mutex_lock(&venc.venc_lock);
598
Archit Tanejaa5abf472012-07-20 16:15:44 +0530599 config = venc_timings_to_config(&venc.timings);
Tomi Valkeinen36511312010-01-19 15:53:16 +0200600
601 /* Invert due to VENC_L21_WC_CTL:INV=1 */
602 venc.wss_data = (wss ^ 0xfffff) << 8;
603
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300604 r = venc_runtime_get();
605 if (r)
606 goto err;
Tomi Valkeinen36511312010-01-19 15:53:16 +0200607
608 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
609 venc.wss_data);
610
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300611 venc_runtime_put();
Tomi Valkeinen36511312010-01-19 15:53:16 +0200612
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300613err:
Tomi Valkeinen36511312010-01-19 15:53:16 +0200614 mutex_unlock(&venc.venc_lock);
615
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300616 return r;
Tomi Valkeinen36511312010-01-19 15:53:16 +0200617}
618
Archit Tanejafebe2902012-08-16 11:55:15 +0530619void omapdss_venc_set_type(struct omap_dss_device *dssdev,
620 enum omap_dss_venc_type type)
621{
622 mutex_lock(&venc.venc_lock);
623
624 venc.type = type;
625
626 mutex_unlock(&venc.venc_lock);
627}
628
Archit Taneja89e71952012-08-16 11:56:31 +0530629void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev,
630 bool invert_polarity)
631{
632 mutex_lock(&venc.venc_lock);
633
634 venc.invert_polarity = invert_polarity;
635
636 mutex_unlock(&venc.venc_lock);
637}
638
Tomi Valkeinen9d8232a2012-03-01 16:58:39 +0200639static int __init venc_init_display(struct omap_dss_device *dssdev)
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300640{
641 DSSDBG("init_display\n");
642
Tomi Valkeinen5f42f2ce2011-02-22 15:53:46 +0200643 if (venc.vdda_dac_reg == NULL) {
644 struct regulator *vdda_dac;
645
646 vdda_dac = regulator_get(&venc.pdev->dev, "vdda_dac");
647
648 if (IS_ERR(vdda_dac)) {
649 DSSERR("can't get VDDA_DAC regulator\n");
650 return PTR_ERR(vdda_dac);
651 }
652
653 venc.vdda_dac_reg = vdda_dac;
654 }
655
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300656 return 0;
657}
658
Tomi Valkeinene40402c2012-03-02 18:01:07 +0200659static void venc_dump_regs(struct seq_file *s)
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300660{
661#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))
662
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300663 if (venc_runtime_get())
664 return;
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300665
666 DUMPREG(VENC_F_CONTROL);
667 DUMPREG(VENC_VIDOUT_CTRL);
668 DUMPREG(VENC_SYNC_CTRL);
669 DUMPREG(VENC_LLEN);
670 DUMPREG(VENC_FLENS);
671 DUMPREG(VENC_HFLTR_CTRL);
672 DUMPREG(VENC_CC_CARR_WSS_CARR);
673 DUMPREG(VENC_C_PHASE);
674 DUMPREG(VENC_GAIN_U);
675 DUMPREG(VENC_GAIN_V);
676 DUMPREG(VENC_GAIN_Y);
677 DUMPREG(VENC_BLACK_LEVEL);
678 DUMPREG(VENC_BLANK_LEVEL);
679 DUMPREG(VENC_X_COLOR);
680 DUMPREG(VENC_M_CONTROL);
681 DUMPREG(VENC_BSTAMP_WSS_DATA);
682 DUMPREG(VENC_S_CARR);
683 DUMPREG(VENC_LINE21);
684 DUMPREG(VENC_LN_SEL);
685 DUMPREG(VENC_L21__WC_CTL);
686 DUMPREG(VENC_HTRIGGER_VTRIGGER);
687 DUMPREG(VENC_SAVID__EAVID);
688 DUMPREG(VENC_FLEN__FAL);
689 DUMPREG(VENC_LAL__PHASE_RESET);
690 DUMPREG(VENC_HS_INT_START_STOP_X);
691 DUMPREG(VENC_HS_EXT_START_STOP_X);
692 DUMPREG(VENC_VS_INT_START_X);
693 DUMPREG(VENC_VS_INT_STOP_X__VS_INT_START_Y);
694 DUMPREG(VENC_VS_INT_STOP_Y__VS_EXT_START_X);
695 DUMPREG(VENC_VS_EXT_STOP_X__VS_EXT_START_Y);
696 DUMPREG(VENC_VS_EXT_STOP_Y);
697 DUMPREG(VENC_AVID_START_STOP_X);
698 DUMPREG(VENC_AVID_START_STOP_Y);
699 DUMPREG(VENC_FID_INT_START_X__FID_INT_START_Y);
700 DUMPREG(VENC_FID_INT_OFFSET_Y__FID_EXT_START_X);
701 DUMPREG(VENC_FID_EXT_START_Y__FID_EXT_OFFSET_Y);
702 DUMPREG(VENC_TVDETGP_INT_START_STOP_X);
703 DUMPREG(VENC_TVDETGP_INT_START_STOP_Y);
704 DUMPREG(VENC_GEN_CTRL);
705 DUMPREG(VENC_OUTPUT_CONTROL);
706 DUMPREG(VENC_OUTPUT_TEST);
707
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300708 venc_runtime_put();
Tomi Valkeinenb2886272009-08-05 16:18:06 +0300709
710#undef DUMPREG
711}
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000712
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300713static int venc_get_clocks(struct platform_device *pdev)
714{
715 struct clk *clk;
716
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300717 if (dss_has_feature(FEAT_VENC_REQUIRES_TV_DAC_CLK)) {
Tomi Valkeinenbfe4f8d2011-08-04 11:22:54 +0300718 clk = clk_get(&pdev->dev, "tv_dac_clk");
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300719 if (IS_ERR(clk)) {
720 DSSERR("can't get tv_dac_clk\n");
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300721 return PTR_ERR(clk);
722 }
723 } else {
724 clk = NULL;
725 }
726
727 venc.tv_dac_clk = clk;
728
729 return 0;
730}
731
732static void venc_put_clocks(void)
733{
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300734 if (venc.tv_dac_clk)
735 clk_put(venc.tv_dac_clk);
736}
737
Tomi Valkeinen15216532012-09-06 14:29:31 +0300738static struct omap_dss_device * __init venc_find_dssdev(struct platform_device *pdev)
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300739{
740 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
Tomi Valkeinen15216532012-09-06 14:29:31 +0300741 const char *def_disp_name = dss_get_default_display_name();
742 struct omap_dss_device *def_dssdev;
743 int i;
744
745 def_dssdev = NULL;
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300746
747 for (i = 0; i < pdata->num_devices; ++i) {
748 struct omap_dss_device *dssdev = pdata->devices[i];
749
750 if (dssdev->type != OMAP_DISPLAY_TYPE_VENC)
751 continue;
752
Tomi Valkeinen15216532012-09-06 14:29:31 +0300753 if (def_dssdev == NULL)
754 def_dssdev = dssdev;
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300755
Tomi Valkeinen15216532012-09-06 14:29:31 +0300756 if (def_disp_name != NULL &&
757 strcmp(dssdev->name, def_disp_name) == 0) {
758 def_dssdev = dssdev;
759 break;
760 }
761 }
762
763 return def_dssdev;
764}
765
766static void __init venc_probe_pdata(struct platform_device *pdev)
767{
768 struct omap_dss_device *dssdev;
769 int r;
770
771 dssdev = venc_find_dssdev(pdev);
772
773 if (!dssdev)
774 return;
775
776 r = venc_init_display(dssdev);
777 if (r) {
778 DSSERR("device %s init failed: %d\n", dssdev->name, r);
779 return;
780 }
781
782 r = omap_dss_register_device(dssdev, &pdev->dev);
783 if (r) {
784 DSSERR("device %s register failed: %d\n", dssdev->name, r);
785 return;
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300786 }
787}
788
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000789/* VENC HW IP initialisation */
Tomi Valkeinen6e7e8f02012-02-17 17:41:13 +0200790static int __init omap_venchw_probe(struct platform_device *pdev)
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000791{
792 u8 rev_id;
Senthilvadivu Guruswamyea9da362011-01-24 06:22:04 +0000793 struct resource *venc_mem;
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300794 int r;
Senthilvadivu Guruswamyea9da362011-01-24 06:22:04 +0000795
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000796 venc.pdev = pdev;
797
798 mutex_init(&venc.venc_lock);
799
800 venc.wss_data = 0;
801
Senthilvadivu Guruswamyea9da362011-01-24 06:22:04 +0000802 venc_mem = platform_get_resource(venc.pdev, IORESOURCE_MEM, 0);
803 if (!venc_mem) {
804 DSSERR("can't get IORESOURCE_MEM VENC\n");
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200805 return -EINVAL;
Senthilvadivu Guruswamyea9da362011-01-24 06:22:04 +0000806 }
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200807
Julia Lawall6e2a14d2012-01-24 14:00:45 +0100808 venc.base = devm_ioremap(&pdev->dev, venc_mem->start,
809 resource_size(venc_mem));
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000810 if (!venc.base) {
811 DSSERR("can't ioremap VENC\n");
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200812 return -ENOMEM;
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000813 }
814
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300815 r = venc_get_clocks(pdev);
816 if (r)
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200817 return r;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300818
819 pm_runtime_enable(&pdev->dev);
820
821 r = venc_runtime_get();
822 if (r)
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200823 goto err_runtime_get;
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000824
825 rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
Sumit Semwala06b62f2011-01-24 06:22:03 +0000826 dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000827
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300828 venc_runtime_put();
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000829
Archit Taneja156fd992012-07-06 20:52:37 +0530830 r = venc_panel_init();
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200831 if (r)
Archit Taneja156fd992012-07-06 20:52:37 +0530832 goto err_panel_init;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300833
Tomi Valkeinene40402c2012-03-02 18:01:07 +0200834 dss_debugfs_create_file("venc", venc_dump_regs);
835
Tomi Valkeinen38f3daf2012-05-02 14:55:12 +0300836 venc_probe_pdata(pdev);
Tomi Valkeinen35deca32012-03-01 15:45:53 +0200837
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200838 return 0;
839
Archit Taneja156fd992012-07-06 20:52:37 +0530840err_panel_init:
Tomi Valkeinencd3b3442012-01-25 13:31:04 +0200841err_runtime_get:
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300842 pm_runtime_disable(&pdev->dev);
843 venc_put_clocks();
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300844 return r;
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000845}
846
Tomi Valkeinen6e7e8f02012-02-17 17:41:13 +0200847static int __exit omap_venchw_remove(struct platform_device *pdev)
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000848{
Tomi Valkeinen35deca32012-03-01 15:45:53 +0200849 omap_dss_unregister_child_devices(&pdev->dev);
850
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000851 if (venc.vdda_dac_reg != NULL) {
852 regulator_put(venc.vdda_dac_reg);
853 venc.vdda_dac_reg = NULL;
854 }
Tomi Valkeinen35deca32012-03-01 15:45:53 +0200855
Archit Taneja156fd992012-07-06 20:52:37 +0530856 venc_panel_exit();
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000857
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300858 pm_runtime_disable(&pdev->dev);
859 venc_put_clocks();
860
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000861 return 0;
862}
863
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300864static int venc_runtime_suspend(struct device *dev)
865{
866 if (venc.tv_dac_clk)
Rajendra Nayakf11766d2012-06-27 14:21:26 +0530867 clk_disable_unprepare(venc.tv_dac_clk);
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300868
869 dispc_runtime_put();
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300870
871 return 0;
872}
873
874static int venc_runtime_resume(struct device *dev)
875{
876 int r;
877
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300878 r = dispc_runtime_get();
879 if (r < 0)
Tomi Valkeinen852f0832012-02-17 17:58:04 +0200880 return r;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300881
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300882 if (venc.tv_dac_clk)
Rajendra Nayakf11766d2012-06-27 14:21:26 +0530883 clk_prepare_enable(venc.tv_dac_clk);
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300884
885 return 0;
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300886}
887
888static const struct dev_pm_ops venc_pm_ops = {
889 .runtime_suspend = venc_runtime_suspend,
890 .runtime_resume = venc_runtime_resume,
891};
892
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000893static struct platform_driver omap_venchw_driver = {
Tomi Valkeinen6e7e8f02012-02-17 17:41:13 +0200894 .remove = __exit_p(omap_venchw_remove),
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000895 .driver = {
896 .name = "omapdss_venc",
897 .owner = THIS_MODULE,
Tomi Valkeinen4fbafaf2011-05-27 10:52:19 +0300898 .pm = &venc_pm_ops,
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000899 },
900};
901
Tomi Valkeinen6e7e8f02012-02-17 17:41:13 +0200902int __init venc_init_platform_driver(void)
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000903{
Tomi Valkeinen61055d42012-03-07 12:53:38 +0200904 return platform_driver_probe(&omap_venchw_driver, omap_venchw_probe);
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000905}
906
Tomi Valkeinen6e7e8f02012-02-17 17:41:13 +0200907void __exit venc_uninit_platform_driver(void)
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000908{
Tomi Valkeinen04c742c2012-02-23 15:32:37 +0200909 platform_driver_unregister(&omap_venchw_driver);
Senthilvadivu Guruswamy30ea50c2011-01-24 06:22:01 +0000910}