aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2014-01-23 01:50:38 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-02-03 03:11:45 -0500
commitcffcc92e966911e3ea9320fac943f545a353f2e0 (patch)
tree99029050f3f2e7dc0f3c45fc8ff5b2c2a5d65a8d /drivers/gpio
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
gpio: xtensa: fix build when XCHAL_HAVE_CP is 0
In xtensa coprocessors may exist without coprocessor context, i.e. they cannot be disabled/enabled. In this case the RSR_CPENABLE/WSR_CPENABLE are undefined, thus breaking the build. Fix the build by adding dummy versions of enable_cp/disable_cp in this case. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-xtensa.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-xtensa.c b/drivers/gpio/gpio-xtensa.c
index 1d136eceda62..7081304d6797 100644
--- a/drivers/gpio/gpio-xtensa.c
+++ b/drivers/gpio/gpio-xtensa.c
@@ -40,6 +40,8 @@
40#error GPIO32 option is not enabled for your xtensa core variant 40#error GPIO32 option is not enabled for your xtensa core variant
41#endif 41#endif
42 42
43#if XCHAL_HAVE_CP
44
43static inline unsigned long enable_cp(unsigned long *cpenable) 45static inline unsigned long enable_cp(unsigned long *cpenable)
44{ 46{
45 unsigned long flags; 47 unsigned long flags;
@@ -57,6 +59,20 @@ static inline void disable_cp(unsigned long flags, unsigned long cpenable)
57 local_irq_restore(flags); 59 local_irq_restore(flags);
58} 60}
59 61
62#else
63
64static inline unsigned long enable_cp(unsigned long *cpenable)
65{
66 *cpenable = 0; /* avoid uninitialized value warning */
67 return 0;
68}
69
70static inline void disable_cp(unsigned long flags, unsigned long cpenable)
71{
72}
73
74#endif /* XCHAL_HAVE_CP */
75
60static int xtensa_impwire_get_direction(struct gpio_chip *gc, unsigned offset) 76static int xtensa_impwire_get_direction(struct gpio_chip *gc, unsigned offset)
61{ 77{
62 return 1; /* input only */ 78 return 1; /* input only */