Re: sane-backends: make SCAN button work on Canon MG3200 series

Antoine Jacoutot <[email protected]>
Newsgroups gmane.os.openbsd.ports
Message-ID <[email protected]>
On Thu, Jul 09, 2026 at 10:19:39AM +0000, Mikolaj Kucharski wrote:
> On Wed, Jul 08, 2026 at 04:26:14PM +0200, Antoine Jacoutot wrote:
> > On Wed, Jul 08, 2026 at 10:03:52AM +0000, Mikolaj Kucharski wrote:
> > > Hi Antoine,
> > > 
> > > I would like to add this small patch to make my scanner Canon PIXMA
> > > MG3250 work with the SCAN button.
> > > 
> > > See:
> > > 
> > > - https://gitlab.com/sane-project/backends/-/work_items/856
> > > - https://gitlab.com/sane-project/backends/-/merge_requests/933
> > 
> > Seems fine.
> > I'll have a look within the next couple of days.
> > Thanks.
> > 
> 
> Thanks. Simpler patch below.

Committed, thanks.


> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/graphics/sane-backends/Makefile,v
> diff -u -p -u -r1.118 Makefile
> --- Makefile	1 Nov 2025 11:16:41 -0000	1.118
> +++ Makefile	9 Jul 2026 10:09:12 -0000
> @@ -3,7 +3,7 @@ BROKEN-alpha=		ICE hp5590.c:1141: error:
>  COMMENT=		API for accessing scanners, backends
>  
>  V=			1.4.0
> -REVISION=		2
> +REVISION=		3
>  DISTNAME=		backends-${V}
>  PKGNAME=		sane-${DISTNAME}
>  
> Index: patches/patch-backend_pixma_pixma_mp150_c
> ===================================================================
> RCS file: patches/patch-backend_pixma_pixma_mp150_c
> diff -N patches/patch-backend_pixma_pixma_mp150_c
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ patches/patch-backend_pixma_pixma_mp150_c	9 Jul 2026 10:09:12 -0000
> @@ -0,0 +1,24 @@
> +PIXMA: decode SCAN button interrupt on MG3200 series (buf[4])
> +
> +- https://gitlab.com/sane-project/backends/-/work_items/856
> +- https://gitlab.com/sane-project/backends/-/merge_requests/933
> +
> +Index: backend/pixma/pixma_mp150.c
> +--- backend/pixma/pixma_mp150.c.orig
> ++++ backend/pixma/pixma_mp150.c
> +@@ -1049,6 +1049,15 @@ handle_interrupt (pixma_t * s, int timeout)
> +       s->events = PIXMA_EV_BUTTON1 | (buf[0x13] & 0x0f);
> +     }
> +   }
> ++  else if (s->cfg->pid == MG3200_PID)
> ++  /* MG3200 series: SCAN is the only button reported; flag in buf[4]. */
> ++  {
> ++    if (buf[4] & 1)
> ++    {
> ++      /* start scan */
> ++      s->events = PIXMA_EV_BUTTON1;
> ++    }
> ++  }
> +   else
> +   /* button no. in buf[0]
> +    * original in buf[0]
> 
> 
> -- 
> Regards,
>  Mikolaj
> 

-- 
Antoine
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.