Lines Matching +full:artpec +full:- +full:8

2  * Driver for the Axis ARTPEC-6 pin controller
18 #include <linux/pinctrl/pinconf-generic.h>
24 #include "pinctrl-utils.h"
50 #define ARTPEC6_DRIVE_8mA 8
90 PINCTRL_PIN(8, "GPIO8"),
186 static const unsigned int i2s0_pins0[] = { 8, 9, 10, 11 };
294 .num_pins = ARRAY_SIZE(uart0_pins1) - 2,
360 .num_pins = ARRAY_SIZE(uart5_pins0) - 1,
401 { 0, 35, 0x0 }, /* 0x0 - 0x8c */
402 { 36, 52, 0x100 }, /* 0x100 - 0x140 */
403 { 53, 96, 0x180 }, /* 0x180 - 0x22c */
412 return (pin - pin_register[i].start) * 4 + in artpec6_pmx_reg_offset()
457 return -EINVAL; in artpec6_pconf_drive_mA_to_field()
684 regval = readl(pmx->base + reg); in artpec6_pmx_select_func()
687 writel(regval, pmx->base + reg); in artpec6_pmx_select_func()
697 dev_dbg(pmx->dev, "enabling %s function for pin group %s\n", in artpec6_pmx_set()
715 return -EINVAL; in artpec6_pmx_request_gpio()
717 val = readl_relaxed(pmx->base + reg); in artpec6_pmx_request_gpio()
720 writel_relaxed(val, pmx->base + reg); in artpec6_pmx_request_gpio()
741 if (pin >= pmx->num_pins) { in artpec6_pconf_get()
742 dev_dbg(pmx->dev, "pinconf is not supported for pin %s\n", in artpec6_pconf_get()
743 pmx->pins[pin].name); in artpec6_pconf_get()
744 return -ENOTSUPP; in artpec6_pconf_get()
747 dev_dbg(pmx->dev, "getting configuration for pin %s\n", in artpec6_pconf_get()
748 pmx->pins[pin].name); in artpec6_pconf_get()
751 regval = readl(pmx->base + artpec6_pmx_reg_offset(pin)); in artpec6_pconf_get()
757 return -EINVAL; in artpec6_pconf_get()
763 return -EINVAL; in artpec6_pconf_get()
768 return -EINVAL; in artpec6_pconf_get()
777 return -ENOTSUPP; in artpec6_pconf_get()
790 * PIN_CONFIG_DRIVE_STRENGTH: x (4mA, 6mA, 8mA, 9mA)
805 if (pin >= pmx->num_pins) { in artpec6_pconf_set()
806 dev_dbg(pmx->dev, "pinconf is not supported for pin %s\n", in artpec6_pconf_set()
807 pmx->pins[pin].name); in artpec6_pconf_set()
808 return -ENOTSUPP; in artpec6_pconf_set()
811 dev_dbg(pmx->dev, "setting configuration for pin %s\n", in artpec6_pconf_set()
812 pmx->pins[pin].name); in artpec6_pconf_set()
814 reg = pmx->base + artpec6_pmx_reg_offset(pin); in artpec6_pconf_set()
832 dev_dbg(pctldev->dev, "%s: arg %u out of range\n", in artpec6_pconf_set()
834 return -EINVAL; in artpec6_pconf_set()
845 dev_dbg(pctldev->dev, "%s: arg %u out of range\n", in artpec6_pconf_set()
847 return -EINVAL; in artpec6_pconf_set()
859 dev_dbg(pctldev->dev, "%s: arg %u out of range\n", in artpec6_pconf_set()
861 return -EINVAL; in artpec6_pconf_set()
871 dev_dbg(pmx->dev, "parameter not supported\n"); in artpec6_pconf_set()
872 return -ENOTSUPP; in artpec6_pconf_set()
886 dev_dbg(pctldev->dev, "setting group %s configuration\n", in artpec6_pconf_group_set()
911 .name = "artpec6-pinctrl",
920 /* The reset values say 4mA, but we want 8mA as default. */
923 void __iomem *base = pmx->base; in artpec6_pmx_reset()
940 pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); in artpec6_pmx_probe()
942 return -ENOMEM; in artpec6_pmx_probe()
944 pmx->dev = &pdev->dev; in artpec6_pmx_probe()
946 pmx->base = devm_platform_ioremap_resource(pdev, 0); in artpec6_pmx_probe()
948 if (IS_ERR(pmx->base)) in artpec6_pmx_probe()
949 return PTR_ERR(pmx->base); in artpec6_pmx_probe()
953 pmx->pins = artpec6_pins; in artpec6_pmx_probe()
954 pmx->num_pins = ARRAY_SIZE(artpec6_pins); in artpec6_pmx_probe()
955 pmx->functions = artpec6_pmx_functions; in artpec6_pmx_probe()
956 pmx->num_functions = ARRAY_SIZE(artpec6_pmx_functions); in artpec6_pmx_probe()
957 pmx->pin_groups = artpec6_pin_groups; in artpec6_pmx_probe()
958 pmx->num_pin_groups = ARRAY_SIZE(artpec6_pin_groups); in artpec6_pmx_probe()
959 pmx->pctl = pinctrl_register(&artpec6_desc, &pdev->dev, pmx); in artpec6_pmx_probe()
961 if (IS_ERR(pmx->pctl)) { in artpec6_pmx_probe()
962 dev_err(&pdev->dev, "could not register pinctrl driver\n"); in artpec6_pmx_probe()
963 return PTR_ERR(pmx->pctl); in artpec6_pmx_probe()
968 dev_info(&pdev->dev, "initialised Axis ARTPEC-6 pinctrl driver\n"); in artpec6_pmx_probe()
977 pinctrl_unregister(pmx->pctl); in artpec6_pmx_remove()
981 { .compatible = "axis,artpec6-pinctrl" },
987 .name = "artpec6-pinctrl",