Lines Matching refs:pct
92 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_get_bit() local
98 ret = abx500_get_register_interruptible(pct->dev, in abx500_gpio_get_bit()
101 dev_err(pct->dev, in abx500_gpio_get_bit()
115 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_set_bits() local
120 ret = abx500_mask_and_set_register_interruptible(pct->dev, in abx500_gpio_set_bits()
123 dev_err(pct->dev, "%s write reg, %x offset %x failed (%d)\n", in abx500_gpio_set_bits()
136 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_get() local
155 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_gpio_get()
164 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_set() local
169 dev_err(pct->dev, "%s write failed (%d)\n", __func__, ret); in abx500_gpio_set()
176 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_direction_output() local
195 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_gpio_direction_output()
214 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_to_irq() local
220 for (i = 0; i < pct->irq_cluster_size; i++) { in abx500_gpio_to_irq()
222 &pct->irq_cluster[i]; in abx500_gpio_to_irq()
232 return irq_create_mapping(pct->parent->domain, hwirq); in abx500_gpio_to_irq()
242 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_set_mode() local
243 struct alternate_functions af = pct->soc->alternate_functions[gpio]; in abx500_set_mode()
259 dev_dbg(pct->dev, "pin %d doesn't support %s mode\n", gpio, in abx500_set_mode()
348 dev_dbg(pct->dev, "unknown alt_setting %d\n", alt_setting); in abx500_set_mode()
354 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_set_mode()
367 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_get_mode() local
368 struct alternate_functions af = pct->soc->alternate_functions[gpio]; in abx500_get_mode()
391 dev_err(pct->dev, in abx500_get_mode()
398 dev_err(pct->dev, in abx500_get_mode()
441 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_get_mode()
452 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_gpio_dbg_show_one() local
499 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_gpio_dbg_show_one()
506 struct abx500_pinctrl *pct = gpiochip_get_data(chip); in abx500_gpio_dbg_show() local
507 struct pinctrl_dev *pctldev = pct->pctldev; in abx500_gpio_dbg_show()
541 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pmx_get_funcs_cnt() local
543 return pct->soc->nfunctions; in abx500_pmx_get_funcs_cnt()
549 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pmx_get_func_name() local
551 return pct->soc->functions[function].name; in abx500_pmx_get_func_name()
559 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pmx_get_func_groups() local
561 *groups = pct->soc->functions[function].groups; in abx500_pmx_get_func_groups()
562 *num_groups = pct->soc->functions[function].ngroups; in abx500_pmx_get_func_groups()
570 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pmx_set() local
571 struct gpio_chip *chip = &pct->chip; in abx500_pmx_set()
576 g = &pct->soc->groups[group]; in abx500_pmx_set()
580 dev_dbg(pct->dev, "enable group %s, %u pins\n", g->name, g->npins); in abx500_pmx_set()
583 dev_dbg(pct->dev, "setting pin %d to altsetting %d\n", in abx500_pmx_set()
590 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_pmx_set()
599 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_gpio_request_enable() local
609 for (i = 0; i < pct->soc->gpio_num_ranges; i++) { in abx500_gpio_request_enable()
610 p = &pct->soc->gpio_ranges[i]; in abx500_gpio_request_enable()
616 if (i == pct->soc->gpio_num_ranges) { in abx500_gpio_request_enable()
617 dev_err(pct->dev, "%s failed to locate range\n", __func__); in abx500_gpio_request_enable()
621 dev_dbg(pct->dev, "enable GPIO by altfunc %d at gpio %d\n", in abx500_gpio_request_enable()
624 ret = abx500_set_mode(pct->pctldev, &pct->chip, in abx500_gpio_request_enable()
627 dev_err(pct->dev, "%s setting altfunc failed\n", __func__); in abx500_gpio_request_enable()
649 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_get_groups_cnt() local
651 return pct->soc->ngroups; in abx500_get_groups_cnt()
657 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_get_group_name() local
659 return pct->soc->groups[selector].name; in abx500_get_group_name()
667 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_get_group_pins() local
669 *pins = pct->soc->groups[selector].pins; in abx500_get_group_pins()
670 *num_pins = pct->soc->groups[selector].npins; in abx500_get_group_pins()
678 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pin_dbg_show() local
679 struct gpio_chip *chip = &pct->chip; in abx500_pin_dbg_show()
847 struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev); in abx500_pin_config_set() local
848 struct gpio_chip *chip = &pct->chip; in abx500_pin_config_set()
920 dev_err(pct->dev, "%s failed (%d)\n", __func__, ret); in abx500_pin_config_set()
987 struct abx500_pinctrl *pct; in abx500_gpio_probe() local
997 pct = devm_kzalloc(&pdev->dev, sizeof(*pct), GFP_KERNEL); in abx500_gpio_probe()
998 if (!pct) in abx500_gpio_probe()
1001 pct->dev = &pdev->dev; in abx500_gpio_probe()
1002 pct->parent = dev_get_drvdata(pdev->dev.parent); in abx500_gpio_probe()
1003 pct->chip = abx500gpio_chip; in abx500_gpio_probe()
1004 pct->chip.parent = &pdev->dev; in abx500_gpio_probe()
1005 pct->chip.base = -1; /* Dynamic allocation */ in abx500_gpio_probe()
1017 abx500_pinctrl_ab8500_init(&pct->soc); in abx500_gpio_probe()
1020 abx500_pinctrl_ab8505_init(&pct->soc); in abx500_gpio_probe()
1027 if (!pct->soc) { in abx500_gpio_probe()
1032 pct->chip.ngpio = abx500_get_gpio_num(pct->soc); in abx500_gpio_probe()
1033 pct->irq_cluster = pct->soc->gpio_irq_cluster; in abx500_gpio_probe()
1034 pct->irq_cluster_size = pct->soc->ngpio_irq_cluster; in abx500_gpio_probe()
1036 ret = gpiochip_add_data(&pct->chip, pct); in abx500_gpio_probe()
1043 abx500_pinctrl_desc.pins = pct->soc->pins; in abx500_gpio_probe()
1044 abx500_pinctrl_desc.npins = pct->soc->npins; in abx500_gpio_probe()
1045 pct->pctldev = devm_pinctrl_register(&pdev->dev, &abx500_pinctrl_desc, in abx500_gpio_probe()
1046 pct); in abx500_gpio_probe()
1047 if (IS_ERR(pct->pctldev)) { in abx500_gpio_probe()
1050 ret = PTR_ERR(pct->pctldev); in abx500_gpio_probe()
1056 for (i = 0; i < pct->soc->gpio_num_ranges; i++) { in abx500_gpio_probe()
1057 const struct abx500_pinrange *p = &pct->soc->gpio_ranges[i]; in abx500_gpio_probe()
1059 ret = gpiochip_add_pin_range(&pct->chip, in abx500_gpio_probe()
1066 platform_set_drvdata(pdev, pct); in abx500_gpio_probe()
1072 gpiochip_remove(&pct->chip); in abx500_gpio_probe()
1082 struct abx500_pinctrl *pct = platform_get_drvdata(pdev); in abx500_gpio_remove() local
1084 gpiochip_remove(&pct->chip); in abx500_gpio_remove()