Lines Matching refs:pin

167 			     struct pm8xxx_pin_data *pin)  in pm8xxx_mpp_update()  argument
175 switch (pin->mode) { in pm8xxx_mpp_update()
177 if (pin->dtest) { in pm8xxx_mpp_update()
179 ctrl = pin->dtest - 1; in pm8xxx_mpp_update()
180 } else if (pin->input && pin->output) { in pm8xxx_mpp_update()
182 if (pin->high_z) in pm8xxx_mpp_update()
184 else if (pin->pullup == 600) in pm8xxx_mpp_update()
186 else if (pin->pullup == 10000) in pm8xxx_mpp_update()
190 } else if (pin->input) { in pm8xxx_mpp_update()
192 if (pin->dtest) in pm8xxx_mpp_update()
193 ctrl = pin->dtest; in pm8xxx_mpp_update()
198 ctrl = !!pin->output_value; in pm8xxx_mpp_update()
199 if (pin->paired) in pm8xxx_mpp_update()
203 level = pin->power_source; in pm8xxx_mpp_update()
206 if (pin->output) { in pm8xxx_mpp_update()
208 level = pin->aout_level; in pm8xxx_mpp_update()
209 ctrl = pin->output_value; in pm8xxx_mpp_update()
210 if (pin->paired) in pm8xxx_mpp_update()
214 level = pin->amux; in pm8xxx_mpp_update()
219 level = (pin->drive_strength / 5) - 1; in pm8xxx_mpp_update()
220 if (pin->dtest) { in pm8xxx_mpp_update()
222 ctrl = pin->dtest - 1; in pm8xxx_mpp_update()
225 ctrl = pin->output_value; in pm8xxx_mpp_update()
226 if (pin->paired) in pm8xxx_mpp_update()
235 ret = regmap_write(pctrl->regmap, pin->reg, val); in pm8xxx_mpp_update()
305 struct pm8xxx_pin_data *pin = pctrl->desc.pins[group].drv_data; in pm8xxx_pinmux_set_mux() local
307 pin->mode = function; in pm8xxx_pinmux_set_mux()
308 pm8xxx_mpp_update(pctrl, pin); in pm8xxx_pinmux_set_mux()
325 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_pin_config_get() local
331 arg = pin->pullup; in pm8xxx_pin_config_get()
334 arg = pin->high_z; in pm8xxx_pin_config_get()
337 arg = pin->input; in pm8xxx_pin_config_get()
340 arg = pin->output_value; in pm8xxx_pin_config_get()
343 arg = pin->power_source; in pm8xxx_pin_config_get()
346 arg = pin->drive_strength; in pm8xxx_pin_config_get()
349 arg = pin->dtest; in pm8xxx_pin_config_get()
352 arg = pin->amux; in pm8xxx_pin_config_get()
355 arg = pin->aout_level; in pm8xxx_pin_config_get()
358 arg = pin->paired; in pm8xxx_pin_config_get()
375 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_pin_config_set() local
386 pin->pullup = arg; in pm8xxx_pin_config_set()
389 pin->high_z = true; in pm8xxx_pin_config_set()
392 pin->input = true; in pm8xxx_pin_config_set()
395 pin->output = true; in pm8xxx_pin_config_set()
396 pin->output_value = !!arg; in pm8xxx_pin_config_set()
399 pin->power_source = arg; in pm8xxx_pin_config_set()
402 pin->drive_strength = arg; in pm8xxx_pin_config_set()
405 pin->dtest = arg; in pm8xxx_pin_config_set()
408 pin->amux = arg; in pm8xxx_pin_config_set()
411 pin->aout_level = arg; in pm8xxx_pin_config_set()
414 pin->paired = !!arg; in pm8xxx_pin_config_set()
424 pm8xxx_mpp_update(pctrl, pin); in pm8xxx_pin_config_set()
447 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_mpp_direction_input() local
449 switch (pin->mode) { in pm8xxx_mpp_direction_input()
451 pin->input = true; in pm8xxx_mpp_direction_input()
454 pin->input = true; in pm8xxx_mpp_direction_input()
455 pin->output = true; in pm8xxx_mpp_direction_input()
461 pm8xxx_mpp_update(pctrl, pin); in pm8xxx_mpp_direction_input()
471 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_mpp_direction_output() local
473 switch (pin->mode) { in pm8xxx_mpp_direction_output()
475 pin->output = true; in pm8xxx_mpp_direction_output()
478 pin->input = false; in pm8xxx_mpp_direction_output()
479 pin->output = true; in pm8xxx_mpp_direction_output()
482 pin->input = false; in pm8xxx_mpp_direction_output()
483 pin->output = true; in pm8xxx_mpp_direction_output()
487 pm8xxx_mpp_update(pctrl, pin); in pm8xxx_mpp_direction_output()
495 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_mpp_get() local
499 if (!pin->input) in pm8xxx_mpp_get()
500 return !!pin->output_value; in pm8xxx_mpp_get()
516 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_mpp_set() local
518 pin->output_value = !!value; in pm8xxx_mpp_set()
520 pm8xxx_mpp_update(pctrl, pin); in pm8xxx_mpp_set()
546 struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data; in pm8xxx_mpp_dbg_show_one() local
560 switch (pin->mode) { in pm8xxx_mpp_dbg_show_one()
563 if (pin->dtest) { in pm8xxx_mpp_dbg_show_one()
564 seq_printf(s, "dtest%d\n", pin->dtest); in pm8xxx_mpp_dbg_show_one()
565 } else if (pin->input && pin->output) { in pm8xxx_mpp_dbg_show_one()
566 if (pin->high_z) in pm8xxx_mpp_dbg_show_one()
569 seq_printf(s, "bi-dir %dOhm", pin->pullup); in pm8xxx_mpp_dbg_show_one()
570 } else if (pin->input) { in pm8xxx_mpp_dbg_show_one()
571 if (pin->dtest) in pm8xxx_mpp_dbg_show_one()
572 seq_printf(s, "in dtest%d", pin->dtest); in pm8xxx_mpp_dbg_show_one()
575 } else if (pin->output) { in pm8xxx_mpp_dbg_show_one()
578 if (!pin->paired) { in pm8xxx_mpp_dbg_show_one()
579 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
582 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
589 if (pin->output) { in pm8xxx_mpp_dbg_show_one()
590 seq_printf(s, "out %s ", aout_lvls[pin->aout_level]); in pm8xxx_mpp_dbg_show_one()
591 if (!pin->paired) { in pm8xxx_mpp_dbg_show_one()
592 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
595 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
599 seq_printf(s, "input mux %s", amuxs[pin->amux]); in pm8xxx_mpp_dbg_show_one()
603 seq_printf(s, " sink %dmA ", pin->drive_strength); in pm8xxx_mpp_dbg_show_one()
604 if (pin->dtest) { in pm8xxx_mpp_dbg_show_one()
605 seq_printf(s, "dtest%d", pin->dtest); in pm8xxx_mpp_dbg_show_one()
607 if (!pin->paired) { in pm8xxx_mpp_dbg_show_one()
608 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
611 seq_puts(s, pin->output_value ? in pm8xxx_mpp_dbg_show_one()
645 struct pm8xxx_pin_data *pin) in pm8xxx_pin_populate() argument
653 ret = regmap_read(pctrl->regmap, pin->reg, &val); in pm8xxx_pin_populate()
665 pin->mode = PM8XXX_MPP_DIGITAL; in pm8xxx_pin_populate()
666 pin->input = true; in pm8xxx_pin_populate()
667 pin->power_source = level; in pm8xxx_pin_populate()
668 pin->dtest = ctrl; in pm8xxx_pin_populate()
671 pin->mode = PM8XXX_MPP_DIGITAL; in pm8xxx_pin_populate()
672 pin->output = true; in pm8xxx_pin_populate()
673 pin->power_source = level; in pm8xxx_pin_populate()
674 pin->output_value = !!(ctrl & BIT(0)); in pm8xxx_pin_populate()
675 pin->paired = !!(ctrl & BIT(1)); in pm8xxx_pin_populate()
678 pin->mode = PM8XXX_MPP_DIGITAL; in pm8xxx_pin_populate()
679 pin->input = true; in pm8xxx_pin_populate()
680 pin->output = true; in pm8xxx_pin_populate()
681 pin->power_source = level; in pm8xxx_pin_populate()
684 pin->pullup = 600; in pm8xxx_pin_populate()
687 pin->high_z = true; in pm8xxx_pin_populate()
690 pin->pullup = 10000; in pm8xxx_pin_populate()
693 pin->pullup = 30000; in pm8xxx_pin_populate()
698 pin->mode = PM8XXX_MPP_ANALOG; in pm8xxx_pin_populate()
699 pin->input = true; in pm8xxx_pin_populate()
700 pin->amux = level; in pm8xxx_pin_populate()
703 pin->mode = PM8XXX_MPP_ANALOG; in pm8xxx_pin_populate()
704 pin->output = true; in pm8xxx_pin_populate()
705 pin->aout_level = level; in pm8xxx_pin_populate()
706 pin->output_value = !!(ctrl & BIT(0)); in pm8xxx_pin_populate()
707 pin->paired = !!(ctrl & BIT(1)); in pm8xxx_pin_populate()
710 pin->mode = PM8XXX_MPP_SINK; in pm8xxx_pin_populate()
711 pin->drive_strength = 5 * (level + 1); in pm8xxx_pin_populate()
712 pin->output_value = !!(ctrl & BIT(0)); in pm8xxx_pin_populate()
713 pin->paired = !!(ctrl & BIT(1)); in pm8xxx_pin_populate()
716 pin->mode = PM8XXX_MPP_SINK; in pm8xxx_pin_populate()
717 pin->dtest = ctrl + 1; in pm8xxx_pin_populate()
718 pin->drive_strength = 5 * (level + 1); in pm8xxx_pin_populate()
721 pin->mode = PM8XXX_MPP_DIGITAL; in pm8xxx_pin_populate()
722 pin->power_source = level; in pm8xxx_pin_populate()
724 pin->dtest = ctrl; in pm8xxx_pin_populate()