Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: keembay: use a dedicated structure for the pinfunction description

struct function_desc is a wrapper around struct pinfunction with an
additional void *data pointer. We're 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(). This driver uses the data pointer so in
order to stop using struct function_desc, we need to provide an
alternative that also wraps the mux mode which is passed to pinctrl core
as user data.

Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Bartosz Golaszewski and committed by
Linus Walleij
071cdf56 aae7a287

+11 -6
+11 -6
drivers/pinctrl/pinctrl-keembay.c
··· 135 135 const struct pinctrl_pin_desc *pins; 136 136 }; 137 137 138 + struct keembay_pinfunction { 139 + struct pinfunction func; 140 + u8 mux_mode; 141 + }; 142 + 138 143 static const struct pinctrl_pin_desc keembay_pins[] = { 139 144 KEEMBAY_PIN_DESC(0, "GPIO0", 140 145 KEEMBAY_MUX(0x0, "I2S0_M0"), ··· 1561 1556 } 1562 1557 1563 1558 static int keembay_add_functions(struct keembay_pinctrl *kpc, 1564 - struct function_desc *functions) 1559 + struct keembay_pinfunction *functions) 1565 1560 { 1566 1561 unsigned int i; 1567 1562 1568 1563 /* Assign the groups for each function */ 1569 1564 for (i = 0; i < kpc->nfuncs; i++) { 1570 - struct function_desc *func = &functions[i]; 1565 + struct keembay_pinfunction *func = &functions[i]; 1571 1566 const char **group_names; 1572 1567 unsigned int grp_idx = 0; 1573 1568 int j; ··· 1593 1588 /* Add all functions */ 1594 1589 for (i = 0; i < kpc->nfuncs; i++) 1595 1590 pinmux_generic_add_pinfunction(kpc->pctrl, &functions[i].func, 1596 - functions[i].data); 1591 + &functions[i].mux_mode); 1597 1592 1598 1593 return 0; 1599 1594 } 1600 1595 1601 1596 static int keembay_build_functions(struct keembay_pinctrl *kpc) 1602 1597 { 1603 - struct function_desc *keembay_funcs, *new_funcs; 1598 + struct keembay_pinfunction *keembay_funcs, *new_funcs; 1604 1599 int i; 1605 1600 1606 1601 /* ··· 1619 1614 struct keembay_mux_desc *mux; 1620 1615 1621 1616 for (mux = pdesc->drv_data; mux->name; mux++) { 1622 - struct function_desc *fdesc; 1617 + struct keembay_pinfunction *fdesc; 1623 1618 1624 1619 /* Check if we already have function for this mux */ 1625 1620 for (fdesc = keembay_funcs; fdesc->func.name; fdesc++) { ··· 1633 1628 if (!fdesc->func.name) { 1634 1629 fdesc->func.name = mux->name; 1635 1630 fdesc->func.ngroups = 1; 1636 - fdesc->data = &mux->mode; 1631 + fdesc->mux_mode = mux->mode; 1637 1632 kpc->nfuncs++; 1638 1633 } 1639 1634 }