View | Details | Raw Unified | Return to bug 239695 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/iicbus/sy8106a.c (-31 / +2 lines)
Lines 83-124 Link Here
83
static int
83
static int
84
sy8106a_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size)
84
sy8106a_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size)
85
{
85
{
86
	struct sy8106a_softc *sc;
86
	return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT));
87
	struct iic_msg msg[2];
88
89
	sc = device_get_softc(dev);
90
91
	msg[0].slave = sc->addr;
92
	msg[0].flags = IIC_M_WR;
93
	msg[0].len = 1;
94
	msg[0].buf = ®
95
96
	msg[1].slave = sc->addr;
97
	msg[1].flags = IIC_M_RD;
98
	msg[1].len = size;
99
	msg[1].buf = data;
100
101
	return (iicbus_transfer(dev, msg, 2));
102
}
87
}
103
88
104
static int
89
static int
105
sy8106a_write(device_t dev, uint8_t reg, uint8_t val)
90
sy8106a_write(device_t dev, uint8_t reg, uint8_t val)
106
{
91
{
107
	struct sy8106a_softc *sc;
92
	return (iicdev_writeto(dev, reg, &val, sizeof(val), IIC_INTRWAIT));
108
	struct iic_msg msg;
109
	uint8_t buffer[2];
110
111
	sc = device_get_softc(dev);
112
113
	buffer[0] = reg;
114
	buffer[1] = val;
115
116
	msg.slave = sc->addr;
117
	msg.flags = IIC_M_WR;
118
	msg.len = 2;
119
	msg.buf = buffer;
120
121
	return (iicbus_transfer(dev, &msg, 1));
122
}
93
}
123
94
124
static int
95
static int
(-)sys/dev/iicbus/syr827.c (-31 / +2 lines)
Lines 90-131 Link Here
90
static int
90
static int
91
syr827_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size)
91
syr827_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size)
92
{
92
{
93
	struct syr827_softc *sc;
93
	return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT));
94
	struct iic_msg msg[2];
95
96
	sc = device_get_softc(dev);
97
98
	msg[0].slave = sc->addr;
99
	msg[0].flags = IIC_M_WR;
100
	msg[0].len = 1;
101
	msg[0].buf = ®
102
103
	msg[1].slave = sc->addr;
104
	msg[1].flags = IIC_M_RD;
105
	msg[1].len = size;
106
	msg[1].buf = data;
107
108
	return (iicbus_transfer(dev, msg, 2));
109
}
94
}
110
95
111
static int
96
static int
112
syr827_write(device_t dev, uint8_t reg, uint8_t val)
97
syr827_write(device_t dev, uint8_t reg, uint8_t val)
113
{
98
{
114
	struct syr827_softc *sc;
99
	return (iicdev_writeto(dev, reg, &val, sizeof(val), IIC_INTRWAIT));
115
	struct iic_msg msg;
116
	uint8_t buffer[2];
117
118
	sc = device_get_softc(dev);
119
120
	buffer[0] = reg;
121
	buffer[1] = val;
122
123
	msg.slave = sc->addr;
124
	msg.flags = IIC_M_WR;
125
	msg.len = 2;
126
	msg.buf = buffer;
127
128
	return (iicbus_transfer(dev, &msg, 1));
129
}
100
}
130
101
131
static int
102
static int

Return to bug 239695