Lines Matching refs:image
340 static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, in ca91cx42_slave_set() argument
350 ca91cx42_bridge = image->parent; in ca91cx42_slave_set()
354 i = image->number; in ca91cx42_slave_set()
446 static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled, in ca91cx42_slave_get() argument
454 bridge = image->parent->driver_priv; in ca91cx42_slave_get()
456 i = image->number; in ca91cx42_slave_get()
506 static int ca91cx42_alloc_resource(struct vme_master_resource *image, in ca91cx42_alloc_resource() argument
514 ca91cx42_bridge = image->parent; in ca91cx42_alloc_resource()
523 existing_size = (unsigned long long)(image->bus_resource.end - in ca91cx42_alloc_resource()
524 image->bus_resource.start); in ca91cx42_alloc_resource()
531 iounmap(image->kern_base); in ca91cx42_alloc_resource()
532 image->kern_base = NULL; in ca91cx42_alloc_resource()
533 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
534 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
535 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_alloc_resource()
538 if (image->bus_resource.name == NULL) { in ca91cx42_alloc_resource()
539 image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC); in ca91cx42_alloc_resource()
540 if (image->bus_resource.name == NULL) { in ca91cx42_alloc_resource()
548 sprintf((char *)image->bus_resource.name, "%s.%d", in ca91cx42_alloc_resource()
549 ca91cx42_bridge->name, image->number); in ca91cx42_alloc_resource()
551 image->bus_resource.start = 0; in ca91cx42_alloc_resource()
552 image->bus_resource.end = (unsigned long)size; in ca91cx42_alloc_resource()
553 image->bus_resource.flags = IORESOURCE_MEM; in ca91cx42_alloc_resource()
556 &image->bus_resource, size, 0x10000, PCIBIOS_MIN_MEM, in ca91cx42_alloc_resource()
561 image->number, (unsigned long)size, in ca91cx42_alloc_resource()
562 (unsigned long)image->bus_resource.start); in ca91cx42_alloc_resource()
566 image->kern_base = ioremap_nocache( in ca91cx42_alloc_resource()
567 image->bus_resource.start, size); in ca91cx42_alloc_resource()
568 if (image->kern_base == NULL) { in ca91cx42_alloc_resource()
577 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
579 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
580 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_alloc_resource()
588 static void ca91cx42_free_resource(struct vme_master_resource *image) in ca91cx42_free_resource() argument
590 iounmap(image->kern_base); in ca91cx42_free_resource()
591 image->kern_base = NULL; in ca91cx42_free_resource()
592 release_resource(&image->bus_resource); in ca91cx42_free_resource()
593 kfree(image->bus_resource.name); in ca91cx42_free_resource()
594 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_free_resource()
598 static int ca91cx42_master_set(struct vme_master_resource *image, int enabled, in ca91cx42_master_set() argument
609 ca91cx42_bridge = image->parent; in ca91cx42_master_set()
613 i = image->number; in ca91cx42_master_set()
634 spin_lock(&image->lock); in ca91cx42_master_set()
640 retval = ca91cx42_alloc_resource(image, size); in ca91cx42_master_set()
642 spin_unlock(&image->lock); in ca91cx42_master_set()
649 pci_base = (unsigned long long)image->bus_resource.start; in ca91cx42_master_set()
686 spin_unlock(&image->lock); in ca91cx42_master_set()
718 spin_unlock(&image->lock); in ca91cx42_master_set()
744 spin_unlock(&image->lock); in ca91cx42_master_set()
749 ca91cx42_free_resource(image); in ca91cx42_master_set()
755 static int __ca91cx42_master_get(struct vme_master_resource *image, in __ca91cx42_master_get() argument
763 bridge = image->parent->driver_priv; in __ca91cx42_master_get()
765 i = image->number; in __ca91cx42_master_get()
842 static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled, in ca91cx42_master_get() argument
848 spin_lock(&image->lock); in ca91cx42_master_get()
850 retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace, in ca91cx42_master_get()
853 spin_unlock(&image->lock); in ca91cx42_master_get()
858 static ssize_t ca91cx42_master_read(struct vme_master_resource *image, in ca91cx42_master_read() argument
862 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_read()
869 spin_lock(&image->lock); in ca91cx42_master_read()
912 spin_unlock(&image->lock); in ca91cx42_master_read()
917 static ssize_t ca91cx42_master_write(struct vme_master_resource *image, in ca91cx42_master_write() argument
921 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_write()
928 spin_lock(&image->lock); in ca91cx42_master_write()
967 spin_unlock(&image->lock); in ca91cx42_master_write()
972 static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image, in ca91cx42_master_rmw() argument
982 bridge = image->parent->driver_priv; in ca91cx42_master_rmw()
983 dev = image->parent->parent; in ca91cx42_master_rmw()
986 i = image->number; in ca91cx42_master_rmw()
992 spin_lock(&image->lock); in ca91cx42_master_rmw()
994 pci_addr = (uintptr_t)image->kern_base + offset; in ca91cx42_master_rmw()
1016 result = ioread32(image->kern_base + offset); in ca91cx42_master_rmw()
1022 spin_unlock(&image->lock); in ca91cx42_master_rmw()