Module Name:    src
Committed By:   nat
Date:           Tue Aug  8 16:32:39 UTC 2023

Modified Files:
        src/sys/dev/ic: hd44780_subr.c hd44780var.h

Log Message:
Add a flag for output only devices and attachments.

It is necessary to skip the test for the device as output only attached
devices lack the ability for the device to be probed - such as the 1602 lcd
module.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/hd44780_subr.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/hd44780var.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/ic/hd44780_subr.c
diff -u src/sys/dev/ic/hd44780_subr.c:1.22 src/sys/dev/ic/hd44780_subr.c:1.23
--- src/sys/dev/ic/hd44780_subr.c:1.22	Tue Aug  8 16:29:00 2023
+++ src/sys/dev/ic/hd44780_subr.c	Tue Aug  8 16:32:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hd44780_subr.c,v 1.22 2023/08/08 16:29:00 nat Exp $ */
+/* $NetBSD: hd44780_subr.c,v 1.23 2023/08/08 16:32:39 nat Exp $ */
 
 /*
  * Copyright (c) 2002 Dennis I. Chernoivanov
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd44780_subr.c,v 1.22 2023/08/08 16:29:00 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd44780_subr.c,v 1.23 2023/08/08 16:32:39 nat Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -458,7 +458,7 @@ hd44780_chipinit(struct hd44780_chip *sc
 	hd44780_ir_write(sc, en, cmd_ddramset(0x5));
 	hd44780_ir_write(sc, en, cmd_shift(0, 1));
 	hd44780_busy_wait(sc, en);
-	if ((dat = hd44780_ir_read(sc, en) & 0x7f) != 0x6) {
+	if (!sc->sc_writeonly && (dat = hd44780_ir_read(sc, en) & 0x7f) != 0x6) {
 		sc->sc_dev_ok = 0;
 		sc->sc_flags &= ~HD_UP;
 		return EIO;

Index: src/sys/dev/ic/hd44780var.h
diff -u src/sys/dev/ic/hd44780var.h:1.9 src/sys/dev/ic/hd44780var.h:1.10
--- src/sys/dev/ic/hd44780var.h:1.9	Tue Aug  8 16:29:00 2023
+++ src/sys/dev/ic/hd44780var.h	Tue Aug  8 16:32:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hd44780var.h,v 1.9 2023/08/08 16:29:00 nat Exp $ */
+/* $NetBSD: hd44780var.h,v 1.10 2023/08/08 16:32:39 nat Exp $ */
 
 /*
  * Copyright (c) 2002 Dennis I. Chernoivanov
@@ -118,6 +118,7 @@ struct hd44780_chip {
 	void     (* sc_writereg)(struct hd44780_chip *, uint32_t, uint32_t,
 	  uint8_t);
 	uint8_t (* sc_readreg)(struct hd44780_chip *, uint32_t, uint32_t);
+	bool sc_writeonly;		/* Output only device */
 };
 
 #define hd44780_ir_write(sc, en, dat) \

Reply via email to