From nobody@FreeBSD.ORG  Sat Jul 29 22:05:22 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 7701937B6D9; Sat, 29 Jul 2000 22:05:22 -0700 (PDT)
Message-Id: <20000730050522.7701937B6D9@hub.freebsd.org>
Date: Sat, 29 Jul 2000 22:05:22 -0700 (PDT)
From: stake@po.shiojiri.ne.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Joystick is not enabled with es1370 based soundcard.
X-Send-Pr-Version: www-1.0

>Number:         20297
>Category:       kern
>Synopsis:       [sound] [patch] Joystick is not enabled with es1370 based soundcard.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 29 22:10:01 PDT 2000
>Closed-Date:    Wed Dec 28 18:42:22 GMT 2005
>Last-Modified:  Wed Dec 28 18:42:22 GMT 2005
>Originator:     Takefumi SAYO
>Release:        4.1-STABLE
>Organization:
Personal
>Environment:
FreeBSD vipal5.my.domain 4.1-STABLE FreeBSD 4.1-STABLE #1: Sun Jul 30 13:22:40 JST 2000     root@vipal5.my.domain:/usr/src/sys/compile/TEST  i386
>Description:
Joystick is not enabled with es1370 based soundcard.

$ grep '$FreeBSD:' /usr/src/sys/dev/sound/pci/es137x.*
/usr/src/sys/dev/sound/pci/es137x.c: * $FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.13.2.2 2000/07/19 21:18:45 cg Exp $
/usr/src/sys/dev/sound/pci/es137x.h: * $FreeBSD: src/sys/dev/sound/pci/es137x.h,v 1.3.2.2 2000/07/19 21:18:45 cg Exp $
>How-To-Repeat:
1. Boot TEST kernel.
$ diff GENERIC TEST 
235a236,241
> 
> # For PnP/PCI sound cards
> device          pcm
> 
> # joy: joystick
> device          joy0    at isa? port IO_GAME

2. Run joy(4) example program.
$ perl -e 'open(JOY,"/dev/joy0")||die;while(1){sysread(JOY,$x,16);@j=unpack("iiii",$x);print "@j\n";sleep(1);}'
-2147483648 -2147483648 0 0
-2147483648 -2147483648 0 0
-2147483648 -2147483648 0 0
-2147483648 -2147483648 0 0

>Fix:
Add CTRL_JYSTK_EN to es->ctrl in es1370_init().
(but checking io port may be needed...)

$ diff -c es137x.c.dist es137x.c
*** es137x.c.dist       Thu Jul 20 06:18:45 2000
--- es137x.c    Sun Jul 30 13:22:23 2000
***************
*** 466,471 ****
--- 466,472 ----
  es1370_init(struct es_info *es)
  {
        es->ctrl = CTRL_CDC_EN | CTRL_SERR_DIS |
+               CTRL_UART_EN | CTRL_JYSTK_EN | 
                (DAC2_SRTODIV(DSP_DEFAULT_SPEED) << CTRL_SH_PCLKDIV);
        bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL, es->ctrl);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 31 02:42:12 PDT 2000 
Responsible-Changed-Why:  
Cameron, this one contains a patch. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20297 

From: Christopher Masto <chris@netmonger.net>
To: freebsd-gnats-submit@FreeBSD.org, stake@niagara.shiojiri.ne.jp
Cc:  
Subject: Re: kern/20297: Joystick is not enabled with es1370 based soundcard.
Date: Sun, 21 Apr 2002 16:54:08 -0400

 FWIW, there seems to be a similar method to enable the joystick on
 es1371-based cards.  The difference seems to be that it is necessary
 to specify the IO address instead of just a boolean.  Apparently this
 is done on Linux.
 
 http://groups.google.com/groups?selm=lxpatch.v2.1patch-2.1.132.pt35.36805F24%40mvmap66.ciw.uni-karlsruhe.de
 
 I was about to try to get it working, but I won't be able to spend the
 time on it for a while.  I just noticed this PR and even though it's
 old, I might as well add this info.
 -- 
 Christopher Masto
 
 CB461C61 8AFC E3A8 7CE5 9023 B35D  C26A D849 1F6E CB46 1C61
Responsible-Changed-From-To: cg->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 9 19:32:46 GMT 2004 
Responsible-Changed-Why:  
With permission, reassign to mailing list alias. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20297 
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Wed Dec 28 18:42:14 UTC 2005 
State-Changed-Why:  
Fixed in -current. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20297 
>Unformatted:
