From 894db164260c39870ea79e473e1307b4aa5e4257 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 13 Jun 2013 11:23:38 +0200 Subject: irqchip: renesas-intc-irqpin: DT binding for sense bitfield width Most Renesas irqpin controllers have 4-bit sense fields, however, some have different widths. This patch adds a DT binding to optionally specify such non-standard values. Signed-off-by: Guennadi Liakhovetski Acked-by: Arnd Bergmann Signed-off-by: Simon Horman diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt new file mode 100644 index 0000000..66fcaf5 --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt @@ -0,0 +1,14 @@ +DT bindings for the R-/SH-Mobile irqpin controller + +Required properties: + +- compatible: has to be "renesas,intc-irqpin" +- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in + interrupts.txt in this directory + +Optional properties: + +- any properties, listed in interrupts.txt, and any standard resource allocation + properties +- sense-bitfield-width: width of a single sense bitfield in the SENSE register, + if different from the default 4 bits diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 5a68e5a..4aca1b2 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -349,6 +350,9 @@ static int intc_irqpin_probe(struct platform_device *pdev) /* deal with driver instance configuration */ if (pdata) memcpy(&p->config, pdata, sizeof(*pdata)); + else + of_property_read_u32(pdev->dev.of_node, "sense-bitfield-width", + &p->config.sense_bitfield_width); if (!p->config.sense_bitfield_width) p->config.sense_bitfield_width = 4; /* default to 4 bits */ -- cgit v0.10.2 From 561a1a31d232d0f2b1ce7b7480bd03aba97e818d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 6 Jun 2013 17:38:12 +0200 Subject: ARM: shmobile: sh73a0: remove "0x" prefix from DT node names The convention for Device Tree node names is @, where the part after '@' shouldn't contain the "0x" prefix. Fix the sh73a0.dtsi DT names. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Simon Horman diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index ec40bf7..b977502 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi @@ -119,7 +119,7 @@ 0 32 0x4>; }; - i2c0: i2c@0xe6820000 { + i2c0: i2c@e6820000 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,rmobile-iic"; @@ -131,7 +131,7 @@ 0 170 0x4>; }; - i2c1: i2c@0xe6822000 { + i2c1: i2c@e6822000 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,rmobile-iic"; @@ -143,7 +143,7 @@ 0 54 0x4>; }; - i2c2: i2c@0xe6824000 { + i2c2: i2c@e6824000 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,rmobile-iic"; @@ -155,7 +155,7 @@ 0 174 0x4>; }; - i2c3: i2c@0xe6826000 { + i2c3: i2c@e6826000 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,rmobile-iic"; @@ -167,7 +167,7 @@ 0 186 0x4>; }; - i2c4: i2c@0xe6828000 { + i2c4: i2c@e6828000 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,rmobile-iic"; @@ -179,7 +179,7 @@ 0 190 0x4>; }; - mmcif: mmcif@0x10010000 { + mmcif: mmcif@e6bd0000 { compatible = "renesas,sh-mmcif"; reg = <0xe6bd0000 0x100>; interrupt-parent = <&gic>; @@ -189,7 +189,7 @@ status = "disabled"; }; - sdhi0: sdhi@0xee100000 { + sdhi0: sdhi@ee100000 { compatible = "renesas,r8a7740-sdhi"; reg = <0xee100000 0x100>; interrupt-parent = <&gic>; @@ -201,7 +201,7 @@ }; /* SDHI1 and SDHI2 have no CD pins, no need for CD IRQ */ - sdhi1: sdhi@0xee120000 { + sdhi1: sdhi@ee120000 { compatible = "renesas,r8a7740-sdhi"; reg = <0xee120000 0x100>; interrupt-parent = <&gic>; @@ -212,7 +212,7 @@ status = "disabled"; }; - sdhi2: sdhi@0xee140000 { + sdhi2: sdhi@ee140000 { compatible = "renesas,r8a7740-sdhi"; reg = <0xee140000 0x100>; interrupt-parent = <&gic>; -- cgit v0.10.2 From c4fa4946f177ae214523586cd794ac18d34b1430 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 19 Jun 2013 07:53:09 +0200 Subject: ARM: shmobile: irqpin: add a DT property to enable masking on parent To disable spurious interrupts, that get triggered on certain hardware, the irqpin driver masks them on the parent interrupt controller. To specify such broken devices a .control_parent parameter can be provided in the platform data. In the DT case we need a property, to do the same. Signed-off-by: Guennadi Liakhovetski Acked-by: Magnus Damm Signed-off-by: Simon Horman diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt index 66fcaf5..1f8b0c5 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt @@ -12,3 +12,5 @@ Optional properties: properties - sense-bitfield-width: width of a single sense bitfield in the SENSE register, if different from the default 4 bits +- control-parent: disable and enable interrupts on the parent interrupt + controller, needed for some broken implementations diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 4aca1b2..82cec63 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c @@ -348,11 +348,14 @@ static int intc_irqpin_probe(struct platform_device *pdev) } /* deal with driver instance configuration */ - if (pdata) + if (pdata) { memcpy(&p->config, pdata, sizeof(*pdata)); - else + } else { of_property_read_u32(pdev->dev.of_node, "sense-bitfield-width", &p->config.sense_bitfield_width); + p->config.control_parent = of_property_read_bool(pdev->dev.of_node, + "control-parent"); + } if (!p->config.sense_bitfield_width) p->config.sense_bitfield_width = 4; /* default to 4 bits */ -- cgit v0.10.2