Lines Matching refs:cc
24 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
26 return !!bcma_chipco_gpio_in(cc, 1 << gpio);
32 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
34 bcma_chipco_gpio_out(cc, 1 << gpio, value ? 1 << gpio : 0);
41 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
43 bcma_chipco_gpio_outen(cc, 1 << gpio, 0);
50 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
52 bcma_chipco_gpio_outen(cc, 1 << gpio, 1 << gpio);
53 bcma_chipco_gpio_out(cc, 1 << gpio, value ? 1 << gpio : 0);
59 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
61 bcma_chipco_gpio_control(cc, 1 << gpio, 0);
63 bcma_chipco_gpio_pulldown(cc, 1 << gpio, 0);
65 bcma_chipco_gpio_pullup(cc, 1 << gpio, 1 << gpio);
72 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
75 bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
83 struct bcma_drv_cc *cc = gpiochip_get_data(gc);
85 u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
88 bcma_chipco_gpio_polarity(cc, BIT(gpio), val);
89 bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio));
95 struct bcma_drv_cc *cc = gpiochip_get_data(gc);
98 bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
112 struct bcma_drv_cc *cc = dev_id;
113 struct gpio_chip *gc = &cc->gpio;
114 u32 val = bcma_cc_read32(cc, BCMA_CC_GPIOIN);
115 u32 mask = bcma_cc_read32(cc, BCMA_CC_GPIOIRQ);
116 u32 pol = bcma_cc_read32(cc, BCMA_CC_GPIOPOL);
125 bcma_chipco_gpio_polarity(cc, irqs, val & irqs);
130 static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
132 struct gpio_chip *chip = &cc->gpio;
136 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
139 hwirq = bcma_core_irq(cc->core, 0);
141 cc);
145 bcma_chipco_gpio_intmask(cc, ~0, 0);
146 bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
159 static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc)
161 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
164 bcma_cc_mask32(cc, BCMA_CC_IRQMASK, ~BCMA_CC_IRQ_GPIO);
165 free_irq(bcma_core_irq(cc->core, 0), cc);
168 static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
173 static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc)
178 int bcma_gpio_init(struct bcma_drv_cc *cc)
180 struct bcma_bus *bus = cc->core->bus;
181 struct gpio_chip *chip = &cc->gpio;
193 chip->fwnode = dev_fwnode(&cc->core->dev);
215 cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
220 err = bcma_gpio_irq_init(cc);
224 err = gpiochip_add_data(chip, cc);
226 bcma_gpio_irq_exit(cc);
233 int bcma_gpio_unregister(struct bcma_drv_cc *cc)
235 bcma_gpio_irq_exit(cc);
236 gpiochip_remove(&cc->gpio);