summaryrefslogtreecommitdiff
path: root/backend/genesys/gl843.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-01 15:26:02 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-01 15:26:02 +0100
commit5de81480e84023d91763d89e4523de88df42c194 (patch)
treecb83e4c8216cf0e8bcaa17a6f2cb64cf4d7f469a /backend/genesys/gl843.cpp
parent97e55bdc5cdf59304af739e65f416320bcbcf599 (diff)
parent8e5d399808d2270ae9d56c96560a021e594d18a4 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/genesys/gl843.cpp')
-rw-r--r--backend/genesys/gl843.cpp35
1 files changed, 14 insertions, 21 deletions
diff --git a/backend/genesys/gl843.cpp b/backend/genesys/gl843.cpp
index e768ac0..6180bf9 100644
--- a/backend/genesys/gl843.cpp
+++ b/backend/genesys/gl843.cpp
@@ -17,27 +17,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-
- As a special exception, the authors of SANE give permission for
- additional uses of the libraries contained in this release of SANE.
-
- The exception is that, if you link a SANE library with other files
- to produce an executable, this does not by itself cause the
- resulting executable to be covered by the GNU General Public
- License. Your use of that executable is in no way restricted on
- account of linking the SANE library code into it.
-
- This exception does not, however, invalidate any other reasons why
- the executable file might be covered by the GNU General Public
- License.
-
- If you submit changes to SANE to the maintainers to be included in
- a subsequent release, you agree by submitting the changes that
- those changes may be distributed with this exception intact.
-
- If you write modifications of your own for SANE, it is your choice
- whether to permit this exception to apply to your modifications.
- If you do not wish that, delete this exception notice.
*/
#define DEBUG_DECLARE_ONLY
@@ -1122,6 +1101,8 @@ ScanSession CommandSetGl843::calculate_scan_session(const Genesys_Device* dev,
session.params.scan_method = settings.scan_method;
session.params.scan_mode = settings.scan_mode;
session.params.color_filter = settings.color_filter;
+ session.params.contrast_adjustment = settings.contrast;
+ session.params.brightness_adjustment = settings.brightness;
session.params.flags = flags;
compute_session(dev, session, sensor);
@@ -1240,6 +1221,7 @@ void CommandSetGl843::begin_scan(Genesys_Device* dev, const Genesys_Sensor& sens
dev->interface->write_register(0x7e, 0x04);
break;
case GpioId::G4050:
+ case GpioId::G4010:
dev->interface->write_register(REG_0xA7, 0xfe);
dev->interface->write_register(REG_0xA8, 0x3e);
dev->interface->write_register(REG_0xA9, 0x06);
@@ -1432,6 +1414,8 @@ void CommandSetGl843::init_regs_for_shading(Genesys_Device* dev, const Genesys_S
session.params.scan_method = dev->settings.scan_method;
session.params.scan_mode = dev->settings.scan_mode;
session.params.color_filter = dev->settings.color_filter;
+ session.params.contrast_adjustment = dev->settings.contrast;
+ session.params.brightness_adjustment = dev->settings.brightness;
session.params.flags = flags;
compute_session(dev, session, calib_sensor);
@@ -1535,6 +1519,8 @@ void CommandSetGl843::init_regs_for_warmup(Genesys_Device* dev, const Genesys_Se
session.params.scan_method = dev->settings.scan_method;
session.params.scan_mode = ScanColorMode::COLOR_SINGLE_PASS;
session.params.color_filter = dev->settings.color_filter;
+ session.params.contrast_adjustment = 0;
+ session.params.brightness_adjustment = 0;
session.params.flags = flags;
compute_session(dev, session, calib_sensor);
@@ -1680,6 +1666,7 @@ void CommandSetGl843::update_hardware_sensors(Genesys_Scanner* s) const
*/
uint8_t val = s->dev->interface->read_register(REG_0x6D);
+ DBG(DBG_io, "%s: read buttons_gpio value=0x%x\n", __func__, (int)val);
switch (s->dev->model->gpio_id)
{
@@ -1692,6 +1679,12 @@ void CommandSetGl843::update_hardware_sensors(Genesys_Scanner* s) const
s->buttons[BUTTON_EMAIL_SW].write((val & 0x04) == 0);
s->buttons[BUTTON_COPY_SW].write((val & 0x08) == 0);
break;
+ case GpioId::G4010:
+ s->buttons[BUTTON_FILE_SW].write((val & 0x01) == 0);
+ s->buttons[BUTTON_COPY_SW].write((val & 0x04) == 0);
+ s->buttons[BUTTON_TRANSP_SW].write((val & 0x40) == 0);
+ s->buttons[BUTTON_SCAN_SW].write((val & 0x08) == 0);
+ break;
case GpioId::CANON_4400F:
case GpioId::CANON_8400F:
default: