pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 22 Feb 2022 11:11:44 +0000 (12:11 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 17 Mar 2022 01:06:53 +0000 (02:06 +0100)
commit156f721704b5c9e8fae02270f606f09d710ff27e
tree84b296095ac0525823a673fe4c4cc7d8c207c58b
parentc19763c3de3718b8d8472e180421aa9d4a86770f
pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback

All of the MediaTek pinctrl drivers registering with pinctrl-mtk-common
that are offering a .spec_ies_smt_set() callback are declaring their
own function which is doing exactly the same on all drivers: calling
mtk_pconf_spec_set_ies_smt_range() with their struct and a simple check.

Commonize this callback by adding the ies and smt structure pointers
to struct mtk_pinctrl_devdata and changing the callback signature to
take it.

Removing the callback and checking for the existance of the spec_smt
and/or spec_ies data would allow us to staticize the function
mtk_pconf_spec_set_ies_smt_range(), but this solution was avoided as
to keep flexibility, as some SoCs may need to perform a very different
operation compared to what this commonized function is doing.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20220222111144.20796-6-angelogioacchino.delregno@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-mt2701.c
drivers/pinctrl/mediatek/pinctrl-mt2712.c
drivers/pinctrl/mediatek/pinctrl-mt8127.c
drivers/pinctrl/mediatek/pinctrl-mt8167.c
drivers/pinctrl/mediatek/pinctrl-mt8173.c
drivers/pinctrl/mediatek/pinctrl-mt8365.c
drivers/pinctrl/mediatek/pinctrl-mt8516.c
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
drivers/pinctrl/mediatek/pinctrl-mtk-common.h