Lines Matching refs:pctldev

448 static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev,  in atmel_pin_config_read()  argument
451 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pin_config_read()
464 static void atmel_pin_config_write(struct pinctrl_dev *pctldev, in atmel_pin_config_write() argument
467 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pin_config_write()
479 static int atmel_pctl_get_groups_count(struct pinctrl_dev *pctldev) in atmel_pctl_get_groups_count() argument
481 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pctl_get_groups_count()
486 static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev, in atmel_pctl_get_group_name() argument
489 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pctl_get_group_name()
494 static int atmel_pctl_get_group_pins(struct pinctrl_dev *pctldev, in atmel_pctl_get_group_pins() argument
499 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pctl_get_group_pins()
508 atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned int pin) in atmel_pctl_find_group_by_pin() argument
510 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pctl_find_group_by_pin()
523 static int atmel_pctl_xlate_pinfunc(struct pinctrl_dev *pctldev, in atmel_pctl_xlate_pinfunc() argument
528 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pctl_xlate_pinfunc()
540 grp = atmel_pctl_find_group_by_pin(pctldev, pin_id); in atmel_pctl_xlate_pinfunc()
556 static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, in atmel_pctl_dt_subnode_to_map() argument
572 ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, in atmel_pctl_dt_subnode_to_map()
575 dev_err(pctldev->dev, "%pOF: could not parse node property\n", in atmel_pctl_dt_subnode_to_map()
582 dev_err(pctldev->dev, "no pins found in node %pOF\n", np); in atmel_pctl_dt_subnode_to_map()
595 ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, num_maps, in atmel_pctl_dt_subnode_to_map()
607 ret = atmel_pctl_xlate_pinfunc(pctldev, np, pinfunc, &group, in atmel_pctl_dt_subnode_to_map()
612 pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps, in atmel_pctl_dt_subnode_to_map()
616 ret = pinctrl_utils_add_map_configs(pctldev, map, in atmel_pctl_dt_subnode_to_map()
630 static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, in atmel_pctl_dt_node_to_map() argument
648 ret = atmel_pctl_dt_subnode_to_map(pctldev, np_config, map, in atmel_pctl_dt_node_to_map()
652 ret = atmel_pctl_dt_subnode_to_map(pctldev, np, map, in atmel_pctl_dt_node_to_map()
662 pinctrl_utils_free_map(pctldev, *map, *num_maps); in atmel_pctl_dt_node_to_map()
663 dev_err(pctldev->dev, "can't create maps for node %pOF\n", in atmel_pctl_dt_node_to_map()
678 static int atmel_pmx_get_functions_count(struct pinctrl_dev *pctldev) in atmel_pmx_get_functions_count() argument
683 static const char *atmel_pmx_get_function_name(struct pinctrl_dev *pctldev, in atmel_pmx_get_function_name() argument
689 static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev, in atmel_pmx_get_function_groups() argument
694 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pmx_get_function_groups()
702 static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev, in atmel_pmx_set_mux() argument
706 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_pmx_set_mux()
710 dev_dbg(pctldev->dev, "enable function %s group %s\n", in atmel_pmx_set_mux()
714 conf = atmel_pin_config_read(pctldev, pin); in atmel_pmx_set_mux()
717 dev_dbg(pctldev->dev, "pin: %u, conf: 0x%08x\n", pin, conf); in atmel_pmx_set_mux()
718 atmel_pin_config_write(pctldev, pin, conf); in atmel_pmx_set_mux()
730 static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev, in atmel_conf_pin_config_group_get() argument
734 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_conf_pin_config_group_get()
740 res = atmel_pin_config_read(pctldev, pin_id); in atmel_conf_pin_config_group_get()
797 static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, in atmel_conf_pin_config_group_set() argument
802 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_conf_pin_config_group_set()
808 conf = atmel_pin_config_read(pctldev, pin_id); in atmel_conf_pin_config_group_set()
818 dev_dbg(pctldev->dev, "%s: pin=%u, config=0x%lx\n", in atmel_conf_pin_config_group_set()
894 dev_warn(pctldev->dev, "drive strength not updated (incorrect value)\n"); in atmel_conf_pin_config_group_set()
900 dev_warn(pctldev->dev, in atmel_conf_pin_config_group_set()
907 dev_dbg(pctldev->dev, "%s: reg=0x%08x\n", __func__, conf); in atmel_conf_pin_config_group_set()
908 atmel_pin_config_write(pctldev, pin_id, conf); in atmel_conf_pin_config_group_set()
913 static int atmel_conf_pin_config_set(struct pinctrl_dev *pctldev, in atmel_conf_pin_config_set() argument
918 struct atmel_group *grp = atmel_pctl_find_group_by_pin(pctldev, pin); in atmel_conf_pin_config_set()
920 return atmel_conf_pin_config_group_set(pctldev, grp->pin, configs, num_configs); in atmel_conf_pin_config_set()
923 static int atmel_conf_pin_config_get(struct pinctrl_dev *pctldev, in atmel_conf_pin_config_get() argument
927 struct atmel_group *grp = atmel_pctl_find_group_by_pin(pctldev, pin); in atmel_conf_pin_config_get()
929 return atmel_conf_pin_config_group_get(pctldev, grp->pin, configs); in atmel_conf_pin_config_get()
932 static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev, in atmel_conf_pin_config_dbg_show() argument
936 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); in atmel_conf_pin_config_dbg_show()
946 conf = atmel_pin_config_read(pctldev, pin_id); in atmel_conf_pin_config_dbg_show()