panel-simple.c 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603
  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. gpiod_set_value_cansleep(p->enable_gpio, 0);
  153. regulator_disable(p->supply);
  154. if (p->desc->delay.unprepare)
  155. msleep(p->desc->delay.unprepare);
  156. p->prepared = false;
  157. return 0;
  158. }
  159. static int panel_simple_prepare(struct drm_panel *panel)
  160. {
  161. struct panel_simple *p = to_panel_simple(panel);
  162. int err;
  163. if (p->prepared)
  164. return 0;
  165. err = regulator_enable(p->supply);
  166. if (err < 0) {
  167. dev_err(panel->dev, "failed to enable supply: %d\n", err);
  168. return err;
  169. }
  170. gpiod_set_value_cansleep(p->enable_gpio, 1);
  171. if (p->desc->delay.prepare)
  172. msleep(p->desc->delay.prepare);
  173. p->prepared = true;
  174. return 0;
  175. }
  176. static int panel_simple_enable(struct drm_panel *panel)
  177. {
  178. struct panel_simple *p = to_panel_simple(panel);
  179. if (p->enabled)
  180. return 0;
  181. if (p->desc->delay.enable)
  182. msleep(p->desc->delay.enable);
  183. if (p->backlight) {
  184. p->backlight->props.state &= ~BL_CORE_FBBLANK;
  185. p->backlight->props.power = FB_BLANK_UNBLANK;
  186. backlight_update_status(p->backlight);
  187. }
  188. p->enabled = true;
  189. return 0;
  190. }
  191. static int panel_simple_get_modes(struct drm_panel *panel)
  192. {
  193. struct panel_simple *p = to_panel_simple(panel);
  194. int num = 0;
  195. /* probe EDID if a DDC bus is available */
  196. if (p->ddc) {
  197. struct edid *edid = drm_get_edid(panel->connector, p->ddc);
  198. drm_mode_connector_update_edid_property(panel->connector, edid);
  199. if (edid) {
  200. num += drm_add_edid_modes(panel->connector, edid);
  201. kfree(edid);
  202. }
  203. }
  204. /* add hard-coded panel modes */
  205. num += panel_simple_get_fixed_modes(p);
  206. return num;
  207. }
  208. static int panel_simple_get_timings(struct drm_panel *panel,
  209. unsigned int num_timings,
  210. struct display_timing *timings)
  211. {
  212. struct panel_simple *p = to_panel_simple(panel);
  213. unsigned int i;
  214. if (p->desc->num_timings < num_timings)
  215. num_timings = p->desc->num_timings;
  216. if (timings)
  217. for (i = 0; i < num_timings; i++)
  218. timings[i] = p->desc->timings[i];
  219. return p->desc->num_timings;
  220. }
  221. static const struct drm_panel_funcs panel_simple_funcs = {
  222. .disable = panel_simple_disable,
  223. .unprepare = panel_simple_unprepare,
  224. .prepare = panel_simple_prepare,
  225. .enable = panel_simple_enable,
  226. .get_modes = panel_simple_get_modes,
  227. .get_timings = panel_simple_get_timings,
  228. };
  229. static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
  230. {
  231. struct device_node *backlight, *ddc;
  232. struct panel_simple *panel;
  233. int err;
  234. panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
  235. if (!panel)
  236. return -ENOMEM;
  237. panel->enabled = false;
  238. panel->prepared = false;
  239. panel->desc = desc;
  240. panel->supply = devm_regulator_get(dev, "power");
  241. if (IS_ERR(panel->supply))
  242. return PTR_ERR(panel->supply);
  243. panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
  244. GPIOD_OUT_LOW);
  245. if (IS_ERR(panel->enable_gpio)) {
  246. err = PTR_ERR(panel->enable_gpio);
  247. if (err != -EPROBE_DEFER)
  248. dev_err(dev, "failed to request GPIO: %d\n", err);
  249. return err;
  250. }
  251. backlight = of_parse_phandle(dev->of_node, "backlight", 0);
  252. if (backlight) {
  253. panel->backlight = of_find_backlight_by_node(backlight);
  254. of_node_put(backlight);
  255. if (!panel->backlight)
  256. return -EPROBE_DEFER;
  257. }
  258. ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
  259. if (ddc) {
  260. panel->ddc = of_find_i2c_adapter_by_node(ddc);
  261. of_node_put(ddc);
  262. if (!panel->ddc) {
  263. err = -EPROBE_DEFER;
  264. goto free_backlight;
  265. }
  266. }
  267. drm_panel_init(&panel->base);
  268. panel->base.dev = dev;
  269. panel->base.funcs = &panel_simple_funcs;
  270. err = drm_panel_add(&panel->base);
  271. if (err < 0)
  272. goto free_ddc;
  273. dev_set_drvdata(dev, panel);
  274. return 0;
  275. free_ddc:
  276. if (panel->ddc)
  277. put_device(&panel->ddc->dev);
  278. free_backlight:
  279. if (panel->backlight)
  280. put_device(&panel->backlight->dev);
  281. return err;
  282. }
  283. static int panel_simple_remove(struct device *dev)
  284. {
  285. struct panel_simple *panel = dev_get_drvdata(dev);
  286. drm_panel_remove(&panel->base);
  287. panel_simple_disable(&panel->base);
  288. panel_simple_unprepare(&panel->base);
  289. if (panel->ddc)
  290. put_device(&panel->ddc->dev);
  291. if (panel->backlight)
  292. put_device(&panel->backlight->dev);
  293. return 0;
  294. }
  295. static void panel_simple_shutdown(struct device *dev)
  296. {
  297. struct panel_simple *panel = dev_get_drvdata(dev);
  298. panel_simple_disable(&panel->base);
  299. panel_simple_unprepare(&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 drm_display_mode auo_g104sn02_mode = {
  480. .clock = 40000,
  481. .hdisplay = 800,
  482. .hsync_start = 800 + 40,
  483. .hsync_end = 800 + 40 + 216,
  484. .htotal = 800 + 40 + 216 + 128,
  485. .vdisplay = 600,
  486. .vsync_start = 600 + 10,
  487. .vsync_end = 600 + 10 + 35,
  488. .vtotal = 600 + 10 + 35 + 2,
  489. .vrefresh = 60,
  490. };
  491. static const struct panel_desc auo_g104sn02 = {
  492. .modes = &auo_g104sn02_mode,
  493. .num_modes = 1,
  494. .bpc = 8,
  495. .size = {
  496. .width = 211,
  497. .height = 158,
  498. },
  499. };
  500. static const struct display_timing auo_g133han01_timings = {
  501. .pixelclock = { 134000000, 141200000, 149000000 },
  502. .hactive = { 1920, 1920, 1920 },
  503. .hfront_porch = { 39, 58, 77 },
  504. .hback_porch = { 59, 88, 117 },
  505. .hsync_len = { 28, 42, 56 },
  506. .vactive = { 1080, 1080, 1080 },
  507. .vfront_porch = { 3, 8, 11 },
  508. .vback_porch = { 5, 14, 19 },
  509. .vsync_len = { 4, 14, 19 },
  510. };
  511. static const struct panel_desc auo_g133han01 = {
  512. .timings = &auo_g133han01_timings,
  513. .num_timings = 1,
  514. .bpc = 8,
  515. .size = {
  516. .width = 293,
  517. .height = 165,
  518. },
  519. .delay = {
  520. .prepare = 200,
  521. .enable = 50,
  522. .disable = 50,
  523. .unprepare = 1000,
  524. },
  525. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
  526. };
  527. static const struct display_timing auo_g185han01_timings = {
  528. .pixelclock = { 120000000, 144000000, 175000000 },
  529. .hactive = { 1920, 1920, 1920 },
  530. .hfront_porch = { 18, 60, 74 },
  531. .hback_porch = { 12, 44, 54 },
  532. .hsync_len = { 10, 24, 32 },
  533. .vactive = { 1080, 1080, 1080 },
  534. .vfront_porch = { 6, 10, 40 },
  535. .vback_porch = { 2, 5, 20 },
  536. .vsync_len = { 2, 5, 20 },
  537. };
  538. static const struct panel_desc auo_g185han01 = {
  539. .timings = &auo_g185han01_timings,
  540. .num_timings = 1,
  541. .bpc = 8,
  542. .size = {
  543. .width = 409,
  544. .height = 230,
  545. },
  546. .delay = {
  547. .prepare = 50,
  548. .enable = 200,
  549. .disable = 110,
  550. .unprepare = 1000,
  551. },
  552. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  553. };
  554. static const struct display_timing auo_p320hvn03_timings = {
  555. .pixelclock = { 106000000, 148500000, 164000000 },
  556. .hactive = { 1920, 1920, 1920 },
  557. .hfront_porch = { 25, 50, 130 },
  558. .hback_porch = { 25, 50, 130 },
  559. .hsync_len = { 20, 40, 105 },
  560. .vactive = { 1080, 1080, 1080 },
  561. .vfront_porch = { 8, 17, 150 },
  562. .vback_porch = { 8, 17, 150 },
  563. .vsync_len = { 4, 11, 100 },
  564. };
  565. static const struct panel_desc auo_p320hvn03 = {
  566. .timings = &auo_p320hvn03_timings,
  567. .num_timings = 1,
  568. .bpc = 8,
  569. .size = {
  570. .width = 698,
  571. .height = 393,
  572. },
  573. .delay = {
  574. .prepare = 1,
  575. .enable = 450,
  576. .unprepare = 500,
  577. },
  578. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  579. };
  580. static const struct drm_display_mode auo_t215hvn01_mode = {
  581. .clock = 148800,
  582. .hdisplay = 1920,
  583. .hsync_start = 1920 + 88,
  584. .hsync_end = 1920 + 88 + 44,
  585. .htotal = 1920 + 88 + 44 + 148,
  586. .vdisplay = 1080,
  587. .vsync_start = 1080 + 4,
  588. .vsync_end = 1080 + 4 + 5,
  589. .vtotal = 1080 + 4 + 5 + 36,
  590. .vrefresh = 60,
  591. };
  592. static const struct panel_desc auo_t215hvn01 = {
  593. .modes = &auo_t215hvn01_mode,
  594. .num_modes = 1,
  595. .bpc = 8,
  596. .size = {
  597. .width = 430,
  598. .height = 270,
  599. },
  600. .delay = {
  601. .disable = 5,
  602. .unprepare = 1000,
  603. }
  604. };
  605. static const struct drm_display_mode avic_tm070ddh03_mode = {
  606. .clock = 51200,
  607. .hdisplay = 1024,
  608. .hsync_start = 1024 + 160,
  609. .hsync_end = 1024 + 160 + 4,
  610. .htotal = 1024 + 160 + 4 + 156,
  611. .vdisplay = 600,
  612. .vsync_start = 600 + 17,
  613. .vsync_end = 600 + 17 + 1,
  614. .vtotal = 600 + 17 + 1 + 17,
  615. .vrefresh = 60,
  616. };
  617. static const struct panel_desc avic_tm070ddh03 = {
  618. .modes = &avic_tm070ddh03_mode,
  619. .num_modes = 1,
  620. .bpc = 8,
  621. .size = {
  622. .width = 154,
  623. .height = 90,
  624. },
  625. .delay = {
  626. .prepare = 20,
  627. .enable = 200,
  628. .disable = 200,
  629. },
  630. };
  631. static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
  632. {
  633. .clock = 71900,
  634. .hdisplay = 1280,
  635. .hsync_start = 1280 + 48,
  636. .hsync_end = 1280 + 48 + 32,
  637. .htotal = 1280 + 48 + 32 + 80,
  638. .vdisplay = 800,
  639. .vsync_start = 800 + 3,
  640. .vsync_end = 800 + 3 + 5,
  641. .vtotal = 800 + 3 + 5 + 24,
  642. .vrefresh = 60,
  643. },
  644. {
  645. .clock = 57500,
  646. .hdisplay = 1280,
  647. .hsync_start = 1280 + 48,
  648. .hsync_end = 1280 + 48 + 32,
  649. .htotal = 1280 + 48 + 32 + 80,
  650. .vdisplay = 800,
  651. .vsync_start = 800 + 3,
  652. .vsync_end = 800 + 3 + 5,
  653. .vtotal = 800 + 3 + 5 + 24,
  654. .vrefresh = 48,
  655. },
  656. };
  657. static const struct panel_desc boe_nv101wxmn51 = {
  658. .modes = boe_nv101wxmn51_modes,
  659. .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
  660. .bpc = 8,
  661. .size = {
  662. .width = 217,
  663. .height = 136,
  664. },
  665. .delay = {
  666. .prepare = 210,
  667. .enable = 50,
  668. .unprepare = 160,
  669. },
  670. };
  671. static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
  672. .clock = 66770,
  673. .hdisplay = 800,
  674. .hsync_start = 800 + 49,
  675. .hsync_end = 800 + 49 + 33,
  676. .htotal = 800 + 49 + 33 + 17,
  677. .vdisplay = 1280,
  678. .vsync_start = 1280 + 1,
  679. .vsync_end = 1280 + 1 + 7,
  680. .vtotal = 1280 + 1 + 7 + 15,
  681. .vrefresh = 60,
  682. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  683. };
  684. static const struct panel_desc chunghwa_claa070wp03xg = {
  685. .modes = &chunghwa_claa070wp03xg_mode,
  686. .num_modes = 1,
  687. .bpc = 6,
  688. .size = {
  689. .width = 94,
  690. .height = 150,
  691. },
  692. };
  693. static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
  694. .clock = 72070,
  695. .hdisplay = 1366,
  696. .hsync_start = 1366 + 58,
  697. .hsync_end = 1366 + 58 + 58,
  698. .htotal = 1366 + 58 + 58 + 58,
  699. .vdisplay = 768,
  700. .vsync_start = 768 + 4,
  701. .vsync_end = 768 + 4 + 4,
  702. .vtotal = 768 + 4 + 4 + 4,
  703. .vrefresh = 60,
  704. };
  705. static const struct panel_desc chunghwa_claa101wa01a = {
  706. .modes = &chunghwa_claa101wa01a_mode,
  707. .num_modes = 1,
  708. .bpc = 6,
  709. .size = {
  710. .width = 220,
  711. .height = 120,
  712. },
  713. };
  714. static const struct drm_display_mode chunghwa_claa101wb01_mode = {
  715. .clock = 69300,
  716. .hdisplay = 1366,
  717. .hsync_start = 1366 + 48,
  718. .hsync_end = 1366 + 48 + 32,
  719. .htotal = 1366 + 48 + 32 + 20,
  720. .vdisplay = 768,
  721. .vsync_start = 768 + 16,
  722. .vsync_end = 768 + 16 + 8,
  723. .vtotal = 768 + 16 + 8 + 16,
  724. .vrefresh = 60,
  725. };
  726. static const struct panel_desc chunghwa_claa101wb01 = {
  727. .modes = &chunghwa_claa101wb01_mode,
  728. .num_modes = 1,
  729. .bpc = 6,
  730. .size = {
  731. .width = 223,
  732. .height = 125,
  733. },
  734. };
  735. static const struct drm_display_mode edt_et057090dhu_mode = {
  736. .clock = 25175,
  737. .hdisplay = 640,
  738. .hsync_start = 640 + 16,
  739. .hsync_end = 640 + 16 + 30,
  740. .htotal = 640 + 16 + 30 + 114,
  741. .vdisplay = 480,
  742. .vsync_start = 480 + 10,
  743. .vsync_end = 480 + 10 + 3,
  744. .vtotal = 480 + 10 + 3 + 32,
  745. .vrefresh = 60,
  746. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  747. };
  748. static const struct panel_desc edt_et057090dhu = {
  749. .modes = &edt_et057090dhu_mode,
  750. .num_modes = 1,
  751. .bpc = 6,
  752. .size = {
  753. .width = 115,
  754. .height = 86,
  755. },
  756. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  757. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
  758. };
  759. static const struct drm_display_mode edt_etm0700g0dh6_mode = {
  760. .clock = 33260,
  761. .hdisplay = 800,
  762. .hsync_start = 800 + 40,
  763. .hsync_end = 800 + 40 + 128,
  764. .htotal = 800 + 40 + 128 + 88,
  765. .vdisplay = 480,
  766. .vsync_start = 480 + 10,
  767. .vsync_end = 480 + 10 + 2,
  768. .vtotal = 480 + 10 + 2 + 33,
  769. .vrefresh = 60,
  770. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  771. };
  772. static const struct panel_desc edt_etm0700g0dh6 = {
  773. .modes = &edt_etm0700g0dh6_mode,
  774. .num_modes = 1,
  775. .bpc = 6,
  776. .size = {
  777. .width = 152,
  778. .height = 91,
  779. },
  780. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  781. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
  782. };
  783. static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
  784. .clock = 32260,
  785. .hdisplay = 800,
  786. .hsync_start = 800 + 168,
  787. .hsync_end = 800 + 168 + 64,
  788. .htotal = 800 + 168 + 64 + 88,
  789. .vdisplay = 480,
  790. .vsync_start = 480 + 37,
  791. .vsync_end = 480 + 37 + 2,
  792. .vtotal = 480 + 37 + 2 + 8,
  793. .vrefresh = 60,
  794. };
  795. static const struct panel_desc foxlink_fl500wvr00_a0t = {
  796. .modes = &foxlink_fl500wvr00_a0t_mode,
  797. .num_modes = 1,
  798. .bpc = 8,
  799. .size = {
  800. .width = 108,
  801. .height = 65,
  802. },
  803. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  804. };
  805. static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
  806. .clock = 9000,
  807. .hdisplay = 480,
  808. .hsync_start = 480 + 5,
  809. .hsync_end = 480 + 5 + 1,
  810. .htotal = 480 + 5 + 1 + 40,
  811. .vdisplay = 272,
  812. .vsync_start = 272 + 8,
  813. .vsync_end = 272 + 8 + 1,
  814. .vtotal = 272 + 8 + 1 + 8,
  815. .vrefresh = 60,
  816. };
  817. static const struct panel_desc giantplus_gpg482739qs5 = {
  818. .modes = &giantplus_gpg482739qs5_mode,
  819. .num_modes = 1,
  820. .bpc = 8,
  821. .size = {
  822. .width = 95,
  823. .height = 54,
  824. },
  825. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  826. };
  827. static const struct display_timing hannstar_hsd070pww1_timing = {
  828. .pixelclock = { 64300000, 71100000, 82000000 },
  829. .hactive = { 1280, 1280, 1280 },
  830. .hfront_porch = { 1, 1, 10 },
  831. .hback_porch = { 1, 1, 10 },
  832. /*
  833. * According to the data sheet, the minimum horizontal blanking interval
  834. * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
  835. * minimum working horizontal blanking interval to be 60 clocks.
  836. */
  837. .hsync_len = { 58, 158, 661 },
  838. .vactive = { 800, 800, 800 },
  839. .vfront_porch = { 1, 1, 10 },
  840. .vback_porch = { 1, 1, 10 },
  841. .vsync_len = { 1, 21, 203 },
  842. .flags = DISPLAY_FLAGS_DE_HIGH,
  843. };
  844. static const struct panel_desc hannstar_hsd070pww1 = {
  845. .timings = &hannstar_hsd070pww1_timing,
  846. .num_timings = 1,
  847. .bpc = 6,
  848. .size = {
  849. .width = 151,
  850. .height = 94,
  851. },
  852. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  853. };
  854. static const struct display_timing hannstar_hsd100pxn1_timing = {
  855. .pixelclock = { 55000000, 65000000, 75000000 },
  856. .hactive = { 1024, 1024, 1024 },
  857. .hfront_porch = { 40, 40, 40 },
  858. .hback_porch = { 220, 220, 220 },
  859. .hsync_len = { 20, 60, 100 },
  860. .vactive = { 768, 768, 768 },
  861. .vfront_porch = { 7, 7, 7 },
  862. .vback_porch = { 21, 21, 21 },
  863. .vsync_len = { 10, 10, 10 },
  864. .flags = DISPLAY_FLAGS_DE_HIGH,
  865. };
  866. static const struct panel_desc hannstar_hsd100pxn1 = {
  867. .timings = &hannstar_hsd100pxn1_timing,
  868. .num_timings = 1,
  869. .bpc = 6,
  870. .size = {
  871. .width = 203,
  872. .height = 152,
  873. },
  874. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  875. };
  876. static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
  877. .clock = 33333,
  878. .hdisplay = 800,
  879. .hsync_start = 800 + 85,
  880. .hsync_end = 800 + 85 + 86,
  881. .htotal = 800 + 85 + 86 + 85,
  882. .vdisplay = 480,
  883. .vsync_start = 480 + 16,
  884. .vsync_end = 480 + 16 + 13,
  885. .vtotal = 480 + 16 + 13 + 16,
  886. .vrefresh = 60,
  887. };
  888. static const struct panel_desc hitachi_tx23d38vm0caa = {
  889. .modes = &hitachi_tx23d38vm0caa_mode,
  890. .num_modes = 1,
  891. .bpc = 6,
  892. .size = {
  893. .width = 195,
  894. .height = 117,
  895. },
  896. .delay = {
  897. .enable = 160,
  898. .disable = 160,
  899. },
  900. };
  901. static const struct drm_display_mode innolux_at043tn24_mode = {
  902. .clock = 9000,
  903. .hdisplay = 480,
  904. .hsync_start = 480 + 2,
  905. .hsync_end = 480 + 2 + 41,
  906. .htotal = 480 + 2 + 41 + 2,
  907. .vdisplay = 272,
  908. .vsync_start = 272 + 2,
  909. .vsync_end = 272 + 2 + 10,
  910. .vtotal = 272 + 2 + 10 + 2,
  911. .vrefresh = 60,
  912. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  913. };
  914. static const struct panel_desc innolux_at043tn24 = {
  915. .modes = &innolux_at043tn24_mode,
  916. .num_modes = 1,
  917. .bpc = 8,
  918. .size = {
  919. .width = 95,
  920. .height = 54,
  921. },
  922. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  923. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
  924. };
  925. static const struct drm_display_mode innolux_at070tn92_mode = {
  926. .clock = 33333,
  927. .hdisplay = 800,
  928. .hsync_start = 800 + 210,
  929. .hsync_end = 800 + 210 + 20,
  930. .htotal = 800 + 210 + 20 + 46,
  931. .vdisplay = 480,
  932. .vsync_start = 480 + 22,
  933. .vsync_end = 480 + 22 + 10,
  934. .vtotal = 480 + 22 + 23 + 10,
  935. .vrefresh = 60,
  936. };
  937. static const struct panel_desc innolux_at070tn92 = {
  938. .modes = &innolux_at070tn92_mode,
  939. .num_modes = 1,
  940. .size = {
  941. .width = 154,
  942. .height = 86,
  943. },
  944. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  945. };
  946. static const struct display_timing innolux_g101ice_l01_timing = {
  947. .pixelclock = { 60400000, 71100000, 74700000 },
  948. .hactive = { 1280, 1280, 1280 },
  949. .hfront_porch = { 41, 80, 100 },
  950. .hback_porch = { 40, 79, 99 },
  951. .hsync_len = { 1, 1, 1 },
  952. .vactive = { 800, 800, 800 },
  953. .vfront_porch = { 5, 11, 14 },
  954. .vback_porch = { 4, 11, 14 },
  955. .vsync_len = { 1, 1, 1 },
  956. .flags = DISPLAY_FLAGS_DE_HIGH,
  957. };
  958. static const struct panel_desc innolux_g101ice_l01 = {
  959. .timings = &innolux_g101ice_l01_timing,
  960. .num_timings = 1,
  961. .bpc = 8,
  962. .size = {
  963. .width = 217,
  964. .height = 135,
  965. },
  966. .delay = {
  967. .enable = 200,
  968. .disable = 200,
  969. },
  970. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  971. };
  972. static const struct display_timing innolux_g121i1_l01_timing = {
  973. .pixelclock = { 67450000, 71000000, 74550000 },
  974. .hactive = { 1280, 1280, 1280 },
  975. .hfront_porch = { 40, 80, 160 },
  976. .hback_porch = { 39, 79, 159 },
  977. .hsync_len = { 1, 1, 1 },
  978. .vactive = { 800, 800, 800 },
  979. .vfront_porch = { 5, 11, 100 },
  980. .vback_porch = { 4, 11, 99 },
  981. .vsync_len = { 1, 1, 1 },
  982. };
  983. static const struct panel_desc innolux_g121i1_l01 = {
  984. .timings = &innolux_g121i1_l01_timing,
  985. .num_timings = 1,
  986. .bpc = 6,
  987. .size = {
  988. .width = 261,
  989. .height = 163,
  990. },
  991. .delay = {
  992. .enable = 200,
  993. .disable = 20,
  994. },
  995. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  996. };
  997. static const struct drm_display_mode innolux_g121x1_l03_mode = {
  998. .clock = 65000,
  999. .hdisplay = 1024,
  1000. .hsync_start = 1024 + 0,
  1001. .hsync_end = 1024 + 1,
  1002. .htotal = 1024 + 0 + 1 + 320,
  1003. .vdisplay = 768,
  1004. .vsync_start = 768 + 38,
  1005. .vsync_end = 768 + 38 + 1,
  1006. .vtotal = 768 + 38 + 1 + 0,
  1007. .vrefresh = 60,
  1008. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  1009. };
  1010. static const struct panel_desc innolux_g121x1_l03 = {
  1011. .modes = &innolux_g121x1_l03_mode,
  1012. .num_modes = 1,
  1013. .bpc = 6,
  1014. .size = {
  1015. .width = 246,
  1016. .height = 185,
  1017. },
  1018. .delay = {
  1019. .enable = 200,
  1020. .unprepare = 200,
  1021. .disable = 400,
  1022. },
  1023. };
  1024. static const struct drm_display_mode innolux_n116bge_mode = {
  1025. .clock = 76420,
  1026. .hdisplay = 1366,
  1027. .hsync_start = 1366 + 136,
  1028. .hsync_end = 1366 + 136 + 30,
  1029. .htotal = 1366 + 136 + 30 + 60,
  1030. .vdisplay = 768,
  1031. .vsync_start = 768 + 8,
  1032. .vsync_end = 768 + 8 + 12,
  1033. .vtotal = 768 + 8 + 12 + 12,
  1034. .vrefresh = 60,
  1035. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  1036. };
  1037. static const struct panel_desc innolux_n116bge = {
  1038. .modes = &innolux_n116bge_mode,
  1039. .num_modes = 1,
  1040. .bpc = 6,
  1041. .size = {
  1042. .width = 256,
  1043. .height = 144,
  1044. },
  1045. };
  1046. static const struct drm_display_mode innolux_n156bge_l21_mode = {
  1047. .clock = 69300,
  1048. .hdisplay = 1366,
  1049. .hsync_start = 1366 + 16,
  1050. .hsync_end = 1366 + 16 + 34,
  1051. .htotal = 1366 + 16 + 34 + 50,
  1052. .vdisplay = 768,
  1053. .vsync_start = 768 + 2,
  1054. .vsync_end = 768 + 2 + 6,
  1055. .vtotal = 768 + 2 + 6 + 12,
  1056. .vrefresh = 60,
  1057. };
  1058. static const struct panel_desc innolux_n156bge_l21 = {
  1059. .modes = &innolux_n156bge_l21_mode,
  1060. .num_modes = 1,
  1061. .bpc = 6,
  1062. .size = {
  1063. .width = 344,
  1064. .height = 193,
  1065. },
  1066. };
  1067. static const struct drm_display_mode innolux_tv123wam_mode = {
  1068. .clock = 206016,
  1069. .hdisplay = 2160,
  1070. .hsync_start = 2160 + 48,
  1071. .hsync_end = 2160 + 48 + 32,
  1072. .htotal = 2160 + 48 + 32 + 80,
  1073. .vdisplay = 1440,
  1074. .vsync_start = 1440 + 3,
  1075. .vsync_end = 1440 + 3 + 10,
  1076. .vtotal = 1440 + 3 + 10 + 27,
  1077. .vrefresh = 60,
  1078. .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
  1079. };
  1080. static const struct panel_desc innolux_tv123wam = {
  1081. .modes = &innolux_tv123wam_mode,
  1082. .num_modes = 1,
  1083. .bpc = 8,
  1084. .size = {
  1085. .width = 259,
  1086. .height = 173,
  1087. },
  1088. };
  1089. static const struct drm_display_mode innolux_zj070na_01p_mode = {
  1090. .clock = 51501,
  1091. .hdisplay = 1024,
  1092. .hsync_start = 1024 + 128,
  1093. .hsync_end = 1024 + 128 + 64,
  1094. .htotal = 1024 + 128 + 64 + 128,
  1095. .vdisplay = 600,
  1096. .vsync_start = 600 + 16,
  1097. .vsync_end = 600 + 16 + 4,
  1098. .vtotal = 600 + 16 + 4 + 16,
  1099. .vrefresh = 60,
  1100. };
  1101. static const struct panel_desc innolux_zj070na_01p = {
  1102. .modes = &innolux_zj070na_01p_mode,
  1103. .num_modes = 1,
  1104. .bpc = 6,
  1105. .size = {
  1106. .width = 154,
  1107. .height = 90,
  1108. },
  1109. };
  1110. static const struct display_timing koe_tx31d200vm0baa_timing = {
  1111. .pixelclock = { 39600000, 43200000, 48000000 },
  1112. .hactive = { 1280, 1280, 1280 },
  1113. .hfront_porch = { 16, 36, 56 },
  1114. .hback_porch = { 16, 36, 56 },
  1115. .hsync_len = { 8, 8, 8 },
  1116. .vactive = { 480, 480, 480 },
  1117. .vfront_porch = { 6, 21, 33 },
  1118. .vback_porch = { 6, 21, 33 },
  1119. .vsync_len = { 8, 8, 8 },
  1120. .flags = DISPLAY_FLAGS_DE_HIGH,
  1121. };
  1122. static const struct panel_desc koe_tx31d200vm0baa = {
  1123. .timings = &koe_tx31d200vm0baa_timing,
  1124. .num_timings = 1,
  1125. .bpc = 6,
  1126. .size = {
  1127. .width = 292,
  1128. .height = 109,
  1129. },
  1130. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  1131. };
  1132. static const struct display_timing kyo_tcg121xglp_timing = {
  1133. .pixelclock = { 52000000, 65000000, 71000000 },
  1134. .hactive = { 1024, 1024, 1024 },
  1135. .hfront_porch = { 2, 2, 2 },
  1136. .hback_porch = { 2, 2, 2 },
  1137. .hsync_len = { 86, 124, 244 },
  1138. .vactive = { 768, 768, 768 },
  1139. .vfront_porch = { 2, 2, 2 },
  1140. .vback_porch = { 2, 2, 2 },
  1141. .vsync_len = { 6, 34, 73 },
  1142. .flags = DISPLAY_FLAGS_DE_HIGH,
  1143. };
  1144. static const struct panel_desc kyo_tcg121xglp = {
  1145. .timings = &kyo_tcg121xglp_timing,
  1146. .num_timings = 1,
  1147. .bpc = 8,
  1148. .size = {
  1149. .width = 246,
  1150. .height = 184,
  1151. },
  1152. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1153. };
  1154. static const struct drm_display_mode lg_lb070wv8_mode = {
  1155. .clock = 33246,
  1156. .hdisplay = 800,
  1157. .hsync_start = 800 + 88,
  1158. .hsync_end = 800 + 88 + 80,
  1159. .htotal = 800 + 88 + 80 + 88,
  1160. .vdisplay = 480,
  1161. .vsync_start = 480 + 10,
  1162. .vsync_end = 480 + 10 + 25,
  1163. .vtotal = 480 + 10 + 25 + 10,
  1164. .vrefresh = 60,
  1165. };
  1166. static const struct panel_desc lg_lb070wv8 = {
  1167. .modes = &lg_lb070wv8_mode,
  1168. .num_modes = 1,
  1169. .bpc = 16,
  1170. .size = {
  1171. .width = 151,
  1172. .height = 91,
  1173. },
  1174. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1175. };
  1176. static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
  1177. .clock = 200000,
  1178. .hdisplay = 1536,
  1179. .hsync_start = 1536 + 12,
  1180. .hsync_end = 1536 + 12 + 16,
  1181. .htotal = 1536 + 12 + 16 + 48,
  1182. .vdisplay = 2048,
  1183. .vsync_start = 2048 + 8,
  1184. .vsync_end = 2048 + 8 + 4,
  1185. .vtotal = 2048 + 8 + 4 + 8,
  1186. .vrefresh = 60,
  1187. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1188. };
  1189. static const struct panel_desc lg_lp079qx1_sp0v = {
  1190. .modes = &lg_lp079qx1_sp0v_mode,
  1191. .num_modes = 1,
  1192. .size = {
  1193. .width = 129,
  1194. .height = 171,
  1195. },
  1196. };
  1197. static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
  1198. .clock = 205210,
  1199. .hdisplay = 2048,
  1200. .hsync_start = 2048 + 150,
  1201. .hsync_end = 2048 + 150 + 5,
  1202. .htotal = 2048 + 150 + 5 + 5,
  1203. .vdisplay = 1536,
  1204. .vsync_start = 1536 + 3,
  1205. .vsync_end = 1536 + 3 + 1,
  1206. .vtotal = 1536 + 3 + 1 + 9,
  1207. .vrefresh = 60,
  1208. };
  1209. static const struct panel_desc lg_lp097qx1_spa1 = {
  1210. .modes = &lg_lp097qx1_spa1_mode,
  1211. .num_modes = 1,
  1212. .size = {
  1213. .width = 208,
  1214. .height = 147,
  1215. },
  1216. };
  1217. static const struct drm_display_mode lg_lp120up1_mode = {
  1218. .clock = 162300,
  1219. .hdisplay = 1920,
  1220. .hsync_start = 1920 + 40,
  1221. .hsync_end = 1920 + 40 + 40,
  1222. .htotal = 1920 + 40 + 40+ 80,
  1223. .vdisplay = 1280,
  1224. .vsync_start = 1280 + 4,
  1225. .vsync_end = 1280 + 4 + 4,
  1226. .vtotal = 1280 + 4 + 4 + 12,
  1227. .vrefresh = 60,
  1228. };
  1229. static const struct panel_desc lg_lp120up1 = {
  1230. .modes = &lg_lp120up1_mode,
  1231. .num_modes = 1,
  1232. .bpc = 8,
  1233. .size = {
  1234. .width = 267,
  1235. .height = 183,
  1236. },
  1237. };
  1238. static const struct drm_display_mode lg_lp129qe_mode = {
  1239. .clock = 285250,
  1240. .hdisplay = 2560,
  1241. .hsync_start = 2560 + 48,
  1242. .hsync_end = 2560 + 48 + 32,
  1243. .htotal = 2560 + 48 + 32 + 80,
  1244. .vdisplay = 1700,
  1245. .vsync_start = 1700 + 3,
  1246. .vsync_end = 1700 + 3 + 10,
  1247. .vtotal = 1700 + 3 + 10 + 36,
  1248. .vrefresh = 60,
  1249. };
  1250. static const struct panel_desc lg_lp129qe = {
  1251. .modes = &lg_lp129qe_mode,
  1252. .num_modes = 1,
  1253. .bpc = 8,
  1254. .size = {
  1255. .width = 272,
  1256. .height = 181,
  1257. },
  1258. };
  1259. static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
  1260. .clock = 30400,
  1261. .hdisplay = 800,
  1262. .hsync_start = 800 + 0,
  1263. .hsync_end = 800 + 1,
  1264. .htotal = 800 + 0 + 1 + 160,
  1265. .vdisplay = 480,
  1266. .vsync_start = 480 + 0,
  1267. .vsync_end = 480 + 48 + 1,
  1268. .vtotal = 480 + 48 + 1 + 0,
  1269. .vrefresh = 60,
  1270. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  1271. };
  1272. static const struct panel_desc mitsubishi_aa070mc01 = {
  1273. .modes = &mitsubishi_aa070mc01_mode,
  1274. .num_modes = 1,
  1275. .bpc = 8,
  1276. .size = {
  1277. .width = 152,
  1278. .height = 91,
  1279. },
  1280. .delay = {
  1281. .enable = 200,
  1282. .unprepare = 200,
  1283. .disable = 400,
  1284. },
  1285. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1286. .bus_flags = DRM_BUS_FLAG_DE_HIGH,
  1287. };
  1288. static const struct display_timing nec_nl12880bc20_05_timing = {
  1289. .pixelclock = { 67000000, 71000000, 75000000 },
  1290. .hactive = { 1280, 1280, 1280 },
  1291. .hfront_porch = { 2, 30, 30 },
  1292. .hback_porch = { 6, 100, 100 },
  1293. .hsync_len = { 2, 30, 30 },
  1294. .vactive = { 800, 800, 800 },
  1295. .vfront_porch = { 5, 5, 5 },
  1296. .vback_porch = { 11, 11, 11 },
  1297. .vsync_len = { 7, 7, 7 },
  1298. };
  1299. static const struct panel_desc nec_nl12880bc20_05 = {
  1300. .timings = &nec_nl12880bc20_05_timing,
  1301. .num_timings = 1,
  1302. .bpc = 8,
  1303. .size = {
  1304. .width = 261,
  1305. .height = 163,
  1306. },
  1307. .delay = {
  1308. .enable = 50,
  1309. .disable = 50,
  1310. },
  1311. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1312. };
  1313. static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
  1314. .clock = 10870,
  1315. .hdisplay = 480,
  1316. .hsync_start = 480 + 2,
  1317. .hsync_end = 480 + 2 + 41,
  1318. .htotal = 480 + 2 + 41 + 2,
  1319. .vdisplay = 272,
  1320. .vsync_start = 272 + 2,
  1321. .vsync_end = 272 + 2 + 4,
  1322. .vtotal = 272 + 2 + 4 + 2,
  1323. .vrefresh = 74,
  1324. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1325. };
  1326. static const struct panel_desc nec_nl4827hc19_05b = {
  1327. .modes = &nec_nl4827hc19_05b_mode,
  1328. .num_modes = 1,
  1329. .bpc = 8,
  1330. .size = {
  1331. .width = 95,
  1332. .height = 54,
  1333. },
  1334. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1335. .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1336. };
  1337. static const struct drm_display_mode netron_dy_e231732_mode = {
  1338. .clock = 66000,
  1339. .hdisplay = 1024,
  1340. .hsync_start = 1024 + 160,
  1341. .hsync_end = 1024 + 160 + 70,
  1342. .htotal = 1024 + 160 + 70 + 90,
  1343. .vdisplay = 600,
  1344. .vsync_start = 600 + 127,
  1345. .vsync_end = 600 + 127 + 20,
  1346. .vtotal = 600 + 127 + 20 + 3,
  1347. .vrefresh = 60,
  1348. };
  1349. static const struct panel_desc netron_dy_e231732 = {
  1350. .modes = &netron_dy_e231732_mode,
  1351. .num_modes = 1,
  1352. .size = {
  1353. .width = 154,
  1354. .height = 87,
  1355. },
  1356. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1357. };
  1358. static const struct display_timing nlt_nl192108ac18_02d_timing = {
  1359. .pixelclock = { 130000000, 148350000, 163000000 },
  1360. .hactive = { 1920, 1920, 1920 },
  1361. .hfront_porch = { 80, 100, 100 },
  1362. .hback_porch = { 100, 120, 120 },
  1363. .hsync_len = { 50, 60, 60 },
  1364. .vactive = { 1080, 1080, 1080 },
  1365. .vfront_porch = { 12, 30, 30 },
  1366. .vback_porch = { 4, 10, 10 },
  1367. .vsync_len = { 4, 5, 5 },
  1368. };
  1369. static const struct panel_desc nlt_nl192108ac18_02d = {
  1370. .timings = &nlt_nl192108ac18_02d_timing,
  1371. .num_timings = 1,
  1372. .bpc = 8,
  1373. .size = {
  1374. .width = 344,
  1375. .height = 194,
  1376. },
  1377. .delay = {
  1378. .unprepare = 500,
  1379. },
  1380. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1381. };
  1382. static const struct drm_display_mode nvd_9128_mode = {
  1383. .clock = 29500,
  1384. .hdisplay = 800,
  1385. .hsync_start = 800 + 130,
  1386. .hsync_end = 800 + 130 + 98,
  1387. .htotal = 800 + 0 + 130 + 98,
  1388. .vdisplay = 480,
  1389. .vsync_start = 480 + 10,
  1390. .vsync_end = 480 + 10 + 50,
  1391. .vtotal = 480 + 0 + 10 + 50,
  1392. };
  1393. static const struct panel_desc nvd_9128 = {
  1394. .modes = &nvd_9128_mode,
  1395. .num_modes = 1,
  1396. .bpc = 8,
  1397. .size = {
  1398. .width = 156,
  1399. .height = 88,
  1400. },
  1401. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1402. };
  1403. static const struct display_timing okaya_rs800480t_7x0gp_timing = {
  1404. .pixelclock = { 30000000, 30000000, 40000000 },
  1405. .hactive = { 800, 800, 800 },
  1406. .hfront_porch = { 40, 40, 40 },
  1407. .hback_porch = { 40, 40, 40 },
  1408. .hsync_len = { 1, 48, 48 },
  1409. .vactive = { 480, 480, 480 },
  1410. .vfront_porch = { 13, 13, 13 },
  1411. .vback_porch = { 29, 29, 29 },
  1412. .vsync_len = { 3, 3, 3 },
  1413. .flags = DISPLAY_FLAGS_DE_HIGH,
  1414. };
  1415. static const struct panel_desc okaya_rs800480t_7x0gp = {
  1416. .timings = &okaya_rs800480t_7x0gp_timing,
  1417. .num_timings = 1,
  1418. .bpc = 6,
  1419. .size = {
  1420. .width = 154,
  1421. .height = 87,
  1422. },
  1423. .delay = {
  1424. .prepare = 41,
  1425. .enable = 50,
  1426. .unprepare = 41,
  1427. .disable = 50,
  1428. },
  1429. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1430. };
  1431. static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
  1432. .clock = 9000,
  1433. .hdisplay = 480,
  1434. .hsync_start = 480 + 5,
  1435. .hsync_end = 480 + 5 + 30,
  1436. .htotal = 480 + 5 + 30 + 10,
  1437. .vdisplay = 272,
  1438. .vsync_start = 272 + 8,
  1439. .vsync_end = 272 + 8 + 5,
  1440. .vtotal = 272 + 8 + 5 + 3,
  1441. .vrefresh = 60,
  1442. };
  1443. static const struct panel_desc olimex_lcd_olinuxino_43ts = {
  1444. .modes = &olimex_lcd_olinuxino_43ts_mode,
  1445. .num_modes = 1,
  1446. .size = {
  1447. .width = 95,
  1448. .height = 54,
  1449. },
  1450. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1451. };
  1452. /*
  1453. * 800x480 CVT. The panel appears to be quite accepting, at least as far as
  1454. * pixel clocks, but this is the timing that was being used in the Adafruit
  1455. * installation instructions.
  1456. */
  1457. static const struct drm_display_mode ontat_yx700wv03_mode = {
  1458. .clock = 29500,
  1459. .hdisplay = 800,
  1460. .hsync_start = 824,
  1461. .hsync_end = 896,
  1462. .htotal = 992,
  1463. .vdisplay = 480,
  1464. .vsync_start = 483,
  1465. .vsync_end = 493,
  1466. .vtotal = 500,
  1467. .vrefresh = 60,
  1468. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1469. };
  1470. /*
  1471. * Specification at:
  1472. * https://www.adafruit.com/images/product-files/2406/c3163.pdf
  1473. */
  1474. static const struct panel_desc ontat_yx700wv03 = {
  1475. .modes = &ontat_yx700wv03_mode,
  1476. .num_modes = 1,
  1477. .bpc = 8,
  1478. .size = {
  1479. .width = 154,
  1480. .height = 83,
  1481. },
  1482. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1483. };
  1484. static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
  1485. .clock = 25000,
  1486. .hdisplay = 480,
  1487. .hsync_start = 480 + 10,
  1488. .hsync_end = 480 + 10 + 10,
  1489. .htotal = 480 + 10 + 10 + 15,
  1490. .vdisplay = 800,
  1491. .vsync_start = 800 + 3,
  1492. .vsync_end = 800 + 3 + 3,
  1493. .vtotal = 800 + 3 + 3 + 3,
  1494. .vrefresh = 60,
  1495. };
  1496. static const struct panel_desc ortustech_com43h4m85ulc = {
  1497. .modes = &ortustech_com43h4m85ulc_mode,
  1498. .num_modes = 1,
  1499. .bpc = 8,
  1500. .size = {
  1501. .width = 56,
  1502. .height = 93,
  1503. },
  1504. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1505. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1506. };
  1507. static const struct drm_display_mode qd43003c0_40_mode = {
  1508. .clock = 9000,
  1509. .hdisplay = 480,
  1510. .hsync_start = 480 + 8,
  1511. .hsync_end = 480 + 8 + 4,
  1512. .htotal = 480 + 8 + 4 + 39,
  1513. .vdisplay = 272,
  1514. .vsync_start = 272 + 4,
  1515. .vsync_end = 272 + 4 + 10,
  1516. .vtotal = 272 + 4 + 10 + 2,
  1517. .vrefresh = 60,
  1518. };
  1519. static const struct panel_desc qd43003c0_40 = {
  1520. .modes = &qd43003c0_40_mode,
  1521. .num_modes = 1,
  1522. .bpc = 8,
  1523. .size = {
  1524. .width = 95,
  1525. .height = 53,
  1526. },
  1527. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1528. };
  1529. static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
  1530. .clock = 271560,
  1531. .hdisplay = 2560,
  1532. .hsync_start = 2560 + 48,
  1533. .hsync_end = 2560 + 48 + 32,
  1534. .htotal = 2560 + 48 + 32 + 80,
  1535. .vdisplay = 1600,
  1536. .vsync_start = 1600 + 2,
  1537. .vsync_end = 1600 + 2 + 5,
  1538. .vtotal = 1600 + 2 + 5 + 57,
  1539. .vrefresh = 60,
  1540. };
  1541. static const struct panel_desc samsung_lsn122dl01_c01 = {
  1542. .modes = &samsung_lsn122dl01_c01_mode,
  1543. .num_modes = 1,
  1544. .size = {
  1545. .width = 263,
  1546. .height = 164,
  1547. },
  1548. };
  1549. static const struct drm_display_mode samsung_ltn101nt05_mode = {
  1550. .clock = 54030,
  1551. .hdisplay = 1024,
  1552. .hsync_start = 1024 + 24,
  1553. .hsync_end = 1024 + 24 + 136,
  1554. .htotal = 1024 + 24 + 136 + 160,
  1555. .vdisplay = 600,
  1556. .vsync_start = 600 + 3,
  1557. .vsync_end = 600 + 3 + 6,
  1558. .vtotal = 600 + 3 + 6 + 61,
  1559. .vrefresh = 60,
  1560. };
  1561. static const struct panel_desc samsung_ltn101nt05 = {
  1562. .modes = &samsung_ltn101nt05_mode,
  1563. .num_modes = 1,
  1564. .bpc = 6,
  1565. .size = {
  1566. .width = 223,
  1567. .height = 125,
  1568. },
  1569. };
  1570. static const struct drm_display_mode samsung_ltn140at29_301_mode = {
  1571. .clock = 76300,
  1572. .hdisplay = 1366,
  1573. .hsync_start = 1366 + 64,
  1574. .hsync_end = 1366 + 64 + 48,
  1575. .htotal = 1366 + 64 + 48 + 128,
  1576. .vdisplay = 768,
  1577. .vsync_start = 768 + 2,
  1578. .vsync_end = 768 + 2 + 5,
  1579. .vtotal = 768 + 2 + 5 + 17,
  1580. .vrefresh = 60,
  1581. };
  1582. static const struct panel_desc samsung_ltn140at29_301 = {
  1583. .modes = &samsung_ltn140at29_301_mode,
  1584. .num_modes = 1,
  1585. .bpc = 6,
  1586. .size = {
  1587. .width = 320,
  1588. .height = 187,
  1589. },
  1590. };
  1591. static const struct display_timing sharp_lq101k1ly04_timing = {
  1592. .pixelclock = { 60000000, 65000000, 80000000 },
  1593. .hactive = { 1280, 1280, 1280 },
  1594. .hfront_porch = { 20, 20, 20 },
  1595. .hback_porch = { 20, 20, 20 },
  1596. .hsync_len = { 10, 10, 10 },
  1597. .vactive = { 800, 800, 800 },
  1598. .vfront_porch = { 4, 4, 4 },
  1599. .vback_porch = { 4, 4, 4 },
  1600. .vsync_len = { 4, 4, 4 },
  1601. .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
  1602. };
  1603. static const struct panel_desc sharp_lq101k1ly04 = {
  1604. .timings = &sharp_lq101k1ly04_timing,
  1605. .num_timings = 1,
  1606. .bpc = 8,
  1607. .size = {
  1608. .width = 217,
  1609. .height = 136,
  1610. },
  1611. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
  1612. };
  1613. static const struct display_timing sharp_lq123p1jx31_timing = {
  1614. .pixelclock = { 252750000, 252750000, 266604720 },
  1615. .hactive = { 2400, 2400, 2400 },
  1616. .hfront_porch = { 48, 48, 48 },
  1617. .hback_porch = { 80, 80, 84 },
  1618. .hsync_len = { 32, 32, 32 },
  1619. .vactive = { 1600, 1600, 1600 },
  1620. .vfront_porch = { 3, 3, 3 },
  1621. .vback_porch = { 33, 33, 120 },
  1622. .vsync_len = { 10, 10, 10 },
  1623. .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
  1624. };
  1625. static const struct panel_desc sharp_lq123p1jx31 = {
  1626. .timings = &sharp_lq123p1jx31_timing,
  1627. .num_timings = 1,
  1628. .bpc = 8,
  1629. .size = {
  1630. .width = 259,
  1631. .height = 173,
  1632. },
  1633. .delay = {
  1634. .prepare = 110,
  1635. .enable = 50,
  1636. .unprepare = 550,
  1637. },
  1638. };
  1639. static const struct drm_display_mode sharp_lq150x1lg11_mode = {
  1640. .clock = 71100,
  1641. .hdisplay = 1024,
  1642. .hsync_start = 1024 + 168,
  1643. .hsync_end = 1024 + 168 + 64,
  1644. .htotal = 1024 + 168 + 64 + 88,
  1645. .vdisplay = 768,
  1646. .vsync_start = 768 + 37,
  1647. .vsync_end = 768 + 37 + 2,
  1648. .vtotal = 768 + 37 + 2 + 8,
  1649. .vrefresh = 60,
  1650. };
  1651. static const struct panel_desc sharp_lq150x1lg11 = {
  1652. .modes = &sharp_lq150x1lg11_mode,
  1653. .num_modes = 1,
  1654. .bpc = 6,
  1655. .size = {
  1656. .width = 304,
  1657. .height = 228,
  1658. },
  1659. .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
  1660. };
  1661. static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
  1662. .clock = 33300,
  1663. .hdisplay = 800,
  1664. .hsync_start = 800 + 1,
  1665. .hsync_end = 800 + 1 + 64,
  1666. .htotal = 800 + 1 + 64 + 64,
  1667. .vdisplay = 480,
  1668. .vsync_start = 480 + 1,
  1669. .vsync_end = 480 + 1 + 23,
  1670. .vtotal = 480 + 1 + 23 + 22,
  1671. .vrefresh = 60,
  1672. };
  1673. static const struct panel_desc shelly_sca07010_bfn_lnn = {
  1674. .modes = &shelly_sca07010_bfn_lnn_mode,
  1675. .num_modes = 1,
  1676. .size = {
  1677. .width = 152,
  1678. .height = 91,
  1679. },
  1680. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1681. };
  1682. static const struct drm_display_mode starry_kr122ea0sra_mode = {
  1683. .clock = 147000,
  1684. .hdisplay = 1920,
  1685. .hsync_start = 1920 + 16,
  1686. .hsync_end = 1920 + 16 + 16,
  1687. .htotal = 1920 + 16 + 16 + 32,
  1688. .vdisplay = 1200,
  1689. .vsync_start = 1200 + 15,
  1690. .vsync_end = 1200 + 15 + 2,
  1691. .vtotal = 1200 + 15 + 2 + 18,
  1692. .vrefresh = 60,
  1693. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1694. };
  1695. static const struct panel_desc starry_kr122ea0sra = {
  1696. .modes = &starry_kr122ea0sra_mode,
  1697. .num_modes = 1,
  1698. .size = {
  1699. .width = 263,
  1700. .height = 164,
  1701. },
  1702. .delay = {
  1703. .prepare = 10 + 200,
  1704. .enable = 50,
  1705. .unprepare = 10 + 500,
  1706. },
  1707. };
  1708. static const struct display_timing tianma_tm070jdhg30_timing = {
  1709. .pixelclock = { 62600000, 68200000, 78100000 },
  1710. .hactive = { 1280, 1280, 1280 },
  1711. .hfront_porch = { 15, 64, 159 },
  1712. .hback_porch = { 5, 5, 5 },
  1713. .hsync_len = { 1, 1, 256 },
  1714. .vactive = { 800, 800, 800 },
  1715. .vfront_porch = { 3, 40, 99 },
  1716. .vback_porch = { 2, 2, 2 },
  1717. .vsync_len = { 1, 1, 128 },
  1718. .flags = DISPLAY_FLAGS_DE_HIGH,
  1719. };
  1720. static const struct panel_desc tianma_tm070jdhg30 = {
  1721. .timings = &tianma_tm070jdhg30_timing,
  1722. .num_timings = 1,
  1723. .bpc = 8,
  1724. .size = {
  1725. .width = 151,
  1726. .height = 95,
  1727. },
  1728. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1729. };
  1730. static const struct display_timing tianma_tm070rvhg71_timing = {
  1731. .pixelclock = { 27700000, 29200000, 39600000 },
  1732. .hactive = { 800, 800, 800 },
  1733. .hfront_porch = { 12, 40, 212 },
  1734. .hback_porch = { 88, 88, 88 },
  1735. .hsync_len = { 1, 1, 40 },
  1736. .vactive = { 480, 480, 480 },
  1737. .vfront_porch = { 1, 13, 88 },
  1738. .vback_porch = { 32, 32, 32 },
  1739. .vsync_len = { 1, 1, 3 },
  1740. .flags = DISPLAY_FLAGS_DE_HIGH,
  1741. };
  1742. static const struct panel_desc tianma_tm070rvhg71 = {
  1743. .timings = &tianma_tm070rvhg71_timing,
  1744. .num_timings = 1,
  1745. .bpc = 8,
  1746. .size = {
  1747. .width = 154,
  1748. .height = 86,
  1749. },
  1750. .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
  1751. };
  1752. static const struct drm_display_mode toshiba_lt089ac29000_mode = {
  1753. .clock = 79500,
  1754. .hdisplay = 1280,
  1755. .hsync_start = 1280 + 192,
  1756. .hsync_end = 1280 + 192 + 128,
  1757. .htotal = 1280 + 192 + 128 + 64,
  1758. .vdisplay = 768,
  1759. .vsync_start = 768 + 20,
  1760. .vsync_end = 768 + 20 + 7,
  1761. .vtotal = 768 + 20 + 7 + 3,
  1762. .vrefresh = 60,
  1763. };
  1764. static const struct panel_desc toshiba_lt089ac29000 = {
  1765. .modes = &toshiba_lt089ac29000_mode,
  1766. .num_modes = 1,
  1767. .size = {
  1768. .width = 194,
  1769. .height = 116,
  1770. },
  1771. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1772. .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1773. };
  1774. static const struct drm_display_mode tpk_f07a_0102_mode = {
  1775. .clock = 33260,
  1776. .hdisplay = 800,
  1777. .hsync_start = 800 + 40,
  1778. .hsync_end = 800 + 40 + 128,
  1779. .htotal = 800 + 40 + 128 + 88,
  1780. .vdisplay = 480,
  1781. .vsync_start = 480 + 10,
  1782. .vsync_end = 480 + 10 + 2,
  1783. .vtotal = 480 + 10 + 2 + 33,
  1784. .vrefresh = 60,
  1785. };
  1786. static const struct panel_desc tpk_f07a_0102 = {
  1787. .modes = &tpk_f07a_0102_mode,
  1788. .num_modes = 1,
  1789. .size = {
  1790. .width = 152,
  1791. .height = 91,
  1792. },
  1793. .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
  1794. };
  1795. static const struct drm_display_mode tpk_f10a_0102_mode = {
  1796. .clock = 45000,
  1797. .hdisplay = 1024,
  1798. .hsync_start = 1024 + 176,
  1799. .hsync_end = 1024 + 176 + 5,
  1800. .htotal = 1024 + 176 + 5 + 88,
  1801. .vdisplay = 600,
  1802. .vsync_start = 600 + 20,
  1803. .vsync_end = 600 + 20 + 5,
  1804. .vtotal = 600 + 20 + 5 + 25,
  1805. .vrefresh = 60,
  1806. };
  1807. static const struct panel_desc tpk_f10a_0102 = {
  1808. .modes = &tpk_f10a_0102_mode,
  1809. .num_modes = 1,
  1810. .size = {
  1811. .width = 223,
  1812. .height = 125,
  1813. },
  1814. };
  1815. static const struct display_timing urt_umsh_8596md_timing = {
  1816. .pixelclock = { 33260000, 33260000, 33260000 },
  1817. .hactive = { 800, 800, 800 },
  1818. .hfront_porch = { 41, 41, 41 },
  1819. .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
  1820. .hsync_len = { 71, 128, 128 },
  1821. .vactive = { 480, 480, 480 },
  1822. .vfront_porch = { 10, 10, 10 },
  1823. .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
  1824. .vsync_len = { 2, 2, 2 },
  1825. .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
  1826. DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
  1827. };
  1828. static const struct panel_desc urt_umsh_8596md_lvds = {
  1829. .timings = &urt_umsh_8596md_timing,
  1830. .num_timings = 1,
  1831. .bpc = 6,
  1832. .size = {
  1833. .width = 152,
  1834. .height = 91,
  1835. },
  1836. .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
  1837. };
  1838. static const struct panel_desc urt_umsh_8596md_parallel = {
  1839. .timings = &urt_umsh_8596md_timing,
  1840. .num_timings = 1,
  1841. .bpc = 6,
  1842. .size = {
  1843. .width = 152,
  1844. .height = 91,
  1845. },
  1846. .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
  1847. };
  1848. static const struct drm_display_mode winstar_wf35ltiacd_mode = {
  1849. .clock = 6410,
  1850. .hdisplay = 320,
  1851. .hsync_start = 320 + 20,
  1852. .hsync_end = 320 + 20 + 30,
  1853. .htotal = 320 + 20 + 30 + 38,
  1854. .vdisplay = 240,
  1855. .vsync_start = 240 + 4,
  1856. .vsync_end = 240 + 4 + 3,
  1857. .vtotal = 240 + 4 + 3 + 15,
  1858. .vrefresh = 60,
  1859. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  1860. };
  1861. static const struct panel_desc winstar_wf35ltiacd = {
  1862. .modes = &winstar_wf35ltiacd_mode,
  1863. .num_modes = 1,
  1864. .bpc = 8,
  1865. .size = {
  1866. .width = 70,
  1867. .height = 53,
  1868. },
  1869. .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
  1870. };
  1871. static const struct of_device_id platform_of_match[] = {
  1872. {
  1873. .compatible = "ampire,am-480272h3tmqw-t01h",
  1874. .data = &ampire_am_480272h3tmqw_t01h,
  1875. }, {
  1876. .compatible = "ampire,am800480r3tmqwa1h",
  1877. .data = &ampire_am800480r3tmqwa1h,
  1878. }, {
  1879. .compatible = "auo,b101aw03",
  1880. .data = &auo_b101aw03,
  1881. }, {
  1882. .compatible = "auo,b101ean01",
  1883. .data = &auo_b101ean01,
  1884. }, {
  1885. .compatible = "auo,b101xtn01",
  1886. .data = &auo_b101xtn01,
  1887. }, {
  1888. .compatible = "auo,b116xw03",
  1889. .data = &auo_b116xw03,
  1890. }, {
  1891. .compatible = "auo,b133htn01",
  1892. .data = &auo_b133htn01,
  1893. }, {
  1894. .compatible = "auo,b133xtn01",
  1895. .data = &auo_b133xtn01,
  1896. }, {
  1897. .compatible = "auo,g104sn02",
  1898. .data = &auo_g104sn02,
  1899. }, {
  1900. .compatible = "auo,g133han01",
  1901. .data = &auo_g133han01,
  1902. }, {
  1903. .compatible = "auo,g185han01",
  1904. .data = &auo_g185han01,
  1905. }, {
  1906. .compatible = "auo,p320hvn03",
  1907. .data = &auo_p320hvn03,
  1908. }, {
  1909. .compatible = "auo,t215hvn01",
  1910. .data = &auo_t215hvn01,
  1911. }, {
  1912. .compatible = "avic,tm070ddh03",
  1913. .data = &avic_tm070ddh03,
  1914. }, {
  1915. .compatible = "boe,nv101wxmn51",
  1916. .data = &boe_nv101wxmn51,
  1917. }, {
  1918. .compatible = "chunghwa,claa070wp03xg",
  1919. .data = &chunghwa_claa070wp03xg,
  1920. }, {
  1921. .compatible = "chunghwa,claa101wa01a",
  1922. .data = &chunghwa_claa101wa01a
  1923. }, {
  1924. .compatible = "chunghwa,claa101wb01",
  1925. .data = &chunghwa_claa101wb01
  1926. }, {
  1927. .compatible = "edt,et057090dhu",
  1928. .data = &edt_et057090dhu,
  1929. }, {
  1930. .compatible = "edt,et070080dh6",
  1931. .data = &edt_etm0700g0dh6,
  1932. }, {
  1933. .compatible = "edt,etm0700g0dh6",
  1934. .data = &edt_etm0700g0dh6,
  1935. }, {
  1936. .compatible = "foxlink,fl500wvr00-a0t",
  1937. .data = &foxlink_fl500wvr00_a0t,
  1938. }, {
  1939. .compatible = "giantplus,gpg482739qs5",
  1940. .data = &giantplus_gpg482739qs5
  1941. }, {
  1942. .compatible = "hannstar,hsd070pww1",
  1943. .data = &hannstar_hsd070pww1,
  1944. }, {
  1945. .compatible = "hannstar,hsd100pxn1",
  1946. .data = &hannstar_hsd100pxn1,
  1947. }, {
  1948. .compatible = "hit,tx23d38vm0caa",
  1949. .data = &hitachi_tx23d38vm0caa
  1950. }, {
  1951. .compatible = "innolux,at043tn24",
  1952. .data = &innolux_at043tn24,
  1953. }, {
  1954. .compatible = "innolux,at070tn92",
  1955. .data = &innolux_at070tn92,
  1956. }, {
  1957. .compatible ="innolux,g101ice-l01",
  1958. .data = &innolux_g101ice_l01
  1959. }, {
  1960. .compatible ="innolux,g121i1-l01",
  1961. .data = &innolux_g121i1_l01
  1962. }, {
  1963. .compatible = "innolux,g121x1-l03",
  1964. .data = &innolux_g121x1_l03,
  1965. }, {
  1966. .compatible = "innolux,n116bge",
  1967. .data = &innolux_n116bge,
  1968. }, {
  1969. .compatible = "innolux,n156bge-l21",
  1970. .data = &innolux_n156bge_l21,
  1971. }, {
  1972. .compatible = "innolux,tv123wam",
  1973. .data = &innolux_tv123wam,
  1974. }, {
  1975. .compatible = "innolux,zj070na-01p",
  1976. .data = &innolux_zj070na_01p,
  1977. }, {
  1978. .compatible = "koe,tx31d200vm0baa",
  1979. .data = &koe_tx31d200vm0baa,
  1980. }, {
  1981. .compatible = "kyo,tcg121xglp",
  1982. .data = &kyo_tcg121xglp,
  1983. }, {
  1984. .compatible = "lg,lb070wv8",
  1985. .data = &lg_lb070wv8,
  1986. }, {
  1987. .compatible = "lg,lp079qx1-sp0v",
  1988. .data = &lg_lp079qx1_sp0v,
  1989. }, {
  1990. .compatible = "lg,lp097qx1-spa1",
  1991. .data = &lg_lp097qx1_spa1,
  1992. }, {
  1993. .compatible = "lg,lp120up1",
  1994. .data = &lg_lp120up1,
  1995. }, {
  1996. .compatible = "lg,lp129qe",
  1997. .data = &lg_lp129qe,
  1998. }, {
  1999. .compatible = "mitsubishi,aa070mc01-ca1",
  2000. .data = &mitsubishi_aa070mc01,
  2001. }, {
  2002. .compatible = "nec,nl12880bc20-05",
  2003. .data = &nec_nl12880bc20_05,
  2004. }, {
  2005. .compatible = "nec,nl4827hc19-05b",
  2006. .data = &nec_nl4827hc19_05b,
  2007. }, {
  2008. .compatible = "netron-dy,e231732",
  2009. .data = &netron_dy_e231732,
  2010. }, {
  2011. .compatible = "nlt,nl192108ac18-02d",
  2012. .data = &nlt_nl192108ac18_02d,
  2013. }, {
  2014. .compatible = "nvd,9128",
  2015. .data = &nvd_9128,
  2016. }, {
  2017. .compatible = "okaya,rs800480t-7x0gp",
  2018. .data = &okaya_rs800480t_7x0gp,
  2019. }, {
  2020. .compatible = "olimex,lcd-olinuxino-43-ts",
  2021. .data = &olimex_lcd_olinuxino_43ts,
  2022. }, {
  2023. .compatible = "ontat,yx700wv03",
  2024. .data = &ontat_yx700wv03,
  2025. }, {
  2026. .compatible = "ortustech,com43h4m85ulc",
  2027. .data = &ortustech_com43h4m85ulc,
  2028. }, {
  2029. .compatible = "qiaodian,qd43003c0-40",
  2030. .data = &qd43003c0_40,
  2031. }, {
  2032. .compatible = "samsung,lsn122dl01-c01",
  2033. .data = &samsung_lsn122dl01_c01,
  2034. }, {
  2035. .compatible = "samsung,ltn101nt05",
  2036. .data = &samsung_ltn101nt05,
  2037. }, {
  2038. .compatible = "samsung,ltn140at29-301",
  2039. .data = &samsung_ltn140at29_301,
  2040. }, {
  2041. .compatible = "sharp,lq101k1ly04",
  2042. .data = &sharp_lq101k1ly04,
  2043. }, {
  2044. .compatible = "sharp,lq123p1jx31",
  2045. .data = &sharp_lq123p1jx31,
  2046. }, {
  2047. .compatible = "sharp,lq150x1lg11",
  2048. .data = &sharp_lq150x1lg11,
  2049. }, {
  2050. .compatible = "shelly,sca07010-bfn-lnn",
  2051. .data = &shelly_sca07010_bfn_lnn,
  2052. }, {
  2053. .compatible = "starry,kr122ea0sra",
  2054. .data = &starry_kr122ea0sra,
  2055. }, {
  2056. .compatible = "tianma,tm070jdhg30",
  2057. .data = &tianma_tm070jdhg30,
  2058. }, {
  2059. .compatible = "tianma,tm070rvhg71",
  2060. .data = &tianma_tm070rvhg71,
  2061. }, {
  2062. .compatible = "toshiba,lt089ac29000",
  2063. .data = &toshiba_lt089ac29000,
  2064. }, {
  2065. .compatible = "tpk,f07a-0102",
  2066. .data = &tpk_f07a_0102,
  2067. }, {
  2068. .compatible = "tpk,f10a-0102",
  2069. .data = &tpk_f10a_0102,
  2070. }, {
  2071. .compatible = "urt,umsh-8596md-t",
  2072. .data = &urt_umsh_8596md_parallel,
  2073. }, {
  2074. .compatible = "urt,umsh-8596md-1t",
  2075. .data = &urt_umsh_8596md_parallel,
  2076. }, {
  2077. .compatible = "urt,umsh-8596md-7t",
  2078. .data = &urt_umsh_8596md_parallel,
  2079. }, {
  2080. .compatible = "urt,umsh-8596md-11t",
  2081. .data = &urt_umsh_8596md_lvds,
  2082. }, {
  2083. .compatible = "urt,umsh-8596md-19t",
  2084. .data = &urt_umsh_8596md_lvds,
  2085. }, {
  2086. .compatible = "urt,umsh-8596md-20t",
  2087. .data = &urt_umsh_8596md_parallel,
  2088. }, {
  2089. .compatible = "winstar,wf35ltiacd",
  2090. .data = &winstar_wf35ltiacd,
  2091. }, {
  2092. /* sentinel */
  2093. }
  2094. };
  2095. MODULE_DEVICE_TABLE(of, platform_of_match);
  2096. static int panel_simple_platform_probe(struct platform_device *pdev)
  2097. {
  2098. const struct of_device_id *id;
  2099. id = of_match_node(platform_of_match, pdev->dev.of_node);
  2100. if (!id)
  2101. return -ENODEV;
  2102. return panel_simple_probe(&pdev->dev, id->data);
  2103. }
  2104. static int panel_simple_platform_remove(struct platform_device *pdev)
  2105. {
  2106. return panel_simple_remove(&pdev->dev);
  2107. }
  2108. static void panel_simple_platform_shutdown(struct platform_device *pdev)
  2109. {
  2110. panel_simple_shutdown(&pdev->dev);
  2111. }
  2112. static struct platform_driver panel_simple_platform_driver = {
  2113. .driver = {
  2114. .name = "panel-simple",
  2115. .of_match_table = platform_of_match,
  2116. },
  2117. .probe = panel_simple_platform_probe,
  2118. .remove = panel_simple_platform_remove,
  2119. .shutdown = panel_simple_platform_shutdown,
  2120. };
  2121. struct panel_desc_dsi {
  2122. struct panel_desc desc;
  2123. unsigned long flags;
  2124. enum mipi_dsi_pixel_format format;
  2125. unsigned int lanes;
  2126. };
  2127. static const struct drm_display_mode auo_b080uan01_mode = {
  2128. .clock = 154500,
  2129. .hdisplay = 1200,
  2130. .hsync_start = 1200 + 62,
  2131. .hsync_end = 1200 + 62 + 4,
  2132. .htotal = 1200 + 62 + 4 + 62,
  2133. .vdisplay = 1920,
  2134. .vsync_start = 1920 + 9,
  2135. .vsync_end = 1920 + 9 + 2,
  2136. .vtotal = 1920 + 9 + 2 + 8,
  2137. .vrefresh = 60,
  2138. };
  2139. static const struct panel_desc_dsi auo_b080uan01 = {
  2140. .desc = {
  2141. .modes = &auo_b080uan01_mode,
  2142. .num_modes = 1,
  2143. .bpc = 8,
  2144. .size = {
  2145. .width = 108,
  2146. .height = 272,
  2147. },
  2148. },
  2149. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
  2150. .format = MIPI_DSI_FMT_RGB888,
  2151. .lanes = 4,
  2152. };
  2153. static const struct drm_display_mode boe_tv080wum_nl0_mode = {
  2154. .clock = 160000,
  2155. .hdisplay = 1200,
  2156. .hsync_start = 1200 + 120,
  2157. .hsync_end = 1200 + 120 + 20,
  2158. .htotal = 1200 + 120 + 20 + 21,
  2159. .vdisplay = 1920,
  2160. .vsync_start = 1920 + 21,
  2161. .vsync_end = 1920 + 21 + 3,
  2162. .vtotal = 1920 + 21 + 3 + 18,
  2163. .vrefresh = 60,
  2164. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  2165. };
  2166. static const struct panel_desc_dsi boe_tv080wum_nl0 = {
  2167. .desc = {
  2168. .modes = &boe_tv080wum_nl0_mode,
  2169. .num_modes = 1,
  2170. .size = {
  2171. .width = 107,
  2172. .height = 172,
  2173. },
  2174. },
  2175. .flags = MIPI_DSI_MODE_VIDEO |
  2176. MIPI_DSI_MODE_VIDEO_BURST |
  2177. MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
  2178. .format = MIPI_DSI_FMT_RGB888,
  2179. .lanes = 4,
  2180. };
  2181. static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
  2182. .clock = 71000,
  2183. .hdisplay = 800,
  2184. .hsync_start = 800 + 32,
  2185. .hsync_end = 800 + 32 + 1,
  2186. .htotal = 800 + 32 + 1 + 57,
  2187. .vdisplay = 1280,
  2188. .vsync_start = 1280 + 28,
  2189. .vsync_end = 1280 + 28 + 1,
  2190. .vtotal = 1280 + 28 + 1 + 14,
  2191. .vrefresh = 60,
  2192. };
  2193. static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
  2194. .desc = {
  2195. .modes = &lg_ld070wx3_sl01_mode,
  2196. .num_modes = 1,
  2197. .bpc = 8,
  2198. .size = {
  2199. .width = 94,
  2200. .height = 151,
  2201. },
  2202. },
  2203. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
  2204. .format = MIPI_DSI_FMT_RGB888,
  2205. .lanes = 4,
  2206. };
  2207. static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
  2208. .clock = 67000,
  2209. .hdisplay = 720,
  2210. .hsync_start = 720 + 12,
  2211. .hsync_end = 720 + 12 + 4,
  2212. .htotal = 720 + 12 + 4 + 112,
  2213. .vdisplay = 1280,
  2214. .vsync_start = 1280 + 8,
  2215. .vsync_end = 1280 + 8 + 4,
  2216. .vtotal = 1280 + 8 + 4 + 12,
  2217. .vrefresh = 60,
  2218. };
  2219. static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
  2220. .desc = {
  2221. .modes = &lg_lh500wx1_sd03_mode,
  2222. .num_modes = 1,
  2223. .bpc = 8,
  2224. .size = {
  2225. .width = 62,
  2226. .height = 110,
  2227. },
  2228. },
  2229. .flags = MIPI_DSI_MODE_VIDEO,
  2230. .format = MIPI_DSI_FMT_RGB888,
  2231. .lanes = 4,
  2232. };
  2233. static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
  2234. .clock = 157200,
  2235. .hdisplay = 1920,
  2236. .hsync_start = 1920 + 154,
  2237. .hsync_end = 1920 + 154 + 16,
  2238. .htotal = 1920 + 154 + 16 + 32,
  2239. .vdisplay = 1200,
  2240. .vsync_start = 1200 + 17,
  2241. .vsync_end = 1200 + 17 + 2,
  2242. .vtotal = 1200 + 17 + 2 + 16,
  2243. .vrefresh = 60,
  2244. };
  2245. static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
  2246. .desc = {
  2247. .modes = &panasonic_vvx10f004b00_mode,
  2248. .num_modes = 1,
  2249. .bpc = 8,
  2250. .size = {
  2251. .width = 217,
  2252. .height = 136,
  2253. },
  2254. },
  2255. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
  2256. MIPI_DSI_CLOCK_NON_CONTINUOUS,
  2257. .format = MIPI_DSI_FMT_RGB888,
  2258. .lanes = 4,
  2259. };
  2260. static const struct of_device_id dsi_of_match[] = {
  2261. {
  2262. .compatible = "auo,b080uan01",
  2263. .data = &auo_b080uan01
  2264. }, {
  2265. .compatible = "boe,tv080wum-nl0",
  2266. .data = &boe_tv080wum_nl0
  2267. }, {
  2268. .compatible = "lg,ld070wx3-sl01",
  2269. .data = &lg_ld070wx3_sl01
  2270. }, {
  2271. .compatible = "lg,lh500wx1-sd03",
  2272. .data = &lg_lh500wx1_sd03
  2273. }, {
  2274. .compatible = "panasonic,vvx10f004b00",
  2275. .data = &panasonic_vvx10f004b00
  2276. }, {
  2277. /* sentinel */
  2278. }
  2279. };
  2280. MODULE_DEVICE_TABLE(of, dsi_of_match);
  2281. static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
  2282. {
  2283. const struct panel_desc_dsi *desc;
  2284. const struct of_device_id *id;
  2285. int err;
  2286. id = of_match_node(dsi_of_match, dsi->dev.of_node);
  2287. if (!id)
  2288. return -ENODEV;
  2289. desc = id->data;
  2290. err = panel_simple_probe(&dsi->dev, &desc->desc);
  2291. if (err < 0)
  2292. return err;
  2293. dsi->mode_flags = desc->flags;
  2294. dsi->format = desc->format;
  2295. dsi->lanes = desc->lanes;
  2296. return mipi_dsi_attach(dsi);
  2297. }
  2298. static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
  2299. {
  2300. int err;
  2301. err = mipi_dsi_detach(dsi);
  2302. if (err < 0)
  2303. dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
  2304. return panel_simple_remove(&dsi->dev);
  2305. }
  2306. static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
  2307. {
  2308. panel_simple_shutdown(&dsi->dev);
  2309. }
  2310. static struct mipi_dsi_driver panel_simple_dsi_driver = {
  2311. .driver = {
  2312. .name = "panel-simple-dsi",
  2313. .of_match_table = dsi_of_match,
  2314. },
  2315. .probe = panel_simple_dsi_probe,
  2316. .remove = panel_simple_dsi_remove,
  2317. .shutdown = panel_simple_dsi_shutdown,
  2318. };
  2319. static int __init panel_simple_init(void)
  2320. {
  2321. int err;
  2322. err = platform_driver_register(&panel_simple_platform_driver);
  2323. if (err < 0)
  2324. return err;
  2325. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
  2326. err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
  2327. if (err < 0)
  2328. return err;
  2329. }
  2330. return 0;
  2331. }
  2332. module_init(panel_simple_init);
  2333. static void __exit panel_simple_exit(void)
  2334. {
  2335. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
  2336. mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
  2337. platform_driver_unregister(&panel_simple_platform_driver);
  2338. }
  2339. module_exit(panel_simple_exit);
  2340. MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
  2341. MODULE_DESCRIPTION("DRM Driver for Simple Panels");
  2342. MODULE_LICENSE("GPL and additional rights");