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);
39 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
41 bcma_chipco_gpio_outen(cc, 1 << gpio, 0);
48 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
50 bcma_chipco_gpio_outen(cc, 1 << gpio, 1 << gpio);
51 bcma_chipco_gpio_out(cc, 1 << gpio, value ? 1 << gpio : 0);
57 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
59 bcma_chipco_gpio_control(cc, 1 << gpio, 0);
61 bcma_chipco_gpio_pulldown(cc, 1 << gpio, 0);
63 bcma_chipco_gpio_pullup(cc, 1 << gpio, 1 << gpio);
70 struct bcma_drv_cc *cc = gpiochip_get_data(chip);
73 bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
81 struct bcma_drv_cc *cc = gpiochip_get_data(gc);
83 u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
86 bcma_chipco_gpio_polarity(cc, BIT(gpio), val);
87 bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio));
93 struct bcma_drv_cc *cc = gpiochip_get_data(gc);
96 bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
110 struct bcma_drv_cc *cc = dev_id;
111 struct gpio_chip *gc = &cc->gpio;
112 u32 val = bcma_cc_read32(cc, BCMA_CC_GPIOIN);
113 u32 mask = bcma_cc_read32(cc, BCMA_CC_GPIOIRQ);
114 u32 pol = bcma_cc_read32(cc, BCMA_CC_GPIOPOL);
123 bcma_chipco_gpio_polarity(cc, irqs, val & irqs);
128 static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
130 struct gpio_chip *chip = &cc->gpio;
134 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
137 hwirq = bcma_core_irq(cc->core, 0);
139 cc);
143 bcma_chipco_gpio_intmask(cc, ~0, 0);
144 bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
157 static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc)
159 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
162 bcma_cc_mask32(cc, BCMA_CC_IRQMASK, ~BCMA_CC_IRQ_GPIO);
163 free_irq(bcma_core_irq(cc->core, 0), cc);
166 static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
171 static void bcma_gpio_irq_exit(struct bcma_drv_cc *cc)
176 int bcma_gpio_init(struct bcma_drv_cc *cc)
178 struct bcma_bus *bus = cc->core->bus;
179 struct gpio_chip *chip = &cc->gpio;
191 chip->fwnode = dev_fwnode(&cc->core->dev);
213 cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
218 err = bcma_gpio_irq_init(cc);
222 err = gpiochip_add_data(chip, cc);
224 bcma_gpio_irq_exit(cc);
231 int bcma_gpio_unregister(struct bcma_drv_cc *cc)
233 bcma_gpio_irq_exit(cc);
234 gpiochip_remove(&cc->gpio);