Skip to content

Commit bf64f7f

Browse files
JackieLiu1tsbogend
authored andcommitted
MIPS: rb532: move GPIOD definition into C-files
My kernel robot reports build error from drivers/iio/adc/da9150-gpadc.c, drivers/iio/adc/da9150-gpadc.c:254:13: error: ‘DA9150_GPADC_CHAN_0x08’ undeclared here (not in a function); did you mean ‘DA9150_GPADC_CHAN_TBAT’? 254 | .channel = DA9150_GPADC_CHAN_##_id, We define GPIOD in rb.h, in fact it should only be used in gpio.c, but it affects the driver da9150-gpadc.c which goes against the original intention of the design, just move it to its scope. Fixes: 1b43284 ("MIPS: RB532: GPIO register offsets are relative to GPIOBASE") Suggested-by: Jonathan Cameron <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reported-by: k2ci <[email protected]> Signed-off-by: Jackie Liu <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 3412320 commit bf64f7f

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

arch/mips/include/asm/mach-rc32434/rb.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@
2929
#define DEV3TC 0x01003C
3030
#define BTCS 0x010040
3131
#define BTCOMPARE 0x010044
32-
#define GPIOBASE 0x050000
33-
/* Offsets relative to GPIOBASE */
34-
#define GPIOFUNC 0x00
35-
#define GPIOCFG 0x04
36-
#define GPIOD 0x08
37-
#define GPIOILEVEL 0x0C
38-
#define GPIOISTAT 0x10
39-
#define GPIONMIEN 0x14
40-
#define IMASK6 0x38
4132
#define LO_WPX (1 << 0)
4233
#define LO_ALE (1 << 1)
4334
#define LO_CLE (1 << 2)

arch/mips/rb532/gpio.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
#include <asm/mach-rc32434/rb.h>
3838
#include <asm/mach-rc32434/gpio.h>
3939

40+
#define GPIOBASE 0x050000
41+
/* Offsets relative to GPIOBASE */
42+
#define GPIOFUNC 0x00
43+
#define GPIOCFG 0x04
44+
#define GPIOD 0x08
45+
#define GPIOILEVEL 0x0C
46+
#define GPIOISTAT 0x10
47+
#define GPIONMIEN 0x14
48+
#define IMASK6 0x38
49+
4050
struct rb532_gpio_chip {
4151
struct gpio_chip chip;
4252
void __iomem *regbase;

0 commit comments

Comments
 (0)