Skip to content

Commit 5f755e1

Browse files
Light Hsiehlinusw
authored andcommitted
pinctrl: mediatek: Supporting driving setting without mapping current to register value
MediaTek's smartphone project actual usage does need to know current value (in mA) in procedure of finding the best driving setting. The steps in the procedure is like as follow: 1. set driving setting field in setting register as 0, measure waveform, perform test, and etc. 2. set driving setting field in setting register as 1, measure waveform, perform test, and etc. ... n. set driving setting field in setting register as n-1, measure waveform, perform test, and etc. Check the results of steps 1~n and adopt the setting that get best result. This procedure does need to know the mapping between current to register value. Therefore, setting driving without mapping current is more practical for MediaTek's smartphone usage. Signed-off-by: Light Hsieh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Sean Wang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 3de7dee commit 5f755e1

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

drivers/pinctrl/mediatek/pinctrl-mt6765.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,8 @@ static const struct mtk_pin_soc mt6765_data = {
10771077
.bias_disable_get = mtk_pinconf_bias_disable_get,
10781078
.bias_set = mtk_pinconf_bias_set,
10791079
.bias_get = mtk_pinconf_bias_get,
1080-
.drive_set = mtk_pinconf_drive_set_rev1,
1081-
.drive_get = mtk_pinconf_drive_get_rev1,
1080+
.drive_set = mtk_pinconf_drive_set_raw,
1081+
.drive_get = mtk_pinconf_drive_get_raw,
10821082
.adv_pull_get = mtk_pinconf_adv_pull_get,
10831083
.adv_pull_set = mtk_pinconf_adv_pull_set,
10841084
};

drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,18 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
608608
return 0;
609609
}
610610

611+
int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
612+
const struct mtk_pin_desc *desc, u32 arg)
613+
{
614+
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
615+
}
616+
617+
int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
618+
const struct mtk_pin_desc *desc, int *val)
619+
{
620+
return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
621+
}
622+
611623
int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
612624
const struct mtk_pin_desc *desc, bool pullup,
613625
u32 arg)

drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
288288
int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
289289
const struct mtk_pin_desc *desc, int *val);
290290

291+
int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
292+
const struct mtk_pin_desc *desc, u32 arg);
293+
int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
294+
const struct mtk_pin_desc *desc, int *val);
295+
291296
int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
292297
const struct mtk_pin_desc *desc, bool pullup,
293298
u32 arg);

0 commit comments

Comments
 (0)