summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-04-23 16:27:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-04-23 16:27:21 +0000
commit7c3cd069b16c4f1ecfd0a754ef0889a1a8525e53 (patch)
tree92270b8a5d75ab98a7080afdafe66a2f910c545f /sys/arch/macppc/dev
parente04c5d3fbea31227520ebab8aad2dd7a192f3011 (diff)
rename drivers with numbers in them; ok gwk drahn
Diffstat (limited to 'sys/arch/macppc/dev')
-rw-r--r--sys/arch/macppc/dev/adb.c4
-rw-r--r--sys/arch/macppc/dev/daca.c14
-rw-r--r--sys/arch/macppc/dev/kiic.c (renamed from sys/arch/macppc/dev/ki2c.c)180
-rw-r--r--sys/arch/macppc/dev/kiicvar.h (renamed from sys/arch/macppc/dev/ki2cvar.h)16
-rw-r--r--sys/arch/macppc/dev/onyx.c16
-rw-r--r--sys/arch/macppc/dev/piic.c (renamed from sys/arch/macppc/dev/pi2c.c)44
-rw-r--r--sys/arch/macppc/dev/snapper.c14
-rw-r--r--sys/arch/macppc/dev/tumbler.c12
8 files changed, 150 insertions, 150 deletions
diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c
index f0ad5dc32b5..600f1cbe462 100644
--- a/sys/arch/macppc/dev/adb.c
+++ b/sys/arch/macppc/dev/adb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.c,v 1.26 2007/04/22 22:31:14 deraadt Exp $ */
+/* $OpenBSD: adb.c,v 1.27 2007/04/23 16:27:20 deraadt Exp $ */
/* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */
/* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */
@@ -1709,7 +1709,7 @@ adbattach(struct device *parent, struct device *self, void *aux)
if (OF_getprop(node, "name", name, sizeof name) <= 0)
continue;
if (strcmp(name, "pmu-i2c") == 0) {
- nca.ca_name = "pi2c";
+ nca.ca_name = "piic";
nca.ca_node = node;
config_found(self, &nca, NULL);
}
diff --git a/sys/arch/macppc/dev/daca.c b/sys/arch/macppc/dev/daca.c
index 834e7478e02..8fcf8053e6d 100644
--- a/sys/arch/macppc/dev/daca.c
+++ b/sys/arch/macppc/dev/daca.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: daca.c,v 1.3 2005/11/20 19:54:05 brad Exp $ */
-/* $Id: daca.c,v 1.3 2005/11/20 19:54:05 brad Exp $ */
+/* $OpenBSD: daca.c,v 1.4 2007/04/23 16:27:20 deraadt Exp $ */
+/* $Id: daca.c,v 1.4 2007/04/23 16:27:20 deraadt Exp $ */
/*-
* Copyright (c) 2002,2003 Tsubai Masanari. All rights reserved.
@@ -55,8 +55,8 @@
#define daca_softc i2s_softc
/* XXX */
-int ki2c_write(struct device *, int, int, const void *, int);
-int ki2c_writereg(struct device *, int, u_int);
+int kiic_write(struct device *, int, int, const void *, int);
+int kiic_writereg(struct device *, int, u_int);
int daca_getdev(void *, struct audio_device *);
int daca_match(struct device *, void *, void *);
@@ -156,7 +156,7 @@ daca_defer(struct device *dev)
struct device *dv;
TAILQ_FOREACH(dv, &alldevs, dv_list)
- if (strncmp(dv->dv_xname, "ki2c", 4) == 0 &&
+ if (strncmp(dv->dv_xname, "kiic", 4) == 0 &&
strncmp(dv->dv_parent->dv_xname, "macobio", 7) == 0)
sc->sc_i2c = dv;
if (sc->sc_i2c == NULL) {
@@ -175,7 +175,7 @@ void
daca_init(struct daca_softc *sc)
{
i2s_set_rate(sc, 44100);
- ki2c_writereg(sc->sc_i2c, 4, 0x01 | 0x02 | 0x04);
+ kiic_writereg(sc->sc_i2c, 4, 0x01 | 0x02 | 0x04);
}
int
@@ -196,5 +196,5 @@ daca_set_volume(struct daca_softc *sc, int left, int right)
left >>= 2;
right >>= 2;
data = left << 8 | right;
- ki2c_write(sc->sc_i2c, DEQaddr, DEQ_AVOL, &data, 2);
+ kiic_write(sc->sc_i2c, DEQaddr, DEQ_AVOL, &data, 2);
}
diff --git a/sys/arch/macppc/dev/ki2c.c b/sys/arch/macppc/dev/kiic.c
index 51dbe47338d..85ea7cfcd86 100644
--- a/sys/arch/macppc/dev/ki2c.c
+++ b/sys/arch/macppc/dev/kiic.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ki2c.c,v 1.13 2006/06/19 22:42:33 miod Exp $ */
-/* $NetBSD: ki2c.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
+/* $OpenBSD: kiic.c,v 1.1 2007/04/23 16:27:20 deraadt Exp $ */
+/* $NetBSD: kiic.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
* Copyright (c) 2001 Tsubai Masanari. All rights reserved.
@@ -35,43 +35,43 @@
#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
-#include <macppc/dev/ki2cvar.h>
+#include <macppc/dev/kiicvar.h>
#include <macppc/dev/maci2cvar.h>
-int ki2c_match(struct device *, void *, void *);
-void ki2c_attach(struct device *, struct device *, void *);
-void ki2c_attach_bus(struct ki2c_softc *, struct ki2c_bus *, int);
-inline u_int ki2c_readreg(struct ki2c_softc *, int);
-inline void ki2c_writereg(struct ki2c_softc *, int, u_int);
-u_int ki2c_getmode(struct ki2c_softc *);
-void ki2c_setmode(struct ki2c_softc *, u_int, u_int);
-u_int ki2c_getspeed(struct ki2c_softc *);
-void ki2c_setspeed(struct ki2c_softc *, u_int);
-int ki2c_intr(struct ki2c_softc *);
-int ki2c_poll(struct ki2c_softc *, int);
-int ki2c_start(struct ki2c_softc *, int, int, void *, int);
-int ki2c_read(struct ki2c_softc *, int, int, void *, int);
-int ki2c_write(struct ki2c_softc *, int, int, const void *, int);
+int kiic_match(struct device *, void *, void *);
+void kiic_attach(struct device *, struct device *, void *);
+void kiic_attach_bus(struct kiic_softc *, struct kiic_bus *, int);
+inline u_int kiic_readreg(struct kiic_softc *, int);
+inline void kiic_writereg(struct kiic_softc *, int, u_int);
+u_int kiic_getmode(struct kiic_softc *);
+void kiic_setmode(struct kiic_softc *, u_int, u_int);
+u_int kiic_getspeed(struct kiic_softc *);
+void kiic_setspeed(struct kiic_softc *, u_int);
+int kiic_intr(struct kiic_softc *);
+int kiic_poll(struct kiic_softc *, int);
+int kiic_start(struct kiic_softc *, int, int, void *, int);
+int kiic_read(struct kiic_softc *, int, int, void *, int);
+int kiic_write(struct kiic_softc *, int, int, const void *, int);
/* I2C glue */
-int ki2c_i2c_acquire_bus(void *, int);
-void ki2c_i2c_release_bus(void *, int);
-int ki2c_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
+int kiic_i2c_acquire_bus(void *, int);
+void kiic_i2c_release_bus(void *, int);
+int kiic_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
void *, size_t, int);
-struct cfattach ki2c_ca = {
- sizeof(struct ki2c_softc), ki2c_match, ki2c_attach
+struct cfattach kiic_ca = {
+ sizeof(struct kiic_softc), kiic_match, kiic_attach
};
-struct cfattach ki2c_memc_ca = {
- sizeof(struct ki2c_softc), ki2c_match, ki2c_attach
+struct cfattach kiic_memc_ca = {
+ sizeof(struct kiic_softc), kiic_match, kiic_attach
};
-struct cfdriver ki2c_cd = {
- NULL, "ki2c", DV_DULL
+struct cfdriver kiic_cd = {
+ NULL, "kiic", DV_DULL
};
int
-ki2c_match(struct device *parent, void *match, void *aux)
+kiic_match(struct device *parent, void *match, void *aux)
{
struct confargs *ca = aux;
@@ -83,9 +83,9 @@ ki2c_match(struct device *parent, void *match, void *aux)
}
void
-ki2c_attach(struct device *parent, struct device *self, void *aux)
+kiic_attach(struct device *parent, struct device *self, void *aux)
{
- struct ki2c_softc *sc = (struct ki2c_softc *)self;
+ struct kiic_softc *sc = (struct kiic_softc *)self;
struct confargs *ca = aux;
int node = ca->ca_node;
int rate, count = 0;
@@ -109,21 +109,21 @@ ki2c_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
- ki2c_writereg(sc, STATUS, 0);
- ki2c_writereg(sc, ISR, 0);
- ki2c_writereg(sc, IER, 0);
+ kiic_writereg(sc, STATUS, 0);
+ kiic_writereg(sc, ISR, 0);
+ kiic_writereg(sc, IER, 0);
- ki2c_setmode(sc, I2C_STDSUBMODE, 0);
- ki2c_setspeed(sc, I2C_100kHz); /* XXX rate */
+ kiic_setmode(sc, I2C_STDSUBMODE, 0);
+ kiic_setspeed(sc, I2C_100kHz); /* XXX rate */
lockinit(&sc->sc_buslock, PZERO, sc->sc_dev.dv_xname, 0, 0);
- ki2c_writereg(sc, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
+ kiic_writereg(sc, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
for (node = OF_child(ca->ca_node); node; node = OF_peer(node)) {
if (OF_getprop(node, "name", &name, sizeof name) > 0) {
if (strcmp(name, "i2c-bus") == 0) {
- ki2c_attach_bus(sc, &sc->sc_bus[count], node);
- if (++count >= KI2C_MAX_BUSSES)
+ kiic_attach_bus(sc, &sc->sc_bus[count], node);
+ if (++count >= KIIC_MAX_BUSSES)
break;
}
}
@@ -135,11 +135,11 @@ ki2c_attach(struct device *parent, struct device *self, void *aux)
*/
if (count == 0)
- ki2c_attach_bus(sc, &sc->sc_bus[0], ca->ca_node);
+ kiic_attach_bus(sc, &sc->sc_bus[0], ca->ca_node);
}
void
-ki2c_attach_bus(struct ki2c_softc *sc, struct ki2c_bus *bus, int node)
+kiic_attach_bus(struct kiic_softc *sc, struct kiic_bus *bus, int node)
{
struct i2cbus_attach_args iba;
u_int32_t reg;
@@ -149,9 +149,9 @@ ki2c_attach_bus(struct ki2c_softc *sc, struct ki2c_bus *bus, int node)
bus->sc = sc;
bus->i2c_tag.ic_cookie = bus;
- bus->i2c_tag.ic_acquire_bus = ki2c_i2c_acquire_bus;
- bus->i2c_tag.ic_release_bus = ki2c_i2c_release_bus;
- bus->i2c_tag.ic_exec = ki2c_i2c_exec;
+ bus->i2c_tag.ic_acquire_bus = kiic_i2c_acquire_bus;
+ bus->i2c_tag.ic_release_bus = kiic_i2c_release_bus;
+ bus->i2c_tag.ic_exec = kiic_i2c_exec;
bus->reg = reg;
bzero(&iba, sizeof iba);
@@ -163,7 +163,7 @@ ki2c_attach_bus(struct ki2c_softc *sc, struct ki2c_bus *bus, int node)
}
u_int
-ki2c_readreg(struct ki2c_softc *sc, int reg)
+kiic_readreg(struct kiic_softc *sc, int reg)
{
u_char *addr = sc->sc_reg + sc->sc_regstep * reg;
@@ -171,7 +171,7 @@ ki2c_readreg(struct ki2c_softc *sc, int reg)
}
void
-ki2c_writereg(struct ki2c_softc *sc, int reg, u_int val)
+kiic_writereg(struct kiic_softc *sc, int reg, u_int val)
{
u_char *addr = sc->sc_reg + sc->sc_regstep * reg;
@@ -181,54 +181,54 @@ ki2c_writereg(struct ki2c_softc *sc, int reg, u_int val)
}
u_int
-ki2c_getmode(struct ki2c_softc *sc)
+kiic_getmode(struct kiic_softc *sc)
{
- return ki2c_readreg(sc, MODE) & I2C_MODE;
+ return kiic_readreg(sc, MODE) & I2C_MODE;
}
void
-ki2c_setmode(struct ki2c_softc *sc, u_int mode, u_int bus)
+kiic_setmode(struct kiic_softc *sc, u_int mode, u_int bus)
{
u_int x;
KASSERT((mode & ~I2C_MODE) == 0);
- x = ki2c_readreg(sc, MODE);
+ x = kiic_readreg(sc, MODE);
x &= ~(I2C_MODE);
if (bus)
x |= I2C_BUS1;
else
x &= ~I2C_BUS1;
x |= mode;
- ki2c_writereg(sc, MODE, x);
+ kiic_writereg(sc, MODE, x);
}
u_int
-ki2c_getspeed(struct ki2c_softc *sc)
+kiic_getspeed(struct kiic_softc *sc)
{
- return ki2c_readreg(sc, MODE) & I2C_SPEED;
+ return kiic_readreg(sc, MODE) & I2C_SPEED;
}
void
-ki2c_setspeed(struct ki2c_softc *sc, u_int speed)
+kiic_setspeed(struct kiic_softc *sc, u_int speed)
{
u_int x;
KASSERT((speed & ~I2C_SPEED) == 0);
- x = ki2c_readreg(sc, MODE);
+ x = kiic_readreg(sc, MODE);
x &= ~I2C_SPEED;
x |= speed;
- ki2c_writereg(sc, MODE, x);
+ kiic_writereg(sc, MODE, x);
}
int
-ki2c_intr(struct ki2c_softc *sc)
+kiic_intr(struct kiic_softc *sc)
{
u_int isr, x;
- isr = ki2c_readreg(sc, ISR);
+ isr = kiic_readreg(sc, ISR);
if (isr & I2C_INT_ADDR) {
#if 0
- if ((ki2c_readreg(sc, STATUS) & I2C_ST_LASTAAK) == 0) {
+ if ((kiic_readreg(sc, STATUS) & I2C_ST_LASTAAK) == 0) {
/* No slave responded. */
sc->sc_flags |= I2C_ERROR;
goto out;
@@ -237,28 +237,28 @@ ki2c_intr(struct ki2c_softc *sc)
if (sc->sc_flags & I2C_READING) {
if (sc->sc_resid > 1) {
- x = ki2c_readreg(sc, CONTROL);
+ x = kiic_readreg(sc, CONTROL);
x |= I2C_CT_AAK;
- ki2c_writereg(sc, CONTROL, x);
+ kiic_writereg(sc, CONTROL, x);
}
} else {
- ki2c_writereg(sc, DATA, *sc->sc_data++);
+ kiic_writereg(sc, DATA, *sc->sc_data++);
sc->sc_resid--;
}
}
if (isr & I2C_INT_DATA) {
if (sc->sc_flags & I2C_READING) {
- *sc->sc_data++ = ki2c_readreg(sc, DATA);
+ *sc->sc_data++ = kiic_readreg(sc, DATA);
sc->sc_resid--;
if (sc->sc_resid == 0) { /* Completed */
- ki2c_writereg(sc, CONTROL, 0);
+ kiic_writereg(sc, CONTROL, 0);
goto out;
}
} else {
#if 0
- if ((ki2c_readreg(sc, STATUS) & I2C_ST_LASTAAK) == 0) {
+ if ((kiic_readreg(sc, STATUS) & I2C_ST_LASTAAK) == 0) {
/* No slave responded. */
sc->sc_flags |= I2C_ERROR;
goto out;
@@ -266,10 +266,10 @@ ki2c_intr(struct ki2c_softc *sc)
#endif
if (sc->sc_resid == 0) {
- x = ki2c_readreg(sc, CONTROL) | I2C_CT_STOP;
- ki2c_writereg(sc, CONTROL, x);
+ x = kiic_readreg(sc, CONTROL) | I2C_CT_STOP;
+ kiic_writereg(sc, CONTROL, x);
} else {
- ki2c_writereg(sc, DATA, *sc->sc_data++);
+ kiic_writereg(sc, DATA, *sc->sc_data++);
sc->sc_resid--;
}
}
@@ -277,21 +277,21 @@ ki2c_intr(struct ki2c_softc *sc)
out:
if (isr & I2C_INT_STOP) {
- ki2c_writereg(sc, CONTROL, 0);
+ kiic_writereg(sc, CONTROL, 0);
sc->sc_flags &= ~I2C_BUSY;
}
- ki2c_writereg(sc, ISR, isr);
+ kiic_writereg(sc, ISR, isr);
return (1);
}
int
-ki2c_poll(struct ki2c_softc *sc, int timo)
+kiic_poll(struct kiic_softc *sc, int timo)
{
while (sc->sc_flags & I2C_BUSY) {
- if (ki2c_readreg(sc, ISR))
- ki2c_intr(sc);
+ if (kiic_readreg(sc, ISR))
+ kiic_intr(sc);
timo -= 100;
if (timo < 0) {
printf("i2c_poll: timeout\n");
@@ -303,7 +303,7 @@ ki2c_poll(struct ki2c_softc *sc, int timo)
}
int
-ki2c_start(struct ki2c_softc *sc, int addr, int subaddr, void *data, int len)
+kiic_start(struct kiic_softc *sc, int addr, int subaddr, void *data, int len)
{
int rw = (sc->sc_flags & I2C_READING) ? 1 : 0;
int timo, x;
@@ -320,13 +320,13 @@ ki2c_start(struct ki2c_softc *sc, int addr, int subaddr, void *data, int len)
/* if (addr == 0x68) */
timo += 100000;
- ki2c_writereg(sc, ADDR, addr | rw);
- ki2c_writereg(sc, SUBADDR, subaddr);
+ kiic_writereg(sc, ADDR, addr | rw);
+ kiic_writereg(sc, SUBADDR, subaddr);
- x = ki2c_readreg(sc, CONTROL) | I2C_CT_ADDR;
- ki2c_writereg(sc, CONTROL, x);
+ x = kiic_readreg(sc, CONTROL) | I2C_CT_ADDR;
+ kiic_writereg(sc, CONTROL, x);
- if (ki2c_poll(sc, timo))
+ if (kiic_poll(sc, timo))
return (-1);
if (sc->sc_flags & I2C_ERROR) {
printf("I2C_ERROR\n");
@@ -336,40 +336,40 @@ ki2c_start(struct ki2c_softc *sc, int addr, int subaddr, void *data, int len)
}
int
-ki2c_read(struct ki2c_softc *sc, int addr, int subaddr, void *data, int len)
+kiic_read(struct kiic_softc *sc, int addr, int subaddr, void *data, int len)
{
sc->sc_flags = I2C_READING;
- return ki2c_start(sc, addr, subaddr, data, len);
+ return kiic_start(sc, addr, subaddr, data, len);
}
int
-ki2c_write(struct ki2c_softc *sc, int addr, int subaddr, const void *data, int len)
+kiic_write(struct kiic_softc *sc, int addr, int subaddr, const void *data, int len)
{
sc->sc_flags = 0;
- return ki2c_start(sc, addr, subaddr, (void *)data, len);
+ return kiic_start(sc, addr, subaddr, (void *)data, len);
}
int
-ki2c_i2c_acquire_bus(void *cookie, int flags)
+kiic_i2c_acquire_bus(void *cookie, int flags)
{
- struct ki2c_bus *bus = cookie;
+ struct kiic_bus *bus = cookie;
return (lockmgr(&bus->sc->sc_buslock, LK_EXCLUSIVE, NULL));
}
void
-ki2c_i2c_release_bus(void *cookie, int flags)
+kiic_i2c_release_bus(void *cookie, int flags)
{
- struct ki2c_bus *bus = cookie;
+ struct kiic_bus *bus = cookie;
(void) lockmgr(&bus->sc->sc_buslock, LK_RELEASE, NULL);
}
int
-ki2c_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
+kiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
const void *cmdbuf, size_t cmdlen, void *buf, size_t len, int flags)
{
- struct ki2c_bus *bus = cookie;
+ struct kiic_bus *bus = cookie;
u_int mode = I2C_STDSUBMODE;
u_int8_t cmd = 0;
@@ -384,14 +384,14 @@ ki2c_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
if (cmdlen > 0)
cmd = *(u_int8_t *)cmdbuf;
- ki2c_setmode(bus->sc, mode, bus->reg || addr & 0x80);
+ kiic_setmode(bus->sc, mode, bus->reg || addr & 0x80);
addr &= 0x7f;
if (I2C_OP_READ_P(op)) {
- if (ki2c_read(bus->sc, (addr << 1), cmd, buf, len) != 0)
+ if (kiic_read(bus->sc, (addr << 1), cmd, buf, len) != 0)
return (EIO);
} else {
- if (ki2c_write(bus->sc, (addr << 1), cmd, buf, len) != 0)
+ if (kiic_write(bus->sc, (addr << 1), cmd, buf, len) != 0)
return (EIO);
}
return (0);
diff --git a/sys/arch/macppc/dev/ki2cvar.h b/sys/arch/macppc/dev/kiicvar.h
index 4a8c39b559d..3a22738a19c 100644
--- a/sys/arch/macppc/dev/ki2cvar.h
+++ b/sys/arch/macppc/dev/kiicvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ki2cvar.h,v 1.4 2005/12/13 19:21:45 kettenis Exp $ */
+/* $OpenBSD: kiicvar.h,v 1.1 2007/04/23 16:27:20 deraadt Exp $ */
/*-
* Copyright (c) 2001 Tsubai Masanari. All rights reserved.
@@ -26,8 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KI2CVAR_H
-#define KI2CVAR_H
+#ifndef KIICVAR_H
+#define KIICVAR_H
#include <sys/param.h>
#include <sys/device.h>
@@ -82,20 +82,20 @@
#define I2C_READING 0x02
#define I2C_ERROR 0x04
-#define KI2C_MAX_BUSSES 2
+#define KIIC_MAX_BUSSES 2
-struct ki2c_softc {
+struct kiic_softc {
struct device sc_dev;
paddr_t sc_paddr;
u_char *sc_reg;
int sc_regstep;
struct lock sc_buslock;
- struct ki2c_bus {
- struct ki2c_softc *sc;
+ struct kiic_bus {
+ struct kiic_softc *sc;
struct i2c_controller i2c_tag;
u_int32_t reg;
- } sc_bus[KI2C_MAX_BUSSES];
+ } sc_bus[KIIC_MAX_BUSSES];
int sc_flags;
u_char *sc_data;
diff --git a/sys/arch/macppc/dev/onyx.c b/sys/arch/macppc/dev/onyx.c
index 28be4a010f5..6417721070a 100644
--- a/sys/arch/macppc/dev/onyx.c
+++ b/sys/arch/macppc/dev/onyx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: onyx.c,v 1.6 2005/12/28 10:08:07 kettenis Exp $ */
+/* $OpenBSD: onyx.c,v 1.7 2007/04/23 16:27:20 deraadt Exp $ */
/*-
* Copyright (c) 2005 Tsubai Masanari. All rights reserved.
@@ -45,7 +45,7 @@
#include <machine/autoconf.h>
#include <macppc/dev/i2svar.h>
-#include <macppc/dev/ki2cvar.h>
+#include <macppc/dev/kiicvar.h>
#ifdef ONYX_DEBUG
# define DPRINTF printf
@@ -64,8 +64,8 @@
#define onyx_softc i2s_softc
/* XXX */
-void ki2c_setmode(struct ki2c_softc *, u_int, u_int);
-int ki2c_write(struct device *, int, int, const void *, int);
+void kiic_setmode(struct kiic_softc *, u_int, u_int);
+int kiic_write(struct device *, int, int, const void *, int);
int onyx_getdev(void *, struct audio_device *);
int onyx_match(struct device *, void *, void *);
@@ -166,7 +166,7 @@ onyx_defer(struct device *dev)
struct device *dv;
TAILQ_FOREACH(dv, &alldevs, dv_list)
- if (strncmp(dv->dv_xname, "ki2c", 4) == 0 &&
+ if (strncmp(dv->dv_xname, "kiic", 4) == 0 &&
strncmp(dv->dv_parent->dv_xname, "macobio", 7) == 0)
sc->sc_i2c = dv;
if (sc->sc_i2c == NULL) {
@@ -197,11 +197,11 @@ onyx_set_volume(struct onyx_softc *sc, int left, int right)
sc->sc_vol_l = left;
sc->sc_vol_r = right;
- ki2c_setmode(sc->sc_i2c, I2C_STDSUBMODE, 0);
+ kiic_setmode(sc->sc_i2c, I2C_STDSUBMODE, 0);
data = 128 + (left >> 1);
- ki2c_write(sc->sc_i2c, PCM3052_I2C_ADDR,
+ kiic_write(sc->sc_i2c, PCM3052_I2C_ADDR,
PCM3052_REG_LEFT_VOLUME, &data, 1);
data = 128 + (right >> 1);
- ki2c_write(sc->sc_i2c, PCM3052_I2C_ADDR,
+ kiic_write(sc->sc_i2c, PCM3052_I2C_ADDR,
PCM3052_REG_RIGHT_VOLUME, &data, 1);
}
diff --git a/sys/arch/macppc/dev/pi2c.c b/sys/arch/macppc/dev/piic.c
index ff2fa05e895..7cf8f2a1c14 100644
--- a/sys/arch/macppc/dev/pi2c.c
+++ b/sys/arch/macppc/dev/piic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pi2c.c,v 1.5 2006/01/01 20:52:25 deraadt Exp $ */
+/* $OpenBSD: piic.c,v 1.1 2007/04/23 16:27:20 deraadt Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -29,39 +29,39 @@
#include <arch/macppc/dev/maci2cvar.h>
#include <arch/macppc/dev/pm_direct.h>
-struct pi2c_softc {
+struct piic_softc {
struct device sc_dev;
struct lock sc_buslock;
struct i2c_controller sc_i2c_tag;
};
-int pi2c_match(struct device *, void *, void *);
-void pi2c_attach(struct device *, struct device *, void *);
+int piic_match(struct device *, void *, void *);
+void piic_attach(struct device *, struct device *, void *);
-struct cfattach pi2c_ca = {
- sizeof(struct pi2c_softc), pi2c_match, pi2c_attach
+struct cfattach piic_ca = {
+ sizeof(struct piic_softc), piic_match, piic_attach
};
-struct cfdriver pi2c_cd = {
- NULL, "pi2c", DV_DULL,
+struct cfdriver piic_cd = {
+ NULL, "piic", DV_DULL,
};
-int pi2c_i2c_acquire_bus(void *, int);
-void pi2c_i2c_release_bus(void *, int);
-int pi2c_i2c_exec(void *, i2c_op_t, i2c_addr_t,
+int piic_i2c_acquire_bus(void *, int);
+void piic_i2c_release_bus(void *, int);
+int piic_i2c_exec(void *, i2c_op_t, i2c_addr_t,
const void *, size_t, void *buf, size_t, int);
int
-pi2c_match(struct device *parent, void *cf, void *aux)
+piic_match(struct device *parent, void *cf, void *aux)
{
return (1);
}
void
-pi2c_attach(struct device *parent, struct device *self, void *aux)
+piic_attach(struct device *parent, struct device *self, void *aux)
{
- struct pi2c_softc *sc = (struct pi2c_softc *)self;
+ struct piic_softc *sc = (struct piic_softc *)self;
struct confargs *ca = aux;
struct i2cbus_attach_args iba;
@@ -70,9 +70,9 @@ pi2c_attach(struct device *parent, struct device *self, void *aux)
lockinit(&sc->sc_buslock, PZERO, sc->sc_dev.dv_xname, 0, 0);
sc->sc_i2c_tag.ic_cookie = sc;
- sc->sc_i2c_tag.ic_acquire_bus = pi2c_i2c_acquire_bus;
- sc->sc_i2c_tag.ic_release_bus = pi2c_i2c_release_bus;
- sc->sc_i2c_tag.ic_exec = pi2c_i2c_exec;
+ sc->sc_i2c_tag.ic_acquire_bus = piic_i2c_acquire_bus;
+ sc->sc_i2c_tag.ic_release_bus = piic_i2c_release_bus;
+ sc->sc_i2c_tag.ic_exec = piic_i2c_exec;
bzero(&iba, sizeof iba);
iba.iba_name = "iic";
@@ -83,23 +83,23 @@ pi2c_attach(struct device *parent, struct device *self, void *aux)
}
int
-pi2c_i2c_acquire_bus(void *cookie, int flags)
+piic_i2c_acquire_bus(void *cookie, int flags)
{
- struct pi2c_softc *sc = cookie;
+ struct piic_softc *sc = cookie;
return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL));
}
void
-pi2c_i2c_release_bus(void *cookie, int flags)
+piic_i2c_release_bus(void *cookie, int flags)
{
- struct pi2c_softc *sc = cookie;
+ struct piic_softc *sc = cookie;
lockmgr(&sc->sc_buslock, LK_RELEASE, NULL);
}
int
-pi2c_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
+piic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
const void *cmdbuf, size_t cmdlen, void *buf, size_t len, int flags)
{
u_int8_t pmu_op = PMU_I2C_NORMAL;
diff --git a/sys/arch/macppc/dev/snapper.c b/sys/arch/macppc/dev/snapper.c
index fe6211f222b..06322333627 100644
--- a/sys/arch/macppc/dev/snapper.c
+++ b/sys/arch/macppc/dev/snapper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snapper.c,v 1.27 2005/12/28 10:08:07 kettenis Exp $ */
+/* $OpenBSD: snapper.c,v 1.28 2007/04/23 16:27:20 deraadt Exp $ */
/* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -55,8 +55,8 @@
#define snapper_softc i2s_softc
/* XXX */
-int ki2c_write(struct device *, int, int, const void *, int);
-int ki2c_writereg(struct device *, int, u_int);
+int kiic_write(struct device *, int, int, const void *, int);
+int kiic_writereg(struct device *, int, u_int);
void snapper_init(struct snapper_softc *);
int snapper_getdev(void *, struct audio_device *);
@@ -325,7 +325,7 @@ snapper_defer(struct device *dev)
struct device *dv;
TAILQ_FOREACH(dv, &alldevs, dv_list)
- if (strncmp(dv->dv_xname, "ki2c", 4) == 0 &&
+ if (strncmp(dv->dv_xname, "kiic", 4) == 0 &&
strncmp(dv->dv_parent->dv_xname, "macobio", 7) == 0)
sc->sc_i2c = dv;
if (sc->sc_i2c == NULL) {
@@ -337,7 +337,7 @@ snapper_defer(struct device *dev)
audio_attach_mi(&snapper_hw_if, sc, &sc->sc_dev);
- /* ki2c_setmode(sc->sc_i2c, I2C_STDSUBMODE); */
+ /* kiic_setmode(sc->sc_i2c, I2C_STDSUBMODE); */
snapper_init(sc);
}
@@ -470,7 +470,7 @@ tas3004_write(struct snapper_softc *sc, u_int reg, const void *data)
size = tas3004_regsize[reg];
KASSERT(size > 0);
- if (ki2c_write(sc->sc_i2c, DEQaddr, reg, data, size))
+ if (kiic_write(sc->sc_i2c, DEQaddr, reg, data, size))
return (-1);
return (0);
@@ -531,7 +531,7 @@ snapper_init(struct snapper_softc *sc)
#define I2C_INT_DATA 0x01
#define I2C_INT_ADDR 0x02
#define I2C_INT_STOP 0x04
- ki2c_writereg(sc->sc_i2c, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
+ kiic_writereg(sc->sc_i2c, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
#endif
if (tas3004_init(sc))
diff --git a/sys/arch/macppc/dev/tumbler.c b/sys/arch/macppc/dev/tumbler.c
index 71e3bf7b7ec..ac5896bf834 100644
--- a/sys/arch/macppc/dev/tumbler.c
+++ b/sys/arch/macppc/dev/tumbler.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tumbler.c,v 1.3 2005/11/05 04:26:22 brad Exp $ */
+/* $OpenBSD: tumbler.c,v 1.4 2007/04/23 16:27:20 deraadt Exp $ */
/*-
* Copyright (c) 2001,2003 Tsubai Masanari. All rights reserved.
@@ -54,8 +54,8 @@
#define tumbler_softc i2s_softc
/* XXX */
-int ki2c_write(struct device *, int, int, const void *, int);
-int ki2c_writereg(struct device *, int, u_int);
+int kiic_write(struct device *, int, int, const void *, int);
+int kiic_writereg(struct device *, int, u_int);
void tumbler_init(struct tumbler_softc *);
int tumbler_getdev(void *, struct audio_device *);
@@ -300,7 +300,7 @@ tumbler_defer(struct device *dev)
struct device *dv;
TAILQ_FOREACH(dv, &alldevs, dv_list)
- if (strncmp(dv->dv_xname, "ki2c", 4) == 0 &&
+ if (strncmp(dv->dv_xname, "kiic", 4) == 0 &&
strncmp(dv->dv_parent->dv_xname, "macobio", 7) == 0)
sc->sc_i2c = dv;
if (sc->sc_i2c == NULL) {
@@ -423,7 +423,7 @@ tas3001_write(struct tumbler_softc *sc, u_int reg, const void *data)
size = tas3001_regsize[reg];
KASSERT(size > 0);
- if (ki2c_write(sc->sc_i2c, DEQaddr, reg, data, size))
+ if (kiic_write(sc->sc_i2c, DEQaddr, reg, data, size))
return (-1);
return (0);
@@ -477,7 +477,7 @@ tumbler_init(struct tumbler_softc *sc)
#define I2C_INT_DATA 0x01
#define I2C_INT_ADDR 0x02
#define I2C_INT_STOP 0x04
- ki2c_writereg(sc->sc_i2c, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
+ kiic_writereg(sc->sc_i2c, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
#endif
if (tas3001_init(sc))