panel-simple.c 57 KB

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