1*cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*cb7aa33aSEmmanuel Vadot# Copyright 2022 Unisoc Inc. 3*cb7aa33aSEmmanuel Vadot%YAML 1.2 4*cb7aa33aSEmmanuel Vadot--- 5*cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/sprd,gpio-eic.yaml# 6*cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7*cb7aa33aSEmmanuel Vadot 8*cb7aa33aSEmmanuel Vadottitle: Unisoc EIC controller 9*cb7aa33aSEmmanuel Vadot 10*cb7aa33aSEmmanuel Vadotmaintainers: 11*cb7aa33aSEmmanuel Vadot - Orson Zhai <orsonzhai@gmail.com> 12*cb7aa33aSEmmanuel Vadot - Baolin Wang <baolin.wang7@gmail.com> 13*cb7aa33aSEmmanuel Vadot - Chunyan Zhang <zhang.lyra@gmail.com> 14*cb7aa33aSEmmanuel Vadot 15*cb7aa33aSEmmanuel Vadotdescription: | 16*cb7aa33aSEmmanuel Vadot The EIC is the abbreviation of external interrupt controller, which can 17*cb7aa33aSEmmanuel Vadot be used only in input mode. The Spreadtrum platform has 2 EIC controllers, 18*cb7aa33aSEmmanuel Vadot one is in digital chip, and another one is in PMIC. The digital chip EIC 19*cb7aa33aSEmmanuel Vadot controller contains 4 sub-modules, i.e. EIC-debounce, EIC-latch, EIC-async and 20*cb7aa33aSEmmanuel Vadot EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub- 21*cb7aa33aSEmmanuel Vadot module. 22*cb7aa33aSEmmanuel Vadot 23*cb7aa33aSEmmanuel Vadot The EIC-debounce sub-module provides up to 8 source input signal 24*cb7aa33aSEmmanuel Vadot connections. A debounce mechanism is used to capture the input signals' 25*cb7aa33aSEmmanuel Vadot stable status (millisecond resolution) and a single-trigger mechanism 26*cb7aa33aSEmmanuel Vadot is introduced into this sub-module to enhance the input event detection 27*cb7aa33aSEmmanuel Vadot reliability. In addition, this sub-module's clock can be shut off 28*cb7aa33aSEmmanuel Vadot automatically to reduce power dissipation. Moreover the debounce range 29*cb7aa33aSEmmanuel Vadot is from 1ms to 4s with a step size of 1ms. The input signal will be 30*cb7aa33aSEmmanuel Vadot ignored if it is asserted for less than 1 ms. 31*cb7aa33aSEmmanuel Vadot 32*cb7aa33aSEmmanuel Vadot The EIC-latch sub-module is used to latch some special power down signals 33*cb7aa33aSEmmanuel Vadot and generate interrupts, since the EIC-latch does not depend on the APB 34*cb7aa33aSEmmanuel Vadot clock to capture signals. 35*cb7aa33aSEmmanuel Vadot 36*cb7aa33aSEmmanuel Vadot The EIC-async sub-module uses a 32kHz clock to capture the short signals 37*cb7aa33aSEmmanuel Vadot (microsecond resolution) to generate interrupts by level or edge trigger. 38*cb7aa33aSEmmanuel Vadot 39*cb7aa33aSEmmanuel Vadot The EIC-sync is similar with GPIO's input function, which is a synchronized 40*cb7aa33aSEmmanuel Vadot signal input register. It can generate interrupts by level or edge trigger 41*cb7aa33aSEmmanuel Vadot when detecting input signals. 42*cb7aa33aSEmmanuel Vadot 43*cb7aa33aSEmmanuel Vadotproperties: 44*cb7aa33aSEmmanuel Vadot compatible: 45*cb7aa33aSEmmanuel Vadot oneOf: 46*cb7aa33aSEmmanuel Vadot - enum: 47*cb7aa33aSEmmanuel Vadot - sprd,sc9860-eic-debounce 48*cb7aa33aSEmmanuel Vadot - sprd,sc9860-eic-latch 49*cb7aa33aSEmmanuel Vadot - sprd,sc9860-eic-async 50*cb7aa33aSEmmanuel Vadot - sprd,sc9860-eic-sync 51*cb7aa33aSEmmanuel Vadot - sprd,sc2731-eic 52*cb7aa33aSEmmanuel Vadot - items: 53*cb7aa33aSEmmanuel Vadot - enum: 54*cb7aa33aSEmmanuel Vadot - sprd,ums512-eic-debounce 55*cb7aa33aSEmmanuel Vadot - const: sprd,sc9860-eic-debounce 56*cb7aa33aSEmmanuel Vadot - items: 57*cb7aa33aSEmmanuel Vadot - enum: 58*cb7aa33aSEmmanuel Vadot - sprd,ums512-eic-latch 59*cb7aa33aSEmmanuel Vadot - const: sprd,sc9860-eic-latch 60*cb7aa33aSEmmanuel Vadot - items: 61*cb7aa33aSEmmanuel Vadot - enum: 62*cb7aa33aSEmmanuel Vadot - sprd,ums512-eic-async 63*cb7aa33aSEmmanuel Vadot - const: sprd,sc9860-eic-async 64*cb7aa33aSEmmanuel Vadot - items: 65*cb7aa33aSEmmanuel Vadot - enum: 66*cb7aa33aSEmmanuel Vadot - sprd,ums512-eic-sync 67*cb7aa33aSEmmanuel Vadot - const: sprd,sc9860-eic-sync 68*cb7aa33aSEmmanuel Vadot - items: 69*cb7aa33aSEmmanuel Vadot - enum: 70*cb7aa33aSEmmanuel Vadot - sprd,sc2730-eic 71*cb7aa33aSEmmanuel Vadot - const: sprd,sc2731-eic 72*cb7aa33aSEmmanuel Vadot 73*cb7aa33aSEmmanuel Vadot reg: 74*cb7aa33aSEmmanuel Vadot minItems: 1 75*cb7aa33aSEmmanuel Vadot maxItems: 3 76*cb7aa33aSEmmanuel Vadot description: 77*cb7aa33aSEmmanuel Vadot EIC controller can support maximum 3 banks which has its own 78*cb7aa33aSEmmanuel Vadot address base. 79*cb7aa33aSEmmanuel Vadot 80*cb7aa33aSEmmanuel Vadot gpio-controller: true 81*cb7aa33aSEmmanuel Vadot 82*cb7aa33aSEmmanuel Vadot "#gpio-cells": 83*cb7aa33aSEmmanuel Vadot const: 2 84*cb7aa33aSEmmanuel Vadot 85*cb7aa33aSEmmanuel Vadot interrupt-controller: true 86*cb7aa33aSEmmanuel Vadot 87*cb7aa33aSEmmanuel Vadot "#interrupt-cells": 88*cb7aa33aSEmmanuel Vadot const: 2 89*cb7aa33aSEmmanuel Vadot 90*cb7aa33aSEmmanuel Vadot interrupts: 91*cb7aa33aSEmmanuel Vadot maxItems: 1 92*cb7aa33aSEmmanuel Vadot description: 93*cb7aa33aSEmmanuel Vadot The interrupt shared by all GPIO lines for this controller. 94*cb7aa33aSEmmanuel Vadot 95*cb7aa33aSEmmanuel Vadotrequired: 96*cb7aa33aSEmmanuel Vadot - compatible 97*cb7aa33aSEmmanuel Vadot - reg 98*cb7aa33aSEmmanuel Vadot - gpio-controller 99*cb7aa33aSEmmanuel Vadot - "#gpio-cells" 100*cb7aa33aSEmmanuel Vadot - interrupt-controller 101*cb7aa33aSEmmanuel Vadot - "#interrupt-cells" 102*cb7aa33aSEmmanuel Vadot - interrupts 103*cb7aa33aSEmmanuel Vadot 104*cb7aa33aSEmmanuel VadotadditionalProperties: false 105*cb7aa33aSEmmanuel Vadot 106*cb7aa33aSEmmanuel Vadotexamples: 107*cb7aa33aSEmmanuel Vadot - | 108*cb7aa33aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 109*cb7aa33aSEmmanuel Vadot 110*cb7aa33aSEmmanuel Vadot soc { 111*cb7aa33aSEmmanuel Vadot #address-cells = <2>; 112*cb7aa33aSEmmanuel Vadot #size-cells = <2>; 113*cb7aa33aSEmmanuel Vadot 114*cb7aa33aSEmmanuel Vadot eic_debounce: gpio@40210000 { 115*cb7aa33aSEmmanuel Vadot compatible = "sprd,sc9860-eic-debounce"; 116*cb7aa33aSEmmanuel Vadot reg = <0 0x40210000 0 0x80>; 117*cb7aa33aSEmmanuel Vadot gpio-controller; 118*cb7aa33aSEmmanuel Vadot #gpio-cells = <2>; 119*cb7aa33aSEmmanuel Vadot interrupt-controller; 120*cb7aa33aSEmmanuel Vadot #interrupt-cells = <2>; 121*cb7aa33aSEmmanuel Vadot interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; 122*cb7aa33aSEmmanuel Vadot }; 123*cb7aa33aSEmmanuel Vadot }; 124*cb7aa33aSEmmanuel Vadot... 125