convert pcf8584 to device_t.
This commit is contained in:
parent
71c3052b91
commit
ebe7b38bb0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pcf8584.c,v 1.2 2007/10/19 11:59:58 ad Exp $ */
|
||||
/* $NetBSD: pcf8584.c,v 1.3 2008/03/26 19:14:24 tnn Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcf8584.c,v 1.2 2007/10/19 11:59:58 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcf8584.c,v 1.3 2008/03/26 19:14:24 tnn Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -162,7 +162,7 @@ pcf8584_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
|
||||
|
||||
if (BUSY()) {
|
||||
/* We're the only master on the bus, something is wrong. */
|
||||
printf("*%s: i2c bus busy!\n", ha->ha_parent->dv_xname);
|
||||
printf("*%s: i2c bus busy!\n", device_xname(ha->ha_parent));
|
||||
pcf8584_bus_reset(ha, flags);
|
||||
}
|
||||
if (op == I2C_OP_READ_WITH_STOP)
|
||||
@ -185,7 +185,7 @@ pcf8584_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
|
||||
pcf8584_wait(ha, flags);
|
||||
if (!PENDING()) {
|
||||
printf("%s: lost intr during i2c read\n",
|
||||
ha->ha_parent->dv_xname);
|
||||
device_xname(ha->ha_parent));
|
||||
goto fail;
|
||||
}
|
||||
if (NAK())
|
||||
@ -203,7 +203,7 @@ pcf8584_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
|
||||
pcf8584_wait(ha, flags);
|
||||
if (!PENDING()) {
|
||||
printf("%s: no intr on final i2c nak\n",
|
||||
ha->ha_parent->dv_xname);
|
||||
device_xname(ha->ha_parent));
|
||||
goto fail;
|
||||
}
|
||||
CSR_W(PCF8584_CMD_STOP);
|
||||
@ -214,7 +214,7 @@ pcf8584_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
|
||||
pcf8584_wait(ha, flags);
|
||||
if (!PENDING()) {
|
||||
printf("%s: no intr during i2c write\n",
|
||||
ha->ha_parent->dv_xname);
|
||||
device_xname(ha->ha_parent));
|
||||
goto fail;
|
||||
}
|
||||
if (NAK())
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pcf8584var.h,v 1.1 2007/04/14 19:33:30 tnn Exp $ */
|
||||
/* $NetBSD: pcf8584var.h,v 1.2 2008/03/26 19:14:24 tnn Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
struct pcf8584_handle {
|
||||
struct device *ha_parent;
|
||||
device_t ha_parent;
|
||||
bus_space_tag_t ha_iot;
|
||||
bus_space_handle_t ha_ioh;
|
||||
struct i2c_controller ha_i2c;
|
||||
|
Loading…
Reference in New Issue
Block a user