summaryrefslogtreecommitdiff
path: root/backend/pixma
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
commit44916ca6d75e0b5f258a098a50d659f31c6625fd (patch)
tree2e51a12ae43b3def9e55d3f2c9ca60d2032ad45c /backend/pixma
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
New upstream version 1.3.0upstream/1.3.0
Diffstat (limited to 'backend/pixma')
-rw-r--r--backend/pixma/pixma.c48
-rw-r--r--backend/pixma/pixma_imageclass.c2
-rw-r--r--backend/pixma/pixma_io_sanei.c7
-rw-r--r--backend/pixma/pixma_mp150.c50
4 files changed, 91 insertions, 16 deletions
diff --git a/backend/pixma/pixma.c b/backend/pixma/pixma.c
index 72385b2..cd89e99 100644
--- a/backend/pixma/pixma.c
+++ b/backend/pixma/pixma.c
@@ -851,18 +851,48 @@ control_option (pixma_sane_t * ss, SANE_Int n,
case opt_source:
if ((cfg->cap & (PIXMA_CAP_ADF|PIXMA_CAP_ADFDUP|PIXMA_CAP_TPU))
&& (a == SANE_ACTION_SET_VALUE || a == SANE_ACTION_SET_AUTO))
- { /* new source selected: flatbed, ADF, TPU, ... */
- /* to avoid fatal errors,
- * select first entry of dynamic mode_list
- * identifiers are unknown here */
- OVAL (opt_mode).w = ss->mode_map[0];
+ {
+ /* new source selected: flatbed, ADF, TPU, ... */
+ pixma_scan_mode_t curr_mode = ss->mode_map[OVAL (opt_mode).w];
+ SANE_Word curr_res = OVAL (opt_resolution).w;
+
/* recreate dynamic lists */
create_mode_list (ss);
create_dpi_list (ss);
- /* to avoid fatal errors,
- * select first entry of dynamic dpi_list
- * identifiers are unknown here */
- OVAL (opt_resolution).w = ss->dpi_list[1];
+
+ /*
+ * Check to see if the mode and res are still valid.
+ * Replace with default mode or closest res if not.
+ *
+ */
+ for (SANE_Int mode_idx = 0;; mode_idx++)
+ {
+ if (!ss->mode_list[mode_idx])
+ {
+ OVAL (opt_mode).w = 0;
+ break;
+ }
+ if (curr_mode == ss->mode_map[mode_idx])
+ {
+ OVAL (opt_mode).w = mode_idx;
+ break;
+ }
+ }
+
+ for (SANE_Int res_idx = 1;; res_idx++)
+ {
+ if (res_idx > ss->dpi_list[0])
+ {
+ OVAL (opt_resolution).w = ss->dpi_list[1];
+ break;
+ }
+ if (ss->dpi_list[res_idx] >= curr_res)
+ {
+ OVAL (opt_resolution).w = ss->dpi_list[res_idx];
+ break;
+ }
+ }
+
if (ss->mode_map[OVAL (opt_mode).w] == PIXMA_SCAN_MODE_LINEART)
{ /* lineart */
enable_option (ss, opt_threshold, SANE_TRUE);
diff --git a/backend/pixma/pixma_imageclass.c b/backend/pixma/pixma_imageclass.c
index 6a485de..83b19bd 100644
--- a/backend/pixma/pixma_imageclass.c
+++ b/backend/pixma/pixma_imageclass.c
@@ -118,6 +118,7 @@
#define MF260_PID 0x27f4
#define MF740_PID 0x27fb
#define MF743_PID 0x27fc
+#define MF750_PID 0x2885
#define MF640_PID 0x27fe
#define MF645_PID 0x27fd
#define MF440_PID 0x2823
@@ -989,6 +990,7 @@ const pixma_config_t pixma_iclass_devices[] = {
DEV ("Canon i-SENSYS MF260 Series", "MF260", MF260_PID, 600, 0, 640, 1050, PIXMA_CAP_JPEG | PIXMA_CAP_ADFDUP),
DEV ("Canon i-SENSYS MF740 Series", "MF740", MF740_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP),
DEV ("Canon i-SENSYS MF741C/743C", "MF741C/743C", MF743_PID, 600, 300, 640, 1050, PIXMA_CAP_ADFDUP), /* ADFDUP restricted to 300dpi */
+ DEV ("Canon i-SENSYS MF750 Series", "MF750C", MF750_PID, 600, 300, 640, 1050, PIXMA_CAP_ADFDUP),
DEV ("Canon i-SENSYS MF640 Series", "MF642C/643C/644C", MF640_PID, 600, 0, 640, 1050, PIXMA_CAP_ADFDUP),
DEV ("Canon i-SENSYS MF645C", "MF645C", MF645_PID, 600, 0, 637, 877, PIXMA_CAP_ADFDUP), /* max. w = 216mm */
DEV ("Canon i-SENSYS MF440 Series", "MF440", MF440_PID, 600, 300, 637, 877, PIXMA_CAP_ADFDUP),
diff --git a/backend/pixma/pixma_io_sanei.c b/backend/pixma/pixma_io_sanei.c
index ae780b3..394523e 100644
--- a/backend/pixma/pixma_io_sanei.c
+++ b/backend/pixma/pixma_io_sanei.c
@@ -62,13 +62,6 @@
# define UNUSED(v)
#endif
-/* MAC OS X does not support timeouts in darwin/libusb interrupt reads
- * This is a very basic turnaround for MAC OS X
- * Button scan will not work with this wrapper */
-#ifdef __APPLE__
-# define sanei_usb_read_int sanei_usb_read_bulk
-#endif
-
struct pixma_io_t
{
diff --git a/backend/pixma/pixma_mp150.c b/backend/pixma/pixma_mp150.c
index 171eccf..99024ca 100644
--- a/backend/pixma/pixma_mp150.c
+++ b/backend/pixma/pixma_mp150.c
@@ -336,6 +336,32 @@
#define TS2400_PID 0x1108
#define TS2600_PID 0x1107
+#define TS8630_PID 0x18F8
+#define XK110_PID 0x18F9
+#define GX3000_PID 0x18F1
+#define GX4000_PID 0x18F2
+
+/* 2023 new device (untested) */
+#define G3070_PID 0x18F4
+#define G2070_PID 0x18F5
+#define G4070_PID 0x18F3
+#define G3030_PID 0x1105
+#define G2030_PID 0x1106
+#define TC20M_PID 0x18FC
+#define TC5200M_PID 0x18FF
+
+#define TS8700_PID 0x1118
+#define XK120_PID 0x1119
+#define GX1000_PID 0x110B
+#define GX2000_PID 0x110D
+#define TS6630_PID 0x114E
+#define TS7700_PID 0x110F
+#define TS7600i_PID 0x114F
+#define TS6730_PID 0x1150
+#define TR7800_PID 0x1151
+#define TS7700i_PID 0x1152
+#define TS7700A_PID 0x1111
+#define GX6500_PID 0x1148
/* Generation 4 XML messages that encapsulates the Pixma protocol messages */
#define XML_START_1 \
@@ -1966,6 +1992,30 @@ const pixma_config_t pixma_mp150_devices[] = {
DEVICE ("Canon PIXMA TS5400 Series", "TS5400", TS5400_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
DEVICE ("Canon PIXMA TS2400 Series", "TS2400", TS2400_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
DEVICE ("Canon PIXMA TS2600 Series", "TS2600", TS2600_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TS8630 Series", "TS8630", TS8630_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXUS XK110 Series", "XK110", XK110_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA GX3000 Series", "GX3000", GX3000_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+ DEVICE ("Canon PIXMA GX4000 Series", "GX4000", GX4000_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+ DEVICE ("Canon PIXMA G3070", "G3070", G3070_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA G2070", "G2070", G2070_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA G4070", "G4070", G4070_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA G3030", "G3030", G3030_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA G2030", "G2030", G2030_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TC-20M", "TC-20M", TC20M_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TC-5200M", "TC-5200M", TC5200M_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+
+ DEVICE ("Canon PIXMA TS8700 series", "TS8700", TS8700_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA XK120 series", "XK120", XK120_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA GX1000 series", "GX1000", GX1000_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+ DEVICE ("Canon PIXMA GX2000 series", "GX2000", GX2000_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
+ DEVICE ("Canon PIXMA TS6630 series", "TS6630", TS6630_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TS7700 series", "TS7700", TS7700_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TS7600i series", "TS7600i", TS7600i_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TS6730 series", "TS6730", TS6730_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TR7800 series", "TR7800", TR7800_PID, 0, 600, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF | PIXMA_CAP_ADF_JPEG),
+ DEVICE ("Canon PIXMA TS7700i series", "TS7700i", TS7700i_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA TS7700A series", "TS7700A", TS7700A_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS),
+ DEVICE ("Canon PIXMA GX6500 series", "GX6500", GX6500_PID, 0, 1200, 0, 0, 638, 877, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
END_OF_DEVICE_LIST
};