Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ef364b3 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij
Browse files

pinctrl: uniphier: remove obsoleted compatibles



Since commit 3e030b0b ("pinctrl: uniphier: allow to have pinctrl
node under syscon node"), this driver has kept compatibility for the
old DT files.  Several releases have passed since then, so remove
the obsoleted compatibles and clean up the code.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent cc97a95f
Loading
Loading
Loading
Loading
+21 −27
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
 * Copyright (C) 2015-2017 Socionext Inc.
 *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * it under the terms of the GNU General Public License as published by
@@ -26,11 +27,18 @@
#include "../pinctrl-utils.h"
#include "../pinctrl-utils.h"
#include "pinctrl-uniphier.h"
#include "pinctrl-uniphier.h"


#define UNIPHIER_PINCTRL_PINMUX_BASE	0x1000
#define UNIPHIER_PINCTRL_LOAD_PINMUX	0x1700
#define UNIPHIER_PINCTRL_DRVCTRL_BASE	0x1800
#define UNIPHIER_PINCTRL_DRV2CTRL_BASE	0x1900
#define UNIPHIER_PINCTRL_DRV3CTRL_BASE	0x1980
#define UNIPHIER_PINCTRL_PUPDCTRL_BASE	0x1a00
#define UNIPHIER_PINCTRL_IECTRL		0x1d00

struct uniphier_pinctrl_priv {
struct uniphier_pinctrl_priv {
	struct pinctrl_desc pctldesc;
	struct pinctrl_desc pctldesc;
	struct pinctrl_dev *pctldev;
	struct pinctrl_dev *pctldev;
	struct regmap *regmap;
	struct regmap *regmap;
	unsigned int regbase;
	struct uniphier_pinctrl_socdata *socdata;
	struct uniphier_pinctrl_socdata *socdata;
};
};


@@ -171,7 +179,7 @@ static int uniphier_conf_pin_bias_get(struct pinctrl_dev *pctldev,
	reg = UNIPHIER_PINCTRL_PUPDCTRL_BASE + pupdctrl / 32 * 4;
	reg = UNIPHIER_PINCTRL_PUPDCTRL_BASE + pupdctrl / 32 * 4;
	shift = pupdctrl % 32;
	shift = pupdctrl % 32;


	ret = regmap_read(priv->regmap, priv->regbase + reg, &val);
	ret = regmap_read(priv->regmap, reg, &val);
	if (ret)
	if (ret)
		return ret;
		return ret;


@@ -231,7 +239,7 @@ static int uniphier_conf_pin_drive_get(struct pinctrl_dev *pctldev,
	shift = drvctrl % 32;
	shift = drvctrl % 32;
	mask = (1U << width) - 1;
	mask = (1U << width) - 1;


	ret = regmap_read(priv->regmap, priv->regbase + reg, &val);
	ret = regmap_read(priv->regmap, reg, &val);
	if (ret)
	if (ret)
		return ret;
		return ret;


@@ -252,8 +260,7 @@ static int uniphier_conf_pin_input_enable_get(struct pinctrl_dev *pctldev,
		/* This pin is always input-enabled. */
		/* This pin is always input-enabled. */
		return 0;
		return 0;


	ret = regmap_read(priv->regmap,
	ret = regmap_read(priv->regmap, UNIPHIER_PINCTRL_IECTRL, &val);
			  priv->regbase + UNIPHIER_PINCTRL_IECTRL, &val);
	if (ret)
	if (ret)
		return ret;
		return ret;


@@ -366,8 +373,7 @@ static int uniphier_conf_pin_bias_set(struct pinctrl_dev *pctldev,
	reg = UNIPHIER_PINCTRL_PUPDCTRL_BASE + pupdctrl / 32 * 4;
	reg = UNIPHIER_PINCTRL_PUPDCTRL_BASE + pupdctrl / 32 * 4;
	shift = pupdctrl % 32;
	shift = pupdctrl % 32;


	return regmap_update_bits(priv->regmap, priv->regbase + reg,
	return regmap_update_bits(priv->regmap, reg, 1 << shift, val << shift);
				  1 << shift, val << shift);
}
}


static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
@@ -427,7 +433,7 @@ static int uniphier_conf_pin_drive_set(struct pinctrl_dev *pctldev,
	shift = drvctrl % 32;
	shift = drvctrl % 32;
	mask = (1U << width) - 1;
	mask = (1U << width) - 1;


	return regmap_update_bits(priv->regmap, priv->regbase + reg,
	return regmap_update_bits(priv->regmap, reg,
				  mask << shift, val << shift);
				  mask << shift, val << shift);
}
}


@@ -451,7 +457,7 @@ static int uniphier_conf_pin_input_enable(struct pinctrl_dev *pctldev,
	if (iectrl == UNIPHIER_PIN_IECTRL_NONE)
	if (iectrl == UNIPHIER_PIN_IECTRL_NONE)
		return enable ? 0 : -EINVAL;
		return enable ? 0 : -EINVAL;


	reg = priv->regbase + UNIPHIER_PINCTRL_IECTRL + iectrl / 32 * 4;
	reg = UNIPHIER_PINCTRL_IECTRL + iectrl / 32 * 4;
	mask = BIT(iectrl % 32);
	mask = BIT(iectrl % 32);


	return regmap_update_bits(priv->regmap, reg, mask, enable ? mask : 0);
	return regmap_update_bits(priv->regmap, reg, mask, enable ? mask : 0);
@@ -601,7 +607,7 @@ static int uniphier_pmx_set_one_mux(struct pinctrl_dev *pctldev, unsigned pin,
	 * stored in the offset+4.
	 * stored in the offset+4.
	 */
	 */
	for (; reg < reg_end; reg += 4) {
	for (; reg < reg_end; reg += 4) {
		ret = regmap_update_bits(priv->regmap, priv->regbase + reg,
		ret = regmap_update_bits(priv->regmap, reg,
					 mask << shift, muxval << shift);
					 mask << shift, muxval << shift);
		if (ret)
		if (ret)
			return ret;
			return ret;
@@ -610,8 +616,7 @@ static int uniphier_pmx_set_one_mux(struct pinctrl_dev *pctldev, unsigned pin,


	if (load_pinctrl) {
	if (load_pinctrl) {
		ret = regmap_write(priv->regmap,
		ret = regmap_write(priv->regmap,
				   priv->regbase + UNIPHIER_PINCTRL_LOAD_PINMUX,
				   UNIPHIER_PINCTRL_LOAD_PINMUX, 1);
				   1);
		if (ret)
		if (ret)
			return ret;
			return ret;
	}
	}
@@ -698,20 +703,9 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
	if (!priv)
	if (!priv)
		return -ENOMEM;
		return -ENOMEM;


	if (of_device_is_compatible(dev->of_node, "socionext,ph1-ld4-pinctrl") ||
	    of_device_is_compatible(dev->of_node, "socionext,ph1-pro4-pinctrl") ||
	    of_device_is_compatible(dev->of_node, "socionext,ph1-sld8-pinctrl") ||
	    of_device_is_compatible(dev->of_node, "socionext,ph1-pro5-pinctrl") ||
	    of_device_is_compatible(dev->of_node, "socionext,proxstream2-pinctrl") ||
	    of_device_is_compatible(dev->of_node, "socionext,ph1-ld6b-pinctrl")) {
		/* old binding */
		priv->regmap = syscon_node_to_regmap(dev->of_node);
	} else {
		priv->regbase = 0x1000;
	parent = of_get_parent(dev->of_node);
	parent = of_get_parent(dev->of_node);
	priv->regmap = syscon_node_to_regmap(parent);
	priv->regmap = syscon_node_to_regmap(parent);
	of_node_put(parent);
	of_node_put(parent);
	}


	if (IS_ERR(priv->regmap)) {
	if (IS_ERR(priv->regmap)) {
		dev_err(dev, "failed to get regmap\n");
		dev_err(dev, "failed to get regmap\n");
+0 −1
Original line number Original line Diff line number Diff line
@@ -929,7 +929,6 @@ static int uniphier_ld4_pinctrl_probe(struct platform_device *pdev)


static const struct of_device_id uniphier_ld4_pinctrl_match[] = {
static const struct of_device_id uniphier_ld4_pinctrl_match[] = {
	{ .compatible = "socionext,uniphier-ld4-pinctrl" },
	{ .compatible = "socionext,uniphier-ld4-pinctrl" },
	{ .compatible = "socionext,ph1-ld4-pinctrl" },
	{ /* sentinel */ }
	{ /* sentinel */ }
};
};
MODULE_DEVICE_TABLE(of, uniphier_ld4_pinctrl_match);
MODULE_DEVICE_TABLE(of, uniphier_ld4_pinctrl_match);
+0 −1
Original line number Original line Diff line number Diff line
@@ -1290,7 +1290,6 @@ static int uniphier_ld6b_pinctrl_probe(struct platform_device *pdev)


static const struct of_device_id uniphier_ld6b_pinctrl_match[] = {
static const struct of_device_id uniphier_ld6b_pinctrl_match[] = {
	{ .compatible = "socionext,uniphier-ld6b-pinctrl" },
	{ .compatible = "socionext,uniphier-ld6b-pinctrl" },
	{ .compatible = "socionext,ph1-ld6b-pinctrl" },
	{ /* sentinel */ }
	{ /* sentinel */ }
};
};
MODULE_DEVICE_TABLE(of, uniphier_ld6b_pinctrl_match);
MODULE_DEVICE_TABLE(of, uniphier_ld6b_pinctrl_match);
+0 −1
Original line number Original line Diff line number Diff line
@@ -1600,7 +1600,6 @@ static int uniphier_pro4_pinctrl_probe(struct platform_device *pdev)


static const struct of_device_id uniphier_pro4_pinctrl_match[] = {
static const struct of_device_id uniphier_pro4_pinctrl_match[] = {
	{ .compatible = "socionext,uniphier-pro4-pinctrl" },
	{ .compatible = "socionext,uniphier-pro4-pinctrl" },
	{ .compatible = "socionext,ph1-pro4-pinctrl" },
	{ /* sentinel */ }
	{ /* sentinel */ }
};
};
MODULE_DEVICE_TABLE(of, uniphier_pro4_pinctrl_match);
MODULE_DEVICE_TABLE(of, uniphier_pro4_pinctrl_match);
+0 −1
Original line number Original line Diff line number Diff line
@@ -1365,7 +1365,6 @@ static int uniphier_pro5_pinctrl_probe(struct platform_device *pdev)


static const struct of_device_id uniphier_pro5_pinctrl_match[] = {
static const struct of_device_id uniphier_pro5_pinctrl_match[] = {
	{ .compatible = "socionext,uniphier-pro5-pinctrl" },
	{ .compatible = "socionext,uniphier-pro5-pinctrl" },
	{ .compatible = "socionext,ph1-pro5-pinctrl" },
	{ /* sentinel */ }
	{ /* sentinel */ }
};
};
MODULE_DEVICE_TABLE(of, uniphier_pro5_pinctrl_match);
MODULE_DEVICE_TABLE(of, uniphier_pro5_pinctrl_match);
Loading