panel-simple.c 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182
  1. /*
  2. * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sub license,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the
  12. * next paragraph) shall be included in all copies or substantial portions
  13. * of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. */
  23. #include <linux/backlight.h>
  24. #include <linux/gpio/consumer.h>
  25. #include <linux/module.h>
  26. #include <linux/of_platform.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/regulator/consumer.h>
  29. #include <drm/drmP.h>
  30. #include <drm/drm_crtc.h>
  31. #include <drm/drm_mipi_dsi.h>
  32. #include <drm/drm_panel.h>
  33. #include <video/display_timing.h>
  34. #include <video/videomode.h>
  35. struct panel_desc {
  36. const struct drm_display_mode *modes;
  37. unsigned int num_modes;
  38. const struct display_timing *timings;
  39. unsigned int num_timings;
  40. unsigned int bpc;
  41. /**
  42. * @width: width (in millimeters) of the panel's active display area
  43. * @height: height (in millimeters) of the panel's active display area
  44. */
  45. struct {
  46. unsigned int width;
  47. unsigned int height;
  48. } size;
  49. /**
  50. * @prepare: the time (in milliseconds) that it takes for the panel to
  51. * become ready and start receiving video data
  52. * @enable: the time (in milliseconds) that it takes for the panel to
  53. * display the first valid frame after starting to receive
  54. * video data
  55. * @disable: the time (in milliseconds) that it takes for the panel to
  56. * turn the display off (no content is visible)
  57. * @unprepare: the time (in milliseconds) that it takes for the panel
  58. * to power itself down completely
  59. */
  60. struct {
  61. unsigned int prepare;
  62. unsigned int enable;
  63. unsigned int disable;
  64. unsigned int unprepare;
  65. } delay;
  66. u32 bus_format;
  67. u32 bus_flags;
  68. };
  69. struct panel_simple {
  70. struct drm_panel base;
  71. bool prepared;
  72. bool enabled;
  73. const struct panel_desc *desc;
  74. struct backlight_device *backlight;
  75. struct regulator *supply;
  76. struct i2c_adapter *ddc;
  77. struct gpio_desc *enable_gpio;
  78. };
  79. static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
  80. {
  81. return container_of(panel, struct panel_simple, base);
  82. }
  83. static int panel_simple_get_fixed_modes(struct panel_simple *panel)
  84. {
  85. struct drm_connector *connector = panel->base.connector;
  86. struct drm_device *drm = panel->base.drm;
  87. struct drm_display_mode *mode;
  88. unsigned int i, num = 0;
  89. if (!panel->desc)
  90. return 0;
  91. for (i = 0; i < panel->desc->num_timings; i++) {
  92. const struct display_timing *dt = &panel->desc->timings[i];
  93. struct videomode vm;
  94. videomode_from_timing(dt, &vm);
  95. mode = drm_mode_create(drm);
  96. if (!mode) {
  97. dev_err(drm->dev, "failed to add mode %ux%u\n",
  98. dt->hactive.typ, dt->vactive.typ);
  99. continue;
  100. }
  101. drm_display_mode_from_videomode(&vm, mode);
  102. mode->type |= DRM_MODE_TYPE_DRIVER;
  103. if (panel->desc->num_timings == 1)
  104. mode->type |= DRM_MODE_TYPE_PREFERRED;
  105. drm_mode_probed_add(connector, mode);
  106. num++;
  107. }
  108. for (i = 0; i < panel->desc->num_modes; i++) {
  109. const struct drm_display_mode *m = &panel->desc->modes[i];
  110. mode = drm_mode_duplicate(drm, m);
  111. if (!mode) {
  112. dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
  113. m->hdisplay, m->vdisplay, m->vrefresh);
  114. continue;
  115. }
  116. mode->type |= DRM_MODE_TYPE_DRIVER;
  117. if (panel->desc->num_modes == 1)
  118. mode->type |= DRM_MODE_TYPE_PREFERRED;
  119. drm_mode_set_name(mode);
  120. drm_mode_probed_add(connector, mode);
  121. num++;
  122. }
  123. connector->display_info.bpc = panel->desc->bpc;
  124. connector->display_info.width_mm = panel->desc->size.width;
  125. connector->display_info.height_mm = panel->desc->size.height;
  126. if (panel->desc->bus_format)
  127. drm_display_info_set_bus_formats(&connector->display_info,
  128. &panel->desc->bus_format, 1);
  129. connector->display_info.bus_flags = panel->desc->bus_flags;
  130. return num;
  131. }
  132. static int panel_simple_disable(struct drm_panel *panel)
  133. {
  134. struct panel_simple *p = to_panel_simple(panel);
  135. if (!p->enabled)
  136. return 0;
  137. if (p->backlight) {
  138. p->backlight->props.power = FB_BLANK_POWERDOWN;
  139. p->backlight->props.state |= BL_CORE_FBBLANK;
  140. backlight_update_status(p->backlight);
  141. }
  142. if (p->desc->delay.disable)
  143. msleep(p->desc->delay.disable);
  144. p->enabled = false;
  145. return 0;
  146. }
  147. static int panel_simple_unprepare(struct drm_panel *panel)
  148. {
  149. struct panel_simple *p = to_panel_simple(panel);
  150. if (!p->prepared)
  151. return 0;
  152. if (p->enable_gpio)
  153. gpiod_set_value_cansleep(p->enable_gpio, 0);
  154. regulator_disable(p->supply);
  155. if (p->desc->delay.unprepare)
  156. msleep(p->desc->delay.unprepare);
  157. p->prepared = false;
  158. return 0;
  159. }
  160. static int panel_simple_prepare(struct drm_panel *panel)
  161. {
  162. struct panel_simple *p = to_panel_simple(panel);
  163. int err;
  164. if (p->prepared)
  165. return 0;
  166. err = regulator_enable(p->supply);
  167. if (err < 0) {
  168. dev_err(panel->dev, "failed to enable supply: %d\n", err);
  169. return err;
  170. }
  171. if (p->enable_gpio)
  172. gpiod_set_value_cansleep(p->enable_gpio, 1);
  173. if (p->desc->delay.prepare)
  174. msleep(p->desc->delay.prepare);
  175. p->prepared = true;
  176. return 0;
  177. }
  178. static int panel_simple_enable(struct drm_panel *panel)
  179. {
  180. struct panel_simple *p = to_panel_simple(panel);
  181. if (p->enabled)
  182. return 0;
  183. if (p->desc->delay.enable)
  184. msleep(p->desc->delay.enable);
  185. if (p->backlight) {
  186. p->backlight->props.state &= ~BL_CORE_FBBLANK;
  187. p->backlight->props.power = FB_BLANK_UNBLANK;
  188. backlight_update_status(p->backlight);
  189. }
  190. p->enabled = true;
  191. return 0;
  192. }
  193. static int panel_simple_get_modes(struct drm_panel *panel)
  194. {
  195. struct panel_simple *p = to_panel_simple(panel);
  196. int num = 0;
  197. /* probe EDID if a DDC bus is available */
  198. if (p->ddc) {
  199. struct edid *edid = drm_get_edid(panel->connector, p->ddc);
  200. drm_mode_connector_update_edid_property(panel->connector, edid);
  201. if (edid) {
  202. num += drm_add_edid_modes(panel->connector, edid);
  203. kfree(edid);
  204. }
  205. }
  206. /* add hard-coded panel modes */
  207. num += panel_simple_get_fixed_modes(p);
  208. return num;
  209. }
  210. static int panel_simple_get_timings(struct drm_panel *panel,
  211. unsigned int num_timings,
  212. struct display_timing *timings)
  213. {
  214. struct panel_simple *p = to_panel_simple(panel);
  215. unsigned int i;
  216. if (p->desc->num_timings < num_timings)
  217. num_timings = p->desc->num_timings;
  218. if (timings)
  219. for (i = 0; i < num_timings; i++)
  220. timings[i] = p->desc->timings[i];
  221. return p->desc->num_timings;
  222. }
  223. static const struct drm_panel_funcs panel_simple_funcs = {
  224. .disable = panel_simple_disable,
  225. .unprepare = panel_simple_unprepare,
  226. .prepare = panel_simple_prepare,
  227. .enable = panel_simple_enable,
  228. .get_modes = panel_simple_get_modes,
  229. .get_timings = panel_simple_get_timings,
  230. };
  231. static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
  232. {
  233. struct device_node *backlight, *ddc;
  234. struct panel_simple *panel;
  235. int err;
  236. panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
  237. if (!panel)
  238. return -ENOMEM;
  239. panel->enabled = false;
  240. panel->prepared = false;
  241. panel->desc = desc;
  242. panel->supply = devm_regulator_get(dev, "power");
  243. if (IS_ERR(panel->supply))
  244. return PTR_ERR(panel->supply);
  245. panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
  246. GPIOD_OUT_LOW);
  247. if (IS_ERR(panel->enable_gpio)) {
  248. err = PTR_ERR(panel->enable_gpio);
  249. dev_err(dev, "failed to request GPIO: %d\n", err);
  250. return err;
  251. }
  252. backlight = of_parse_phandle(dev->of_node, "backlight", 0);
  253. if (backlight) {
  254. panel->backlight = of_find_backlight_by_node(backlight);
  255. of_node_put(backlight);
  256. if (!panel->backlight)
  257. return -EPROBE_DEFER;
  258. }
  259. ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
  260. if (ddc) {
  261. panel->ddc = of_find_i2c_adapter_by_node(ddc);
  262. of_node_put(ddc);
  263. if (!panel->ddc) {
  264. err = -EPROBE_DEFER;
  265. goto free_backlight;
  266. }
  267. }
  268. drm_panel_init(&panel->base);
  269. panel->base.dev = dev;
  270. panel->base.funcs = &panel_simple_funcs;
  271. err = drm_panel_add(&panel->base);
  272. if (err < 0)
  273. goto free_ddc;
  274. dev_set_drvdata(dev, panel);
  275. return 0;
  276. free_ddc:
  277. if (panel->ddc)
  278. put_device(&panel->ddc->dev);
  279. free_backlight:
  280. if (panel->backlight)
  281. put_device(&panel->backlight->dev);
  282. return err;
  283. }
  284. static int panel_simple_remove(struct device *dev)
  285. {
  286. struct panel_simple *panel = dev_get_drvdata(dev);
  287. drm_panel_detach(&panel->base);
  288. drm_panel_remove(&panel->base);
  289. panel_simple_disable(&panel->base);
  290. if (panel->ddc)
  291. put_device(&panel->ddc->dev);
  292. if (panel->backlight)
  293. put_device(&panel->backlight->dev);
  294. return 0;
  295. }
  296. static void panel_simple_shutdown(struct device *dev)
  297. {
  298. struct panel_simple *panel = dev_get_drvdata(dev);
  299. panel_simple_disable(&panel->base);
  300. }
  301. static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
  302. .clock = 33333,
  303. .hdisplay = 800,
  304. .hsync_start = 800 + 0,
  305. .hsync_end = 800 + 0 + 255,
  306. .htotal = 800 + 0 + 255 + 0,
  307. .vdisplay = 480,
  308. .vsync_start = 480 + 2,
  309. .vsync_end = 480 + 2 + 45,
  310. .vtotal = 480 + 2 + 45 + 0,
  311. .vrefresh = 60,
  312. .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
  313. };
  314. static const struct panel_desc ampire_am800480r3tmqwa1h = {
  315. .modes = &ampire_am800480r3tmqwa1h_mode,
  316. .num_modes = 1,
  317. .bpc = 6,
  318. .size = {
  319. .width = 152,
  320. .height = 91,
  321. },
  322. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  323. };
  324. static const struct drm_display_mode auo_b101aw03_mode = {
  325. .clock = 51450,
  326. .hdisplay = 1024,
  327. .hsync_start = 1024 + 156,
  328. .hsync_end = 1024 + 156 + 8,
  329. .htotal = 1024 + 156 + 8 + 156,
  330. .vdisplay = 600,
  331. .vsync_start = 600 + 16,
  332. .vsync_end = 600 + 16 + 6,
  333. .vtotal = 600 + 16 + 6 + 16,
  334. .vrefresh = 60,
  335. };
  336. static const struct panel_desc auo_b101aw03 = {
  337. .modes = &auo_b101aw03_mode,
  338. .num_modes = 1,
  339. .bpc = 6,
  340. .size = {
  341. .width = 223,
  342. .height = 125,
  343. },
  344. };
  345. static const struct drm_display_mode auo_b101ean01_mode = {
  346. .clock = 72500,
  347. .hdisplay = 1280,
  348. .hsync_start = 1280 + 119,
  349. .hsync_end = 1280 + 119 + 32,
  350. .htotal = 1280 + 119 + 32 + 21,
  351. .vdisplay = 800,
  352. .vsync_start = 800 + 4,
  353. .vsync_end = 800 + 4 + 20,
  354. .vtotal = 800 + 4 + 20 + 8,
  355. .vrefresh = 60,
  356. };
  357. static const struct panel_desc auo_b101ean01 = {
  358. .modes = &auo_b101ean01_mode,
  359. .num_modes = 1,
  360. .bpc = 6,
  361. .size = {
  362. .width = 217,
  363. .height = 136,
  364. },
  365. };
  366. static const struct drm_display_mode auo_b101xtn01_mode = {
  367. .clock = 72000,
  368. .hdisplay = 1366,
  369. .hsync_start = 1366 + 20,
  370. .hsync_end = 1366 + 20 + 70,
  371. .htotal = 1366 + 20 + 70,
  372. .vdisplay = 768,
  373. .vsync_start = 768 + 14,
  374. .vsync_end = 768 + 14 + 42,
  375. .vtotal = 768 + 14 + 42,
  376. .vrefresh = 60,
  377. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  378. };
  379. static const struct panel_desc auo_b101xtn01 = {
  380. .modes = &auo_b101xtn01_mode,
  381. .num_modes = 1,
  382. .bpc = 6,
  383. .size = {
  384. .width = 223,
  385. .height = 125,
  386. },
  387. };
  388. static const struct drm_display_mode auo_b116xw03_mode = {
  389. .clock = 70589,
  390. .hdisplay = 1366,
  391. .hsync_start = 1366 + 40,
  392. .hsync_end = 1366 + 40 + 40,
  393. .htotal = 1366 + 40 + 40 + 32,
  394. .vdisplay = 768,
  395. .vsync_start = 768 + 10,
  396. .vsync_end = 768 + 10 + 12,
  397. .vtotal = 768 + 10 + 12 + 6,
  398. .vrefresh = 60,
  399. };
  400. static const struct panel_desc auo_b116xw03 = {
  401. .modes = &auo_b116xw03_mode,
  402. .num_modes = 1,
  403. .bpc = 6,
  404. .size = {
  405. .width = 256,
  406. .height = 144,
  407. },
  408. };
  409. static const struct drm_display_mode auo_b133xtn01_mode = {
  410. .clock = 69500,
  411. .hdisplay = 1366,
  412. .hsync_start = 1366 + 48,
  413. .hsync_end = 1366 + 48 + 32,
  414. .htotal = 1366 + 48 + 32 + 20,
  415. .vdisplay = 768,
  416. .vsync_start = 768 + 3,
  417. .vsync_end = 768 + 3 + 6,
  418. .vtotal = 768 + 3 + 6 + 13,
  419. .vrefresh = 60,
  420. };
  421. static const struct panel_desc auo_b133xtn01 = {
  422. .modes = &auo_b133xtn01_mode,
  423. .num_modes = 1,
  424. .bpc = 6,
  425. .size = {
  426. .width = 293,
  427. .height = 165,
  428. },
  429. };
  430. static const struct drm_display_mode auo_b133htn01_mode = {
  431. .clock = 150660,
  432. .hdisplay = 1920,
  433. .hsync_start = 1920 + 172,
  434. .hsync_end = 1920 + 172 + 80,
  435. .htotal = 1920 + 172 + 80 + 60,
  436. .vdisplay = 1080,
  437. .vsync_start = 1080 + 25,
  438. .vsync_end = 1080 + 25 + 10,
  439. .vtotal = 1080 + 25 + 10 + 10,
  440. .vrefresh = 60,
  441. };
  442. static const struct panel_desc auo_b133htn01 = {
  443. .modes = &auo_b133htn01_mode,
  444. .num_modes = 1,
  445. .bpc = 6,
  446. .size = {
  447. .width = 293,
  448. .height = 165,
  449. },
  450. .delay = {
  451. .prepare = 105,
  452. .enable = 20,
  453. .unprepare = 50,
  454. },
  455. };
  456. static const struct display_timing auo_g133han01_timings = {
  457. .pixelclock = { 134000000, 141200000, 149000000 },
  458. .hactive = { 1920, 1920, 1920 },
  459. .hfront_porch = { 39, 58, 77 },
  460. .hback_porch = { 59, 88, 117 },
  461. .hsync_len = { 28, 42, 56 },
  462. .vactive = { 1080, 1080, 1080 },
  463. .vfront_porch = { 3, 8, 11 },
  464. .vback_porch = { 5, 14, 19 },
  465. .vsync_len = { 4, 14, 19 },
  466. };
  467. static const struct panel_desc auo_g133han01 = {
  468. .timings = &auo_g133han01_timings,
  469. .num_timings = 1,
  470. .bpc = 8,
  471. .size = {
  472. .width = 293,
  473. .height = 165,
  474. },
  475. .delay = {
  476. .prepare = 200,
  477. .enable = 50,
  478. .disable = 50,
  479. .unprepare = 1000,
  480. },
  481. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
  482. };
  483. static const struct display_timing auo_g185han01_timings = {
  484. .pixelclock = { 120000000, 144000000, 175000000 },
  485. .hactive = { 1920, 1920, 1920 },
  486. .hfront_porch = { 18, 60, 74 },
  487. .hback_porch = { 12, 44, 54 },
  488. .hsync_len = { 10, 24, 32 },
  489. .vactive = { 1080, 1080, 1080 },
  490. .vfront_porch = { 6, 10, 40 },
  491. .vback_porch = { 2, 5, 20 },
  492. .vsync_len = { 2, 5, 20 },
  493. };
  494. static const struct panel_desc auo_g185han01 = {
  495. .timings = &auo_g185han01_timings,
  496. .num_timings = 1,
  497. .bpc = 8,
  498. .size = {
  499. .width = 409,
  500. .height = 230,
  501. },
  502. .delay = {
  503. .prepare = 50,
  504. .enable = 200,
  505. .disable = 110,
  506. .unprepare = 1000,
  507. },
  508. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  509. };
  510. static const struct drm_display_mode auo_t215hvn01_mode = {
  511. .clock = 148800,
  512. .hdisplay = 1920,
  513. .hsync_start = 1920 + 88,
  514. .hsync_end = 1920 + 88 + 44,
  515. .htotal = 1920 + 88 + 44 + 148,
  516. .vdisplay = 1080,
  517. .vsync_start = 1080 + 4,
  518. .vsync_end = 1080 + 4 + 5,
  519. .vtotal = 1080 + 4 + 5 + 36,
  520. .vrefresh = 60,
  521. };
  522. static const struct panel_desc auo_t215hvn01 = {
  523. .modes = &auo_t215hvn01_mode,
  524. .num_modes = 1,
  525. .bpc = 8,
  526. .size = {
  527. .width = 430,
  528. .height = 270,
  529. },
  530. .delay = {
  531. .disable = 5,
  532. .unprepare = 1000,
  533. }
  534. };
  535. static const struct drm_display_mode avic_tm070ddh03_mode = {
  536. .clock = 51200,
  537. .hdisplay = 1024,
  538. .hsync_start = 1024 + 160,
  539. .hsync_end = 1024 + 160 + 4,
  540. .htotal = 1024 + 160 + 4 + 156,
  541. .vdisplay = 600,
  542. .vsync_start = 600 + 17,
  543. .vsync_end = 600 + 17 + 1,
  544. .vtotal = 600 + 17 + 1 + 17,
  545. .vrefresh = 60,
  546. };
  547. static const struct panel_desc avic_tm070ddh03 = {
  548. .modes = &avic_tm070ddh03_mode,
  549. .num_modes = 1,
  550. .bpc = 8,
  551. .size = {
  552. .width = 154,
  553. .height = 90,
  554. },
  555. .delay = {
  556. .prepare = 20,
  557. .enable = 200,
  558. .disable = 200,
  559. },
  560. };
  561. static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
  562. .clock = 66770,
  563. .hdisplay = 800,
  564. .hsync_start = 800 + 49,
  565. .hsync_end = 800 + 49 + 33,
  566. .htotal = 800 + 49 + 33 + 17,
  567. .vdisplay = 1280,
  568. .vsync_start = 1280 + 1,
  569. .vsync_end = 1280 + 1 + 7,
  570. .vtotal = 1280 + 1 + 7 + 15,
  571. .vrefresh = 60,
  572. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  573. };
  574. static const struct panel_desc chunghwa_claa070wp03xg = {
  575. .modes = &chunghwa_claa070wp03xg_mode,
  576. .num_modes = 1,
  577. .bpc = 6,
  578. .size = {
  579. .width = 94,
  580. .height = 150,
  581. },
  582. };
  583. static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
  584. .clock = 72070,
  585. .hdisplay = 1366,
  586. .hsync_start = 1366 + 58,
  587. .hsync_end = 1366 + 58 + 58,
  588. .htotal = 1366 + 58 + 58 + 58,
  589. .vdisplay = 768,
  590. .vsync_start = 768 + 4,
  591. .vsync_end = 768 + 4 + 4,
  592. .vtotal = 768 + 4 + 4 + 4,
  593. .vrefresh = 60,
  594. };
  595. static const struct panel_desc chunghwa_claa101wa01a = {
  596. .modes = &chunghwa_claa101wa01a_mode,
  597. .num_modes = 1,
  598. .bpc = 6,
  599. .size = {
  600. .width = 220,
  601. .height = 120,
  602. },
  603. };
  604. static const struct drm_display_mode chunghwa_claa101wb01_mode = {
  605. .clock = 69300,
  606. .hdisplay = 1366,
  607. .hsync_start = 1366 + 48,
  608. .hsync_end = 1366 + 48 + 32,
  609. .htotal = 1366 + 48 + 32 + 20,
  610. .vdisplay = 768,
  611. .vsync_start = 768 + 16,
  612. .vsync_end = 768 + 16 + 8,
  613. .vtotal = 768 + 16 + 8 + 16,
  614. .vrefresh = 60,
  615. };
  616. static const struct panel_desc chunghwa_claa101wb01 = {
  617. .modes = &chunghwa_claa101wb01_mode,
  618. .num_modes = 1,
  619. .bpc = 6,
  620. .size = {
  621. .width = 223,
  622. .height = 125,
  623. },
  624. };
  625. static const struct drm_display_mode edt_et057090dhu_mode = {
  626. .clock = 25175,
  627. .hdisplay = 640,
  628. .hsync_start = 640 + 16,
  629. .hsync_end = 640 + 16 + 30,
  630. .htotal = 640 + 16 + 30 + 114,
  631. .vdisplay = 480,
  632. .vsync_start = 480 + 10,
  633. .vsync_end = 480 + 10 + 3,
  634. .vtotal = 480 + 10 + 3 + 32,
  635. .vrefresh = 60,
  636. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  637. };
  638. static const struct panel_desc edt_et057090dhu = {
  639. .modes = &edt_et057090dhu_mode,
  640. .num_modes = 1,
  641. .bpc = 6,
  642. .size = {
  643. .width = 115,
  644. .height = 86,
  645. },
  646. };
  647. static const struct drm_display_mode edt_etm0700g0dh6_mode = {
  648. .clock = 33260,
  649. .hdisplay = 800,
  650. .hsync_start = 800 + 40,
  651. .hsync_end = 800 + 40 + 128,
  652. .htotal = 800 + 40 + 128 + 88,
  653. .vdisplay = 480,
  654. .vsync_start = 480 + 10,
  655. .vsync_end = 480 + 10 + 2,
  656. .vtotal = 480 + 10 + 2 + 33,
  657. .vrefresh = 60,
  658. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  659. };
  660. static const struct panel_desc edt_etm0700g0dh6 = {
  661. .modes = &edt_etm0700g0dh6_mode,
  662. .num_modes = 1,
  663. .bpc = 6,
  664. .size = {
  665. .width = 152,
  666. .height = 91,
  667. },
  668. };
  669. static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
  670. .clock = 32260,
  671. .hdisplay = 800,
  672. .hsync_start = 800 + 168,
  673. .hsync_end = 800 + 168 + 64,
  674. .htotal = 800 + 168 + 64 + 88,
  675. .vdisplay = 480,
  676. .vsync_start = 480 + 37,
  677. .vsync_end = 480 + 37 + 2,
  678. .vtotal = 480 + 37 + 2 + 8,
  679. .vrefresh = 60,
  680. };
  681. static const struct panel_desc foxlink_fl500wvr00_a0t = {
  682. .modes = &foxlink_fl500wvr00_a0t_mode,
  683. .num_modes = 1,
  684. .bpc = 8,
  685. .size = {
  686. .width = 108,
  687. .height = 65,
  688. },
  689. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  690. };
  691. static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
  692. .clock = 9000,
  693. .hdisplay = 480,
  694. .hsync_start = 480 + 5,
  695. .hsync_end = 480 + 5 + 1,
  696. .htotal = 480 + 5 + 1 + 40,
  697. .vdisplay = 272,
  698. .vsync_start = 272 + 8,
  699. .vsync_end = 272 + 8 + 1,
  700. .vtotal = 272 + 8 + 1 + 8,
  701. .vrefresh = 60,
  702. };
  703. static const struct panel_desc giantplus_gpg482739qs5 = {
  704. .modes = &giantplus_gpg482739qs5_mode,
  705. .num_modes = 1,
  706. .bpc = 8,
  707. .size = {
  708. .width = 95,
  709. .height = 54,
  710. },
  711. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  712. };
  713. static const struct display_timing hannstar_hsd070pww1_timing = {
  714. .pixelclock = { 64300000, 71100000, 82000000 },
  715. .hactive = { 1280, 1280, 1280 },
  716. .hfront_porch = { 1, 1, 10 },
  717. .hback_porch = { 1, 1, 10 },
  718. /*
  719. * According to the data sheet, the minimum horizontal blanking interval
  720. * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
  721. * minimum working horizontal blanking interval to be 60 clocks.
  722. */
  723. .hsync_len = { 58, 158, 661 },
  724. .vactive = { 800, 800, 800 },
  725. .vfront_porch = { 1, 1, 10 },
  726. .vback_porch = { 1, 1, 10 },
  727. .vsync_len = { 1, 21, 203 },
  728. .flags = DISPLAY_FLAGS_DE_HIGH,
  729. };
  730. static const struct panel_desc hannstar_hsd070pww1 = {
  731. .timings = &hannstar_hsd070pww1_timing,
  732. .num_timings = 1,
  733. .bpc = 6,
  734. .size = {
  735. .width = 151,
  736. .height = 94,
  737. },
  738. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  739. };
  740. static const struct display_timing hannstar_hsd100pxn1_timing = {
  741. .pixelclock = { 55000000, 65000000, 75000000 },
  742. .hactive = { 1024, 1024, 1024 },
  743. .hfront_porch = { 40, 40, 40 },
  744. .hback_porch = { 220, 220, 220 },
  745. .hsync_len = { 20, 60, 100 },
  746. .vactive = { 768, 768, 768 },
  747. .vfront_porch = { 7, 7, 7 },
  748. .vback_porch = { 21, 21, 21 },
  749. .vsync_len = { 10, 10, 10 },
  750. .flags = DISPLAY_FLAGS_DE_HIGH,
  751. };
  752. static const struct panel_desc hannstar_hsd100pxn1 = {
  753. .timings = &hannstar_hsd100pxn1_timing,
  754. .num_timings = 1,
  755. .bpc = 6,
  756. .size = {
  757. .width = 203,
  758. .height = 152,
  759. },
  760. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  761. };
  762. static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
  763. .clock = 33333,
  764. .hdisplay = 800,
  765. .hsync_start = 800 + 85,
  766. .hsync_end = 800 + 85 + 86,
  767. .htotal = 800 + 85 + 86 + 85,
  768. .vdisplay = 480,
  769. .vsync_start = 480 + 16,
  770. .vsync_end = 480 + 16 + 13,
  771. .vtotal = 480 + 16 + 13 + 16,
  772. .vrefresh = 60,
  773. };
  774. static const struct panel_desc hitachi_tx23d38vm0caa = {
  775. .modes = &hitachi_tx23d38vm0caa_mode,
  776. .num_modes = 1,
  777. .bpc = 6,
  778. .size = {
  779. .width = 195,
  780. .height = 117,
  781. },
  782. };
  783. static const struct drm_display_mode innolux_at043tn24_mode = {
  784. .clock = 9000,
  785. .hdisplay = 480,
  786. .hsync_start = 480 + 2,
  787. .hsync_end = 480 + 2 + 41,
  788. .htotal = 480 + 2 + 41 + 2,
  789. .vdisplay = 272,
  790. .vsync_start = 272 + 2,
  791. .vsync_end = 272 + 2 + 11,
  792. .vtotal = 272 + 2 + 11 + 2,
  793. .vrefresh = 60,
  794. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  795. };
  796. static const struct panel_desc innolux_at043tn24 = {
  797. .modes = &innolux_at043tn24_mode,
  798. .num_modes = 1,
  799. .bpc = 8,
  800. .size = {
  801. .width = 95,
  802. .height = 54,
  803. },
  804. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  805. };
  806. static const struct drm_display_mode innolux_at070tn92_mode = {
  807. .clock = 33333,
  808. .hdisplay = 800,
  809. .hsync_start = 800 + 210,
  810. .hsync_end = 800 + 210 + 20,
  811. .htotal = 800 + 210 + 20 + 46,
  812. .vdisplay = 480,
  813. .vsync_start = 480 + 22,
  814. .vsync_end = 480 + 22 + 10,
  815. .vtotal = 480 + 22 + 23 + 10,
  816. .vrefresh = 60,
  817. };
  818. static const struct panel_desc innolux_at070tn92 = {
  819. .modes = &innolux_at070tn92_mode,
  820. .num_modes = 1,
  821. .size = {
  822. .width = 154,
  823. .height = 86,
  824. },
  825. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  826. };
  827. static const struct display_timing innolux_g101ice_l01_timing = {
  828. .pixelclock = { 60400000, 71100000, 74700000 },
  829. .hactive = { 1280, 1280, 1280 },
  830. .hfront_porch = { 41, 80, 100 },
  831. .hback_porch = { 40, 79, 99 },
  832. .hsync_len = { 1, 1, 1 },
  833. .vactive = { 800, 800, 800 },
  834. .vfront_porch = { 5, 11, 14 },
  835. .vback_porch = { 4, 11, 14 },
  836. .vsync_len = { 1, 1, 1 },
  837. .flags = DISPLAY_FLAGS_DE_HIGH,
  838. };
  839. static const struct panel_desc innolux_g101ice_l01 = {
  840. .timings = &innolux_g101ice_l01_timing,
  841. .num_timings = 1,
  842. .bpc = 8,
  843. .size = {
  844. .width = 217,
  845. .height = 135,
  846. },
  847. .delay = {
  848. .enable = 200,
  849. .disable = 200,
  850. },
  851. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  852. };
  853. static const struct display_timing innolux_g121i1_l01_timing = {
  854. .pixelclock = { 67450000, 71000000, 74550000 },
  855. .hactive = { 1280, 1280, 1280 },
  856. .hfront_porch = { 40, 80, 160 },
  857. .hback_porch = { 39, 79, 159 },
  858. .hsync_len = { 1, 1, 1 },
  859. .vactive = { 800, 800, 800 },
  860. .vfront_porch = { 5, 11, 100 },
  861. .vback_porch = { 4, 11, 99 },
  862. .vsync_len = { 1, 1, 1 },
  863. };
  864. static const struct panel_desc innolux_g121i1_l01 = {
  865. .timings = &innolux_g121i1_l01_timing,
  866. .num_timings = 1,
  867. .bpc = 6,
  868. .size = {
  869. .width = 261,
  870. .height = 163,
  871. },
  872. .delay = {
  873. .enable = 200,
  874. .disable = 20,
  875. },
  876. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  877. };
  878. static const struct drm_display_mode innolux_g121x1_l03_mode = {
  879. .clock = 65000,
  880. .hdisplay = 1024,
  881. .hsync_start = 1024 + 0,
  882. .hsync_end = 1024 + 1,
  883. .htotal = 1024 + 0 + 1 + 320,
  884. .vdisplay = 768,
  885. .vsync_start = 768 + 38,
  886. .vsync_end = 768 + 38 + 1,
  887. .vtotal = 768 + 38 + 1 + 0,
  888. .vrefresh = 60,
  889. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  890. };
  891. static const struct panel_desc innolux_g121x1_l03 = {
  892. .modes = &innolux_g121x1_l03_mode,
  893. .num_modes = 1,
  894. .bpc = 6,
  895. .size = {
  896. .width = 246,
  897. .height = 185,
  898. },
  899. .delay = {
  900. .enable = 200,
  901. .unprepare = 200,
  902. .disable = 400,
  903. },
  904. };
  905. static const struct drm_display_mode innolux_n116bge_mode = {
  906. .clock = 76420,
  907. .hdisplay = 1366,
  908. .hsync_start = 1366 + 136,
  909. .hsync_end = 1366 + 136 + 30,
  910. .htotal = 1366 + 136 + 30 + 60,
  911. .vdisplay = 768,
  912. .vsync_start = 768 + 8,
  913. .vsync_end = 768 + 8 + 12,
  914. .vtotal = 768 + 8 + 12 + 12,
  915. .vrefresh = 60,
  916. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  917. };
  918. static const struct panel_desc innolux_n116bge = {
  919. .modes = &innolux_n116bge_mode,
  920. .num_modes = 1,
  921. .bpc = 6,
  922. .size = {
  923. .width = 256,
  924. .height = 144,
  925. },
  926. };
  927. static const struct drm_display_mode innolux_n156bge_l21_mode = {
  928. .clock = 69300,
  929. .hdisplay = 1366,
  930. .hsync_start = 1366 + 16,
  931. .hsync_end = 1366 + 16 + 34,
  932. .htotal = 1366 + 16 + 34 + 50,
  933. .vdisplay = 768,
  934. .vsync_start = 768 + 2,
  935. .vsync_end = 768 + 2 + 6,
  936. .vtotal = 768 + 2 + 6 + 12,
  937. .vrefresh = 60,
  938. };
  939. static const struct panel_desc innolux_n156bge_l21 = {
  940. .modes = &innolux_n156bge_l21_mode,
  941. .num_modes = 1,
  942. .bpc = 6,
  943. .size = {
  944. .width = 344,
  945. .height = 193,
  946. },
  947. };
  948. static const struct drm_display_mode innolux_zj070na_01p_mode = {
  949. .clock = 51501,
  950. .hdisplay = 1024,
  951. .hsync_start = 1024 + 128,
  952. .hsync_end = 1024 + 128 + 64,
  953. .htotal = 1024 + 128 + 64 + 128,
  954. .vdisplay = 600,
  955. .vsync_start = 600 + 16,
  956. .vsync_end = 600 + 16 + 4,
  957. .vtotal = 600 + 16 + 4 + 16,
  958. .vrefresh = 60,
  959. };
  960. static const struct panel_desc innolux_zj070na_01p = {
  961. .modes = &innolux_zj070na_01p_mode,
  962. .num_modes = 1,
  963. .bpc = 6,
  964. .size = {
  965. .width = 154,
  966. .height = 90,
  967. },
  968. };
  969. static const struct display_timing kyo_tcg121xglp_timing = {
  970. .pixelclock = { 52000000, 65000000, 71000000 },
  971. .hactive = { 1024, 1024, 1024 },
  972. .hfront_porch = { 2, 2, 2 },
  973. .hback_porch = { 2, 2, 2 },
  974. .hsync_len = { 86, 124, 244 },
  975. .vactive = { 768, 768, 768 },
  976. .vfront_porch = { 2, 2, 2 },
  977. .vback_porch = { 2, 2, 2 },
  978. .vsync_len = { 6, 34, 73 },
  979. .flags = DISPLAY_FLAGS_DE_HIGH,
  980. };
  981. static const struct panel_desc kyo_tcg121xglp = {
  982. .timings = &kyo_tcg121xglp_timing,
  983. .num_timings = 1,
  984. .bpc = 8,
  985. .size = {
  986. .width = 246,
  987. .height = 184,
  988. },
  989. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  990. };
  991. static const struct drm_display_mode lg_lb070wv8_mode = {
  992. .clock = 33246,
  993. .hdisplay = 800,
  994. .hsync_start = 800 + 88,
  995. .hsync_end = 800 + 88 + 80,
  996. .htotal = 800 + 88 + 80 + 88,
  997. .vdisplay = 480,
  998. .vsync_start = 480 + 10,
  999. .vsync_end = 480 + 10 + 25,
  1000. .vtotal = 480 + 10 + 25 + 10,
  1001. .vrefresh = 60,
  1002. };
  1003. static const struct panel_desc lg_lb070wv8 = {
  1004. .modes = &lg_lb070wv8_mode,
  1005. .num_modes = 1,
  1006. .bpc = 16,
  1007. .size = {
  1008. .width = 151,
  1009. .height = 91,
  1010. },
  1011. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1012. };
  1013. static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
  1014. .clock = 200000,
  1015. .hdisplay = 1536,
  1016. .hsync_start = 1536 + 12,
  1017. .hsync_end = 1536 + 12 + 16,
  1018. .htotal = 1536 + 12 + 16 + 48,
  1019. .vdisplay = 2048,
  1020. .vsync_start = 2048 + 8,
  1021. .vsync_end = 2048 + 8 + 4,
  1022. .vtotal = 2048 + 8 + 4 + 8,
  1023. .vrefresh = 60,
  1024. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1025. };
  1026. static const struct panel_desc lg_lp079qx1_sp0v = {
  1027. .modes = &lg_lp079qx1_sp0v_mode,
  1028. .num_modes = 1,
  1029. .size = {
  1030. .width = 129,
  1031. .height = 171,
  1032. },
  1033. };
  1034. static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
  1035. .clock = 205210,
  1036. .hdisplay = 2048,
  1037. .hsync_start = 2048 + 150,
  1038. .hsync_end = 2048 + 150 + 5,
  1039. .htotal = 2048 + 150 + 5 + 5,
  1040. .vdisplay = 1536,
  1041. .vsync_start = 1536 + 3,
  1042. .vsync_end = 1536 + 3 + 1,
  1043. .vtotal = 1536 + 3 + 1 + 9,
  1044. .vrefresh = 60,
  1045. };
  1046. static const struct panel_desc lg_lp097qx1_spa1 = {
  1047. .modes = &lg_lp097qx1_spa1_mode,
  1048. .num_modes = 1,
  1049. .size = {
  1050. .width = 208,
  1051. .height = 147,
  1052. },
  1053. };
  1054. static const struct drm_display_mode lg_lp120up1_mode = {
  1055. .clock = 162300,
  1056. .hdisplay = 1920,
  1057. .hsync_start = 1920 + 40,
  1058. .hsync_end = 1920 + 40 + 40,
  1059. .htotal = 1920 + 40 + 40+ 80,
  1060. .vdisplay = 1280,
  1061. .vsync_start = 1280 + 4,
  1062. .vsync_end = 1280 + 4 + 4,
  1063. .vtotal = 1280 + 4 + 4 + 12,
  1064. .vrefresh = 60,
  1065. };
  1066. static const struct panel_desc lg_lp120up1 = {
  1067. .modes = &lg_lp120up1_mode,
  1068. .num_modes = 1,
  1069. .bpc = 8,
  1070. .size = {
  1071. .width = 267,
  1072. .height = 183,
  1073. },
  1074. };
  1075. static const struct drm_display_mode lg_lp129qe_mode = {
  1076. .clock = 285250,
  1077. .hdisplay = 2560,
  1078. .hsync_start = 2560 + 48,
  1079. .hsync_end = 2560 + 48 + 32,
  1080. .htotal = 2560 + 48 + 32 + 80,
  1081. .vdisplay = 1700,
  1082. .vsync_start = 1700 + 3,
  1083. .vsync_end = 1700 + 3 + 10,
  1084. .vtotal = 1700 + 3 + 10 + 36,
  1085. .vrefresh = 60,
  1086. };
  1087. static const struct panel_desc lg_lp129qe = {
  1088. .modes = &lg_lp129qe_mode,
  1089. .num_modes = 1,
  1090. .bpc = 8,
  1091. .size = {
  1092. .width = 272,
  1093. .height = 181,
  1094. },
  1095. };
  1096. static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
  1097. .clock = 10870,
  1098. .hdisplay = 480,
  1099. .hsync_start = 480 + 2,
  1100. .hsync_end = 480 + 2 + 41,
  1101. .htotal = 480 + 2 + 41 + 2,
  1102. .vdisplay = 272,
  1103. .vsync_start = 272 + 2,
  1104. .vsync_end = 272 + 2 + 4,
  1105. .vtotal = 272 + 2 + 4 + 2,
  1106. .vrefresh = 74,
  1107. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1108. };
  1109. static const struct panel_desc nec_nl4827hc19_05b = {
  1110. .modes = &nec_nl4827hc19_05b_mode,
  1111. .num_modes = 1,
  1112. .bpc = 8,
  1113. .size = {
  1114. .width = 95,
  1115. .height = 54,
  1116. },
  1117. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1118. .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1119. };
  1120. static const struct drm_display_mode nvd_9128_mode = {
  1121. .clock = 29500,
  1122. .hdisplay = 800,
  1123. .hsync_start = 800 + 130,
  1124. .hsync_end = 800 + 130 + 98,
  1125. .htotal = 800 + 0 + 130 + 98,
  1126. .vdisplay = 480,
  1127. .vsync_start = 480 + 10,
  1128. .vsync_end = 480 + 10 + 50,
  1129. .vtotal = 480 + 0 + 10 + 50,
  1130. };
  1131. static const struct panel_desc nvd_9128 = {
  1132. .modes = &nvd_9128_mode,
  1133. .num_modes = 1,
  1134. .bpc = 8,
  1135. .size = {
  1136. .width = 156,
  1137. .height = 88,
  1138. },
  1139. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1140. };
  1141. static const struct display_timing okaya_rs800480t_7x0gp_timing = {
  1142. .pixelclock = { 30000000, 30000000, 40000000 },
  1143. .hactive = { 800, 800, 800 },
  1144. .hfront_porch = { 40, 40, 40 },
  1145. .hback_porch = { 40, 40, 40 },
  1146. .hsync_len = { 1, 48, 48 },
  1147. .vactive = { 480, 480, 480 },
  1148. .vfront_porch = { 13, 13, 13 },
  1149. .vback_porch = { 29, 29, 29 },
  1150. .vsync_len = { 3, 3, 3 },
  1151. .flags = DISPLAY_FLAGS_DE_HIGH,
  1152. };
  1153. static const struct panel_desc okaya_rs800480t_7x0gp = {
  1154. .timings = &okaya_rs800480t_7x0gp_timing,
  1155. .num_timings = 1,
  1156. .bpc = 6,
  1157. .size = {
  1158. .width = 154,
  1159. .height = 87,
  1160. },
  1161. .delay = {
  1162. .prepare = 41,
  1163. .enable = 50,
  1164. .unprepare = 41,
  1165. .disable = 50,
  1166. },
  1167. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1168. };
  1169. static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
  1170. .clock = 9000,
  1171. .hdisplay = 480,
  1172. .hsync_start = 480 + 5,
  1173. .hsync_end = 480 + 5 + 30,
  1174. .htotal = 480 + 5 + 30 + 10,
  1175. .vdisplay = 272,
  1176. .vsync_start = 272 + 8,
  1177. .vsync_end = 272 + 8 + 5,
  1178. .vtotal = 272 + 8 + 5 + 3,
  1179. .vrefresh = 60,
  1180. };
  1181. static const struct panel_desc olimex_lcd_olinuxino_43ts = {
  1182. .modes = &olimex_lcd_olinuxino_43ts_mode,
  1183. .num_modes = 1,
  1184. .size = {
  1185. .width = 105,
  1186. .height = 67,
  1187. },
  1188. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1189. };
  1190. /*
  1191. * 800x480 CVT. The panel appears to be quite accepting, at least as far as
  1192. * pixel clocks, but this is the timing that was being used in the Adafruit
  1193. * installation instructions.
  1194. */
  1195. static const struct drm_display_mode ontat_yx700wv03_mode = {
  1196. .clock = 29500,
  1197. .hdisplay = 800,
  1198. .hsync_start = 824,
  1199. .hsync_end = 896,
  1200. .htotal = 992,
  1201. .vdisplay = 480,
  1202. .vsync_start = 483,
  1203. .vsync_end = 493,
  1204. .vtotal = 500,
  1205. .vrefresh = 60,
  1206. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1207. };
  1208. /*
  1209. * Specification at:
  1210. * https://www.adafruit.com/images/product-files/2406/c3163.pdf
  1211. */
  1212. static const struct panel_desc ontat_yx700wv03 = {
  1213. .modes = &ontat_yx700wv03_mode,
  1214. .num_modes = 1,
  1215. .bpc = 8,
  1216. .size = {
  1217. .width = 154,
  1218. .height = 83,
  1219. },
  1220. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1221. };
  1222. static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
  1223. .clock = 25000,
  1224. .hdisplay = 480,
  1225. .hsync_start = 480 + 10,
  1226. .hsync_end = 480 + 10 + 10,
  1227. .htotal = 480 + 10 + 10 + 15,
  1228. .vdisplay = 800,
  1229. .vsync_start = 800 + 3,
  1230. .vsync_end = 800 + 3 + 3,
  1231. .vtotal = 800 + 3 + 3 + 3,
  1232. .vrefresh = 60,
  1233. };
  1234. static const struct panel_desc ortustech_com43h4m85ulc = {
  1235. .modes = &ortustech_com43h4m85ulc_mode,
  1236. .num_modes = 1,
  1237. .bpc = 8,
  1238. .size = {
  1239. .width = 56,
  1240. .height = 93,
  1241. },
  1242. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1243. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1244. };
  1245. static const struct drm_display_mode qd43003c0_40_mode = {
  1246. .clock = 9000,
  1247. .hdisplay = 480,
  1248. .hsync_start = 480 + 8,
  1249. .hsync_end = 480 + 8 + 4,
  1250. .htotal = 480 + 8 + 4 + 39,
  1251. .vdisplay = 272,
  1252. .vsync_start = 272 + 4,
  1253. .vsync_end = 272 + 4 + 10,
  1254. .vtotal = 272 + 4 + 10 + 2,
  1255. .vrefresh = 60,
  1256. };
  1257. static const struct panel_desc qd43003c0_40 = {
  1258. .modes = &qd43003c0_40_mode,
  1259. .num_modes = 1,
  1260. .bpc = 8,
  1261. .size = {
  1262. .width = 95,
  1263. .height = 53,
  1264. },
  1265. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1266. };
  1267. static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
  1268. .clock = 271560,
  1269. .hdisplay = 2560,
  1270. .hsync_start = 2560 + 48,
  1271. .hsync_end = 2560 + 48 + 32,
  1272. .htotal = 2560 + 48 + 32 + 80,
  1273. .vdisplay = 1600,
  1274. .vsync_start = 1600 + 2,
  1275. .vsync_end = 1600 + 2 + 5,
  1276. .vtotal = 1600 + 2 + 5 + 57,
  1277. .vrefresh = 60,
  1278. };
  1279. static const struct panel_desc samsung_lsn122dl01_c01 = {
  1280. .modes = &samsung_lsn122dl01_c01_mode,
  1281. .num_modes = 1,
  1282. .size = {
  1283. .width = 263,
  1284. .height = 164,
  1285. },
  1286. };
  1287. static const struct drm_display_mode samsung_ltn101nt05_mode = {
  1288. .clock = 54030,
  1289. .hdisplay = 1024,
  1290. .hsync_start = 1024 + 24,
  1291. .hsync_end = 1024 + 24 + 136,
  1292. .htotal = 1024 + 24 + 136 + 160,
  1293. .vdisplay = 600,
  1294. .vsync_start = 600 + 3,
  1295. .vsync_end = 600 + 3 + 6,
  1296. .vtotal = 600 + 3 + 6 + 61,
  1297. .vrefresh = 60,
  1298. };
  1299. static const struct panel_desc samsung_ltn101nt05 = {
  1300. .modes = &samsung_ltn101nt05_mode,
  1301. .num_modes = 1,
  1302. .bpc = 6,
  1303. .size = {
  1304. .width = 223,
  1305. .height = 125,
  1306. },
  1307. };
  1308. static const struct drm_display_mode samsung_ltn140at29_301_mode = {
  1309. .clock = 76300,
  1310. .hdisplay = 1366,
  1311. .hsync_start = 1366 + 64,
  1312. .hsync_end = 1366 + 64 + 48,
  1313. .htotal = 1366 + 64 + 48 + 128,
  1314. .vdisplay = 768,
  1315. .vsync_start = 768 + 2,
  1316. .vsync_end = 768 + 2 + 5,
  1317. .vtotal = 768 + 2 + 5 + 17,
  1318. .vrefresh = 60,
  1319. };
  1320. static const struct panel_desc samsung_ltn140at29_301 = {
  1321. .modes = &samsung_ltn140at29_301_mode,
  1322. .num_modes = 1,
  1323. .bpc = 6,
  1324. .size = {
  1325. .width = 320,
  1326. .height = 187,
  1327. },
  1328. };
  1329. static const struct display_timing sharp_lq101k1ly04_timing = {
  1330. .pixelclock = { 60000000, 65000000, 80000000 },
  1331. .hactive = { 1280, 1280, 1280 },
  1332. .hfront_porch = { 20, 20, 20 },
  1333. .hback_porch = { 20, 20, 20 },
  1334. .hsync_len = { 10, 10, 10 },
  1335. .vactive = { 800, 800, 800 },
  1336. .vfront_porch = { 4, 4, 4 },
  1337. .vback_porch = { 4, 4, 4 },
  1338. .vsync_len = { 4, 4, 4 },
  1339. .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
  1340. };
  1341. static const struct panel_desc sharp_lq101k1ly04 = {
  1342. .timings = &sharp_lq101k1ly04_timing,
  1343. .num_timings = 1,
  1344. .bpc = 8,
  1345. .size = {
  1346. .width = 217,
  1347. .height = 136,
  1348. },
  1349. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
  1350. };
  1351. static const struct drm_display_mode sharp_lq123p1jx31_mode = {
  1352. .clock = 252750,
  1353. .hdisplay = 2400,
  1354. .hsync_start = 2400 + 48,
  1355. .hsync_end = 2400 + 48 + 32,
  1356. .htotal = 2400 + 48 + 32 + 80,
  1357. .vdisplay = 1600,
  1358. .vsync_start = 1600 + 3,
  1359. .vsync_end = 1600 + 3 + 10,
  1360. .vtotal = 1600 + 3 + 10 + 33,
  1361. .vrefresh = 60,
  1362. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1363. };
  1364. static const struct panel_desc sharp_lq123p1jx31 = {
  1365. .modes = &sharp_lq123p1jx31_mode,
  1366. .num_modes = 1,
  1367. .bpc = 8,
  1368. .size = {
  1369. .width = 259,
  1370. .height = 173,
  1371. },
  1372. .delay = {
  1373. .prepare = 110,
  1374. .enable = 50,
  1375. .unprepare = 550,
  1376. },
  1377. };
  1378. static const struct drm_display_mode sharp_lq150x1lg11_mode = {
  1379. .clock = 71100,
  1380. .hdisplay = 1024,
  1381. .hsync_start = 1024 + 168,
  1382. .hsync_end = 1024 + 168 + 64,
  1383. .htotal = 1024 + 168 + 64 + 88,
  1384. .vdisplay = 768,
  1385. .vsync_start = 768 + 37,
  1386. .vsync_end = 768 + 37 + 2,
  1387. .vtotal = 768 + 37 + 2 + 8,
  1388. .vrefresh = 60,
  1389. };
  1390. static const struct panel_desc sharp_lq150x1lg11 = {
  1391. .modes = &sharp_lq150x1lg11_mode,
  1392. .num_modes = 1,
  1393. .bpc = 6,
  1394. .size = {
  1395. .width = 304,
  1396. .height = 228,
  1397. },
  1398. .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
  1399. };
  1400. static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
  1401. .clock = 33300,
  1402. .hdisplay = 800,
  1403. .hsync_start = 800 + 1,
  1404. .hsync_end = 800 + 1 + 64,
  1405. .htotal = 800 + 1 + 64 + 64,
  1406. .vdisplay = 480,
  1407. .vsync_start = 480 + 1,
  1408. .vsync_end = 480 + 1 + 23,
  1409. .vtotal = 480 + 1 + 23 + 22,
  1410. .vrefresh = 60,
  1411. };
  1412. static const struct panel_desc shelly_sca07010_bfn_lnn = {
  1413. .modes = &shelly_sca07010_bfn_lnn_mode,
  1414. .num_modes = 1,
  1415. .size = {
  1416. .width = 152,
  1417. .height = 91,
  1418. },
  1419. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1420. };
  1421. static const struct drm_display_mode starry_kr122ea0sra_mode = {
  1422. .clock = 147000,
  1423. .hdisplay = 1920,
  1424. .hsync_start = 1920 + 16,
  1425. .hsync_end = 1920 + 16 + 16,
  1426. .htotal = 1920 + 16 + 16 + 32,
  1427. .vdisplay = 1200,
  1428. .vsync_start = 1200 + 15,
  1429. .vsync_end = 1200 + 15 + 2,
  1430. .vtotal = 1200 + 15 + 2 + 18,
  1431. .vrefresh = 60,
  1432. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1433. };
  1434. static const struct panel_desc starry_kr122ea0sra = {
  1435. .modes = &starry_kr122ea0sra_mode,
  1436. .num_modes = 1,
  1437. .size = {
  1438. .width = 263,
  1439. .height = 164,
  1440. },
  1441. .delay = {
  1442. .prepare = 10 + 200,
  1443. .enable = 50,
  1444. .unprepare = 10 + 500,
  1445. },
  1446. };
  1447. static const struct drm_display_mode tpk_f07a_0102_mode = {
  1448. .clock = 33260,
  1449. .hdisplay = 800,
  1450. .hsync_start = 800 + 40,
  1451. .hsync_end = 800 + 40 + 128,
  1452. .htotal = 800 + 40 + 128 + 88,
  1453. .vdisplay = 480,
  1454. .vsync_start = 480 + 10,
  1455. .vsync_end = 480 + 10 + 2,
  1456. .vtotal = 480 + 10 + 2 + 33,
  1457. .vrefresh = 60,
  1458. };
  1459. static const struct panel_desc tpk_f07a_0102 = {
  1460. .modes = &tpk_f07a_0102_mode,
  1461. .num_modes = 1,
  1462. .size = {
  1463. .width = 152,
  1464. .height = 91,
  1465. },
  1466. .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1467. };
  1468. static const struct drm_display_mode tpk_f10a_0102_mode = {
  1469. .clock = 45000,
  1470. .hdisplay = 1024,
  1471. .hsync_start = 1024 + 176,
  1472. .hsync_end = 1024 + 176 + 5,
  1473. .htotal = 1024 + 176 + 5 + 88,
  1474. .vdisplay = 600,
  1475. .vsync_start = 600 + 20,
  1476. .vsync_end = 600 + 20 + 5,
  1477. .vtotal = 600 + 20 + 5 + 25,
  1478. .vrefresh = 60,
  1479. };
  1480. static const struct panel_desc tpk_f10a_0102 = {
  1481. .modes = &tpk_f10a_0102_mode,
  1482. .num_modes = 1,
  1483. .size = {
  1484. .width = 223,
  1485. .height = 125,
  1486. },
  1487. };
  1488. static const struct display_timing urt_umsh_8596md_timing = {
  1489. .pixelclock = { 33260000, 33260000, 33260000 },
  1490. .hactive = { 800, 800, 800 },
  1491. .hfront_porch = { 41, 41, 41 },
  1492. .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
  1493. .hsync_len = { 71, 128, 128 },
  1494. .vactive = { 480, 480, 480 },
  1495. .vfront_porch = { 10, 10, 10 },
  1496. .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
  1497. .vsync_len = { 2, 2, 2 },
  1498. .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
  1499. DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
  1500. };
  1501. static const struct panel_desc urt_umsh_8596md_lvds = {
  1502. .timings = &urt_umsh_8596md_timing,
  1503. .num_timings = 1,
  1504. .bpc = 6,
  1505. .size = {
  1506. .width = 152,
  1507. .height = 91,
  1508. },
  1509. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  1510. };
  1511. static const struct panel_desc urt_umsh_8596md_parallel = {
  1512. .timings = &urt_umsh_8596md_timing,
  1513. .num_timings = 1,
  1514. .bpc = 6,
  1515. .size = {
  1516. .width = 152,
  1517. .height = 91,
  1518. },
  1519. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1520. };
  1521. static const struct of_device_id platform_of_match[] = {
  1522. {
  1523. .compatible = "ampire,am800480r3tmqwa1h",
  1524. .data = &ampire_am800480r3tmqwa1h,
  1525. }, {
  1526. .compatible = "auo,b101aw03",
  1527. .data = &auo_b101aw03,
  1528. }, {
  1529. .compatible = "auo,b101ean01",
  1530. .data = &auo_b101ean01,
  1531. }, {
  1532. .compatible = "auo,b101xtn01",
  1533. .data = &auo_b101xtn01,
  1534. }, {
  1535. .compatible = "auo,b116xw03",
  1536. .data = &auo_b116xw03,
  1537. }, {
  1538. .compatible = "auo,b133htn01",
  1539. .data = &auo_b133htn01,
  1540. }, {
  1541. .compatible = "auo,b133xtn01",
  1542. .data = &auo_b133xtn01,
  1543. }, {
  1544. .compatible = "auo,g133han01",
  1545. .data = &auo_g133han01,
  1546. }, {
  1547. .compatible = "auo,g185han01",
  1548. .data = &auo_g185han01,
  1549. }, {
  1550. .compatible = "auo,t215hvn01",
  1551. .data = &auo_t215hvn01,
  1552. }, {
  1553. .compatible = "avic,tm070ddh03",
  1554. .data = &avic_tm070ddh03,
  1555. }, {
  1556. .compatible = "chunghwa,claa070wp03xg",
  1557. .data = &chunghwa_claa070wp03xg,
  1558. }, {
  1559. .compatible = "chunghwa,claa101wa01a",
  1560. .data = &chunghwa_claa101wa01a
  1561. }, {
  1562. .compatible = "chunghwa,claa101wb01",
  1563. .data = &chunghwa_claa101wb01
  1564. }, {
  1565. .compatible = "edt,et057090dhu",
  1566. .data = &edt_et057090dhu,
  1567. }, {
  1568. .compatible = "edt,et070080dh6",
  1569. .data = &edt_etm0700g0dh6,
  1570. }, {
  1571. .compatible = "edt,etm0700g0dh6",
  1572. .data = &edt_etm0700g0dh6,
  1573. }, {
  1574. .compatible = "foxlink,fl500wvr00-a0t",
  1575. .data = &foxlink_fl500wvr00_a0t,
  1576. }, {
  1577. .compatible = "giantplus,gpg482739qs5",
  1578. .data = &giantplus_gpg482739qs5
  1579. }, {
  1580. .compatible = "hannstar,hsd070pww1",
  1581. .data = &hannstar_hsd070pww1,
  1582. }, {
  1583. .compatible = "hannstar,hsd100pxn1",
  1584. .data = &hannstar_hsd100pxn1,
  1585. }, {
  1586. .compatible = "hit,tx23d38vm0caa",
  1587. .data = &hitachi_tx23d38vm0caa
  1588. }, {
  1589. .compatible = "innolux,at043tn24",
  1590. .data = &innolux_at043tn24,
  1591. }, {
  1592. .compatible = "innolux,at070tn92",
  1593. .data = &innolux_at070tn92,
  1594. }, {
  1595. .compatible ="innolux,g101ice-l01",
  1596. .data = &innolux_g101ice_l01
  1597. }, {
  1598. .compatible ="innolux,g121i1-l01",
  1599. .data = &innolux_g121i1_l01
  1600. }, {
  1601. .compatible = "innolux,g121x1-l03",
  1602. .data = &innolux_g121x1_l03,
  1603. }, {
  1604. .compatible = "innolux,n116bge",
  1605. .data = &innolux_n116bge,
  1606. }, {
  1607. .compatible = "innolux,n156bge-l21",
  1608. .data = &innolux_n156bge_l21,
  1609. }, {
  1610. .compatible = "innolux,zj070na-01p",
  1611. .data = &innolux_zj070na_01p,
  1612. }, {
  1613. .compatible = "kyo,tcg121xglp",
  1614. .data = &kyo_tcg121xglp,
  1615. }, {
  1616. .compatible = "lg,lb070wv8",
  1617. .data = &lg_lb070wv8,
  1618. }, {
  1619. .compatible = "lg,lp079qx1-sp0v",
  1620. .data = &lg_lp079qx1_sp0v,
  1621. }, {
  1622. .compatible = "lg,lp097qx1-spa1",
  1623. .data = &lg_lp097qx1_spa1,
  1624. }, {
  1625. .compatible = "lg,lp120up1",
  1626. .data = &lg_lp120up1,
  1627. }, {
  1628. .compatible = "lg,lp129qe",
  1629. .data = &lg_lp129qe,
  1630. }, {
  1631. .compatible = "nec,nl4827hc19-05b",
  1632. .data = &nec_nl4827hc19_05b,
  1633. }, {
  1634. .compatible = "nvd,9128",
  1635. .data = &nvd_9128,
  1636. }, {
  1637. .compatible = "okaya,rs800480t-7x0gp",
  1638. .data = &okaya_rs800480t_7x0gp,
  1639. }, {
  1640. .compatible = "olimex,lcd-olinuxino-43-ts",
  1641. .data = &olimex_lcd_olinuxino_43ts,
  1642. }, {
  1643. .compatible = "ontat,yx700wv03",
  1644. .data = &ontat_yx700wv03,
  1645. }, {
  1646. .compatible = "ortustech,com43h4m85ulc",
  1647. .data = &ortustech_com43h4m85ulc,
  1648. }, {
  1649. .compatible = "qiaodian,qd43003c0-40",
  1650. .data = &qd43003c0_40,
  1651. }, {
  1652. .compatible = "samsung,lsn122dl01-c01",
  1653. .data = &samsung_lsn122dl01_c01,
  1654. }, {
  1655. .compatible = "samsung,ltn101nt05",
  1656. .data = &samsung_ltn101nt05,
  1657. }, {
  1658. .compatible = "samsung,ltn140at29-301",
  1659. .data = &samsung_ltn140at29_301,
  1660. }, {
  1661. .compatible = "sharp,lq101k1ly04",
  1662. .data = &sharp_lq101k1ly04,
  1663. }, {
  1664. .compatible = "sharp,lq123p1jx31",
  1665. .data = &sharp_lq123p1jx31,
  1666. }, {
  1667. .compatible = "sharp,lq150x1lg11",
  1668. .data = &sharp_lq150x1lg11,
  1669. }, {
  1670. .compatible = "shelly,sca07010-bfn-lnn",
  1671. .data = &shelly_sca07010_bfn_lnn,
  1672. }, {
  1673. .compatible = "starry,kr122ea0sra",
  1674. .data = &starry_kr122ea0sra,
  1675. }, {
  1676. .compatible = "tpk,f07a-0102",
  1677. .data = &tpk_f07a_0102,
  1678. }, {
  1679. .compatible = "tpk,f10a-0102",
  1680. .data = &tpk_f10a_0102,
  1681. }, {
  1682. .compatible = "urt,umsh-8596md-t",
  1683. .data = &urt_umsh_8596md_parallel,
  1684. }, {
  1685. .compatible = "urt,umsh-8596md-1t",
  1686. .data = &urt_umsh_8596md_parallel,
  1687. }, {
  1688. .compatible = "urt,umsh-8596md-7t",
  1689. .data = &urt_umsh_8596md_parallel,
  1690. }, {
  1691. .compatible = "urt,umsh-8596md-11t",
  1692. .data = &urt_umsh_8596md_lvds,
  1693. }, {
  1694. .compatible = "urt,umsh-8596md-19t",
  1695. .data = &urt_umsh_8596md_lvds,
  1696. }, {
  1697. .compatible = "urt,umsh-8596md-20t",
  1698. .data = &urt_umsh_8596md_parallel,
  1699. }, {
  1700. /* sentinel */
  1701. }
  1702. };
  1703. MODULE_DEVICE_TABLE(of, platform_of_match);
  1704. static int panel_simple_platform_probe(struct platform_device *pdev)
  1705. {
  1706. const struct of_device_id *id;
  1707. id = of_match_node(platform_of_match, pdev->dev.of_node);
  1708. if (!id)
  1709. return -ENODEV;
  1710. return panel_simple_probe(&pdev->dev, id->data);
  1711. }
  1712. static int panel_simple_platform_remove(struct platform_device *pdev)
  1713. {
  1714. return panel_simple_remove(&pdev->dev);
  1715. }
  1716. static void panel_simple_platform_shutdown(struct platform_device *pdev)
  1717. {
  1718. panel_simple_shutdown(&pdev->dev);
  1719. }
  1720. static struct platform_driver panel_simple_platform_driver = {
  1721. .driver = {
  1722. .name = "panel-simple",
  1723. .of_match_table = platform_of_match,
  1724. },
  1725. .probe = panel_simple_platform_probe,
  1726. .remove = panel_simple_platform_remove,
  1727. .shutdown = panel_simple_platform_shutdown,
  1728. };
  1729. struct panel_desc_dsi {
  1730. struct panel_desc desc;
  1731. unsigned long flags;
  1732. enum mipi_dsi_pixel_format format;
  1733. unsigned int lanes;
  1734. };
  1735. static const struct drm_display_mode auo_b080uan01_mode = {
  1736. .clock = 154500,
  1737. .hdisplay = 1200,
  1738. .hsync_start = 1200 + 62,
  1739. .hsync_end = 1200 + 62 + 4,
  1740. .htotal = 1200 + 62 + 4 + 62,
  1741. .vdisplay = 1920,
  1742. .vsync_start = 1920 + 9,
  1743. .vsync_end = 1920 + 9 + 2,
  1744. .vtotal = 1920 + 9 + 2 + 8,
  1745. .vrefresh = 60,
  1746. };
  1747. static const struct panel_desc_dsi auo_b080uan01 = {
  1748. .desc = {
  1749. .modes = &auo_b080uan01_mode,
  1750. .num_modes = 1,
  1751. .bpc = 8,
  1752. .size = {
  1753. .width = 108,
  1754. .height = 272,
  1755. },
  1756. },
  1757. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
  1758. .format = MIPI_DSI_FMT_RGB888,
  1759. .lanes = 4,
  1760. };
  1761. static const struct drm_display_mode boe_tv080wum_nl0_mode = {
  1762. .clock = 160000,
  1763. .hdisplay = 1200,
  1764. .hsync_start = 1200 + 120,
  1765. .hsync_end = 1200 + 120 + 20,
  1766. .htotal = 1200 + 120 + 20 + 21,
  1767. .vdisplay = 1920,
  1768. .vsync_start = 1920 + 21,
  1769. .vsync_end = 1920 + 21 + 3,
  1770. .vtotal = 1920 + 21 + 3 + 18,
  1771. .vrefresh = 60,
  1772. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1773. };
  1774. static const struct panel_desc_dsi boe_tv080wum_nl0 = {
  1775. .desc = {
  1776. .modes = &boe_tv080wum_nl0_mode,
  1777. .num_modes = 1,
  1778. .size = {
  1779. .width = 107,
  1780. .height = 172,
  1781. },
  1782. },
  1783. .flags = MIPI_DSI_MODE_VIDEO |
  1784. MIPI_DSI_MODE_VIDEO_BURST |
  1785. MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
  1786. .format = MIPI_DSI_FMT_RGB888,
  1787. .lanes = 4,
  1788. };
  1789. static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
  1790. .clock = 71000,
  1791. .hdisplay = 800,
  1792. .hsync_start = 800 + 32,
  1793. .hsync_end = 800 + 32 + 1,
  1794. .htotal = 800 + 32 + 1 + 57,
  1795. .vdisplay = 1280,
  1796. .vsync_start = 1280 + 28,
  1797. .vsync_end = 1280 + 28 + 1,
  1798. .vtotal = 1280 + 28 + 1 + 14,
  1799. .vrefresh = 60,
  1800. };
  1801. static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
  1802. .desc = {
  1803. .modes = &lg_ld070wx3_sl01_mode,
  1804. .num_modes = 1,
  1805. .bpc = 8,
  1806. .size = {
  1807. .width = 94,
  1808. .height = 151,
  1809. },
  1810. },
  1811. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
  1812. .format = MIPI_DSI_FMT_RGB888,
  1813. .lanes = 4,
  1814. };
  1815. static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
  1816. .clock = 67000,
  1817. .hdisplay = 720,
  1818. .hsync_start = 720 + 12,
  1819. .hsync_end = 720 + 12 + 4,
  1820. .htotal = 720 + 12 + 4 + 112,
  1821. .vdisplay = 1280,
  1822. .vsync_start = 1280 + 8,
  1823. .vsync_end = 1280 + 8 + 4,
  1824. .vtotal = 1280 + 8 + 4 + 12,
  1825. .vrefresh = 60,
  1826. };
  1827. static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
  1828. .desc = {
  1829. .modes = &lg_lh500wx1_sd03_mode,
  1830. .num_modes = 1,
  1831. .bpc = 8,
  1832. .size = {
  1833. .width = 62,
  1834. .height = 110,
  1835. },
  1836. },
  1837. .flags = MIPI_DSI_MODE_VIDEO,
  1838. .format = MIPI_DSI_FMT_RGB888,
  1839. .lanes = 4,
  1840. };
  1841. static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
  1842. .clock = 157200,
  1843. .hdisplay = 1920,
  1844. .hsync_start = 1920 + 154,
  1845. .hsync_end = 1920 + 154 + 16,
  1846. .htotal = 1920 + 154 + 16 + 32,
  1847. .vdisplay = 1200,
  1848. .vsync_start = 1200 + 17,
  1849. .vsync_end = 1200 + 17 + 2,
  1850. .vtotal = 1200 + 17 + 2 + 16,
  1851. .vrefresh = 60,
  1852. };
  1853. static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
  1854. .desc = {
  1855. .modes = &panasonic_vvx10f004b00_mode,
  1856. .num_modes = 1,
  1857. .bpc = 8,
  1858. .size = {
  1859. .width = 217,
  1860. .height = 136,
  1861. },
  1862. },
  1863. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
  1864. MIPI_DSI_CLOCK_NON_CONTINUOUS,
  1865. .format = MIPI_DSI_FMT_RGB888,
  1866. .lanes = 4,
  1867. };
  1868. static const struct of_device_id dsi_of_match[] = {
  1869. {
  1870. .compatible = "auo,b080uan01",
  1871. .data = &auo_b080uan01
  1872. }, {
  1873. .compatible = "boe,tv080wum-nl0",
  1874. .data = &boe_tv080wum_nl0
  1875. }, {
  1876. .compatible = "lg,ld070wx3-sl01",
  1877. .data = &lg_ld070wx3_sl01
  1878. }, {
  1879. .compatible = "lg,lh500wx1-sd03",
  1880. .data = &lg_lh500wx1_sd03
  1881. }, {
  1882. .compatible = "panasonic,vvx10f004b00",
  1883. .data = &panasonic_vvx10f004b00
  1884. }, {
  1885. /* sentinel */
  1886. }
  1887. };
  1888. MODULE_DEVICE_TABLE(of, dsi_of_match);
  1889. static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
  1890. {
  1891. const struct panel_desc_dsi *desc;
  1892. const struct of_device_id *id;
  1893. int err;
  1894. id = of_match_node(dsi_of_match, dsi->dev.of_node);
  1895. if (!id)
  1896. return -ENODEV;
  1897. desc = id->data;
  1898. err = panel_simple_probe(&dsi->dev, &desc->desc);
  1899. if (err < 0)
  1900. return err;
  1901. dsi->mode_flags = desc->flags;
  1902. dsi->format = desc->format;
  1903. dsi->lanes = desc->lanes;
  1904. return mipi_dsi_attach(dsi);
  1905. }
  1906. static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
  1907. {
  1908. int err;
  1909. err = mipi_dsi_detach(dsi);
  1910. if (err < 0)
  1911. dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
  1912. return panel_simple_remove(&dsi->dev);
  1913. }
  1914. static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
  1915. {
  1916. panel_simple_shutdown(&dsi->dev);
  1917. }
  1918. static struct mipi_dsi_driver panel_simple_dsi_driver = {
  1919. .driver = {
  1920. .name = "panel-simple-dsi",
  1921. .of_match_table = dsi_of_match,
  1922. },
  1923. .probe = panel_simple_dsi_probe,
  1924. .remove = panel_simple_dsi_remove,
  1925. .shutdown = panel_simple_dsi_shutdown,
  1926. };
  1927. static int __init panel_simple_init(void)
  1928. {
  1929. int err;
  1930. err = platform_driver_register(&panel_simple_platform_driver);
  1931. if (err < 0)
  1932. return err;
  1933. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
  1934. err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
  1935. if (err < 0)
  1936. return err;
  1937. }
  1938. return 0;
  1939. }
  1940. module_init(panel_simple_init);
  1941. static void __exit panel_simple_exit(void)
  1942. {
  1943. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
  1944. mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
  1945. platform_driver_unregister(&panel_simple_platform_driver);
  1946. }
  1947. module_exit(panel_simple_exit);
  1948. MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
  1949. MODULE_DESCRIPTION("DRM Driver for Simple Panels");
  1950. MODULE_LICENSE("GPL and additional rights");