Guennadi Liakhovetski | 9fd04fe | 2010-05-23 14:00:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Public SH-mobile MIPI DSI header |
| 3 | * |
| 4 | * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | #ifndef VIDEO_SH_MIPI_DSI_H |
| 11 | #define VIDEO_SH_MIPI_DSI_H |
| 12 | |
| 13 | enum sh_mipi_dsi_data_fmt { |
| 14 | MIPI_RGB888, |
| 15 | MIPI_RGB565, |
| 16 | MIPI_RGB666_LP, |
| 17 | MIPI_RGB666, |
| 18 | MIPI_BGR888, |
| 19 | MIPI_BGR565, |
| 20 | MIPI_BGR666_LP, |
| 21 | MIPI_BGR666, |
| 22 | MIPI_YUYV, |
| 23 | MIPI_UYVY, |
| 24 | MIPI_YUV420_L, |
| 25 | MIPI_YUV420, |
| 26 | }; |
| 27 | |
| 28 | struct sh_mobile_lcdc_chan_cfg; |
| 29 | |
Guennadi Liakhovetski | 38f3a87 | 2010-12-29 08:12:22 +0000 | [diff] [blame] | 30 | #define SH_MIPI_DSI_HSABM (1 << 0) |
Kuninori Morimoto | 32ba95c | 2011-11-08 20:34:01 -0800 | [diff] [blame] | 31 | #define SH_MIPI_DSI_HBPBM (1 << 1) |
Kuninori Morimoto | f7b0af6 | 2011-11-08 20:34:24 -0800 | [diff] [blame] | 32 | #define SH_MIPI_DSI_HFPBM (1 << 2) |
Kuninori Morimoto | d07a9d2 | 2011-11-08 20:34:33 -0800 | [diff] [blame] | 33 | #define SH_MIPI_DSI_BL2E (1 << 3) |
Kuninori Morimoto | f832906a | 2011-11-08 20:34:55 -0800 | [diff] [blame] | 34 | #define SH_MIPI_DSI_VSEE (1 << 4) |
| 35 | #define SH_MIPI_DSI_HSEE (1 << 5) |
| 36 | #define SH_MIPI_DSI_HSAE (1 << 6) |
| 37 | |
Kuninori Morimoto | a2e6297 | 2011-11-08 20:35:27 -0800 | [diff] [blame] | 38 | #define SH_MIPI_DSI_HSbyteCLK (1 << 24) |
| 39 | #define SH_MIPI_DSI_HS6divCLK (1 << 25) |
| 40 | #define SH_MIPI_DSI_HS4divCLK (1 << 26) |
| 41 | |
Kuninori Morimoto | f832906a | 2011-11-08 20:34:55 -0800 | [diff] [blame] | 42 | #define SH_MIPI_DSI_SYNC_PULSES_MODE (SH_MIPI_DSI_VSEE | \ |
| 43 | SH_MIPI_DSI_HSEE | \ |
| 44 | SH_MIPI_DSI_HSAE) |
| 45 | #define SH_MIPI_DSI_SYNC_EVENTS_MODE (0) |
| 46 | #define SH_MIPI_DSI_SYNC_BURST_MODE (SH_MIPI_DSI_BL2E) |
Guennadi Liakhovetski | 38f3a87 | 2010-12-29 08:12:22 +0000 | [diff] [blame] | 47 | |
Guennadi Liakhovetski | 9fd04fe | 2010-05-23 14:00:43 +0000 | [diff] [blame] | 48 | struct sh_mipi_dsi_info { |
| 49 | enum sh_mipi_dsi_data_fmt data_format; |
| 50 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; |
Kuninori Morimoto | 26c3d7a | 2011-11-08 20:34:43 -0800 | [diff] [blame] | 51 | int lane; |
Guennadi Liakhovetski | 38f3a87 | 2010-12-29 08:12:22 +0000 | [diff] [blame] | 52 | unsigned long flags; |
| 53 | u32 clksrc; |
Kuninori Morimoto | 8f9c60f | 2012-03-20 18:34:10 -0700 | [diff] [blame] | 54 | u32 phyctrl; /* for extra setting */ |
Guennadi Liakhovetski | 38f3a87 | 2010-12-29 08:12:22 +0000 | [diff] [blame] | 55 | unsigned int vsynw_offset; |
Kuninori Morimoto | 5e47431 | 2011-11-08 20:35:14 -0800 | [diff] [blame] | 56 | int (*set_dot_clock)(struct platform_device *pdev, |
| 57 | void __iomem *base, |
| 58 | int enable); |
Guennadi Liakhovetski | 9fd04fe | 2010-05-23 14:00:43 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | #endif |