Commit bd6f4a91 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Linus Walleij
Browse files

pinctrl: mediatek: moore: replace struct function_desc with struct pinfunction



struct function_desc is a wrapper around struct pinfunction with an
additional void *data pointer. This driver doesn't use the data pointer.
We're also working towards reducing the usage of struct function_desc in
pinctrl drivers - they should only be created by pinmux core and
accessed by drivers using pinmux_generic_get_function(). Replace the
struct function_desc objects in this driver with smaller struct
pinfunction instances.

Reviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Tested-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7a24f1f5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -622,11 +622,9 @@ static int mtk_build_functions(struct mtk_pinctrl *hw)
	int i, err;

	for (i = 0; i < hw->soc->nfuncs ; i++) {
		const struct function_desc *function = hw->soc->funcs + i;
		const struct pinfunction *func = &function->func;
		const struct pinfunction *func = hw->soc->funcs + i;

		err = pinmux_generic_add_pinfunction(hw->pctrl, func,
						     function->data);
		err = pinmux_generic_add_pinfunction(hw->pctrl, func, NULL);
		if (err < 0) {
			dev_err(hw->dev, "Failed to register function %s\n",
				func->name);
+2 −5
Original line number Diff line number Diff line
@@ -44,10 +44,7 @@
	}

#define PINCTRL_PIN_FUNCTION(_name_, id)						\
	{											\
		.func = PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)),	\
		.data = NULL,									\
	}
	PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups))

int mtk_moore_pinctrl_probe(struct platform_device *pdev,
			    const struct mtk_pin_soc *soc);
+1 −1
Original line number Diff line number Diff line
@@ -822,7 +822,7 @@ static const char *mt7622_uart_groups[] = { "uart0_0_tx_rx",
					    "uart4_2_rts_cts",};
static const char *mt7622_wdt_groups[] = { "watchdog", };

static const struct function_desc mt7622_functions[] = {
static const struct pinfunction mt7622_functions[] = {
	PINCTRL_PIN_FUNCTION("antsel", mt7622_antsel),
	PINCTRL_PIN_FUNCTION("emmc", mt7622_emmc),
	PINCTRL_PIN_FUNCTION("eth", mt7622_ethernet),
+1 −1
Original line number Diff line number Diff line
@@ -1340,7 +1340,7 @@ static const char *mt7623_uart_groups[] = { "uart0_0_txd_rxd",
					    "uart3_rts_cts", };
static const char *mt7623_wdt_groups[] = { "watchdog_0", "watchdog_1", };

static const struct function_desc mt7623_functions[] = {
static const struct pinfunction mt7623_functions[] = {
	PINCTRL_PIN_FUNCTION("audck", mt7623_aud_clk),
	PINCTRL_PIN_FUNCTION("disp", mt7623_disp_pwm),
	PINCTRL_PIN_FUNCTION("eth", mt7623_ethernet),
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ static const char *mt7629_wdt_groups[] = { "watchdog", };
static const char *mt7629_wifi_groups[] = { "wf0_5g", "wf0_2g", };
static const char *mt7629_flash_groups[] = { "snfi", "spi_nor" };

static const struct function_desc mt7629_functions[] = {
static const struct pinfunction mt7629_functions[] = {
	PINCTRL_PIN_FUNCTION("eth", mt7629_ethernet),
	PINCTRL_PIN_FUNCTION("i2c", mt7629_i2c),
	PINCTRL_PIN_FUNCTION("led", mt7629_led),
Loading