• Home
  • Raw
  • Download

Lines Matching +full:invert +full:- +full:enable

6  *  This is a re-write of Christophe Kerello's PMU driver.
13 #include <dt-bindings/interrupt-controller/irq-st.h>
51 .compatible = "st,stih415-irq-syscfg",
55 .compatible = "st,stih416-irq-syscfg",
59 .compatible = "st,stih407-irq-syscfg",
63 .compatible = "st,stid127-irq-syscfg",
72 struct st_irq_syscfg *ddata = dev_get_drvdata(&pdev->dev); in st_irq_xlate()
74 /* Set the device enable bit. */ in st_irq_xlate()
77 ddata->config |= ST_A9_IRQ_EN_EXT_0; in st_irq_xlate()
80 ddata->config |= ST_A9_IRQ_EN_EXT_1; in st_irq_xlate()
83 ddata->config |= ST_A9_IRQ_EN_EXT_2; in st_irq_xlate()
86 ddata->config |= ST_A9_IRQ_EN_CTI_0; in st_irq_xlate()
89 ddata->config |= ST_A9_IRQ_EN_CTI_1; in st_irq_xlate()
92 ddata->config |= ST_A9_IRQ_EN_PMU_0; in st_irq_xlate()
95 ddata->config |= ST_A9_IRQ_EN_PMU_1; in st_irq_xlate()
98 ddata->config |= ST_A9_IRQ_EN_PL310_L2; in st_irq_xlate()
103 dev_err(&pdev->dev, "Unrecognised device %d\n", device); in st_irq_xlate()
104 return -EINVAL; in st_irq_xlate()
108 ddata->config |= irq ? in st_irq_xlate()
117 struct device_node *np = pdev->dev.of_node; in st_irq_syscfg_enable()
118 struct st_irq_syscfg *ddata = dev_get_drvdata(&pdev->dev); in st_irq_syscfg_enable()
120 u32 device, invert; in st_irq_syscfg_enable() local
122 channels = of_property_count_u32_elems(np, "st,irq-device"); in st_irq_syscfg_enable()
124 dev_err(&pdev->dev, "st,enable-irq-device must have 2 elems\n"); in st_irq_syscfg_enable()
125 return -EINVAL; in st_irq_syscfg_enable()
128 channels = of_property_count_u32_elems(np, "st,fiq-device"); in st_irq_syscfg_enable()
130 dev_err(&pdev->dev, "st,enable-fiq-device must have 2 elems\n"); in st_irq_syscfg_enable()
131 return -EINVAL; in st_irq_syscfg_enable()
135 of_property_read_u32_index(np, "st,irq-device", i, &device); in st_irq_syscfg_enable()
141 of_property_read_u32_index(np, "st,fiq-device", i, &device); in st_irq_syscfg_enable()
149 of_property_read_u32(np, "st,invert-ext", &invert); in st_irq_syscfg_enable()
150 ddata->config |= ST_A9_EXTIRQ_INV_SEL(invert); in st_irq_syscfg_enable()
152 return regmap_update_bits(ddata->regmap, ddata->syscfg, in st_irq_syscfg_enable()
153 ST_A9_IRQ_MASK, ddata->config); in st_irq_syscfg_enable()
158 struct device_node *np = pdev->dev.of_node; in st_irq_syscfg_probe()
162 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); in st_irq_syscfg_probe()
164 return -ENOMEM; in st_irq_syscfg_probe()
166 match = of_match_device(st_irq_syscfg_match, &pdev->dev); in st_irq_syscfg_probe()
168 return -ENODEV; in st_irq_syscfg_probe()
170 ddata->syscfg = (unsigned int)match->data; in st_irq_syscfg_probe()
172 ddata->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); in st_irq_syscfg_probe()
173 if (IS_ERR(ddata->regmap)) { in st_irq_syscfg_probe()
174 dev_err(&pdev->dev, "syscfg phandle missing\n"); in st_irq_syscfg_probe()
175 return PTR_ERR(ddata->regmap); in st_irq_syscfg_probe()
178 dev_set_drvdata(&pdev->dev, ddata); in st_irq_syscfg_probe()
187 return regmap_update_bits(ddata->regmap, ddata->syscfg, in st_irq_syscfg_resume()
188 ST_A9_IRQ_MASK, ddata->config); in st_irq_syscfg_resume()