gpio-generic.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. /*
  2. * Generic driver for memory-mapped GPIO controllers.
  3. *
  4. * Copyright 2008 MontaVista Software, Inc.
  5. * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * ....``.```~~~~````.`.`.`.`.```````'',,,.........`````......`.......
  13. * ...`` ```````..
  14. * ..The simplest form of a GPIO controller that the driver supports is``
  15. * `.just a single "data" register, where GPIO state can be read and/or `
  16. * `,..written. ,,..``~~~~ .....``.`.`.~~.```.`.........``````.```````
  17. * `````````
  18. ___
  19. _/~~|___/~| . ```~~~~~~ ___/___\___ ,~.`.`.`.`````.~~...,,,,...
  20. __________|~$@~~~ %~ /o*o*o*o*o*o\ .. Implementing such a GPIO .
  21. o ` ~~~~\___/~~~~ ` controller in FPGA is ,.`
  22. `....trivial..'~`.```.```
  23. * ```````
  24. * .```````~~~~`..`.``.``.
  25. * . The driver supports `... ,..```.`~~~```````````````....````.``,,
  26. * . big-endian notation, just`. .. A bit more sophisticated controllers ,
  27. * . register the device with -be`. .with a pair of set/clear-bit registers ,
  28. * `.. suffix. ```~~`````....`.` . affecting the data register and the .`
  29. * ``.`.``...``` ```.. output pins are also supported.`
  30. * ^^ `````.`````````.,``~``~``~~``````
  31. * . ^^
  32. * ,..`.`.`...````````````......`.`.`.`.`.`..`.`.`..
  33. * .. The expectation is that in at least some cases . ,-~~~-,
  34. * .this will be used with roll-your-own ASIC/FPGA .` \ /
  35. * .logic in Verilog or VHDL. ~~~`````````..`````~~` \ /
  36. * ..````````......``````````` \o_
  37. * |
  38. * ^^ / \
  39. *
  40. * ...`````~~`.....``.`..........``````.`.``.```........``.
  41. * ` 8, 16, 32 and 64 bits registers are supported, and``.
  42. * . the number of GPIOs is determined by the width of ~
  43. * .. the registers. ,............```.`.`..`.`.~~~.`.`.`~
  44. * `.......````.```
  45. */
  46. #include <linux/init.h>
  47. #include <linux/err.h>
  48. #include <linux/bug.h>
  49. #include <linux/kernel.h>
  50. #include <linux/module.h>
  51. #include <linux/spinlock.h>
  52. #include <linux/compiler.h>
  53. #include <linux/types.h>
  54. #include <linux/errno.h>
  55. #include <linux/log2.h>
  56. #include <linux/ioport.h>
  57. #include <linux/io.h>
  58. #include <linux/gpio.h>
  59. #include <linux/slab.h>
  60. #include <linux/platform_device.h>
  61. #include <linux/mod_devicetable.h>
  62. #include <linux/basic_mmio_gpio.h>
  63. static void bgpio_write8(void __iomem *reg, unsigned long data)
  64. {
  65. writeb(data, reg);
  66. }
  67. static unsigned long bgpio_read8(void __iomem *reg)
  68. {
  69. return readb(reg);
  70. }
  71. static void bgpio_write16(void __iomem *reg, unsigned long data)
  72. {
  73. writew(data, reg);
  74. }
  75. static unsigned long bgpio_read16(void __iomem *reg)
  76. {
  77. return readw(reg);
  78. }
  79. static void bgpio_write32(void __iomem *reg, unsigned long data)
  80. {
  81. writel(data, reg);
  82. }
  83. static unsigned long bgpio_read32(void __iomem *reg)
  84. {
  85. return readl(reg);
  86. }
  87. #if BITS_PER_LONG >= 64
  88. static void bgpio_write64(void __iomem *reg, unsigned long data)
  89. {
  90. writeq(data, reg);
  91. }
  92. static unsigned long bgpio_read64(void __iomem *reg)
  93. {
  94. return readq(reg);
  95. }
  96. #endif /* BITS_PER_LONG >= 64 */
  97. static void bgpio_write16be(void __iomem *reg, unsigned long data)
  98. {
  99. iowrite16be(data, reg);
  100. }
  101. static unsigned long bgpio_read16be(void __iomem *reg)
  102. {
  103. return ioread16be(reg);
  104. }
  105. static void bgpio_write32be(void __iomem *reg, unsigned long data)
  106. {
  107. iowrite32be(data, reg);
  108. }
  109. static unsigned long bgpio_read32be(void __iomem *reg)
  110. {
  111. return ioread32be(reg);
  112. }
  113. static unsigned long bgpio_pin2mask(struct bgpio_chip *bgc, unsigned int pin)
  114. {
  115. return 1 << pin;
  116. }
  117. static unsigned long bgpio_pin2mask_be(struct bgpio_chip *bgc,
  118. unsigned int pin)
  119. {
  120. return 1 << (bgc->bits - 1 - pin);
  121. }
  122. static int bgpio_get_set(struct gpio_chip *gc, unsigned int gpio)
  123. {
  124. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  125. unsigned long pinmask = bgc->pin2mask(bgc, gpio);
  126. if (bgc->dir & pinmask)
  127. return bgc->read_reg(bgc->reg_set) & pinmask;
  128. else
  129. return bgc->read_reg(bgc->reg_dat) & pinmask;
  130. }
  131. static int bgpio_get(struct gpio_chip *gc, unsigned int gpio)
  132. {
  133. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  134. return !!(bgc->read_reg(bgc->reg_dat) & bgc->pin2mask(bgc, gpio));
  135. }
  136. static void bgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
  137. {
  138. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  139. unsigned long mask = bgc->pin2mask(bgc, gpio);
  140. unsigned long flags;
  141. spin_lock_irqsave(&bgc->lock, flags);
  142. if (val)
  143. bgc->data |= mask;
  144. else
  145. bgc->data &= ~mask;
  146. bgc->write_reg(bgc->reg_dat, bgc->data);
  147. spin_unlock_irqrestore(&bgc->lock, flags);
  148. }
  149. static void bgpio_set_with_clear(struct gpio_chip *gc, unsigned int gpio,
  150. int val)
  151. {
  152. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  153. unsigned long mask = bgc->pin2mask(bgc, gpio);
  154. if (val)
  155. bgc->write_reg(bgc->reg_set, mask);
  156. else
  157. bgc->write_reg(bgc->reg_clr, mask);
  158. }
  159. static void bgpio_set_set(struct gpio_chip *gc, unsigned int gpio, int val)
  160. {
  161. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  162. unsigned long mask = bgc->pin2mask(bgc, gpio);
  163. unsigned long flags;
  164. spin_lock_irqsave(&bgc->lock, flags);
  165. if (val)
  166. bgc->data |= mask;
  167. else
  168. bgc->data &= ~mask;
  169. bgc->write_reg(bgc->reg_set, bgc->data);
  170. spin_unlock_irqrestore(&bgc->lock, flags);
  171. }
  172. static void bgpio_multiple_get_masks(struct bgpio_chip *bgc,
  173. unsigned long *mask, unsigned long *bits,
  174. unsigned long *set_mask,
  175. unsigned long *clear_mask)
  176. {
  177. int i;
  178. *set_mask = 0;
  179. *clear_mask = 0;
  180. for (i = 0; i < bgc->bits; i++) {
  181. if (*mask == 0)
  182. break;
  183. if (__test_and_clear_bit(i, mask)) {
  184. if (test_bit(i, bits))
  185. *set_mask |= bgc->pin2mask(bgc, i);
  186. else
  187. *clear_mask |= bgc->pin2mask(bgc, i);
  188. }
  189. }
  190. }
  191. static void bgpio_set_multiple_single_reg(struct bgpio_chip *bgc,
  192. unsigned long *mask,
  193. unsigned long *bits,
  194. void __iomem *reg)
  195. {
  196. unsigned long flags;
  197. unsigned long set_mask, clear_mask;
  198. spin_lock_irqsave(&bgc->lock, flags);
  199. bgpio_multiple_get_masks(bgc, mask, bits, &set_mask, &clear_mask);
  200. bgc->data |= set_mask;
  201. bgc->data &= ~clear_mask;
  202. bgc->write_reg(reg, bgc->data);
  203. spin_unlock_irqrestore(&bgc->lock, flags);
  204. }
  205. static void bgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
  206. unsigned long *bits)
  207. {
  208. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  209. bgpio_set_multiple_single_reg(bgc, mask, bits, bgc->reg_dat);
  210. }
  211. static void bgpio_set_multiple_set(struct gpio_chip *gc, unsigned long *mask,
  212. unsigned long *bits)
  213. {
  214. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  215. bgpio_set_multiple_single_reg(bgc, mask, bits, bgc->reg_set);
  216. }
  217. static void bgpio_set_multiple_with_clear(struct gpio_chip *gc,
  218. unsigned long *mask,
  219. unsigned long *bits)
  220. {
  221. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  222. unsigned long set_mask, clear_mask;
  223. bgpio_multiple_get_masks(bgc, mask, bits, &set_mask, &clear_mask);
  224. if (set_mask)
  225. bgc->write_reg(bgc->reg_set, set_mask);
  226. if (clear_mask)
  227. bgc->write_reg(bgc->reg_clr, clear_mask);
  228. }
  229. static int bgpio_simple_dir_in(struct gpio_chip *gc, unsigned int gpio)
  230. {
  231. return 0;
  232. }
  233. static int bgpio_simple_dir_out(struct gpio_chip *gc, unsigned int gpio,
  234. int val)
  235. {
  236. gc->set(gc, gpio, val);
  237. return 0;
  238. }
  239. static int bgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
  240. {
  241. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  242. unsigned long flags;
  243. spin_lock_irqsave(&bgc->lock, flags);
  244. bgc->dir &= ~bgc->pin2mask(bgc, gpio);
  245. bgc->write_reg(bgc->reg_dir, bgc->dir);
  246. spin_unlock_irqrestore(&bgc->lock, flags);
  247. return 0;
  248. }
  249. static int bgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
  250. {
  251. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  252. unsigned long flags;
  253. gc->set(gc, gpio, val);
  254. spin_lock_irqsave(&bgc->lock, flags);
  255. bgc->dir |= bgc->pin2mask(bgc, gpio);
  256. bgc->write_reg(bgc->reg_dir, bgc->dir);
  257. spin_unlock_irqrestore(&bgc->lock, flags);
  258. return 0;
  259. }
  260. static int bgpio_dir_in_inv(struct gpio_chip *gc, unsigned int gpio)
  261. {
  262. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  263. unsigned long flags;
  264. spin_lock_irqsave(&bgc->lock, flags);
  265. bgc->dir |= bgc->pin2mask(bgc, gpio);
  266. bgc->write_reg(bgc->reg_dir, bgc->dir);
  267. spin_unlock_irqrestore(&bgc->lock, flags);
  268. return 0;
  269. }
  270. static int bgpio_dir_out_inv(struct gpio_chip *gc, unsigned int gpio, int val)
  271. {
  272. struct bgpio_chip *bgc = to_bgpio_chip(gc);
  273. unsigned long flags;
  274. gc->set(gc, gpio, val);
  275. spin_lock_irqsave(&bgc->lock, flags);
  276. bgc->dir &= ~bgc->pin2mask(bgc, gpio);
  277. bgc->write_reg(bgc->reg_dir, bgc->dir);
  278. spin_unlock_irqrestore(&bgc->lock, flags);
  279. return 0;
  280. }
  281. static int bgpio_setup_accessors(struct device *dev,
  282. struct bgpio_chip *bgc,
  283. bool bit_be,
  284. bool byte_be)
  285. {
  286. switch (bgc->bits) {
  287. case 8:
  288. bgc->read_reg = bgpio_read8;
  289. bgc->write_reg = bgpio_write8;
  290. break;
  291. case 16:
  292. if (byte_be) {
  293. bgc->read_reg = bgpio_read16be;
  294. bgc->write_reg = bgpio_write16be;
  295. } else {
  296. bgc->read_reg = bgpio_read16;
  297. bgc->write_reg = bgpio_write16;
  298. }
  299. break;
  300. case 32:
  301. if (byte_be) {
  302. bgc->read_reg = bgpio_read32be;
  303. bgc->write_reg = bgpio_write32be;
  304. } else {
  305. bgc->read_reg = bgpio_read32;
  306. bgc->write_reg = bgpio_write32;
  307. }
  308. break;
  309. #if BITS_PER_LONG >= 64
  310. case 64:
  311. if (byte_be) {
  312. dev_err(dev,
  313. "64 bit big endian byte order unsupported\n");
  314. return -EINVAL;
  315. } else {
  316. bgc->read_reg = bgpio_read64;
  317. bgc->write_reg = bgpio_write64;
  318. }
  319. break;
  320. #endif /* BITS_PER_LONG >= 64 */
  321. default:
  322. dev_err(dev, "unsupported data width %u bits\n", bgc->bits);
  323. return -EINVAL;
  324. }
  325. bgc->pin2mask = bit_be ? bgpio_pin2mask_be : bgpio_pin2mask;
  326. return 0;
  327. }
  328. /*
  329. * Create the device and allocate the resources. For setting GPIO's there are
  330. * three supported configurations:
  331. *
  332. * - single input/output register resource (named "dat").
  333. * - set/clear pair (named "set" and "clr").
  334. * - single output register resource and single input resource ("set" and
  335. * dat").
  336. *
  337. * For the single output register, this drives a 1 by setting a bit and a zero
  338. * by clearing a bit. For the set clr pair, this drives a 1 by setting a bit
  339. * in the set register and clears it by setting a bit in the clear register.
  340. * The configuration is detected by which resources are present.
  341. *
  342. * For setting the GPIO direction, there are three supported configurations:
  343. *
  344. * - simple bidirection GPIO that requires no configuration.
  345. * - an output direction register (named "dirout") where a 1 bit
  346. * indicates the GPIO is an output.
  347. * - an input direction register (named "dirin") where a 1 bit indicates
  348. * the GPIO is an input.
  349. */
  350. static int bgpio_setup_io(struct bgpio_chip *bgc,
  351. void __iomem *dat,
  352. void __iomem *set,
  353. void __iomem *clr,
  354. unsigned long flags)
  355. {
  356. bgc->reg_dat = dat;
  357. if (!bgc->reg_dat)
  358. return -EINVAL;
  359. if (set && clr) {
  360. bgc->reg_set = set;
  361. bgc->reg_clr = clr;
  362. bgc->gc.set = bgpio_set_with_clear;
  363. bgc->gc.set_multiple = bgpio_set_multiple_with_clear;
  364. } else if (set && !clr) {
  365. bgc->reg_set = set;
  366. bgc->gc.set = bgpio_set_set;
  367. bgc->gc.set_multiple = bgpio_set_multiple_set;
  368. } else {
  369. bgc->gc.set = bgpio_set;
  370. bgc->gc.set_multiple = bgpio_set_multiple;
  371. }
  372. if (!(flags & BGPIOF_UNREADABLE_REG_SET) &&
  373. (flags & BGPIOF_READ_OUTPUT_REG_SET))
  374. bgc->gc.get = bgpio_get_set;
  375. else
  376. bgc->gc.get = bgpio_get;
  377. return 0;
  378. }
  379. static int bgpio_setup_direction(struct bgpio_chip *bgc,
  380. void __iomem *dirout,
  381. void __iomem *dirin)
  382. {
  383. if (dirout && dirin) {
  384. return -EINVAL;
  385. } else if (dirout) {
  386. bgc->reg_dir = dirout;
  387. bgc->gc.direction_output = bgpio_dir_out;
  388. bgc->gc.direction_input = bgpio_dir_in;
  389. } else if (dirin) {
  390. bgc->reg_dir = dirin;
  391. bgc->gc.direction_output = bgpio_dir_out_inv;
  392. bgc->gc.direction_input = bgpio_dir_in_inv;
  393. } else {
  394. bgc->gc.direction_output = bgpio_simple_dir_out;
  395. bgc->gc.direction_input = bgpio_simple_dir_in;
  396. }
  397. return 0;
  398. }
  399. static int bgpio_request(struct gpio_chip *chip, unsigned gpio_pin)
  400. {
  401. if (gpio_pin < chip->ngpio)
  402. return 0;
  403. return -EINVAL;
  404. }
  405. int bgpio_remove(struct bgpio_chip *bgc)
  406. {
  407. gpiochip_remove(&bgc->gc);
  408. return 0;
  409. }
  410. EXPORT_SYMBOL_GPL(bgpio_remove);
  411. int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
  412. unsigned long sz, void __iomem *dat, void __iomem *set,
  413. void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
  414. unsigned long flags)
  415. {
  416. int ret;
  417. if (!is_power_of_2(sz))
  418. return -EINVAL;
  419. bgc->bits = sz * 8;
  420. if (bgc->bits > BITS_PER_LONG)
  421. return -EINVAL;
  422. spin_lock_init(&bgc->lock);
  423. bgc->gc.dev = dev;
  424. bgc->gc.label = dev_name(dev);
  425. bgc->gc.base = -1;
  426. bgc->gc.ngpio = bgc->bits;
  427. bgc->gc.request = bgpio_request;
  428. ret = bgpio_setup_io(bgc, dat, set, clr, flags);
  429. if (ret)
  430. return ret;
  431. ret = bgpio_setup_accessors(dev, bgc, flags & BGPIOF_BIG_ENDIAN,
  432. flags & BGPIOF_BIG_ENDIAN_BYTE_ORDER);
  433. if (ret)
  434. return ret;
  435. ret = bgpio_setup_direction(bgc, dirout, dirin);
  436. if (ret)
  437. return ret;
  438. bgc->data = bgc->read_reg(bgc->reg_dat);
  439. if (bgc->gc.set == bgpio_set_set &&
  440. !(flags & BGPIOF_UNREADABLE_REG_SET))
  441. bgc->data = bgc->read_reg(bgc->reg_set);
  442. if (bgc->reg_dir && !(flags & BGPIOF_UNREADABLE_REG_DIR))
  443. bgc->dir = bgc->read_reg(bgc->reg_dir);
  444. return ret;
  445. }
  446. EXPORT_SYMBOL_GPL(bgpio_init);
  447. #ifdef CONFIG_GPIO_GENERIC_PLATFORM
  448. static void __iomem *bgpio_map(struct platform_device *pdev,
  449. const char *name,
  450. resource_size_t sane_sz,
  451. int *err)
  452. {
  453. struct device *dev = &pdev->dev;
  454. struct resource *r;
  455. resource_size_t start;
  456. resource_size_t sz;
  457. void __iomem *ret;
  458. *err = 0;
  459. r = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
  460. if (!r)
  461. return NULL;
  462. sz = resource_size(r);
  463. if (sz != sane_sz) {
  464. *err = -EINVAL;
  465. return NULL;
  466. }
  467. start = r->start;
  468. if (!devm_request_mem_region(dev, start, sz, r->name)) {
  469. *err = -EBUSY;
  470. return NULL;
  471. }
  472. ret = devm_ioremap(dev, start, sz);
  473. if (!ret) {
  474. *err = -ENOMEM;
  475. return NULL;
  476. }
  477. return ret;
  478. }
  479. static int bgpio_pdev_probe(struct platform_device *pdev)
  480. {
  481. struct device *dev = &pdev->dev;
  482. struct resource *r;
  483. void __iomem *dat;
  484. void __iomem *set;
  485. void __iomem *clr;
  486. void __iomem *dirout;
  487. void __iomem *dirin;
  488. unsigned long sz;
  489. unsigned long flags = pdev->id_entry->driver_data;
  490. int err;
  491. struct bgpio_chip *bgc;
  492. struct bgpio_pdata *pdata = dev_get_platdata(dev);
  493. r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dat");
  494. if (!r)
  495. return -EINVAL;
  496. sz = resource_size(r);
  497. dat = bgpio_map(pdev, "dat", sz, &err);
  498. if (!dat)
  499. return err ? err : -EINVAL;
  500. set = bgpio_map(pdev, "set", sz, &err);
  501. if (err)
  502. return err;
  503. clr = bgpio_map(pdev, "clr", sz, &err);
  504. if (err)
  505. return err;
  506. dirout = bgpio_map(pdev, "dirout", sz, &err);
  507. if (err)
  508. return err;
  509. dirin = bgpio_map(pdev, "dirin", sz, &err);
  510. if (err)
  511. return err;
  512. bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL);
  513. if (!bgc)
  514. return -ENOMEM;
  515. err = bgpio_init(bgc, dev, sz, dat, set, clr, dirout, dirin, flags);
  516. if (err)
  517. return err;
  518. if (pdata) {
  519. if (pdata->label)
  520. bgc->gc.label = pdata->label;
  521. bgc->gc.base = pdata->base;
  522. if (pdata->ngpio > 0)
  523. bgc->gc.ngpio = pdata->ngpio;
  524. }
  525. platform_set_drvdata(pdev, bgc);
  526. return gpiochip_add(&bgc->gc);
  527. }
  528. static int bgpio_pdev_remove(struct platform_device *pdev)
  529. {
  530. struct bgpio_chip *bgc = platform_get_drvdata(pdev);
  531. return bgpio_remove(bgc);
  532. }
  533. static const struct platform_device_id bgpio_id_table[] = {
  534. {
  535. .name = "basic-mmio-gpio",
  536. .driver_data = 0,
  537. }, {
  538. .name = "basic-mmio-gpio-be",
  539. .driver_data = BGPIOF_BIG_ENDIAN,
  540. },
  541. { }
  542. };
  543. MODULE_DEVICE_TABLE(platform, bgpio_id_table);
  544. static struct platform_driver bgpio_driver = {
  545. .driver = {
  546. .name = "basic-mmio-gpio",
  547. },
  548. .id_table = bgpio_id_table,
  549. .probe = bgpio_pdev_probe,
  550. .remove = bgpio_pdev_remove,
  551. };
  552. module_platform_driver(bgpio_driver);
  553. #endif /* CONFIG_GPIO_GENERIC_PLATFORM */
  554. MODULE_DESCRIPTION("Driver for basic memory-mapped GPIO controllers");
  555. MODULE_AUTHOR("Anton Vorontsov <cbouatmailru@gmail.com>");
  556. MODULE_LICENSE("GPL");