Lines Matching full:err
11 #include <linux/err.h>
197 int err; in mtk_hw_set_value() local
199 err = mtk_hw_pin_field_get(hw, desc, field, &pf); in mtk_hw_set_value()
200 if (err) in mtk_hw_set_value()
201 return err; in mtk_hw_set_value()
220 int err; in mtk_hw_get_value() local
222 err = mtk_hw_pin_field_get(hw, desc, field, &pf); in mtk_hw_get_value()
223 if (err) in mtk_hw_get_value()
224 return err; in mtk_hw_get_value()
308 int value, err; in mtk_xt_get_gpio_state() local
310 err = mtk_xt_get_gpio_n(hw, eint_n, &gpio_n, &gpio_chip); in mtk_xt_get_gpio_state()
311 if (err) in mtk_xt_get_gpio_state()
312 return err; in mtk_xt_get_gpio_state()
316 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DI, &value); in mtk_xt_get_gpio_state()
317 if (err) in mtk_xt_get_gpio_state()
318 return err; in mtk_xt_get_gpio_state()
329 int err; in mtk_xt_set_gpio_as_eint() local
331 err = mtk_xt_get_gpio_n(hw, eint_n, &gpio_n, &gpio_chip); in mtk_xt_set_gpio_as_eint()
332 if (err) in mtk_xt_set_gpio_as_eint()
333 return err; in mtk_xt_set_gpio_as_eint()
340 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE, in mtk_xt_set_gpio_as_eint()
342 if (err) in mtk_xt_set_gpio_as_eint()
343 return err; in mtk_xt_set_gpio_as_eint()
345 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, MTK_INPUT); in mtk_xt_set_gpio_as_eint()
346 if (err) in mtk_xt_set_gpio_as_eint()
347 return err; in mtk_xt_set_gpio_as_eint()
349 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); in mtk_xt_set_gpio_as_eint()
351 * support virtual GPIOs, so the extra condition err != -ENOTSUPP in mtk_xt_set_gpio_as_eint()
356 if (err && err != -ENOTSUPP) in mtk_xt_set_gpio_as_eint()
357 return err; in mtk_xt_set_gpio_as_eint()
442 int err; in mtk_pinconf_bias_disable_set() local
444 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, in mtk_pinconf_bias_disable_set()
446 if (err) in mtk_pinconf_bias_disable_set()
447 return err; in mtk_pinconf_bias_disable_set()
449 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, in mtk_pinconf_bias_disable_set()
451 if (err) in mtk_pinconf_bias_disable_set()
452 return err; in mtk_pinconf_bias_disable_set()
462 int err; in mtk_pinconf_bias_disable_get() local
464 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &v); in mtk_pinconf_bias_disable_get()
465 if (err) in mtk_pinconf_bias_disable_get()
466 return err; in mtk_pinconf_bias_disable_get()
468 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &v2); in mtk_pinconf_bias_disable_get()
469 if (err) in mtk_pinconf_bias_disable_get()
470 return err; in mtk_pinconf_bias_disable_get()
484 int err, arg; in mtk_pinconf_bias_set() local
488 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, arg & 1); in mtk_pinconf_bias_set()
489 if (err) in mtk_pinconf_bias_set()
490 return err; in mtk_pinconf_bias_set()
492 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, in mtk_pinconf_bias_set()
494 if (err) in mtk_pinconf_bias_set()
495 return err; in mtk_pinconf_bias_set()
504 int reg, err, v; in mtk_pinconf_bias_get() local
508 err = mtk_hw_get_value(hw, desc, reg, &v); in mtk_pinconf_bias_get()
509 if (err) in mtk_pinconf_bias_get()
510 return err; in mtk_pinconf_bias_get()
533 int v, err; in mtk_pinconf_bias_disable_get_rev1() local
535 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, &v); in mtk_pinconf_bias_disable_get_rev1()
536 if (err) in mtk_pinconf_bias_disable_get_rev1()
537 return err; in mtk_pinconf_bias_disable_get_rev1()
551 int err, arg; in mtk_pinconf_bias_set_rev1() local
555 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, in mtk_pinconf_bias_set_rev1()
557 if (err) in mtk_pinconf_bias_set_rev1()
558 return err; in mtk_pinconf_bias_set_rev1()
560 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, arg); in mtk_pinconf_bias_set_rev1()
561 if (err) in mtk_pinconf_bias_set_rev1()
562 return err; in mtk_pinconf_bias_set_rev1()
572 int err, v; in mtk_pinconf_bias_get_rev1() local
574 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, &v); in mtk_pinconf_bias_get_rev1()
575 if (err) in mtk_pinconf_bias_get_rev1()
576 return err; in mtk_pinconf_bias_get_rev1()
581 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, &v); in mtk_pinconf_bias_get_rev1()
582 if (err) in mtk_pinconf_bias_get_rev1()
583 return err; in mtk_pinconf_bias_get_rev1()
603 int err, pu, pd; in mtk_pinconf_bias_set_pu_pd() local
619 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu); in mtk_pinconf_bias_set_pu_pd()
620 if (err) in mtk_pinconf_bias_set_pu_pd()
621 return err; in mtk_pinconf_bias_set_pu_pd()
631 int err, enable; in mtk_pinconf_bias_set_pullsel_pullen() local
638 err = -EINVAL; in mtk_pinconf_bias_set_pullsel_pullen()
642 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable); in mtk_pinconf_bias_set_pullsel_pullen()
643 if (err) in mtk_pinconf_bias_set_pullsel_pullen()
646 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup); in mtk_pinconf_bias_set_pullsel_pullen()
649 return err; in mtk_pinconf_bias_set_pullsel_pullen()
656 int err, r0, r1; in mtk_pinconf_bias_set_pupd_r1_r0() local
672 err = -EINVAL; in mtk_pinconf_bias_set_pupd_r1_r0()
677 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, !pullup); in mtk_pinconf_bias_set_pupd_r1_r0()
678 if (err) in mtk_pinconf_bias_set_pupd_r1_r0()
681 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, r0); in mtk_pinconf_bias_set_pupd_r1_r0()
682 if (err) in mtk_pinconf_bias_set_pupd_r1_r0()
685 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, r1); in mtk_pinconf_bias_set_pupd_r1_r0()
688 return err; in mtk_pinconf_bias_set_pupd_r1_r0()
733 int err, rsel_val; in mtk_pinconf_bias_set_rsel() local
737 err = mtk_hw_pin_rsel_lookup(hw, desc, pullup, arg, &rsel_val); in mtk_pinconf_bias_set_rsel()
738 if (err) in mtk_pinconf_bias_set_rsel()
739 return err; in mtk_pinconf_bias_set_rsel()
755 int err; in mtk_pinconf_bias_set_pu_pd_rsel() local
758 err = mtk_pinconf_bias_set_rsel(hw, desc, pullup, arg); in mtk_pinconf_bias_set_pu_pd_rsel()
759 if (err) in mtk_pinconf_bias_set_pu_pd_rsel()
760 return err; in mtk_pinconf_bias_set_pu_pd_rsel()
770 int err = -ENOTSUPP; in mtk_pinconf_bias_set_combo() local
779 err = mtk_pinconf_bias_set_pu_pd_rsel(hw, desc, pullup, arg); in mtk_pinconf_bias_set_combo()
780 if (!err) in mtk_pinconf_bias_set_combo()
785 err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg, true); in mtk_pinconf_bias_set_combo()
786 if (!err) in mtk_pinconf_bias_set_combo()
787 return err; in mtk_pinconf_bias_set_combo()
791 err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg, false); in mtk_pinconf_bias_set_combo()
792 if (!err) in mtk_pinconf_bias_set_combo()
797 err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc, in mtk_pinconf_bias_set_combo()
799 if (!err) in mtk_pinconf_bias_set_combo()
804 err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg); in mtk_pinconf_bias_set_combo()
806 if (err) in mtk_pinconf_bias_set_combo()
809 return err; in mtk_pinconf_bias_set_combo()
842 int pu, pd, rsel, err; in mtk_pinconf_bias_get_pu_pd_rsel() local
844 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_RSEL, &rsel); in mtk_pinconf_bias_get_pu_pd_rsel()
845 if (err) in mtk_pinconf_bias_get_pu_pd_rsel()
848 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu); in mtk_pinconf_bias_get_pu_pd_rsel()
849 if (err) in mtk_pinconf_bias_get_pu_pd_rsel()
852 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); in mtk_pinconf_bias_get_pu_pd_rsel()
853 if (err) in mtk_pinconf_bias_get_pu_pd_rsel()
872 err = -EINVAL; in mtk_pinconf_bias_get_pu_pd_rsel()
877 return err; in mtk_pinconf_bias_get_pu_pd_rsel()
884 int err, pu, pd; in mtk_pinconf_bias_get_pu_pd() local
886 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu); in mtk_pinconf_bias_get_pu_pd()
887 if (err) in mtk_pinconf_bias_get_pu_pd()
890 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); in mtk_pinconf_bias_get_pu_pd()
891 if (err) in mtk_pinconf_bias_get_pu_pd()
904 err = -EINVAL; in mtk_pinconf_bias_get_pu_pd()
907 return err; in mtk_pinconf_bias_get_pu_pd()
914 int err, pd; in mtk_pinconf_bias_get_pd() local
916 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); in mtk_pinconf_bias_get_pd()
917 if (err) in mtk_pinconf_bias_get_pd()
927 err = -EINVAL; in mtk_pinconf_bias_get_pd()
930 return err; in mtk_pinconf_bias_get_pd()
937 int err; in mtk_pinconf_bias_get_pullsel_pullen() local
939 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup); in mtk_pinconf_bias_get_pullsel_pullen()
940 if (err) in mtk_pinconf_bias_get_pullsel_pullen()
943 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable); in mtk_pinconf_bias_get_pullsel_pullen()
946 return err; in mtk_pinconf_bias_get_pullsel_pullen()
953 int err, r0, r1; in mtk_pinconf_bias_get_pupd_r1_r0() local
955 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, pullup); in mtk_pinconf_bias_get_pupd_r1_r0()
956 if (err) in mtk_pinconf_bias_get_pupd_r1_r0()
961 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &r0); in mtk_pinconf_bias_get_pupd_r1_r0()
962 if (err) in mtk_pinconf_bias_get_pupd_r1_r0()
965 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &r1); in mtk_pinconf_bias_get_pupd_r1_r0()
966 if (err) in mtk_pinconf_bias_get_pupd_r1_r0()
978 err = -EINVAL; in mtk_pinconf_bias_get_pupd_r1_r0()
981 return err; in mtk_pinconf_bias_get_pupd_r1_r0()
988 int err = -ENOTSUPP; in mtk_pinconf_bias_get_combo() local
997 err = mtk_pinconf_bias_get_pu_pd_rsel(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
998 if (!err) in mtk_pinconf_bias_get_combo()
1003 err = mtk_pinconf_bias_get_pd(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
1004 if (!err) in mtk_pinconf_bias_get_combo()
1005 return err; in mtk_pinconf_bias_get_combo()
1009 err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
1010 if (!err) in mtk_pinconf_bias_get_combo()
1015 err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc, in mtk_pinconf_bias_get_combo()
1017 if (!err) in mtk_pinconf_bias_get_combo()
1022 err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
1024 return err; in mtk_pinconf_bias_get_combo()
1033 int err = -ENOTSUPP; in mtk_pinconf_drive_set() local
1043 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_E4, in mtk_pinconf_drive_set()
1045 if (err) in mtk_pinconf_drive_set()
1046 return err; in mtk_pinconf_drive_set()
1048 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_E8, in mtk_pinconf_drive_set()
1050 if (err) in mtk_pinconf_drive_set()
1051 return err; in mtk_pinconf_drive_set()
1054 return err; in mtk_pinconf_drive_set()
1062 int err, val1, val2; in mtk_pinconf_drive_get() local
1066 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_E4, &val1); in mtk_pinconf_drive_get()
1067 if (err) in mtk_pinconf_drive_get()
1068 return err; in mtk_pinconf_drive_get()
1070 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_E8, &val2); in mtk_pinconf_drive_get()
1071 if (err) in mtk_pinconf_drive_get()
1072 return err; in mtk_pinconf_drive_get()
1088 int err = -ENOTSUPP; in mtk_pinconf_drive_set_rev1() local
1095 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, in mtk_pinconf_drive_set_rev1()
1097 if (err) in mtk_pinconf_drive_set_rev1()
1098 return err; in mtk_pinconf_drive_set_rev1()
1101 return err; in mtk_pinconf_drive_set_rev1()
1109 int err, val1; in mtk_pinconf_drive_get_rev1() local
1113 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, &val1); in mtk_pinconf_drive_get_rev1()
1114 if (err) in mtk_pinconf_drive_get_rev1()
1115 return err; in mtk_pinconf_drive_get_rev1()
1141 int err; in mtk_pinconf_adv_pull_set() local
1148 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, arg & 1); in mtk_pinconf_adv_pull_set()
1149 if (err) in mtk_pinconf_adv_pull_set()
1152 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, in mtk_pinconf_adv_pull_set()
1154 if (err) in mtk_pinconf_adv_pull_set()
1159 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, arg); in mtk_pinconf_adv_pull_set()
1164 if (err == -ENOTSUPP) { in mtk_pinconf_adv_pull_set()
1166 err = hw->soc->bias_set(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1167 if (err) in mtk_pinconf_adv_pull_set()
1168 return err; in mtk_pinconf_adv_pull_set()
1170 err = mtk_pinconf_bias_set_rev1(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1171 if (err) in mtk_pinconf_adv_pull_set()
1172 err = mtk_pinconf_bias_set(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1176 return err; in mtk_pinconf_adv_pull_set()
1185 int err; in mtk_pinconf_adv_pull_get() local
1187 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, &t); in mtk_pinconf_adv_pull_get()
1192 if (err == -ENOTSUPP) { in mtk_pinconf_adv_pull_get()
1194 err = hw->soc->bias_get(hw, desc, pullup, val); in mtk_pinconf_adv_pull_get()
1195 if (err) in mtk_pinconf_adv_pull_get()
1196 return err; in mtk_pinconf_adv_pull_get()
1202 if (err) in mtk_pinconf_adv_pull_get()
1203 return err; in mtk_pinconf_adv_pull_get()
1209 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &t); in mtk_pinconf_adv_pull_get()
1210 if (err) in mtk_pinconf_adv_pull_get()
1211 return err; in mtk_pinconf_adv_pull_get()
1213 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &t2); in mtk_pinconf_adv_pull_get()
1214 if (err) in mtk_pinconf_adv_pull_get()
1215 return err; in mtk_pinconf_adv_pull_get()
1226 int err; in mtk_pinconf_adv_drive_set() local
1231 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_EN, en); in mtk_pinconf_adv_drive_set()
1232 if (err) in mtk_pinconf_adv_drive_set()
1233 return err; in mtk_pinconf_adv_drive_set()
1236 return err; in mtk_pinconf_adv_drive_set()
1238 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E0, e0); in mtk_pinconf_adv_drive_set()
1239 if (err) in mtk_pinconf_adv_drive_set()
1240 return err; in mtk_pinconf_adv_drive_set()
1242 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, e1); in mtk_pinconf_adv_drive_set()
1243 if (err) in mtk_pinconf_adv_drive_set()
1244 return err; in mtk_pinconf_adv_drive_set()
1246 return err; in mtk_pinconf_adv_drive_set()
1254 int err; in mtk_pinconf_adv_drive_get() local
1256 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_EN, &en); in mtk_pinconf_adv_drive_get()
1257 if (err) in mtk_pinconf_adv_drive_get()
1258 return err; in mtk_pinconf_adv_drive_get()
1260 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_E0, &e0); in mtk_pinconf_adv_drive_get()
1261 if (err) in mtk_pinconf_adv_drive_get()
1262 return err; in mtk_pinconf_adv_drive_get()
1264 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, &e1); in mtk_pinconf_adv_drive_get()
1265 if (err) in mtk_pinconf_adv_drive_get()
1266 return err; in mtk_pinconf_adv_drive_get()