panel-simple.c 52 KB

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