/* * * smapi.c -- SMAPI interface routines * * * Written By: Mike Sullivan IBM Corporation * * Copyright (C) 1999 IBM Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * NO WARRANTY * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is * solely responsible for determining the appropriateness of using and * distributing the Program and assumes all risks associated with its * exercise of rights under this Agreement, including but not limited to * the risks and costs of program errors, damage to or loss of data, * programs or equipment, and unavailability or interruption of operations. * * DISCLAIMER OF LIABILITY * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * 10/23/2000 - Alpha Release * First release to the public */ #include <linux/kernel.h> #include <linux/mc146818rtc.h> /* CMOS defines */ #include "smapi.h" #include "mwavedd.h" static unsigned short g_usSmapiPort = …; static int smapi_request(unsigned short inBX, unsigned short inCX, unsigned short inDI, unsigned short inSI, unsigned short *outAX, unsigned short *outBX, unsigned short *outCX, unsigned short *outDX, unsigned short *outDI, unsigned short *outSI) { … } int smapi_query_DSP_cfg(SMAPI_DSP_SETTINGS * pSettings) { … } int smapi_set_DSP_cfg(void) { … } int smapi_set_DSP_power_state(bool bOn) { … } #if 0 static int SmapiQuerySystemID(void) { int bRC = -EIO; unsigned short usAX = 0xffff, usBX = 0xffff, usCX = 0xffff, usDX = 0xffff, usDI = 0xffff, usSI = 0xffff; printk("smapi::SmapiQUerySystemID entry\n"); bRC = smapi_request(0x0000, 0, 0, 0, &usAX, &usBX, &usCX, &usDX, &usDI, &usSI); if (bRC == 0) { printk("AX=%x, BX=%x, CX=%x, DX=%x, DI=%x, SI=%x\n", usAX, usBX, usCX, usDX, usDI, usSI); } else { printk("smapi::SmapiQuerySystemID smapi_request error\n"); } return bRC; } #endif /* 0 */ int smapi_init(void) { … }