Lines Matching refs:image
333 static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled, in ca91cx42_slave_set() argument
343 ca91cx42_bridge = image->parent; in ca91cx42_slave_set()
347 i = image->number; in ca91cx42_slave_set()
439 static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled, in ca91cx42_slave_get() argument
447 bridge = image->parent->driver_priv; in ca91cx42_slave_get()
449 i = image->number; in ca91cx42_slave_get()
499 static int ca91cx42_alloc_resource(struct vme_master_resource *image, in ca91cx42_alloc_resource() argument
507 ca91cx42_bridge = image->parent; in ca91cx42_alloc_resource()
516 existing_size = (unsigned long long)(image->bus_resource.end - in ca91cx42_alloc_resource()
517 image->bus_resource.start); in ca91cx42_alloc_resource()
524 iounmap(image->kern_base); in ca91cx42_alloc_resource()
525 image->kern_base = NULL; in ca91cx42_alloc_resource()
526 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
527 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
528 memset(&image->bus_resource, 0, sizeof(image->bus_resource)); in ca91cx42_alloc_resource()
531 if (!image->bus_resource.name) { in ca91cx42_alloc_resource()
532 image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC); in ca91cx42_alloc_resource()
533 if (!image->bus_resource.name) { in ca91cx42_alloc_resource()
539 sprintf((char *)image->bus_resource.name, "%s.%d", in ca91cx42_alloc_resource()
540 ca91cx42_bridge->name, image->number); in ca91cx42_alloc_resource()
542 image->bus_resource.start = 0; in ca91cx42_alloc_resource()
543 image->bus_resource.end = (unsigned long)size; in ca91cx42_alloc_resource()
544 image->bus_resource.flags = IORESOURCE_MEM; in ca91cx42_alloc_resource()
547 &image->bus_resource, size, 0x10000, PCIBIOS_MIN_MEM, in ca91cx42_alloc_resource()
552 image->number, (unsigned long)size, in ca91cx42_alloc_resource()
553 (unsigned long)image->bus_resource.start); in ca91cx42_alloc_resource()
557 image->kern_base = ioremap( in ca91cx42_alloc_resource()
558 image->bus_resource.start, size); in ca91cx42_alloc_resource()
559 if (!image->kern_base) { in ca91cx42_alloc_resource()
568 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
570 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
571 memset(&image->bus_resource, 0, sizeof(image->bus_resource)); in ca91cx42_alloc_resource()
579 static void ca91cx42_free_resource(struct vme_master_resource *image) in ca91cx42_free_resource() argument
581 iounmap(image->kern_base); in ca91cx42_free_resource()
582 image->kern_base = NULL; in ca91cx42_free_resource()
583 release_resource(&image->bus_resource); in ca91cx42_free_resource()
584 kfree(image->bus_resource.name); in ca91cx42_free_resource()
585 memset(&image->bus_resource, 0, sizeof(image->bus_resource)); in ca91cx42_free_resource()
589 static int ca91cx42_master_set(struct vme_master_resource *image, int enabled, in ca91cx42_master_set() argument
600 ca91cx42_bridge = image->parent; in ca91cx42_master_set()
604 i = image->number; in ca91cx42_master_set()
625 spin_lock(&image->lock); in ca91cx42_master_set()
631 retval = ca91cx42_alloc_resource(image, size); in ca91cx42_master_set()
633 spin_unlock(&image->lock); in ca91cx42_master_set()
640 pci_base = (unsigned long long)image->bus_resource.start; in ca91cx42_master_set()
677 spin_unlock(&image->lock); in ca91cx42_master_set()
709 spin_unlock(&image->lock); in ca91cx42_master_set()
735 spin_unlock(&image->lock); in ca91cx42_master_set()
740 ca91cx42_free_resource(image); in ca91cx42_master_set()
746 static int __ca91cx42_master_get(struct vme_master_resource *image, in __ca91cx42_master_get() argument
754 bridge = image->parent->driver_priv; in __ca91cx42_master_get()
756 i = image->number; in __ca91cx42_master_get()
833 static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled, in ca91cx42_master_get() argument
839 spin_lock(&image->lock); in ca91cx42_master_get()
841 retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace, in ca91cx42_master_get()
844 spin_unlock(&image->lock); in ca91cx42_master_get()
849 static ssize_t ca91cx42_master_read(struct vme_master_resource *image, in ca91cx42_master_read() argument
853 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_read()
860 spin_lock(&image->lock); in ca91cx42_master_read()
903 spin_unlock(&image->lock); in ca91cx42_master_read()
908 static ssize_t ca91cx42_master_write(struct vme_master_resource *image, in ca91cx42_master_write() argument
912 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_write()
919 spin_lock(&image->lock); in ca91cx42_master_write()
958 spin_unlock(&image->lock); in ca91cx42_master_write()
963 static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image, in ca91cx42_master_rmw() argument
972 bridge = image->parent->driver_priv; in ca91cx42_master_rmw()
973 dev = image->parent->parent; in ca91cx42_master_rmw()
981 spin_lock(&image->lock); in ca91cx42_master_rmw()
983 pci_addr = (uintptr_t)image->kern_base + offset; in ca91cx42_master_rmw()
1005 result = ioread32(image->kern_base + offset); in ca91cx42_master_rmw()
1011 spin_unlock(&image->lock); in ca91cx42_master_rmw()