Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode"

This reverts commit a49d784d5a8272d0f63c448fe8dc69e589db006e.

The updated binding was wrong / invalid and has been reverted. There
isn't any upstream kernel DTS using it and Broadcom isn't known to use
it neither. There is close to zero chance this will cause regression for
anyone.

Actually in-kernel bcm5301x.dtsi still uses the old good binding and so
it's broken since the driver update. This revert fixes it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20211008205938.29925-3-zajec5@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by Rafał Miłecki and committed by Linus Walleij 6dba4bdf 1d0a7798

+10 -19
+10 -19
drivers/pinctrl/bcm/pinctrl-ns.c
··· 5 5 6 6 #include <linux/err.h> 7 7 #include <linux/io.h> 8 - #include <linux/mfd/syscon.h> 9 8 #include <linux/module.h> 10 9 #include <linux/of.h> 11 10 #include <linux/of_device.h> ··· 12 13 #include <linux/pinctrl/pinctrl.h> 13 14 #include <linux/pinctrl/pinmux.h> 14 15 #include <linux/platform_device.h> 15 - #include <linux/regmap.h> 16 16 #include <linux/slab.h> 17 17 18 18 #define FLAG_BCM4708 BIT(1) ··· 22 24 struct device *dev; 23 25 unsigned int chipset_flag; 24 26 struct pinctrl_dev *pctldev; 25 - struct regmap *regmap; 26 - u32 offset; 27 + void __iomem *base; 27 28 28 29 struct pinctrl_desc pctldesc; 29 30 struct ns_pinctrl_group *groups; ··· 229 232 unset |= BIT(pin_number); 230 233 } 231 234 232 - regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp); 235 + tmp = readl(ns_pinctrl->base); 233 236 tmp &= ~unset; 234 - regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp); 237 + writel(tmp, ns_pinctrl->base); 235 238 236 239 return 0; 237 240 } ··· 263 266 static int ns_pinctrl_probe(struct platform_device *pdev) 264 267 { 265 268 struct device *dev = &pdev->dev; 266 - struct device_node *np = dev->of_node; 267 269 const struct of_device_id *of_id; 268 270 struct ns_pinctrl *ns_pinctrl; 269 271 struct pinctrl_desc *pctldesc; 270 272 struct pinctrl_pin_desc *pin; 271 273 struct ns_pinctrl_group *group; 272 274 struct ns_pinctrl_function *function; 275 + struct resource *res; 273 276 int i; 274 277 275 278 ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL); ··· 287 290 return -EINVAL; 288 291 ns_pinctrl->chipset_flag = (uintptr_t)of_id->data; 289 292 290 - ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np)); 291 - if (IS_ERR(ns_pinctrl->regmap)) { 292 - int err = PTR_ERR(ns_pinctrl->regmap); 293 - 294 - dev_err(dev, "Failed to map pinctrl regs: %d\n", err); 295 - 296 - return err; 297 - } 298 - 299 - if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) { 300 - dev_err(dev, "Failed to get register offset\n"); 301 - return -ENOENT; 293 + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 294 + "cru_gpio_control"); 295 + ns_pinctrl->base = devm_ioremap_resource(dev, res); 296 + if (IS_ERR(ns_pinctrl->base)) { 297 + dev_err(dev, "Failed to map pinctrl regs\n"); 298 + return PTR_ERR(ns_pinctrl->base); 302 299 } 303 300 304 301 memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc));