gpio-tz1090.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * Toumaz Xenif TZ1090 GPIO handling.
  3. *
  4. * Copyright (C) 2008-2013 Imagination Technologies Ltd.
  5. *
  6. * Based on ARM PXA code and others.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/bitops.h>
  13. #include <linux/export.h>
  14. #include <linux/gpio.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/io.h>
  17. #include <linux/irq.h>
  18. #include <linux/irqdomain.h>
  19. #include <linux/kernel.h>
  20. #include <linux/of_irq.h>
  21. #include <linux/pinctrl/consumer.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/slab.h>
  24. #include <linux/syscore_ops.h>
  25. #include <asm/global_lock.h>
  26. /* Register offsets from bank base address */
  27. #define REG_GPIO_DIR 0x00
  28. #define REG_GPIO_IRQ_PLRT 0x20
  29. #define REG_GPIO_IRQ_TYPE 0x30
  30. #define REG_GPIO_IRQ_EN 0x40
  31. #define REG_GPIO_IRQ_STS 0x50
  32. #define REG_GPIO_BIT_EN 0x60
  33. #define REG_GPIO_DIN 0x70
  34. #define REG_GPIO_DOUT 0x80
  35. /* REG_GPIO_IRQ_PLRT */
  36. #define REG_GPIO_IRQ_PLRT_LOW 0
  37. #define REG_GPIO_IRQ_PLRT_HIGH 1
  38. /* REG_GPIO_IRQ_TYPE */
  39. #define REG_GPIO_IRQ_TYPE_LEVEL 0
  40. #define REG_GPIO_IRQ_TYPE_EDGE 1
  41. /**
  42. * struct tz1090_gpio_bank - GPIO bank private data
  43. * @chip: Generic GPIO chip for GPIO bank
  44. * @domain: IRQ domain for GPIO bank (may be NULL)
  45. * @reg: Base of registers, offset for this GPIO bank
  46. * @irq: IRQ number for GPIO bank
  47. * @label: Debug GPIO bank label, used for storage of chip->label
  48. *
  49. * This is the main private data for a GPIO bank. It encapsulates a gpio_chip,
  50. * and the callbacks for the gpio_chip can access the private data with the
  51. * to_bank() macro below.
  52. */
  53. struct tz1090_gpio_bank {
  54. struct gpio_chip chip;
  55. struct irq_domain *domain;
  56. void __iomem *reg;
  57. int irq;
  58. char label[16];
  59. };
  60. #define to_bank(c) container_of(c, struct tz1090_gpio_bank, chip)
  61. /**
  62. * struct tz1090_gpio - Overall GPIO device private data
  63. * @dev: Device (from platform device)
  64. * @reg: Base of GPIO registers
  65. *
  66. * Represents the overall GPIO device. This structure is actually only
  67. * temporary, and used during init.
  68. */
  69. struct tz1090_gpio {
  70. struct device *dev;
  71. void __iomem *reg;
  72. };
  73. /**
  74. * struct tz1090_gpio_bank_info - Temporary registration info for GPIO bank
  75. * @priv: Overall GPIO device private data
  76. * @node: Device tree node specific to this GPIO bank
  77. * @index: Index of bank in range 0-2
  78. */
  79. struct tz1090_gpio_bank_info {
  80. struct tz1090_gpio *priv;
  81. struct device_node *node;
  82. unsigned int index;
  83. };
  84. /* Convenience register accessors */
  85. static inline void tz1090_gpio_write(struct tz1090_gpio_bank *bank,
  86. unsigned int reg_offs, u32 data)
  87. {
  88. iowrite32(data, bank->reg + reg_offs);
  89. }
  90. static inline u32 tz1090_gpio_read(struct tz1090_gpio_bank *bank,
  91. unsigned int reg_offs)
  92. {
  93. return ioread32(bank->reg + reg_offs);
  94. }
  95. /* caller must hold LOCK2 */
  96. static inline void _tz1090_gpio_clear_bit(struct tz1090_gpio_bank *bank,
  97. unsigned int reg_offs,
  98. unsigned int offset)
  99. {
  100. u32 value;
  101. value = tz1090_gpio_read(bank, reg_offs);
  102. value &= ~BIT(offset);
  103. tz1090_gpio_write(bank, reg_offs, value);
  104. }
  105. static void tz1090_gpio_clear_bit(struct tz1090_gpio_bank *bank,
  106. unsigned int reg_offs,
  107. unsigned int offset)
  108. {
  109. int lstat;
  110. __global_lock2(lstat);
  111. _tz1090_gpio_clear_bit(bank, reg_offs, offset);
  112. __global_unlock2(lstat);
  113. }
  114. /* caller must hold LOCK2 */
  115. static inline void _tz1090_gpio_set_bit(struct tz1090_gpio_bank *bank,
  116. unsigned int reg_offs,
  117. unsigned int offset)
  118. {
  119. u32 value;
  120. value = tz1090_gpio_read(bank, reg_offs);
  121. value |= BIT(offset);
  122. tz1090_gpio_write(bank, reg_offs, value);
  123. }
  124. static void tz1090_gpio_set_bit(struct tz1090_gpio_bank *bank,
  125. unsigned int reg_offs,
  126. unsigned int offset)
  127. {
  128. int lstat;
  129. __global_lock2(lstat);
  130. _tz1090_gpio_set_bit(bank, reg_offs, offset);
  131. __global_unlock2(lstat);
  132. }
  133. /* caller must hold LOCK2 */
  134. static inline void _tz1090_gpio_mod_bit(struct tz1090_gpio_bank *bank,
  135. unsigned int reg_offs,
  136. unsigned int offset,
  137. bool val)
  138. {
  139. u32 value;
  140. value = tz1090_gpio_read(bank, reg_offs);
  141. value &= ~BIT(offset);
  142. if (val)
  143. value |= BIT(offset);
  144. tz1090_gpio_write(bank, reg_offs, value);
  145. }
  146. static void tz1090_gpio_mod_bit(struct tz1090_gpio_bank *bank,
  147. unsigned int reg_offs,
  148. unsigned int offset,
  149. bool val)
  150. {
  151. int lstat;
  152. __global_lock2(lstat);
  153. _tz1090_gpio_mod_bit(bank, reg_offs, offset, val);
  154. __global_unlock2(lstat);
  155. }
  156. static inline int tz1090_gpio_read_bit(struct tz1090_gpio_bank *bank,
  157. unsigned int reg_offs,
  158. unsigned int offset)
  159. {
  160. return tz1090_gpio_read(bank, reg_offs) & BIT(offset);
  161. }
  162. /* GPIO chip callbacks */
  163. static int tz1090_gpio_direction_input(struct gpio_chip *chip,
  164. unsigned int offset)
  165. {
  166. struct tz1090_gpio_bank *bank = to_bank(chip);
  167. tz1090_gpio_set_bit(bank, REG_GPIO_DIR, offset);
  168. return 0;
  169. }
  170. static int tz1090_gpio_direction_output(struct gpio_chip *chip,
  171. unsigned int offset, int output_value)
  172. {
  173. struct tz1090_gpio_bank *bank = to_bank(chip);
  174. int lstat;
  175. __global_lock2(lstat);
  176. _tz1090_gpio_mod_bit(bank, REG_GPIO_DOUT, offset, output_value);
  177. _tz1090_gpio_clear_bit(bank, REG_GPIO_DIR, offset);
  178. __global_unlock2(lstat);
  179. return 0;
  180. }
  181. /*
  182. * Return GPIO level
  183. */
  184. static int tz1090_gpio_get(struct gpio_chip *chip, unsigned int offset)
  185. {
  186. struct tz1090_gpio_bank *bank = to_bank(chip);
  187. return tz1090_gpio_read_bit(bank, REG_GPIO_DIN, offset);
  188. }
  189. /*
  190. * Set output GPIO level
  191. */
  192. static void tz1090_gpio_set(struct gpio_chip *chip, unsigned int offset,
  193. int output_value)
  194. {
  195. struct tz1090_gpio_bank *bank = to_bank(chip);
  196. tz1090_gpio_mod_bit(bank, REG_GPIO_DOUT, offset, output_value);
  197. }
  198. static int tz1090_gpio_request(struct gpio_chip *chip, unsigned int offset)
  199. {
  200. struct tz1090_gpio_bank *bank = to_bank(chip);
  201. int ret;
  202. ret = pinctrl_request_gpio(chip->base + offset);
  203. if (ret)
  204. return ret;
  205. tz1090_gpio_set_bit(bank, REG_GPIO_DIR, offset);
  206. tz1090_gpio_set_bit(bank, REG_GPIO_BIT_EN, offset);
  207. return 0;
  208. }
  209. static void tz1090_gpio_free(struct gpio_chip *chip, unsigned int offset)
  210. {
  211. struct tz1090_gpio_bank *bank = to_bank(chip);
  212. pinctrl_free_gpio(chip->base + offset);
  213. tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset);
  214. }
  215. static int tz1090_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
  216. {
  217. struct tz1090_gpio_bank *bank = to_bank(chip);
  218. if (!bank->domain)
  219. return -EINVAL;
  220. return irq_create_mapping(bank->domain, offset);
  221. }
  222. /* IRQ chip handlers */
  223. /* Get TZ1090 GPIO chip from irq data provided to generic IRQ callbacks */
  224. static inline struct tz1090_gpio_bank *irqd_to_gpio_bank(struct irq_data *data)
  225. {
  226. return (struct tz1090_gpio_bank *)data->domain->host_data;
  227. }
  228. static void tz1090_gpio_irq_polarity(struct tz1090_gpio_bank *bank,
  229. unsigned int offset, unsigned int polarity)
  230. {
  231. tz1090_gpio_mod_bit(bank, REG_GPIO_IRQ_PLRT, offset, polarity);
  232. }
  233. static void tz1090_gpio_irq_type(struct tz1090_gpio_bank *bank,
  234. unsigned int offset, unsigned int type)
  235. {
  236. tz1090_gpio_mod_bit(bank, REG_GPIO_IRQ_TYPE, offset, type);
  237. }
  238. /* set polarity to trigger on next edge, whether rising or falling */
  239. static void tz1090_gpio_irq_next_edge(struct tz1090_gpio_bank *bank,
  240. unsigned int offset)
  241. {
  242. unsigned int value_p, value_i;
  243. int lstat;
  244. /*
  245. * Set the GPIO's interrupt polarity to the opposite of the current
  246. * input value so that the next edge triggers an interrupt.
  247. */
  248. __global_lock2(lstat);
  249. value_i = ~tz1090_gpio_read(bank, REG_GPIO_DIN);
  250. value_p = tz1090_gpio_read(bank, REG_GPIO_IRQ_PLRT);
  251. value_p &= ~BIT(offset);
  252. value_p |= value_i & BIT(offset);
  253. tz1090_gpio_write(bank, REG_GPIO_IRQ_PLRT, value_p);
  254. __global_unlock2(lstat);
  255. }
  256. static unsigned int gpio_startup_irq(struct irq_data *data)
  257. {
  258. /*
  259. * This warning indicates that the type of the irq hasn't been set
  260. * before enabling the irq. This would normally be done by passing some
  261. * trigger flags to request_irq().
  262. */
  263. WARN(irqd_get_trigger_type(data) == IRQ_TYPE_NONE,
  264. "irq type not set before enabling gpio irq %d", data->irq);
  265. irq_gc_ack_clr_bit(data);
  266. irq_gc_mask_set_bit(data);
  267. return 0;
  268. }
  269. static int gpio_set_irq_type(struct irq_data *data, unsigned int flow_type)
  270. {
  271. struct tz1090_gpio_bank *bank = irqd_to_gpio_bank(data);
  272. unsigned int type;
  273. unsigned int polarity;
  274. switch (flow_type) {
  275. case IRQ_TYPE_EDGE_BOTH:
  276. type = REG_GPIO_IRQ_TYPE_EDGE;
  277. polarity = REG_GPIO_IRQ_PLRT_LOW;
  278. break;
  279. case IRQ_TYPE_EDGE_RISING:
  280. type = REG_GPIO_IRQ_TYPE_EDGE;
  281. polarity = REG_GPIO_IRQ_PLRT_HIGH;
  282. break;
  283. case IRQ_TYPE_EDGE_FALLING:
  284. type = REG_GPIO_IRQ_TYPE_EDGE;
  285. polarity = REG_GPIO_IRQ_PLRT_LOW;
  286. break;
  287. case IRQ_TYPE_LEVEL_HIGH:
  288. type = REG_GPIO_IRQ_TYPE_LEVEL;
  289. polarity = REG_GPIO_IRQ_PLRT_HIGH;
  290. break;
  291. case IRQ_TYPE_LEVEL_LOW:
  292. type = REG_GPIO_IRQ_TYPE_LEVEL;
  293. polarity = REG_GPIO_IRQ_PLRT_LOW;
  294. break;
  295. default:
  296. return -EINVAL;
  297. }
  298. tz1090_gpio_irq_type(bank, data->hwirq, type);
  299. irq_setup_alt_chip(data, flow_type);
  300. if (flow_type == IRQ_TYPE_EDGE_BOTH)
  301. tz1090_gpio_irq_next_edge(bank, data->hwirq);
  302. else
  303. tz1090_gpio_irq_polarity(bank, data->hwirq, polarity);
  304. return 0;
  305. }
  306. #ifdef CONFIG_SUSPEND
  307. static int gpio_set_irq_wake(struct irq_data *data, unsigned int on)
  308. {
  309. struct tz1090_gpio_bank *bank = irqd_to_gpio_bank(data);
  310. #ifdef CONFIG_PM_DEBUG
  311. pr_info("irq_wake irq%d state:%d\n", data->irq, on);
  312. #endif
  313. /* wake on gpio block interrupt */
  314. return irq_set_irq_wake(bank->irq, on);
  315. }
  316. #else
  317. #define gpio_set_irq_wake NULL
  318. #endif
  319. static void tz1090_gpio_irq_handler(struct irq_desc *desc)
  320. {
  321. irq_hw_number_t hw;
  322. unsigned int irq_stat, irq_no;
  323. struct tz1090_gpio_bank *bank;
  324. struct irq_desc *child_desc;
  325. bank = (struct tz1090_gpio_bank *)irq_desc_get_handler_data(desc);
  326. irq_stat = tz1090_gpio_read(bank, REG_GPIO_DIR) &
  327. tz1090_gpio_read(bank, REG_GPIO_IRQ_STS) &
  328. tz1090_gpio_read(bank, REG_GPIO_IRQ_EN) &
  329. 0x3FFFFFFF; /* 30 bits only */
  330. for (hw = 0; irq_stat; irq_stat >>= 1, ++hw) {
  331. if (!(irq_stat & 1))
  332. continue;
  333. irq_no = irq_linear_revmap(bank->domain, hw);
  334. child_desc = irq_to_desc(irq_no);
  335. /* Toggle edge for pin with both edges triggering enabled */
  336. if (irqd_get_trigger_type(&child_desc->irq_data)
  337. == IRQ_TYPE_EDGE_BOTH)
  338. tz1090_gpio_irq_next_edge(bank, hw);
  339. generic_handle_irq_desc(child_desc);
  340. }
  341. }
  342. static int tz1090_gpio_bank_probe(struct tz1090_gpio_bank_info *info)
  343. {
  344. struct device_node *np = info->node;
  345. struct device *dev = info->priv->dev;
  346. struct tz1090_gpio_bank *bank;
  347. struct irq_chip_generic *gc;
  348. int err;
  349. bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
  350. if (!bank) {
  351. dev_err(dev, "unable to allocate driver data\n");
  352. return -ENOMEM;
  353. }
  354. /* Offset the main registers to the first register in this bank */
  355. bank->reg = info->priv->reg + info->index * 4;
  356. /* Set up GPIO chip */
  357. snprintf(bank->label, sizeof(bank->label), "tz1090-gpio-%u",
  358. info->index);
  359. bank->chip.label = bank->label;
  360. bank->chip.dev = dev;
  361. bank->chip.direction_input = tz1090_gpio_direction_input;
  362. bank->chip.direction_output = tz1090_gpio_direction_output;
  363. bank->chip.get = tz1090_gpio_get;
  364. bank->chip.set = tz1090_gpio_set;
  365. bank->chip.free = tz1090_gpio_free;
  366. bank->chip.request = tz1090_gpio_request;
  367. bank->chip.to_irq = tz1090_gpio_to_irq;
  368. bank->chip.of_node = np;
  369. /* GPIO numbering from 0 */
  370. bank->chip.base = info->index * 30;
  371. bank->chip.ngpio = 30;
  372. /* Add the GPIO bank */
  373. gpiochip_add(&bank->chip);
  374. /* Get the GPIO bank IRQ if provided */
  375. bank->irq = irq_of_parse_and_map(np, 0);
  376. /* The interrupt is optional (it may be used by another core on chip) */
  377. if (!bank->irq) {
  378. dev_info(dev, "IRQ not provided for bank %u, IRQs disabled\n",
  379. info->index);
  380. return 0;
  381. }
  382. dev_info(dev, "Setting up IRQs for GPIO bank %u\n",
  383. info->index);
  384. /*
  385. * Initialise all interrupts to disabled so we don't get
  386. * spurious ones on a dirty boot and hit the BUG_ON in the
  387. * handler.
  388. */
  389. tz1090_gpio_write(bank, REG_GPIO_IRQ_EN, 0);
  390. /* Add a virtual IRQ for each GPIO */
  391. bank->domain = irq_domain_add_linear(np,
  392. bank->chip.ngpio,
  393. &irq_generic_chip_ops,
  394. bank);
  395. /* Set up a generic irq chip with 2 chip types (level and edge) */
  396. err = irq_alloc_domain_generic_chips(bank->domain, bank->chip.ngpio, 2,
  397. bank->label, handle_bad_irq, 0, 0,
  398. IRQ_GC_INIT_NESTED_LOCK);
  399. if (err) {
  400. dev_info(dev,
  401. "irq_alloc_domain_generic_chips failed for bank %u, IRQs disabled\n",
  402. info->index);
  403. irq_domain_remove(bank->domain);
  404. return 0;
  405. }
  406. gc = irq_get_domain_generic_chip(bank->domain, 0);
  407. gc->reg_base = bank->reg;
  408. /* level chip type */
  409. gc->chip_types[0].type = IRQ_TYPE_LEVEL_MASK;
  410. gc->chip_types[0].handler = handle_level_irq;
  411. gc->chip_types[0].regs.ack = REG_GPIO_IRQ_STS;
  412. gc->chip_types[0].regs.mask = REG_GPIO_IRQ_EN;
  413. gc->chip_types[0].chip.irq_startup = gpio_startup_irq;
  414. gc->chip_types[0].chip.irq_ack = irq_gc_ack_clr_bit;
  415. gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit;
  416. gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit;
  417. gc->chip_types[0].chip.irq_set_type = gpio_set_irq_type;
  418. gc->chip_types[0].chip.irq_set_wake = gpio_set_irq_wake;
  419. gc->chip_types[0].chip.flags = IRQCHIP_MASK_ON_SUSPEND;
  420. /* edge chip type */
  421. gc->chip_types[1].type = IRQ_TYPE_EDGE_BOTH;
  422. gc->chip_types[1].handler = handle_edge_irq;
  423. gc->chip_types[1].regs.ack = REG_GPIO_IRQ_STS;
  424. gc->chip_types[1].regs.mask = REG_GPIO_IRQ_EN;
  425. gc->chip_types[1].chip.irq_startup = gpio_startup_irq;
  426. gc->chip_types[1].chip.irq_ack = irq_gc_ack_clr_bit;
  427. gc->chip_types[1].chip.irq_mask = irq_gc_mask_clr_bit;
  428. gc->chip_types[1].chip.irq_unmask = irq_gc_mask_set_bit;
  429. gc->chip_types[1].chip.irq_set_type = gpio_set_irq_type;
  430. gc->chip_types[1].chip.irq_set_wake = gpio_set_irq_wake;
  431. gc->chip_types[1].chip.flags = IRQCHIP_MASK_ON_SUSPEND;
  432. /* Setup chained handler for this GPIO bank */
  433. irq_set_chained_handler_and_data(bank->irq, tz1090_gpio_irq_handler,
  434. bank);
  435. return 0;
  436. }
  437. static void tz1090_gpio_register_banks(struct tz1090_gpio *priv)
  438. {
  439. struct device_node *np = priv->dev->of_node;
  440. struct device_node *node;
  441. for_each_available_child_of_node(np, node) {
  442. struct tz1090_gpio_bank_info info;
  443. u32 addr;
  444. int ret;
  445. ret = of_property_read_u32(node, "reg", &addr);
  446. if (ret) {
  447. dev_err(priv->dev, "invalid reg on %s\n",
  448. node->full_name);
  449. continue;
  450. }
  451. if (addr >= 3) {
  452. dev_err(priv->dev, "index %u in %s out of range\n",
  453. addr, node->full_name);
  454. continue;
  455. }
  456. info.index = addr;
  457. info.node = of_node_get(node);
  458. info.priv = priv;
  459. ret = tz1090_gpio_bank_probe(&info);
  460. if (ret) {
  461. dev_err(priv->dev, "failure registering %s\n",
  462. node->full_name);
  463. of_node_put(node);
  464. continue;
  465. }
  466. }
  467. }
  468. static int tz1090_gpio_probe(struct platform_device *pdev)
  469. {
  470. struct device_node *np = pdev->dev.of_node;
  471. struct resource *res_regs;
  472. struct tz1090_gpio priv;
  473. if (!np) {
  474. dev_err(&pdev->dev, "must be instantiated via devicetree\n");
  475. return -ENOENT;
  476. }
  477. res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  478. if (!res_regs) {
  479. dev_err(&pdev->dev, "cannot find registers resource\n");
  480. return -ENOENT;
  481. }
  482. priv.dev = &pdev->dev;
  483. /* Ioremap the registers */
  484. priv.reg = devm_ioremap(&pdev->dev, res_regs->start,
  485. resource_size(res_regs));
  486. if (!priv.reg) {
  487. dev_err(&pdev->dev, "unable to ioremap registers\n");
  488. return -ENOMEM;
  489. }
  490. /* Look for banks */
  491. tz1090_gpio_register_banks(&priv);
  492. return 0;
  493. }
  494. static struct of_device_id tz1090_gpio_of_match[] = {
  495. { .compatible = "img,tz1090-gpio" },
  496. { },
  497. };
  498. static struct platform_driver tz1090_gpio_driver = {
  499. .driver = {
  500. .name = "tz1090-gpio",
  501. .of_match_table = tz1090_gpio_of_match,
  502. },
  503. .probe = tz1090_gpio_probe,
  504. };
  505. static int __init tz1090_gpio_init(void)
  506. {
  507. return platform_driver_register(&tz1090_gpio_driver);
  508. }
  509. subsys_initcall(tz1090_gpio_init);