19 #include <linux/module.h>
33 #define LCD_PIXEL_CLOCK 23800
42 } nec_8048_init_seq[] = {
43 { 3, 0x01 }, { 0, 0x00 }, { 1, 0x01 }, { 4, 0x00 }, { 5, 0x14 },
44 { 6, 0x24 }, { 16, 0xD7 }, { 17, 0x00 }, { 18, 0x00 }, { 19, 0x55 },
45 { 20, 0x01 }, { 21, 0x70 }, { 22, 0x1E }, { 23, 0x25 }, { 24, 0x25 },
46 { 25, 0x02 }, { 26, 0x02 }, { 27, 0xA0 }, { 32, 0x2F }, { 33, 0x0F },
47 { 34, 0x0F }, { 35, 0x0F }, { 36, 0x0F }, { 37, 0x0F }, { 38, 0x0F },
48 { 39, 0x00 }, { 40, 0x02 }, { 41, 0x02 }, { 42, 0x02 }, { 43, 0x0F },
49 { 44, 0x0F }, { 45, 0x0F }, { 46, 0x0F }, { 47, 0x0F }, { 48, 0x0F },
50 { 49, 0x0F }, { 50, 0x00 }, { 51, 0x02 }, { 52, 0x02 }, { 53, 0x02 },
51 { 80, 0x0C }, { 83, 0x42 }, { 84, 0x42 }, { 85, 0x41 }, { 86, 0x14 },
52 { 89, 0x88 }, { 90, 0x01 }, { 91, 0x00 }, { 92, 0x02 }, { 93, 0x0C },
53 { 94, 0x1C }, { 95, 0x27 }, { 98, 0x49 }, { 99, 0x27 }, { 102, 0x76 },
54 { 103, 0x27 }, { 112, 0x01 }, { 113, 0x0E }, { 114, 0x02 },
55 { 115, 0x0C }, { 118, 0x0C }, { 121, 0x30 }, { 130, 0x00 },
56 { 131, 0x00 }, { 132, 0xFC }, { 134, 0x00 }, { 136, 0x00 },
57 { 138, 0x00 }, { 139, 0x00 }, { 140, 0x00 }, { 141, 0xFC },
58 { 143, 0x00 }, { 145, 0x00 }, { 147, 0x00 }, { 148, 0x00 },
59 { 149, 0x00 }, { 150, 0xFC }, { 152, 0x00 }, { 154, 0x00 },
60 { 156, 0x00 }, { 157, 0x00 }, { 2, 0x00 },
97 level = bl->
props.brightness;
108 return bl->
props.brightness;
114 .get_brightness = nec_8048_bl_get_brightness,
115 .update_status = nec_8048_bl_update_status,
125 dssdev->
panel.timings = nec_8048_panel_timings;
134 props.max_brightness = 255;
137 &nec_8048_bl_ops, &props);
150 r = nec_8048_bl_update_status(bl);
152 dev_err(&dssdev->
dev,
"failed to set lcd brightness\n");
163 nec_8048_bl_update_status(bl);
191 r = nec_8048_bl_update_status(bl);
193 dev_err(&dssdev->
dev,
"failed to set lcd brightness\n");
210 bl->
props.brightness = 0;
211 nec_8048_bl_update_status(bl);
223 r = nec_8048_panel_power_on(dssdev);
234 nec_8048_panel_power_off(dssdev);
241 nec_8048_panel_power_off(dssdev);
252 r = nec_8048_panel_power_on(dssdev);
267 .probe = nec_8048_panel_probe,
268 .remove = nec_8048_panel_remove,
269 .enable = nec_8048_panel_enable,
270 .disable = nec_8048_panel_disable,
271 .suspend = nec_8048_panel_suspend,
272 .resume = nec_8048_panel_resume,
273 .get_recommended_bpp = nec_8048_recommended_bpp,
276 .name =
"NEC_8048_panel",
285 unsigned int cmd = 0,
data = 0;
291 ret = spi_write(spi, (
unsigned char *)&
data, 4);
298 static int init_nec_8048_wvga_lcd(
struct spi_device *spi)
303 for (i = 0; i < (
ARRAY_SIZE(nec_8048_init_seq) - 1); i++)
304 nec_8048_spi_send(spi, nec_8048_init_seq[i].
addr,
305 nec_8048_init_seq[i].
dat);
307 nec_8048_spi_send(spi, nec_8048_init_seq[i].addr,
308 nec_8048_init_seq[i].dat);
312 static int nec_8048_spi_probe(
struct spi_device *spi)
318 init_nec_8048_wvga_lcd(spi);
323 static int nec_8048_spi_remove(
struct spi_device *spi)
332 nec_8048_spi_send(spi, 2, 0x01);
338 static int nec_8048_spi_resume(
struct spi_device *spi)
342 nec_8048_spi_send(spi, 2, 0x00);
343 init_nec_8048_wvga_lcd(spi);
348 static struct spi_driver nec_8048_spi_driver = {
349 .probe = nec_8048_spi_probe,
351 .suspend = nec_8048_spi_suspend,
352 .resume = nec_8048_spi_resume,
354 .name =
"nec_8048_spi",