Commit d268dbe7 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pinctrl-v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "This is the bulk of pin control changes for the v4.9 cycle.

  General improvements:

   - nicer debugfs output with one pin/config pair per line.

   - continued efforts to strictify module vs bool.

   - constification and similar from Coccinelle engineers.

   - return error from pinctrl_bind_pins()

   - pulling in the ability to selectively disable mapping of unusable
     IRQs from the GPIO subsystem.

  New drivers:

   - new driver for the Aspeed pin controller family: AST2400 (G4) and
     AST2500 (G5) are supported. These are used by OpenBMC on the IBM
     Witherspoon platform.

   - new subdriver for the Allwinner sunxi GR8.

  Driver improvements:

   - drop default IRQ trigger types assigned during IRQ mapping on AT91
     and Nomadik. This error was identified by improvements in the IRQ
     core by Marc Zyngier.

   - active high/low types on the GPIO IRQs for the ST pin controller.

   - IRQ support on GPIOs on the STM32 pin controller.

   - Renesas Super-H/ARM sh-pfc: continued massive developments.

   - misc MXC improvements.

   - SPDIF on the Allwiner A31 SoC

   - IR remote and SPI NOR flash, NAND flash, I2C pins on the AMLogic
     SoC.

   - PWM pins on the Meson.

   - do not map unusable IRQs (taken by BIOS) on the Intel Cherryview.

   - add GPIO IRQ wakeup support to the Intel driver so we can wake up
     from button pushes.

  Deprecation:

   - delete the obsolete STiH415/6 SoC support"

* tag 'pinctrl-v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (75 commits)
  pinctrl: qcom: fix masking of pinmux functions
  pinctrl: intel: Configure GPIO chip IRQ as wakeup interrupts
  pinctrl: cherryview: Convert to use devm_gpiochip_add_data()
  pinctrl: cherryview: Do not add all southwest and north GPIOs to IRQ domain
  gpiolib: Make it possible to exclude GPIOs from IRQ domain
  pinctrl: nomadik: don't default-flag IRQs as falling
  pinctrl: st: Remove obsolete platforms from pinctrl-st dt doc
  pinctrl: st: Remove STiH415/6 SoC pinctrl driver support.
  pinctrl: amlogic: gxbb: add i2c pins
  pinctrl: amlogic: gxbb: add nand pins
  pinctrl: stm32: add IRQ_DOMAIN_HIERARCHY dependency
  pinctrl: amlogic: gxbb: add spi nor pins
  pinctrl: sh-pfc: r8a7794: Implement voltage switching for SDHI
  pinctrl: sh-pfc: r8a7791: Implement voltage switching for SDHI
  pinctrl: sh-pfc: Add PORT_GP_24 helper macro
  pinctrl: Fix "st,syscfg" definition for STM32 pinctrl
  driver: base: pinctrl: return error from pinctrl_bind_pins()
  pinctrl: meson-gxbb: add the missing SDIO interrupt pin
  pinctrl: aspeed: fix regmap error handling
  pinctrl: mediatek: constify gpio_chip structures
  ...
