Lines Matching refs:err

177 	int err;  in mtk_hw_set_value()  local
179 err = mtk_hw_pin_field_get(dev, pin, field, &pf); in mtk_hw_set_value()
180 if (err) in mtk_hw_set_value()
181 return err; in mtk_hw_set_value()
196 int err; in mtk_hw_get_value() local
198 err = mtk_hw_pin_field_get(dev, pin, field, &pf); in mtk_hw_get_value()
199 if (err) in mtk_hw_get_value()
200 return err; in mtk_hw_get_value()
301 int err, disable, pullup; in mtk_pinconf_bias_set_v0() local
307 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PU, 0); in mtk_pinconf_bias_set_v0()
308 if (err) in mtk_pinconf_bias_set_v0()
309 return err; in mtk_pinconf_bias_set_v0()
310 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PD, 0); in mtk_pinconf_bias_set_v0()
311 if (err) in mtk_pinconf_bias_set_v0()
312 return err; in mtk_pinconf_bias_set_v0()
315 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PU, pullup); in mtk_pinconf_bias_set_v0()
316 if (err) in mtk_pinconf_bias_set_v0()
317 return err; in mtk_pinconf_bias_set_v0()
318 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PD, !pullup); in mtk_pinconf_bias_set_v0()
319 if (err) in mtk_pinconf_bias_set_v0()
320 return err; in mtk_pinconf_bias_set_v0()
328 int err, disable, pullup, r0, r1; in mtk_pinconf_bias_set_v1() local
336 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PULLEN, 0); in mtk_pinconf_bias_set_v1()
337 if (err) in mtk_pinconf_bias_set_v1()
338 return err; in mtk_pinconf_bias_set_v1()
340 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PULLEN, 1); in mtk_pinconf_bias_set_v1()
341 if (err) in mtk_pinconf_bias_set_v1()
342 return err; in mtk_pinconf_bias_set_v1()
343 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PULLSEL, in mtk_pinconf_bias_set_v1()
345 if (err) in mtk_pinconf_bias_set_v1()
346 return err; in mtk_pinconf_bias_set_v1()
350 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup); in mtk_pinconf_bias_set_v1()
351 if (err != -EINVAL) { in mtk_pinconf_bias_set_v1()
361 int err; in mtk_pinconf_input_enable_v1() local
363 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_IES, 1); in mtk_pinconf_input_enable_v1()
364 if (err) in mtk_pinconf_input_enable_v1()
365 return err; in mtk_pinconf_input_enable_v1()
366 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DIR, 0); in mtk_pinconf_input_enable_v1()
367 if (err) in mtk_pinconf_input_enable_v1()
368 return err; in mtk_pinconf_input_enable_v1()
377 int err = -ENOTSUPP; in mtk_pinconf_drive_set_v0() local
387 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_E4, in mtk_pinconf_drive_set_v0()
389 if (err) in mtk_pinconf_drive_set_v0()
390 return err; in mtk_pinconf_drive_set_v0()
391 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_E8, in mtk_pinconf_drive_set_v0()
393 if (err) in mtk_pinconf_drive_set_v0()
394 return err; in mtk_pinconf_drive_set_v0()
406 int err = -ENOTSUPP; in mtk_pinconf_drive_set_v1() local
411 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DRV, arg); in mtk_pinconf_drive_set_v1()
412 if (err) in mtk_pinconf_drive_set_v1()
413 return err; in mtk_pinconf_drive_set_v1()
422 int err = 0; in mtk_pinconf_set() local
431 err = mtk_pinconf_bias_set_v0(dev, pin, param, arg); in mtk_pinconf_set()
433 err = mtk_pinconf_bias_set_v1(dev, pin, param, arg); in mtk_pinconf_set()
434 if (err) in mtk_pinconf_set()
435 goto err; in mtk_pinconf_set()
438 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_SMT, 0); in mtk_pinconf_set()
439 if (err) in mtk_pinconf_set()
440 goto err; in mtk_pinconf_set()
441 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DIR, 1); in mtk_pinconf_set()
442 if (err) in mtk_pinconf_set()
443 goto err; in mtk_pinconf_set()
447 err = mtk_pinconf_input_enable_v1(dev, pin, param); in mtk_pinconf_set()
448 if (err) in mtk_pinconf_set()
449 goto err; in mtk_pinconf_set()
452 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DIR, 1); in mtk_pinconf_set()
453 if (err) in mtk_pinconf_set()
454 goto err; in mtk_pinconf_set()
456 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DO, arg); in mtk_pinconf_set()
457 if (err) in mtk_pinconf_set()
458 goto err; in mtk_pinconf_set()
465 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_DIR, in mtk_pinconf_set()
467 if (err) in mtk_pinconf_set()
468 goto err; in mtk_pinconf_set()
470 err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_SMT, in mtk_pinconf_set()
472 if (err) in mtk_pinconf_set()
473 goto err; in mtk_pinconf_set()
477 err = mtk_pinconf_drive_set_v0(dev, pin, arg); in mtk_pinconf_set()
479 err = mtk_pinconf_drive_set_v1(dev, pin, arg); in mtk_pinconf_set()
480 if (err) in mtk_pinconf_set()
481 goto err; in mtk_pinconf_set()
485 err = -ENOTSUPP; in mtk_pinconf_set()
488 err: in mtk_pinconf_set()
490 return err; in mtk_pinconf_set()
531 int val, err; in mtk_gpio_get() local
533 err = mtk_hw_get_value(dev->parent, off, PINCTRL_PIN_REG_DI, &val); in mtk_gpio_get()
534 if (err) in mtk_gpio_get()
535 return err; in mtk_gpio_get()
547 int val, err; in mtk_gpio_get_direction() local
549 err = mtk_hw_get_value(dev->parent, off, PINCTRL_PIN_REG_DIR, &val); in mtk_gpio_get_direction()
550 if (err) in mtk_gpio_get_direction()
551 return err; in mtk_gpio_get_direction()