Skip to content

Commit 6dba4bd

Browse files
Rafał Miłeckilinusw
authored andcommitted
Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode"
This reverts commit a49d784. 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 1d0a779 commit 6dba4bd

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

drivers/pinctrl/bcm/pinctrl-ns.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55

66
#include <linux/err.h>
77
#include <linux/io.h>
8-
#include <linux/mfd/syscon.h>
98
#include <linux/module.h>
109
#include <linux/of.h>
1110
#include <linux/of_device.h>
1211
#include <linux/pinctrl/pinconf-generic.h>
1312
#include <linux/pinctrl/pinctrl.h>
1413
#include <linux/pinctrl/pinmux.h>
1514
#include <linux/platform_device.h>
16-
#include <linux/regmap.h>
1715
#include <linux/slab.h>
1816

1917
#define FLAG_BCM4708 BIT(1)
@@ -24,8 +22,7 @@ struct ns_pinctrl {
2422
struct device *dev;
2523
unsigned int chipset_flag;
2624
struct pinctrl_dev *pctldev;
27-
struct regmap *regmap;
28-
u32 offset;
25+
void __iomem *base;
2926

3027
struct pinctrl_desc pctldesc;
3128
struct ns_pinctrl_group *groups;
@@ -232,9 +229,9 @@ static int ns_pinctrl_set_mux(struct pinctrl_dev *pctrl_dev,
232229
unset |= BIT(pin_number);
233230
}
234231

235-
regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp);
232+
tmp = readl(ns_pinctrl->base);
236233
tmp &= ~unset;
237-
regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp);
234+
writel(tmp, ns_pinctrl->base);
238235

239236
return 0;
240237
}
@@ -266,13 +263,13 @@ static const struct of_device_id ns_pinctrl_of_match_table[] = {
266263
static int ns_pinctrl_probe(struct platform_device *pdev)
267264
{
268265
struct device *dev = &pdev->dev;
269-
struct device_node *np = dev->of_node;
270266
const struct of_device_id *of_id;
271267
struct ns_pinctrl *ns_pinctrl;
272268
struct pinctrl_desc *pctldesc;
273269
struct pinctrl_pin_desc *pin;
274270
struct ns_pinctrl_group *group;
275271
struct ns_pinctrl_function *function;
272+
struct resource *res;
276273
int i;
277274

278275
ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL);
@@ -290,18 +287,12 @@ static int ns_pinctrl_probe(struct platform_device *pdev)
290287
return -EINVAL;
291288
ns_pinctrl->chipset_flag = (uintptr_t)of_id->data;
292289

293-
ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np));
294-
if (IS_ERR(ns_pinctrl->regmap)) {
295-
int err = PTR_ERR(ns_pinctrl->regmap);
296-
297-
dev_err(dev, "Failed to map pinctrl regs: %d\n", err);
298-
299-
return err;
300-
}
301-
302-
if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) {
303-
dev_err(dev, "Failed to get register offset\n");
304-
return -ENOENT;
290+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
291+
"cru_gpio_control");
292+
ns_pinctrl->base = devm_ioremap_resource(dev, res);
293+
if (IS_ERR(ns_pinctrl->base)) {
294+
dev_err(dev, "Failed to map pinctrl regs\n");
295+
return PTR_ERR(ns_pinctrl->base);
305296
}
306297

307298
memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc));

0 commit comments

Comments
 (0)