sane-backends/0001-pixma-new-scanner-CanoScan-LIDE-300.patch
2019-07-19 14:45:53 +02:00

73 lines
2.5 KiB
Diff

diff --git a/backend/pixma_mp150.c b/backend/pixma_mp150.c
index dca0965..4eaea9c 100644
--- a/backend/pixma_mp150.c
+++ b/backend/pixma_mp150.c
@@ -241,6 +241,7 @@
#define MG3000_PID 0x180b
#define E470_PID 0x180c
#define G3000_PID 0x181d
+#define LIDE300_PID 0x1913 /* tested */
/* Generation 4 XML messages that encapsulates the Pixma protocol messages */
#define XML_START_1 \
@@ -977,6 +978,14 @@ handle_interrupt (pixma_t * s, int timeout)
if (buf[7] & 2)
s->events = PIXMA_EV_BUTTON2 | buf[11] | buf[10]<<8 | buf[12]<<16; /* b/w scan */
}
+ else if (s->cfg->pid == LIDE300_PID)
+ /* unknown value in buf[4]
+ * target in buf[0x13]
+ * always set button-1 */
+ {
+ if (buf[0x13])
+ s->events = PIXMA_EV_BUTTON1 | buf[0x13];
+ }
else
/* button no. in buf[0]
* original in buf[0]
@@ -1331,7 +1340,8 @@ mp150_check_param (pixma_t * s, pixma_scan_param_t * sp)
if ((s->cfg->cap & PIXMA_CAP_ADF) && sp->source == PIXMA_SOURCE_FLATBED)
sp->h = MIN (sp->h, 877 * sp->xdpi / 75);
- if (sp->source == PIXMA_SOURCE_TPU)
+ if (sp->source == PIXMA_SOURCE_TPU
+ || s->cfg->pid == LIDE300_PID)
{
uint8_t k;
@@ -1864,6 +1874,7 @@ const pixma_config_t pixma_mp150_devices[] = {
DEVICE ("Canon PIXMA MG3000 Series", "MG3000", MG3000_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
DEVICE ("Canon PIXMA E470 Series", "E470", E470_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
DEVICE ("Canon PIXMA G4000 Series", "G3000", G3000_PID, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("CanoScan LiDE 300", "LIDE300", LIDE300_PID, 4800, 0, 0, 638, 877, PIXMA_CAP_CIS),
END_OF_DEVICE_LIST
};
diff --git a/doc/descriptions/pixma.desc b/doc/descriptions/pixma.desc
index ad33faa..b610a71 100644
--- a/doc/descriptions/pixma.desc
+++ b/doc/descriptions/pixma.desc
@@ -1162,3 +1162,9 @@
:usbid "0x04a9" "0x190d"
:status :complete
:comment "Full flatbed support up to 4800DPI (Note: flatbed does not have 9600DPI capability). Full TPU support (negatives, slides and infrared) up to 9600DPI."
+
+:model "CanoScan LiDE 300"
+:interface "USB"
+:usbid "0x04a9" "0x1913"
+:status :complete
+:comment "Support up to 4800DPI (Note: does not have less than 300DPI support)"
diff --git a/doc/sane-pixma.man b/doc/sane-pixma.man
index 1058e92..9c23b9d 100644
--- a/doc/sane-pixma.man
+++ b/doc/sane-pixma.man
@@ -67,6 +67,8 @@ imageRUNNER 1020/1024/1025
.br
CanoScan 8800F, 9000F, 9000F Mark II
.br
+CanoScan LiDE 300
+.br
MAXIFY MB5000 (ADF is not working)
.RE
.PP