c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * CDDL HEADER START
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * The contents of this file are subject to the terms of the
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * Common Development and Distribution License (the "License").
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * You may not use this file except in compliance with the License.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * See the License for the specific language governing permissions
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * and limitations under the License.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * When distributing Covered Code, include this CDDL HEADER in each
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * If applicable, add the following below this CDDL HEADER, with the
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * fields enclosed by brackets "[]" replaced with your own identifying
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * information: Portions Copyright [yyyy] [name of copyright owner]
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * CDDL HEADER END
613b28719c10e84c1202c1045df44d77767de21dRichard Bean * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * Use is subject to license terms.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * Simple beeper support for PC platform, using standard timer 2 beeper.
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx /* Dip of pit_beep device */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* Pointer to the state structure */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic int pit_beep_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic int pit_beep_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic int pit_beep_info(dev_info_t *dip, ddi_info_cmd_t infocmd,
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx 0, /* Refcnt */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx 0, /* Bus operations */
613b28719c10e84c1202c1045df44d77767de21dRichard Bean "Intel Pit_beep Driver", /* Name of the module. */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx /* Initialize the soft state structures */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx /* Install the loadable module */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx if (error == 0) {
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx /* Release per module resources */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * pit_beep_attach:
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx switch (cmd) {
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx (void) beep_init((void *)dip, pit_beep_on, pit_beep_off,
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx /* Display information in the banner */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * pit_beep_detach:
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* ARGSUSED */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx switch (cmd) {
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * If a beep is in progress; fail suspend
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx * pit_beep_info:
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* ARGSUSED */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* ARGSUSED */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic void
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx outb(PITCTL_PORT, PIT_C2 | PIT_READMODE | PIT_RATEMODE);
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* ARGSUSED */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic void
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx outb(PITAUX_PORT, inb(PITAUX_PORT) | (PITAUX_OUT2 | PITAUX_GATE2));
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarx/* ARGSUSED */
c35aa225b9ae500f1d14f0d39a94f1eb6cda333dmarxstatic void