Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336459
b: refs/heads/master
c: 5f007db
h: refs/heads/master
i:
  336457: bd3148c
  336455: 2de6a7c
v: v3
  • Loading branch information
Linus Walleij committed Nov 21, 2012
1 parent 948773c commit df1f7cd
Show file tree
Hide file tree
Showing 45 changed files with 710 additions and 368 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c12a819e3ad9147acec3f20201fd51144f2244e9
refs/heads/master: 5f007db68cc01e068f3e12b30151f3b68418cd79
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-nomadik/board-nhk8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/i2c.h>
#include <linux/io.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/pinctrl-nomadik.h>
#include <asm/hardware/vic.h>
#include <asm/sizes.h>
#include <asm/mach-types.h>
Expand All @@ -32,9 +33,7 @@
#include <asm/mach/flash.h>
#include <asm/mach/time.h>

#include <plat/gpio-nomadik.h>
#include <plat/mtu.h>
#include <plat/pincfg.h>

#include <linux/platform_data/mtd-nomadik-nand.h>
#include <mach/fsmc.h>
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-nomadik/cpu-8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/clk-nomadik.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <plat/gpio-nomadik.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <asm/mach/map.h>
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-nomadik/i2c-8815nhk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include <linux/i2c-algo-bit.h>
#include <linux/i2c-gpio.h>
#include <linux/platform_device.h>
#include <plat/gpio-nomadik.h>
#include <plat/pincfg.h>
#include <linux/platform_data/pinctrl-nomadik.h>

/*
* There are two busses in the 8815NHK.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-u300/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,6 @@ static struct platform_device pinctrl_device = {
static struct u300_gpio_platform u300_gpio_plat = {
.ports = 7,
.gpio_base = 0,
.pinctrl_device = &pinctrl_device,
};

static struct platform_device gpio_device = {
Expand Down Expand Up @@ -1589,6 +1588,7 @@ static struct platform_device *platform_devs[] __initdata = {
&i2c1_device,
&keypad_device,
&rtc_device,
&pinctrl_device,
&gpio_device,
&nand_device,
&wdog_device,
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-ux500/board-mop500-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <plat/gpio-nomadik.h>
#include <plat/pincfg.h>
#include <plat/ste_dma40.h>

#include <mach/devices.h>
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-ux500/board-mop500-pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
#include <linux/bug.h>
#include <linux/string.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <asm/mach-types.h>
#include <plat/pincfg.h>
#include <plat/gpio-nomadik.h>

#include <mach/hardware.h>

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
#include <linux/of_platform.h>
#include <linux/leds.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>

#include <plat/ste_dma40.h>
#include <plat/gpio-nomadik.h>

#include <mach/hardware.h>
#include <mach/setup.h>
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/arm/mach-ux500/cpu-db8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/platform_data/usb-musb-ux500.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <asm/pmu.h>
#include <asm/mach/map.h>
#include <plat/gpio-nomadik.h>
#include <mach/hardware.h>
#include <mach/setup.h>
#include <mach/devices.h>
#include <linux/platform_data/usb-musb-ux500.h>
#include <mach/db8500-regs.h>

#include "devices-db8500.h"
Expand Down Expand Up @@ -158,7 +158,7 @@ static void __init db8500_add_gpios(struct device *parent)

dbx500_add_gpios(parent, ARRAY_AND_SIZE(db8500_gpio_base),
IRQ_DB8500_GPIO0, &pdata);
dbx500_add_pinctrl(parent, "pinctrl-db8500");
dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE);
}

static int usb_db8500_rx_dma_cfg[] = {
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-ux500/devices-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/platform_device.h>

#include <plat/gpio-nomadik.h>
#include <linux/platform_data/pinctrl-nomadik.h>

#include <mach/hardware.h>

Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/arm/mach-ux500/devices-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,18 @@ void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num,
int irq, struct nmk_gpio_platform_data *pdata);

static inline void
dbx500_add_pinctrl(struct device *parent, const char *name)
dbx500_add_pinctrl(struct device *parent, const char *name,
resource_size_t base)
{
struct resource res[] = {
DEFINE_RES_MEM(base, SZ_8K),
};
struct platform_device_info pdevinfo = {
.parent = parent,
.name = name,
.id = -1,
.res = res,
.num_res = ARRAY_SIZE(res),
};

platform_device_register_full(&pdevinfo);
Expand Down
102 changes: 0 additions & 102 deletions trunk/arch/arm/plat-nomadik/include/plat/gpio-nomadik.h

This file was deleted.

12 changes: 12 additions & 0 deletions trunk/drivers/gpio/gpiolib-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,20 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)
if (!pctldev)
break;

/*
* This assumes that the n GPIO pins are consecutive in the
* GPIO number space, and that the pins are also consecutive
* in their local number space. Currently it is not possible
* to add different ranges for one and the same GPIO chip,
* as the code assumes that we have one consecutive range
* on both, mapping 1-to-1.
*
* TODO: make the OF bindings handle multiple sparse ranges
* on the same GPIO chip.
*/
ret = gpiochip_add_pin_range(chip,
pinctrl_dev_get_name(pctldev),
0, /* offset in gpiochip */
pinspec.args[0],
pinspec.args[1]);

