drivers/gpio/gpio-menz127.c:69:17: sparse: sparse: cast removes address space '__iomem' of expression
From: kernel test robot
Date: Tue Jul 07 2020 - 06:03:27 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: bfe91da29bfad9941d5d703d45e29f0812a20724
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 3 weeks ago
config: m68k-randconfig-s031-20200707 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-31-gabbfd661-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> drivers/gpio/gpio-menz127.c:69:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpio/gpio-menz127.c:79:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpio/gpio-menz127.c:80:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpio/gpio-menz127.c:95:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpio/gpio-menz127.c:103:9: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:177:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:167:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/spi/spi-dw.h:162:16: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/spi/spi-dw.h:172:9: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/video/fbdev/68328fb.c:438:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char [noderef] __iomem *static [toplevel] screen_base @@ got void * @@
>> drivers/video/fbdev/68328fb.c:438:29: sparse: expected char [noderef] __iomem *static [toplevel] screen_base
drivers/video/fbdev/68328fb.c:438:29: sparse: got void *
--
>> drivers/watchdog/dw_wdt.c:78:19: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:87:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:114:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:132:19: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:138:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:172:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:174:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:189:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:63:16: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/dw_wdt.c:63:16: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/watchdog/menz69_wdt.c:39:15: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:41:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:51:15: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:53:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:64:15: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:66:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:80:15: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/menz69_wdt.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
--
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
>> sound/soc/hisilicon/hi6210-i2s.c:88:16: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/hisilicon/hi6210-i2s.c:83:9: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/crypto/amlogic/amlogic-gxl-core.c:31:29: sparse: sparse: cast removes address space '__iomem' of expression
include/asm-generic/io.h:299:9: sparse: sparse: cast removes address space '__iomem' of expression
include/asm-generic/io.h:299:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int volatile @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:299:9: sparse: expected unsigned int volatile
include/asm-generic/io.h:299:9: sparse: got restricted __le32 [usertype]
--
drivers/crypto/amlogic/amlogic-gxl-cipher.c:171:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] v @@ got unsigned long @@
drivers/crypto/amlogic/amlogic-gxl-cipher.c:171:19: sparse: expected restricted __le32 [usertype] v
drivers/crypto/amlogic/amlogic-gxl-cipher.c:171:19: sparse: got unsigned long
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __le32 [usertype] v @@
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: expected unsigned int [usertype] val
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: got restricted __le32 [usertype] v
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:172:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:215:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] v @@ got unsigned long @@
drivers/crypto/amlogic/amlogic-gxl-cipher.c:215:19: sparse: expected restricted __le32 [usertype] v
drivers/crypto/amlogic/amlogic-gxl-cipher.c:215:19: sparse: got unsigned long
drivers/crypto/amlogic/amlogic-gxl-cipher.c:217:27: sparse: sparse: invalid assignment: |=
drivers/crypto/amlogic/amlogic-gxl-cipher.c:217:27: sparse: left side has type restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:217:27: sparse: right side has type unsigned long
drivers/crypto/amlogic/amlogic-gxl-cipher.c:221:27: sparse: sparse: invalid assignment: |=
drivers/crypto/amlogic/amlogic-gxl-cipher.c:221:27: sparse: left side has type restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:221:27: sparse: right side has type unsigned long
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __le32 [usertype] v @@
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: expected unsigned int [usertype] val
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: got restricted __le32 [usertype] v
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: cast from restricted __le32
drivers/crypto/amlogic/amlogic-gxl-cipher.c:222:34: sparse: sparse: cast from restricted __le32
>> drivers/crypto/amlogic/amlogic-gxl-cipher.c:230:9: sparse: sparse: cast removes address space '__iomem' of expression
--
sound/soc/xilinx/xlnx_i2s.c:28:53: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got void * @@
sound/soc/xilinx/xlnx_i2s.c:28:53: sparse: expected void [noderef] __iomem *base
sound/soc/xilinx/xlnx_i2s.c:28:53: sparse: got void *
>> sound/soc/xilinx/xlnx_i2s.c:33:9: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/xilinx/xlnx_i2s.c:43:53: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got void * @@
sound/soc/xilinx/xlnx_i2s.c:43:53: sparse: expected void [noderef] __iomem *base
sound/soc/xilinx/xlnx_i2s.c:43:53: sparse: got void *
sound/soc/xilinx/xlnx_i2s.c:49:17: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/xilinx/xlnx_i2s.c:59:53: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *base @@ got void * @@
sound/soc/xilinx/xlnx_i2s.c:59:53: sparse: expected void [noderef] __iomem *base
sound/soc/xilinx/xlnx_i2s.c:59:53: sparse: got void *
sound/soc/xilinx/xlnx_i2s.c:65:17: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/xilinx/xlnx_i2s.c:70:17: sparse: sparse: cast removes address space '__iomem' of expression
sound/soc/xilinx/xlnx_i2s.c:156:37: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *data @@ got void [noderef] __iomem *[assigned] base @@
sound/soc/xilinx/xlnx_i2s.c:156:37: sparse: expected void *data
sound/soc/xilinx/xlnx_i2s.c:156:37: sparse: got void [noderef] __iomem *[assigned] base
vim +/__iomem +69 drivers/gpio/gpio-menz127.c
f436bc2726c645 Andreas Werner 2016-02-29 37
f436bc2726c645 Andreas Werner 2016-02-29 38 static int men_z127_debounce(struct gpio_chip *gc, unsigned gpio,
f436bc2726c645 Andreas Werner 2016-02-29 39 unsigned debounce)
f436bc2726c645 Andreas Werner 2016-02-29 40 {
f436bc2726c645 Andreas Werner 2016-02-29 41 struct men_z127_gpio *priv = gpiochip_get_data(gc);
86d3f367686852 Axel Lin 2016-03-09 42 struct device *dev = gc->parent;
f436bc2726c645 Andreas Werner 2016-02-29 43 unsigned int rnd;
f436bc2726c645 Andreas Werner 2016-02-29 44 u32 db_en, db_cnt;
f436bc2726c645 Andreas Werner 2016-02-29 45
f436bc2726c645 Andreas Werner 2016-02-29 46 if (!MEN_Z127_DB_IN_RANGE(debounce)) {
f436bc2726c645 Andreas Werner 2016-02-29 47 dev_err(dev, "debounce value %u out of range", debounce);
f436bc2726c645 Andreas Werner 2016-02-29 48 return -EINVAL;
f436bc2726c645 Andreas Werner 2016-02-29 49 }
f436bc2726c645 Andreas Werner 2016-02-29 50
f436bc2726c645 Andreas Werner 2016-02-29 51 if (debounce > 0) {
f436bc2726c645 Andreas Werner 2016-02-29 52 /* round up or down depending on MSB-1 */
f436bc2726c645 Andreas Werner 2016-02-29 53 rnd = fls(debounce) - 1;
f436bc2726c645 Andreas Werner 2016-02-29 54
f436bc2726c645 Andreas Werner 2016-02-29 55 if (rnd && (debounce & BIT(rnd - 1)))
7279d9917560bb Nadav Amit 2018-06-04 56 debounce = roundup(debounce, MEN_Z127_DB_MIN_US);
f436bc2726c645 Andreas Werner 2016-02-29 57 else
7279d9917560bb Nadav Amit 2018-06-04 58 debounce = rounddown(debounce, MEN_Z127_DB_MIN_US);
f436bc2726c645 Andreas Werner 2016-02-29 59
f436bc2726c645 Andreas Werner 2016-02-29 60 if (debounce > MEN_Z127_DB_MAX_US)
f436bc2726c645 Andreas Werner 2016-02-29 61 debounce = MEN_Z127_DB_MAX_US;
f436bc2726c645 Andreas Werner 2016-02-29 62
f436bc2726c645 Andreas Werner 2016-02-29 63 /* 50us per register unit */
f436bc2726c645 Andreas Werner 2016-02-29 64 debounce /= 50;
f436bc2726c645 Andreas Werner 2016-02-29 65 }
f436bc2726c645 Andreas Werner 2016-02-29 66
fd975a7b180c9a Axel Lin 2016-03-09 67 spin_lock(&gc->bgpio_lock);
f436bc2726c645 Andreas Werner 2016-02-29 68
f436bc2726c645 Andreas Werner 2016-02-29 @69 db_en = readl(priv->reg_base + MEN_Z127_DBER);
f436bc2726c645 Andreas Werner 2016-02-29 70
f436bc2726c645 Andreas Werner 2016-02-29 71 if (debounce == 0) {
f436bc2726c645 Andreas Werner 2016-02-29 72 db_en &= ~BIT(gpio);
f436bc2726c645 Andreas Werner 2016-02-29 73 db_cnt = 0;
f436bc2726c645 Andreas Werner 2016-02-29 74 } else {
f436bc2726c645 Andreas Werner 2016-02-29 75 db_en |= BIT(gpio);
f436bc2726c645 Andreas Werner 2016-02-29 76 db_cnt = debounce;
f436bc2726c645 Andreas Werner 2016-02-29 77 }
f436bc2726c645 Andreas Werner 2016-02-29 78
f436bc2726c645 Andreas Werner 2016-02-29 79 writel(db_en, priv->reg_base + MEN_Z127_DBER);
f436bc2726c645 Andreas Werner 2016-02-29 80 writel(db_cnt, priv->reg_base + GPIO_TO_DBCNT_REG(gpio));
f436bc2726c645 Andreas Werner 2016-02-29 81
fd975a7b180c9a Axel Lin 2016-03-09 82 spin_unlock(&gc->bgpio_lock);
f436bc2726c645 Andreas Werner 2016-02-29 83
f436bc2726c645 Andreas Werner 2016-02-29 84 return 0;
f436bc2726c645 Andreas Werner 2016-02-29 85 }
f436bc2726c645 Andreas Werner 2016-02-29 86
:::::: The code at line 69 was first introduced by commit
:::::: f436bc2726c6451bd15b63f100f00dcee52ba103 gpio: add driver for MEN 16Z127 GPIO controller
:::::: TO: Andreas Werner <andy@xxxxxxxxxxxxx>
:::::: CC: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip