panel-simple.c 59 KB

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