Commit d6a3bf93 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
 "This is a late pinctrl fix pull request, we had to revert out the
  pinctrl-single GPIO backend, because of, well, design issues.  We're
  cooking a better thing for the next cycle.

   - Revert gpio request/free backend, new patch set in the works, will
     be for v3.9.  Get this old cruft out before anyone hurts himself on
     it.
   - Kconfig buzz
   - Various compile warnings
   - MPP6 value for the Kirkwood"

* tag 'pinctrl-fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: nomadik: nmk_prcm_gpiocr_get_mode may be unused
  pinctrl: exynos: don't mark probing functions as __init
  Revert "pinctrl: single: support gpio request and free"
  pinctrl: mvebu: fix MPP6 value for kirkwood driver
  pinctrl: mvebu: Fix compiler warnings
  pinctrl: pinctrl-mxs: Fix variables' definition type
  pinctrl: samsung: removing duplicated condition for PINCTRL_SAMSUNG
parents 6abb7c25 0fafd50e
...@@ -181,7 +181,6 @@ config PINCTRL_COH901 ...@@ -181,7 +181,6 @@ config PINCTRL_COH901
config PINCTRL_SAMSUNG config PINCTRL_SAMSUNG
bool bool
depends on OF && GPIOLIB
select PINMUX select PINMUX
select PINCONF select PINCONF
......
...@@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev) ...@@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(dove_pinctrl_of_match, &pdev->dev); of_match_device(dove_pinctrl_of_match, &pdev->dev);
pdev->dev.platform_data = match->data; pdev->dev.platform_data = (void *)match->data;
/* /*
* General MPP Configuration Register is part of pdma registers. * General MPP Configuration Register is part of pdma registers.
......
...@@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { ...@@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)), MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))), MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
MPP_MODE(6, MPP_MODE(6,
MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0, 0))), MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
MPP_MODE(7, MPP_MODE(7,
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)), MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)),
...@@ -458,7 +458,7 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev) ...@@ -458,7 +458,7 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
pdev->dev.platform_data = match->data; pdev->dev.platform_data = (void *)match->data;
return mvebu_pinctrl_probe(pdev); return mvebu_pinctrl_probe(pdev);
} }
......
...@@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse ...@@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse
} }
/* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */ /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */
static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
struct device_node *cfg_np, unsigned int **pin_list, struct device_node *cfg_np, unsigned int **pin_list,
unsigned int *npins) unsigned int *npins)
{ {
...@@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev, ...@@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
* Parse the information about all the available pin groups and pin functions * Parse the information about all the available pin groups and pin functions
* from device node of the pin-controller. * from device node of the pin-controller.
*/ */
static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
struct exynos5440_pinctrl_priv_data *priv) struct exynos5440_pinctrl_priv_data *priv)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev, ...@@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
} }
/* register the pinctrl interface with the pinctrl subsystem */ /* register the pinctrl interface with the pinctrl subsystem */
static int __init exynos5440_pinctrl_register(struct platform_device *pdev, static int exynos5440_pinctrl_register(struct platform_device *pdev,
struct exynos5440_pinctrl_priv_data *priv) struct exynos5440_pinctrl_priv_data *priv)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev, ...@@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev,
} }
/* register the gpiolib interface with the gpiolib subsystem */ /* register the gpiolib interface with the gpiolib subsystem */
static int __init exynos5440_gpiolib_register(struct platform_device *pdev, static int exynos5440_gpiolib_register(struct platform_device *pdev,
struct exynos5440_pinctrl_priv_data *priv) struct exynos5440_pinctrl_priv_data *priv)
{ {
struct gpio_chip *gc; struct gpio_chip *gc;
...@@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev, ...@@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev,
} }
/* unregister the gpiolib interface with the gpiolib subsystem */ /* unregister the gpiolib interface with the gpiolib subsystem */
static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev, static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
struct exynos5440_pinctrl_priv_data *priv) struct exynos5440_pinctrl_priv_data *priv)
{ {
int ret = gpiochip_remove(priv->gc); int ret = gpiochip_remove(priv->gc);
......
...@@ -146,7 +146,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -146,7 +146,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
static void mxs_dt_free_map(struct pinctrl_dev *pctldev, static void mxs_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned num_maps) struct pinctrl_map *map, unsigned num_maps)
{ {
int i; u32 i;
for (i = 0; i < num_maps; i++) { for (i = 0; i < num_maps; i++) {
if (map[i].type == PIN_MAP_TYPE_MUX_GROUP) if (map[i].type == PIN_MAP_TYPE_MUX_GROUP)
...@@ -203,7 +203,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector, ...@@ -203,7 +203,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector,
void __iomem *reg; void __iomem *reg;
u8 bank, shift; u8 bank, shift;
u16 pin; u16 pin;
int i; u32 i;
for (i = 0; i < g->npins; i++) { for (i = 0; i < g->npins; i++) {
bank = PINID_TO_BANK(g->pins[i]); bank = PINID_TO_BANK(g->pins[i]);
...@@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev, ...@@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev,
void __iomem *reg; void __iomem *reg;
u8 ma, vol, pull, bank, shift; u8 ma, vol, pull, bank, shift;
u16 pin; u16 pin;
int i; u32 i;
ma = CONFIG_TO_MA(config); ma = CONFIG_TO_MA(config);
vol = CONFIG_TO_VOL(config); vol = CONFIG_TO_VOL(config);
...@@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev, ...@@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev,
const char *propname = "fsl,pinmux-ids"; const char *propname = "fsl,pinmux-ids";
char *group; char *group;
int length = strlen(np->name) + SUFFIX_LEN; int length = strlen(np->name) + SUFFIX_LEN;
int i; u32 val, i;
u32 val;
group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL); group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL);
if (!group) if (!group)
......
...@@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode) ...@@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode)
} }
EXPORT_SYMBOL(nmk_gpio_set_mode); EXPORT_SYMBOL(nmk_gpio_set_mode);
static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
{ {
int i; int i;
u16 reg; u16 reg;
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#define PCS_MUX_BITS_NAME "pinctrl-single,bits" #define PCS_MUX_BITS_NAME "pinctrl-single,bits"
#define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1) #define PCS_REG_NAME_LEN ((sizeof(unsigned long) * 2) + 1)
#define PCS_OFF_DISABLED ~0U #define PCS_OFF_DISABLED ~0U
#define PCS_MAX_GPIO_VALUES 2
/** /**
* struct pcs_pingroup - pingroups for a function * struct pcs_pingroup - pingroups for a function
...@@ -77,16 +76,6 @@ struct pcs_function { ...@@ -77,16 +76,6 @@ struct pcs_function {
struct list_head node; struct list_head node;
}; };
/**
* struct pcs_gpio_range - pinctrl gpio range
* @range: subrange of the GPIO number space
* @gpio_func: gpio function value in the pinmux register
*/
struct pcs_gpio_range {
struct pinctrl_gpio_range range;
int gpio_func;
};
/** /**
* struct pcs_data - wrapper for data needed by pinctrl framework * struct pcs_data - wrapper for data needed by pinctrl framework
* @pa: pindesc array * @pa: pindesc array
...@@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector, ...@@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector,
} }
static int pcs_request_gpio(struct pinctrl_dev *pctldev, static int pcs_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range, unsigned pin) struct pinctrl_gpio_range *range, unsigned offset)
{ {
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev); return -ENOTSUPP;
struct pcs_gpio_range *gpio = NULL;
int end, mux_bytes;
unsigned data;
gpio = container_of(range, struct pcs_gpio_range, range);
end = range->pin_base + range->npins - 1;
if (pin < range->pin_base || pin > end) {
dev_err(pctldev->dev,
"pin %d isn't in the range of %d to %d\n",
pin, range->pin_base, end);
return -EINVAL;
}
mux_bytes = pcs->width / BITS_PER_BYTE;
data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask;
data |= gpio->gpio_func;
pcs->write(data, pcs->base + pin * mux_bytes);
return 0;
} }
static struct pinmux_ops pcs_pinmux_ops = { static struct pinmux_ops pcs_pinmux_ops = {
...@@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs) ...@@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs)
static struct of_device_id pcs_of_match[]; static struct of_device_id pcs_of_match[];
static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs)
{
struct pcs_gpio_range *gpio;
struct device_node *child;
struct resource r;
const char name[] = "pinctrl-single";
u32 gpiores[PCS_MAX_GPIO_VALUES];
int ret, i = 0, mux_bytes = 0;
for_each_child_of_node(node, child) {
ret = of_address_to_resource(child, 0, &r);
if (ret < 0)
continue;
memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES);
ret = of_property_read_u32_array(child, "pinctrl-single,gpio",
gpiores, PCS_MAX_GPIO_VALUES);
if (ret < 0)
continue;
gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL);
if (!gpio) {
dev_err(pcs->dev, "failed to allocate pcs gpio\n");
return -ENOMEM;
}
gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name),
GFP_KERNEL);
if (!gpio->range.name) {
dev_err(pcs->dev, "failed to allocate range name\n");
return -ENOMEM;
}
memcpy((char *)gpio->range.name, name, sizeof(name));
gpio->range.id = i++;
gpio->range.base = gpiores[0];
gpio->gpio_func = gpiores[1];
mux_bytes = pcs->width / BITS_PER_BYTE;
gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
gpio->range.npins = (r.end - r.start) / mux_bytes + 1;
pinctrl_add_gpio_range(pcs->pctl, &gpio->range);
}
return 0;
}
static int pcs_probe(struct platform_device *pdev) static int pcs_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
...@@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev) ...@@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev)
goto free; goto free;
} }
ret = pcs_add_gpio_range(np, pcs);
if (ret < 0)
goto free;
dev_info(pcs->dev, "%i pins at pa %p size %u\n", dev_info(pcs->dev, "%i pins at pa %p size %u\n",
pcs->desc.npins, pcs->base, pcs->size); pcs->desc.npins, pcs->base, pcs->size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment