use dedicated LiDE120 GPIO

merge-requests/1/head
Stéphane Voltz 2016-02-17 21:43:05 +01:00
rodzic 387cea7d6c
commit 214dfad1d5
2 zmienionych plików z 108 dodań i 94 usunięć

Wyświetl plik

@ -1947,6 +1947,13 @@ gl124_stop_action (Genesys_Device * dev)
} }
/** @brief setup GPIOs for scan
* Setup GPIO values to drive motor (or light) needed for the
* target resolution
* @param *dev device to set up
* @param resolution dpi of the target scan
* @return SANE_STATUS_GOOD unless REG32 cannot be read
*/
static SANE_Status static SANE_Status
gl124_setup_scan_gpio(Genesys_Device *dev, int resolution) gl124_setup_scan_gpio(Genesys_Device *dev, int resolution)
{ {
@ -3518,12 +3525,10 @@ gl124_init_regs_for_warmup (Genesys_Device * dev,
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
} }
/** /** @brief default GPIO values
* set up GPIO/GPOE for idle state * set up GPIO/GPOE for idle state
WRITE GPIO[17-21]= GPIO19 * @param dev device to set up
WRITE GPOE[17-21]= GPOE21 GPOE20 GPOE19 GPOE18 * @return SANE_STATUS_GOOD unless a GPIO register cannot be written
genesys_write_register(0xa8,0x3e)
GPIO(0xa8)=0x3e
*/ */
static SANE_Status static SANE_Status
gl124_init_gpio (Genesys_Device * dev) gl124_init_gpio (Genesys_Device * dev)
@ -3534,11 +3539,14 @@ gl124_init_gpio (Genesys_Device * dev)
DBGSTART; DBGSTART;
/* per model GPIO layout */ /* per model GPIO layout */
if ((strcmp (dev->model->name, "canon-lide-110") == 0) if (strcmp (dev->model->name, "canon-lide-110") == 0)
||(strcmp (dev->model->name, "canon-lide-120") == 0))
{ {
idx = 0; idx = 0;
} }
else if (strcmp (dev->model->name, "canon-lide-110") == 0)
{
idx = 2;
}
else else
{ /* canon LiDE 210 and 220 case */ { /* canon LiDE 210 and 220 case */
idx = 1; idx = 1;
@ -3731,7 +3739,8 @@ gl124_update_hardware_sensors (Genesys_Scanner * s)
* add another per scanner button profile struct to avoid growing * add another per scanner button profile struct to avoid growing
* hard-coded button mapping here. * hard-coded button mapping here.
*/ */
if(s->dev->model->gpo_type == GPO_CANONLIDE110) if((s->dev->model->gpo_type == GPO_CANONLIDE110)
||(s->dev->model->gpo_type == GPO_CANONLIDE120))
{ {
if (s->val[OPT_SCAN_SW].b == s->last_val[OPT_SCAN_SW].b) if (s->val[OPT_SCAN_SW].b == s->last_val[OPT_SCAN_SW].b)
s->val[OPT_SCAN_SW].b = (val & 0x01) == 0; s->val[OPT_SCAN_SW].b = (val & 0x01) == 0;

Wyświetl plik

@ -547,6 +547,10 @@ static Gpio_layout gpios[]={
{ {
0x9f, 0x59, 0x01, 0x80, 0x5f, 0x01, 0x00 0x9f, 0x59, 0x01, 0x80, 0x5f, 0x01, 0x00
}, },
/* LiDE 120 */
{
0x9f, 0x53, 0x01, 0x80, 0x5f, 0x01, 0x00
},
}; };
typedef struct typedef struct
@ -566,8 +570,9 @@ typedef struct
static Memory_layout layouts[]={ static Memory_layout layouts[]={
/* LIDE 110, 120 */ /* LIDE 110, 120 */
{ { /* 0xd0 0xd1 0xd2 */
0x0a, 0x15, 0x20, 0x0a, 0x15, 0x20,
/* 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 */
0x00, 0xac, 0x08, 0x55, 0x08, 0x56, 0x0f, 0xff 0x00, 0xac, 0x08, 0x55, 0x08, 0x56, 0x0f, 0xff
}, },
/* LIDE 210, 220 */ /* LIDE 210, 220 */