Module Name: src
Committed By: nat
Date: Tue Aug 8 17:31:13 UTC 2023
Modified Files:
src/sys/dev/ic: hd44780_subr.c hd44780var.h
Log Message:
Avoid adding another member to the softc and use sc_flags instead.
NFCI.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/hd44780_subr.c
cvs rdiff -u -r1.10 -r1.11 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.23 src/sys/dev/ic/hd44780_subr.c:1.24
--- src/sys/dev/ic/hd44780_subr.c:1.23 Tue Aug 8 16:32:39 2023
+++ src/sys/dev/ic/hd44780_subr.c Tue Aug 8 17:31:13 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hd44780_subr.c,v 1.23 2023/08/08 16:32:39 nat Exp $ */
+/* $NetBSD: hd44780_subr.c,v 1.24 2023/08/08 17:31:13 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.23 2023/08/08 16:32:39 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd44780_subr.c,v 1.24 2023/08/08 17:31:13 nat Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -458,7 +458,8 @@ 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 (!sc->sc_writeonly && (dat = hd44780_ir_read(sc, en) & 0x7f) != 0x6) {
+ if (!(sc->sc_flags & HD_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.10 src/sys/dev/ic/hd44780var.h:1.11
--- src/sys/dev/ic/hd44780var.h:1.10 Tue Aug 8 16:32:39 2023
+++ src/sys/dev/ic/hd44780var.h Tue Aug 8 17:31:13 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hd44780var.h,v 1.10 2023/08/08 16:32:39 nat Exp $ */
+/* $NetBSD: hd44780var.h,v 1.11 2023/08/08 17:31:13 nat Exp $ */
/*
* Copyright (c) 2002 Dennis I. Chernoivanov
@@ -97,6 +97,7 @@ struct hd44780_chip {
#define HD_UP 0x10 /* if set, lcd has been initialized */
#define HD_TIMEDOUT 0x20 /* lcd has recently stopped talking */
#define HD_MULTICHIP 0x40 /* two HD44780 controllers (4-line) */
+#define HD_WRITEONLY 0x80 /* write only if set */
uint8_t sc_flags;
uint8_t sc_cols; /* visible columns */
@@ -118,7 +119,6 @@ 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) \