]> Git Repo - linux.git/blob - drivers/gpu/drm/omapdrm/dss/display.c
Merge tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[linux.git] / drivers / gpu / drm / omapdrm / dss / display.c
1 /*
2  * Copyright (C) 2009 Nokia Corporation
3  * Author: Tomi Valkeinen <[email protected]>
4  *
5  * Some code and ideas taken from drivers/video/omap/ driver
6  * by Imre Deak.
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #define DSS_SUBSYS_NAME "DISPLAY"
22
23 #include <linux/kernel.h>
24 #include <linux/of.h>
25
26 #include "omapdss.h"
27
28 static int disp_num_counter;
29
30 void omapdss_display_init(struct omap_dss_device *dssdev)
31 {
32         int id;
33
34         /*
35          * Note: this presumes that all displays either have an DT alias, or
36          * none has.
37          */
38         id = of_alias_get_id(dssdev->dev->of_node, "display");
39         if (id < 0)
40                 id = disp_num_counter++;
41
42         dssdev->alias_id = id;
43
44         /* Use 'label' property for name, if it exists */
45         of_property_read_string(dssdev->dev->of_node, "label", &dssdev->name);
46
47         if (dssdev->name == NULL)
48                 dssdev->name = devm_kasprintf(dssdev->dev, GFP_KERNEL,
49                                               "display%u", id);
50 }
51 EXPORT_SYMBOL_GPL(omapdss_display_init);
52
53 struct omap_dss_device *omapdss_display_get(struct omap_dss_device *output)
54 {
55         while (output->next)
56                 output = output->next;
57
58         return omapdss_device_get(output);
59 }
60 EXPORT_SYMBOL_GPL(omapdss_display_get);
This page took 0.036754 seconds and 4 git commands to generate.