imx31: Work around an apparently not-quite-kosher abuse of CPP

(we were trying to foward-declare functions from within static
 initializer context.  GCC no longer accepts this)

Change-Id: I58f316ecc84c8ab45fffc054955727a55714b0a3
This commit is contained in:
Solomon Peachy 2020-10-13 15:47:26 -04:00
parent f8bd54d575
commit 431caa4311
4 changed files with 23 additions and 7 deletions

View File

@ -1067,7 +1067,7 @@ enum mc13783_regs_enum
#define MC13783_ICHRG_1064MA (0xc << 3) /* 967 1064 1170 */
#define MC13783_ICHRG_1152MA (0xd << 3) /* 1048 1152 1268 */
#define MC13783_ICHRG_1596MA (0xe << 3) /* 1450 1596 1755 */
#define MC13783_ICHRG_FULLY_ON (0xf << 3) /* Disallow HW FET turn on */
#define MC13783_ICHRG_FULLY_ON (0xf << 3) /* Disallow HW FET turn on */
#define MC13783_ICHRGTR (0x7 << 7) /* Min Nom Max */
#define MC13783_ICHRGTR_POS (7)
#define MC13783_ICHRGTR_0MA (0x0 << 7) /* 0 0 0 */
@ -1340,11 +1340,12 @@ struct mc13783_event
{ \
static const struct mc13783_event __tbl[] = {
#define MC13783_EVENT_VECTOR_CB(__name) void MC13783_EVENT_CB_##__name(void)
#define MC13783_EVENT_VECTOR(__name, __sense) \
{ .id = MC13783_INT_ID_##__name, \
.sense = (__sense), \
.callback = ({ void MC13783_EVENT_CB_##__name(void); \
MC13783_EVENT_CB_##__name; }) },
.callback = (MC13783_EVENT_CB_##__name) },
#define MC13783_EVENT_VECTOR_TBL_END() \
}; \

View File

@ -28,6 +28,11 @@
#ifdef DEFINE_GPIO_VECTOR_TABLE
GPIO_EVENT_VECTOR_CB(GPIO1_31);
#if CONFIG_TUNER
GPIO_EVENT_VECTOR_CB(GPIO1_27);
#endif
GPIO_VECTOR_TBL_START()
/* mc13783 keeps the PRIINT high (no low pulse) if other unmasked
* interrupts become active when clearing them or if a source being

View File

@ -42,6 +42,15 @@ static struct spi_node mc13783_spi =
0, /* SPI clock - no wait states */
};
MC13783_EVENT_VECTOR_CB(ADCDONE);
#if CONFIG_RTC
MC13783_EVENT_VECTOR_CB(1HZ);
#endif
MC13783_EVENT_VECTOR_CB(ONOFD1);
MC13783_EVENT_VECTOR_CB(SE1);
MC13783_EVENT_VECTOR_CB(USB);
MC13783_EVENT_VECTOR_CB(ONOFD2);
/* Gigabeat S definitions for static MC13783 event registration */
MC13783_EVENT_VECTOR_TBL_START()
/* ADC conversion complete */

View File

@ -166,11 +166,12 @@ struct gpio_event
{ \
static const struct gpio_event __tbl[] = {
#define GPIO_EVENT_VECTOR_CB(__name) void __name##_EVENT_CB(void)
#define GPIO_EVENT_VECTOR(__name, __sense) \
{ .id = (__name##_ID), \
.sense = (__sense), \
.callback = ({ void __name##_EVENT_CB(void); \
__name##_EVENT_CB; }) },
{ .id = (__name##_ID), \
.sense = (__sense), \
.callback = (__name##_EVENT_CB) },
#define GPIO_VECTOR_TBL_END() \
}; \