Lines Matching +full:bcm4708 +full:- +full:pinmux

1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/pinctrl/pinconf-generic.h>
12 #include <linux/pinctrl/pinmux.h>
18 #include "../pinmux.h"
172 return -EINVAL; in ns_pinctrl_set_mux()
174 for (i = 0; i < group->grp.npins; i++) in ns_pinctrl_set_mux()
175 unset |= BIT(group->grp.pins[i]); in ns_pinctrl_set_mux()
177 tmp = readl(ns_pinctrl->base); in ns_pinctrl_set_mux()
179 writel(tmp, ns_pinctrl->base); in ns_pinctrl_set_mux()
196 .name = "pinctrl-ns",
202 { .compatible = "brcm,bcm4708-pinmux", .data = (void *)FLAG_BCM4708, },
203 { .compatible = "brcm,bcm4709-pinmux", .data = (void *)FLAG_BCM4709, },
204 { .compatible = "brcm,bcm53012-pinmux", .data = (void *)FLAG_BCM53012, },
210 struct device *dev = &pdev->dev; in ns_pinctrl_probe()
219 return -ENOMEM; in ns_pinctrl_probe()
220 pctldesc = &ns_pinctrl->pctldesc; in ns_pinctrl_probe()
225 ns_pinctrl->dev = dev; in ns_pinctrl_probe()
227 ns_pinctrl->chipset_flag = (uintptr_t)device_get_match_data(dev); in ns_pinctrl_probe()
231 ns_pinctrl->base = devm_ioremap_resource(dev, res); in ns_pinctrl_probe()
232 if (IS_ERR(ns_pinctrl->base)) in ns_pinctrl_probe()
233 return PTR_ERR(ns_pinctrl->base); in ns_pinctrl_probe()
239 pctldesc->pins = devm_kcalloc(dev, ARRAY_SIZE(ns_pinctrl_pins), in ns_pinctrl_probe()
242 if (!pctldesc->pins) in ns_pinctrl_probe()
243 return -ENOMEM; in ns_pinctrl_probe()
244 for (i = 0, pin = (struct pinctrl_pin_desc *)&pctldesc->pins[0]; in ns_pinctrl_probe()
247 unsigned int chipsets = (uintptr_t)src->drv_data; in ns_pinctrl_probe()
249 if (chipsets & ns_pinctrl->chipset_flag) { in ns_pinctrl_probe()
251 pctldesc->npins++; in ns_pinctrl_probe()
257 ns_pinctrl->pctldev = devm_pinctrl_register(dev, pctldesc, ns_pinctrl); in ns_pinctrl_probe()
258 if (IS_ERR(ns_pinctrl->pctldev)) { in ns_pinctrl_probe()
260 return PTR_ERR(ns_pinctrl->pctldev); in ns_pinctrl_probe()
266 if (!(group->chipsets & ns_pinctrl->chipset_flag)) in ns_pinctrl_probe()
269 pinctrl_generic_add_group(ns_pinctrl->pctldev, group->name, in ns_pinctrl_probe()
270 group->pins, group->num_pins, NULL); in ns_pinctrl_probe()
276 if (!(function->chipsets & ns_pinctrl->chipset_flag)) in ns_pinctrl_probe()
279 pinmux_generic_add_function(ns_pinctrl->pctldev, function->name, in ns_pinctrl_probe()
280 function->groups, in ns_pinctrl_probe()
281 function->num_groups, NULL); in ns_pinctrl_probe()
290 .name = "ns-pinmux",