diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/canon/serial.c gphoto/canon/serial.c --- gphoto.orig/canon/serial.c Sun Aug 20 14:28:40 2000 +++ gphoto/canon/serial.c Sat Aug 5 11:49:46 2000 @@ -19,16 +19,8 @@ #include "psa50.h" #include "../src/gphoto.h" -/**** new stuff ********/ #include extern struct Model *Camera; -int gpio_usb_find_device(int idvendor, int idproduct, struct usb_device **device); -int gpio_usb_msg_write(gpio_device *dev, int value, char *bytes, int size); -int gpio_usb_msg_read(gpio_device *dev, int value, char *bytes, int size); -int gpio_usb_read(gpio_device *dev, char *bytes, int size); -int gpio_usb_write(gpio_device *dev, char *bytes, int size); -/******* new stuff *********/ - /**************************************************************************** * @@ -114,10 +107,8 @@ { #ifdef GPIO_USB char msg[65536]; - char mem; char buffer[65536]; gpio_device_settings settings; - struct usb_device *udev; #endif debug_message("Initializing the camera.\n"); @@ -126,25 +117,23 @@ case CANON_USB: #ifdef GPIO_USB - if (gpio_usb_find_device(Camera->idVendor, - Camera->idProduct, &udev)) { + iodev = gpio_new(GPIO_DEVICE_USB); + if (!iodev) + { + return -1; + } + + if (gpio_usb_find_device(iodev,Camera->idVendor, + Camera->idProduct)) { printf("found '%s' @ %s/%s\n", Camera->name, - udev->bus->dirname, udev->filename); + iodev->usb_device->bus->dirname, iodev->usb_device->filename); } else { printf("Found no camera!\n"); exit(1); } - iodev = gpio_new(GPIO_DEVICE_USB); - if (!iodev) - { - return -1; - } - - settings.usb.udev = udev; - settings.usb.inep = 0x81; settings.usb.outep = 0x02; settings.usb.config = 1; diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/configure.in gphoto/configure.in --- gphoto.orig/configure.in Sun Aug 20 14:28:12 2000 +++ gphoto/configure.in Sat Aug 5 11:49:46 2000 @@ -38,6 +44,12 @@ *** Available from GNOME CVS module 'libgpio'. ***]) exit 1 +fi + +AC_PATH_PROG(LIBUSB_CONFIG,libusb-config) +if test -n "${LIBUSB_CONFIG}"; then + CFLAGS="$CFLAGS `$LIBUSB_CONFIG --cflags`" + LIBS="$LIBS `$LIBUSB_CONFIG --libs`" fi AC_SUBST(CFLAGS) diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/digita/serial.c gphoto/digita/serial.c --- gphoto.orig/digita/serial.c Thu Jun 8 14:25:41 2000 +++ gphoto/digita/serial.c Sat Aug 5 11:49:46 2000 @@ -201,12 +202,12 @@ tcsendbreak(dev->gpdev->device_fd, 4); dev->gpdev->settings.serial.speed = 0; - gpio_serial_set_baudrate(dev->gpdev); + gpio_update(dev->gpdev); usleep(50); dev->gpdev->settings.serial.speed = 9600; - gpio_serial_set_baudrate(dev->gpdev); + gpio_update(dev->gpdev); usleep(2000); @@ -250,7 +251,7 @@ dev->deviceframesize = ntohs(beacon_comp.deviceframesize); dev->gpdev->settings.serial.speed = ntohl(beacon_comp.dataspeed); - gpio_serial_set_baudrate(dev->gpdev); + gpio_update(dev->gpdev); usleep(100000); diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/digita/usb.c gphoto/digita/usb.c --- gphoto.orig/digita/usb.c Fri Jul 21 02:12:39 2000 +++ gphoto/digita/usb.c Sat Aug 5 11:49:46 2000 @@ -11,10 +11,8 @@ #include #include "digita.h" - #include "../src/gphoto.h" - -#include +#include static int digita_usb_read(struct digita_device *dev, void *buffer, int len) { @@ -37,17 +35,16 @@ #ifdef GPIO_USB extern struct Model *Camera; -int digita_usb_probe(struct usb_device **udev) +int digita_usb_probe(struct digita_device *dev) { - if (gpio_usb_find_device(Camera->idVendor, - Camera->idProduct, udev)) { + if (gpio_usb_find_device(dev->gpdev,Camera->idVendor, + Camera->idProduct) == GPIO_OK) { printf("found '%s' @ %s/%s\n", Camera->name, - (*udev)->bus->dirname, (*udev)->filename); + dev->gpdev->usb_device->bus->dirname, + dev->gpdev->usb_device->filename); return 1; } - fprintf(stderr, "unable to find any compatible USB cameras\n"); - return 0; } #endif @@ -59,9 +56,6 @@ gpio_device_settings settings; struct usb_device *udev; - if (!digita_usb_probe(&udev)) - return NULL; - dev = malloc(sizeof(*dev)); if (!dev) return NULL; @@ -70,7 +64,8 @@ if (!dev->gpdev) return NULL; - settings.usb.udev = udev; + if (!digita_usb_probe(dev)) + return NULL; settings.usb.inep = 0x81; settings.usb.outep = 0x02; diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/photopc/photopc-usb.c gphoto/photopc/photopc-usb.c --- gphoto.orig/photopc/photopc-usb.c Fri Jul 21 02:12:39 2000 +++ gphoto/photopc/photopc-usb.c Thu Aug 10 16:50:34 2000 @@ -38,12 +48,14 @@ #ifdef GPIO_USB extern struct Model *Camera; -int olympus_usb_probe(struct usb_device **udev) +int +olympus_usb_probe(struct olympus_device *dev) { - if (gpio_usb_find_device(Camera->idVendor, - Camera->idProduct, udev)) { - printf("found '%s' @ %s/%s\n", Camera->name, - (*udev)->bus->dirname, (*udev)->filename); + if (gpio_usb_find_device(dev->gpdev, Camera->idVendor, + Camera->idProduct) == GPIO_OK) { + printf("found '%s' @ %s/%s\n", Camera->name, + dev->gpdev->usb_device->bus->dirname, + dev->gpdev->usb_device->filename); return 1; } @@ -68,10 +81,10 @@ if (!dev->gpdev) return NULL; - if (!olympus_usb_probe(&udev)) + if (!olympus_usb_probe(dev)) return NULL; - gpio_set_timeout (dev->gpdev, 5000); + gpio_set_timeout (dev->gpdev, 2000); settings.usb.udev = udev; settings.usb.inep = 0x83; settings.usb.outep = 0x04; @@ -80,7 +93,6 @@ settings.usb.altsetting = 0; gpio_set_settings(dev->gpdev, settings); - gpio_set_timeout(dev->gpdev, 50000); if (gpio_open(dev->gpdev) < 0) { fprintf(stderr, "error opening device\n"); return NULL; @@ -92,9 +104,12 @@ #endif } -void olympus_usb_reset (struct olympus_device *dev) +void +olympus_usb_reset (struct olympus_device *dev) { #ifdef GPIO_USB - gpio_usb_clear_halt (dev->gpdev); + if (dev) { + gpio_usb_clear_halt (dev->gpdev, GPIO_USB_IN_ENDPOINT); + } #endif } diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/src/callbacks.c gphoto/src/callbacks.c --- gphoto.orig/src/callbacks.c Thu Jul 6 20:08:15 2000 +++ gphoto/src/callbacks.c Fri Aug 4 12:36:49 2000 @@ -22,7 +22,7 @@ #include "main.h" #include "util.h" #include "callbacks.h" -#include +#include #include #include diff -u --new-file --recursive --exclude-from=/tmp/cvs.exclude.gphoto gphoto.orig/src/main.c gphoto/src/main.c --- gphoto.orig/src/main.c Sun Jul 9 23:40:15 2000 +++ gphoto/src/main.c Fri Aug 4 12:30:06 2000 @@ -135,9 +142,9 @@ command_line_mode = 0; gtk_init(&argc, &argv); -#if 1 /* by fujisawa */ gdk_imlib_init(); -#endif + gpio_init(); + gtk_widget_push_visual(gdk_imlib_get_visual()); gtk_widget_push_colormap(gdk_imlib_get_colormap());