Home
last modified time | relevance | path

Searched refs:bgc (Results 1 – 16 of 16) sorted by relevance

/linux-4.4.14/drivers/gpio/
Dgpio-generic.c127 static unsigned long bgpio_pin2mask(struct bgpio_chip *bgc, unsigned int pin) in bgpio_pin2mask() argument
132 static unsigned long bgpio_pin2mask_be(struct bgpio_chip *bgc, in bgpio_pin2mask_be() argument
135 return 1 << (bgc->bits - 1 - pin); in bgpio_pin2mask_be()
140 struct bgpio_chip *bgc = to_bgpio_chip(gc); in bgpio_get_set() local
141 unsigned long pinmask = bgc->pin2mask(bgc, gpio); in bgpio_get_set()
143 if (bgc->dir & pinmask) in bgpio_get_set()
144 return !!(bgc->read_reg(bgc->reg_set) & pinmask); in bgpio_get_set()
146 return !!(bgc->read_reg(bgc->reg_dat) & pinmask); in bgpio_get_set()
151 struct bgpio_chip *bgc = to_bgpio_chip(gc); in bgpio_get() local
153 return !!(bgc->read_reg(bgc->reg_dat) & bgc->pin2mask(bgc, gpio)); in bgpio_get()
[all …]
Dgpio-moxart.c36 struct bgpio_chip *bgc; in moxart_gpio_probe() local
40 bgc = devm_kzalloc(dev, sizeof(*bgc), GFP_KERNEL); in moxart_gpio_probe()
41 if (!bgc) in moxart_gpio_probe()
49 ret = bgpio_init(bgc, dev, 4, base + GPIO_DATA_IN, in moxart_gpio_probe()
58 bgc->gc.label = "moxart-gpio"; in moxart_gpio_probe()
59 bgc->gc.request = gpiochip_generic_request; in moxart_gpio_probe()
60 bgc->gc.free = gpiochip_generic_free; in moxart_gpio_probe()
61 bgc->data = bgc->read_reg(bgc->reg_set); in moxart_gpio_probe()
62 bgc->gc.base = 0; in moxart_gpio_probe()
63 bgc->gc.ngpio = 32; in moxart_gpio_probe()
[all …]
Dgpio-dwapb.c69 struct bgpio_chip bgc; member
87 to_dwapb_gpio_port(struct bgpio_chip *bgc) in to_dwapb_gpio_port() argument
89 return container_of(bgc, struct dwapb_gpio_port, bgc); in to_dwapb_gpio_port()
94 struct bgpio_chip *bgc = &gpio->ports[0].bgc; in dwapb_read() local
97 return bgc->read_reg(reg_base + offset); in dwapb_read()
103 struct bgpio_chip *bgc = &gpio->ports[0].bgc; in dwapb_write() local
106 bgc->write_reg(reg_base + offset, val); in dwapb_write()
111 struct bgpio_chip *bgc = to_bgpio_chip(gc); in dwapb_gpio_to_irq() local
112 struct dwapb_gpio_port *port = to_dwapb_gpio_port(bgc); in dwapb_gpio_to_irq()
122 if (gpio_get_value(gpio->ports[0].bgc.gc.base + offs)) in dwapb_toggle_trigger()
[all …]
Dgpio-grgpio.c66 struct bgpio_chip bgc; member
97 struct bgpio_chip *bgc = to_bgpio_chip(gc); in grgpio_gc_to_priv() local
99 return container_of(bgc, struct grgpio_priv, bgc); in grgpio_gc_to_priv()
105 struct bgpio_chip *bgc = &priv->bgc; in grgpio_set_imask() local
106 unsigned long mask = bgc->pin2mask(bgc, offset); in grgpio_set_imask()
112 bgc->write_reg(priv->regs + GRGPIO_IMASK, priv->imask); in grgpio_set_imask()
161 spin_lock_irqsave(&priv->bgc.lock, flags); in grgpio_irq_set_type()
163 ipol = priv->bgc.read_reg(priv->regs + GRGPIO_IPOL) & ~mask; in grgpio_irq_set_type()
164 iedge = priv->bgc.read_reg(priv->regs + GRGPIO_IEDGE) & ~mask; in grgpio_irq_set_type()
166 priv->bgc.write_reg(priv->regs + GRGPIO_IPOL, ipol | pol); in grgpio_irq_set_type()
[all …]
Dgpio-clps711x.c22 struct bgpio_chip *bgc; in clps711x_gpio_probe() local
29 bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL); in clps711x_gpio_probe()
30 if (!bgc) in clps711x_gpio_probe()
46 err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL, in clps711x_gpio_probe()
50 err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL, in clps711x_gpio_probe()
61 bgc->gc.ngpio = 3; in clps711x_gpio_probe()
67 bgc->gc.base = id * 8; in clps711x_gpio_probe()
68 bgc->gc.owner = THIS_MODULE; in clps711x_gpio_probe()
69 platform_set_drvdata(pdev, bgc); in clps711x_gpio_probe()
71 return gpiochip_add(&bgc->gc); in clps711x_gpio_probe()
[all …]
Dgpio-xgene-sb.c51 struct bgpio_chip bgc; member
58 struct bgpio_chip *bgc = to_bgpio_chip(gc); in to_xgene_gpio_sb() local
60 return container_of(bgc, struct xgene_gpio_sb, bgc); in to_xgene_gpio_sb()
63 static void xgene_gpio_set_bit(struct bgpio_chip *bgc, void __iomem *reg, u32 gpio, int val) in xgene_gpio_set_bit() argument
67 data = bgc->read_reg(reg); in xgene_gpio_set_bit()
72 bgc->write_reg(reg, data); in xgene_gpio_set_bit()
102 ret = bgpio_init(&priv->bgc, &pdev->dev, 4, in xgene_gpio_sb_probe()
109 priv->bgc.gc.to_irq = apm_gpio_sb_to_irq; in xgene_gpio_sb_probe()
110 priv->bgc.gc.ngpio = XGENE_MAX_GPIO_DS; in xgene_gpio_sb_probe()
121 xgene_gpio_set_bit(&priv->bgc, regs + MPA_GPIO_SEL_LO, in xgene_gpio_sb_probe()
[all …]
Dgpio-ge.c58 struct bgpio_chip *bgc; in gef_gpio_probe() local
62 bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL); in gef_gpio_probe()
63 if (!bgc) in gef_gpio_probe()
70 ret = bgpio_init(bgc, &pdev->dev, 4, regs + GEF_GPIO_IN, in gef_gpio_probe()
79 bgc->gc.label = devm_kstrdup(&pdev->dev, pdev->dev.of_node->full_name, in gef_gpio_probe()
81 if (!bgc->gc.label) { in gef_gpio_probe()
86 bgc->gc.base = -1; in gef_gpio_probe()
87 bgc->gc.ngpio = (u16)(uintptr_t)of_id->data; in gef_gpio_probe()
88 bgc->gc.of_gpio_n_cells = 2; in gef_gpio_probe()
89 bgc->gc.of_node = pdev->dev.of_node; in gef_gpio_probe()
[all …]
Dgpio-brcmstb.c38 struct bgpio_chip bgc; member
63 struct bgpio_chip *bgc = to_bgpio_chip(gc); in brcmstb_gpio_gc_to_bank() local
64 return container_of(bgc, struct brcmstb_gpio_bank, bgc); in brcmstb_gpio_gc_to_bank()
77 struct bgpio_chip *bgc = &bank->bgc; in brcmstb_gpio_set_imask() local
79 u32 mask = bgc->pin2mask(bgc, offset); in brcmstb_gpio_set_imask()
83 spin_lock_irqsave(&bgc->lock, flags); in brcmstb_gpio_set_imask()
84 imask = bgc->read_reg(priv->reg_base + GIO_MASK(bank->id)); in brcmstb_gpio_set_imask()
89 bgc->write_reg(priv->reg_base + GIO_MASK(bank->id), imask); in brcmstb_gpio_set_imask()
90 spin_unlock_irqrestore(&bgc->lock, flags); in brcmstb_gpio_set_imask()
152 spin_lock_irqsave(&bank->bgc.lock, flags); in brcmstb_gpio_irq_set_type()
[all …]
Dgpio-74xx-mmio.c24 struct bgpio_chip bgc; member
83 struct bgpio_chip *bgc = to_bgpio_chip(gc); in to_74xx_gpio() local
85 return container_of(bgc, struct mmio_74xx_gpio_priv, bgc); in to_74xx_gpio()
137 err = bgpio_init(&priv->bgc, &pdev->dev, in mmio_74xx_gpio_probe()
143 priv->bgc.gc.direction_input = mmio_74xx_dir_in; in mmio_74xx_gpio_probe()
144 priv->bgc.gc.direction_output = mmio_74xx_dir_out; in mmio_74xx_gpio_probe()
145 priv->bgc.gc.get_direction = mmio_74xx_get_direction; in mmio_74xx_gpio_probe()
146 priv->bgc.gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags); in mmio_74xx_gpio_probe()
147 priv->bgc.gc.owner = THIS_MODULE; in mmio_74xx_gpio_probe()
151 return gpiochip_add(&priv->bgc.gc); in mmio_74xx_gpio_probe()
[all …]
Dgpio-mxs.c67 struct bgpio_chip bgc; member
96 val = gpio_get_value(port->bgc.gc.base + d->hwirq); in mxs_gpio_set_irq_type()
228 struct bgpio_chip *bgc = to_bgpio_chip(gc); in mxs_gpio_to_irq() local
230 container_of(bgc, struct mxs_gpio_port, bgc); in mxs_gpio_to_irq()
237 struct bgpio_chip *bgc = to_bgpio_chip(gc); in mxs_gpio_get_direction() local
239 container_of(bgc, struct mxs_gpio_port, bgc); in mxs_gpio_get_direction()
333 err = bgpio_init(&port->bgc, &pdev->dev, 4, in mxs_gpio_probe()
341 port->bgc.gc.to_irq = mxs_gpio_to_irq; in mxs_gpio_probe()
342 port->bgc.gc.get_direction = mxs_gpio_get_direction; in mxs_gpio_probe()
343 port->bgc.gc.base = port->id * 32; in mxs_gpio_probe()
[all …]
Dgpio-etraxfs.c70 struct bgpio_chip bgc; member
181 return container_of(gc, struct etraxfs_gpio_chip, bgc.gc); in to_etraxfs()
223 return 4 * etraxfs_gpio_chip_to_port(&chip->bgc.gc) + gpio / 8; in etraxfs_gpio_to_group_pin()
311 ret = gpiochip_lock_as_irq(&chip->bgc.gc, d->hwirq); in etraxfs_gpio_irq_request_resources()
339 gpiochip_unlock_as_irq(&chip->bgc.gc, d->hwirq); in etraxfs_gpio_irq_release_resources()
422 struct bgpio_chip *bgc = &chip->bgc; in etraxfs_gpio_probe() local
436 ret = bgpio_init(bgc, dev, 4, in etraxfs_gpio_probe()
445 bgc->gc.ngpio = port->ngpio; in etraxfs_gpio_probe()
446 bgc->gc.label = port->label; in etraxfs_gpio_probe()
448 bgc->gc.of_node = dev->of_node; in etraxfs_gpio_probe()
[all …]
Dgpio-ep93xx.c31 struct bgpio_chip bgc[8]; member
322 static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, in ep93xx_gpio_add_bank() argument
329 err = bgpio_init(bgc, dev, 1, data, NULL, NULL, dir, NULL, 0); in ep93xx_gpio_add_bank()
333 bgc->gc.label = bank->label; in ep93xx_gpio_add_bank()
334 bgc->gc.base = bank->base; in ep93xx_gpio_add_bank()
337 bgc->gc.set_debounce = ep93xx_gpio_set_debounce; in ep93xx_gpio_add_bank()
338 bgc->gc.to_irq = ep93xx_gpio_to_irq; in ep93xx_gpio_add_bank()
341 return gpiochip_add(&bgc->gc); in ep93xx_gpio_add_bank()
361 struct bgpio_chip *bgc = &ep93xx_gpio->bgc[i]; in ep93xx_gpio_probe() local
364 if (ep93xx_gpio_add_bank(bgc, &pdev->dev, in ep93xx_gpio_probe()
Dgpio-mxc.c67 struct bgpio_chip bgc; member
175 u32 gpio = port->bgc.gc.base + gpio_idx; in gpio_set_irq_type()
401 struct bgpio_chip *bgc = to_bgpio_chip(gc); in mxc_gpio_to_irq() local
403 container_of(bgc, struct mxc_gpio_port, bgc); in mxc_gpio_to_irq()
454 err = bgpio_init(&port->bgc, &pdev->dev, 4, in mxc_gpio_probe()
462 port->bgc.gc.to_irq = mxc_gpio_to_irq; in mxc_gpio_probe()
463 port->bgc.gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : in mxc_gpio_probe()
466 err = gpiochip_add(&port->bgc.gc); in mxc_gpio_probe()
497 gpiochip_remove(&port->bgc.gc); in mxc_gpio_probe()
499 bgpio_remove(&port->bgc); in mxc_gpio_probe()
/linux-4.4.14/drivers/irqchip/
Dirq-atmel-aic5.c73 struct irq_chip_generic *bgc = irq_get_domain_generic_chip(aic5_domain, 0); in aic5_handle() local
77 irqnr = irq_reg_readl(bgc, AT91_AIC5_IVR); in aic5_handle()
78 irqstat = irq_reg_readl(bgc, AT91_AIC5_ISR); in aic5_handle()
81 irq_reg_writel(bgc, 0, AT91_AIC5_EOICR); in aic5_handle()
89 struct irq_chip_generic *bgc = irq_get_domain_generic_chip(domain, 0); in aic5_mask() local
96 irq_gc_lock(bgc); in aic5_mask()
100 irq_gc_unlock(bgc); in aic5_mask()
106 struct irq_chip_generic *bgc = irq_get_domain_generic_chip(domain, 0); in aic5_unmask() local
113 irq_gc_lock(bgc); in aic5_unmask()
117 irq_gc_unlock(bgc); in aic5_unmask()
[all …]
/linux-4.4.14/include/linux/
Dbasic_mmio_gpio.h47 unsigned long (*pin2mask)(struct bgpio_chip *bgc, unsigned int pin);
67 int bgpio_remove(struct bgpio_chip *bgc);
68 int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
/linux-4.4.14/drivers/video/fbdev/
Dimsttfb.c994 __u32 Bpp, line_pitch, bgc, dx, dy, width, height; in imsttfb_fillrect() local
996 bgc = rect->color; in imsttfb_fillrect()
997 bgc |= (bgc << 8); in imsttfb_fillrect()
998 bgc |= (bgc << 16); in imsttfb_fillrect()
1017 write_reg_le32(par->dc_regs, CLR, bgc); in imsttfb_fillrect()