panel-simple.c 58 KB

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