parents 64cbd16a 6bcf3f63
...@@ -23,6 +23,7 @@ Required properties: ...@@ -23,6 +23,7 @@ Required properties:
"allwinner,sun8i-h3-pinctrl" "allwinner,sun8i-h3-pinctrl"
"allwinner,sun8i-h3-r-pinctrl" "allwinner,sun8i-h3-r-pinctrl"
"allwinner,sun50i-a64-pinctrl" "allwinner,sun50i-a64-pinctrl"
"nextthing,gr8-pinctrl"
- reg: Should contain the register physical address and length for the - reg: Should contain the register physical address and length for the
pin controller. pin controller.
......
Aspeed Pin Controllers
----------------------
The Aspeed SoCs vary in functionality inside a generation but have a common mux
device register layout.
Required properties:
- compatible : Should be any one of the following:
"aspeed,ast2400-pinctrl"
"aspeed,g4-pinctrl"
"aspeed,ast2500-pinctrl"
"aspeed,g5-pinctrl"
The pin controller node should be a child of a syscon node with the required
property:
- compatible: "syscon", "simple-mfd"
Refer to the the bindings described in
Documentation/devicetree/bindings/mfd/syscon.txt
Subnode Format
--------------
The required properties of child nodes are (as defined in pinctrl-bindings):
- function
- groups
Each function has only one associated pin group. Each group is named by its
function. The following values for the function and groups properties are
supported:
aspeed,ast2400-pinctrl, aspeed,g4-pinctrl:
ACPI BMCINT DDCCLK DDCDAT FLACK FLBUSY FLWP GPID0 GPIE0 GPIE2 GPIE4 GPIE6 I2C10
I2C11 I2C12 I2C13 I2C3 I2C4 I2C5 I2C6 I2C7 I2C8 I2C9 LPCPD LPCPME LPCSMI MDIO1
MDIO2 NCTS1 NCTS3 NCTS4 NDCD1 NDCD3 NDCD4 NDSR1 NDSR3 NDTR1 NDTR3 NRI1 NRI3
NRI4 NRTS1 NRTS3 PWM0 PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 RGMII1 RMII1 ROM16
ROM8 ROMCS1 ROMCS2 ROMCS3 ROMCS4 RXD1 RXD3 RXD4 SD1 SGPMI SIOPBI SIOPBO TIMER3
TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD3 TXD4 UART6 VGAHS VGAVS VPI18 VPI24 VPI30
VPO12 VPO24
aspeed,ast2500-pinctrl, aspeed,g5-pinctrl:
GPID0 GPID2 GPIE0 I2C10 I2C11 I2C12 I2C13 I2C14 I2C3 I2C4 I2C5 I2C6 I2C7 I2C8
I2C9 MAC1LINK MDIO1 MDIO2 OSCCLK PEWAKE PWM0 PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7
RGMII1 RGMII2 RMII1 RMII2 SD1 SPI1 TIMER4 TIMER5 TIMER6 TIMER7 TIMER8
Examples:
syscon: scu@1e6e2000 {
compatible = "syscon", "simple-mfd";
reg = <0x1e6e2000 0x1a8>;
pinctrl: pinctrl {
compatible = "aspeed,g4-pinctrl";
pinctrl_i2c3_default: i2c3_default {
function = "I2C3";
groups = "I2C3";
};
};
};
Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices.
...@@ -30,8 +30,7 @@ Second type has a dedicated interrupt per gpio bank. ...@@ -30,8 +30,7 @@ Second type has a dedicated interrupt per gpio bank.
Pin controller node: Pin controller node:
Required properties: Required properties:
- compatible : should be "st,<SOC>-<pio-block>-pinctrl" - compatible : should be "st,stih407-<pio-block>-pinctrl"
like st,stih415-sbc-pinctrl, st,stih415-front-pinctrl and so on.
- st,syscfg : Should be a phandle of the syscfg node. - st,syscfg : Should be a phandle of the syscfg node.
- st,retime-pin-mask : Should be mask to specify which pins can be retimed. - st,retime-pin-mask : Should be mask to specify which pins can be retimed.
If the property is not present, it is assumed that all the pins in the If the property is not present, it is assumed that all the pins in the
...@@ -50,7 +49,11 @@ Optional properties: ...@@ -50,7 +49,11 @@ Optional properties:
GPIO controller/bank node. GPIO controller/bank node.
Required properties: Required properties:
- gpio-controller : Indicates this device is a GPIO controller - gpio-controller : Indicates this device is a GPIO controller
- #gpio-cells : Should be one. The first cell is the pin number. - #gpio-cells : Must be two.
- First cell: specifies the pin number inside the controller
- Second cell: specifies whether the pin is logically inverted.
- 0 = active high
- 1 = active low
- st,bank-name : Should be a name string for this bank as specified in - st,bank-name : Should be a name string for this bank as specified in
datasheet. datasheet.
...@@ -76,23 +79,23 @@ include/dt-bindings/interrupt-controller/irq.h ...@@ -76,23 +79,23 @@ include/dt-bindings/interrupt-controller/irq.h
Example: Example:
pin-controller-sbc { pin-controller-sbc {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "st,stih415-sbc-pinctrl"; compatible = "st,stih407-sbc-pinctrl";
st,syscfg = <&syscfg_sbc>; st,syscfg = <&syscfg_sbc>;
reg = <0xfe61f080 0x4>; reg = <0x0961f080 0x4>;
reg-names = "irqmux"; reg-names = "irqmux";
interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>;
interrupt-names = "irqmux"; interrupt-names = "irqmux";
ranges = <0 0xfe610000 0x5000>; ranges = <0 0x09610000 0x6000>;
PIO0: gpio@fe610000 { pio0: gpio@09610000 {
gpio-controller; gpio-controller;
#gpio-cells = <1>; #gpio-cells = <2>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
reg = <0 0x100>; reg = <0x0 0x100>;
st,bank-name = "PIO0"; st,bank-name = "PIO0";
}; };
... ...
pin-functions nodes follow... pin-functions nodes follow...
...@@ -162,7 +165,7 @@ pin-controller { ...@@ -162,7 +165,7 @@ pin-controller {
sdhci0:sdhci@fe810000{ sdhci0:sdhci@fe810000{
... ...
interrupt-parent = <&PIO3>; interrupt-parent = <&pio3>;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; /* Interrupt line via PIO3-3 */ interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; /* Interrupt line via PIO3-3 */
interrupt-names = "card-detect"; interrupt-names = "card-detect";
......
...@@ -17,6 +17,9 @@ PMIC's from Qualcomm. ...@@ -17,6 +17,9 @@ PMIC's from Qualcomm.
"qcom,pm8994-gpio" "qcom,pm8994-gpio"
"qcom,pma8084-gpio" "qcom,pma8084-gpio"
And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio"
if the device is on an spmi bus or an ssbi bus respectively
- reg: - reg:
Usage: required Usage: required
Value type: <prop-encoded-array> Value type: <prop-encoded-array>
...@@ -183,7 +186,7 @@ to specify in a pin configuration subnode: ...@@ -183,7 +186,7 @@ to specify in a pin configuration subnode:
Example: Example:
pm8921_gpio: gpio@150 { pm8921_gpio: gpio@150 {
compatible = "qcom,pm8921-gpio"; compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio";
reg = <0x150 0x160>; reg = <0x150 0x160>;
interrupts = <192 1>, <193 1>, <194 1>, interrupts = <192 1>, <193 1>, <194 1>,
<195 1>, <196 1>, <197 1>, <195 1>, <196 1>, <197 1>,
......
...@@ -19,6 +19,9 @@ of PMIC's from Qualcomm. ...@@ -19,6 +19,9 @@ of PMIC's from Qualcomm.
"qcom,pm8994-mpp", "qcom,pm8994-mpp",
"qcom,pma8084-mpp", "qcom,pma8084-mpp",
And must contain either "qcom,spmi-mpp" or "qcom,ssbi-mpp"
if the device is on an spmi bus or an ssbi bus respectively.
- reg: - reg:
Usage: required Usage: required
Value type: <prop-encoded-array> Value type: <prop-encoded-array>
...@@ -158,7 +161,7 @@ to specify in a pin configuration subnode: ...@@ -158,7 +161,7 @@ to specify in a pin configuration subnode:
Example: Example:
mpps@a000 { mpps@a000 {
compatible = "qcom,pm8841-mpp"; compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
reg = <0xa000>; reg = <0xa000>;
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
......
...@@ -17,9 +17,11 @@ Required Properties: ...@@ -17,9 +17,11 @@ Required Properties:
- "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller. - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
- "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller. - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
- "renesas,pfc-r8a7791": for R8A7791 (R-Car M2-W) compatible pin-controller. - "renesas,pfc-r8a7791": for R8A7791 (R-Car M2-W) compatible pin-controller.
- "renesas,pfc-r8a7792": for R8A7792 (R-Car V2H) compatible pin-controller.
- "renesas,pfc-r8a7793": for R8A7793 (R-Car M2-N) compatible pin-controller. - "renesas,pfc-r8a7793": for R8A7793 (R-Car M2-N) compatible pin-controller.
- "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller. - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller.
- "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller. - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller.
- "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) compatible pin-controller.
- "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller. - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
- reg: Base address and length of each memory resource used by the pin - reg: Base address and length of each memory resource used by the pin
......
...@@ -14,6 +14,11 @@ Required properies: ...@@ -14,6 +14,11 @@ Required properies:
- #size-cells : The value of this property must be 1 - #size-cells : The value of this property must be 1
- ranges : defines mapping between pin controller node (parent) to - ranges : defines mapping between pin controller node (parent) to
gpio-bank node (children). gpio-bank node (children).
- interrupt-parent: phandle of the interrupt parent to which the external
GPIO interrupts are forwarded to.
- st,syscfg: Should be phandle/offset pair. The phandle to the syscon node
which includes IRQ mux selection register, and the offset of the IRQ mux
selection register.
- pins-are-numbered: Specify the subnodes are using numbered pinmux to - pins-are-numbered: Specify the subnodes are using numbered pinmux to
specify pins. specify pins.
......
...@@ -262,6 +262,12 @@ symbol: ...@@ -262,6 +262,12 @@ symbol:
to the container using container_of(). to the container using container_of().
(See Documentation/driver-model/design-patterns.txt) (See Documentation/driver-model/design-patterns.txt)
If there is a need to exclude certain GPIOs from the IRQ domain, one can
set .irq_need_valid_mask of the gpiochip before gpiochip_add_data() is
called. This allocates .irq_valid_mask with as many bits set as there are
GPIOs in the chip. Drivers can exclude GPIOs by clearing bits from this
mask. The mask must be filled in before gpiochip_irqchip_add() is called.
* gpiochip_set_chained_irqchip(): sets up a chained irq handler for a * gpiochip_set_chained_irqchip(): sets up a chained irq handler for a
gpio_chip from a parent IRQ and passes the struct gpio_chip* as handler gpio_chip from a parent IRQ and passes the struct gpio_chip* as handler
data. (Notice handler data, since the irqchip data is likely used by the data. (Notice handler data, since the irqchip data is likely used by the
......
...@@ -91,9 +91,13 @@ int pinctrl_bind_pins(struct device *dev) ...@@ -91,9 +91,13 @@ int pinctrl_bind_pins(struct device *dev)
devm_kfree(dev, dev->pins); devm_kfree(dev, dev->pins);
dev->pins = NULL; dev->pins = NULL;
/* Only return deferrals */ /* Return deferrals */
if (ret != -EPROBE_DEFER) if (ret == -EPROBE_DEFER)
ret = 0; return ret;
/* Return serious errors */
if (ret == -EINVAL)
return ret;
/* We ignore errors like -ENOENT meaning no pinctrl state */
return ret; return 0;
} }
...@@ -458,6 +458,11 @@ static int mxc_gpio_probe(struct platform_device *pdev) ...@@ -458,6 +458,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
if (err) if (err)
goto out_bgio; goto out_bgio;
if (of_property_read_bool(np, "gpio-ranges")) {
port->gc.request = gpiochip_generic_request;
port->gc.free = gpiochip_generic_free;
}
port->gc.to_irq = mxc_gpio_to_irq; port->gc.to_irq = mxc_gpio_to_irq;
port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
pdev->id * 32; pdev->id * 32;
...@@ -510,7 +515,7 @@ static int __init gpio_mxc_init(void) ...@@ -510,7 +515,7 @@ static int __init gpio_mxc_init(void)
{ {
return platform_driver_register(&mxc_gpio_driver); return platform_driver_register(&mxc_gpio_driver);
} }
postcore_initcall(gpio_mxc_init); subsys_initcall(gpio_mxc_init);
MODULE_AUTHOR("Freescale Semiconductor, " MODULE_AUTHOR("Freescale Semiconductor, "
"Daniel Mack <danielncaiaq.de>, " "Daniel Mack <danielncaiaq.de>, "
......
...@@ -71,6 +71,8 @@ LIST_HEAD(gpio_devices); ...@@ -71,6 +71,8 @@ LIST_HEAD(gpio_devices);
static void gpiochip_free_hogs(struct gpio_chip *chip); static void gpiochip_free_hogs(struct gpio_chip *chip);
static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip); static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip);
static int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip);
static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip);
static bool gpiolib_initialized; static bool gpiolib_initialized;
...@@ -1167,6 +1169,10 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) ...@@ -1167,6 +1169,10 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data)
if (status) if (status)
goto err_remove_from_list; goto err_remove_from_list;
status = gpiochip_irqchip_init_valid_mask(chip);
if (status)
goto err_remove_from_list;
status = of_gpiochip_add(chip); status = of_gpiochip_add(chip);
if (status) if (status)
goto err_remove_chip; goto err_remove_chip;
...@@ -1192,6 +1198,7 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) ...@@ -1192,6 +1198,7 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data)
acpi_gpiochip_remove(chip); acpi_gpiochip_remove(chip);
gpiochip_free_hogs(chip); gpiochip_free_hogs(chip);
of_gpiochip_remove(chip); of_gpiochip_remove(chip);
gpiochip_irqchip_free_valid_mask(chip);
err_remove_from_list: err_remove_from_list:
spin_lock_irqsave(&gpio_lock, flags); spin_lock_irqsave(&gpio_lock, flags);
list_del(&gdev->list); list_del(&gdev->list);
...@@ -1401,6 +1408,40 @@ static struct gpio_chip *find_chip_by_name(const char *name) ...@@ -1401,6 +1408,40 @@ static struct gpio_chip *find_chip_by_name(const char *name)
* The following is irqchip helper code for gpiochips. * The following is irqchip helper code for gpiochips.
*/ */
static int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip)
{
int i;
if (!gpiochip->irq_need_valid_mask)
return 0;
gpiochip->irq_valid_mask = kcalloc(BITS_TO_LONGS(gpiochip->ngpio),
sizeof(long), GFP_KERNEL);
if (!gpiochip->irq_valid_mask)
return -ENOMEM;
/* Assume by default all GPIOs are valid */
for (i = 0; i < gpiochip->ngpio; i++)
set_bit(i, gpiochip->irq_valid_mask);
return 0;
}
static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
{
kfree(gpiochip->irq_valid_mask);
gpiochip->irq_valid_mask = NULL;
}
static bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip,
unsigned int offset)
{
/* No mask means all valid */
if (likely(!gpiochip->irq_valid_mask))
return true;
return test_bit(offset, gpiochip->irq_valid_mask);
}
/** /**
* gpiochip_set_chained_irqchip() - sets a chained irqchip to a gpiochip * gpiochip_set_chained_irqchip() - sets a chained irqchip to a gpiochip
* @gpiochip: the gpiochip to set the irqchip chain to * @gpiochip: the gpiochip to set the irqchip chain to
...@@ -1442,9 +1483,12 @@ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, ...@@ -1442,9 +1483,12 @@ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
} }
/* Set the parent IRQ for all affected IRQs */ /* Set the parent IRQ for all affected IRQs */
for (offset = 0; offset < gpiochip->ngpio; offset++) for (offset = 0; offset < gpiochip->ngpio; offset++) {
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
continue;
irq_set_parent(irq_find_mapping(gpiochip->irqdomain, offset), irq_set_parent(irq_find_mapping(gpiochip->irqdomain, offset),
parent_irq); parent_irq);
}
} }
EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip); EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip);
...@@ -1551,9 +1595,12 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) ...@@ -1551,9 +1595,12 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
/* Remove all IRQ mappings and delete the domain */ /* Remove all IRQ mappings and delete the domain */
if (gpiochip->irqdomain) { if (gpiochip->irqdomain) {
for (offset = 0; offset < gpiochip->ngpio; offset++) for (offset = 0; offset < gpiochip->ngpio; offset++) {
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
continue;
irq_dispose_mapping( irq_dispose_mapping(
irq_find_mapping(gpiochip->irqdomain, offset)); irq_find_mapping(gpiochip->irqdomain, offset));
}
irq_domain_remove(gpiochip->irqdomain); irq_domain_remove(gpiochip->irqdomain);
} }
...@@ -1562,6 +1609,8 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) ...@@ -1562,6 +1609,8 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
gpiochip->irqchip->irq_release_resources = NULL; gpiochip->irqchip->irq_release_resources = NULL;
gpiochip->irqchip = NULL; gpiochip->irqchip = NULL;
} }
gpiochip_irqchip_free_valid_mask(gpiochip);
} }
/** /**
...@@ -1597,6 +1646,7 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip, ...@@ -1597,6 +1646,7 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
struct lock_class_key *lock_key) struct lock_class_key *lock_key)
{ {
struct device_node *of_node; struct device_node *of_node;
bool irq_base_set = false;
unsigned int offset; unsigned int offset;
unsigned irq_base = 0; unsigned irq_base = 0;
...@@ -1646,13 +1696,17 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip, ...@@ -1646,13 +1696,17 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
* necessary to allocate descriptors for all IRQs. * necessary to allocate descriptors for all IRQs.
*/ */
for (offset = 0; offset < gpiochip->ngpio; offset++) { for (offset = 0; offset < gpiochip->ngpio; offset++) {
if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
continue;
irq_base = irq_create_mapping(gpiochip->irqdomain, offset); irq_base = irq_create_mapping(gpiochip->irqdomain, offset);
if (offset == 0) if (!irq_base_set) {
/* /*
* Store the base into the gpiochip to be used when * Store the base into the gpiochip to be used when
* unmapping the irqs. * unmapping the irqs.
*/ */
gpiochip->irq_base = irq_base; gpiochip->irq_base = irq_base;
irq_base_set = true;
}
} }
acpi_gpiochip_request_interrupts(gpiochip); acpi_gpiochip_request_interrupts(gpiochip);
...@@ -1664,6 +1718,12 @@ EXPORT_SYMBOL_GPL(_gpiochip_irqchip_add); ...@@ -1664,6 +1718,12 @@ EXPORT_SYMBOL_GPL(_gpiochip_irqchip_add);
#else /* CONFIG_GPIOLIB_IRQCHIP */ #else /* CONFIG_GPIOLIB_IRQCHIP */
static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) {} static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) {}
static inline int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip)
{
return 0;
}
static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
{ }
#endif /* CONFIG_GPIOLIB_IRQCHIP */ #endif /* CONFIG_GPIOLIB_IRQCHIP */
......
...@@ -254,6 +254,7 @@ config PINCTRL_ZYNQ ...@@ -254,6 +254,7 @@ config PINCTRL_ZYNQ
help help
This selects the pinctrl driver for Xilinx Zynq. This selects the pinctrl driver for Xilinx Zynq.
source "drivers/pinctrl/aspeed/Kconfig"
source "drivers/pinctrl/bcm/Kconfig" source "drivers/pinctrl/bcm/Kconfig"
source "drivers/pinctrl/berlin/Kconfig" source "drivers/pinctrl/berlin/Kconfig"
source "drivers/pinctrl/freescale/Kconfig" source "drivers/pinctrl/freescale/Kconfig"
......
...@@ -37,6 +37,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o ...@@ -37,6 +37,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o
obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o
obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
obj-y += bcm/ obj-y += bcm/
obj-$(CONFIG_PINCTRL_BERLIN) += berlin/ obj-$(CONFIG_PINCTRL_BERLIN) += berlin/
obj-y += freescale/ obj-y += freescale/
......
config PINCTRL_ASPEED
bool
depends on (ARCH_ASPEED || COMPILE_TEST) && OF
depends on MFD_SYSCON
select PINMUX
select PINCONF
select GENERIC_PINCONF
select REGMAP_MMIO
config PINCTRL_ASPEED_G4
bool "Aspeed G4 SoC pin control"
depends on (MACH_ASPEED_G4 || COMPILE_TEST) && OF
select PINCTRL_ASPEED
help
Say Y here to enable pin controller support for Aspeed's 4th
generation SoCs. GPIO is provided by a separate GPIO driver.
config PINCTRL_ASPEED_G5
bool "Aspeed G5 SoC pin control"
depends on (MACH_ASPEED_G5 || COMPILE_TEST) && OF
select PINCTRL_ASPEED
help
Say Y here to enable pin controller support for Aspeed's 5th
generation SoCs. GPIO is provided by a separate GPIO driver.
# Aspeed pinctrl support
ccflags-y += -Woverride-init
obj-$(CONFIG_PINCTRL_ASPEED) += pinctrl-aspeed.o
obj-$(CONFIG_PINCTRL_ASPEED_G4) += pinctrl-aspeed-g4.o
obj-$(CONFIG_PINCTRL_ASPEED_G5) += pinctrl-aspeed-g5.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1018,7 +1018,7 @@ static void bcm281xx_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev, ...@@ -1018,7 +1018,7 @@ static void bcm281xx_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev,
seq_printf(s, " %s", dev_name(pctldev->dev)); seq_printf(s, " %s", dev_name(pctldev->dev));
} }
static struct pinctrl_ops bcm281xx_pinctrl_ops = { static const struct pinctrl_ops bcm281xx_pinctrl_ops = {
.get_groups_count = bcm281xx_pinctrl_get_groups_count, .get_groups_count = bcm281xx_pinctrl_get_groups_count,
.get_group_name = bcm281xx_pinctrl_get_group_name, .get_group_name = bcm281xx_pinctrl_get_group_name,
.get_group_pins = bcm281xx_pinctrl_get_group_pins, .get_group_pins = bcm281xx_pinctrl_get_group_pins,
...@@ -1080,7 +1080,7 @@ static int bcm281xx_pinmux_set(struct pinctrl_dev *pctldev, ...@@ -1080,7 +1080,7 @@ static int bcm281xx_pinmux_set(struct pinctrl_dev *pctldev,
return rc; return rc;
} }
static struct pinmux_ops bcm281xx_pinctrl_pinmux_ops = { static const struct pinmux_ops bcm281xx_pinctrl_pinmux_ops = {
.get_functions_count = bcm281xx_pinctrl_get_fcns_count, .get_functions_count = bcm281xx_pinctrl_get_fcns_count,
.get_function_name = bcm281xx_pinctrl_get_fcn_name, .get_function_name = bcm281xx_pinctrl_get_fcn_name,
.get_function_groups = bcm281xx_pinctrl_get_fcn_groups, .get_function_groups = bcm281xx_pinctrl_get_fcn_groups,
......
...@@ -531,7 +531,7 @@ static void ns2_pin_dbg_show(struct pinctrl_dev *pctrl_dev, ...@@ -531,7 +531,7 @@ static void ns2_pin_dbg_show(struct pinctrl_dev *pctrl_dev,
seq_printf(s, " %s", dev_name(pctrl_dev->dev)); seq_printf(s, " %s", dev_name(pctrl_dev->dev));
} }
static struct pinctrl_ops ns2_pinctrl_ops = { static const struct pinctrl_ops ns2_pinctrl_ops = {
.get_groups_count = ns2_get_groups_count, .get_groups_count = ns2_get_groups_count,
.get_group_name = ns2_get_group_name, .get_group_name = ns2_get_group_name,
.get_group_pins = ns2_get_group_pins, .get_group_pins = ns2_get_group_pins,
...@@ -959,7 +959,7 @@ static int ns2_pin_config_set(struct pinctrl_dev *pctrldev, unsigned int pin, ...@@ -959,7 +959,7 @@ static int ns2_pin_config_set(struct pinctrl_dev *pctrldev, unsigned int pin,
out: out:
return ret; return ret;
} }
static struct pinmux_ops ns2_pinmux_ops = { static const struct pinmux_ops ns2_pinmux_ops = {
.get_functions_count = ns2_get_functions_count, .get_functions_count = ns2_get_functions_count,
.get_function_name = ns2_get_function_name, .get_function_name = ns2_get_function_name,
.get_function_groups = ns2_get_function_groups, .get_function_groups = ns2_get_function_groups,
......
...@@ -348,7 +348,7 @@ static void nsp_pin_dbg_show(struct pinctrl_dev *pctrl_dev, ...@@ -348,7 +348,7 @@ static void nsp_pin_dbg_show(struct pinctrl_dev *pctrl_dev,
seq_printf(s, " %s", dev_name(pctrl_dev->dev)); seq_printf(s, " %s", dev_name(pctrl_dev->dev));
} }
static struct pinctrl_ops nsp_pinctrl_ops = { static const struct pinctrl_ops nsp_pinctrl_ops = {
.get_groups_count = nsp_get_groups_count, .get_groups_count = nsp_get_groups_count,
.get_group_name = nsp_get_group_name, .get_group_name = nsp_get_group_name,
.get_group_pins = nsp_get_group_pins, .get_group_pins = nsp_get_group_pins,
...@@ -518,7 +518,7 @@ static void nsp_gpio_disable_free(struct pinctrl_dev *pctrl_dev, ...@@ -518,7 +518,7 @@ static void nsp_gpio_disable_free(struct pinctrl_dev *pctrl_dev,
spin_unlock_irqrestore(&pinctrl->lock, flags); spin_unlock_irqrestore(&pinctrl->lock, flags);
} }
static struct pinmux_ops nsp_pinmux_ops = { static const struct pinmux_ops nsp_pinmux_ops = {
.get_functions_count = nsp_get_functions_count, .get_functions_count = nsp_get_functions_count,
.get_function_name = nsp_get_function_name, .get_function_name = nsp_get_function_name,
.get_function_groups = nsp_get_function_groups, .get_function_groups = nsp_get_function_groups,
......
...@@ -315,7 +315,7 @@ static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, ...@@ -315,7 +315,7 @@ static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
/* Currently implementation only for shared mux/conf register */ /* Currently implementation only for shared mux/conf register */
if (!(info->flags & SHARE_MUX_CONF_REG)) if (!(info->flags & SHARE_MUX_CONF_REG))
return -EINVAL; return 0;
pin_reg = &info->pin_regs[offset]; pin_reg = &info->pin_regs[offset];
if (pin_reg->mux_reg == -1) if (pin_reg->mux_reg == -1)
...@@ -380,7 +380,7 @@ static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, ...@@ -380,7 +380,7 @@ static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
* They are part of the shared mux/conf register. * They are part of the shared mux/conf register.
*/ */
if (!(info->flags & SHARE_MUX_CONF_REG)) if (!(info->flags & SHARE_MUX_CONF_REG))
return -EINVAL; return 0;
pin_reg = &info->pin_regs[offset]; pin_reg = &info->pin_regs[offset];
if (pin_reg->mux_reg == -1) if (pin_reg->mux_reg == -1)
...@@ -501,7 +501,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev, ...@@ -501,7 +501,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
ret = imx_pinconf_get(pctldev, pin->pin, &config); ret = imx_pinconf_get(pctldev, pin->pin, &config);
if (ret) if (ret)
return; return;
seq_printf(s, "%s: 0x%lx", name, config); seq_printf(s, " %s: 0x%lx\n", name, config);
} }
} }
......
...@@ -134,6 +134,7 @@ struct chv_gpio_pinrange { ...@@ -134,6 +134,7 @@ struct chv_gpio_pinrange {
* @gpio_ranges: An array of GPIO ranges in this community * @gpio_ranges: An array of GPIO ranges in this community
* @ngpio_ranges: Number of GPIO ranges * @ngpio_ranges: Number of GPIO ranges
* @ngpios: Total number of GPIOs in this community * @ngpios: Total number of GPIOs in this community
* @nirqs: Total number of IRQs this community can generate
*/ */
struct chv_community { struct chv_community {
const char *uid; const char *uid;
...@@ -146,6 +147,7 @@ struct chv_community { ...@@ -146,6 +147,7 @@ struct chv_community {
const struct chv_gpio_pinrange *gpio_ranges; const struct chv_gpio_pinrange *gpio_ranges;
size_t ngpio_ranges; size_t ngpio_ranges;
size_t ngpios; size_t ngpios;
size_t nirqs;
}; };
struct chv_pin_context { struct chv_pin_context {
...@@ -396,6 +398,12 @@ static const struct chv_community southwest_community = { ...@@ -396,6 +398,12 @@ static const struct chv_community southwest_community = {
.gpio_ranges = southwest_gpio_ranges, .gpio_ranges = southwest_gpio_ranges,
.ngpio_ranges = ARRAY_SIZE(southwest_gpio_ranges), .ngpio_ranges = ARRAY_SIZE(southwest_gpio_ranges),
.ngpios = ARRAY_SIZE(southwest_pins), .ngpios = ARRAY_SIZE(southwest_pins),
/*
* Southwest community can benerate GPIO interrupts only for the
* first 8 interrupts. The upper half (8-15) can only be used to
* trigger GPEs.
*/
.nirqs = 8,
}; };
static const struct pinctrl_pin_desc north_pins[] = { static const struct pinctrl_pin_desc north_pins[] = {
...@@ -479,6 +487,12 @@ static const struct chv_community north_community = { ...@@ -479,6 +487,12 @@ static const struct chv_community north_community = {
.gpio_ranges = north_gpio_ranges, .gpio_ranges = north_gpio_ranges,
.ngpio_ranges = ARRAY_SIZE(north_gpio_ranges), .ngpio_ranges = ARRAY_SIZE(north_gpio_ranges),
.ngpios = ARRAY_SIZE(north_pins), .ngpios = ARRAY_SIZE(north_pins),
/*
* North community can benerate GPIO interrupts only for the first
* 8 interrupts. The upper half (8-15) can only be used to trigger
* GPEs.
*/
.nirqs = 8,
}; };
static const struct pinctrl_pin_desc east_pins[] = { static const struct pinctrl_pin_desc east_pins[] = {
...@@ -521,6 +535,7 @@ static const struct chv_community east_community = { ...@@ -521,6 +535,7 @@ static const struct chv_community east_community = {
.gpio_ranges = east_gpio_ranges, .gpio_ranges = east_gpio_ranges,
.ngpio_ranges = ARRAY_SIZE(east_gpio_ranges), .ngpio_ranges = ARRAY_SIZE(east_gpio_ranges),
.ngpios = ARRAY_SIZE(east_pins), .ngpios = ARRAY_SIZE(east_pins),
.nirqs = 16,
}; };
static const struct pinctrl_pin_desc southeast_pins[] = { static const struct pinctrl_pin_desc southeast_pins[] = {
...@@ -646,6 +661,7 @@ static const struct chv_community southeast_community = { ...@@ -646,6 +661,7 @@ static const struct chv_community southeast_community = {
.gpio_ranges = southeast_gpio_ranges, .gpio_ranges = southeast_gpio_ranges,
.ngpio_ranges = ARRAY_SIZE(southeast_gpio_ranges), .ngpio_ranges = ARRAY_SIZE(southeast_gpio_ranges),
.ngpios = ARRAY_SIZE(southeast_pins), .ngpios = ARRAY_SIZE(southeast_pins),
.nirqs = 16,
}; };
static const struct chv_community *chv_communities[] = { static const struct chv_community *chv_communities[] = {
...@@ -1497,7 +1513,7 @@ static void chv_gpio_irq_handler(struct irq_desc *desc) ...@@ -1497,7 +1513,7 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
chained_irq_enter(chip, desc); chained_irq_enter(chip, desc);
pending = readl(pctrl->regs + CHV_INTSTAT); pending = readl(pctrl->regs + CHV_INTSTAT);
for_each_set_bit(intr_line, &pending, 16) { for_each_set_bit(intr_line, &pending, pctrl->community->nirqs) {
unsigned irq, offset; unsigned irq, offset;
offset = pctrl->intr_lines[intr_line]; offset = pctrl->intr_lines[intr_line];
...@@ -1520,8 +1536,9 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) ...@@ -1520,8 +1536,9 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
chip->label = dev_name(pctrl->dev); chip->label = dev_name(pctrl->dev);
chip->parent = pctrl->dev; chip->parent = pctrl->dev;
chip->base = -1; chip->base = -1;
chip->irq_need_valid_mask = true;
ret = gpiochip_add_data(chip, pctrl); ret = devm_gpiochip_add_data(pctrl->dev, chip, pctrl);
if (ret) { if (ret) {
dev_err(pctrl->dev, "Failed to register gpiochip\n"); dev_err(pctrl->dev, "Failed to register gpiochip\n");
return ret; return ret;
...@@ -1533,12 +1550,27 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) ...@@ -1533,12 +1550,27 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
range->base, range->npins); range->base, range->npins);
if (ret) { if (ret) {
dev_err(pctrl->dev, "failed to add GPIO pin range\n"); dev_err(pctrl->dev, "failed to add GPIO pin range\n");
goto fail; return ret;
} }
offset += range->npins; offset += range->npins;
} }
/* Do not add GPIOs that can only generate GPEs to the IRQ domain */
for (i = 0; i < pctrl->community->npins; i++) {
const struct pinctrl_pin_desc *desc;
u32 intsel;
desc = &pctrl->community->pins[i];
intsel = readl(chv_padreg(pctrl, desc->number, CHV_PADCTRL0));
intsel &= CHV_PADCTRL0_INTSEL_MASK;
intsel >>= CHV_PADCTRL0_INTSEL_SHIFT;
if (intsel >= pctrl->community->nirqs)
clear_bit(i, chip->irq_valid_mask);
}
/* Clear all interrupts */ /* Clear all interrupts */
chv_writel(0xffff, pctrl->regs + CHV_INTSTAT); chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
...@@ -1546,17 +1578,12 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq) ...@@ -1546,17 +1578,12 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
handle_bad_irq, IRQ_TYPE_NONE); handle_bad_irq, IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_err(pctrl->dev, "failed to add IRQ chip\n"); dev_err(pctrl->dev, "failed to add IRQ chip\n");
goto fail; return ret;
} }
gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq, gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq,
chv_gpio_irq_handler); chv_gpio_irq_handler);
return 0; return 0;
fail:
gpiochip_remove(chip);
return ret;
} }
static int chv_pinctrl_probe(struct platform_device *pdev) static int chv_pinctrl_probe(struct platform_device *pdev)
...@@ -1624,15 +1651,6 @@ static int chv_pinctrl_probe(struct platform_device *pdev) ...@@ -1624,15 +1651,6 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int chv_pinctrl_remove(struct platform_device *pdev)
{
struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
gpiochip_remove(&pctrl->chip);
return 0;
}
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int chv_pinctrl_suspend(struct device *dev) static int chv_pinctrl_suspend(struct device *dev)
{ {
...@@ -1729,7 +1747,6 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match); ...@@ -1729,7 +1747,6 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match);
static struct platform_driver chv_pinctrl_driver = { static struct platform_driver chv_pinctrl_driver = {
.probe = chv_pinctrl_probe, .probe = chv_pinctrl_probe,
.remove = chv_pinctrl_remove,
.driver = { .driver = {
.name = "cherryview-pinctrl", .name = "cherryview-pinctrl",
.pm = &chv_pinctrl_pm_ops, .pm = &chv_pinctrl_pm_ops,
......
...@@ -86,6 +86,7 @@ struct intel_pinctrl_context { ...@@ -86,6 +86,7 @@ struct intel_pinctrl_context {
* @communities: All communities in this pin controller * @communities: All communities in this pin controller
* @ncommunities: Number of communities in this pin controller * @ncommunities: Number of communities in this pin controller
* @context: Configuration saved over system sleep * @context: Configuration saved over system sleep
* @irq: pinctrl/GPIO chip irq number
*/ */
struct intel_pinctrl { struct intel_pinctrl {
struct device *dev; struct device *dev;
...@@ -97,6 +98,7 @@ struct intel_pinctrl { ...@@ -97,6 +98,7 @@ struct intel_pinctrl {
struct intel_community *communities; struct intel_community *communities;
size_t ncommunities; size_t ncommunities;
struct intel_pinctrl_context context; struct intel_pinctrl_context context;
int irq;
}; };
#define pin_to_padno(c, p) ((p) - (c)->pin_base) #define pin_to_padno(c, p) ((p) - (c)->pin_base)
...@@ -793,38 +795,12 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on) ...@@ -793,38 +795,12 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
const struct intel_community *community;
unsigned pin = irqd_to_hwirq(d); unsigned pin = irqd_to_hwirq(d);
unsigned padno, gpp, gpp_offset;
unsigned long flags;
u32 gpe_en;
community = intel_get_community(pctrl, pin);
if (!community)
return -EINVAL;
raw_spin_lock_irqsave(&pctrl->lock, flags);
padno = pin_to_padno(community, pin);
gpp = padno / community->gpp_size;
gpp_offset = padno % community->gpp_size;
/* Clear the existing wake status */
writel(BIT(gpp_offset), community->regs + GPI_GPE_STS + gpp * 4);
/*
* The controller will generate wake when GPE of the corresponding
* pad is enabled and it is not routed to SCI (GPIROUTSCI is not
* set).
*/
gpe_en = readl(community->regs + GPI_GPE_EN + gpp * 4);
if (on) if (on)
gpe_en |= BIT(gpp_offset); enable_irq_wake(pctrl->irq);
else else
gpe_en &= ~BIT(gpp_offset); disable_irq_wake(pctrl->irq);
writel(gpe_en, community->regs + GPI_GPE_EN + gpp * 4);
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
dev_dbg(pctrl->dev, "%sable wake for pin %u\n", on ? "en" : "dis", pin); dev_dbg(pctrl->dev, "%sable wake for pin %u\n", on ? "en" : "dis", pin);
return 0; return 0;
...@@ -905,6 +881,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) ...@@ -905,6 +881,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
pctrl->chip.label = dev_name(pctrl->dev); pctrl->chip.label = dev_name(pctrl->dev);
pctrl->chip.parent = pctrl->dev; pctrl->chip.parent = pctrl->dev;
pctrl->chip.base = -1; pctrl->chip.base = -1;
pctrl->irq = irq;
ret = gpiochip_add_data(&pctrl->chip, pctrl); ret = gpiochip_add_data(&pctrl->chip, pctrl);
if (ret) { if (ret) {
......
...@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev) ...@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
*/ */
nfamilies = ARRAY_SIZE(mrfld_families), nfamilies = ARRAY_SIZE(mrfld_families),
families = devm_kmemdup(&pdev->dev, mrfld_families, families = devm_kmemdup(&pdev->dev, mrfld_families,
nfamilies * sizeof(mrfld_families), sizeof(mrfld_families),
GFP_KERNEL); GFP_KERNEL);
if (!families) if (!families)
return -ENOMEM; return -ENOMEM;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/gpio/driver.h> #include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h> #include <linux/of_device.h>
...@@ -1055,7 +1054,7 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, ...@@ -1055,7 +1054,7 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
return 0; return 0;
} }
static struct gpio_chip mtk_gpio_chip = { static const struct gpio_chip mtk_gpio_chip = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.request = gpiochip_generic_request, .request = gpiochip_generic_request,
.free = gpiochip_generic_free, .free = gpiochip_generic_free,
...@@ -1496,7 +1495,3 @@ int mtk_pctrl_init(struct platform_device *pdev, ...@@ -1496,7 +1495,3 @@ int mtk_pctrl_init(struct platform_device *pdev,
gpiochip_remove(pctl->chip); gpiochip_remove(pctl->chip);
return ret; return ret;
} }
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MediaTek Pinctrl Driver");
MODULE_AUTHOR("Hongzhou Yang <hongzhou.yang@mediatek.com>");
This diff is collapsed.
This diff is collapsed.
...@@ -95,54 +95,17 @@ struct meson_bank { ...@@ -95,54 +95,17 @@ struct meson_bank {
struct meson_reg_desc regs[NUM_REG]; struct meson_reg_desc regs[NUM_REG];
}; };
/**
* struct meson_domain_data - domain platform data
*
* @name: name of the domain
* @banks: set of banks belonging to the domain
* @num_banks: number of banks in the domain
*/
struct meson_domain_data {
const char *name;
struct meson_bank *banks;
unsigned int num_banks;
unsigned int pin_base;
unsigned int num_pins;
};
/**
* struct meson_domain
*
* @reg_mux: registers for mux settings
* @reg_pullen: registers for pull-enable settings
* @reg_pull: registers for pull settings
* @reg_gpio: registers for gpio settings
* @chip: gpio chip associated with the domain
* @data; platform data for the domain
* @node: device tree node for the domain
*
* A domain represents a set of banks controlled by the same set of
* registers.
*/
struct meson_domain {
struct regmap *reg_mux;
struct regmap *reg_pullen;
struct regmap *reg_pull;
struct regmap *reg_gpio;
struct gpio_chip chip;
struct meson_domain_data *data;
struct device_node *of_node;
};
struct meson_pinctrl_data { struct meson_pinctrl_data {
const char *name;
const struct pinctrl_pin_desc *pins; const struct pinctrl_pin_desc *pins;
struct meson_pmx_group *groups; struct meson_pmx_group *groups;
struct meson_pmx_func *funcs; struct meson_pmx_func *funcs;
struct meson_domain_data *domain_data; unsigned int pin_base;
unsigned int num_pins; unsigned int num_pins;
unsigned int num_groups; unsigned int num_groups;
unsigned int num_funcs; unsigned int num_funcs;
struct meson_bank *banks;
unsigned int num_banks;
}; };
struct meson_pinctrl { struct meson_pinctrl {
...@@ -150,7 +113,12 @@ struct meson_pinctrl { ...@@ -150,7 +113,12 @@ struct meson_pinctrl {
struct pinctrl_dev *pcdev; struct pinctrl_dev *pcdev;
struct pinctrl_desc desc; struct pinctrl_desc desc;
struct meson_pinctrl_data *data; struct meson_pinctrl_data *data;
struct meson_domain *domain; struct regmap *reg_mux;
struct regmap *reg_pullen;
struct regmap *reg_pull;
struct regmap *reg_gpio;
struct gpio_chip chip;
struct device_node *of_node;
}; };
#define PIN(x, b) (b + x) #define PIN(x, b) (b + x)
......
...@@ -931,38 +931,28 @@ static struct meson_bank meson8_aobus_banks[] = { ...@@ -931,38 +931,28 @@ static struct meson_bank meson8_aobus_banks[] = {
BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 0, 0, 16, 0, 0, 0, 16, 1, 0),
}; };
static struct meson_domain_data meson8_cbus_domain_data = { struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
.name = "cbus-banks", .name = "cbus-banks",
.banks = meson8_cbus_banks,
.num_banks = ARRAY_SIZE(meson8_cbus_banks),
.pin_base = 0, .pin_base = 0,
.num_pins = 120,
};
static struct meson_domain_data meson8_aobus_domain_data = {
.name = "ao-bank",
.banks = meson8_aobus_banks,
.num_banks = ARRAY_SIZE(meson8_aobus_banks),
.pin_base = 120,
.num_pins = 16,
};
struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
.pins = meson8_cbus_pins, .pins = meson8_cbus_pins,
.groups = meson8_cbus_groups, .groups = meson8_cbus_groups,
.funcs = meson8_cbus_functions, .funcs = meson8_cbus_functions,
.domain_data = &meson8_cbus_domain_data, .banks = meson8_cbus_banks,
.num_pins = ARRAY_SIZE(meson8_cbus_pins), .num_pins = ARRAY_SIZE(meson8_cbus_pins),
.num_groups = ARRAY_SIZE(meson8_cbus_groups), .num_groups = ARRAY_SIZE(meson8_cbus_groups),
.num_funcs = ARRAY_SIZE(meson8_cbus_functions), .num_funcs = ARRAY_SIZE(meson8_cbus_functions),
.num_banks = ARRAY_SIZE(meson8_cbus_banks),
}; };
struct meson_pinctrl_data meson8_aobus_pinctrl_data = { struct meson_pinctrl_data meson8_aobus_pinctrl_data = {
.name = "ao-bank",
.pin_base = 120,
.pins = meson8_aobus_pins, .pins = meson8_aobus_pins,
.groups = meson8_aobus_groups, .groups = meson8_aobus_groups,
.funcs = meson8_aobus_functions, .funcs = meson8_aobus_functions,
.domain_data = &meson8_aobus_domain_data, .banks = meson8_aobus_banks,
.num_pins = ARRAY_SIZE(meson8_aobus_pins), .num_pins = ARRAY_SIZE(meson8_aobus_pins),
.num_groups = ARRAY_SIZE(meson8_aobus_groups), .num_groups = ARRAY_SIZE(meson8_aobus_groups),
.num_funcs = ARRAY_SIZE(meson8_aobus_functions), .num_funcs = ARRAY_SIZE(meson8_aobus_functions),
.num_banks = ARRAY_SIZE(meson8_aobus_banks),
}; };
...@@ -896,38 +896,28 @@ static struct meson_bank meson8b_aobus_banks[] = { ...@@ -896,38 +896,28 @@ static struct meson_bank meson8b_aobus_banks[] = {
BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), BANK("AO", PIN(GPIOAO_0, AO_OFF), PIN(GPIO_TEST_N, AO_OFF), 0, 0, 0, 16, 0, 0, 0, 16, 1, 0),
}; };
static struct meson_domain_data meson8b_cbus_domain_data = { struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
.name = "cbus-banks", .name = "cbus-banks",
.banks = meson8b_cbus_banks,
.num_banks = ARRAY_SIZE(meson8b_cbus_banks),
.pin_base = 0, .pin_base = 0,
.num_pins = 130,
};
static struct meson_domain_data meson8b_aobus_domain_data = {
.name = "aobus-banks",
.banks = meson8b_aobus_banks,
.num_banks = ARRAY_SIZE(meson8b_aobus_banks),
.pin_base = 130,
.num_pins = 16,
};
struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
.pins = meson8b_cbus_pins, .pins = meson8b_cbus_pins,
.groups = meson8b_cbus_groups, .groups = meson8b_cbus_groups,
.funcs = meson8b_cbus_functions, .funcs = meson8b_cbus_functions,
.domain_data = &meson8b_cbus_domain_data, .banks = meson8b_cbus_banks,
.num_pins = ARRAY_SIZE(meson8b_cbus_pins), .num_pins = ARRAY_SIZE(meson8b_cbus_pins),
.num_groups = ARRAY_SIZE(meson8b_cbus_groups), .num_groups = ARRAY_SIZE(meson8b_cbus_groups),
.num_funcs = ARRAY_SIZE(meson8b_cbus_functions), .num_funcs = ARRAY_SIZE(meson8b_cbus_functions),
.num_banks = ARRAY_SIZE(meson8b_cbus_banks),
}; };
struct meson_pinctrl_data meson8b_aobus_pinctrl_data = { struct meson_pinctrl_data meson8b_aobus_pinctrl_data = {
.name = "aobus-banks",
.pin_base = 130,
.pins = meson8b_aobus_pins, .pins = meson8b_aobus_pins,
.groups = meson8b_aobus_groups, .groups = meson8b_aobus_groups,
.funcs = meson8b_aobus_functions, .funcs = meson8b_aobus_functions,
.domain_data = &meson8b_aobus_domain_data, .banks = meson8b_aobus_banks,
.num_pins = ARRAY_SIZE(meson8b_aobus_pins), .num_pins = ARRAY_SIZE(meson8b_aobus_pins),
.num_groups = ARRAY_SIZE(meson8b_aobus_groups), .num_groups = ARRAY_SIZE(meson8b_aobus_groups),
.num_funcs = ARRAY_SIZE(meson8b_aobus_functions), .num_funcs = ARRAY_SIZE(meson8b_aobus_functions),
.num_banks = ARRAY_SIZE(meson8b_aobus_banks),
}; };
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* Author: Patrice Chotard <patrice.chotard@st.com> * Author: Patrice Chotard <patrice.chotard@st.com>
* License terms: GNU General Public License (GPL) version 2 * License terms: GNU General Public License (GPL) version 2
* *
* Driver allows to use AxB5xx unused pins to be used as GPIO
*
* 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 version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
...@@ -12,7 +14,6 @@ ...@@ -12,7 +14,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
...@@ -1269,8 +1270,3 @@ static int __init abx500_gpio_init(void) ...@@ -1269,8 +1270,3 @@ static int __init abx500_gpio_init(void)
return platform_driver_register(&abx500_gpio_driver); return platform_driver_register(&abx500_gpio_driver);
} }
core_initcall(abx500_gpio_init); core_initcall(abx500_gpio_init);
MODULE_AUTHOR("Patrice Chotard <patrice.chotard@st.com>");
MODULE_DESCRIPTION("Driver allows to use AxB5xx unused pins to be used as GPIO");
MODULE_ALIAS("platform:abx500-gpio");
MODULE_LICENSE("GPL v2");
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -1110,10 +1109,8 @@ static int nmk_gpio_probe(struct platform_device *dev) ...@@ -1110,10 +1109,8 @@ static int nmk_gpio_probe(struct platform_device *dev)
return PTR_ERR(nmk_chip); return PTR_ERR(nmk_chip);
} }
if (of_get_property(np, "st,supports-sleepmode", NULL)) supports_sleepmode =
supports_sleepmode = true; of_property_read_bool(np, "st,supports-sleepmode");
else
supports_sleepmode = false;
/* Correct platform device ID */ /* Correct platform device ID */
dev->id = nmk_chip->bank; dev->id = nmk_chip->bank;
...@@ -1180,7 +1177,7 @@ static int nmk_gpio_probe(struct platform_device *dev) ...@@ -1180,7 +1177,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
irqchip, irqchip,
0, 0,
handle_edge_irq, handle_edge_irq,
IRQ_TYPE_EDGE_FALLING); IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_err(&dev->dev, "could not add irqchip\n"); dev_err(&dev->dev, "could not add irqchip\n");
gpiochip_remove(&nmk_chip->chip); gpiochip_remove(&nmk_chip->chip);
...@@ -1985,7 +1982,3 @@ static int __init nmk_pinctrl_init(void) ...@@ -1985,7 +1982,3 @@ static int __init nmk_pinctrl_init(void)
return platform_driver_register(&nmk_pinctrl_driver); return platform_driver_register(&nmk_pinctrl_driver);
} }
core_initcall(nmk_pinctrl_init); core_initcall(nmk_pinctrl_init);
MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini");
MODULE_DESCRIPTION("Nomadik GPIO Driver");
MODULE_LICENSE("GPL");
...@@ -383,12 +383,26 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type) ...@@ -383,12 +383,26 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
int ret = 0; int ret = 0;
u32 pin_reg; u32 pin_reg;
unsigned long flags; unsigned long flags;
bool level_trig;
u32 active_level;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc); struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
spin_lock_irqsave(&gpio_dev->lock, flags); spin_lock_irqsave(&gpio_dev->lock, flags);
pin_reg = readl(gpio_dev->base + (d->hwirq)*4); pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
/*
* When level_trig is set EDGE and active_level is set HIGH in BIOS
* default settings, ignore incoming settings from client and use
* BIOS settings to configure GPIO register.
*/
level_trig = !(pin_reg & (LEVEL_TRIGGER << LEVEL_TRIG_OFF));
active_level = pin_reg & (ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
if(level_trig &&
((active_level >> ACTIVE_LEVEL_OFF) == ACTIVE_HIGH))
type = IRQ_TYPE_EDGE_FALLING;
switch (type & IRQ_TYPE_SENSE_MASK) { switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_RISING: case IRQ_TYPE_EDGE_RISING:
pin_reg &= ~BIT(LEVEL_TRIG_OFF); pin_reg &= ~BIT(LEVEL_TRIG_OFF);
......
...@@ -1614,7 +1614,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev, ...@@ -1614,7 +1614,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev,
&gpio_irqchip, &gpio_irqchip,
0, 0,
handle_edge_irq, handle_edge_irq,
IRQ_TYPE_EDGE_BOTH); IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_err(&pdev->dev, "at91_gpio.%d: Couldn't add irqchip to gpiochip.\n", dev_err(&pdev->dev, "at91_gpio.%d: Couldn't add irqchip to gpiochip.\n",
at91_gpio->pioc_idx); at91_gpio->pioc_idx);
......
...@@ -1004,9 +1004,7 @@ static int palmas_pinctrl_probe(struct platform_device *pdev) ...@@ -1004,9 +1004,7 @@ static int palmas_pinctrl_probe(struct platform_device *pdev)
bool enable_dvfs2 = false; bool enable_dvfs2 = false;
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
const struct of_device_id *match; pinctrl_data = of_device_get_match_data(&pdev->dev);
match = of_match_device(palmas_pinctrl_of_match, &pdev->dev);
pinctrl_data = match->data;
enable_dvfs1 = of_property_read_bool(pdev->dev.of_node, enable_dvfs1 = of_property_read_bool(pdev->dev.of_node,
"ti,palmas-enable-dvfs1"); "ti,palmas-enable-dvfs1");
enable_dvfs2 = of_property_read_bool(pdev->dev.of_node, enable_dvfs2 = of_property_read_bool(pdev->dev.of_node,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include <linux/module.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/bitops.h> #include <linux/bitops.h>
...@@ -2704,7 +2704,6 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { ...@@ -2704,7 +2704,6 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
.data = (void *)&rk3399_pin_ctrl }, .data = (void *)&rk3399_pin_ctrl },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, rockchip_pinctrl_dt_match);
static struct platform_driver rockchip_pinctrl_driver = { static struct platform_driver rockchip_pinctrl_driver = {
.probe = rockchip_pinctrl_probe, .probe = rockchip_pinctrl_probe,
...@@ -2720,7 +2719,3 @@ static int __init rockchip_pinctrl_drv_register(void) ...@@ -2720,7 +2719,3 @@ static int __init rockchip_pinctrl_drv_register(void)
return platform_driver_register(&rockchip_pinctrl_driver); return platform_driver_register(&rockchip_pinctrl_driver);
} }
postcore_initcall(rockchip_pinctrl_drv_register); postcore_initcall(rockchip_pinctrl_drv_register);
MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
MODULE_DESCRIPTION("Rockchip pinctrl driver");
MODULE_LICENSE("GPL v2");
This diff is collapsed.
...@@ -233,7 +233,7 @@ static const unsigned int sdio0_2_pins[] = {40, 41, 42, 43, 44, 45}; ...@@ -233,7 +233,7 @@ static const unsigned int sdio0_2_pins[] = {40, 41, 42, 43, 44, 45};
static const unsigned int sdio1_0_pins[] = {10, 11, 12, 13, 14, 15}; static const unsigned int sdio1_0_pins[] = {10, 11, 12, 13, 14, 15};
static const unsigned int sdio1_1_pins[] = {22, 23, 24, 25, 26, 27}; static const unsigned int sdio1_1_pins[] = {22, 23, 24, 25, 26, 27};
static const unsigned int sdio1_2_pins[] = {34, 35, 36, 37, 38, 39}; static const unsigned int sdio1_2_pins[] = {34, 35, 36, 37, 38, 39};
static const unsigned int sdio1_3_pins[] = {46, 47, 48, 49, 40, 51}; static const unsigned int sdio1_3_pins[] = {46, 47, 48, 49, 50, 51};
static const unsigned int sdio0_emio_wp_pins[] = {54}; static const unsigned int sdio0_emio_wp_pins[] = {54};
static const unsigned int sdio0_emio_cd_pins[] = {55}; static const unsigned int sdio0_emio_cd_pins[] = {55};
static const unsigned int sdio1_emio_wp_pins[] = {56}; static const unsigned int sdio1_emio_wp_pins[] = {56};
......
...@@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
spin_lock_irqsave(&pctrl->lock, flags); spin_lock_irqsave(&pctrl->lock, flags);
val = readl(pctrl->regs + g->ctl_reg); val = readl(pctrl->regs + g->ctl_reg);
val &= mask; val &= ~mask;
val |= i << g->mux_bit; val |= i << g->mux_bit;
writel(val, pctrl->regs + g->ctl_reg); writel(val, pctrl->regs + g->ctl_reg);
......
...@@ -800,6 +800,7 @@ static const struct of_device_id pmic_gpio_of_match[] = { ...@@ -800,6 +800,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
{ .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */ { .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */
{ .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */ { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */
{ .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */ { .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */
{ .compatible = "qcom,spmi-gpio" }, /* Generic */
{ }, { },
}; };
......
...@@ -914,6 +914,7 @@ static const struct of_device_id pmic_mpp_of_match[] = { ...@@ -914,6 +914,7 @@ static const struct of_device_id pmic_mpp_of_match[] = {
{ .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */
{ .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */
{ .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */
{ .compatible = "qcom,spmi-mpp" }, /* Generic */
{ }, { },
}; };
......
...@@ -428,14 +428,10 @@ static void exynos_irq_eint0_15(struct irq_desc *desc) ...@@ -428,14 +428,10 @@ static void exynos_irq_eint0_15(struct irq_desc *desc)
int eint_irq; int eint_irq;
chained_irq_enter(chip, desc); chained_irq_enter(chip, desc);
chip->irq_mask(&desc->irq_data);
if (chip->irq_ack)
chip->irq_ack(&desc->irq_data);
eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq); eint_irq = irq_linear_revmap(bank->irq_domain, eintd->irq);
generic_handle_irq(eint_irq); generic_handle_irq(eint_irq);
chip->irq_unmask(&desc->irq_data);
chained_irq_exit(chip, desc); chained_irq_exit(chip, desc);
} }
......
...@@ -1041,17 +1041,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) ...@@ -1041,17 +1041,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; int ret;
if (!dev->of_node) {
dev_err(dev, "device tree node not found\n");
return -ENODEV;
}
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata) { if (!drvdata)
dev_err(dev, "failed to allocate memory for driver's "
"private data\n");
return -ENOMEM; return -ENOMEM;
}
ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev); ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev);
if (IS_ERR(ctrl)) { if (IS_ERR(ctrl)) {
......
...@@ -54,6 +54,11 @@ config PINCTRL_PFC_R8A7791 ...@@ -54,6 +54,11 @@ config PINCTRL_PFC_R8A7791
depends on ARCH_R8A7791 depends on ARCH_R8A7791
select PINCTRL_SH_PFC select PINCTRL_SH_PFC
config PINCTRL_PFC_R8A7792
def_bool y
depends on ARCH_R8A7792
select PINCTRL_SH_PFC
config PINCTRL_PFC_R8A7793 config PINCTRL_PFC_R8A7793
def_bool y def_bool y
depends on ARCH_R8A7793 depends on ARCH_R8A7793
...@@ -69,6 +74,11 @@ config PINCTRL_PFC_R8A7795 ...@@ -69,6 +74,11 @@ config PINCTRL_PFC_R8A7795
depends on ARCH_R8A7795 depends on ARCH_R8A7795
select PINCTRL_SH_PFC select PINCTRL_SH_PFC
config PINCTRL_PFC_R8A7796
def_bool y
depends on ARCH_R8A7796
select PINCTRL_SH_PFC
config PINCTRL_PFC_SH7203 config PINCTRL_PFC_SH7203
def_bool y def_bool y
depends on CPU_SUBTYPE_SH7203 depends on CPU_SUBTYPE_SH7203
......
...@@ -7,9 +7,11 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o ...@@ -7,9 +7,11 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o
obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o
obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
obj-$(CONFIG_PINCTRL_PFC_R8A7791) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7791) += pfc-r8a7791.o
obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o
obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o
obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o
obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o
obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o
obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o
obj-$(CONFIG_PINCTRL_PFC_SH7269) += pfc-sh7269.o obj-$(CONFIG_PINCTRL_PFC_SH7269) += pfc-sh7269.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Licensed under GPLv2 or later. * Licensed under GPLv2 or later.
*/ */
#include <linux/module.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/bitops.h> #include <linux/bitops.h>
...@@ -6158,6 +6158,3 @@ static int __init atlas7_gpio_init(void) ...@@ -6158,6 +6158,3 @@ static int __init atlas7_gpio_init(void)
return platform_driver_register(&atlas7_gpio_driver); return platform_driver_register(&atlas7_gpio_driver);
} }
subsys_initcall(atlas7_gpio_init); subsys_initcall(atlas7_gpio_init);
MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver");
MODULE_LICENSE("GPL");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,6 +5,7 @@ obj-y += pinctrl-sunxi.o ...@@ -5,6 +5,7 @@ obj-y += pinctrl-sunxi.o
obj-$(CONFIG_PINCTRL_SUN4I_A10) += pinctrl-sun4i-a10.o obj-$(CONFIG_PINCTRL_SUN4I_A10) += pinctrl-sun4i-a10.o
obj-$(CONFIG_PINCTRL_SUN5I_A10S) += pinctrl-sun5i-a10s.o obj-$(CONFIG_PINCTRL_SUN5I_A10S) += pinctrl-sun5i-a10s.o
obj-$(CONFIG_PINCTRL_SUN5I_A13) += pinctrl-sun5i-a13.o obj-$(CONFIG_PINCTRL_SUN5I_A13) += pinctrl-sun5i-a13.o
obj-$(CONFIG_PINCTRL_GR8) += pinctrl-gr8.o
obj-$(CONFIG_PINCTRL_SUN6I_A31) += pinctrl-sun6i-a31.o obj-$(CONFIG_PINCTRL_SUN6I_A31) += pinctrl-sun6i-a31.o
obj-$(CONFIG_PINCTRL_SUN6I_A31S) += pinctrl-sun6i-a31s.o obj-$(CONFIG_PINCTRL_SUN6I_A31S) += pinctrl-sun6i-a31s.o
obj-$(CONFIG_PINCTRL_SUN6I_A31_R) += pinctrl-sun6i-a31-r.o obj-$(CONFIG_PINCTRL_SUN6I_A31_R) += pinctrl-sun6i-a31-r.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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