Lines Matching refs:ipctl
81 static void __iomem *imx1_mem(struct imx1_pinctrl *ipctl, unsigned int pin_id) in imx1_mem() argument
84 return ipctl->base + port * MX1_PORT_STRIDE; in imx1_mem()
91 static void imx1_write_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_write_2bit() argument
94 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_write_2bit()
104 dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n", in imx1_write_2bit()
118 static void imx1_write_bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_write_bit() argument
121 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_write_bit()
138 static int imx1_read_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_read_2bit() argument
141 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_read_2bit()
151 static int imx1_read_bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_read_bit() argument
154 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_read_bit()
179 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_groups_count() local
180 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_groups_count()
188 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_group_name() local
189 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_group_name()
198 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_group_pins() local
199 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_group_pins()
213 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pin_dbg_show() local
216 imx1_read_bit(ipctl, offset, MX1_GIUS), in imx1_pin_dbg_show()
217 imx1_read_bit(ipctl, offset, MX1_GPR), in imx1_pin_dbg_show()
218 imx1_read_bit(ipctl, offset, MX1_DDIR), in imx1_pin_dbg_show()
219 imx1_read_2bit(ipctl, offset, MX1_OCR), in imx1_pin_dbg_show()
220 imx1_read_2bit(ipctl, offset, MX1_ICONFA), in imx1_pin_dbg_show()
221 imx1_read_2bit(ipctl, offset, MX1_ICONFB)); in imx1_pin_dbg_show()
228 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_dt_node_to_map() local
229 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_dt_node_to_map()
304 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_set() local
305 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_set()
319 dev_dbg(ipctl->dev, "enable function %s group %s\n", in imx1_pmx_set()
337 imx1_write_bit(ipctl, pin_id, gpio_in_use, MX1_GIUS); in imx1_pmx_set()
338 imx1_write_bit(ipctl, pin_id, direction, MX1_DDIR); in imx1_pmx_set()
341 imx1_write_2bit(ipctl, pin_id, gpio_oconf, MX1_OCR); in imx1_pmx_set()
342 imx1_write_2bit(ipctl, pin_id, gpio_iconfa, in imx1_pmx_set()
344 imx1_write_2bit(ipctl, pin_id, gpio_iconfb, in imx1_pmx_set()
347 imx1_write_bit(ipctl, pin_id, afunction, MX1_GPR); in imx1_pmx_set()
356 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_funcs_count() local
357 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_funcs_count()
365 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_func_name() local
366 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_func_name()
375 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_groups() local
376 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_groups()
394 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_get() local
396 *config = imx1_read_bit(ipctl, pin_id, MX1_PUEN); in imx1_pinconf_get()
405 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_set() local
409 imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN); in imx1_pinconf_set()
411 dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n", in imx1_pinconf_set()
430 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_group_dbg_show() local
431 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pinconf_group_dbg_show()
599 struct imx1_pinctrl *ipctl; in imx1_pinctrl_core_probe() local
611 ipctl = devm_kzalloc(&pdev->dev, sizeof(*ipctl), GFP_KERNEL); in imx1_pinctrl_core_probe()
612 if (!ipctl) in imx1_pinctrl_core_probe()
619 ipctl->base = devm_ioremap_nocache(&pdev->dev, res->start, in imx1_pinctrl_core_probe()
621 if (!ipctl->base) in imx1_pinctrl_core_probe()
629 ret = imx1_pinctrl_parse_dt(pdev, ipctl, info); in imx1_pinctrl_core_probe()
635 ipctl->info = info; in imx1_pinctrl_core_probe()
636 ipctl->dev = info->dev; in imx1_pinctrl_core_probe()
637 platform_set_drvdata(pdev, ipctl); in imx1_pinctrl_core_probe()
638 ipctl->pctl = pinctrl_register(pctl_desc, &pdev->dev, ipctl); in imx1_pinctrl_core_probe()
639 if (IS_ERR(ipctl->pctl)) { in imx1_pinctrl_core_probe()
641 return PTR_ERR(ipctl->pctl); in imx1_pinctrl_core_probe()
646 pinctrl_unregister(ipctl->pctl); in imx1_pinctrl_core_probe()
658 struct imx1_pinctrl *ipctl = platform_get_drvdata(pdev); in imx1_pinctrl_core_remove() local
660 pinctrl_unregister(ipctl->pctl); in imx1_pinctrl_core_remove()