diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-02-13 08:31:38 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-04-17 01:10:19 -0400 |
commit | f7018c21350204c4cf628462f229d44d03545254 (patch) | |
tree | 408787177164cf51cc06f7aabdb04fcff8d2b6aa /drivers/video/via/via_aux_edid.c | |
parent | c26ef3eb3c11274bad1b64498d0a134f85755250 (diff) |
video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.
Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.
No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/video/via/via_aux_edid.c')
-rw-r--r-- | drivers/video/via/via_aux_edid.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/drivers/video/via/via_aux_edid.c b/drivers/video/via/via_aux_edid.c deleted file mode 100644 index 754d4509033f..000000000000 --- a/drivers/video/via/via_aux_edid.c +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public | ||
6 | * License as published by the Free Software Foundation; | ||
7 | * either version 2, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | ||
11 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
12 | * A PARTICULAR PURPOSE.See the GNU General Public License | ||
13 | * for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | /* | ||
21 | * generic EDID driver | ||
22 | */ | ||
23 | |||
24 | #include <linux/slab.h> | ||
25 | #include <linux/fb.h> | ||
26 | #include "via_aux.h" | ||
27 | #include "../edid.h" | ||
28 | |||
29 | |||
30 | static const char *name = "EDID"; | ||
31 | |||
32 | |||
33 | static void query_edid(struct via_aux_drv *drv) | ||
34 | { | ||
35 | struct fb_monspecs *spec = drv->data; | ||
36 | unsigned char edid[EDID_LENGTH]; | ||
37 | bool valid = false; | ||
38 | |||
39 | if (spec) { | ||
40 | fb_destroy_modedb(spec->modedb); | ||
41 | } else { | ||
42 | spec = kmalloc(sizeof(*spec), GFP_KERNEL); | ||
43 | if (!spec) | ||
44 | return; | ||
45 | } | ||
46 | |||
47 | spec->version = spec->revision = 0; | ||
48 | if (via_aux_read(drv, 0x00, edid, EDID_LENGTH)) { | ||
49 | fb_edid_to_monspecs(edid, spec); | ||
50 | valid = spec->version || spec->revision; | ||
51 | } | ||
52 | |||
53 | if (!valid) { | ||
54 | kfree(spec); | ||
55 | spec = NULL; | ||
56 | } else | ||
57 | printk(KERN_DEBUG "EDID: %s %s\n", spec->manufacturer, spec->monitor); | ||
58 | |||
59 | drv->data = spec; | ||
60 | } | ||
61 | |||
62 | static const struct fb_videomode *get_preferred_mode(struct via_aux_drv *drv) | ||
63 | { | ||
64 | struct fb_monspecs *spec = drv->data; | ||
65 | int i; | ||
66 | |||
67 | if (!spec || !spec->modedb || !(spec->misc & FB_MISC_1ST_DETAIL)) | ||
68 | return NULL; | ||
69 | |||
70 | for (i = 0; i < spec->modedb_len; i++) { | ||
71 | if (spec->modedb[i].flag & FB_MODE_IS_FIRST && | ||
72 | spec->modedb[i].flag & FB_MODE_IS_DETAILED) | ||
73 | return &spec->modedb[i]; | ||
74 | } | ||
75 | |||
76 | return NULL; | ||
77 | } | ||
78 | |||
79 | static void cleanup(struct via_aux_drv *drv) | ||
80 | { | ||
81 | struct fb_monspecs *spec = drv->data; | ||
82 | |||
83 | if (spec) | ||
84 | fb_destroy_modedb(spec->modedb); | ||
85 | } | ||
86 | |||
87 | void via_aux_edid_probe(struct via_aux_bus *bus) | ||
88 | { | ||
89 | struct via_aux_drv drv = { | ||
90 | .bus = bus, | ||
91 | .addr = 0x50, | ||
92 | .name = name, | ||
93 | .cleanup = cleanup, | ||
94 | .get_preferred_mode = get_preferred_mode}; | ||
95 | |||
96 | query_edid(&drv); | ||
97 | |||
98 | /* as EDID devices can be connected/disconnected just add the driver */ | ||
99 | via_aux_add(&drv); | ||
100 | } | ||