From nsayer@quack.kfu.com  Sun Sep 28 22:08:50 1997
Received: from quack.kfu.com (0@quack.kfu.com [204.147.226.1])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA16880
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Sep 1997 22:08:47 -0700 (PDT)
Received: from icarus.kfu.com (icarus.kfu.com [204.147.226.3])
	by quack.kfu.com (8.8.5/8.8.5) with ESMTP id WAA11240
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 28 Sep 1997 22:08:45 -0700 (PDT)
Received: by icarus.kfu.com 
        (8.8.2//ident-1.0) id WAA09986; Sun, 28 Sep 1997 22:08:44 -0700 (PDT) 
Message-Id: <199709290508.WAA09986@icarus.kfu.com>
Date: Sun, 28 Sep 1997 22:08:44 -0700 (PDT)
From: <nsayer@quack.kfu.com>
Reply-To: nsayer@quack.kfu.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Cirrus Logic pcic chips need audio bit & LPDM bit set.
X-Send-Pr-Version: 3.2

>Number:         4650
>Category:       kern
>Synopsis:       Cirrus Logic pcic chips need audio bit & LPDM bit set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          support
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 28 22:10:00 PDT 1997
>Closed-Date:    Sun Oct 5 20:17:41 PDT 1997
>Last-Modified:  Sun Oct  5 20:18:07 PDT 1997
>Originator:     Nick Sayer
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
>Environment:

Laptops (or desktops) with Cirrus Logic PD672x chipsets.

>Description:

PCMCIA modem cards send the speaker audio (dialing noises) to the
host to be sent to the speaker. Cirrus Logic PCIC chips have a
bit to enable or disable this, and it is disabled by default.

There is also a Low Power Dynamic Mode bit (this one is one per
chip rather than one per slot, but it doesn't hurt to set it per
slot - extras are ignored) that the docco claims will reduce PCIC
power consumption by 30% or so. I have seen no ill effects from
turning this bit on.

>How-To-Repeat:

>Fix:
	

*** pcic.c.orig	Sun Jul  6 09:11:53 1997
--- pcic.c	Sun Jul  6 10:19:03 1997
***************
*** 949,954 ****
--- 949,961 ----
  				printf("pcic: controller irq %d\n", pcic_irq);
  		}
  #endif	/* PCIC_NO_IRQ */
+ #ifndef NOCIRRUSHACK
+ 		if (sp->controller == PCIC_PD672X)
+ 		{
+ 			setb (sp, PCIC_MISC1, PCIC_SPKR_EN);
+ 			setb (sp, PCIC_MISC2, PCIC_LPDM_EN);
+ 		}
+ #endif
  		/*
  		 *	Check for a card in this slot.
  		 */
***************
*** 1331,1334 ****
--- 1338,1348 ----
  
  	if (pcic_irq > 0)
  		sp->putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF);
+ #ifndef NOCIRRUSHACK
+ 	if (sp->controller == PCIC_PD672X)
+ 	{
+ 		setb (sp, PCIC_MISC1, PCIC_SPKR_EN);
+ 		setb (sp, PCIC_MISC2, PCIC_LPDM_EN);
+ 	}
+ #endif
  }
*** i82365.h.orig	Sun Jul  6 09:11:52 1997
--- i82365.h	Sun Jul  6 09:15:04 1997
***************
*** 84,90 ****
--- 84,92 ----
  #define PCIC_IO1	0x0c	/* I/O Address 1 */
  #define	PCIC_MEMBASE	0x10	/* Base of memory window registers */
  #define PCIC_CDGC	0x16	/* Card Detect and General Control */
+ #define PCIC_MISC1	0x16	/* PD672x: Misc control register 1 per slot */
  #define PCIC_GLO_CTRL	0x1e	/* Global Control Register */
+ #define PCIC_MISC2	0x1e	/* PD672x: Misc control register 2 per chip */
  
  #define	PCIC_TIME_SETUP0	0x3a
  #define	PCIC_TIME_CMD0		0x3b
***************
*** 205,210 ****
--- 207,215 ----
  #define PCIC_CDRES_EN	0x10	/* card detect resume enable */
  #define PCIC_SW_CD_INT	0x20	/* s/w card detect interrupt */
  
+ /* For Misc. Control Register 1 */
+ #define PCIC_SPKR_EN	0x10	/* Cirrus PD672x: speaker enable */
+ 
  /* For Global Control register (PCIC_GLO_CTRL) */
  #define PCIC_PWR_DOWN	0x01	/* power down */
  #define PCIC_LVL_MODE	0x02	/* level mode interrupt enable */
***************
*** 212,217 ****
--- 217,224 ----
  #define PCIC_IRQ0_LEVEL 0x08	/* irq 14 pulse mode enable */
  #define PCIC_IRQ1_LEVEL 0x10
  
+ /* For Misc. Control Register 2 */
+ #define PCIC_LPDM_EN	0x02	/* Cirrus PD672x: low power dynamic mode */
  /*
   *	Mask of allowable interrupts.
   *	Ints are 3,4,5,7,9,10,11,12,14,15
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nate 
State-Changed-When: Sun Oct 5 20:17:41 PDT 1997 
State-Changed-Why:  
Applied, thanks! 

>Unformatted:
