summaryrefslogtreecommitdiff
path: root/hardsid.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardsid.c')
-rw-r--r--hardsid.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hardsid.c b/hardsid.c
index a7bed75..6a71bca 100644
--- a/hardsid.c
+++ b/hardsid.c
@@ -44,7 +44,7 @@
/* The maximum amount we support in a write call
*/
-#define MAXREADBUFF 256
+#define MAXWRITEBUFF 256
/* The softc holds our per-instance data.
*/
@@ -84,7 +84,10 @@ static struct cdevsw hardsid_cdevsw =
*/
static void SetSIDReg(struct hardsid_softc *sc, int reg, int value)
{
- bus_space_write_2(sc->res_bt, sc->res_bh, 3, reg << 8 | value);
+ //bus_space_write_2(sc->res_bt, sc->res_bh, 2, reg << 8 | value);
+ bus_space_write_1(sc->res_bt, sc->res_bh, 2, value);
+ bus_space_write_1(sc->res_bt, sc->res_bh, 3, reg);
+ tsleep(sc, 0, "sleep", hz/200);
}
int hardsid_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
@@ -137,11 +140,11 @@ int hardsid_read(struct cdev *dev, struct uio *uio, int ioflag)
int hardsid_write(struct cdev *dev, struct uio *uio, int ioflag)
{
struct hardsid_softc *sc;
- unsigned char buff[MAXREADBUFF];
+ unsigned char buff[MAXWRITEBUFF];
int len;
int f;
- if (uio->uio_resid > MAXREADBUFF)
+ if (uio->uio_resid > MAXWRITEBUFF)
{
return EINVAL;
}