Lines Matching refs:image

341 static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,  in ca91cx42_slave_set()  argument
351 ca91cx42_bridge = image->parent; in ca91cx42_slave_set()
355 i = image->number; in ca91cx42_slave_set()
447 static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled, in ca91cx42_slave_get() argument
455 bridge = image->parent->driver_priv; in ca91cx42_slave_get()
457 i = image->number; in ca91cx42_slave_get()
507 static int ca91cx42_alloc_resource(struct vme_master_resource *image, in ca91cx42_alloc_resource() argument
515 ca91cx42_bridge = image->parent; in ca91cx42_alloc_resource()
524 existing_size = (unsigned long long)(image->bus_resource.end - in ca91cx42_alloc_resource()
525 image->bus_resource.start); in ca91cx42_alloc_resource()
532 iounmap(image->kern_base); in ca91cx42_alloc_resource()
533 image->kern_base = NULL; in ca91cx42_alloc_resource()
534 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
535 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
536 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_alloc_resource()
539 if (image->bus_resource.name == NULL) { in ca91cx42_alloc_resource()
540 image->bus_resource.name = kmalloc(VMENAMSIZ+3, GFP_ATOMIC); in ca91cx42_alloc_resource()
541 if (image->bus_resource.name == NULL) { in ca91cx42_alloc_resource()
549 sprintf((char *)image->bus_resource.name, "%s.%d", in ca91cx42_alloc_resource()
550 ca91cx42_bridge->name, image->number); in ca91cx42_alloc_resource()
552 image->bus_resource.start = 0; in ca91cx42_alloc_resource()
553 image->bus_resource.end = (unsigned long)size; in ca91cx42_alloc_resource()
554 image->bus_resource.flags = IORESOURCE_MEM; in ca91cx42_alloc_resource()
557 &image->bus_resource, size, size, PCIBIOS_MIN_MEM, in ca91cx42_alloc_resource()
562 image->number, (unsigned long)size, in ca91cx42_alloc_resource()
563 (unsigned long)image->bus_resource.start); in ca91cx42_alloc_resource()
567 image->kern_base = ioremap_nocache( in ca91cx42_alloc_resource()
568 image->bus_resource.start, size); in ca91cx42_alloc_resource()
569 if (image->kern_base == NULL) { in ca91cx42_alloc_resource()
578 release_resource(&image->bus_resource); in ca91cx42_alloc_resource()
580 kfree(image->bus_resource.name); in ca91cx42_alloc_resource()
581 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_alloc_resource()
589 static void ca91cx42_free_resource(struct vme_master_resource *image) in ca91cx42_free_resource() argument
591 iounmap(image->kern_base); in ca91cx42_free_resource()
592 image->kern_base = NULL; in ca91cx42_free_resource()
593 release_resource(&image->bus_resource); in ca91cx42_free_resource()
594 kfree(image->bus_resource.name); in ca91cx42_free_resource()
595 memset(&image->bus_resource, 0, sizeof(struct resource)); in ca91cx42_free_resource()
599 static int ca91cx42_master_set(struct vme_master_resource *image, int enabled, in ca91cx42_master_set() argument
610 ca91cx42_bridge = image->parent; in ca91cx42_master_set()
614 i = image->number; in ca91cx42_master_set()
635 spin_lock(&image->lock); in ca91cx42_master_set()
641 retval = ca91cx42_alloc_resource(image, size); in ca91cx42_master_set()
643 spin_unlock(&image->lock); in ca91cx42_master_set()
650 pci_base = (unsigned long long)image->bus_resource.start; in ca91cx42_master_set()
687 spin_unlock(&image->lock); in ca91cx42_master_set()
719 spin_unlock(&image->lock); in ca91cx42_master_set()
745 spin_unlock(&image->lock); in ca91cx42_master_set()
750 ca91cx42_free_resource(image); in ca91cx42_master_set()
756 static int __ca91cx42_master_get(struct vme_master_resource *image, in __ca91cx42_master_get() argument
764 bridge = image->parent->driver_priv; in __ca91cx42_master_get()
766 i = image->number; in __ca91cx42_master_get()
843 static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled, in ca91cx42_master_get() argument
849 spin_lock(&image->lock); in ca91cx42_master_get()
851 retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace, in ca91cx42_master_get()
854 spin_unlock(&image->lock); in ca91cx42_master_get()
859 static ssize_t ca91cx42_master_read(struct vme_master_resource *image, in ca91cx42_master_read() argument
863 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_read()
870 spin_lock(&image->lock); in ca91cx42_master_read()
913 spin_unlock(&image->lock); in ca91cx42_master_read()
918 static ssize_t ca91cx42_master_write(struct vme_master_resource *image, in ca91cx42_master_write() argument
922 void __iomem *addr = image->kern_base + offset; in ca91cx42_master_write()
929 spin_lock(&image->lock); in ca91cx42_master_write()
968 spin_unlock(&image->lock); in ca91cx42_master_write()
973 static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image, in ca91cx42_master_rmw() argument
983 bridge = image->parent->driver_priv; in ca91cx42_master_rmw()
984 dev = image->parent->parent; in ca91cx42_master_rmw()
987 i = image->number; in ca91cx42_master_rmw()
993 spin_lock(&image->lock); in ca91cx42_master_rmw()
995 pci_addr = (uintptr_t)image->kern_base + offset; in ca91cx42_master_rmw()
1017 result = ioread32(image->kern_base + offset); in ca91cx42_master_rmw()
1023 spin_unlock(&image->lock); in ca91cx42_master_rmw()