Thu Oct 6 19:38:54 2022 UTC ()
fix few typos in comments and node description.


(andvar)
diff -r1.5 -r1.6 src/sys/dev/adb/adb_ktm.c
diff -r1.2 -r1.3 src/sys/dev/ic/scmd.c

cvs diff -r1.5 -r1.6 src/sys/dev/adb/adb_ktm.c (expand / switch to unified diff)

--- src/sys/dev/adb/adb_ktm.c 2022/04/06 17:37:31 1.5
+++ src/sys/dev/adb/adb_ktm.c 2022/10/06 19:38:54 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: adb_ktm.c,v 1.5 2022/04/06 17:37:31 macallan Exp $ */ 1/* $NetBSD: adb_ktm.c,v 1.6 2022/10/06 19:38:54 andvar Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2019 Michael Lorenz 4 * Copyright (c) 2019 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: adb_ktm.c,v 1.5 2022/04/06 17:37:31 macallan Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: adb_ktm.c,v 1.6 2022/10/06 19:38:54 andvar Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/fcntl.h> 34#include <sys/fcntl.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/kernel.h> 36#include <sys/kernel.h>
37#include <sys/sysctl.h> 37#include <sys/sysctl.h>
38 38
39#include <machine/autoconf.h> 39#include <machine/autoconf.h>
40 40
41#include <dev/wscons/wsconsio.h> 41#include <dev/wscons/wsconsio.h>
42#include <dev/wscons/wsmousevar.h> 42#include <dev/wscons/wsmousevar.h>
43 43
@@ -240,33 +240,33 @@ ktm_init(struct ktm_softc *sc) @@ -240,33 +240,33 @@ ktm_init(struct ktm_softc *sc)
240 for (i = 0; i < sc->sc_msg_len; i++) 240 for (i = 0; i < sc->sc_msg_len; i++)
241 printf(" %02x", sc->sc_buffer[i]); 241 printf(" %02x", sc->sc_buffer[i]);
242 printf("\n"); 242 printf("\n");
243 } 243 }
244#endif 244#endif
245 ret = sysctl_createv(NULL, 0, NULL, &me, 245 ret = sysctl_createv(NULL, 0, NULL, &me,
246 CTLFLAG_READWRITE, 246 CTLFLAG_READWRITE,
247 CTLTYPE_NODE, device_xname(sc->sc_dev), NULL, 247 CTLTYPE_NODE, device_xname(sc->sc_dev), NULL,
248 NULL, 0, NULL, 0, 248 NULL, 0, NULL, 0,
249 CTL_MACHDEP, CTL_CREATE, CTL_EOL); 249 CTL_MACHDEP, CTL_CREATE, CTL_EOL);
250 250
251 ret = sysctl_createv(NULL, 0, NULL, &node, 251 ret = sysctl_createv(NULL, 0, NULL, &node,
252 CTLFLAG_READWRITE | CTLFLAG_OWNDESC, 252 CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
253 CTLTYPE_INT, "left", "left button assigmnent", 253 CTLTYPE_INT, "left", "left button assignment",
254 sysctl_ktm_left, 1, (void *)sc, 0, 254 sysctl_ktm_left, 1, (void *)sc, 0,
255 CTL_MACHDEP, me->sysctl_num, CTL_CREATE, CTL_EOL); 255 CTL_MACHDEP, me->sysctl_num, CTL_CREATE, CTL_EOL);
256 256
257 ret = sysctl_createv(NULL, 0, NULL, &node, 257 ret = sysctl_createv(NULL, 0, NULL, &node,
258 CTLFLAG_READWRITE | CTLFLAG_OWNDESC, 258 CTLFLAG_READWRITE | CTLFLAG_OWNDESC,
259 CTLTYPE_INT, "right", "right button assigmnent", 259 CTLTYPE_INT, "right", "right button assignment",
260 sysctl_ktm_right, 1, (void *)sc, 0, 260 sysctl_ktm_right, 1, (void *)sc, 0,
261 CTL_MACHDEP, me->sysctl_num, CTL_CREATE, CTL_EOL); 261 CTL_MACHDEP, me->sysctl_num, CTL_CREATE, CTL_EOL);
262 __USE(ret); 262 __USE(ret);
263} 263}
264 264
265static void 265static void
266ktm_handler(void *cookie, int len, uint8_t *data) 266ktm_handler(void *cookie, int len, uint8_t *data)
267{ 267{
268 struct ktm_softc *sc = cookie; 268 struct ktm_softc *sc = cookie;
269 269
270#ifdef KTM_DEBUG 270#ifdef KTM_DEBUG
271 int i; 271 int i;
272 printf("%s: %02x - ", device_xname(sc->sc_dev), sc->sc_us); 272 printf("%s: %02x - ", device_xname(sc->sc_dev), sc->sc_us);

cvs diff -r1.2 -r1.3 src/sys/dev/ic/scmd.c (expand / switch to unified diff)

--- src/sys/dev/ic/scmd.c 2022/03/31 19:30:16 1.2
+++ src/sys/dev/ic/scmd.c 2022/10/06 19:38:54 1.3
@@ -1,34 +1,34 @@ @@ -1,34 +1,34 @@
1 1
2/* $NetBSD: scmd.c,v 1.2 2022/03/31 19:30:16 pgoyette Exp $ */ 2/* $NetBSD: scmd.c,v 1.3 2022/10/06 19:38:54 andvar Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2021 Brad Spencer <brad@anduin.eldar.org> 5 * Copyright (c) 2021 Brad Spencer <brad@anduin.eldar.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20#include <sys/cdefs.h> 20#include <sys/cdefs.h>
21__KERNEL_RCSID(0, "$NetBSD: scmd.c,v 1.2 2022/03/31 19:30:16 pgoyette Exp $"); 21__KERNEL_RCSID(0, "$NetBSD: scmd.c,v 1.3 2022/10/06 19:38:54 andvar Exp $");
22 22
23/* 23/*
24 * Common driver for the Sparkfun Serial motor controller. 24 * Common driver for the Sparkfun Serial motor controller.
25 * Calls out to specific frontends to move bits. 25 * Calls out to specific frontends to move bits.
26*/ 26*/
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29#include <sys/systm.h> 29#include <sys/systm.h>
30#include <sys/kernel.h> 30#include <sys/kernel.h>
31#include <sys/device.h> 31#include <sys/device.h>
32#include <sys/module.h> 32#include <sys/module.h>
33#include <sys/conf.h> 33#include <sys/conf.h>
34#include <sys/sysctl.h> 34#include <sys/sysctl.h>
@@ -264,27 +264,27 @@ scmd_attach(struct scmd_sc *sc) @@ -264,27 +264,27 @@ scmd_attach(struct scmd_sc *sc)
264 */ 264 */
265static int 265static int
266scmd_open(dev_t dev, int flags, int fmt, struct lwp *l) 266scmd_open(dev_t dev, int flags, int fmt, struct lwp *l)
267{ 267{
268 struct scmd_sc *sc; 268 struct scmd_sc *sc;
269 269
270 sc = device_lookup_private(&scmd_cd, minor(dev)); 270 sc = device_lookup_private(&scmd_cd, minor(dev));
271 if (!sc) 271 if (!sc)
272 return ENXIO; 272 return ENXIO;
273 273
274 if (sc->sc_opened) 274 if (sc->sc_opened)
275 return EBUSY; 275 return EBUSY;
276 276
277 /* This is a meaningless assigment to keep GCC from 277 /* This is a meaningless assignment to keep GCC from
278 * complaining. 278 * complaining.
279 */ 279 */
280 sc->sc_func_attach = &scmd_attach; 280 sc->sc_func_attach = &scmd_attach;
281 281
282 mutex_enter(&sc->sc_mutex); 282 mutex_enter(&sc->sc_mutex);
283 sc->sc_opened = true; 283 sc->sc_opened = true;
284 mutex_exit(&sc->sc_mutex); 284 mutex_exit(&sc->sc_mutex);
285 285
286 return 0; 286 return 0;
287} 287}
288 288
289static int 289static int
290scmd_maxregister(int topaddr) 290scmd_maxregister(int topaddr)
@@ -511,27 +511,27 @@ scmd_write(dev_t dev, struct uio *uio, i @@ -511,27 +511,27 @@ scmd_write(dev_t dev, struct uio *uio, i
511 if (reg_addr <= SCMD_LAST_REG) { 511 if (reg_addr <= SCMD_LAST_REG) {
512 if ((error = scmd_local_write(sc, (uint8_t)reg_addr, buf)) != 0) { 512 if ((error = scmd_local_write(sc, (uint8_t)reg_addr, buf)) != 0) {
513 (*(sc->sc_func_release_bus))(sc); 513 (*(sc->sc_func_release_bus))(sc);
514 aprint_error_dev(sc->sc_dev, 514 aprint_error_dev(sc->sc_dev,
515 "%s: local write failed at 0x%02x: %d\n", 515 "%s: local write failed at 0x%02x: %d\n",
516 __func__, reg_addr, error); 516 __func__, reg_addr, error);
517 return error; 517 return error;
518 } 518 }
519 519
520 /* If this was a local command to the control register that 520 /* If this was a local command to the control register that
521 * can perform re-enumeration, then do the wait thing. 521 * can perform re-enumeration, then do the wait thing.
522 * It is not as important that this be done for remote module 522 * It is not as important that this be done for remote module
523 * access as the only thing that you could really do there is 523 * access as the only thing that you could really do there is
524 * a restart and not re-emumeration, which is really what the wait 524 * a restart and not re-enumeration, which is really what the wait
525 * is all about. 525 * is all about.
526 */ 526 */
527 if (reg_addr == SCMD_REG_CONTROL_1) { 527 if (reg_addr == SCMD_REG_CONTROL_1) {
528 scmd_wait_restart(sc, false); 528 scmd_wait_restart(sc, false);
529 529
530 sc->sc_topaddr = scmd_get_topaddr(sc); 530 sc->sc_topaddr = scmd_get_topaddr(sc);
531 aprint_normal_dev(sc->sc_dev, "Highest I2C address on expansion bus is: %02x\n", 531 aprint_normal_dev(sc->sc_dev, "Highest I2C address on expansion bus is: %02x\n",
532 sc->sc_topaddr); 532 sc->sc_topaddr);
533 } 533 }
534 } else { 534 } else {
535 if ((error = scmd_remote_write(sc, reg_addr, buf)) != 0) { 535 if ((error = scmd_remote_write(sc, reg_addr, buf)) != 0) {
536 (*(sc->sc_func_release_bus))(sc); 536 (*(sc->sc_func_release_bus))(sc);
537 aprint_error_dev(sc->sc_dev, 537 aprint_error_dev(sc->sc_dev,