Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c add ddc_read_edid_block, which is the same as dd...
details: https://anonhg.NetBSD.org/src/rev/ead867b3d7c2
branches: trunk
changeset: 803938:ead867b3d7c2
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Nov 17 00:46:44 2014 +0000
description:
add ddc_read_edid_block, which is the same as ddc_read_edid but takes an additional block number argument
diffstat:
sys/dev/i2c/ddc.c | 12 +++++++++---
sys/dev/i2c/ddcvar.h | 3 ++-
2 files changed, 11 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r 8b495a9208e2 -r ead867b3d7c2 sys/dev/i2c/ddc.c
--- a/sys/dev/i2c/ddc.c Mon Nov 17 00:46:04 2014 +0000
+++ b/sys/dev/i2c/ddc.c Mon Nov 17 00:46:44 2014 +0000
@@ -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 @@
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)) {
diff -r 8b495a9208e2 -r ead867b3d7c2 sys/dev/i2c/ddcvar.h
--- a/sys/dev/i2c/ddcvar.h Mon Nov 17 00:46:04 2014 +0000
+++ b/sys/dev/i2c/ddcvar.h Mon Nov 17 00:46:44 2014 +0000
@@ -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_ */
Home |
Main Index |
Thread Index |
Old Index