simplefb.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Simplest possible simple frame-buffer driver, as a platform device
  4. *
  5. * Copyright (c) 2013, Stephen Warren
  6. *
  7. * Based on q40fb.c, which was:
  8. * Copyright (C) 2001 Richard Zidlicky <rz@linux-m68k.org>
  9. *
  10. * Also based on offb.c, which was:
  11. * Copyright (C) 1997 Geert Uytterhoeven
  12. * Copyright (C) 1996 Paul Mackerras
  13. */
  14. #include <linux/aperture.h>
  15. #include <linux/clk.h>
  16. #include <linux/errno.h>
  17. #include <linux/fb.h>
  18. #include <linux/io.h>
  19. #include <linux/module.h>
  20. #include <linux/of.h>
  21. #include <linux/of_clk.h>
  22. #include <linux/of_platform.h>
  23. #include <linux/of_reserved_mem.h>
  24. #include <linux/parser.h>
  25. #include <linux/platform_data/simplefb.h>
  26. #include <linux/platform_device.h>
  27. #include <linux/pm_domain.h>
  28. #include <linux/regulator/consumer.h>
  29. static const struct fb_fix_screeninfo simplefb_fix = {
  30. .id = "simple",
  31. .type = FB_TYPE_PACKED_PIXELS,
  32. .visual = FB_VISUAL_TRUECOLOR,
  33. .accel = FB_ACCEL_NONE,
  34. };
  35. static const struct fb_var_screeninfo simplefb_var = {
  36. .height = -1,
  37. .width = -1,
  38. .activate = FB_ACTIVATE_NOW,
  39. .vmode = FB_VMODE_NONINTERLACED,
  40. };
  41. #define PSEUDO_PALETTE_SIZE 16
  42. static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
  43. u_int transp, struct fb_info *info)
  44. {
  45. u32 *pal = info->pseudo_palette;
  46. u32 cr = red >> (16 - info->var.red.length);
  47. u32 cg = green >> (16 - info->var.green.length);
  48. u32 cb = blue >> (16 - info->var.blue.length);
  49. u32 value;
  50. if (regno >= PSEUDO_PALETTE_SIZE)
  51. return -EINVAL;
  52. value = (cr << info->var.red.offset) |
  53. (cg << info->var.green.offset) |
  54. (cb << info->var.blue.offset);
  55. if (info->var.transp.length > 0) {
  56. u32 mask = (1 << info->var.transp.length) - 1;
  57. mask <<= info->var.transp.offset;
  58. value |= mask;
  59. }
  60. pal[regno] = value;
  61. return 0;
  62. }
  63. struct simplefb_par {
  64. u32 palette[PSEUDO_PALETTE_SIZE];
  65. resource_size_t base;
  66. resource_size_t size;
  67. struct resource *mem;
  68. #if defined CONFIG_OF && defined CONFIG_COMMON_CLK
  69. bool clks_enabled;
  70. unsigned int clk_count;
  71. struct clk **clks;
  72. #endif
  73. #if defined CONFIG_OF && defined CONFIG_PM_GENERIC_DOMAINS
  74. unsigned int num_genpds;
  75. struct device **genpds;
  76. struct device_link **genpd_links;
  77. #endif
  78. #if defined CONFIG_OF && defined CONFIG_REGULATOR
  79. bool regulators_enabled;
  80. u32 regulator_count;
  81. struct regulator **regulators;
  82. #endif
  83. };
  84. static void simplefb_clocks_destroy(struct simplefb_par *par);
  85. static void simplefb_regulators_destroy(struct simplefb_par *par);
  86. static void simplefb_detach_genpds(void *res);
  87. /*
  88. * fb_ops.fb_destroy is called by the last put_fb_info() call at the end
  89. * of unregister_framebuffer() or fb_release(). Do any cleanup here.
  90. */
  91. static void simplefb_destroy(struct fb_info *info)
  92. {
  93. struct simplefb_par *par = info->par;
  94. struct resource *mem = par->mem;
  95. simplefb_regulators_destroy(info->par);
  96. simplefb_clocks_destroy(info->par);
  97. simplefb_detach_genpds(info->par);
  98. if (info->screen_base)
  99. iounmap(info->screen_base);
  100. framebuffer_release(info);
  101. if (mem)
  102. release_mem_region(mem->start, resource_size(mem));
  103. }
  104. static const struct fb_ops simplefb_ops = {
  105. .owner = THIS_MODULE,
  106. FB_DEFAULT_IOMEM_OPS,
  107. .fb_destroy = simplefb_destroy,
  108. .fb_setcolreg = simplefb_setcolreg,
  109. };
  110. static struct simplefb_format simplefb_formats[] = SIMPLEFB_FORMATS;
  111. struct simplefb_params {
  112. u32 width;
  113. u32 height;
  114. u32 stride;
  115. struct simplefb_format *format;
  116. struct resource memory;
  117. };
  118. static int simplefb_parse_dt(struct platform_device *pdev,
  119. struct simplefb_params *params)
  120. {
  121. struct device_node *np = pdev->dev.of_node;
  122. int ret;
  123. const char *format;
  124. int i;
  125. ret = of_property_read_u32(np, "width", &params->width);
  126. if (ret) {
  127. dev_err(&pdev->dev, "Can't parse width property\n");
  128. return ret;
  129. }
  130. ret = of_property_read_u32(np, "height", &params->height);
  131. if (ret) {
  132. dev_err(&pdev->dev, "Can't parse height property\n");
  133. return ret;
  134. }
  135. ret = of_property_read_u32(np, "stride", &params->stride);
  136. if (ret) {
  137. dev_err(&pdev->dev, "Can't parse stride property\n");
  138. return ret;
  139. }
  140. ret = of_property_read_string(np, "format", &format);
  141. if (ret) {
  142. dev_err(&pdev->dev, "Can't parse format property\n");
  143. return ret;
  144. }
  145. params->format = NULL;
  146. for (i = 0; i < ARRAY_SIZE(simplefb_formats); i++) {
  147. if (strcmp(format, simplefb_formats[i].name))
  148. continue;
  149. params->format = &simplefb_formats[i];
  150. break;
  151. }
  152. if (!params->format) {
  153. dev_err(&pdev->dev, "Invalid format value\n");
  154. return -EINVAL;
  155. }
  156. ret = of_reserved_mem_region_to_resource(np, 0, &params->memory);
  157. if (!ret) {
  158. if (of_property_present(np, "reg"))
  159. dev_warn(&pdev->dev, "preferring \"memory-region\" over \"reg\" property\n");
  160. } else {
  161. memset(&params->memory, 0, sizeof(params->memory));
  162. }
  163. return 0;
  164. }
  165. static int simplefb_parse_pd(struct platform_device *pdev,
  166. struct simplefb_params *params)
  167. {
  168. struct simplefb_platform_data *pd = dev_get_platdata(&pdev->dev);
  169. int i;
  170. params->width = pd->width;
  171. params->height = pd->height;
  172. params->stride = pd->stride;
  173. params->format = NULL;
  174. for (i = 0; i < ARRAY_SIZE(simplefb_formats); i++) {
  175. if (strcmp(pd->format, simplefb_formats[i].name))
  176. continue;
  177. params->format = &simplefb_formats[i];
  178. break;
  179. }
  180. if (!params->format) {
  181. dev_err(&pdev->dev, "Invalid format value\n");
  182. return -EINVAL;
  183. }
  184. memset(&params->memory, 0, sizeof(params->memory));
  185. return 0;
  186. }
  187. #if defined CONFIG_OF && defined CONFIG_COMMON_CLK
  188. /*
  189. * Clock handling code.
  190. *
  191. * Here we handle the clocks property of our "simple-framebuffer" dt node.
  192. * This is necessary so that we can make sure that any clocks needed by
  193. * the display engine that the bootloader set up for us (and for which it
  194. * provided a simplefb dt node), stay up, for the life of the simplefb
  195. * driver.
  196. *
  197. * When the driver unloads, we cleanly disable, and then release the clocks.
  198. *
  199. * We only complain about errors here, no action is taken as the most likely
  200. * error can only happen due to a mismatch between the bootloader which set
  201. * up simplefb, and the clock definitions in the device tree. Chances are
  202. * that there are no adverse effects, and if there are, a clean teardown of
  203. * the fb probe will not help us much either. So just complain and carry on,
  204. * and hope that the user actually gets a working fb at the end of things.
  205. */
  206. static int simplefb_clocks_get(struct simplefb_par *par,
  207. struct platform_device *pdev)
  208. {
  209. struct device_node *np = pdev->dev.of_node;
  210. struct clk *clock;
  211. int i;
  212. if (dev_get_platdata(&pdev->dev) || !np)
  213. return 0;
  214. par->clk_count = of_clk_get_parent_count(np);
  215. if (!par->clk_count)
  216. return 0;
  217. par->clks = kzalloc_objs(struct clk *, par->clk_count);
  218. if (!par->clks)
  219. return -ENOMEM;
  220. for (i = 0; i < par->clk_count; i++) {
  221. clock = of_clk_get(np, i);
  222. if (IS_ERR(clock)) {
  223. if (PTR_ERR(clock) == -EPROBE_DEFER) {
  224. while (--i >= 0) {
  225. clk_put(par->clks[i]);
  226. }
  227. kfree(par->clks);
  228. return -EPROBE_DEFER;
  229. }
  230. dev_err(&pdev->dev, "%s: clock %d not found: %ld\n",
  231. __func__, i, PTR_ERR(clock));
  232. continue;
  233. }
  234. par->clks[i] = clock;
  235. }
  236. return 0;
  237. }
  238. static void simplefb_clocks_enable(struct simplefb_par *par,
  239. struct platform_device *pdev)
  240. {
  241. int i, ret;
  242. for (i = 0; i < par->clk_count; i++) {
  243. if (par->clks[i]) {
  244. ret = clk_prepare_enable(par->clks[i]);
  245. if (ret) {
  246. dev_err(&pdev->dev,
  247. "%s: failed to enable clock %d: %d\n",
  248. __func__, i, ret);
  249. clk_put(par->clks[i]);
  250. par->clks[i] = NULL;
  251. }
  252. }
  253. }
  254. par->clks_enabled = true;
  255. }
  256. static void simplefb_clocks_destroy(struct simplefb_par *par)
  257. {
  258. int i;
  259. if (!par->clks)
  260. return;
  261. for (i = 0; i < par->clk_count; i++) {
  262. if (par->clks[i]) {
  263. if (par->clks_enabled)
  264. clk_disable_unprepare(par->clks[i]);
  265. clk_put(par->clks[i]);
  266. }
  267. }
  268. kfree(par->clks);
  269. }
  270. #else
  271. static int simplefb_clocks_get(struct simplefb_par *par,
  272. struct platform_device *pdev) { return 0; }
  273. static void simplefb_clocks_enable(struct simplefb_par *par,
  274. struct platform_device *pdev) { }
  275. static void simplefb_clocks_destroy(struct simplefb_par *par) { }
  276. #endif
  277. #if defined CONFIG_OF && defined CONFIG_REGULATOR
  278. #define SUPPLY_SUFFIX "-supply"
  279. /*
  280. * Regulator handling code.
  281. *
  282. * Here we handle the num-supplies and vin*-supply properties of our
  283. * "simple-framebuffer" dt node. This is necessary so that we can make sure
  284. * that any regulators needed by the display hardware that the bootloader
  285. * set up for us (and for which it provided a simplefb dt node), stay up,
  286. * for the life of the simplefb driver.
  287. *
  288. * When the driver unloads, we cleanly disable, and then release the
  289. * regulators.
  290. *
  291. * We only complain about errors here, no action is taken as the most likely
  292. * error can only happen due to a mismatch between the bootloader which set
  293. * up simplefb, and the regulator definitions in the device tree. Chances are
  294. * that there are no adverse effects, and if there are, a clean teardown of
  295. * the fb probe will not help us much either. So just complain and carry on,
  296. * and hope that the user actually gets a working fb at the end of things.
  297. */
  298. static int simplefb_regulators_get(struct simplefb_par *par,
  299. struct platform_device *pdev)
  300. {
  301. struct device_node *np = pdev->dev.of_node;
  302. struct property *prop;
  303. struct regulator *regulator;
  304. const char *p;
  305. int count = 0, i = 0;
  306. if (dev_get_platdata(&pdev->dev) || !np)
  307. return 0;
  308. /* Count the number of regulator supplies */
  309. for_each_property_of_node(np, prop) {
  310. p = strstr(prop->name, SUPPLY_SUFFIX);
  311. if (p && p != prop->name)
  312. count++;
  313. }
  314. if (!count)
  315. return 0;
  316. par->regulators = devm_kcalloc(&pdev->dev, count,
  317. sizeof(struct regulator *), GFP_KERNEL);
  318. if (!par->regulators)
  319. return -ENOMEM;
  320. /* Get all the regulators */
  321. for_each_property_of_node(np, prop) {
  322. char name[32]; /* 32 is max size of property name */
  323. p = strstr(prop->name, SUPPLY_SUFFIX);
  324. if (!p || p == prop->name)
  325. continue;
  326. strscpy(name, prop->name,
  327. strlen(prop->name) - strlen(SUPPLY_SUFFIX) + 1);
  328. regulator = devm_regulator_get_optional(&pdev->dev, name);
  329. if (IS_ERR(regulator)) {
  330. if (PTR_ERR(regulator) == -EPROBE_DEFER)
  331. return -EPROBE_DEFER;
  332. dev_err(&pdev->dev, "regulator %s not found: %ld\n",
  333. name, PTR_ERR(regulator));
  334. continue;
  335. }
  336. par->regulators[i++] = regulator;
  337. }
  338. par->regulator_count = i;
  339. return 0;
  340. }
  341. static void simplefb_regulators_enable(struct simplefb_par *par,
  342. struct platform_device *pdev)
  343. {
  344. int i, ret;
  345. /* Enable all the regulators */
  346. for (i = 0; i < par->regulator_count; i++) {
  347. ret = regulator_enable(par->regulators[i]);
  348. if (ret) {
  349. dev_err(&pdev->dev,
  350. "failed to enable regulator %d: %d\n",
  351. i, ret);
  352. devm_regulator_put(par->regulators[i]);
  353. par->regulators[i] = NULL;
  354. }
  355. }
  356. par->regulators_enabled = true;
  357. }
  358. static void simplefb_regulators_destroy(struct simplefb_par *par)
  359. {
  360. int i;
  361. if (!par->regulators || !par->regulators_enabled)
  362. return;
  363. for (i = 0; i < par->regulator_count; i++)
  364. if (par->regulators[i])
  365. regulator_disable(par->regulators[i]);
  366. }
  367. #else
  368. static int simplefb_regulators_get(struct simplefb_par *par,
  369. struct platform_device *pdev) { return 0; }
  370. static void simplefb_regulators_enable(struct simplefb_par *par,
  371. struct platform_device *pdev) { }
  372. static void simplefb_regulators_destroy(struct simplefb_par *par) { }
  373. #endif
  374. #if defined CONFIG_OF && defined CONFIG_PM_GENERIC_DOMAINS
  375. static void simplefb_detach_genpds(void *res)
  376. {
  377. struct simplefb_par *par = res;
  378. unsigned int i = par->num_genpds;
  379. if (par->num_genpds <= 1)
  380. return;
  381. while (i--) {
  382. if (par->genpd_links[i])
  383. device_link_del(par->genpd_links[i]);
  384. if (!IS_ERR_OR_NULL(par->genpds[i]))
  385. dev_pm_domain_detach(par->genpds[i], true);
  386. }
  387. par->num_genpds = 0;
  388. }
  389. static int simplefb_attach_genpds(struct simplefb_par *par,
  390. struct platform_device *pdev)
  391. {
  392. struct device *dev = &pdev->dev;
  393. unsigned int i, num_genpds;
  394. int err;
  395. err = of_count_phandle_with_args(dev->of_node, "power-domains",
  396. "#power-domain-cells");
  397. if (err < 0) {
  398. /* Nothing wrong if optional PDs are missing */
  399. if (err == -ENOENT)
  400. return 0;
  401. dev_err(dev, "failed to parse power-domains: %d\n", err);
  402. return err;
  403. }
  404. num_genpds = err;
  405. /*
  406. * Single power-domain devices are handled by the driver core, so
  407. * nothing to do here.
  408. */
  409. if (num_genpds <= 1) {
  410. par->num_genpds = num_genpds;
  411. return 0;
  412. }
  413. par->genpds = devm_kcalloc(dev, num_genpds, sizeof(*par->genpds),
  414. GFP_KERNEL);
  415. if (!par->genpds)
  416. return -ENOMEM;
  417. par->genpd_links = devm_kcalloc(dev, num_genpds,
  418. sizeof(*par->genpd_links),
  419. GFP_KERNEL);
  420. if (!par->genpd_links)
  421. return -ENOMEM;
  422. /*
  423. * Set par->num_genpds only after genpds and genpd_links are allocated
  424. * to exit early from simplefb_detach_genpds() without full
  425. * initialisation.
  426. */
  427. par->num_genpds = num_genpds;
  428. for (i = 0; i < par->num_genpds; i++) {
  429. par->genpds[i] = dev_pm_domain_attach_by_id(dev, i);
  430. if (IS_ERR(par->genpds[i])) {
  431. err = PTR_ERR(par->genpds[i]);
  432. if (err == -EPROBE_DEFER) {
  433. simplefb_detach_genpds(par);
  434. return err;
  435. }
  436. dev_warn(dev, "failed to attach domain %u: %d\n", i, err);
  437. continue;
  438. }
  439. par->genpd_links[i] = device_link_add(dev, par->genpds[i],
  440. DL_FLAG_STATELESS |
  441. DL_FLAG_PM_RUNTIME |
  442. DL_FLAG_RPM_ACTIVE);
  443. if (!par->genpd_links[i])
  444. dev_warn(dev, "failed to link power-domain %u\n", i);
  445. }
  446. return 0;
  447. }
  448. #else
  449. static void simplefb_detach_genpds(void *res) { }
  450. static int simplefb_attach_genpds(struct simplefb_par *par,
  451. struct platform_device *pdev)
  452. {
  453. return 0;
  454. }
  455. #endif
  456. static int simplefb_probe(struct platform_device *pdev)
  457. {
  458. int ret;
  459. struct simplefb_params params;
  460. struct fb_info *info;
  461. struct simplefb_par *par;
  462. struct resource *res, *mem;
  463. if (fb_get_options("simplefb", NULL))
  464. return -ENODEV;
  465. ret = -ENODEV;
  466. if (dev_get_platdata(&pdev->dev))
  467. ret = simplefb_parse_pd(pdev, &params);
  468. else if (pdev->dev.of_node)
  469. ret = simplefb_parse_dt(pdev, &params);
  470. if (ret)
  471. return ret;
  472. if (params.memory.start == 0 && params.memory.end == 0) {
  473. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  474. if (!res) {
  475. dev_err(&pdev->dev, "No memory resource\n");
  476. return -EINVAL;
  477. }
  478. } else {
  479. res = &params.memory;
  480. }
  481. mem = request_mem_region(res->start, resource_size(res), "simplefb");
  482. if (!mem) {
  483. /*
  484. * We cannot make this fatal. Sometimes this comes from magic
  485. * spaces our resource handlers simply don't know about. Use
  486. * the I/O-memory resource as-is and try to map that instead.
  487. */
  488. dev_warn(&pdev->dev, "simplefb: cannot reserve video memory at %pR\n", res);
  489. mem = res;
  490. }
  491. info = framebuffer_alloc(sizeof(struct simplefb_par), &pdev->dev);
  492. if (!info) {
  493. ret = -ENOMEM;
  494. goto error_release_mem_region;
  495. }
  496. platform_set_drvdata(pdev, info);
  497. par = info->par;
  498. info->fix = simplefb_fix;
  499. info->fix.smem_start = mem->start;
  500. info->fix.smem_len = resource_size(mem);
  501. info->fix.line_length = params.stride;
  502. info->var = simplefb_var;
  503. info->var.xres = params.width;
  504. info->var.yres = params.height;
  505. info->var.xres_virtual = params.width;
  506. info->var.yres_virtual = params.height;
  507. info->var.bits_per_pixel = params.format->bits_per_pixel;
  508. info->var.red = params.format->red;
  509. info->var.green = params.format->green;
  510. info->var.blue = params.format->blue;
  511. info->var.transp = params.format->transp;
  512. par->base = info->fix.smem_start;
  513. par->size = info->fix.smem_len;
  514. info->fbops = &simplefb_ops;
  515. info->screen_base = ioremap_wc(info->fix.smem_start,
  516. info->fix.smem_len);
  517. if (!info->screen_base) {
  518. ret = -ENOMEM;
  519. goto error_fb_release;
  520. }
  521. info->pseudo_palette = par->palette;
  522. ret = simplefb_clocks_get(par, pdev);
  523. if (ret < 0)
  524. goto error_unmap;
  525. ret = simplefb_regulators_get(par, pdev);
  526. if (ret < 0)
  527. goto error_clocks;
  528. ret = simplefb_attach_genpds(par, pdev);
  529. if (ret < 0)
  530. goto error_regulators;
  531. simplefb_clocks_enable(par, pdev);
  532. simplefb_regulators_enable(par, pdev);
  533. dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes\n",
  534. info->fix.smem_start, info->fix.smem_len);
  535. dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
  536. params.format->name,
  537. info->var.xres, info->var.yres,
  538. info->var.bits_per_pixel, info->fix.line_length);
  539. if (mem != res)
  540. par->mem = mem; /* release in clean-up handler */
  541. ret = devm_aperture_acquire_for_platform_device(pdev, par->base, par->size);
  542. if (ret) {
  543. dev_err(&pdev->dev, "Unable to acquire aperture: %d\n", ret);
  544. goto error_genpds;
  545. }
  546. ret = register_framebuffer(info);
  547. if (ret < 0) {
  548. dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
  549. goto error_genpds;
  550. }
  551. dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
  552. return 0;
  553. error_genpds:
  554. simplefb_detach_genpds(par);
  555. error_regulators:
  556. simplefb_regulators_destroy(par);
  557. error_clocks:
  558. simplefb_clocks_destroy(par);
  559. error_unmap:
  560. iounmap(info->screen_base);
  561. error_fb_release:
  562. framebuffer_release(info);
  563. error_release_mem_region:
  564. if (mem != res)
  565. release_mem_region(mem->start, resource_size(mem));
  566. return ret;
  567. }
  568. static void simplefb_remove(struct platform_device *pdev)
  569. {
  570. struct fb_info *info = platform_get_drvdata(pdev);
  571. /* simplefb_destroy takes care of info cleanup */
  572. unregister_framebuffer(info);
  573. }
  574. static const struct of_device_id simplefb_of_match[] = {
  575. { .compatible = "simple-framebuffer", },
  576. { },
  577. };
  578. MODULE_DEVICE_TABLE(of, simplefb_of_match);
  579. static struct platform_driver simplefb_driver = {
  580. .driver = {
  581. .name = "simple-framebuffer",
  582. .of_match_table = simplefb_of_match,
  583. },
  584. .probe = simplefb_probe,
  585. .remove = simplefb_remove,
  586. };
  587. module_platform_driver(simplefb_driver);
  588. MODULE_AUTHOR("Stephen Warren <swarren@wwwdotorg.org>");
  589. MODULE_DESCRIPTION("Simple framebuffer driver");
  590. MODULE_LICENSE("GPL v2");