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
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;
}
/**
/** @brief default GPIO values
* set up GPIO/GPOE for idle state
WRITE GPIO[17-21]= GPIO19
WRITE GPOE[17-21]= GPOE21 GPOE20 GPOE19 GPOE18
genesys_write_register(0xa8,0x3e)
GPIO(0xa8)=0x3e
* @param dev device to set up
* @return SANE_STATUS_GOOD unless a GPIO register cannot be written
*/
static SANE_Status
gl124_init_gpio (Genesys_Device * dev)
@ -3534,11 +3539,14 @@ gl124_init_gpio (Genesys_Device * dev)
DBGSTART;
/* per model GPIO layout */
if ((strcmp (dev->model->name, "canon-lide-110") == 0)
||(strcmp (dev->model->name, "canon-lide-120") == 0))
if (strcmp (dev->model->name, "canon-lide-110") == 0)
{
idx = 0;
}
else if (strcmp (dev->model->name, "canon-lide-110") == 0)
{
idx = 2;
}
else
{ /* canon LiDE 210 and 220 case */
idx = 1;
@ -3731,7 +3739,8 @@ gl124_update_hardware_sensors (Genesys_Scanner * s)
* add another per scanner button profile struct to avoid growing
* 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)
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
},
/* LiDE 120 */
{
0x9f, 0x53, 0x01, 0x80, 0x5f, 0x01, 0x00
},
};
typedef struct
@ -566,8 +570,9 @@ typedef struct
static Memory_layout layouts[]={
/* LIDE 110, 120 */
{
{ /* 0xd0 0xd1 0xd2 */
0x0a, 0x15, 0x20,
/* 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 0xe6 0xe7 */
0x00, 0xac, 0x08, 0x55, 0x08, 0x56, 0x0f, 0xff
},
/* LIDE 210, 220 */