Lines Matching +full:bcm63xx +full:- +full:gpio

17 #include <linux/gpio.h>
36 return bcm_readl(skt->base + off); in pcmcia_readl()
42 bcm_writel(val, skt->base + off); in pcmcia_writel()
46 * This callback should (re-)initialise the socket, turn on status
69 * Implements the set_socket() operation for the in-kernel PCMCIA
82 skt = sock->driver_data; in bcm63xx_pcmcia_set_socket()
84 spin_lock_irqsave(&skt->lock, flags); in bcm63xx_pcmcia_set_socket()
91 if (state->flags & SS_RESET) in bcm63xx_pcmcia_set_socket()
97 if (skt->card_detected && (skt->card_type & CARD_CARDBUS)) in bcm63xx_pcmcia_set_socket()
103 skt->requested_state = *state; in bcm63xx_pcmcia_set_socket()
105 spin_unlock_irqrestore(&skt->lock, flags); in bcm63xx_pcmcia_set_socket()
176 if ((stat & SS_DETECT) && !skt->card_detected) { in __get_socket_status()
213 skt->card_type = vscd_to_cardtype[stat]; in __get_socket_status()
214 if (!skt->card_type) in __get_socket_status()
215 dev_err(&skt->socket.dev, "unsupported card type\n"); in __get_socket_status()
222 if (skt->card_type & CARD_PCCARD) in __get_socket_status()
229 skt->card_detected = (stat & SS_DETECT) ? 1 : 0; in __get_socket_status()
232 if (skt->card_type & CARD_CARDBUS) in __get_socket_status()
234 if (skt->card_type & CARD_3V) in __get_socket_status()
236 if (skt->card_type & CARD_XV) in __get_socket_status()
240 if (gpio_get_value(skt->pd->ready_gpio)) in __get_socket_status()
254 skt = sock->driver_data; in bcm63xx_pcmcia_get_status()
256 spin_lock_bh(&skt->lock); in bcm63xx_pcmcia_get_status()
258 spin_unlock_bh(&skt->lock); in bcm63xx_pcmcia_get_status()
273 spin_lock_bh(&skt->lock); in bcm63xx_pcmcia_poll()
279 events = (stat ^ skt->old_status) & skt->requested_state.csc_mask; in bcm63xx_pcmcia_poll()
280 skt->old_status = stat; in bcm63xx_pcmcia_poll()
281 spin_unlock_bh(&skt->lock); in bcm63xx_pcmcia_poll()
284 pcmcia_parse_events(&skt->socket, events); in bcm63xx_pcmcia_poll()
286 mod_timer(&skt->timer, in bcm63xx_pcmcia_poll()
304 skt = sock->driver_data; in bcm63xx_pcmcia_set_mem_map()
305 if (map->flags & MAP_ATTRIB) in bcm63xx_pcmcia_set_mem_map()
306 res = skt->attr_res; in bcm63xx_pcmcia_set_mem_map()
308 res = skt->common_res; in bcm63xx_pcmcia_set_mem_map()
310 map->static_start = res->start + map->card_start; in bcm63xx_pcmcia_set_mem_map()
338 return -ENOMEM; in bcm63xx_drv_pcmcia_probe()
339 spin_lock_init(&skt->lock); in bcm63xx_drv_pcmcia_probe()
340 sock = &skt->socket; in bcm63xx_drv_pcmcia_probe()
341 sock->driver_data = skt; in bcm63xx_drv_pcmcia_probe()
344 skt->common_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); in bcm63xx_drv_pcmcia_probe()
345 skt->attr_res = platform_get_resource(pdev, IORESOURCE_MEM, 2); in bcm63xx_drv_pcmcia_probe()
347 skt->pd = pdev->dev.platform_data; in bcm63xx_drv_pcmcia_probe()
348 if (!skt->common_res || !skt->attr_res || (irq < 0) || !skt->pd) { in bcm63xx_drv_pcmcia_probe()
349 ret = -EINVAL; in bcm63xx_drv_pcmcia_probe()
356 if (!request_mem_region(res->start, regmem_size, "bcm63xx_pcmcia")) { in bcm63xx_drv_pcmcia_probe()
357 ret = -EINVAL; in bcm63xx_drv_pcmcia_probe()
360 skt->reg_res = res; in bcm63xx_drv_pcmcia_probe()
362 skt->base = ioremap(res->start, regmem_size); in bcm63xx_drv_pcmcia_probe()
363 if (!skt->base) { in bcm63xx_drv_pcmcia_probe()
364 ret = -ENOMEM; in bcm63xx_drv_pcmcia_probe()
371 skt->io_base = ioremap(res->start, iomem_size); in bcm63xx_drv_pcmcia_probe()
372 if (!skt->io_base) { in bcm63xx_drv_pcmcia_probe()
373 ret = -ENOMEM; in bcm63xx_drv_pcmcia_probe()
378 sock->resource_ops = &pccard_static_ops; in bcm63xx_drv_pcmcia_probe()
379 sock->ops = &bcm63xx_pcmcia_operations; in bcm63xx_drv_pcmcia_probe()
380 sock->owner = THIS_MODULE; in bcm63xx_drv_pcmcia_probe()
381 sock->dev.parent = &pdev->dev; in bcm63xx_drv_pcmcia_probe()
382 sock->features = SS_CAP_STATIC_MAP | SS_CAP_PCCARD; in bcm63xx_drv_pcmcia_probe()
383 sock->io_offset = (unsigned long)skt->io_base; in bcm63xx_drv_pcmcia_probe()
384 sock->pci_irq = irq; in bcm63xx_drv_pcmcia_probe()
387 sock->cb_dev = bcm63xx_cb_dev; in bcm63xx_drv_pcmcia_probe()
389 sock->features |= SS_CAP_CARDBUS; in bcm63xx_drv_pcmcia_probe()
393 sock->map_size = resource_size(skt->common_res); in bcm63xx_drv_pcmcia_probe()
396 timer_setup(&skt->timer, bcm63xx_pcmcia_poll, 0); in bcm63xx_drv_pcmcia_probe()
423 mod_timer(&skt->timer, in bcm63xx_drv_pcmcia_probe()
430 if (skt->io_base) in bcm63xx_drv_pcmcia_probe()
431 iounmap(skt->io_base); in bcm63xx_drv_pcmcia_probe()
432 if (skt->base) in bcm63xx_drv_pcmcia_probe()
433 iounmap(skt->base); in bcm63xx_drv_pcmcia_probe()
434 if (skt->reg_res) in bcm63xx_drv_pcmcia_probe()
435 release_mem_region(skt->reg_res->start, regmem_size); in bcm63xx_drv_pcmcia_probe()
446 timer_shutdown_sync(&skt->timer); in bcm63xx_drv_pcmcia_remove()
447 iounmap(skt->base); in bcm63xx_drv_pcmcia_remove()
448 iounmap(skt->io_base); in bcm63xx_drv_pcmcia_remove()
449 res = skt->reg_res; in bcm63xx_drv_pcmcia_remove()
450 release_mem_region(res->start, resource_size(res)); in bcm63xx_drv_pcmcia_remove()
536 MODULE_DESCRIPTION("Linux PCMCIA Card Services: bcm63xx Socket Controller");