STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12,
	STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 };
static const unsigned mmcsd_b_1_pins[] = { STN8815_PIN_D15 };
static const unsigned u1_a_1_pins[] = { STN8815_PIN_M2, STN8815_PIN_L1,
					STN8815_PIN_F3, STN8815_PIN_F2 };
static const unsigned i2c1_a_1_pins[] = { STN8815_PIN_L4, STN8815_PIN_L3 };
static const unsigned i2c0_a_1_pins[] = { STN8815_PIN_D3, STN8815_PIN_D2 };
/* Altfunction B */
static const unsigned u1_b_1_pins[] = { STN8815_PIN_B16, STN8815_PIN_A16 };
static const unsigned i2cusb_b_1_pins[] = { STN8815_PIN_C21, STN8815_PIN_C20 };

#define STN8815_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins,		\
			.npins = ARRAY_SIZE(a##_pins), .altsetting = b }

static const struct nmk_pingroup nmk_stn8815_groups[] = {
	STN8815_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
	STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
	STN8815_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
};

/* We use this macro to define the groups applicable to a function */
#define STN8815_FUNC_GROUPS(a, b...)	   \
static const char * const a##_groups[] = { b };
Example #2
0
static const unsigned mmcsd_a_1_pins[] = { STN8815_PIN_B10, STN8815_PIN_A10,
	STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12,
	STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 };
static const unsigned u1_a_1_pins[] = { STN8815_PIN_M2, STN8815_PIN_L1,
					STN8815_PIN_F3, STN8815_PIN_F2 };
static const unsigned i2c1_a_1_pins[] = { STN8815_PIN_L4, STN8815_PIN_L3 };
static const unsigned i2c0_a_1_pins[] = { STN8815_PIN_D3, STN8815_PIN_D2 };
/* Altfunction B */
static const unsigned u1_b_1_pins[] = { STN8815_PIN_B16, STN8815_PIN_A16 };
static const unsigned i2cusb_b_1_pins[] = { STN8815_PIN_C21, STN8815_PIN_C20 };

#define STN8815_PIN_GROUP(a,b) { .name = #a, .pins = a##_pins,		\
			.npins = ARRAY_SIZE(a##_pins), .altsetting = b }

static const struct nmk_pingroup nmk_stn8815_groups[] = {
	STN8815_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
	STN8815_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
	STN8815_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
};

/* We use this macro to define the groups applicable to a function */
#define STN8815_FUNC_GROUPS(a, b...)	   \
static const char * const a##_groups[] = { b };

STN8815_FUNC_GROUPS(u0, "u0_a_1");
STN8815_FUNC_GROUPS(mmcsd, "mmcsd_a_1");
STN8815_FUNC_GROUPS(u1, "u1_a_1", "u1_b_1");