tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git fixes head: 7b74feff6fdb0820252b75b2313ad7bccfc8515b commit: 7b74feff6fdb0820252b75b2313ad7bccfc8515b [6/6] gpio:mcp23s08 Fixed missing interrupts config: i386-randconfig-x074-201711 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout 7b74feff6fdb0820252b75b2313ad7bccfc8515b # save the attached .config to linux build tree make ARCH=i386 All error/warnings (new ones prefixed by >>): drivers/gpio/gpio-mcp23s08.c: In function 'mcp23s08_irq': drivers/gpio/gpio-mcp23s08.c:294:12: error: 'struct mcp23s08' has no member named 'ops' gpio = mcp->ops->read(mcp, MCP_GPIO); ^~ In file included from include/linux/kdev_t.h:4:0, from include/linux/fs.h:6, from include/linux/seq_file.h:10, from drivers/gpio/gpio-mcp23s08.c:485: >> include/uapi/linux/kdev_t.h:13:0: error: unterminated argument list invoking macro "if" #endif /* _UAPI_LINUX_KDEV_T_H */ In file included from include/linux/fs.h:6:0, from include/linux/seq_file.h:10, from drivers/gpio/gpio-mcp23s08.c:485: >> include/linux/kdev_t.h:23:1: error: expected '(' before 'static' static inline bool old_valid_dev(dev_t dev) ^~~~~~ In file included from include/linux/rculist_bl.h:7:0, from include/linux/dcache.h:7, from include/linux/fs.h:7, from include/linux/seq_file.h:10, from drivers/gpio/gpio-mcp23s08.c:485: >> include/linux/list_bl.h:37:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] struct hlist_bl_node { ^~~~~~ >> include/linux/list_bl.h:43:20: error: invalid storage class for function 'INIT_HLIST_BL_NODE' static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) ^~~~~~~~~~~~~~~~~~ >> include/linux/list_bl.h:51:21: error: invalid storage class for function 'hlist_bl_unhashed' static inline bool hlist_bl_unhashed(const struct hlist_bl_node *h) ^~~~~~~~~~~~~~~~~ >> include/linux/list_bl.h:56:59: warning: 'struct hlist_bl_head' declared inside parameter list will not be visible outside of this definition or declaration static inline struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h) ^~~~~~~~~~~~~ >> include/linux/list_bl.h:56:37: error: invalid storage class for function 'hlist_bl_first' static inline struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h) ^~~~~~~~~~~~~~ include/linux/list_bl.h: In function 'hlist_bl_first': >> include/linux/list_bl.h:59:20: error: dereferencing pointer to incomplete type 'struct hlist_bl_head' ((unsigned long)h->first & ~LIST_BL_LOCKMASK); ^~ include/linux/list_bl.h: In function 'mcp23s08_irq': include/linux/list_bl.h:62:46: warning: 'struct hlist_bl_head' declared inside parameter list will not be visible outside of this definition or declaration static inline void hlist_bl_set_first(struct hlist_bl_head *h, ^~~~~~~~~~~~~ >> include/linux/list_bl.h:62:20: error: invalid storage class for function 'hlist_bl_set_first' static inline void hlist_bl_set_first(struct hlist_bl_head *h, ^~~~~~~~~~~~~~~~~~ In file included from include/linux/linkage.h:4:0, from include/linux/kernel.h:6, from drivers/gpio/gpio-mcp23s08.c:13: include/linux/list_bl.h: In function 'hlist_bl_set_first': include/linux/list_bl.h:66:34: error: dereferencing pointer to incomplete type 'struct hlist_bl_head' LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != ^ include/linux/compiler.h:160:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ include/asm-generic/bug.h:55:32: note: in expansion of macro 'if' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^~ include/linux/compiler.h:150:24: note: in expansion of macro '__branch_check__' # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) ^~~~~~~~~~~~~~~~ include/asm-generic/bug.h:55:36: note: in expansion of macro 'unlikely' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^~~~~~~~ >> include/linux/list_bl.h:27:27: note: in expansion of macro 'BUG_ON' #define LIST_BL_BUG_ON(x) BUG_ON(x) ^~~~~~ >> include/linux/list_bl.h:66:2: note: in expansion of macro 'LIST_BL_BUG_ON' LIST_BL_BUG_ON(((unsigned long)h->first & LIST_BL_LOCKMASK) != ^~~~~~~~~~~~~~ In file included from include/linux/rculist_bl.h:7:0, from include/linux/dcache.h:7, from include/linux/fs.h:7, from include/linux/seq_file.h:10, from drivers/gpio/gpio-mcp23s08.c:485: include/linux/list_bl.h: In function 'mcp23s08_irq': include/linux/list_bl.h:71:48: warning: 'struct hlist_bl_head' declared inside parameter list will not be visible outside of this definition or declaration static inline bool hlist_bl_empty(const struct hlist_bl_head *h) ^~~~~~~~~~~~~ >> include/linux/list_bl.h:71:20: error: invalid storage class for function 'hlist_bl_empty' static inline bool hlist_bl_empty(const struct hlist_bl_head *h) ^~~~~~~~~~~~~~ In file included from include/linux/linkage.h:4:0, from include/linux/kernel.h:6, from drivers/gpio/gpio-mcp23s08.c:13: include/linux/list_bl.h: In function 'hlist_bl_empty': >> include/linux/list_bl.h:73:37: error: dereferencing pointer to incomplete type 'const struct hlist_bl_head' return !((unsigned long)READ_ONCE(h->first) & ~LIST_BL_LOCKMASK); ^ include/linux/compiler.h:316:17: note: in definition of macro '__READ_ONCE' union { typeof(x) __val; char __c[1]; } __u; \ ^ >> include/linux/list_bl.h:73:26: note: in expansion of macro 'READ_ONCE' return !((unsigned long)READ_ONCE(h->first) & ~LIST_BL_LOCKMASK); ^~~~~~~~~ In file included from include/linux/rculist_bl.h:7:0, from include/linux/dcache.h:7, from include/linux/fs.h:7, from include/linux/seq_file.h:10, from drivers/gpio/gpio-mcp23s08.c:485: include/linux/list_bl.h: In function 'mcp23s08_irq': include/linux/list_bl.h:77:13: warning: 'struct hlist_bl_head' declared inside parameter list will not be visible outside of this definition or declaration struct hlist_bl_head *h) ^~~~~~~~~~~~~ >> include/linux/list_bl.h:76:20: error: invalid storage class for function 'hlist_bl_add_head' static inline void hlist_bl_add_head(struct hlist_bl_node *n, ^~~~~~~~~~~~~~~~~ include/linux/list_bl.h: In function 'hlist_bl_add_head': >> include/linux/list_bl.h:79:47: error: passing argument 1 of 'hlist_bl_first' from incompatible pointer type [-Werror=incompatible-pointer-types] struct hlist_bl_node *first = hlist_bl_first(h); ^ include/linux/list_bl.h:56:37: note: expected 'struct hlist_bl_head *' but argument is of type 'struct hlist_bl_head *' static inline struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h) ^~~~~~~~~~~~~~ include/linux/list_bl.h:84:15: error: dereferencing pointer to incomplete type 'struct hlist_bl_head' n->pprev = &h->first; ^~ >> include/linux/list_bl.h:85:21: error: passing argument 1 of 'hlist_bl_set_first' from incompatible pointer type [-Werror=incompatible-pointer-types] hlist_bl_set_first(h, n); ^ include/linux/list_bl.h:62:20: note: expected 'struct hlist_bl_head *' but argument is of type 'struct hlist_bl_head *' static inline void hlist_bl_set_first(struct hlist_bl_head *h, ^~~~~~~~~~~~~~~~~~ include/linux/list_bl.h: In function 'mcp23s08_irq': >> include/linux/list_bl.h:88:20: error: invalid storage class for function '__hlist_bl_del' static inline void __hlist_bl_del(struct hlist_bl_node *n) ^~~~~~~~~~~~~~ >> include/linux/list_bl.h:104:20: error: invalid storage class for function 'hlist_bl_del' static inline void hlist_bl_del(struct hlist_bl_node *n) ^~~~~~~~~~~~ >> include/linux/list_bl.h:111:20: error: invalid storage class for function 'hlist_bl_del_init' static inline void hlist_bl_del_init(struct hlist_bl_node *n) ^~~~~~~~~~~~~~~~~ include/linux/list_bl.h:119:41: warning: 'struct hlist_bl_head' declared inside parameter list will not be visible outside of this definition or declaration static inline void hlist_bl_lock(struct hlist_bl_head *b) ^~~~~~~~~~~~~ vim +/mcp23s08_dbg_show +491 drivers/gpio/gpio-mcp23s08.c e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 485 #include <linux/seq_file.h> e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 486 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 487 /* e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 488 * This shows more info than the generic gpio dump code: e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 489 * pullups, deglitching, open drain drive. e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 490 */ e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 @491 static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 492 { e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 493 struct mcp23s08 *mcp; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 494 char bank; 1d1c1d9b drivers/gpio/mcp23s08.c Roel Kluin 2008-05-23 495 int t; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 496 unsigned mask; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 497 9e03cf0b drivers/gpio/gpio-mcp23s08.c Linus Walleij 2015-12-07 498 mcp = gpiochip_get_data(chip); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 499 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 500 /* NOTE: we only handle one bank for now ... */ 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 501 bank = '0' + ((mcp->addr >> 1) & 0x7); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 502 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 503 mutex_lock(&mcp->lock); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 504 t = mcp_update_cache(mcp); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 505 if (t < 0) { e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 506 seq_printf(s, " I/O ERROR %d\n", t); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 507 goto done; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 508 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 509 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 510 for (t = 0, mask = 1; t < chip->ngpio; t++, mask <<= 1) { e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 511 const char *label; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 512 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 513 label = gpiochip_is_requested(chip, t); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 514 if (!label) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 515 continue; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 516 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 517 seq_printf(s, " gpio-%-3d P%c.%d (%-12s) %s %s %s", e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 518 chip->base + t, bank, t, label, e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 519 (mcp->cache[MCP_IODIR] & mask) ? "in " : "out", e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 520 (mcp->cache[MCP_GPIO] & mask) ? "hi" : "lo", eb1567f7 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2012-04-25 521 (mcp->cache[MCP_GPPU] & mask) ? "up" : " "); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 522 /* NOTE: ignoring the irq-related registers */ 33bc8411 drivers/gpio/gpio-mcp23s08.c Gary Servin 2014-03-06 523 seq_puts(s, "\n"); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 524 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 525 done: e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 526 mutex_unlock(&mcp->lock); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 527 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 528 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 529 #else e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 530 #define mcp23s08_dbg_show NULL e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 531 #endif e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 532 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 533 /*----------------------------------------------------------------------*/ e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 534 d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 @535 static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 536 void *data, unsigned addr, unsigned type, 3af0dbd5 drivers/gpio/gpio-mcp23s08.c Sonic Zhang 2014-09-01 537 struct mcp23s08_platform_data *pdata, int cs) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 538 { 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 539 int status, ret; 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 540 bool mirror = false; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 541 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 542 mutex_init(&mcp->lock); e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 543 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 544 mcp->dev = dev; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 545 mcp->addr = addr; a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 546 mcp->irq_active_high = false; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 547 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 548 mcp->chip.direction_input = mcp23s08_direction_input; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 549 mcp->chip.get = mcp23s08_get; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 550 mcp->chip.direction_output = mcp23s08_direction_output; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 551 mcp->chip.set = mcp23s08_set; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 @552 mcp->chip.dbg_show = mcp23s08_dbg_show; 60f749f8 drivers/gpio/gpio-mcp23s08.c Linus Walleij 2016-09-07 553 #ifdef CONFIG_OF_GPIO 97ddb1c8 drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2013-04-04 554 mcp->chip.of_gpio_n_cells = 2; 97ddb1c8 drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2013-04-04 555 mcp->chip.of_node = dev->of_node; 97ddb1c8 drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2013-04-04 556 #endif e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 557 d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 558 switch (type) { d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 559 #ifdef CONFIG_SPI_MASTER d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 560 case MCP_TYPE_S08: 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 561 mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 562 &mcp23x08_regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 563 mcp->reg_shift = 0; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 564 mcp->chip.ngpio = 8; 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 565 mcp->chip.label = "mcp23s08"; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 566 break; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 567 d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 568 case MCP_TYPE_S17: 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 569 mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 570 &mcp23x17_regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 571 mcp->reg_shift = 1; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 572 mcp->chip.ngpio = 16; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 573 mcp->chip.label = "mcp23s17"; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 574 break; 28c5a41e drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-01 575 28c5a41e drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-01 576 case MCP_TYPE_S18: 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 577 mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 578 &mcp23x17_regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 579 mcp->reg_shift = 1; 28c5a41e drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-01 580 mcp->chip.ngpio = 16; 28c5a41e drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-01 581 mcp->chip.label = "mcp23s18"; 28c5a41e drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-01 582 break; d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 583 #endif /* CONFIG_SPI_MASTER */ d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 584 cbf24fad drivers/gpio/gpio-mcp23s08.c Daniel M. Weeks 2012-11-06 585 #if IS_ENABLED(CONFIG_I2C) 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 586 case MCP_TYPE_008: 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 587 mcp->regmap = devm_regmap_init_i2c(data, &mcp23x08_regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 588 mcp->reg_shift = 0; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 589 mcp->chip.ngpio = 8; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 590 mcp->chip.label = "mcp23008"; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 591 break; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 592 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 593 case MCP_TYPE_017: 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 594 mcp->regmap = devm_regmap_init_i2c(data, &mcp23x17_regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 595 mcp->reg_shift = 1; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 596 mcp->chip.ngpio = 16; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 597 mcp->chip.label = "mcp23017"; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 598 break; 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 599 #endif /* CONFIG_I2C */ 752ad5e8 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 600 d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 601 default: d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 602 dev_err(dev, "invalid device type (%d)\n", type); d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 603 return -EINVAL; 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 604 } d62b98f3 drivers/gpio/gpio-mcp23s08.c Peter Korsgaard 2011-07-15 605 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 606 if (IS_ERR(mcp->regmap)) 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 607 return PTR_ERR(mcp->regmap); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 608 3af0dbd5 drivers/gpio/gpio-mcp23s08.c Sonic Zhang 2014-09-01 609 mcp->chip.base = pdata->base; 9fb1f39e drivers/gpio/gpio-mcp23s08.c Linus Walleij 2013-12-04 610 mcp->chip.can_sleep = true; 58383c78 drivers/gpio/gpio-mcp23s08.c Linus Walleij 2015-11-04 611 mcp->chip.parent = dev; d72cbed0 drivers/gpio/mcp23s08.c Guennadi Liakhovetski 2008-04-28 612 mcp->chip.owner = THIS_MODULE; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 613 8f1cc3b1 drivers/gpio/mcp23s08.c David Brownell 2008-07-25 614 /* verify MCP_IOCON.SEQOP = 0, so sequential reads work, 8f1cc3b1 drivers/gpio/mcp23s08.c David Brownell 2008-07-25 615 * and MCP_IOCON.HAEN = 1, so we work with all chips. 8f1cc3b1 drivers/gpio/mcp23s08.c David Brownell 2008-07-25 616 */ 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 617 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 618 ret = mcp_read(mcp, MCP_IOCON, &status); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 619 if (ret < 0) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 620 goto fail; 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 621 3af0dbd5 drivers/gpio/gpio-mcp23s08.c Sonic Zhang 2014-09-01 622 mcp->irq_controller = pdata->irq_controller; a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 623 if (mcp->irq && mcp->irq_controller) { 170680ab drivers/gpio/gpio-mcp23s08.c Linus Walleij 2014-12-12 624 mcp->irq_active_high = 58383c78 drivers/gpio/gpio-mcp23s08.c Linus Walleij 2015-11-04 625 of_property_read_bool(mcp->chip.parent->of_node, a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 626 "microchip,irq-active-high"); a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 627 3af0dbd5 drivers/gpio/gpio-mcp23s08.c Sonic Zhang 2014-09-01 628 mirror = pdata->mirror; a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 629 } 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 630 a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 631 if ((status & IOCON_SEQOP) || !(status & IOCON_HAEN) || mirror || a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 632 mcp->irq_active_high) { 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 633 /* mcp23s17 has IOCON twice, make sure they are in sync */ 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 634 status &= ~(IOCON_SEQOP | (IOCON_SEQOP << 8)); 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 635 status |= IOCON_HAEN | (IOCON_HAEN << 8); a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 636 if (mcp->irq_active_high) a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 637 status |= IOCON_INTPOL | (IOCON_INTPOL << 8); a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 638 else 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 639 status &= ~(IOCON_INTPOL | (IOCON_INTPOL << 8)); a4e63554 drivers/gpio/gpio-mcp23s08.c Alexander Stein 2014-12-01 640 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 641 if (mirror) 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 642 status |= IOCON_MIRROR | (IOCON_MIRROR << 8); 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 643 3539699c drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-15 644 if (type == MCP_TYPE_S18) 3539699c drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-15 645 status |= IOCON_INTCC | (IOCON_INTCC << 8); 3539699c drivers/gpio/gpio-mcp23s08.c Phil Reid 2016-03-15 646 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 647 ret = mcp_write(mcp, MCP_IOCON, status); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 648 if (ret < 0) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 649 goto fail; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 650 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 651 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 652 /* configure ~100K pullups */ 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 653 ret = mcp_write(mcp, MCP_GPPU, pdata->chip[cs].pullups); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 654 if (ret < 0) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 655 goto fail; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 656 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 657 ret = mcp_update_cache(mcp); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 658 if (ret < 0) e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 659 goto fail; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 660 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 661 /* disable inverter on input */ e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 662 if (mcp->cache[MCP_IPOL] != 0) { e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 663 mcp->cache[MCP_IPOL] = 0; 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 664 ret = mcp_write(mcp, MCP_IPOL, 0); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 665 if (ret < 0) 0b7bb77f drivers/gpio/mcp23s08.c Peter Korsgaard 2011-03-09 666 goto fail; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 667 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 668 e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 669 /* disable irqs */ e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 670 if (mcp->cache[MCP_GPINTEN] != 0) { e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 671 mcp->cache[MCP_GPINTEN] = 0; 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 672 ret = mcp_write(mcp, MCP_GPINTEN, 0); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 673 if (ret < 0) 8f1cc3b1 drivers/gpio/mcp23s08.c David Brownell 2008-07-25 674 goto fail; e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 675 } e58b9e27 drivers/gpio/mcp23s08.c David Brownell 2008-02-04 676 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 677 ret = gpiochip_add_data(&mcp->chip, mcp); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 678 if (ret < 0) 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 679 goto fail; 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 680 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 681 if (mcp->irq && mcp->irq_controller) { 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 @682 ret = mcp23s08_irq_setup(mcp); 3d84fdb3 drivers/gpio/gpio-mcp23s08.c Sebastian Reichel 2017-01-27 683 if (ret) 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 684 goto fail; 4e47f91b drivers/gpio/gpio-mcp23s08.c Lars Poeschel 2014-01-16 685 } :::::: The code at line 491 was first introduced by commit :::::: e58b9e2762a6ef99e20dba47aba21b911658541d mcp23s08 spi gpio expander support :::::: TO: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip