summaryrefslogtreecommitdiffstats
path: root/include/linux/display.h
blob: 3bf70d639728f1f6714f9d96528a947a9ea6c8b1 (plain) (blame)
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
/*
 *  Copyright (C) 2006 James Simmons <jsimmons@infradead.org>
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or (at
 *  your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#ifndef _LINUX_DISPLAY_H
#define _LINUX_DISPLAY_H

#include <linux/device.h>

struct display_device;

/* This structure defines all the properties of a Display. */
struct display_driver {
	int  (*set_contrast)(struct display_device *, unsigned int);
	int  (*get_contrast)(struct display_device *);
	void (*suspend)(struct display_device *, pm_message_t state);
	void (*resume)(struct display_device *);
	int  (*probe)(struct display_device *, void *);
	int  (*remove)(struct display_device *);
	int  max_contrast;
};

struct display_device {
	struct module *owner;			/* Owner module */
	struct display_driver *driver;
	struct device *parent;			/* This is the parent */
	struct device *dev;			/* This is this display device */
	struct mutex lock;
	void *priv_data;
	char type[16];
	char *name;
	int idx;
};

extern struct display_device *display_device_register(struct display_driver *driver,
					struct device *dev, void *devdata);
extern void display_device_unregister(struct display_device *dev);

extern int probe_edid(struct display_device *dev, void *devdata);

#define to_display_device(obj) container_of(obj, struct display_device, class_dev)

#endif