Expand Down
40 changes: 35 additions & 5 deletions trunk/drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,31 +1187,60 @@ EXPORT_SYMBOL_GPL(gpiochip_find);

#ifdef CONFIG_PINCTRL

/**
* gpiochip_add_pin_range() - add a range for GPIO <-> pin mapping
* @chip: the gpiochip to add the range for
* @pinctrl_name: the dev_name() of the pin controller to map to
* @gpio_offset: the start offset in the current gpio_chip number space
* @pin_offset: the start offset in the pin controller number space
* @npins: the number of pins from the offset of each pin space (GPIO and
* pin controller) to accumulate in this range
*/
int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int pin_base, unsigned int npins)
unsigned int gpio_offset, unsigned int pin_offset,
unsigned int npins)
{
struct gpio_pin_range *pin_range;
int ret;

pin_range = devm_kzalloc(chip->dev, sizeof(*pin_range), GFP_KERNEL);
pin_range = kzalloc(sizeof(*pin_range), GFP_KERNEL);
if (!pin_range) {
pr_err("%s: GPIO chip: failed to allocate pin ranges\n",
chip->label);
return -ENOMEM;
}

/* Use local offset as range ID */
pin_range->range.id = gpio_offset;
pin_range->range.gc = chip;
pin_range->range.name = chip->label;
pin_range->range.base = chip->base;
pin_range->range.pin_base = pin_base;
pin_range->range.base = chip->base + gpio_offset;
pin_range->range.pin_base = pin_offset;
pin_range->range.npins = npins;
pin_range->pctldev = find_pinctrl_and_add_gpio_range(pinctl_name,
pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name,
&pin_range->range);
if (IS_ERR(pin_range->pctldev)) {
ret = PTR_ERR(pin_range->pctldev);
pr_err("%s: GPIO chip: could not create pin range\n",
chip->label);
kfree(pin_range);
return ret;
}
pr_debug("GPIO chip %s: created GPIO range %d->%d ==> %s PIN %d->%d\n",
chip->label, gpio_offset, gpio_offset + npins - 1,
pinctl_name,
pin_offset, pin_offset + npins - 1);

list_add_tail(&pin_range->node, &chip->pin_ranges);

return 0;
}
EXPORT_SYMBOL_GPL(gpiochip_add_pin_range);

/**
* gpiochip_remove_pin_ranges() - remove all the GPIO <-> pin mappings
* @chip: the chip to remove all the mappings for
*/
void gpiochip_remove_pin_ranges(struct gpio_chip *chip)
{
struct gpio_pin_range *pin_range, *tmp;
Expand All @@ -1220,6 +1249,7 @@ void gpiochip_remove_pin_ranges(struct gpio_chip *chip)
list_del(&pin_range->node);
pinctrl_remove_gpio_range(pin_range->pctldev,
&pin_range->range);
kfree(pin_range);
}
}
EXPORT_SYMBOL_GPL(gpiochip_remove_pin_ranges);
Expand Down
12 changes: 4 additions & 8 deletions trunk/drivers/pinctrl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,15 @@ config PINCTRL_MMP2

config PINCTRL_MXS
bool
select PINMUX
select PINCONF

config PINCTRL_IMX23
bool
select PINMUX
select PINCONF
select PINCTRL_MXS

config PINCTRL_IMX28
bool
select PINMUX
select PINCONF
select PINCTRL_MXS

config PINCTRL_NOMADIK
Expand Down Expand Up @@ -158,17 +156,15 @@ config PINCTRL_SIRF

config PINCTRL_TEGRA
bool
select PINMUX
select PINCONF

config PINCTRL_TEGRA20
bool
select PINMUX
select PINCONF
select PINCTRL_TEGRA

config PINCTRL_TEGRA30
bool
select PINMUX
select PINCONF
select PINCTRL_TEGRA

config PINCTRL_U300
Expand Down
Loading

0 comments on commit df1f7cd

Please sign in to comment.