OMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on OMAP4
[zen-stable.git] / drivers / video / backlight / ili9320.h
blobe388eca7cac5ca89069684d17d6bcaba75ab3a68
1 /* drivers/video/backlight/ili9320.h
3 * ILI9320 LCD controller driver core.
5 * Copyright 2007 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
8 * http://armlinux.simtec.co.uk/
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 /* Holder for register and value pairs. */
16 struct ili9320_reg {
17 unsigned short address;
18 unsigned short value;
21 struct ili9320;
23 struct ili9320_client {
24 const char *name;
25 int (*init)(struct ili9320 *ili, struct ili9320_platdata *cfg);
28 /* Device attached via an SPI bus. */
29 struct ili9320_spi {
30 struct spi_device *dev;
31 struct spi_message message;
32 struct spi_transfer xfer[2];
34 unsigned char id;
35 unsigned char buffer_addr[4];
36 unsigned char buffer_data[4];
39 /* ILI9320 device state. */
40 struct ili9320 {
41 union {
42 struct ili9320_spi spi; /* SPI attachged device. */
43 } access; /* Register access method. */
45 struct device *dev;
46 struct lcd_device *lcd; /* LCD device we created. */
47 struct ili9320_client *client;
48 struct ili9320_platdata *platdata;
50 int power; /* current power state. */
51 int initialised;
53 unsigned short display1;
54 unsigned short power1;
56 int (*write)(struct ili9320 *ili, unsigned int reg, unsigned int val);
60 /* ILI9320 register access routines */
62 extern int ili9320_write(struct ili9320 *ili,
63 unsigned int reg, unsigned int value);
65 extern int ili9320_write_regs(struct ili9320 *ili,
66 struct ili9320_reg *values,
67 int nr_values);
69 /* Device probe */
71 extern int ili9320_probe_spi(struct spi_device *spi,
72 struct ili9320_client *cli);
74 extern int ili9320_remove(struct ili9320 *lcd);
75 extern void ili9320_shutdown(struct ili9320 *lcd);
77 /* PM */
79 extern int ili9320_suspend(struct ili9320 *lcd, pm_message_t state);
80 extern int ili9320_resume(struct ili9320 *lcd);