pinctrl: stm32: update pincontrol for stmp32mp157
- add the 2 new compatible used by STM32MP157 "st,stm32mp157-pinctrl" "st,stm32mp157-z-pinctrl" - update the mask for the port Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
5d0c74e624
commit
8aeba629cc
@ -41,9 +41,10 @@ static int stm32_gpio_config(struct gpio_desc *desc,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int prep_gpio_dsc(struct stm32_gpio_dsc *gpio_dsc, u32 port_pin)
|
static int prep_gpio_dsc(struct stm32_gpio_dsc *gpio_dsc, u32 port_pin)
|
||||||
{
|
{
|
||||||
gpio_dsc->port = (port_pin & 0xF000) >> 12;
|
gpio_dsc->port = (port_pin & 0x1F000) >> 12;
|
||||||
gpio_dsc->pin = (port_pin & 0x0F00) >> 8;
|
gpio_dsc->pin = (port_pin & 0x0F00) >> 8;
|
||||||
debug("%s: GPIO:port= %d, pin= %d\n", __func__, gpio_dsc->port,
|
debug("%s: GPIO:port= %d, pin= %d\n", __func__, gpio_dsc->port,
|
||||||
gpio_dsc->pin);
|
gpio_dsc->pin);
|
||||||
@ -115,11 +116,13 @@ static int stm32_pinctrl_config(int offset)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
struct gpio_desc desc;
|
struct gpio_desc desc;
|
||||||
|
|
||||||
debug("%s: pinmux = %x\n", __func__, *(pin_mux + i));
|
debug("%s: pinmux = %x\n", __func__, *(pin_mux + i));
|
||||||
prep_gpio_dsc(&gpio_dsc, *(pin_mux + i));
|
prep_gpio_dsc(&gpio_dsc, *(pin_mux + i));
|
||||||
prep_gpio_ctl(&gpio_ctl, *(pin_mux + i), offset);
|
prep_gpio_ctl(&gpio_ctl, *(pin_mux + i), offset);
|
||||||
rv = uclass_get_device_by_seq(UCLASS_GPIO,
|
rv = uclass_get_device_by_seq(UCLASS_GPIO,
|
||||||
gpio_dsc.port, &desc.dev);
|
gpio_dsc.port,
|
||||||
|
&desc.dev);
|
||||||
if (rv)
|
if (rv)
|
||||||
return rv;
|
return rv;
|
||||||
desc.offset = gpio_dsc.pin;
|
desc.offset = gpio_dsc.pin;
|
||||||
@ -186,6 +189,8 @@ static const struct udevice_id stm32_pinctrl_ids[] = {
|
|||||||
{ .compatible = "st,stm32f469-pinctrl" },
|
{ .compatible = "st,stm32f469-pinctrl" },
|
||||||
{ .compatible = "st,stm32f746-pinctrl" },
|
{ .compatible = "st,stm32f746-pinctrl" },
|
||||||
{ .compatible = "st,stm32h743-pinctrl" },
|
{ .compatible = "st,stm32h743-pinctrl" },
|
||||||
|
{ .compatible = "st,stm32mp157-pinctrl" },
|
||||||
|
{ .compatible = "st,stm32mp157-z-pinctrl" },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user