mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Submitted by: Nicolas Souchu <nsouch@freebsd.org>
Updated to support bt848 driver and MSP3400 audio chip. This adds changes made in 1.4.2.1 and 1.4.2.2 from RELENG_3
This commit is contained in:
parent
f8f3b24aa2
commit
84a3aec329
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43347
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: iiconf.c,v 1.3 1998/11/22 22:01:42 nsouch Exp $
|
||||
* $Id: iiconf.c,v 1.4 1999/01/09 18:08:24 nsouch Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
@ -195,6 +195,28 @@ iicbus_start(device_t bus, u_char slave, int timeout)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* iicbus_repeated_start()
|
||||
*
|
||||
* Send start condition to the slave addressed by 'slave'
|
||||
*/
|
||||
int
|
||||
iicbus_repeated_start(device_t bus, u_char slave, int timeout)
|
||||
{
|
||||
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
|
||||
int error = 0;
|
||||
|
||||
if (!sc->started)
|
||||
return (EINVAL); /* bus should have been already started */
|
||||
|
||||
if (!(error = IICBUS_START(device_get_parent(bus), slave, timeout)))
|
||||
sc->started = slave;
|
||||
else
|
||||
sc->started = 0;
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* iicbus_stop()
|
||||
*
|
||||
@ -253,6 +275,33 @@ iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
|
||||
return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
|
||||
}
|
||||
|
||||
/*
|
||||
* iicbus_write_byte()
|
||||
*
|
||||
* Write a byte to the slave previously started by iicbus_start() call
|
||||
*/
|
||||
int
|
||||
iicbus_write_byte(device_t bus, char byte, int timeout)
|
||||
{
|
||||
char data = byte;
|
||||
int sent;
|
||||
|
||||
return (iicbus_write(bus, &data, 1, &sent, timeout));
|
||||
}
|
||||
|
||||
/*
|
||||
* iicbus_read_byte()
|
||||
*
|
||||
* Read a byte from the slave previously started by iicbus_start() call
|
||||
*/
|
||||
int
|
||||
iicbus_read_byte(device_t bus, char *byte, int timeout)
|
||||
{
|
||||
int read;
|
||||
|
||||
return (iicbus_read(bus, byte, 1, &read, IIC_LAST_READ, timeout));
|
||||
}
|
||||
|
||||
/*
|
||||
* iicbus_block_write()
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user