Make the following changes:

struct device * -> device_t
struct cfdata * -> cfdata_t
printf -> aprint_
device_t/softc split
This commit is contained in:
rjs 2009-05-29 14:15:44 +00:00
parent 01ff2d54d9
commit 4c494f7678
35 changed files with 382 additions and 375 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa1111.c,v 1.22 2008/04/28 20:23:14 martin Exp $ */
/* $NetBSD: sa1111.c,v 1.23 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.22 2008/04/28 20:23:14 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.23 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -69,7 +69,7 @@ static void sacc_intr_setpolarity(sacc_chipset_tag_t *, int , int);
#endif
int
sacc_probe(struct device *parent, struct cfdata *match, void *aux)
sacc_probe(device_t parent, cfdata_t match, void *aux)
{
struct sa11x0_attach_args *sa = aux;
bus_space_handle_t ioh;
@ -89,7 +89,7 @@ sacc_probe(struct device *parent, struct cfdata *match, void *aux)
int
sa1111_search(struct device *parent, struct cfdata *cf, const int *ldesc,
sa1111_search(device_t parent, cfdata_t cf, const int *ldesc,
void *aux)
{
struct sa1111_attach_args aa;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa1111_kbc.c,v 1.10 2008/01/05 00:31:55 ad Exp $ */
/* $NetBSD: sa1111_kbc.c,v 1.11 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2004 Ben Harris.
@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.10 2008/01/05 00:31:55 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.11 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -82,7 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: sa1111_kbc.c,v 1.10 2008/01/05 00:31:55 ad Exp $");
#include "locators.h"
struct sackbc_softc {
struct device dev;
device_t dev;
bus_space_tag_t iot;
bus_space_handle_t ioh;
@ -101,8 +101,8 @@ struct sackbc_softc {
pckbport_tag_t pt;
};
static int sackbc_match(struct device *, struct cfdata *, void *);
static void sackbc_attach(struct device *, struct device *, void *);
static int sackbc_match(device_t, cfdata_t, void *);
static void sackbc_attach(device_t, device_t, void *);
static int sackbc_xt_translation(void *, pckbport_slot_t, int);
#define sackbc_send_devcmd sackbc_send_cmd
@ -112,7 +112,7 @@ static void sackbc_slot_enable(void *, pckbport_slot_t, int);
static void sackbc_intr_establish(void *, pckbport_slot_t);
static void sackbc_set_poll(void *, pckbport_slot_t, int);
CFATTACH_DECL(sackbc, sizeof(struct sackbc_softc), sackbc_match,
CFATTACH_DECL_NEW(sackbc, sizeof(struct sackbc_softc), sackbc_match,
sackbc_attach, NULL, NULL);
static struct pckbport_accessops const sackbc_ops = {
@ -136,7 +136,7 @@ static struct pckbport_accessops const sackbc_ops = {
static int
sackbc_match(struct device *parent, struct cfdata *cf, void *aux)
sackbc_match(device_t parent, cfdata_t cf, void *aux)
{
struct sa1111_attach_args *aa = (struct sa1111_attach_args *)aux;
@ -193,11 +193,10 @@ sackbc_intr_establish(void *cookie, pckbport_slot_t slot)
if (!(sc->polling) && sc->ih_rx == NULL) {
sc->ih_rx = sacc_intr_establish(
(sacc_chipset_tag_t *) device_parent(&sc->dev),
(sacc_chipset_tag_t *) device_parent(sc->dev),
sc->intr+1, IST_EDGE_RAISE, IPL_TTY, sackbc_rxint, sc);
if (sc->ih_rx == NULL) {
printf("%s: can't establish interrupt\n",
sc->dev.dv_xname);
aprint_normal_dev(sc->dev, "can't establish interrupt\n");
}
}
}
@ -207,19 +206,19 @@ sackbc_disable_intrhandler(struct sackbc_softc *sc)
{
if (sc->polling && sc->ih_rx) {
sacc_intr_disestablish(
(sacc_chipset_tag_t *) device_parent(&sc->dev),
(sacc_chipset_tag_t *) device_parent(sc->dev),
sc->ih_rx);
sc->ih_rx = NULL;
}
}
static void
sackbc_attach(struct device *parent, struct device *self, void *aux)
sackbc_attach(device_t parent, device_t self, void *aux)
{
struct sackbc_softc *sc = (struct sackbc_softc *)self;
struct sacc_softc *psc = (struct sacc_softc *)parent;
struct sackbc_softc *sc = device_private(self);
struct sacc_softc *psc = device_private(parent);
struct sa1111_attach_args *aa = (struct sa1111_attach_args *)aux;
struct device *child;
device_t child;
uint32_t tmp, clock_bit;
int intr, slot;
@ -235,10 +234,11 @@ sackbc_attach(struct device *parent, struct device *self, void *aux)
if (aa->sa_intr == SACCCF_INTR_DEFAULT)
aa->sa_intr = intr;
sc->dev = self;
sc->iot = psc->sc_iot;
if (bus_space_subregion(psc->sc_iot, psc->sc_ioh,
aa->sa_addr, aa->sa_size, &sc->ioh)) {
printf(": can't map subregion\n");
aprint_normal(": can't map subregion\n");
return;
}
@ -278,7 +278,7 @@ sackbc_attach(struct device *parent, struct device *self, void *aux)
continue;
sc->slot = slot;
#if NRND > 0
rnd_attach_source(&sc->rnd_source, child->dv_xname,
rnd_attach_source(&sc->rnd_source, device_xname(child),
RND_TYPE_TTY, 0);
#endif
/* only one of KBD_SLOT or AUX_SLOT is used. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa1111_var.h,v 1.11 2008/04/28 20:23:14 martin Exp $ */
/* $NetBSD: sa1111_var.h,v 1.12 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@ struct sacc_intrvec {
};
struct sacc_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
bus_space_tag_t sc_piot; /* parent(SA-1110)'s iot */
@ -71,7 +71,7 @@ struct sa1111_attach_args {
void *sacc_intr_establish(sacc_chipset_tag_t *, int, int, int,
int (*)(void *), void *);
void sacc_intr_disestablish(sacc_chipset_tag_t *, void *);
int sacc_probe(struct device *, struct cfdata *, void *);
int sa1111_search(struct device *, struct cfdata *, const int *, void *);
int sacc_probe(device_t, cfdata_t, void *);
int sa1111_search(device_t, cfdata_t, const int *, void *);
#endif /* _SA1111_VAR_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0.c,v 1.23 2008/06/13 13:24:10 rafal Exp $ */
/* $NetBSD: sa11x0.c,v 1.24 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0.c,v 1.23 2008/06/13 13:24:10 rafal Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0.c,v 1.24 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,14 +87,13 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x0.c,v 1.23 2008/06/13 13:24:10 rafal Exp $");
#include "locators.h"
/* prototypes */
static int sa11x0_match(struct device *, struct cfdata *, void *);
static void sa11x0_attach(struct device *, struct device *, void *);
static int sa11x0_search(struct device *, struct cfdata *,
const int *, void *);
static int sa11x0_match(device_t, cfdata_t, void *);
static void sa11x0_attach(device_t, device_t, void *);
static int sa11x0_search(device_t, cfdata_t, const int *, void *);
static int sa11x0_print(void *, const char *);
/* attach structures */
CFATTACH_DECL(saip, sizeof(struct sa11x0_softc),
CFATTACH_DECL_NEW(saip, sizeof(struct sa11x0_softc),
sa11x0_match, sa11x0_attach, NULL, NULL);
extern struct bus_space sa11x0_bs_tag;
@ -123,17 +122,18 @@ sa11x0_print(void *aux, const char *name)
}
int
sa11x0_match(struct device *parent, struct cfdata *match, void *aux)
sa11x0_match(device_t parent, cfdata_t match, void *aux)
{
return 1;
}
void
sa11x0_attach(struct device *parent, struct device *self, void *aux)
sa11x0_attach(device_t parent, device_t self, void *aux)
{
struct sa11x0_softc *sc = (struct sa11x0_softc*)self;
struct sa11x0_softc *sc = device_private(self);
sc->sc_dev = self;
sc->sc_iot = &sa11x0_bs_tag;
/* Map the SAIP */
@ -197,10 +197,9 @@ sa11x0_attach(struct device *parent, struct device *self, void *aux)
}
int
sa11x0_search(struct device *parent, struct cfdata *cf, const int *ldesc,
void *aux)
sa11x0_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
struct sa11x0_softc *sc = (struct sa11x0_softc *)parent;
struct sa11x0_softc *sc = device_private(parent);
struct sa11x0_attach_args sa;
sa.sa_sc = sc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_com.c,v 1.44 2008/06/11 22:37:21 cegger Exp $ */
/* $NetBSD: sa11x0_com.c,v 1.45 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.44 2008/06/11 22:37:21 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.45 2009/05/29 14:15:44 rjs Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -121,16 +121,16 @@ const struct cdevsw sacom_cdevsw = {
sacomstop, sacomtty, sacompoll, nommap, ttykqfilter, D_TTY
};
static int sacom_match(struct device *, struct cfdata *, void *);
static void sacom_attach(struct device *, struct device *, void *);
static int sacom_match(device_t, cfdata_t, void *);
static void sacom_attach(device_t, device_t, void *);
static void sacom_filltx(struct sacom_softc *);
static void sacom_attach_subr(struct sacom_softc *);
#if defined(DDB) || defined(KGDB)
static void sacom_enable_debugport(struct sacom_softc *);
#endif
int sacom_detach(struct device *, int);
int sacom_detach(device_t, int);
void sacom_config(struct sacom_softc *);
int sacom_activate(struct device *, enum devact);
int sacom_activate(device_t, enum devact);
void sacom_shutdown(struct sacom_softc *);
static u_int cflag2cr0(tcflag_t);
int sacomparam(struct tty *, struct termios *);
@ -169,7 +169,7 @@ static void sacom_j720_init(struct sa11x0_softc *, struct sacom_softc *);
#define COMDIALOUT(x) (minor(x) & COMDIALOUT_MASK)
#define COM_ISALIVE(sc) ((sc)->enabled != 0 && \
device_is_active(&(sc)->sc_dev))
device_is_active((sc)->sc_dev))
#define COM_BARRIER(t, h, f) bus_space_barrier((t), (h), 0, COM_NPORTS, (f))
#define COM_LOCK(sc)
@ -193,7 +193,7 @@ static int sacomconsattached;
static int sacomconsrate;
static tcflag_t sacomconscflag;
CFATTACH_DECL(sacom, sizeof(struct sacom_softc),
CFATTACH_DECL_NEW(sacom, sizeof(struct sacom_softc),
sacom_match, sacom_attach, NULL, NULL);
extern struct cfdriver sacom_cd;
@ -220,47 +220,47 @@ struct consdev sacomcons = {
#endif
static int
sacom_match(struct device *parent, struct cfdata *match, void *aux)
sacom_match(device_t parent, cfdata_t match, void *aux)
{
return 1;
}
void
sacom_attach(struct device *parent, struct device *self, void *aux)
sacom_attach(device_t parent, device_t self, void *aux)
{
struct sacom_softc *sc = (struct sacom_softc*)self;
struct sacom_softc *sc = device_private(self);
struct sa11x0_attach_args *sa = aux;
#ifdef hpcarm
struct platid_data *p;
void (*mdinit)(struct device *, struct sacom_softc *);
void (*mdinit)(device_t, struct sacom_softc *);
#endif
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_iot = sa->sa_iot;
sc->sc_baseaddr = sa->sa_addr;
if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 0,
&sc->sc_ioh)) {
printf("%s: unable to map registers\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "unable to map registers\n");
return;
}
printf("%s: ", sc->sc_dev.dv_xname);
switch (sc->sc_baseaddr) {
case SACOM1_BASE:
printf("SA-11x0 UART1\n");
aprint_normal_dev(self, "SA-11x0 UART1\n");
break;
case SACOM2_BASE:
printf("SA-11x0 UART2 (IRDA)\n");
aprint_normal_dev(self, "SA-11x0 UART2 (IRDA)\n");
break;
case SACOM3_BASE:
printf("SA-11x0 UART3\n");
aprint_normal_dev(self, "SA-11x0 UART3\n");
break;
default:
printf("unknown SA-11x0 UART\n");
aprint_normal_dev(self, "unknown SA-11x0 UART\n");
break;
}
@ -306,8 +306,7 @@ sacom_attach_subr(struct sacom_softc *sc)
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
sc->sc_rbavail = SACOM_RING_SIZE;
if (sc->sc_rbuf == NULL) {
printf("%s: unable to allocate ring buffer\n",
sc->sc_dev.dv_xname);
aprint_normal_dev(sc->sc_dev, "unable to allocate ring buffer\n");
return;
}
sc->sc_ebuf = sc->sc_rbuf + (SACOM_RING_SIZE << 1);
@ -321,10 +320,10 @@ sacom_attach_subr(struct sacom_softc *sc)
/* locate the major number */
maj = cdevsw_lookup_major(&sacom_cdevsw);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
cn_tab->cn_dev = makedev(maj, device_unit(sc->sc_dev));
delay(10000); /* XXX */
printf("%s: console\n", sc->sc_dev.dv_xname);
aprint_normal_dev(sc->sc_dev, "console\n");
delay(10000); /* XXX */
}
@ -332,7 +331,7 @@ sacom_attach_subr(struct sacom_softc *sc)
sc->sc_si = softint_establish(SOFTINT_SERIAL, sacomsoft, sc);
#if NRND > 0 && defined(RND_COM)
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
rnd_attach_source(&sc->rnd_source, device_xname(sc->sc_dev),
RND_TYPE_TTY, 0);
#endif
@ -348,16 +347,16 @@ sacom_attach_subr(struct sacom_softc *sc)
/* This is necessary when dynamically changing SAIP configuration. */
int
sacom_detach(struct device *self, int flags)
sacom_detach(device_t dev, int flags)
{
struct sacom_softc *sc = (struct sacom_softc *)self;
struct sacom_softc *sc = device_private(dev);
int maj, mn;
/* locate the major number */
maj = cdevsw_lookup_major(&sacom_cdevsw);
/* Nuke the vnodes for any open instances. */
mn = device_unit(self);
mn = device_unit(dev);
vdevgone(maj, mn, mn, VCHR);
mn |= COMDIALOUT_MASK;
@ -415,9 +414,9 @@ sacom_enable_debugport(struct sacom_softc *sc)
#endif
int
sacom_activate(struct device *self, enum devact act)
sacom_activate(device_t dev, enum devact act)
{
struct sacom_softc *sc = (struct sacom_softc *)self;
struct sacom_softc *sc = device_private(dev);
int s, rv = 0;
s = splserial();
@ -501,7 +500,7 @@ sacomopen(dev_t dev, int flag, int mode, struct lwp *l)
sc->sc_rbuf == NULL)
return ENXIO;
if (!device_is_active(&sc->sc_dev))
if (!device_is_active(sc->sc_dev))
return ENXIO;
tp = sc->sc_tty;
@ -527,8 +526,7 @@ sacomopen(dev_t dev, int flag, int mode, struct lwp *l)
COM_UNLOCK(sc);
splx(s2);
splx(s);
printf("%s: device enable failed\n",
sc->sc_dev.dv_xname);
aprint_normal_dev(sc->sc_dev, "device enable failed\n");
return EIO;
}
sc->enabled = 1;
@ -973,8 +971,7 @@ sacom_iflush(struct sacom_softc *sc)
#endif
#ifdef DIAGNOSTIC
if (!timo)
printf("%s: sacom_iflush timeout %02x\n", sc->sc_dev.dv_xname,
reg);
aprint_debug_dev(sc->sc_dev, "sacom_iflush timeout %02x\n", reg);
#endif
}
@ -1429,7 +1426,7 @@ sacominit(bus_space_tag_t iot, bus_addr_t iobase, int baud, tcflag_t cflag,
int brd, cr0;
if (bus_space_map(iot, iobase, SACOM_NPORTS, 0, iohp))
printf("register map failed\n");
aprint_normal("register map failed\n");
/* wait for the Tx queue to drain and disable the UART */
while (bus_space_read_4(iot, *iohp, SACOM_SR1) & SR1_TBY)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_comvar.h,v 1.5 2008/04/28 20:23:14 martin Exp $ */
/* $NetBSD: sa11x0_comvar.h,v 1.6 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved.
@ -46,7 +46,7 @@
#define SACOM_RING_SIZE 2048
struct sacom_softc {
struct device sc_dev;
device_t sc_dev;
bus_addr_t sc_baseaddr;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_ost.c,v 1.25 2008/05/10 15:31:04 martin Exp $ */
/* $NetBSD: sa11x0_ost.c,v 1.26 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.25 2008/05/10 15:31:04 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.26 2009/05/29 14:15:44 rjs Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -57,8 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.25 2008/05/10 15:31:04 martin Exp $
#include <arm/sa11x0/sa11x0_var.h>
#include <arm/sa11x0/sa11x0_ostreg.h>
static int saost_match(struct device *, struct cfdata *, void *);
static void saost_attach(struct device *, struct device *, void *);
static int saost_match(device_t, cfdata_t, void *);
static void saost_attach(device_t, device_t, void *);
static void saost_tc_init(void);
@ -67,7 +67,7 @@ static int clockintr(void *);
static int statintr(void *);
struct saost_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
@ -91,37 +91,38 @@ static struct saost_softc *saost_sc = NULL;
#define STATHZ 64
#endif
CFATTACH_DECL(saost, sizeof(struct saost_softc),
CFATTACH_DECL_NEW(saost, sizeof(struct saost_softc),
saost_match, saost_attach, NULL, NULL);
static int
saost_match(struct device *parent, struct cfdata *match, void *aux)
saost_match(device_t parent, cfdata_t match, void *aux)
{
return 1;
}
static void
saost_attach(struct device *parent, struct device *self, void *aux)
saost_attach(device_t parent, device_t self, void *aux)
{
struct saost_softc *sc = (struct saost_softc *)self;
struct saost_softc *sc = device_private(self);
struct sa11x0_attach_args *sa = aux;
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_iot = sa->sa_iot;
saost_sc = sc;
if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 0,
&sc->sc_ioh))
panic("%s: Cannot map registers", self->dv_xname);
panic("%s: Cannot map registers", device_xname(self));
/* disable all channel and clear interrupt status */
bus_space_write_4(sc->sc_iot, sc->sc_ioh, SAOST_IR, 0);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, SAOST_SR, 0xf);
printf("%s: SA-11x0 OS Timer\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "SA-11x0 OS Timer\n");
}
static int
@ -224,7 +225,7 @@ cpu_initclocks(void)
profhz = stathz;
sc->sc_statclock_step = TIMER_FREQUENCY / stathz;
printf("clock: hz=%d stathz=%d\n", hz, stathz);
aprint_normal("clock: hz=%d stathz=%d\n", hz, stathz);
/* Use the channels 0 and 1 for hardclock and statclock, respectively */
sc->sc_clock_count = TIMER_FREQUENCY / hz;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x0_var.h,v 1.8 2008/04/28 20:23:14 martin Exp $ */
/* $NetBSD: sa11x0_var.h,v 1.9 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved.
@ -37,7 +37,7 @@
#include <machine/bus.h>
struct sa11x0_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
bus_space_handle_t sc_gpioh;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11x1_pcic.c,v 1.19 2008/06/03 13:45:22 rafal Exp $ */
/* $NetBSD: sa11x1_pcic.c,v 1.20 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11x1_pcic.c,v 1.19 2008/06/03 13:45:22 rafal Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11x1_pcic.c,v 1.20 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -59,9 +59,9 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x1_pcic.c,v 1.19 2008/06/03 13:45:22 rafal Exp $
static int sacpcic_print(void *, const char *);
static void
sacpcic_config_deferred(struct device *dev)
sacpcic_config_deferred(device_t dev)
{
struct sacpcic_softc *sc = (struct sacpcic_softc *)dev;
struct sacpcic_softc *sc = device_private(dev);
struct sapcic_socket *so;
int i;
@ -82,7 +82,7 @@ sacpcic_attach_common(struct sacc_softc *psc, struct sacpcic_softc *sc,
int i;
struct pcmciabus_attach_args paa;
printf("\n");
aprint_normal("\n");
sc->sc_pc.sc_iot = psc->sc_iot;
sc->sc_ioh = psc->sc_ioh;
@ -108,11 +108,11 @@ sacpcic_attach_common(struct sacc_softc *psc, struct sacpcic_softc *sc,
paa.iosize = 0x4000000;
sc->sc_socket[i].pcmcia =
config_found_ia(&sc->sc_pc.sc_dev, "pcmciabus", &paa,
config_found_ia(sc->sc_pc.sc_dev, "pcmciabus", &paa,
sacpcic_print);
}
config_interrupts(&sc->sc_pc.sc_dev, sacpcic_config_deferred);
config_interrupts(sc->sc_pc.sc_dev, sacpcic_config_deferred);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11xx_pcic.c,v 1.12 2008/06/03 13:45:22 rafal Exp $ */
/* $NetBSD: sa11xx_pcic.c,v 1.13 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2001 IWAMOTO Toshihiro. All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sa11xx_pcic.c,v 1.12 2008/06/03 13:45:22 rafal Exp $");
__KERNEL_RCSID(0, "$NetBSD: sa11xx_pcic.c,v 1.13 2009/05/29 14:15:44 rjs Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -90,7 +90,7 @@ static void sapcic_event_thread(void *);
static void sapcic_delay(int, const char *);
#ifdef DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg)
#endif
@ -124,16 +124,14 @@ sapcic_kthread_create(void *arg)
so->laststatus = (so->pcictag->read)(so, SAPCIC_STATUS_CARD);
if (so->laststatus == SAPCIC_CARD_VALID) {
printf("%s: card present\n",
so->sc->sc_dev.dv_xname);
aprint_normal_dev(so->sc->sc_dev, "card present\n");
pcmcia_card_attach(so->pcmcia);
}
if (kthread_create(PRI_NONE, 0, NULL, sapcic_event_thread, so,
&so->event_thread, "%s,%d", so->sc->sc_dev.dv_xname, so->socket)) {
printf("%s: unable to create event thread for socket %d\n",
so->sc->sc_dev.dv_xname, so->socket);
&so->event_thread, "%s,%d", device_xname(so->sc->sc_dev), so->socket)) {
aprint_normal_dev(so->sc->sc_dev, "unable to create event thread for socket %d\n",
so->socket);
panic("sapcic_kthread_create");
}
}
@ -173,15 +171,13 @@ sapcic_event_thread(void *arg)
so->laststatus = newstatus;
switch (newstatus) {
case SAPCIC_CARD_VALID:
printf("%s: insertion event\n",
so->sc->sc_dev.dv_xname);
aprint_normal_dev(so->sc->sc_dev, "insertion event\n");
pcmcia_card_attach(so->pcmcia);
break;
case SAPCIC_CARD_INVALID:
printf("%s: removal event\n",
so->sc->sc_dev.dv_xname);
aprint_normal_dev(so->sc->sc_dev, "removal event\n");
pcmcia_card_detach(so->pcmcia, DETACH_FORCE);
break;
@ -356,7 +352,7 @@ sapcic_socket_enable(pcmcia_chipset_handle_t pch)
#if defined(DIAGNOSTIC) && defined(notyet)
if (so->flags & PCIC_FLAG_ENABLED)
printf("sapcic_socket_enable: enabling twice\n");
aprint_normal("sapcic_socket_enable: enabling twice\n");
#endif
/* disable interrupts */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sa11xx_pcicvar.h,v 1.6 2008/04/28 20:23:14 martin Exp $ */
/* $NetBSD: sa11xx_pcicvar.h,v 1.7 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
struct sapcic_socket {
struct sapcic_softc *sc;
int socket; /* socket number */
struct device *pcmcia;
device_t pcmcia;
struct sapcic_tag *pcictag;
struct lwp *event_thread;
@ -75,7 +75,7 @@ struct sapcic_tag {
/* common part for sacpcic_softc and sagpcic_softc */
struct sapcic_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
kmutex_t sc_lock;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sm_obio.c,v 1.2 2008/04/28 20:23:17 martin Exp $ */
/* $NetBSD: if_sm_obio.c,v 1.3 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sm_obio.c,v 1.2 2008/04/28 20:23:17 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sm_obio.c,v 1.3 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -124,7 +124,7 @@ smc_obio_intr(void *arg)
#endif /* SM_OBIO_INTR_PARANOIA */
int
sm_obio_match(struct device *parent, struct cfdata *match, void *aux)
sm_obio_match(device_t parent, cfdata_t match, void *aux)
{
struct obio_attach_args *oba = aux;
bus_space_tag_t iot = &smobio8_bs_tag;
@ -177,7 +177,7 @@ sm_obio_match(struct device *parent, struct cfdata *match, void *aux)
}
void
sm_obio_attach(struct device *parent, struct device *self, void *aux)
sm_obio_attach(device_t parent, device_t self, void *aux)
{
struct sm_obio_softc *isc = (struct sm_obio_softc *)self;
struct smc91cxx_softc *sc = &isc->sc_smc;
@ -228,10 +228,9 @@ sm_obio_attach(struct device *parent, struct device *self, void *aux)
smc91cxx_attach(sc, NULL);
/* Establish the interrupt handler. */
isc->sc_ih = obio_intr_establish((struct obio_softc *)parent,
isc->sc_ih = obio_intr_establish(device_private(parent),
oba->oba_intr, IPL_NET, smintr, sc);
if (isc->sc_ih == NULL)
printf("%s: couldn't establish interrupt handler\n",
sc->sc_dev.dv_xname);
aprint_normal_dev(self, "couldn't establish interrupt handler\n");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lubbock_lcd.c,v 1.9 2009/01/29 12:28:15 nonaka Exp $ */
/* $NetBSD: lubbock_lcd.c,v 1.10 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
@ -40,7 +40,7 @@
* LCD panel geometry
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lubbock_lcd.c,v 1.9 2009/01/29 12:28:15 nonaka Exp $");
__KERNEL_RCSID(0, "$NetBSD: lubbock_lcd.c,v 1.10 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -221,8 +221,8 @@ void lcd_attach( device_t parent, device_t self, void *aux )
int
lcd_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, struct lwp *l)
{
struct obio_softc *osc =
(struct obio_softc *) device_parent((struct device *)v);
struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *) v;
struct obio_softc *osc = device_private(device_parent(sc->dev));
uint16_t reg;
switch (cmd) {
@ -245,8 +245,8 @@ int
lcd_show_screen(void *v, void *cookie, int waitok,
void (*cb)(void *, int, int), void *cbarg)
{
struct obio_softc *osc =
(struct obio_softc *) device_parent((struct device *)v);
struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *) v;
struct obio_softc *osc = device_private(device_parent(sc->dev));
pxa2x0_lcd_show_screen(v,cookie,waitok,cb,cbarg);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lubbock_pcic.c,v 1.4 2008/04/28 20:23:17 martin Exp $ */
/* $NetBSD: lubbock_pcic.c,v 1.5 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lubbock_pcic.c,v 1.4 2008/04/28 20:23:17 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: lubbock_pcic.c,v 1.5 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,8 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: lubbock_pcic.c,v 1.4 2008/04/28 20:23:17 martin Exp
#include <evbarm/lubbock/lubbock_reg.h>
#include <evbarm/lubbock/lubbock_var.h>
static int sacpcic_match(struct device *, struct cfdata *, void *);
static void sacpcic_attach(struct device *, struct device *, void *);
static int sacpcic_match(device_t, cfdata_t, void *);
static void sacpcic_attach(device_t, device_t, void *);
static void lubbock_set_power(struct sapcic_socket *so, int arg);
static void lubbock_socket_setup(struct sapcic_socket *sp);
@ -71,11 +71,11 @@ static struct sapcic_tag lubbock_sacpcic_functions = {
sacpcic_intr_disestablish
};
CFATTACH_DECL(sacpcic, sizeof(struct sacpcic_softc),
CFATTACH_DECL_NEW(sacpcic, sizeof(struct sacpcic_softc),
sacpcic_match, sacpcic_attach, NULL, NULL);
static int
sacpcic_match(struct device *parent, struct cfdata *cf, void *aux)
sacpcic_match(device_t parent, cfdata_t cf, void *aux)
{
return (1);
}
@ -88,10 +88,10 @@ lubbock_socket_setup(struct sapcic_socket *sp)
}
static void
sacpcic_attach(struct device *parent, struct device *self, void *aux)
sacpcic_attach(device_t parent, device_t self, void *aux)
{
sacpcic_attach_common((struct sacc_softc *)parent,
(struct sacpcic_softc *)self, aux, lubbock_socket_setup);
sacpcic_attach_common(device_private(parent),
device_private(self), aux, lubbock_socket_setup);
}
@ -99,8 +99,7 @@ static void
lubbock_set_power(struct sapcic_socket *so, int arg)
{
struct sacc_softc *sc = so->pcictag_cookie;
struct obio_softc *bsc =
(struct obio_softc *)device_parent(&sc->sc_dev);
struct obio_softc *bsc = device_private(device_parent(sc->sc_dev));
int s;
uint16_t tmp;
@ -134,6 +133,6 @@ lubbock_set_power(struct sapcic_socket *so, int arg)
splx(s);
break;
default:
printf("unknown socket number: %d\n", so->socket);
aprint_normal("unknown socket number: %d\n", so->socket);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
/* $NetBSD: lubbock_var.h,v 1.2 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
@ -45,7 +45,7 @@
#define N_OBIO_IRQ 8
struct obio_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_obioreg_ioh;
void *sc_ih; /* interrupt handler for obio on pxaip */

View File

@ -1,4 +1,4 @@
/* $NetBSD: obio.c,v 1.8 2008/04/27 18:58:46 matt Exp $ */
/* $NetBSD: obio.c,v 1.9 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.8 2008/04/27 18:58:46 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.9 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -59,14 +59,13 @@ __KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.8 2008/04/27 18:58:46 matt Exp $");
#include "locators.h"
/* prototypes */
static int obio_match(struct device *, struct cfdata *, void *);
static void obio_attach(struct device *, struct device *, void *);
static int obio_search(struct device *, struct cfdata *,
const int *, void *);
static int obio_match(device_t, cfdata_t, void *);
static void obio_attach(device_t, device_t, void *);
static int obio_search(device_t, cfdata_t, const int *, void *);
static int obio_print(void *, const char *);
/* attach structures */
CFATTACH_DECL(obio, sizeof(struct obio_softc), obio_match, obio_attach,
CFATTACH_DECL_NEW(obio, sizeof(struct obio_softc), obio_match, obio_attach,
NULL, NULL);
uint32_t obio_intr_mask;
@ -76,7 +75,7 @@ obio_spurious(void *arg)
{
int irqno = (int)arg;
printf("Spurious interrupt %d on On-board peripheral", irqno);
aprint_normal("Spurious interrupt %d on On-board peripheral", irqno);
return 1;
}
@ -194,22 +193,22 @@ obio_print(void *aux, const char *name)
struct obio_attach_args *oba = (struct obio_attach_args*)aux;
if (oba->oba_addr != OBIOCF_ADDR_DEFAULT)
printf(" addr 0x%lx", oba->oba_addr);
aprint_normal(" addr 0x%lx", oba->oba_addr);
if (oba->oba_intr > 0)
printf(" intr %d", oba->oba_intr);
aprint_normal(" intr %d", oba->oba_intr);
return (UNCONF);
}
int
obio_match(struct device *parent, struct cfdata *match, void *aux)
obio_match(device_t parent, cfdata_t match, void *aux)
{
return 1;
}
void
obio_attach(struct device *parent, struct device *self, void *aux)
obio_attach(device_t parent, device_t self, void *aux)
{
struct obio_softc *sc = (struct obio_softc*)self;
struct obio_softc *sc = device_private(self);
int system_id, baseboard_id, expansion_id, processor_card_id;
struct pxaip_attach_args *sa = (struct pxaip_attach_args *)aux;
const char *processor_card_name;
@ -217,10 +216,11 @@ obio_attach(struct device *parent, struct device *self, void *aux)
/* Map on-board FPGA registers */
sc->sc_dev = self;
sc->sc_iot = &pxa2x0_bs_tag;
if (bus_space_map(sc->sc_iot, LUBBOCK_OBIO_PBASE, LUBBOCK_OBIO_SIZE,
0, &(sc->sc_obioreg_ioh))) {
printf("%s: can't map FPGA registers\n", self->dv_xname);
aprint_normal_dev(self, "can't map FPGA registers\n");
}
system_id = bus_space_read_4(sc->sc_iot, sc->sc_obioreg_ioh,
@ -287,10 +287,9 @@ obio_attach(struct device *parent, struct device *self, void *aux)
}
int
obio_search(struct device *parent, struct cfdata *cf, const int *ldesc,
void *aux)
obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
struct obio_softc *sc = (struct obio_softc *)parent;
struct obio_softc *sc = device_private(parent);
struct obio_attach_args oba;
oba.oba_sc = sc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sacc_obio.c,v 1.9 2009/03/14 15:36:05 dsl Exp $ */
/* $NetBSD: sacc_obio.c,v 1.10 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sacc_obio.c,v 1.9 2009/03/14 15:36:05 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: sacc_obio.c,v 1.10 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -65,14 +65,14 @@ __KERNEL_RCSID(0, "$NetBSD: sacc_obio.c,v 1.9 2009/03/14 15:36:05 dsl Exp $");
#include <evbarm/lubbock/lubbock_var.h>
static void sacc_obio_attach(struct device *, struct device *, void *);
static void sacc_obio_attach(device_t, device_t, void *);
static int sacc_obio_intr(void *arg);
CFATTACH_DECL(sacc_obio, sizeof(struct sacc_softc), sacc_probe,
CFATTACH_DECL_NEW(sacc_obio, sizeof(struct sacc_softc), sacc_probe,
sacc_obio_attach, NULL, NULL);
#if 0
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg)
#endif
@ -80,17 +80,17 @@ CFATTACH_DECL(sacc_obio, sizeof(struct sacc_softc), sacc_probe,
uint16_t cs2_memctl_init = 0x7ff0;
static void
sacc_obio_attach(struct device *parent, struct device *self, void *aux)
sacc_obio_attach(device_t parent, device_t self, void *aux)
{
int i;
u_int32_t skid, tmp;
struct sacc_softc *sc = (struct sacc_softc *)self;
struct obio_softc *psc = (struct obio_softc *)parent;
struct sacc_softc *sc = device_private(self);
struct obio_softc *psc = device_private(parent);
struct obio_attach_args *sa = aux;
bus_space_tag_t iot = sa->oba_iot;
bus_space_handle_t memctl_ioh;
printf("\n");
aprint_normal("\n");
/* Set alternative function for GPIO pings 48..57 on PXA2X0 */
for (i=48; i <= 55; ++i)
@ -109,6 +109,7 @@ sacc_obio_attach(struct device *parent, struct device *self, void *aux)
bus_space_unmap(iot, memctl_ioh, PXA2X0_MEMCTL_SIZE);
sc->sc_dev = self;
sc->sc_piot = sc->sc_iot = iot;
sc->sc_gpioh = 0; /* not used */
@ -117,8 +118,8 @@ sacc_obio_attach(struct device *parent, struct device *self, void *aux)
skid = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SACCSBI_SKID);
printf("%s: SA1111 rev %d.%d\n", sc->sc_dev.dv_xname,
(skid & 0xf0) >> 4, skid & 0xf);
aprint_normal_dev(self, "SA1111 rev %d.%d\n",
(skid & 0xf0) >> 4, skid & 0xf);
tmp = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SACCSBI_SKCR);
tmp = (tmp & ~SKCR_VCOOFF) | SKCR_PLLBYPASS;
@ -161,7 +162,7 @@ sacc_obio_attach(struct device *parent, struct device *self, void *aux)
return;
fail:
printf("%s: unable to map registers\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "unable to map registers\n");
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_atmelgpio.c,v 1.14 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_atmelgpio.c,v 1.15 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. All rights reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipaq_atmelgpio.c,v 1.14 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipaq_atmelgpio.c,v 1.15 2009/05/29 14:15:44 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,48 +57,47 @@ __KERNEL_RCSID(0, "$NetBSD: ipaq_atmelgpio.c,v 1.14 2008/04/28 20:23:21 martin E
#include <arm/sa11x0/sa11x0_reg.h>
#ifdef ATMEL_DEBUG
#define DPRINTF(x) printf x
#define DPRINTF(x) aprint_normal x
#else
#define DPRINTF(x)
#endif
static int atmelgpio_match(struct device *, struct cfdata *, void *);
static void atmelgpio_attach(struct device *, struct device *, void *);
static int atmelgpio_match(device_t, cfdata_t, void *);
static void atmelgpio_attach(device_t, device_t, void *);
static int atmelgpio_print(void *, const char *);
static int atmelgpio_search(struct device *, struct cfdata *,
const int *, void *);
static int atmelgpio_search(device_t, cfdata_t, const int *, void *);
static void atmelgpio_init(struct atmelgpio_softc *);
static void rxtx_data(struct atmelgpio_softc *, int, int,
uint8_t *, struct atmel_rx *);
CFATTACH_DECL(atmelgpio, sizeof(struct atmelgpio_softc),
CFATTACH_DECL_NEW(atmelgpio, sizeof(struct atmelgpio_softc),
atmelgpio_match, atmelgpio_attach, NULL, NULL);
static int
atmelgpio_match(struct device *parent, struct cfdata *cf, void *aux)
atmelgpio_match(device_t parent, cfdata_t cf, void *aux)
{
return (1);
}
static void
atmelgpio_attach(struct device *parent, struct device *self, void *aux)
atmelgpio_attach(device_t parent, device_t self, void *aux)
{
struct atmelgpio_softc *sc = (struct atmelgpio_softc *)self;
struct ipaq_softc *psc = (struct ipaq_softc *)parent;
struct atmelgpio_softc *sc = device_private(self);
struct ipaq_softc *psc = device_private(parent);
struct atmel_rx rxbuf;
printf("\n");
printf("%s: Atmel microcontroller GPIO\n", sc->sc_dev.dv_xname);
aprint_normal("\n");
aprint_normal_dev(self, "Atmel microcontroller GPIO\n");
sc->sc_iot = psc->sc_iot;
sc->sc_ioh = psc->sc_ioh;
sc->sc_parent = (struct ipaq_softc *)parent;
sc->sc_parent = psc;
if (bus_space_map(sc->sc_iot, SACOM1_BASE, SACOM_NPORTS, 0,
&sc->sc_ioh)) {
printf("%s: unable to map of UART1 registers\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "unable to map of UART1 registers\n");
return;
}
@ -110,12 +109,12 @@ atmelgpio_attach(struct device *parent, struct device *self, void *aux)
#if 1 /* this is sample */
rxtx_data(sc, STATUS_BATTERY, 0, NULL, &rxbuf);
printf("ac_status = %x\n", rxbuf.data[0]);
printf("Battery kind = %x\n", rxbuf.data[1]);
printf("Voltage = %d mV\n",
aprint_normal("ac_status = %x\n", rxbuf.data[0]);
aprint_normal("Battery kind = %x\n", rxbuf.data[1]);
aprint_normal("Voltage = %d mV\n",
1000 * (rxbuf.data[3] << 8 | rxbuf.data[2]) /228);
printf("Battery Status = %x\n", rxbuf.data[4]);
printf("Battery percentage = %d\n",
aprint_normal("Battery Status = %x\n", rxbuf.data[4]);
aprint_normal("Battery percentage = %d\n",
425 * (rxbuf.data[3] << 8 | rxbuf.data[2]) /1000 - 298);
#endif
@ -129,7 +128,7 @@ atmelgpio_attach(struct device *parent, struct device *self, void *aux)
}
static int
atmelgpio_search(struct device *parent, struct cfdata *cf, const int *ldesc,
atmelgpio_search(device_t parent, cfdata_t cf, const int *ldesc,
void *aux)
{
if (config_match(parent, cf, NULL) > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_atmelvar.h,v 1.3 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_atmelvar.h,v 1.4 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. All rights reserved.
@ -29,7 +29,7 @@
*/
struct atmelgpio_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct ipaq_softc *sc_parent;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_lcd.c,v 1.17 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_lcd.c,v 1.18 2009/05/29 14:15:44 rjs Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipaq_lcd.c,v 1.17 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipaq_lcd.c,v 1.18 2009/05/29 14:15:44 rjs Exp $");
#define IPAQ_LCD_DEBUG
@ -60,15 +60,15 @@ __KERNEL_RCSID(0, "$NetBSD: ipaq_lcd.c,v 1.17 2008/04/28 20:23:21 martin Exp $")
#include <hpcarm/dev/ipaq_lcdvar.h>
#ifdef IPAQ_LCD_DEBUG
#define DPRINTFN(n, x) if (ipaqlcddebug > (n)) printf x
#define DPRINTFN(n, x) if (ipaqlcddebug > (n)) aprint_normal x
int ipaqlcddebug = 0xff;
#else
#define DPRINTFN(n, x)
#endif
#define DPRINTF(x) DPRINTFN(0, x)
static int ipaqlcd_match(struct device *, struct cfdata *, void *);
static void ipaqlcd_attach(struct device *, struct device *, void *);
static int ipaqlcd_match(device_t, cfdata_t, void *);
static void ipaqlcd_attach(device_t, device_t, void *);
static void ipaqlcd_init(struct ipaqlcd_softc *);
static int ipaqlcd_fbinit(struct ipaqlcd_softc *);
static int ipaqlcd_ioctl(void *, u_long, void *, int, struct lwp *);
@ -81,7 +81,7 @@ static paddr_t ipaqlcd_mmap(void *, off_t, int);
#error "define btop, ptob."
#endif
CFATTACH_DECL(ipaqlcd, sizeof(struct ipaqlcd_softc),
CFATTACH_DECL_NEW(ipaqlcd, sizeof(struct ipaqlcd_softc),
ipaqlcd_match, ipaqlcd_attach, NULL, NULL);
struct hpcfb_accessops ipaqlcd_ha = {
@ -90,26 +90,27 @@ struct hpcfb_accessops ipaqlcd_ha = {
static int console_flag = 0;
static int
ipaqlcd_match(struct device *parent, struct cfdata *match, void *aux)
ipaqlcd_match(device_t parent, cfdata_t match, void *aux)
{
return (1);
}
void
ipaqlcd_attach(struct device *parent, struct device *self, void *aux)
ipaqlcd_attach(device_t parent, device_t self, void *aux)
{
struct ipaqlcd_softc *sc = (struct ipaqlcd_softc*)self;
struct ipaqlcd_softc *sc = device_private(self);
struct hpcfb_attach_args ha;
struct ipaq_softc *psc = (struct ipaq_softc *)parent;
struct ipaq_softc *psc = device_private(parent);
sc->sc_dev = self;
sc->sc_iot = psc->sc_iot;
sc->sc_parent = (struct ipaq_softc *)parent;
sc->sc_parent = psc;
ipaqlcd_init(sc);
ipaqlcd_fbinit(sc);
printf("\n");
printf("%s: iPAQ internal LCD controller\n", sc->sc_dev.dv_xname);
aprint_normal("\n");
aprint_normal_dev(self, "iPAQ internal LCD controller\n");
DPRINTF(("framebuffer_baseaddr=%lx\n", (u_long)bootinfo->fb_addr));
@ -123,7 +124,7 @@ ipaqlcd_attach(struct device *parent, struct device *self, void *aux)
ha.ha_ndspconf = 1;
ha.ha_dspconflist = &sc->sc_dspconf;
config_found(&sc->sc_dev, &ha, hpcfbprint);
config_found(sc->sc_dev, &ha, hpcfbprint);
}
void
@ -189,7 +190,7 @@ ipaqlcd_fbinit(struct ipaqlcd_softc *sc)
if (bus_space_map(sc->sc_iot, (bus_addr_t)bootinfo->fb_addr,
bootinfo->fb_height * bootinfo->fb_line_bytes,
0, &fb->hf_baseaddr)) {
printf("unable to map framebuffer\n");
aprint_normal("unable to map framebuffer\n");
return (-1);
}
@ -255,7 +256,8 @@ ipaqlcd_fbinit(struct ipaqlcd_softc *sc)
fb->hf_u.hf_rgb.hf_alpha_shift = 0;
break;
default :
printf("unknown type (=%d).\n", bootinfo->fb_type);
aprint_normal("unknown type (=%d).\n",
bootinfo->fb_type);
return (-1);
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_lcdvar.h,v 1.2 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_lcdvar.h,v 1.3 2009/05/29 14:15:44 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
#include <dev/hpc/hpcfbio.h>
struct ipaqlcd_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct ipaq_softc *sc_parent;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_pcic.c,v 1.18 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_pcic.c,v 1.19 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipaq_pcic.c,v 1.18 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipaq_pcic.c,v 1.19 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -56,8 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: ipaq_pcic.c,v 1.18 2008/04/28 20:23:21 martin Exp $"
#include "ipaqpcic.h"
static int ipaqpcic_match(struct device *, struct cfdata *, void *);
static void ipaqpcic_attach(struct device *, struct device *, void *);
static int ipaqpcic_match(device_t, cfdata_t, void *);
static void ipaqpcic_attach(device_t, device_t, void *);
static int ipaqpcic_print(void *, const char *);
static int ipaqpcic_read(struct sapcic_socket *, int);
@ -86,28 +86,29 @@ static struct sapcic_tag ipaqpcic_functions = {
ipaqpcic_intr_disestablish
};
CFATTACH_DECL(ipaqpcic, sizeof(struct ipaqpcic_softc),
CFATTACH_DECL_NEW(ipaqpcic, sizeof(struct ipaqpcic_softc),
ipaqpcic_match, ipaqpcic_attach, NULL, NULL);
static int
ipaqpcic_match(struct device *parent, struct cfdata *cf, void *aux)
ipaqpcic_match(device_t parent, cfdata_t cf, void *aux)
{
return (1);
}
static void
ipaqpcic_attach(struct device *parent, struct device *self, void *aux)
ipaqpcic_attach(device_t parent, device_t self, void *aux)
{
int i;
struct pcmciabus_attach_args paa;
struct ipaqpcic_softc *sc = (struct ipaqpcic_softc *)self;
struct ipaq_softc *psc = (struct ipaq_softc *)parent;
struct ipaqpcic_softc *sc = device_private(self);
struct ipaq_softc *psc = device_private(parent);
printf("\n");
aprint_normal("\n");
sc->sc_pc.sc_dev = self;
sc->sc_pc.sc_iot = psc->sc_iot;
sc->sc_ioh = psc->sc_ioh;
sc->sc_parent = (struct ipaq_softc *)parent;
sc->sc_parent = psc;
ipaqpcic_init(sc);
@ -128,7 +129,7 @@ ipaqpcic_attach(struct device *parent, struct device *self, void *aux)
paa.iosize = 0x4000000;
sc->sc_socket[i].pcmcia =
config_found_ia(&sc->sc_pc.sc_dev, "pcmciabus",
config_found_ia(sc->sc_pc.sc_dev, "pcmciabus",
&paa, ipaqpcic_print);
sa11x0_intr_establish((sa11x0_chipset_tag_t)psc,

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_saip.c,v 1.21 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_saip.c,v 1.22 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipaq_saip.c,v 1.21 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipaq_saip.c,v 1.22 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -54,14 +54,13 @@ __KERNEL_RCSID(0, "$NetBSD: ipaq_saip.c,v 1.21 2008/04/28 20:23:21 martin Exp $"
#include <hpcarm/dev/ipaq_gpioreg.h>
/* prototypes */
static int ipaq_match(struct device *, struct cfdata *, void *);
static void ipaq_attach(struct device *, struct device *, void *);
static int ipaq_search(struct device *, struct cfdata *,
const int *, void *);
static int ipaq_match(device_t, cfdata_t, void *);
static void ipaq_attach(device_t, device_t, void *);
static int ipaq_search(device_t, cfdata_t, const int *, void *);
static int ipaq_print(void *, const char *);
/* attach structures */
CFATTACH_DECL(ipaqbus, sizeof(struct ipaq_softc),
CFATTACH_DECL_NEW(ipaqbus, sizeof(struct ipaq_softc),
ipaq_match, ipaq_attach, NULL, NULL);
static int
@ -71,19 +70,20 @@ ipaq_print(void *aux, const char *name)
}
int
ipaq_match(struct device *parent, struct cfdata *match, void *aux)
ipaq_match(device_t parent, cfdata_t match, void *aux)
{
return (1);
}
void
ipaq_attach(struct device *parent, struct device *self, void *aux)
ipaq_attach(device_t parent, device_t self, void *aux)
{
struct ipaq_softc *sc = (struct ipaq_softc*)self;
struct sa11x0_softc *psc = (struct sa11x0_softc *)parent;
struct ipaq_softc *sc = device_private(self);
struct sa11x0_softc *psc = device_private(parent);
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_iot = psc->sc_iot;
sc->sc_ioh = psc->sc_ioh;
sc->sc_gpioh = psc->sc_gpioh;
@ -91,7 +91,7 @@ ipaq_attach(struct device *parent, struct device *self, void *aux)
/* Map the Extended GPIO registers */
if (bus_space_map(sc->sc_iot, SAEGPIO_BASE, 1, 0, &sc->sc_egpioh))
panic("%s: unable to map Extended GPIO registers",
self->dv_xname);
device_xname(self));
sc->ipaq_egpio = EGPIO_INIT;
bus_space_write_2(sc->sc_iot, sc->sc_egpioh, 0, sc->ipaq_egpio);
@ -99,7 +99,7 @@ ipaq_attach(struct device *parent, struct device *self, void *aux)
/* Map the SSP registers */
if (bus_space_map(sc->sc_iot, SASSP_BASE, SASSP_NPORTS, 0, &sc->sc_ssph))
panic("%s: unable to map SSP registers",
self->dv_xname);
device_xname(self));
sc->sc_ppch = psc->sc_ppch;
sc->sc_dmach = psc->sc_dmach;
@ -111,8 +111,7 @@ ipaq_attach(struct device *parent, struct device *self, void *aux)
}
int
ipaq_search(struct device *parent, struct cfdata *cf, const int *ldesc,
void *aux)
ipaq_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
if (config_match(parent, cf, NULL) > 0)
config_attach(parent, cf, NULL, ipaq_print);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipaq_saipvar.h,v 1.6 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: ipaq_saipvar.h,v 1.7 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved.
@ -30,7 +30,7 @@
/* ipaq softc */
struct ipaq_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
bus_space_handle_t sc_gpioh;

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720kbd.c,v 1.5 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720kbd.c,v 1.6 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 keyboard driver. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720kbd.c,v 1.5 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720kbd.c,v 1.6 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: j720kbd.c,v 1.5 2008/04/28 20:23:21 martin Exp $");
#include <hpcarm/dev/j720sspvar.h>
#ifdef DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg) /* nothing */
#endif
@ -69,15 +69,15 @@ struct j720kbd_chip {
};
struct j720kbd_softc {
struct device sc_dev;
device_t sc_dev;
struct j720kbd_chip *sc_chip;
};
static struct j720kbd_chip j720kbd_chip;
static int j720kbd_match(struct device *, struct cfdata *, void *);
static void j720kbd_attach(struct device *, struct device *, void *);
static int j720kbd_match(device_t, cfdata_t, void *);
static void j720kbd_attach(device_t, device_t, void *);
static void j720kbd_cnattach(void);
static void j720kbd_ifsetup(struct j720kbd_chip *);
@ -86,12 +86,12 @@ static int j720kbd_intr(void *);
static int j720kbd_poll(void *);
static void j720kbd_read(struct j720kbd_chip *, char *);
CFATTACH_DECL(j720kbd, sizeof(struct j720kbd_softc),
CFATTACH_DECL_NEW(j720kbd, sizeof(struct j720kbd_softc),
j720kbd_match, j720kbd_attach, NULL, NULL);
static int
j720kbd_match(struct device *parent, struct cfdata *cf, void *aux)
j720kbd_match(device_t parent, cfdata_t cf, void *aux)
{
if (!platid_match(&platid, &platid_mask_MACH_HP_JORNADA_7XX))
@ -103,15 +103,16 @@ j720kbd_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
j720kbd_attach(struct device *parent, struct device *self, void *aux)
j720kbd_attach(device_t parent, device_t self, void *aux)
{
struct j720kbd_softc *sc = (void *)self;
struct j720kbd_softc *sc = device_private(self);
struct hpckbd_attach_args haa;
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_chip = &j720kbd_chip;
sc->sc_chip->scc_ssp = (struct j720ssp_softc *)parent;
sc->sc_chip->scc_ssp = device_private(parent);
sc->sc_chip->scc_enabled = 0;
/* Attach console if not using serial. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720lcd.c,v 1.4 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720lcd.c,v 1.5 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 LCD screen driver. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720lcd.c,v 1.4 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720lcd.c,v 1.5 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -52,29 +52,29 @@ __KERNEL_RCSID(0, "$NetBSD: j720lcd.c,v 1.4 2008/04/28 20:23:21 martin Exp $");
#include <hpcarm/dev/sed1356var.h>
#ifdef DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg) /* nothing */
#endif
struct j720lcd_softc {
struct device sc_dev;
device_t sc_dev;
struct j720ssp_softc *sc_ssp;
};
static int j720lcd_match(struct device *, struct cfdata *, void *);
static void j720lcd_attach(struct device *, struct device *, void *);
static int j720lcd_match(device_t, cfdata_t, void *);
static void j720lcd_attach(device_t, device_t, void *);
static int j720lcd_param(void *, int, long, void *);
int j720lcd_power(void *, int, long, void *);
CFATTACH_DECL(j720lcd, sizeof(struct j720lcd_softc),
CFATTACH_DECL_NEW(j720lcd, sizeof(struct j720lcd_softc),
j720lcd_match, j720lcd_attach, NULL, NULL);
static int
j720lcd_match(struct device *parent, struct cfdata *cf, void *aux)
j720lcd_match(device_t parent, cfdata_t cf, void *aux)
{
if (!platid_match(&platid, &platid_mask_MACH_HP_JORNADA_7XX))
@ -86,12 +86,13 @@ j720lcd_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
j720lcd_attach(struct device *parent, struct device *self, void *aux)
j720lcd_attach(device_t parent, device_t self, void *aux)
{
struct j720lcd_softc *sc = (struct j720lcd_softc *)self;
struct j720lcd_softc *sc = device_private(self);
int brightness, contrast;
sc->sc_ssp = (struct j720ssp_softc *)parent;
sc->sc_dev = self;
sc->sc_ssp = device_private(parent);
/* LCD brightness hooks. */
config_hook(CONFIG_HOOK_SET, CONFIG_HOOK_BRIGHTNESS,
@ -120,7 +121,7 @@ j720lcd_attach(struct device *parent, struct device *self, void *aux)
config_hook_call(CONFIG_HOOK_GET, CONFIG_HOOK_BRIGHTNESS, &brightness);
config_hook_call(CONFIG_HOOK_GET, CONFIG_HOOK_CONTRAST, &contrast);
printf(": brightness %d, contrast %d\n", brightness, contrast);
aprint_normal(": brightness %d, contrast %d\n", brightness, contrast);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720pcic.c,v 1.5 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720pcic.c,v 1.6 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 PCMCIA support. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720pcic.c,v 1.5 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720pcic.c,v 1.6 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -61,8 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: j720pcic.c,v 1.5 2008/04/28 20:23:21 martin Exp $");
#include "sacpcic.h"
static int sacpcic_match(struct device *, struct cfdata *, void *);
static void sacpcic_attach(struct device *, struct device *, void *);
static int sacpcic_match(device_t, cfdata_t, void *);
static void sacpcic_attach(device_t, device_t, void *);
static void j720_socket_setup(struct sapcic_socket *);
static void j720_set_power(struct sapcic_socket *, int);
@ -85,23 +85,23 @@ static struct platid_data sacpcic_platid_table[] = {
{ NULL, NULL }
};
CFATTACH_DECL(sacpcic, sizeof(struct sacpcic_softc),
CFATTACH_DECL_NEW(sacpcic, sizeof(struct sacpcic_softc),
sacpcic_match, sacpcic_attach, NULL, NULL);
static int
sacpcic_match(struct device *parent, struct cfdata *cf, void *aux)
sacpcic_match(device_t parent, cfdata_t cf, void *aux)
{
return 1;
}
static void
sacpcic_attach(struct device *parent, struct device *self, void *aux)
sacpcic_attach(device_t parent, device_t self, void *aux)
{
sacpcic_attach_common((struct sacc_softc *)parent,
(struct sacpcic_softc *)self, aux, j720_socket_setup);
sacpcic_attach_common(device_private(parent),
device_private(self), aux, j720_socket_setup);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720pwr.c,v 1.4 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720pwr.c,v 1.5 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 power management. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720pwr.c,v 1.4 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720pwr.c,v 1.5 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: j720pwr.c,v 1.4 2008/04/28 20:23:21 martin Exp $");
#include <hpcarm/dev/j720sspvar.h>
#ifdef DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg) /* nothing */
#endif
@ -62,7 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: j720pwr.c,v 1.4 2008/04/28 20:23:21 martin Exp $");
#define arraysize(ary) (sizeof(ary) / sizeof(ary[0]))
struct j720pwr_softc {
struct device sc_dev;
device_t sc_dev;
struct j720ssp_softc *sc_ssp;
@ -71,8 +71,8 @@ struct j720pwr_softc {
#define J720PWR_SLEEPING 0x02
};
static int j720pwr_match(struct device *, struct cfdata *, void *);
static void j720pwr_attach(struct device *, struct device *, void *);
static int j720pwr_match(device_t, cfdata_t, void *);
static void j720pwr_attach(device_t, device_t, void *);
static void j720pwr_sleep(void *);
static int j720pwr_suspend_hook(void *, int, long, void *);
@ -100,12 +100,12 @@ static const struct {
{ 0, 430, APM_BATT_FLAG_CRITICAL },
};
CFATTACH_DECL(j720pwr, sizeof(struct j720pwr_softc),
CFATTACH_DECL_NEW(j720pwr, sizeof(struct j720pwr_softc),
j720pwr_match, j720pwr_attach, NULL, NULL);
static int
j720pwr_match(struct device *parent, struct cfdata *cf, void *aux)
j720pwr_match(device_t parent, cfdata_t cf, void *aux)
{
if (!platid_match(&platid, &platid_mask_MACH_HP_JORNADA_7XX))
@ -117,15 +117,16 @@ j720pwr_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
j720pwr_attach(struct device *parent, struct device *self, void *aux)
j720pwr_attach(device_t parent, device_t self, void *aux)
{
struct j720pwr_softc *sc = (struct j720pwr_softc *)self;
struct j720pwr_softc *sc = device_private(self);
extern void (*__sleep_func)(void *);
extern void *__sleep_ctx;
printf("\n");
aprint_normal("\n");
sc->sc_ssp = (struct j720ssp_softc *)parent;
sc->sc_dev = self;
sc->sc_ssp = device_private(parent);
sc->sc_state = 0;
/* Register apm sleep function. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720ssp.c,v 1.31 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720ssp.c,v 1.32 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001, 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 SSP port. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720ssp.c,v 1.31 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720ssp.c,v 1.32 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: j720ssp.c,v 1.31 2008/04/28 20:23:21 martin Exp $");
#include <hpcarm/dev/j720sspvar.h>
#ifdef DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg) /* nothing */
#endif
@ -58,18 +58,17 @@ __KERNEL_RCSID(0, "$NetBSD: j720ssp.c,v 1.31 2008/04/28 20:23:21 martin Exp $");
(x) = ((((x) & 0xaa) >> 1) | (((x) & 0x55) << 1)); \
} while (0)
static int j720ssp_match(struct device *, struct cfdata *, void *);
static void j720ssp_attach(struct device *, struct device *, void *);
static int j720ssp_search(struct device *, struct cfdata *,
const int *, void *);
static int j720ssp_match(device_t, cfdata_t, void *);
static void j720ssp_attach(device_t, device_t, void *);
static int j720ssp_search(device_t, cfdata_t, const int *, void *);
static int j720ssp_print(void *, const char *);
CFATTACH_DECL(j720ssp, sizeof(struct j720ssp_softc),
CFATTACH_DECL_NEW(j720ssp, sizeof(struct j720ssp_softc),
j720ssp_match, j720ssp_attach, NULL, NULL);
static int
j720ssp_match(struct device *parent, struct cfdata *cf, void *aux)
j720ssp_match(device_t parent, cfdata_t cf, void *aux)
{
if (strcmp(cf->cf_name, "j720ssp") != 0)
@ -79,30 +78,30 @@ j720ssp_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
j720ssp_attach(struct device *parent, struct device *self, void *aux)
j720ssp_attach(device_t parent, device_t self, void *aux)
{
struct j720ssp_softc *sc = (void *)self;
struct sa11x0_softc *psc = (void *)parent;
struct j720ssp_softc *sc = device_private(self);
struct sa11x0_softc *psc = device_private(parent);
struct sa11x0_attach_args *sa = aux;
sc->sc_dev = self;
sc->sc_iot = psc->sc_iot;
sc->sc_gpioh = psc->sc_gpioh;
sc->sc_parent = psc;
if (bus_space_map(sc->sc_iot, sa->sa_addr, sa->sa_size, 0,
&sc->sc_ssph)) {
printf(": unable to map SSP registers\n");
aprint_normal(": unable to map SSP registers\n");
return;
}
printf("\n");
aprint_normal("\n");
config_search_ia(j720ssp_search, self, "j720ssp", NULL);
}
static int
j720ssp_search(struct device *parent, struct cfdata *cf,
const int *ldesc, void *aux)
j720ssp_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
if (config_match(parent, cf, NULL) > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720sspvar.h,v 1.3 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720sspvar.h,v 1.4 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 SSP port. */
struct j720ssp_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_gpioh;

View File

@ -1,4 +1,4 @@
/* $NetBSD: j720tp.c,v 1.9 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: j720tp.c,v 1.10 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
/* Jornada 720 touch-panel driver. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j720tp.c,v 1.9 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: j720tp.c,v 1.10 2009/05/29 14:15:45 rjs Exp $");
#ifdef _KERNEL_OPT
#include "opt_j720tp.h"
@ -73,15 +73,15 @@ __KERNEL_RCSID(0, "$NetBSD: j720tp.c,v 1.9 2008/04/28 20:23:21 martin Exp $");
#ifdef J720TP_DEBUG
int j720tp_debug = 0;
#define DPRINTF(arg) if (j720tp_debug) printf arg
#define DPRINTFN(n, arg) if (j720tp_debug >= (n)) printf arg
#define DPRINTF(arg) if (j720tp_debug) aprint_normal arg
#define DPRINTFN(n, arg) if (j720tp_debug >= (n)) aprint_normal arg
#else
#define DPRINTF(arg) /* nothing */
#define DPRINTFN(n, arg) /* nothing */
#endif
struct j720tp_softc {
struct device sc_dev;
device_t sc_dev;
#define J720TP_WSMOUSE_ENABLED 0x01
#define J720TP_WSKBD_ENABLED 0x02
@ -94,14 +94,14 @@ struct j720tp_softc {
struct callout sc_tpcallout;
struct j720ssp_softc *sc_ssp;
struct device *sc_wsmousedev;
struct device *sc_wskbddev;
device_t sc_wsmousedev;
device_t sc_wskbddev;
struct tpcalib_softc sc_tpcalib;
};
static int j720tp_match(struct device *, struct cfdata *, void *);
static void j720tp_attach(struct device *, struct device *, void *);
static int j720tp_match(device_t, cfdata_t, void *);
static void j720tp_attach(device_t, device_t, void *);
static int j720tp_wsmouse_enable(void *);
static int j720tp_wsmouse_ioctl(void *, u_long, void *, int,
@ -194,12 +194,12 @@ const struct wskbd_mapdata j720tp_wskbd_keymapdata = {
j720tp_wskbd_keydesctab, KB_US
};
CFATTACH_DECL(j720tp, sizeof(struct j720tp_softc),
CFATTACH_DECL_NEW(j720tp, sizeof(struct j720tp_softc),
j720tp_match, j720tp_attach, NULL, NULL);
static int
j720tp_match(struct device *parent, struct cfdata *cf, void *aux)
j720tp_match(device_t parent, cfdata_t cf, void *aux)
{
if (!platid_match(&platid, &platid_mask_MACH_HP_JORNADA_7XX))
@ -211,15 +211,16 @@ j720tp_match(struct device *parent, struct cfdata *cf, void *aux)
}
static void
j720tp_attach(struct device *parent, struct device *self, void *aux)
j720tp_attach(device_t parent, device_t self, void *aux)
{
struct j720tp_softc *sc = (struct j720tp_softc *)self;
struct j720tp_softc *sc = device_private(self);
struct wsmousedev_attach_args wsma;
struct wskbddev_attach_args wska;
printf("\n");
aprint_normal("\n");
sc->sc_ssp = (struct j720ssp_softc *)parent;
sc->sc_dev = self;
sc->sc_ssp = device_private(parent);
sc->sc_enabled = 0;
sc->sc_hard_icon = 0;
sc->sc_rawkbd = 0;
@ -609,5 +610,5 @@ SYSCTL_SETUP(sysctl_j720tp, "sysctl j720tp subtree setup")
return;
err:
printf("%s: sysctl_createv failed (rc = %d)\n", __func__, rc);
aprint_normal("%s: sysctl_createv failed (rc = %d)\n", __func__, rc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sacc_hpcarm.c,v 1.10 2008/04/28 20:23:21 martin Exp $ */
/* $NetBSD: sacc_hpcarm.c,v 1.11 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sacc_hpcarm.c,v 1.10 2008/04/28 20:23:21 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: sacc_hpcarm.c,v 1.11 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -55,7 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: sacc_hpcarm.c,v 1.10 2008/04/28 20:23:21 martin Exp
#include <arm/sa11x0/sa1111_reg.h>
#include <arm/sa11x0/sa1111_var.h>
static void sacc_attach(struct device *, struct device *, void *);
static void sacc_attach(device_t, device_t, void *);
static int sacc_intr(void *);
struct platid_data sacc_platid_table[] = {
@ -63,27 +63,28 @@ struct platid_data sacc_platid_table[] = {
{ NULL, NULL }
};
CFATTACH_DECL(sacc, sizeof(struct sacc_softc),
CFATTACH_DECL_NEW(sacc, sizeof(struct sacc_softc),
sacc_probe, sacc_attach, NULL, NULL);
#ifdef INTR_DEBUG
#define DPRINTF(arg) printf arg
#define DPRINTF(arg) aprint_normal arg
#else
#define DPRINTF(arg)
#endif
static void
sacc_attach(struct device *parent, struct device *self, void *aux)
sacc_attach(device_t parent, device_t self, void *aux)
{
int i, gpiopin;
uint32_t skid;
struct sacc_softc *sc = (struct sacc_softc *)self;
struct sa11x0_softc *psc = (struct sa11x0_softc *)parent;
struct sacc_softc *sc = device_private(self);
struct sa11x0_softc *psc = device_private(parent);
struct sa11x0_attach_args *sa = aux;
struct platid_data *p;
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_iot = sa->sa_iot;
sc->sc_piot = psc->sc_iot;
sc->sc_gpioh = psc->sc_gpioh;
@ -97,14 +98,14 @@ sacc_attach(struct device *parent, struct device *self, void *aux)
if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 0,
&sc->sc_ioh)) {
printf("%s: unable to map registers\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "unable to map registers\n");
return;
}
skid = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SACCSBI_SKID);
printf("%s: SA-1111 rev %d.%d\n", sc->sc_dev.dv_xname,
(skid & 0xf0) >> 4, skid & 0xf);
aprint_normal_dev(self, "SA-1111 rev %d.%d\n",
(skid & 0xf0) >> 4, skid & 0xf);
for (i = 0; i < SACCIC_LEN; i++)
sc->sc_intrhand[i] = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sed1356var.h,v 1.3 2006/06/27 13:30:19 peter Exp $ */
/* $NetBSD: sed1356var.h,v 1.4 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 1999-2001
@ -36,7 +36,7 @@
#include <dev/hpc/hpcfbio.h>
struct sed1356_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_regh;
struct sa11x0_softc *sc_parent;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sed_saip.c,v 1.23 2008/06/12 01:46:32 rafal Exp $ */
/* $NetBSD: sed_saip.c,v 1.24 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 1999-2001
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sed_saip.c,v 1.23 2008/06/12 01:46:32 rafal Exp $");
__KERNEL_RCSID(0, "$NetBSD: sed_saip.c,v 1.24 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -61,7 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: sed_saip.c,v 1.23 2008/06/12 01:46:32 rafal Exp $");
#include <hpcarm/dev/sed1356var.h>
#ifdef SED_DEBUG
#define VPRINTF(arg) do { if (bootverbose) printf arg; } while (0)
#define VPRINTF(arg) do { if (bootverbose) aprint_normal arg; } while (0)
#else
#define VPRINTF(arg) /* nothing */
#endif
@ -69,8 +69,8 @@ __KERNEL_RCSID(0, "$NetBSD: sed_saip.c,v 1.23 2008/06/12 01:46:32 rafal Exp $");
/*
* Function prototypes.
*/
static int sed1356_match(struct device *, struct cfdata *, void *);
static void sed1356_attach(struct device *, struct device *, void *);
static int sed1356_match(device_t, cfdata_t, void *);
static void sed1356_attach(device_t, device_t, void *);
static int sed1356_ioctl(void *, u_long, void *, int, struct lwp *);
static paddr_t sed1356_mmap(void *, off_t, int);
@ -98,7 +98,7 @@ extern int j720lcd_power(void *, int, long, void *); /* XXX */
/*
* Static variables.
*/
CFATTACH_DECL(sed, sizeof(struct sed1356_softc),
CFATTACH_DECL_NEW(sed, sizeof(struct sed1356_softc),
sed1356_match, sed1356_attach, NULL, NULL);
struct hpcfb_accessops sed1356_ha = {
sed1356_ioctl, sed1356_mmap
@ -110,7 +110,7 @@ static int attach_flag = 0;
* Function bodies.
*/
static int
sed1356_match(struct device *parent, struct cfdata *match, void *aux)
sed1356_match(device_t parent, cfdata_t match, void *aux)
{
/* XXX check version register */
@ -118,9 +118,9 @@ sed1356_match(struct device *parent, struct cfdata *match, void *aux)
}
static void
sed1356_attach(struct device *parent, struct device *self, void *aux)
sed1356_attach(device_t parent, device_t self, void *aux)
{
struct sed1356_softc *sc = (struct sed1356_softc *)self;
struct sed1356_softc *sc = device_private(self);
struct hpcfb_attach_args ha;
int console = (bootinfo->bi_cnuse & BI_CNUSE_SERIAL) ? 0 : 1;
@ -133,31 +133,31 @@ sed1356_attach(struct device *parent, struct device *self, void *aux)
/* just return so that hpcfb will not be attached */
return;
}
printf("\n");
aprint_normal("\n");
sc->sc_dev = self;
sc->sc_iot = &sa11x0_bs_tag;
sc->sc_parent = (struct sa11x0_softc *)parent;
sc->sc_parent = device_private(parent);
if (bus_space_map(sc->sc_iot, (bus_addr_t)bootinfo->fb_addr & ~0x3fffff,
0x200, 0, &sc->sc_regh)) {
printf("%s: unable to map register\n", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "unable to map register\n");
return;
}
printf("%s: Epson SED1356", sc->sc_dev.dv_xname);
aprint_normal_dev(self, "Epson SED1356");
if (console) {
printf(", console");
aprint_normal(", console");
}
printf("\n");
printf("%s: framebuffer address: 0x%08lx\n",
sc->sc_dev.dv_xname, (u_long)bootinfo->fb_addr);
aprint_normal("\n");
aprint_normal_dev(self, "framebuffer address: 0x%08lx\n",
(u_long)bootinfo->fb_addr);
/* Add a suspend hook to power saving */
sc->sc_powerstate = 0;
sc->sc_powerhook = powerhook_establish(self->dv_xname,
sed1356_power, sc);
if (sc->sc_powerhook == NULL)
printf("%s: WARNING: unable to establish power hook\n",
sc->sc_dev.dv_xname);
aprint_normal_dev(self, "WARNING: unable to establish power hook\n");
/* Initialize backlight brightness and lcd contrast */
sc->sc_lcd_inited = 0;
@ -199,7 +199,7 @@ sed1356_init(struct hpcfb_fbconf *fb)
bootinfo->fb_line_bytes == 0 ||
bootinfo->fb_width == 0 ||
bootinfo->fb_height == 0) {
printf("no frame buffer information.\n");
aprint_normal("no frame buffer information.\n");
return -1;
}
@ -218,7 +218,7 @@ sed1356_init(struct hpcfb_fbconf *fb)
if (bus_space_map(&sa11x0_bs_tag, (bus_addr_t)bootinfo->fb_addr,
bootinfo->fb_height * bootinfo->fb_line_bytes,
0, &fb->hf_baseaddr)) {
printf("unable to map framebuffer\n");
aprint_normal("unable to map framebuffer\n");
return -1;
}
fb->hf_offset = (u_long)bootinfo->fb_addr -
@ -296,7 +296,7 @@ sed1356_init(struct hpcfb_fbconf *fb)
break;
default:
printf("unsupported type %d.\n", bootinfo->fb_type);
aprint_normal("unsupported type %d.\n", bootinfo->fb_type);
return -1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uda1341.c,v 1.13 2009/03/14 21:04:09 dsl Exp $ */
/* $NetBSD: uda1341.c,v 1.14 2009/05/29 14:15:45 rjs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. All rights reserved.
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uda1341.c,v 1.13 2009/03/14 21:04:09 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: uda1341.c,v 1.14 2009/05/29 14:15:45 rjs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -51,17 +51,16 @@ __KERNEL_RCSID(0, "$NetBSD: uda1341.c,v 1.13 2009/03/14 21:04:09 dsl Exp $");
#include <arm/sa11x0/sa11x0_sspreg.h>
struct uda1341_softc {
struct device sc_dev;
device_t sc_dev;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct ipaq_softc *sc_parent;
};
static int uda1341_match(struct device *, struct cfdata *, void *);
static void uda1341_attach(struct device *, struct device *, void *);
static int uda1341_match(device_t, cfdata_t, void *);
static void uda1341_attach(device_t, device_t, void *);
static int uda1341_print(void *, const char *);
static int uda1341_search(struct device *, struct cfdata *,
const int *, void *);
static int uda1341_search(device_t, cfdata_t, const int *, void *);
static void uda1341_output_high(struct uda1341_softc *);
static void uda1341_output_low(struct uda1341_softc *);
@ -70,14 +69,20 @@ static void uda1341_init(struct uda1341_softc *);
static void uda1341_reset(struct uda1341_softc *);
static void uda1341_reginit(struct uda1341_softc *);
#if 0
static int L3_getbit(struct uda1341_softc *);
#endif
static void L3_sendbit(struct uda1341_softc *, int);
#if 0
static uint8_t L3_getbyte(struct uda1341_softc *, int);
#endif
static void L3_sendbyte(struct uda1341_softc *, uint8_t, int);
#if 0
static int L3_read(struct uda1341_softc *, uint8_t, uint8_t *, int);
#endif
static int L3_write(struct uda1341_softc *, uint8_t, uint8_t *, int);
CFATTACH_DECL(uda, sizeof(struct uda1341_softc),
CFATTACH_DECL_NEW(uda, sizeof(struct uda1341_softc),
uda1341_match, uda1341_attach, NULL, NULL);
/*
@ -111,23 +116,24 @@ static struct {
bus_space_write_4(sc->sc_iot, sc->sc_parent->sc_ssph, reg, val)
static int
uda1341_match(struct device *parent, struct cfdata *cf, void *aux)
uda1341_match(device_t parent, cfdata_t cf, void *aux)
{
return (1);
}
static void
uda1341_attach(struct device *parent, struct device *self, void *aux)
uda1341_attach(device_t parent, device_t self, void *aux)
{
struct uda1341_softc *sc = (struct uda1341_softc *)self;
struct ipaq_softc *psc = (struct ipaq_softc *)parent;
struct uda1341_softc *sc = device_private(self);
struct ipaq_softc *psc = device_private(parent);
printf("\n");
printf("%s: UDA1341 CODEC\n", sc->sc_dev.dv_xname);
aprint_normal("\n");
aprint_normal_dev(self, "UDA1341 CODEC\n");
sc->sc_dev = self;
sc->sc_iot = psc->sc_iot;
sc->sc_ioh = psc->sc_ioh;
sc->sc_parent = (struct ipaq_softc *)parent;
sc->sc_parent = psc;
uda1341_L3_init(sc);
uda1341_init(sc);
@ -145,7 +151,7 @@ uda1341_attach(struct device *parent, struct device *self, void *aux)
}
static int
uda1341_search(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux)
uda1341_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
if (config_match(parent, cf, NULL) > 0)
config_attach(parent, cf, NULL, uda1341_print);
@ -236,8 +242,7 @@ uda1341_init(struct uda1341_softc *sc)
}
static void
uda1341_reset(sc)
struct uda1341_softc *sc;
uda1341_reset(struct uda1341_softc *sc)
{
uint8_t command;
@ -312,6 +317,7 @@ uda1341_reginit(struct uda1341_softc *sc)
L3_write(sc, command, (uint8_t *) &EXTEND_REG, 2);
}
#if 0
static int
L3_getbit(struct uda1341_softc *sc)
{
@ -328,6 +334,7 @@ L3_getbit(struct uda1341_softc *sc)
return (data);
}
#endif
static void
L3_sendbit(struct uda1341_softc *sc, int bit)
@ -344,6 +351,7 @@ L3_sendbit(struct uda1341_softc *sc, int bit)
delay(L3_CLK_HIGH);
}
#if 0
static uint8_t
L3_getbyte(struct uda1341_softc *sc, int mode)
{
@ -370,6 +378,7 @@ L3_getbyte(struct uda1341_softc *sc, int mode)
return (data);
}
#endif
static void
L3_sendbyte(struct uda1341_softc *sc, uint8_t data, int mode)
@ -400,6 +409,7 @@ L3_sendbyte(struct uda1341_softc *sc, uint8_t data, int mode)
delay(L3_MODE_HOLD);
}
#if 0
static int
L3_read(struct uda1341_softc *sc, uint8_t addr, uint8_t *data, int len)
{
@ -419,6 +429,7 @@ L3_read(struct uda1341_softc *sc, uint8_t addr, uint8_t *data, int len)
return len;
}
#endif
static int
L3_write(struct uda1341_softc *sc, uint8_t addr, uint8_t *data, int len)