Minor fix for startup reset.

Removed unnecessary calls to usbio_ResetLM983x().
merge-requests/1/head
Gerhard Jaeger 2005-08-15 14:52:00 +00:00
rodzic 168204528d
commit a79e3e83f6
1 zmienionych plików z 43 dodań i 46 usunięć

Wyświetl plik

@ -40,6 +40,8 @@
* - 0.48 - added function usb_CheckAndCopyAdjs() * - 0.48 - added function usb_CheckAndCopyAdjs()
* - 0.49 - changed autodetection * - 0.49 - changed autodetection
* - added support for LiDE25 (pid 0x2220) * - added support for LiDE25 (pid 0x2220)
* - 0.50 - minor fix for startup reset
* removed unnecessary calls to usbio_ResetLM983x()
* . * .
* <hr> * <hr>
* This file is part of the SANE package. * This file is part of the SANE package.
@ -167,7 +169,7 @@ static void usb_CheckAndCopyAdjs( Plustek_Device *dev )
/** /**
* assign the values to the structures used by the currently found scanner * assign the values to the structures used by the currently found scanner
*/ */
static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor ) static void usb_initDev( Plustek_Device *dev, int idx, int handle, int vendor )
{ {
char *ptr; char *ptr;
char tmp_str1[PATH_MAX]; char tmp_str1[PATH_MAX];
@ -261,7 +263,6 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
if( dev->initialized >= 0 ) if( dev->initialized >= 0 )
return; return;
usbio_ResetLM983x ( dev );
usb_IsScannerReady( dev ); usb_IsScannerReady( dev );
sParam.bBitDepth = 8; sParam.bBitDepth = 8;
@ -306,7 +307,7 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
/** /**
* will be used for retrieving a Plustek device * will be used for retrieving a Plustek device
*/ */
static int usb_CheckForPlustekDevice( int handle, pPlustek_Device dev ) static int usb_CheckForPlustekDevice( int handle, Plustek_Device *dev )
{ {
char tmp[50]; char tmp[50];
char pcbStr[10]; char pcbStr[10];
@ -320,9 +321,7 @@ static int usb_CheckForPlustekDevice( int handle, pPlustek_Device dev )
*/ */
DBG( _DBG_INFO, "Trying to get the pcbID of a Plustek device...\n" ); DBG( _DBG_INFO, "Trying to get the pcbID of a Plustek device...\n" );
/* /* get the PCB-ID */
* get the PCB-ID
*/
result = sanei_lm983x_read( handle, 0x59, reg59s, 3, SANE_TRUE ); result = sanei_lm983x_read( handle, 0x59, reg59s, 3, SANE_TRUE );
if( SANE_STATUS_GOOD != result ) { if( SANE_STATUS_GOOD != result ) {
sanei_usb_close( handle ); sanei_usb_close( handle );
@ -402,11 +401,9 @@ static void usbDev_shutdown( Plustek_Device *dev )
DBG( _DBG_INFO, "Switching lamp off...\n" ); DBG( _DBG_INFO, "Switching lamp off...\n" );
usb_LampOn( dev, SANE_FALSE, SANE_FALSE ); usb_LampOn( dev, SANE_FALSE, SANE_FALSE );
} }
dev->fd = -1; dev->fd = -1;
sanei_usb_close( handle ); sanei_usb_close( handle );
} }
usb_StopLampTimer( dev ); usb_StopLampTimer( dev );
} }
@ -427,7 +424,6 @@ static SANE_Bool usb_IsDeviceInList( char *usbIdStr )
if( 0 == strncmp( Settings[i].pIDString, usbIdStr, 13 )) if( 0 == strncmp( Settings[i].pIDString, usbIdStr, 13 ))
return SANE_TRUE; return SANE_TRUE;
} }
return SANE_FALSE; return SANE_FALSE;
} }
@ -700,9 +696,10 @@ static int usbDev_open( Plustek_Device *dev, DevList *devs, int keep_lock )
return -1; return -1;
} }
/* need to set the handle and the detected chiptype... */
dev->fd = handle; dev->fd = handle;
usbio_ResetLM983x ( dev ); dev->usbDev.HwSetting.chip = (version==3 ? _LM9831:_LM9832);
usb_IsScannerReady( dev ); usbio_ResetLM983x( dev );
dev->fd = -1; dev->fd = -1;
dev->usbDev.vendor = vendor; dev->usbDev.vendor = vendor;
@ -783,7 +780,7 @@ static int usbDev_close( Plustek_Device *dev )
*/ */
static int usbDev_getCaps( Plustek_Device *dev ) static int usbDev_getCaps( Plustek_Device *dev )
{ {
pDCapsDef scaps = &dev->usbDev.Caps; DCapsDef *scaps = &dev->usbDev.Caps;
DBG( _DBG_INFO, "usbDev_getCaps()\n" ); DBG( _DBG_INFO, "usbDev_getCaps()\n" );
@ -803,7 +800,7 @@ static int usbDev_getCaps( Plustek_Device *dev )
/** usbDev_getCropInfo /** usbDev_getCropInfo
* function to set the image relevant stuff * function to set the image relevant stuff
*/ */
static int usbDev_getCropInfo( Plustek_Device *dev, pCropInfo ci ) static int usbDev_getCropInfo( Plustek_Device *dev, CropInfo *ci )
{ {
WinInfo size; WinInfo size;
@ -862,7 +859,7 @@ static int usbDev_setMap( Plustek_Device *dev, SANE_Word *map,
/** /**
*/ */
static int usbDev_setScanEnv( Plustek_Device *dev, pScanInfo si ) static int usbDev_setScanEnv( Plustek_Device *dev, ScanInfo *si )
{ {
DCapsDef *caps = &dev->usbDev.Caps; DCapsDef *caps = &dev->usbDev.Caps;