Module Name: src
Committed By: jmcneill
Date: Mon Nov 17 00:46:44 UTC 2014
Modified Files:
src/sys/dev/i2c: ddc.c ddcvar.h
Log Message:
add ddc_read_edid_block, which is the same as ddc_read_edid but takes an
additional block number argument
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/ddc.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/ddcvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/i2c/ddc.c
diff -u src/sys/dev/i2c/ddc.c:1.3 src/sys/dev/i2c/ddc.c:1.4
--- src/sys/dev/i2c/ddc.c:1.3 Sun May 4 15:26:29 2008
+++ src/sys/dev/i2c/ddc.c Mon Nov 17 00:46:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ddc.c,v 1.3 2008/05/04 15:26:29 xtraeme Exp $ */
+/* $NetBSD: ddc.c,v 1.4 2014/11/17 00:46:44 jmcneill Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ddc.c,v 1.3 2008/05/04 15:26:29 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddc.c,v 1.4 2014/11/17 00:46:44 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -91,12 +91,18 @@ ddc_attach(device_t parent, device_t sel
int
ddc_read_edid(i2c_tag_t tag, uint8_t *dest, size_t len)
{
+ return ddc_read_edid_block(tag, dest, len, DDC_EDID_START);
+}
+
+int
+ddc_read_edid_block(i2c_tag_t tag, uint8_t *dest, size_t len, uint8_t block)
+{
uint8_t wbuf[2];
if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
return -1;
- wbuf[0] = DDC_EDID_START; /* start address */
+ wbuf[0] = block; /* start address */
if (iic_exec(tag, I2C_OP_READ_WITH_STOP, DDC_ADDR, wbuf, 1, dest,
len, I2C_F_POLL)) {
Index: src/sys/dev/i2c/ddcvar.h
diff -u src/sys/dev/i2c/ddcvar.h:1.1 src/sys/dev/i2c/ddcvar.h:1.2
--- src/sys/dev/i2c/ddcvar.h:1.1 Tue Apr 25 21:18:16 2006
+++ src/sys/dev/i2c/ddcvar.h Mon Nov 17 00:46:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ddcvar.h,v 1.1 2006/04/25 21:18:16 gdamore Exp $ */
+/* $NetBSD: ddcvar.h,v 1.2 2014/11/17 00:46:44 jmcneill Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -40,5 +40,6 @@
* autoconfiguration framework.
*/
int ddc_read_edid(i2c_tag_t, u_int8_t *, size_t);
+int ddc_read_edid_block(i2c_tag_t, u_int8_t *, size_t, uint8_t);
#endif /* _DEV_I2C_DDCVAR_H_ */