panel-simple.c 52 KB

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