gpio-aspeed-sgpio.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright 2019 American Megatrends International LLC.
  4. *
  5. * Author: Karthikeyan Mani <[email protected]>
  6. */
  7. #include <linux/bitfield.h>
  8. #include <linux/clk.h>
  9. #include <linux/gpio/driver.h>
  10. #include <linux/hashtable.h>
  11. #include <linux/init.h>
  12. #include <linux/io.h>
  13. #include <linux/kernel.h>
  14. #include <linux/module.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/spinlock.h>
  17. #include <linux/string.h>
  18. #define ASPEED_SGPIO_CTRL 0x54
  19. #define ASPEED_SGPIO_CLK_DIV_MASK GENMASK(31, 16)
  20. #define ASPEED_SGPIO_ENABLE BIT(0)
  21. #define ASPEED_SGPIO_PINS_SHIFT 6
  22. struct aspeed_sgpio_pdata {
  23. const u32 pin_mask;
  24. };
  25. struct aspeed_sgpio {
  26. struct gpio_chip chip;
  27. struct irq_chip intc;
  28. struct clk *pclk;
  29. raw_spinlock_t lock;
  30. void __iomem *base;
  31. int irq;
  32. };
  33. struct aspeed_sgpio_bank {
  34. u16 val_regs;
  35. u16 rdata_reg;
  36. u16 irq_regs;
  37. u16 tolerance_regs;
  38. const char names[4][3];
  39. };
  40. /*
  41. * Note: The "value" register returns the input value when the GPIO is
  42. * configured as an input.
  43. *
  44. * The "rdata" register returns the output value when the GPIO is
  45. * configured as an output.
  46. */
  47. static const struct aspeed_sgpio_bank aspeed_sgpio_banks[] = {
  48. {
  49. .val_regs = 0x0000,
  50. .rdata_reg = 0x0070,
  51. .irq_regs = 0x0004,
  52. .tolerance_regs = 0x0018,
  53. .names = { "A", "B", "C", "D" },
  54. },
  55. {
  56. .val_regs = 0x001C,
  57. .rdata_reg = 0x0074,
  58. .irq_regs = 0x0020,
  59. .tolerance_regs = 0x0034,
  60. .names = { "E", "F", "G", "H" },
  61. },
  62. {
  63. .val_regs = 0x0038,
  64. .rdata_reg = 0x0078,
  65. .irq_regs = 0x003C,
  66. .tolerance_regs = 0x0050,
  67. .names = { "I", "J", "K", "L" },
  68. },
  69. {
  70. .val_regs = 0x0090,
  71. .rdata_reg = 0x007C,
  72. .irq_regs = 0x0094,
  73. .tolerance_regs = 0x00A8,
  74. .names = { "M", "N", "O", "P" },
  75. },
  76. };
  77. enum aspeed_sgpio_reg {
  78. reg_val,
  79. reg_rdata,
  80. reg_irq_enable,
  81. reg_irq_type0,
  82. reg_irq_type1,
  83. reg_irq_type2,
  84. reg_irq_status,
  85. reg_tolerance,
  86. };
  87. #define GPIO_VAL_VALUE 0x00
  88. #define GPIO_IRQ_ENABLE 0x00
  89. #define GPIO_IRQ_TYPE0 0x04
  90. #define GPIO_IRQ_TYPE1 0x08
  91. #define GPIO_IRQ_TYPE2 0x0C
  92. #define GPIO_IRQ_STATUS 0x10
  93. static void __iomem *bank_reg(struct aspeed_sgpio *gpio,
  94. const struct aspeed_sgpio_bank *bank,
  95. const enum aspeed_sgpio_reg reg)
  96. {
  97. switch (reg) {
  98. case reg_val:
  99. return gpio->base + bank->val_regs + GPIO_VAL_VALUE;
  100. case reg_rdata:
  101. return gpio->base + bank->rdata_reg;
  102. case reg_irq_enable:
  103. return gpio->base + bank->irq_regs + GPIO_IRQ_ENABLE;
  104. case reg_irq_type0:
  105. return gpio->base + bank->irq_regs + GPIO_IRQ_TYPE0;
  106. case reg_irq_type1:
  107. return gpio->base + bank->irq_regs + GPIO_IRQ_TYPE1;
  108. case reg_irq_type2:
  109. return gpio->base + bank->irq_regs + GPIO_IRQ_TYPE2;
  110. case reg_irq_status:
  111. return gpio->base + bank->irq_regs + GPIO_IRQ_STATUS;
  112. case reg_tolerance:
  113. return gpio->base + bank->tolerance_regs;
  114. default:
  115. /* acturally if code runs to here, it's an error case */
  116. BUG();
  117. }
  118. }
  119. #define GPIO_BANK(x) ((x) >> 6)
  120. #define GPIO_OFFSET(x) ((x) & GENMASK(5, 0))
  121. #define GPIO_BIT(x) BIT(GPIO_OFFSET(x) >> 1)
  122. static const struct aspeed_sgpio_bank *to_bank(unsigned int offset)
  123. {
  124. unsigned int bank;
  125. bank = GPIO_BANK(offset);
  126. WARN_ON(bank >= ARRAY_SIZE(aspeed_sgpio_banks));
  127. return &aspeed_sgpio_banks[bank];
  128. }
  129. static int aspeed_sgpio_init_valid_mask(struct gpio_chip *gc,
  130. unsigned long *valid_mask, unsigned int ngpios)
  131. {
  132. bitmap_set(valid_mask, 0, ngpios);
  133. return 0;
  134. }
  135. static void aspeed_sgpio_irq_init_valid_mask(struct gpio_chip *gc,
  136. unsigned long *valid_mask, unsigned int ngpios)
  137. {
  138. unsigned int i;
  139. /* input GPIOs are even bits */
  140. for (i = 0; i < ngpios; i++) {
  141. if (i % 2)
  142. clear_bit(i, valid_mask);
  143. }
  144. }
  145. static bool aspeed_sgpio_is_input(unsigned int offset)
  146. {
  147. return !(offset % 2);
  148. }
  149. static int aspeed_sgpio_get(struct gpio_chip *gc, unsigned int offset)
  150. {
  151. struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
  152. const struct aspeed_sgpio_bank *bank = to_bank(offset);
  153. unsigned long flags;
  154. enum aspeed_sgpio_reg reg;
  155. int rc = 0;
  156. raw_spin_lock_irqsave(&gpio->lock, flags);
  157. reg = aspeed_sgpio_is_input(offset) ? reg_val : reg_rdata;
  158. rc = !!(ioread32(bank_reg(gpio, bank, reg)) & GPIO_BIT(offset));
  159. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  160. return rc;
  161. }
  162. static int sgpio_set_value(struct gpio_chip *gc, unsigned int offset, int val)
  163. {
  164. struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
  165. const struct aspeed_sgpio_bank *bank = to_bank(offset);
  166. void __iomem *addr_r, *addr_w;
  167. u32 reg = 0;
  168. if (aspeed_sgpio_is_input(offset))
  169. return -EINVAL;
  170. /* Since this is an output, read the cached value from rdata, then
  171. * update val. */
  172. addr_r = bank_reg(gpio, bank, reg_rdata);
  173. addr_w = bank_reg(gpio, bank, reg_val);
  174. reg = ioread32(addr_r);
  175. if (val)
  176. reg |= GPIO_BIT(offset);
  177. else
  178. reg &= ~GPIO_BIT(offset);
  179. iowrite32(reg, addr_w);
  180. return 0;
  181. }
  182. static void aspeed_sgpio_set(struct gpio_chip *gc, unsigned int offset, int val)
  183. {
  184. struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
  185. unsigned long flags;
  186. raw_spin_lock_irqsave(&gpio->lock, flags);
  187. sgpio_set_value(gc, offset, val);
  188. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  189. }
  190. static int aspeed_sgpio_dir_in(struct gpio_chip *gc, unsigned int offset)
  191. {
  192. return aspeed_sgpio_is_input(offset) ? 0 : -EINVAL;
  193. }
  194. static int aspeed_sgpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val)
  195. {
  196. struct aspeed_sgpio *gpio = gpiochip_get_data(gc);
  197. unsigned long flags;
  198. int rc;
  199. /* No special action is required for setting the direction; we'll
  200. * error-out in sgpio_set_value if this isn't an output GPIO */
  201. raw_spin_lock_irqsave(&gpio->lock, flags);
  202. rc = sgpio_set_value(gc, offset, val);
  203. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  204. return rc;
  205. }
  206. static int aspeed_sgpio_get_direction(struct gpio_chip *gc, unsigned int offset)
  207. {
  208. return !!aspeed_sgpio_is_input(offset);
  209. }
  210. static void irqd_to_aspeed_sgpio_data(struct irq_data *d,
  211. struct aspeed_sgpio **gpio,
  212. const struct aspeed_sgpio_bank **bank,
  213. u32 *bit, int *offset)
  214. {
  215. struct aspeed_sgpio *internal;
  216. *offset = irqd_to_hwirq(d);
  217. internal = irq_data_get_irq_chip_data(d);
  218. WARN_ON(!internal);
  219. *gpio = internal;
  220. *bank = to_bank(*offset);
  221. *bit = GPIO_BIT(*offset);
  222. }
  223. static void aspeed_sgpio_irq_ack(struct irq_data *d)
  224. {
  225. const struct aspeed_sgpio_bank *bank;
  226. struct aspeed_sgpio *gpio;
  227. unsigned long flags;
  228. void __iomem *status_addr;
  229. int offset;
  230. u32 bit;
  231. irqd_to_aspeed_sgpio_data(d, &gpio, &bank, &bit, &offset);
  232. status_addr = bank_reg(gpio, bank, reg_irq_status);
  233. raw_spin_lock_irqsave(&gpio->lock, flags);
  234. iowrite32(bit, status_addr);
  235. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  236. }
  237. static void aspeed_sgpio_irq_set_mask(struct irq_data *d, bool set)
  238. {
  239. const struct aspeed_sgpio_bank *bank;
  240. struct aspeed_sgpio *gpio;
  241. unsigned long flags;
  242. u32 reg, bit;
  243. void __iomem *addr;
  244. int offset;
  245. irqd_to_aspeed_sgpio_data(d, &gpio, &bank, &bit, &offset);
  246. addr = bank_reg(gpio, bank, reg_irq_enable);
  247. raw_spin_lock_irqsave(&gpio->lock, flags);
  248. reg = ioread32(addr);
  249. if (set)
  250. reg |= bit;
  251. else
  252. reg &= ~bit;
  253. iowrite32(reg, addr);
  254. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  255. }
  256. static void aspeed_sgpio_irq_mask(struct irq_data *d)
  257. {
  258. aspeed_sgpio_irq_set_mask(d, false);
  259. }
  260. static void aspeed_sgpio_irq_unmask(struct irq_data *d)
  261. {
  262. aspeed_sgpio_irq_set_mask(d, true);
  263. }
  264. static int aspeed_sgpio_set_type(struct irq_data *d, unsigned int type)
  265. {
  266. u32 type0 = 0;
  267. u32 type1 = 0;
  268. u32 type2 = 0;
  269. u32 bit, reg;
  270. const struct aspeed_sgpio_bank *bank;
  271. irq_flow_handler_t handler;
  272. struct aspeed_sgpio *gpio;
  273. unsigned long flags;
  274. void __iomem *addr;
  275. int offset;
  276. irqd_to_aspeed_sgpio_data(d, &gpio, &bank, &bit, &offset);
  277. switch (type & IRQ_TYPE_SENSE_MASK) {
  278. case IRQ_TYPE_EDGE_BOTH:
  279. type2 |= bit;
  280. fallthrough;
  281. case IRQ_TYPE_EDGE_RISING:
  282. type0 |= bit;
  283. fallthrough;
  284. case IRQ_TYPE_EDGE_FALLING:
  285. handler = handle_edge_irq;
  286. break;
  287. case IRQ_TYPE_LEVEL_HIGH:
  288. type0 |= bit;
  289. fallthrough;
  290. case IRQ_TYPE_LEVEL_LOW:
  291. type1 |= bit;
  292. handler = handle_level_irq;
  293. break;
  294. default:
  295. return -EINVAL;
  296. }
  297. raw_spin_lock_irqsave(&gpio->lock, flags);
  298. addr = bank_reg(gpio, bank, reg_irq_type0);
  299. reg = ioread32(addr);
  300. reg = (reg & ~bit) | type0;
  301. iowrite32(reg, addr);
  302. addr = bank_reg(gpio, bank, reg_irq_type1);
  303. reg = ioread32(addr);
  304. reg = (reg & ~bit) | type1;
  305. iowrite32(reg, addr);
  306. addr = bank_reg(gpio, bank, reg_irq_type2);
  307. reg = ioread32(addr);
  308. reg = (reg & ~bit) | type2;
  309. iowrite32(reg, addr);
  310. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  311. irq_set_handler_locked(d, handler);
  312. return 0;
  313. }
  314. static void aspeed_sgpio_irq_handler(struct irq_desc *desc)
  315. {
  316. struct gpio_chip *gc = irq_desc_get_handler_data(desc);
  317. struct irq_chip *ic = irq_desc_get_chip(desc);
  318. struct aspeed_sgpio *data = gpiochip_get_data(gc);
  319. unsigned int i, p;
  320. unsigned long reg;
  321. chained_irq_enter(ic, desc);
  322. for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
  323. const struct aspeed_sgpio_bank *bank = &aspeed_sgpio_banks[i];
  324. reg = ioread32(bank_reg(data, bank, reg_irq_status));
  325. for_each_set_bit(p, &reg, 32)
  326. generic_handle_domain_irq(gc->irq.domain, (i * 32 + p) * 2);
  327. }
  328. chained_irq_exit(ic, desc);
  329. }
  330. static int aspeed_sgpio_setup_irqs(struct aspeed_sgpio *gpio,
  331. struct platform_device *pdev)
  332. {
  333. int rc, i;
  334. const struct aspeed_sgpio_bank *bank;
  335. struct gpio_irq_chip *irq;
  336. rc = platform_get_irq(pdev, 0);
  337. if (rc < 0)
  338. return rc;
  339. gpio->irq = rc;
  340. /* Disable IRQ and clear Interrupt status registers for all SGPIO Pins. */
  341. for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
  342. bank = &aspeed_sgpio_banks[i];
  343. /* disable irq enable bits */
  344. iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_enable));
  345. /* clear status bits */
  346. iowrite32(0xffffffff, bank_reg(gpio, bank, reg_irq_status));
  347. }
  348. gpio->intc.name = dev_name(&pdev->dev);
  349. gpio->intc.irq_ack = aspeed_sgpio_irq_ack;
  350. gpio->intc.irq_mask = aspeed_sgpio_irq_mask;
  351. gpio->intc.irq_unmask = aspeed_sgpio_irq_unmask;
  352. gpio->intc.irq_set_type = aspeed_sgpio_set_type;
  353. irq = &gpio->chip.irq;
  354. irq->chip = &gpio->intc;
  355. irq->init_valid_mask = aspeed_sgpio_irq_init_valid_mask;
  356. irq->handler = handle_bad_irq;
  357. irq->default_type = IRQ_TYPE_NONE;
  358. irq->parent_handler = aspeed_sgpio_irq_handler;
  359. irq->parent_handler_data = gpio;
  360. irq->parents = &gpio->irq;
  361. irq->num_parents = 1;
  362. /* Apply default IRQ settings */
  363. for (i = 0; i < ARRAY_SIZE(aspeed_sgpio_banks); i++) {
  364. bank = &aspeed_sgpio_banks[i];
  365. /* set falling or level-low irq */
  366. iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type0));
  367. /* trigger type is edge */
  368. iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type1));
  369. /* single edge trigger */
  370. iowrite32(0x00000000, bank_reg(gpio, bank, reg_irq_type2));
  371. }
  372. return 0;
  373. }
  374. static const struct aspeed_sgpio_pdata ast2400_sgpio_pdata = {
  375. .pin_mask = GENMASK(9, 6),
  376. };
  377. static int aspeed_sgpio_reset_tolerance(struct gpio_chip *chip,
  378. unsigned int offset, bool enable)
  379. {
  380. struct aspeed_sgpio *gpio = gpiochip_get_data(chip);
  381. unsigned long flags;
  382. void __iomem *reg;
  383. u32 val;
  384. reg = bank_reg(gpio, to_bank(offset), reg_tolerance);
  385. raw_spin_lock_irqsave(&gpio->lock, flags);
  386. val = readl(reg);
  387. if (enable)
  388. val |= GPIO_BIT(offset);
  389. else
  390. val &= ~GPIO_BIT(offset);
  391. writel(val, reg);
  392. raw_spin_unlock_irqrestore(&gpio->lock, flags);
  393. return 0;
  394. }
  395. static int aspeed_sgpio_set_config(struct gpio_chip *chip, unsigned int offset,
  396. unsigned long config)
  397. {
  398. unsigned long param = pinconf_to_config_param(config);
  399. u32 arg = pinconf_to_config_argument(config);
  400. if (param == PIN_CONFIG_PERSIST_STATE)
  401. return aspeed_sgpio_reset_tolerance(chip, offset, arg);
  402. return -ENOTSUPP;
  403. }
  404. static const struct aspeed_sgpio_pdata ast2600_sgpiom_pdata = {
  405. .pin_mask = GENMASK(10, 6),
  406. };
  407. static const struct of_device_id aspeed_sgpio_of_table[] = {
  408. { .compatible = "aspeed,ast2400-sgpio", .data = &ast2400_sgpio_pdata, },
  409. { .compatible = "aspeed,ast2500-sgpio", .data = &ast2400_sgpio_pdata, },
  410. { .compatible = "aspeed,ast2600-sgpiom", .data = &ast2600_sgpiom_pdata, },
  411. {}
  412. };
  413. MODULE_DEVICE_TABLE(of, aspeed_sgpio_of_table);
  414. static int __init aspeed_sgpio_probe(struct platform_device *pdev)
  415. {
  416. u32 nr_gpios, sgpio_freq, sgpio_clk_div, gpio_cnt_regval, pin_mask;
  417. const struct aspeed_sgpio_pdata *pdata;
  418. struct aspeed_sgpio *gpio;
  419. unsigned long apb_freq;
  420. int rc;
  421. gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
  422. if (!gpio)
  423. return -ENOMEM;
  424. gpio->base = devm_platform_ioremap_resource(pdev, 0);
  425. if (IS_ERR(gpio->base))
  426. return PTR_ERR(gpio->base);
  427. pdata = device_get_match_data(&pdev->dev);
  428. if (!pdata)
  429. return -EINVAL;
  430. pin_mask = pdata->pin_mask;
  431. rc = device_property_read_u32(&pdev->dev, "ngpios", &nr_gpios);
  432. if (rc < 0) {
  433. dev_err(&pdev->dev, "Could not read ngpios property\n");
  434. return -EINVAL;
  435. } else if (nr_gpios % 8) {
  436. dev_err(&pdev->dev, "Number of GPIOs not multiple of 8: %d\n",
  437. nr_gpios);
  438. return -EINVAL;
  439. }
  440. rc = device_property_read_u32(&pdev->dev, "bus-frequency", &sgpio_freq);
  441. if (rc < 0) {
  442. dev_err(&pdev->dev, "Could not read bus-frequency property\n");
  443. return -EINVAL;
  444. }
  445. gpio->pclk = devm_clk_get(&pdev->dev, NULL);
  446. if (IS_ERR(gpio->pclk)) {
  447. dev_err(&pdev->dev, "devm_clk_get failed\n");
  448. return PTR_ERR(gpio->pclk);
  449. }
  450. apb_freq = clk_get_rate(gpio->pclk);
  451. /*
  452. * From the datasheet,
  453. * SGPIO period = 1/PCLK * 2 * (GPIO254[31:16] + 1)
  454. * period = 2 * (GPIO254[31:16] + 1) / PCLK
  455. * frequency = 1 / (2 * (GPIO254[31:16] + 1) / PCLK)
  456. * frequency = PCLK / (2 * (GPIO254[31:16] + 1))
  457. * frequency * 2 * (GPIO254[31:16] + 1) = PCLK
  458. * GPIO254[31:16] = PCLK / (frequency * 2) - 1
  459. */
  460. if (sgpio_freq == 0)
  461. return -EINVAL;
  462. sgpio_clk_div = (apb_freq / (sgpio_freq * 2)) - 1;
  463. if (sgpio_clk_div > (1 << 16) - 1)
  464. return -EINVAL;
  465. gpio_cnt_regval = ((nr_gpios / 8) << ASPEED_SGPIO_PINS_SHIFT) & pin_mask;
  466. iowrite32(FIELD_PREP(ASPEED_SGPIO_CLK_DIV_MASK, sgpio_clk_div) | gpio_cnt_regval |
  467. ASPEED_SGPIO_ENABLE, gpio->base + ASPEED_SGPIO_CTRL);
  468. raw_spin_lock_init(&gpio->lock);
  469. gpio->chip.parent = &pdev->dev;
  470. gpio->chip.ngpio = nr_gpios * 2;
  471. gpio->chip.init_valid_mask = aspeed_sgpio_init_valid_mask;
  472. gpio->chip.direction_input = aspeed_sgpio_dir_in;
  473. gpio->chip.direction_output = aspeed_sgpio_dir_out;
  474. gpio->chip.get_direction = aspeed_sgpio_get_direction;
  475. gpio->chip.request = NULL;
  476. gpio->chip.free = NULL;
  477. gpio->chip.get = aspeed_sgpio_get;
  478. gpio->chip.set = aspeed_sgpio_set;
  479. gpio->chip.set_config = aspeed_sgpio_set_config;
  480. gpio->chip.label = dev_name(&pdev->dev);
  481. gpio->chip.base = -1;
  482. aspeed_sgpio_setup_irqs(gpio, pdev);
  483. rc = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
  484. if (rc < 0)
  485. return rc;
  486. return 0;
  487. }
  488. static struct platform_driver aspeed_sgpio_driver = {
  489. .driver = {
  490. .name = KBUILD_MODNAME,
  491. .of_match_table = aspeed_sgpio_of_table,
  492. },
  493. };
  494. module_platform_driver_probe(aspeed_sgpio_driver, aspeed_sgpio_probe);
  495. MODULE_DESCRIPTION("Aspeed Serial GPIO Driver");
  496. MODULE_LICENSE("GPL");