• Home
  • Raw
  • Download

Lines Matching full:bank

354  * given a pin number that is local to a pin controller, find out the pin bank
355 * and the register base of the pin bank.
359 struct samsung_pin_bank **bank) in pin_to_reg_bank() argument
371 if (bank) in pin_to_reg_bank()
372 *bank = b; in pin_to_reg_bank()
381 struct samsung_pin_bank *bank; in samsung_pinmux_setup() local
393 &reg, &pin_offset, &bank); in samsung_pinmux_setup()
394 type = bank->type; in samsung_pinmux_setup()
403 spin_lock_irqsave(&bank->slock, flags); in samsung_pinmux_setup()
410 spin_unlock_irqrestore(&bank->slock, flags); in samsung_pinmux_setup()
436 struct samsung_pin_bank *bank; in samsung_pinconf_rw() local
445 &pin_offset, &bank); in samsung_pinconf_rw()
446 type = bank->type; in samsung_pinconf_rw()
454 spin_lock_irqsave(&bank->slock, flags); in samsung_pinconf_rw()
471 spin_unlock_irqrestore(&bank->slock, flags); in samsung_pinconf_rw()
538 * The samsung_gpio_set_vlaue() should be called with "bank->slock" held
544 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_set_value() local
545 const struct samsung_pin_bank_type *type = bank->type; in samsung_gpio_set_value()
549 reg = bank->pctl_base + bank->pctl_offset; in samsung_gpio_set_value()
561 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_set() local
564 spin_lock_irqsave(&bank->slock, flags); in samsung_gpio_set()
566 spin_unlock_irqrestore(&bank->slock, flags); in samsung_gpio_set()
574 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_get() local
575 const struct samsung_pin_bank_type *type = bank->type; in samsung_gpio_get()
577 reg = bank->pctl_base + bank->pctl_offset; in samsung_gpio_get()
586 * The samsung_gpio_set_direction() should be called with "bank->slock" held
595 struct samsung_pin_bank *bank; in samsung_gpio_set_direction() local
599 bank = gpiochip_get_data(gc); in samsung_gpio_set_direction()
600 type = bank->type; in samsung_gpio_set_direction()
602 reg = bank->pctl_base + bank->pctl_offset in samsung_gpio_set_direction()
625 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_direction_input() local
629 spin_lock_irqsave(&bank->slock, flags); in samsung_gpio_direction_input()
631 spin_unlock_irqrestore(&bank->slock, flags); in samsung_gpio_direction_input()
639 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_direction_output() local
643 spin_lock_irqsave(&bank->slock, flags); in samsung_gpio_direction_output()
646 spin_unlock_irqrestore(&bank->slock, flags); in samsung_gpio_direction_output()
657 struct samsung_pin_bank *bank = gpiochip_get_data(gc); in samsung_gpio_to_irq() local
660 if (!bank->irq_domain) in samsung_gpio_to_irq()
663 virq = irq_create_mapping(bank->irq_domain, offset); in samsung_gpio_to_irq()
861 int pin, bank, ret; in samsung_pinctrl_register() local
892 /* for each pin, the name of the pin is pin-bank name + pin number */ in samsung_pinctrl_register()
893 for (bank = 0; bank < drvdata->nr_banks; bank++) { in samsung_pinctrl_register()
894 pin_bank = &drvdata->pin_banks[bank]; in samsung_pinctrl_register()
914 for (bank = 0; bank < drvdata->nr_banks; ++bank) { in samsung_pinctrl_register()
915 pin_bank = &drvdata->pin_banks[bank]; in samsung_pinctrl_register()
917 pin_bank->grange.id = bank; in samsung_pinctrl_register()
933 struct samsung_pin_bank *bank = drvdata->pin_banks; in samsung_pinctrl_unregister() local
936 for (i = 0; i < drvdata->nr_banks; ++i, ++bank) in samsung_pinctrl_unregister()
937 pinctrl_remove_gpio_range(drvdata->pctl_dev, &bank->grange); in samsung_pinctrl_unregister()
957 struct samsung_pin_bank *bank = drvdata->pin_banks; in samsung_gpiolib_register() local
962 for (i = 0; i < drvdata->nr_banks; ++i, ++bank) { in samsung_gpiolib_register()
963 bank->gpio_chip = samsung_gpiolib_chip; in samsung_gpiolib_register()
965 gc = &bank->gpio_chip; in samsung_gpiolib_register()
966 gc->base = bank->grange.base; in samsung_gpiolib_register()
967 gc->ngpio = bank->nr_pins; in samsung_gpiolib_register()
969 gc->of_node = bank->of_node; in samsung_gpiolib_register()
970 gc->label = bank->name; in samsung_gpiolib_register()
972 ret = devm_gpiochip_add_data(&pdev->dev, gc, bank); in samsung_gpiolib_register()
1007 struct samsung_pin_bank *bank; in samsung_banks_of_node_put() local
1010 bank = d->pin_banks; in samsung_banks_of_node_put()
1011 for (i = 0; i < d->nr_banks; ++i, ++bank) in samsung_banks_of_node_put()
1012 of_node_put(bank->of_node); in samsung_banks_of_node_put()
1024 struct samsung_pin_bank *bank; in samsung_pinctrl_get_soc_data() local
1058 bank = d->pin_banks; in samsung_pinctrl_get_soc_data()
1060 for (i = 0; i < ctrl->nr_banks; ++i, ++bdata, ++bank) { in samsung_pinctrl_get_soc_data()
1061 bank->type = bdata->type; in samsung_pinctrl_get_soc_data()
1062 bank->pctl_offset = bdata->pctl_offset; in samsung_pinctrl_get_soc_data()
1063 bank->nr_pins = bdata->nr_pins; in samsung_pinctrl_get_soc_data()
1064 bank->eint_func = bdata->eint_func; in samsung_pinctrl_get_soc_data()
1065 bank->eint_type = bdata->eint_type; in samsung_pinctrl_get_soc_data()
1066 bank->eint_mask = bdata->eint_mask; in samsung_pinctrl_get_soc_data()
1067 bank->eint_offset = bdata->eint_offset; in samsung_pinctrl_get_soc_data()
1068 bank->name = bdata->name; in samsung_pinctrl_get_soc_data()
1070 spin_lock_init(&bank->slock); in samsung_pinctrl_get_soc_data()
1071 bank->drvdata = d; in samsung_pinctrl_get_soc_data()
1072 bank->pin_base = d->nr_pins; in samsung_pinctrl_get_soc_data()
1073 d->nr_pins += bank->nr_pins; in samsung_pinctrl_get_soc_data()
1075 bank->eint_base = virt_base[0]; in samsung_pinctrl_get_soc_data()
1076 bank->pctl_base = virt_base[bdata->pctl_res_idx]; in samsung_pinctrl_get_soc_data()
1088 bank = d->pin_banks; in samsung_pinctrl_get_soc_data()
1089 for (i = 0; i < d->nr_banks; ++i, ++bank) { in samsung_pinctrl_get_soc_data()
1090 if (of_node_name_eq(np, bank->name)) { in samsung_pinctrl_get_soc_data()
1091 bank->of_node = np; in samsung_pinctrl_get_soc_data()
1170 struct samsung_pin_bank *bank = &drvdata->pin_banks[i]; in samsung_pinctrl_suspend() local
1171 void __iomem *reg = bank->pctl_base + bank->pctl_offset; in samsung_pinctrl_suspend()
1172 const u8 *offs = bank->type->reg_offset; in samsung_pinctrl_suspend()
1173 const u8 *widths = bank->type->fld_width; in samsung_pinctrl_suspend()
1182 bank->pm_save[type] = readl(reg + offs[type]); in samsung_pinctrl_suspend()
1184 if (widths[PINCFG_TYPE_FUNC] * bank->nr_pins > 32) { in samsung_pinctrl_suspend()
1186 bank->pm_save[PINCFG_TYPE_NUM] = in samsung_pinctrl_suspend()
1189 bank->name, reg, in samsung_pinctrl_suspend()
1190 bank->pm_save[PINCFG_TYPE_FUNC], in samsung_pinctrl_suspend()
1191 bank->pm_save[PINCFG_TYPE_NUM]); in samsung_pinctrl_suspend()
1193 pr_debug("Save %s @ %p (con %#010x)\n", bank->name, in samsung_pinctrl_suspend()
1194 reg, bank->pm_save[PINCFG_TYPE_FUNC]); in samsung_pinctrl_suspend()
1223 struct samsung_pin_bank *bank = &drvdata->pin_banks[i]; in samsung_pinctrl_resume() local
1224 void __iomem *reg = bank->pctl_base + bank->pctl_offset; in samsung_pinctrl_resume()
1225 const u8 *offs = bank->type->reg_offset; in samsung_pinctrl_resume()
1226 const u8 *widths = bank->type->fld_width; in samsung_pinctrl_resume()
1233 if (widths[PINCFG_TYPE_FUNC] * bank->nr_pins > 32) { in samsung_pinctrl_resume()
1236 bank->name, reg, in samsung_pinctrl_resume()
1239 bank->pm_save[PINCFG_TYPE_FUNC], in samsung_pinctrl_resume()
1240 bank->pm_save[PINCFG_TYPE_NUM]); in samsung_pinctrl_resume()
1241 writel(bank->pm_save[PINCFG_TYPE_NUM], in samsung_pinctrl_resume()
1244 pr_debug("%s @ %p (con %#010x => %#010x)\n", bank->name, in samsung_pinctrl_resume()
1246 bank->pm_save[PINCFG_TYPE_FUNC]); in samsung_pinctrl_resume()
1250 writel(bank->pm_save[type], reg + offs[type]); in samsung_pinctrl_resume()