leds-sun50i-a100.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2021-2023 Samuel Holland <samuel@sholland.org>
  4. *
  5. * Partly based on drivers/leds/leds-turris-omnia.c, which is:
  6. * Copyright (c) 2020 by Marek Behún <kabel@kernel.org>
  7. */
  8. #include <linux/bitfield.h>
  9. #include <linux/clk.h>
  10. #include <linux/delay.h>
  11. #include <linux/dma-mapping.h>
  12. #include <linux/dmaengine.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/io.h>
  15. #include <linux/led-class-multicolor.h>
  16. #include <linux/leds.h>
  17. #include <linux/mod_devicetable.h>
  18. #include <linux/module.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/pm.h>
  21. #include <linux/property.h>
  22. #include <linux/reset.h>
  23. #include <linux/spinlock.h>
  24. #define LEDC_CTRL_REG 0x0000
  25. #define LEDC_CTRL_REG_DATA_LENGTH GENMASK(28, 16)
  26. #define LEDC_CTRL_REG_RGB_MODE GENMASK(8, 6)
  27. #define LEDC_CTRL_REG_LEDC_EN BIT(0)
  28. #define LEDC_T01_TIMING_CTRL_REG 0x0004
  29. #define LEDC_T01_TIMING_CTRL_REG_T1H GENMASK(26, 21)
  30. #define LEDC_T01_TIMING_CTRL_REG_T1L GENMASK(20, 16)
  31. #define LEDC_T01_TIMING_CTRL_REG_T0H GENMASK(10, 6)
  32. #define LEDC_T01_TIMING_CTRL_REG_T0L GENMASK(5, 0)
  33. #define LEDC_RESET_TIMING_CTRL_REG 0x000c
  34. #define LEDC_RESET_TIMING_CTRL_REG_TR GENMASK(28, 16)
  35. #define LEDC_RESET_TIMING_CTRL_REG_LED_NUM GENMASK(9, 0)
  36. #define LEDC_DATA_REG 0x0014
  37. #define LEDC_DMA_CTRL_REG 0x0018
  38. #define LEDC_DMA_CTRL_REG_DMA_EN BIT(5)
  39. #define LEDC_DMA_CTRL_REG_FIFO_TRIG_LEVEL GENMASK(4, 0)
  40. #define LEDC_INT_CTRL_REG 0x001c
  41. #define LEDC_INT_CTRL_REG_GLOBAL_INT_EN BIT(5)
  42. #define LEDC_INT_CTRL_REG_FIFO_CPUREQ_INT_EN BIT(1)
  43. #define LEDC_INT_CTRL_REG_TRANS_FINISH_INT_EN BIT(0)
  44. #define LEDC_INT_STS_REG 0x0020
  45. #define LEDC_INT_STS_REG_FIFO_WLW GENMASK(15, 10)
  46. #define LEDC_INT_STS_REG_FIFO_CPUREQ_INT BIT(1)
  47. #define LEDC_INT_STS_REG_TRANS_FINISH_INT BIT(0)
  48. #define LEDC_FIFO_DEPTH 32U
  49. #define LEDC_MAX_LEDS 1024
  50. #define LEDC_CHANNELS_PER_LED 3 /* RGB */
  51. #define LEDS_TO_BYTES(n) ((n) * sizeof(u32))
  52. struct sun50i_a100_ledc_led {
  53. struct led_classdev_mc mc_cdev;
  54. struct mc_subled subled_info[LEDC_CHANNELS_PER_LED];
  55. u32 addr;
  56. };
  57. #define to_ledc_led(mc) container_of(mc, struct sun50i_a100_ledc_led, mc_cdev)
  58. struct sun50i_a100_ledc_timing {
  59. u32 t0h_ns;
  60. u32 t0l_ns;
  61. u32 t1h_ns;
  62. u32 t1l_ns;
  63. u32 treset_ns;
  64. };
  65. struct sun50i_a100_ledc {
  66. struct device *dev;
  67. void __iomem *base;
  68. struct clk *bus_clk;
  69. struct clk *mod_clk;
  70. struct reset_control *reset;
  71. u32 *buffer;
  72. struct dma_chan *dma_chan;
  73. dma_addr_t dma_handle;
  74. unsigned int pio_length;
  75. unsigned int pio_offset;
  76. spinlock_t lock;
  77. unsigned int next_length;
  78. bool xfer_active;
  79. u32 format;
  80. struct sun50i_a100_ledc_timing timing;
  81. u32 max_addr;
  82. u32 num_leds;
  83. struct sun50i_a100_ledc_led leds[] __counted_by(num_leds);
  84. };
  85. static int sun50i_a100_ledc_dma_xfer(struct sun50i_a100_ledc *priv, unsigned int length)
  86. {
  87. struct dma_async_tx_descriptor *desc;
  88. dma_cookie_t cookie;
  89. desc = dmaengine_prep_slave_single(priv->dma_chan, priv->dma_handle,
  90. LEDS_TO_BYTES(length), DMA_MEM_TO_DEV, 0);
  91. if (!desc)
  92. return -ENOMEM;
  93. cookie = dmaengine_submit(desc);
  94. if (dma_submit_error(cookie))
  95. return -EIO;
  96. dma_async_issue_pending(priv->dma_chan);
  97. return 0;
  98. }
  99. static void sun50i_a100_ledc_pio_xfer(struct sun50i_a100_ledc *priv, unsigned int fifo_used)
  100. {
  101. unsigned int burst, length, offset;
  102. u32 control;
  103. length = priv->pio_length;
  104. offset = priv->pio_offset;
  105. burst = min(length, LEDC_FIFO_DEPTH - fifo_used);
  106. iowrite32_rep(priv->base + LEDC_DATA_REG, priv->buffer + offset, burst);
  107. if (burst < length) {
  108. priv->pio_length = length - burst;
  109. priv->pio_offset = offset + burst;
  110. if (!offset) {
  111. control = readl(priv->base + LEDC_INT_CTRL_REG);
  112. control |= LEDC_INT_CTRL_REG_FIFO_CPUREQ_INT_EN;
  113. writel(control, priv->base + LEDC_INT_CTRL_REG);
  114. }
  115. } else {
  116. /* Disable the request IRQ once all data is written. */
  117. control = readl(priv->base + LEDC_INT_CTRL_REG);
  118. control &= ~LEDC_INT_CTRL_REG_FIFO_CPUREQ_INT_EN;
  119. writel(control, priv->base + LEDC_INT_CTRL_REG);
  120. }
  121. }
  122. static void sun50i_a100_ledc_start_xfer(struct sun50i_a100_ledc *priv, unsigned int length)
  123. {
  124. bool use_dma = false;
  125. u32 control;
  126. if (priv->dma_chan && length > LEDC_FIFO_DEPTH) {
  127. int ret;
  128. ret = sun50i_a100_ledc_dma_xfer(priv, length);
  129. if (ret)
  130. dev_warn(priv->dev, "Failed to set up DMA (%d), using PIO\n", ret);
  131. else
  132. use_dma = true;
  133. }
  134. /* The DMA trigger level must be at least the burst length. */
  135. control = FIELD_PREP(LEDC_DMA_CTRL_REG_DMA_EN, use_dma) |
  136. FIELD_PREP_CONST(LEDC_DMA_CTRL_REG_FIFO_TRIG_LEVEL, LEDC_FIFO_DEPTH / 2);
  137. writel(control, priv->base + LEDC_DMA_CTRL_REG);
  138. control = readl(priv->base + LEDC_CTRL_REG);
  139. control &= ~LEDC_CTRL_REG_DATA_LENGTH;
  140. control |= FIELD_PREP(LEDC_CTRL_REG_DATA_LENGTH, length) | LEDC_CTRL_REG_LEDC_EN;
  141. writel(control, priv->base + LEDC_CTRL_REG);
  142. if (!use_dma) {
  143. /* The FIFO is empty when starting a new transfer. */
  144. unsigned int fifo_used = 0;
  145. priv->pio_length = length;
  146. priv->pio_offset = 0;
  147. sun50i_a100_ledc_pio_xfer(priv, fifo_used);
  148. }
  149. }
  150. static irqreturn_t sun50i_a100_ledc_irq(int irq, void *data)
  151. {
  152. struct sun50i_a100_ledc *priv = data;
  153. u32 status;
  154. status = readl(priv->base + LEDC_INT_STS_REG);
  155. if (status & LEDC_INT_STS_REG_TRANS_FINISH_INT) {
  156. unsigned int next_length;
  157. spin_lock(&priv->lock);
  158. /* If another transfer is queued, dequeue and start it. */
  159. next_length = priv->next_length;
  160. if (next_length)
  161. priv->next_length = 0;
  162. else
  163. priv->xfer_active = false;
  164. spin_unlock(&priv->lock);
  165. if (next_length)
  166. sun50i_a100_ledc_start_xfer(priv, next_length);
  167. } else if (status & LEDC_INT_STS_REG_FIFO_CPUREQ_INT) {
  168. /* Continue the current transfer. */
  169. sun50i_a100_ledc_pio_xfer(priv, FIELD_GET(LEDC_INT_STS_REG_FIFO_WLW, status));
  170. }
  171. /* Clear the W1C status bits. */
  172. writel(status, priv->base + LEDC_INT_STS_REG);
  173. return IRQ_HANDLED;
  174. }
  175. static void sun50i_a100_ledc_brightness_set(struct led_classdev *cdev,
  176. enum led_brightness brightness)
  177. {
  178. struct sun50i_a100_ledc *priv = dev_get_drvdata(cdev->dev->parent);
  179. struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev);
  180. struct sun50i_a100_ledc_led *led = to_ledc_led(mc_cdev);
  181. unsigned int next_length;
  182. unsigned long flags;
  183. bool xfer_active;
  184. led_mc_calc_color_components(mc_cdev, brightness);
  185. priv->buffer[led->addr] = led->subled_info[0].brightness << 16 |
  186. led->subled_info[1].brightness << 8 |
  187. led->subled_info[2].brightness;
  188. spin_lock_irqsave(&priv->lock, flags);
  189. /* Start, enqueue, or extend an enqueued transfer, as appropriate. */
  190. next_length = max(priv->next_length, led->addr + 1);
  191. xfer_active = priv->xfer_active;
  192. if (xfer_active)
  193. priv->next_length = next_length;
  194. else
  195. priv->xfer_active = true;
  196. spin_unlock_irqrestore(&priv->lock, flags);
  197. if (!xfer_active)
  198. sun50i_a100_ledc_start_xfer(priv, next_length);
  199. }
  200. static const char *const sun50i_a100_ledc_formats[] = {
  201. "rgb", "rbg", "grb", "gbr", "brg", "bgr",
  202. };
  203. static int sun50i_a100_ledc_parse_format(struct device *dev,
  204. struct sun50i_a100_ledc *priv)
  205. {
  206. const char *format = "grb";
  207. int i;
  208. device_property_read_string(dev, "allwinner,pixel-format", &format);
  209. i = match_string(sun50i_a100_ledc_formats, ARRAY_SIZE(sun50i_a100_ledc_formats), format);
  210. if (i < 0)
  211. return dev_err_probe(dev, i, "Bad pixel format '%s'\n", format);
  212. priv->format = i;
  213. return 0;
  214. }
  215. static void sun50i_a100_ledc_set_format(struct sun50i_a100_ledc *priv)
  216. {
  217. u32 control;
  218. control = readl(priv->base + LEDC_CTRL_REG);
  219. control &= ~LEDC_CTRL_REG_RGB_MODE;
  220. control |= FIELD_PREP(LEDC_CTRL_REG_RGB_MODE, priv->format);
  221. writel(control, priv->base + LEDC_CTRL_REG);
  222. }
  223. static const struct sun50i_a100_ledc_timing sun50i_a100_ledc_default_timing = {
  224. .t0h_ns = 336,
  225. .t0l_ns = 840,
  226. .t1h_ns = 882,
  227. .t1l_ns = 294,
  228. .treset_ns = 300000,
  229. };
  230. static int sun50i_a100_ledc_parse_timing(struct device *dev,
  231. struct sun50i_a100_ledc *priv)
  232. {
  233. struct sun50i_a100_ledc_timing *timing = &priv->timing;
  234. *timing = sun50i_a100_ledc_default_timing;
  235. device_property_read_u32(dev, "allwinner,t0h-ns", &timing->t0h_ns);
  236. device_property_read_u32(dev, "allwinner,t0l-ns", &timing->t0l_ns);
  237. device_property_read_u32(dev, "allwinner,t1h-ns", &timing->t1h_ns);
  238. device_property_read_u32(dev, "allwinner,t1l-ns", &timing->t1l_ns);
  239. device_property_read_u32(dev, "allwinner,treset-ns", &timing->treset_ns);
  240. return 0;
  241. }
  242. static void sun50i_a100_ledc_set_timing(struct sun50i_a100_ledc *priv)
  243. {
  244. const struct sun50i_a100_ledc_timing *timing = &priv->timing;
  245. unsigned long mod_freq = clk_get_rate(priv->mod_clk);
  246. u32 cycle_ns;
  247. u32 control;
  248. if (!mod_freq)
  249. return;
  250. cycle_ns = NSEC_PER_SEC / mod_freq;
  251. control = FIELD_PREP(LEDC_T01_TIMING_CTRL_REG_T1H, timing->t1h_ns / cycle_ns) |
  252. FIELD_PREP(LEDC_T01_TIMING_CTRL_REG_T1L, timing->t1l_ns / cycle_ns) |
  253. FIELD_PREP(LEDC_T01_TIMING_CTRL_REG_T0H, timing->t0h_ns / cycle_ns) |
  254. FIELD_PREP(LEDC_T01_TIMING_CTRL_REG_T0L, timing->t0l_ns / cycle_ns);
  255. writel(control, priv->base + LEDC_T01_TIMING_CTRL_REG);
  256. control = FIELD_PREP(LEDC_RESET_TIMING_CTRL_REG_TR, timing->treset_ns / cycle_ns) |
  257. FIELD_PREP(LEDC_RESET_TIMING_CTRL_REG_LED_NUM, priv->max_addr);
  258. writel(control, priv->base + LEDC_RESET_TIMING_CTRL_REG);
  259. }
  260. static int sun50i_a100_ledc_resume(struct device *dev)
  261. {
  262. struct sun50i_a100_ledc *priv = dev_get_drvdata(dev);
  263. int ret;
  264. ret = reset_control_deassert(priv->reset);
  265. if (ret)
  266. return ret;
  267. ret = clk_prepare_enable(priv->bus_clk);
  268. if (ret)
  269. goto err_assert_reset;
  270. ret = clk_prepare_enable(priv->mod_clk);
  271. if (ret)
  272. goto err_disable_bus_clk;
  273. sun50i_a100_ledc_set_format(priv);
  274. sun50i_a100_ledc_set_timing(priv);
  275. writel(LEDC_INT_CTRL_REG_GLOBAL_INT_EN | LEDC_INT_CTRL_REG_TRANS_FINISH_INT_EN,
  276. priv->base + LEDC_INT_CTRL_REG);
  277. return 0;
  278. err_disable_bus_clk:
  279. clk_disable_unprepare(priv->bus_clk);
  280. err_assert_reset:
  281. reset_control_assert(priv->reset);
  282. return ret;
  283. }
  284. static int sun50i_a100_ledc_suspend(struct device *dev)
  285. {
  286. struct sun50i_a100_ledc *priv = dev_get_drvdata(dev);
  287. /* Wait for all transfers to complete. */
  288. for (;;) {
  289. unsigned long flags;
  290. bool xfer_active;
  291. spin_lock_irqsave(&priv->lock, flags);
  292. xfer_active = priv->xfer_active;
  293. spin_unlock_irqrestore(&priv->lock, flags);
  294. if (!xfer_active)
  295. break;
  296. usleep_range(1000, 1100);
  297. }
  298. clk_disable_unprepare(priv->mod_clk);
  299. clk_disable_unprepare(priv->bus_clk);
  300. reset_control_assert(priv->reset);
  301. return 0;
  302. }
  303. static void sun50i_a100_ledc_dma_cleanup(void *data)
  304. {
  305. struct sun50i_a100_ledc *priv = data;
  306. dma_release_channel(priv->dma_chan);
  307. }
  308. static int sun50i_a100_ledc_probe(struct platform_device *pdev)
  309. {
  310. struct dma_slave_config dma_cfg = {};
  311. struct led_init_data init_data = {};
  312. struct sun50i_a100_ledc_led *led;
  313. struct device *dev = &pdev->dev;
  314. struct sun50i_a100_ledc *priv;
  315. struct resource *mem;
  316. u32 max_addr = 0;
  317. u32 num_leds = 0;
  318. int irq, ret;
  319. /*
  320. * The maximum LED address must be known in sun50i_a100_ledc_resume() before
  321. * class device registration, so parse and validate the subnodes up front.
  322. */
  323. device_for_each_child_node_scoped(dev, child) {
  324. u32 addr, color;
  325. ret = fwnode_property_read_u32(child, "reg", &addr);
  326. if (ret || addr >= LEDC_MAX_LEDS)
  327. return dev_err_probe(dev, -EINVAL, "'reg' must be between 0 and %d\n",
  328. LEDC_MAX_LEDS - 1);
  329. ret = fwnode_property_read_u32(child, "color", &color);
  330. if (ret || color != LED_COLOR_ID_RGB)
  331. return dev_err_probe(dev, -EINVAL, "'color' must be LED_COLOR_ID_RGB\n");
  332. max_addr = max(max_addr, addr);
  333. num_leds++;
  334. }
  335. if (!num_leds)
  336. return -ENODEV;
  337. priv = devm_kzalloc(dev, struct_size(priv, leds, num_leds), GFP_KERNEL);
  338. if (!priv)
  339. return -ENOMEM;
  340. priv->dev = dev;
  341. priv->max_addr = max_addr;
  342. priv->num_leds = num_leds;
  343. spin_lock_init(&priv->lock);
  344. dev_set_drvdata(dev, priv);
  345. ret = sun50i_a100_ledc_parse_format(dev, priv);
  346. if (ret)
  347. return ret;
  348. ret = sun50i_a100_ledc_parse_timing(dev, priv);
  349. if (ret)
  350. return ret;
  351. priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
  352. if (IS_ERR(priv->base))
  353. return PTR_ERR(priv->base);
  354. priv->bus_clk = devm_clk_get(dev, "bus");
  355. if (IS_ERR(priv->bus_clk))
  356. return PTR_ERR(priv->bus_clk);
  357. priv->mod_clk = devm_clk_get(dev, "mod");
  358. if (IS_ERR(priv->mod_clk))
  359. return PTR_ERR(priv->mod_clk);
  360. priv->reset = devm_reset_control_get_exclusive(dev, NULL);
  361. if (IS_ERR(priv->reset))
  362. return PTR_ERR(priv->reset);
  363. priv->dma_chan = dma_request_chan(dev, "tx");
  364. if (IS_ERR(priv->dma_chan)) {
  365. if (PTR_ERR(priv->dma_chan) != -ENODEV)
  366. return PTR_ERR(priv->dma_chan);
  367. priv->dma_chan = NULL;
  368. priv->buffer = devm_kzalloc(dev, LEDS_TO_BYTES(LEDC_MAX_LEDS), GFP_KERNEL);
  369. if (!priv->buffer)
  370. return -ENOMEM;
  371. } else {
  372. ret = devm_add_action_or_reset(dev, sun50i_a100_ledc_dma_cleanup, priv);
  373. if (ret)
  374. return ret;
  375. dma_cfg.dst_addr = mem->start + LEDC_DATA_REG;
  376. dma_cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
  377. dma_cfg.dst_maxburst = LEDC_FIFO_DEPTH / 2;
  378. ret = dmaengine_slave_config(priv->dma_chan, &dma_cfg);
  379. if (ret)
  380. return ret;
  381. priv->buffer = dmam_alloc_attrs(dmaengine_get_dma_device(priv->dma_chan),
  382. LEDS_TO_BYTES(LEDC_MAX_LEDS), &priv->dma_handle,
  383. GFP_KERNEL, DMA_ATTR_WRITE_COMBINE);
  384. if (!priv->buffer)
  385. return -ENOMEM;
  386. }
  387. irq = platform_get_irq(pdev, 0);
  388. if (irq < 0)
  389. return irq;
  390. ret = devm_request_irq(dev, irq, sun50i_a100_ledc_irq, 0, dev_name(dev), priv);
  391. if (ret)
  392. return ret;
  393. ret = sun50i_a100_ledc_resume(dev);
  394. if (ret)
  395. return ret;
  396. led = priv->leds;
  397. device_for_each_child_node_scoped(dev, child) {
  398. struct led_classdev *cdev;
  399. /* The node was already validated above. */
  400. fwnode_property_read_u32(child, "reg", &led->addr);
  401. led->subled_info[0].color_index = LED_COLOR_ID_RED;
  402. led->subled_info[0].channel = 0;
  403. led->subled_info[1].color_index = LED_COLOR_ID_GREEN;
  404. led->subled_info[1].channel = 1;
  405. led->subled_info[2].color_index = LED_COLOR_ID_BLUE;
  406. led->subled_info[2].channel = 2;
  407. led->mc_cdev.num_colors = ARRAY_SIZE(led->subled_info);
  408. led->mc_cdev.subled_info = led->subled_info;
  409. cdev = &led->mc_cdev.led_cdev;
  410. cdev->max_brightness = U8_MAX;
  411. cdev->brightness_set = sun50i_a100_ledc_brightness_set;
  412. init_data.fwnode = child;
  413. ret = led_classdev_multicolor_register_ext(dev, &led->mc_cdev, &init_data);
  414. if (ret) {
  415. dev_err_probe(dev, ret, "Failed to register multicolor LED %u", led->addr);
  416. while (led-- > priv->leds)
  417. led_classdev_multicolor_unregister(&led->mc_cdev);
  418. sun50i_a100_ledc_suspend(&pdev->dev);
  419. return ret;
  420. }
  421. led++;
  422. }
  423. dev_info(dev, "Registered %u LEDs\n", num_leds);
  424. return 0;
  425. }
  426. static void sun50i_a100_ledc_remove(struct platform_device *pdev)
  427. {
  428. struct sun50i_a100_ledc *priv = platform_get_drvdata(pdev);
  429. for (u32 i = 0; i < priv->num_leds; i++)
  430. led_classdev_multicolor_unregister(&priv->leds[i].mc_cdev);
  431. sun50i_a100_ledc_suspend(&pdev->dev);
  432. }
  433. static const struct of_device_id sun50i_a100_ledc_of_match[] = {
  434. { .compatible = "allwinner,sun50i-a100-ledc" },
  435. {}
  436. };
  437. MODULE_DEVICE_TABLE(of, sun50i_a100_ledc_of_match);
  438. static DEFINE_SIMPLE_DEV_PM_OPS(sun50i_a100_ledc_pm,
  439. sun50i_a100_ledc_suspend,
  440. sun50i_a100_ledc_resume);
  441. static struct platform_driver sun50i_a100_ledc_driver = {
  442. .probe = sun50i_a100_ledc_probe,
  443. .remove = sun50i_a100_ledc_remove,
  444. .shutdown = sun50i_a100_ledc_remove,
  445. .driver = {
  446. .name = "sun50i-a100-ledc",
  447. .of_match_table = sun50i_a100_ledc_of_match,
  448. .pm = pm_ptr(&sun50i_a100_ledc_pm),
  449. },
  450. };
  451. module_platform_driver(sun50i_a100_ledc_driver);
  452. MODULE_AUTHOR("Samuel Holland <samuel@sholland.org>");
  453. MODULE_DESCRIPTION("Allwinner A100 LED controller driver");
  454. MODULE_LICENSE("GPL");