Lines Matching refs:ipctl

75 static void __iomem *imx1_mem(struct imx1_pinctrl *ipctl, unsigned int pin_id)  in imx1_mem()  argument
78 return ipctl->base + port * MX1_PORT_STRIDE; in imx1_mem()
85 static void imx1_write_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_write_2bit() argument
88 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_write_2bit()
98 dev_dbg(ipctl->dev, "write: register 0x%p offset %d value 0x%x\n", in imx1_write_2bit()
112 static void imx1_write_bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_write_bit() argument
115 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_write_bit()
132 static int imx1_read_2bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_read_2bit() argument
135 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_read_2bit()
145 static int imx1_read_bit(struct imx1_pinctrl *ipctl, unsigned int pin_id, in imx1_read_bit() argument
148 void __iomem *reg = imx1_mem(ipctl, pin_id) + reg_offset; in imx1_read_bit()
173 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_groups_count() local
174 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_groups_count()
182 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_group_name() local
183 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_group_name()
192 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_get_group_pins() local
193 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_get_group_pins()
207 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pin_dbg_show() local
210 imx1_read_bit(ipctl, offset, MX1_GIUS), in imx1_pin_dbg_show()
211 imx1_read_bit(ipctl, offset, MX1_GPR), in imx1_pin_dbg_show()
212 imx1_read_bit(ipctl, offset, MX1_DDIR), in imx1_pin_dbg_show()
213 imx1_read_2bit(ipctl, offset, MX1_OCR), in imx1_pin_dbg_show()
214 imx1_read_2bit(ipctl, offset, MX1_ICONFA), in imx1_pin_dbg_show()
215 imx1_read_2bit(ipctl, offset, MX1_ICONFB)); in imx1_pin_dbg_show()
222 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_dt_node_to_map() local
223 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_dt_node_to_map()
299 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_set() local
300 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_set()
314 dev_dbg(ipctl->dev, "enable function %s group %s\n", in imx1_pmx_set()
332 imx1_write_bit(ipctl, pin_id, gpio_in_use, MX1_GIUS); in imx1_pmx_set()
333 imx1_write_bit(ipctl, pin_id, direction, MX1_DDIR); in imx1_pmx_set()
336 imx1_write_2bit(ipctl, pin_id, gpio_oconf, MX1_OCR); in imx1_pmx_set()
337 imx1_write_2bit(ipctl, pin_id, gpio_iconfa, in imx1_pmx_set()
339 imx1_write_2bit(ipctl, pin_id, gpio_iconfb, in imx1_pmx_set()
342 imx1_write_bit(ipctl, pin_id, afunction, MX1_GPR); in imx1_pmx_set()
351 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_funcs_count() local
352 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_funcs_count()
360 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_func_name() local
361 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_func_name()
370 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pmx_get_groups() local
371 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pmx_get_groups()
389 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_get() local
391 *config = imx1_read_bit(ipctl, pin_id, MX1_PUEN); in imx1_pinconf_get()
400 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_set() local
404 imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN); in imx1_pinconf_set()
406 dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n", in imx1_pinconf_set()
425 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); in imx1_pinconf_group_dbg_show() local
426 const struct imx1_pinctrl_soc_info *info = ipctl->info; in imx1_pinconf_group_dbg_show()
594 struct imx1_pinctrl *ipctl; in imx1_pinctrl_core_probe() local
606 ipctl = devm_kzalloc(&pdev->dev, sizeof(*ipctl), GFP_KERNEL); in imx1_pinctrl_core_probe()
607 if (!ipctl) in imx1_pinctrl_core_probe()
614 ipctl->base = devm_ioremap(&pdev->dev, res->start, in imx1_pinctrl_core_probe()
616 if (!ipctl->base) in imx1_pinctrl_core_probe()
624 ret = imx1_pinctrl_parse_dt(pdev, ipctl, info); in imx1_pinctrl_core_probe()
630 ipctl->info = info; in imx1_pinctrl_core_probe()
631 ipctl->dev = info->dev; in imx1_pinctrl_core_probe()
632 platform_set_drvdata(pdev, ipctl); in imx1_pinctrl_core_probe()
633 ipctl->pctl = devm_pinctrl_register(&pdev->dev, pctl_desc, ipctl); in imx1_pinctrl_core_probe()
634 if (IS_ERR(ipctl->pctl)) { in imx1_pinctrl_core_probe()
636 return PTR_ERR(ipctl->pctl); in imx1_pinctrl_core_probe()