Skip to content

Commit c3ffe0f

Browse files
committed
Merge branch 'linux-6.6-trunk/at91/pinctrl' into linux-6.6-mchp
2 parents 6913aae + ece36e6 commit c3ffe0f

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

drivers/pinctrl/pinctrl-at91-pio4.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ static void atmel_gpio_set_multiple(struct gpio_chip *chip, unsigned long *mask,
434434
}
435435

436436
static struct gpio_chip atmel_gpio_chip = {
437+
.request = gpiochip_generic_request,
438+
.free = gpiochip_generic_free,
437439
.direction_input = atmel_gpio_direction_input,
438440
.get = atmel_gpio_get,
439441
.get_multiple = atmel_gpio_get_multiple,
@@ -720,11 +722,27 @@ static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev,
720722
return 0;
721723
}
722724

725+
static int atmel_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
726+
struct pinctrl_gpio_range *range,
727+
unsigned offset)
728+
{
729+
u32 conf;
730+
731+
conf = atmel_pin_config_read(pctldev, offset);
732+
conf &= (~ATMEL_PIO_CFGR_FUNC_MASK);
733+
atmel_pin_config_write(pctldev, offset, conf);
734+
735+
dev_dbg(pctldev->dev, "enable pin %u as GPIO\n", offset);
736+
737+
return 0;
738+
}
739+
723740
static const struct pinmux_ops atmel_pmxops = {
724741
.get_functions_count = atmel_pmx_get_functions_count,
725742
.get_function_name = atmel_pmx_get_function_name,
726743
.get_function_groups = atmel_pmx_get_function_groups,
727744
.set_mux = atmel_pmx_set_mux,
745+
.gpio_request_enable = atmel_pmx_gpio_request_enable,
728746
};
729747

730748
static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
@@ -1038,7 +1056,7 @@ static int __maybe_unused atmel_pctrl_resume(struct device *dev)
10381056
}
10391057

10401058
static const struct dev_pm_ops atmel_pctrl_pm_ops = {
1041-
SET_SYSTEM_SLEEP_PM_OPS(atmel_pctrl_suspend, atmel_pctrl_resume)
1059+
SET_LATE_SYSTEM_SLEEP_PM_OPS(atmel_pctrl_suspend, atmel_pctrl_resume)
10421060
};
10431061

10441062
/*

0 commit comments

Comments
 (0)