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