Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips add UCB1200 sound module ucbsnd (core imple...
details: https://anonhg.NetBSD.org/src/rev/eadff6fcc141
branches: trunk
changeset: 480432:eadff6fcc141
user: uch <uch%NetBSD.org@localhost>
date: Wed Jan 12 14:56:17 2000 +0000
description:
add UCB1200 sound module ucbsnd (core implementation only)
UCB1200 touch panel module moved to ucbtp and sync with vrpiu.
diffstat:
sys/arch/hpcmips/conf/TX3912 | 12 +-
sys/arch/hpcmips/conf/files.hpcmips | 19 +-
sys/arch/hpcmips/dev/skbd.c | 18 +-
sys/arch/hpcmips/dev/ucb1200.c | 687 +++------------------------------
sys/arch/hpcmips/dev/ucb1200reg.h | 79 +++-
sys/arch/hpcmips/dev/ucb1200var.h | 89 +---
sys/arch/hpcmips/dev/ucbsnd.c | 376 ++++++++++++++++++
sys/arch/hpcmips/dev/ucbtp.c | 732 ++++++++++++++++++++++++++++++++++++
sys/arch/hpcmips/tx/tx39.c | 14 +-
sys/arch/hpcmips/tx/tx39sib.c | 165 +++++++-
sys/arch/hpcmips/tx/tx39sibvar.h | 10 +-
sys/arch/hpcmips/tx/tx39var.h | 4 +-
sys/arch/hpcmips/tx/txsim.c | 5 +-
sys/arch/hpcmips/tx/txsnd.c | 52 ++
sys/arch/hpcmips/tx/txsnd.h | 41 ++
15 files changed, 1582 insertions(+), 721 deletions(-)
diffs (truncated from 2672 to 300 lines):
diff -r b9c90da69fdb -r eadff6fcc141 sys/arch/hpcmips/conf/TX3912
--- a/sys/arch/hpcmips/conf/TX3912 Wed Jan 12 14:53:17 2000 +0000
+++ b/sys/arch/hpcmips/conf/TX3912 Wed Jan 12 14:56:17 2000 +0000
@@ -2,7 +2,7 @@
# Distribution kernel (TX3912 based model) kernel config file
#
-# $NetBSD: TX3912,v 1.6 2000/01/09 07:57:43 shin Exp $
+# $NetBSD: TX3912,v 1.7 2000/01/12 14:56:22 uch Exp $
#
include "arch/hpcmips/conf/std.hpcmips"
@@ -79,26 +79,28 @@
txcsbus5 at tx39biu? platform SHARP_MOBILON
txcsbus* at tx39biu? # misc unknown.
-# PHILIPS 74ALVC*1624? connected keyboard
+# PHILIPS 74ALVC*1624? / TOSHIBA TC5165BFTS buffer chip (keyboard)
#
tc5165buf* at txcsbus3 iocs 3 iocsbase 0 iocssize 0x100 iocswidth 16
tc5165buf* at txcsbus5 iocs 4 iocsbase 0 iocssize 0x100 iocswidth 16
skbd* at tc5165buf?
-# ITE IT8368E PCMCIA buffer chip
+# ITE IT8368E PCMCIA / TOSHIBA TC6345AF buffer chip (PCMCIA)
# card ... 3:2 (98)
# insert/remove ... 5:1/8 (161/168)
options IT8368E_LEGACY_MODE # Mobilon HC-4100 requires this
it8368e* at txcsbus? regcs 2 regcsbase 0 regcssize 0x20 regcswidth 16 iocs 8 iocsbase 0 iocssize 0x4000000 iocswidth 16 irq1 161 irq2 168 irq3 98
-# PHILIPS UCB1200 modem/audio analog front-end
+# PHILIPS UCB1200 / TOSHIBA TC35413F (modem/audio analog front-end)
ucb* at tx39sib? slot 0
+ucbtp* at ucb?
+ucbsnd* at ucb?
# WS console uses SUN or VT100 terminal emulation
fb* at tx3912video?
wsdisplay* at fb?
wskbd* at skbd? mux 1
-wsmouse* at ucb? mux 0
+wsmouse* at ucbtp? mux 0
options WSEMUL_VT100
options WSDISPLAY_DEFAULTSCREENS=4
diff -r b9c90da69fdb -r eadff6fcc141 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips Wed Jan 12 14:53:17 2000 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips Wed Jan 12 14:56:17 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.hpcmips,v 1.16 2000/01/10 14:08:05 takemura Exp $
+# $NetBSD: files.hpcmips,v 1.17 2000/01/12 14:56:23 uch Exp $
# maxpartitions must be first item in files.${ARCH}.
maxpartitions 8
@@ -173,9 +173,11 @@
device txcsbusif {[platform = -1]}
device txcomif {[slot = -1]}
device txsibif {[slot = -1]}
+device ucbif { }
attach txsim at mainbus
file arch/hpcmips/tx/txsim.c txsim
+file arch/hpcmips/tx/txsnd.c txsim
device tx39biu: txcsbusif
attach tx39biu at txsim
@@ -209,11 +211,18 @@
attach tx39sib at txsim
file arch/hpcmips/tx/tx39sib.c tx39sib
-# PHILIPS UCB1200 modem/audio analog front-end
-device ucb: wsmousedev
-attach ucb at txsibif: tpcalib
+# PHILIPS UCB1200 / TOSHIBA TC35413F (modem/audio analog front-end)
+device ucb: ucbif
+attach ucb at txsibif
file arch/hpcmips/dev/ucb1200.c ucb
+device ucbtp: wsmousedev
+attach ucbtp at ucbif: tpcalib
+file arch/hpcmips/dev/ucbtp.c ucbtp
+
+device ucbsnd
+attach ucbsnd at ucbif
+file arch/hpcmips/dev/ucbsnd.c ucbsnd
device tx39uart: txcomif
attach tx39uart at txsim
@@ -223,7 +232,7 @@
attach txcom at txcomif
file arch/hpcmips/tx/txcom.c txcom
-# ITE 8368E PCMCIA controller
+# ITE IT8368E PCMCIA / TOSHIBA TC6345AF buffer chip (PCMCIA)
device it8368e: pcmciabus
attach it8368e at txcsbus
file arch/hpcmips/dev/it8368.c it8368e
diff -r b9c90da69fdb -r eadff6fcc141 sys/arch/hpcmips/dev/skbd.c
--- a/sys/arch/hpcmips/dev/skbd.c Wed Jan 12 14:53:17 2000 +0000
+++ b/sys/arch/hpcmips/dev/skbd.c Wed Jan 12 14:56:17 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: skbd.c,v 1.1 1999/12/08 15:49:18 uch Exp $ */
+/* $NetBSD: skbd.c,v 1.2 2000/01/12 14:56:22 uch Exp $ */
/*
* Copyright (c) 1999, by UCHIYAMA Yasushi
@@ -25,6 +25,8 @@
* SUCH DAMAGE.
*
*/
+#include "opt_tx39xx.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
@@ -47,6 +49,11 @@
#include <hpcmips/dev/skbdvar.h>
#include <hpcmips/dev/skbdkeymap.h>
+#ifdef TX39XX
+#include <hpcmips/tx/tx39var.h>
+#include <hpcmips/tx/txsnd.h>
+#endif
+
struct skbd_softc;
struct skbd_chip {
@@ -209,7 +216,14 @@
struct skbd_chip *sk = arg;
int type, key;
- type = flag ? WSCONS_EVENT_KEY_DOWN : WSCONS_EVENT_KEY_UP;
+ if (flag) {
+#ifdef TX39XX
+ tx_sound_click(tx_conf_get_tag());
+#endif
+ type = WSCONS_EVENT_KEY_DOWN;
+ } else {
+ type = WSCONS_EVENT_KEY_UP;
+ }
if ((key = sk->sk_keymap[scancode]) == UNK) {
printf("skbd: unknown scan code %#x\n", scancode);
diff -r b9c90da69fdb -r eadff6fcc141 sys/arch/hpcmips/dev/ucb1200.c
--- a/sys/arch/hpcmips/dev/ucb1200.c Wed Jan 12 14:53:17 2000 +0000
+++ b/sys/arch/hpcmips/dev/ucb1200.c Wed Jan 12 14:56:17 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucb1200.c,v 1.1 2000/01/08 21:07:04 uch Exp $ */
+/* $NetBSD: ucb1200.c,v 1.2 2000/01/12 14:56:22 uch Exp $ */
/*
* Copyright (c) 2000, by UCHIYAMA Yasushi
@@ -29,10 +29,8 @@
/*
* Device driver for PHILIPS UCB1200 Advanced modem/audio analog front-end
*/
-#define UCB1200DEBUG
-
+#undef UCB1200DEBUG
#include "opt_tx39_debug.h"
-#include "opt_use_poll.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -40,17 +38,10 @@
#include <machine/bus.h>
#include <machine/intr.h>
-#include <machine/bootinfo.h> /* bootinfo */
-
-#include <dev/wscons/wsconsio.h>
-#include <dev/wscons/wsmousevar.h>
#include <hpcmips/tx/tx39var.h>
#include <hpcmips/tx/tx39sibvar.h>
#include <hpcmips/tx/tx39sibreg.h>
-#include <hpcmips/tx/tx39icureg.h>
-
-#include <hpcmips/tx/tx3912videovar.h> /* debug */
#include <hpcmips/dev/ucb1200var.h>
#include <hpcmips/dev/ucb1200reg.h>
@@ -61,147 +52,37 @@
#define DPRINTFN(n, arg) if (ucb1200_debug > (n)) printf arg;
#else
#define DPRINTF(arg)
+#define DPRINTFN(n, arg)
#endif
+struct ucbchild_state {
+ int (*cs_busy) __P((void*));
+ void *cs_arg;
+};
+
+struct ucb1200_softc {
+ struct device sc_dev;
+ struct device *sc_parent; /* parent (TX39 SIB module) */
+ tx_chipset_tag_t sc_tc;
+
+ int sc_snd_rate; /* passed down from SIB module */
+ int sc_tel_rate;
+
+ /* inquire child module state */
+ struct ucbchild_state sc_child[UCB1200_MODULE_MAX];
+};
+
int ucb1200_match __P((struct device*, struct cfdata*, void*));
void ucb1200_attach __P((struct device*, struct device*, void*));
-int ucb1200_idcheck __P((bus_space_tag_t));
-
-void ucb1200_dump __P((struct ucb1200_softc*));
-int ucb1200_sibintr __P((void*));
-int ucb1200_poll __P((void*));
-
-int ucb1200_adc_async __P((void*));
-int ucb1200_input __P((struct ucb1200_softc*));
+int ucb1200_print __P((void*, const char*));
+int ucb1200_search __P((struct device*, struct cfdata*, void*));
-void ucb1200_intr_ack_sync __P((struct ucb1200_softc*));
-int ucb1200_adc_sync __P((struct ucb1200_softc*, int, int*));
-
-int ucb_ts_enable __P((void*));
-int ucb_ts_ioctl __P((void*, u_long, caddr_t, int, struct proc*));
-void ucb_ts_disable __P((void*));
-
-/* mra is defined in mra.c */
-int mra_Y_AX1_BX2_C __P((int *y, int ys, int *x1, int x1s, int *x2, int x2s,
- int n, int scale, int *a, int *b, int *c));
+void ucb1200_dump __P((struct ucb1200_softc*));
struct cfattach ucb_ca = {
sizeof(struct ucb1200_softc), ucb1200_match, ucb1200_attach
};
-const struct wsmouse_accessops ucb_ts_accessops = {
- ucb_ts_enable,
- ucb_ts_ioctl,
- ucb_ts_disable,
-};
-
-/*
- * XXX currently no calibration method. this is temporary hack.
- */
-#include <machine/platid.h>
-#define NSAMPLE 5
-
-struct calibration_sample *calibration_sample_lookup __P((void));
-int ucb1200_tp_calibration __P((struct ucb1200_softc*));
-
-struct calibration_sample {
- int cs_xraw, cs_yraw, cs_x, cs_y;
-};
-
-struct calibration_sample_table {
- platid_t cst_platform;
- struct calibration_sample cst_sample[NSAMPLE];
-} calibration_sample_table[] = {
- {{{PLATID_WILD, PLATID_MACH_COMPAQ_C_8XX}}, /* uch machine */
- {{ 507, 510, 320, 120 },
- { 898, 757, 40, 40 },
- { 900, 255, 40, 200 },
- { 109, 249, 600, 200 },
- { 110, 753, 600, 40 }}},
-
- {{{PLATID_WILD, PLATID_MACH_COMPAQ_C_2010}}, /* uch machine */
- {{ 506, 487, 320, 120 },
- { 880, 250, 40, 40 },
- { 880, 718, 40, 200 },
- { 140, 726, 600, 200 },
- { 137, 250, 600, 40 }}},
-
- {{{PLATID_WILD, PLATID_MACH_SHARP_MOBILON_HC4100}}, /* uch machine */
- {{ 497, 501, 320, 120 },
- { 752, 893, 40, 40 },
- { 242, 891, 40, 200 },
- { 241, 115, 600, 200 },
- { 747, 101, 600, 40 }}},
-
- {{{PLATID_UNKNOWN, PLATID_UNKNOWN}},
- {{0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0},
- {0, 0, 0, 0}}},
-};
-
-struct calibration_sample*
-calibration_sample_lookup()
-{
- struct calibration_sample_table *tab;
- platid_mask_t mask;
-
- for (tab = calibration_sample_table;
- tab->cst_platform.dw.dw1 != PLATID_UNKNOWN; tab++) {
-
- mask = PLATID_DEREF(&tab->cst_platform);
-
- if (platid_match(&platid, &mask)) {
- return tab->cst_sample;
Home |
Main Index |
Thread Index |
Old Index