Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/khorben-n900]: src/sys/dev/spi Let the bus speed of SPI devices be speci...



details:   https://anonhg.NetBSD.org/src/rev/ee44a3f3fca6
branches:  khorben-n900
changeset: 786710:ee44a3f3fca6
user:      khorben <khorben%NetBSD.org@localhost>
date:      Wed May 15 13:52:19 2013 +0000

description:
Let the bus speed of SPI devices be specified within the kernel
configuration.

diffstat:

 sys/dev/spi/files.spi |  4 ++--
 sys/dev/spi/spi.c     |  9 ++++-----
 sys/dev/spi/spivar.h  |  3 ++-
 3 files changed, 8 insertions(+), 8 deletions(-)

diffs (75 lines):

diff -r 3f4784d4e6fe -r ee44a3f3fca6 sys/dev/spi/files.spi
--- a/sys/dev/spi/files.spi     Wed May 15 02:44:48 2013 +0000
+++ b/sys/dev/spi/files.spi     Wed May 15 13:52:19 2013 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: files.spi,v 1.2.114.1 2013/05/10 01:25:07 khorben Exp $
+#      $NetBSD: files.spi,v 1.2.114.2 2013/05/15 13:52:19 khorben Exp $
 
 define spibus { }
 
-device spi { slave, [intr = -1] }
+device spi { slave, [intr = -1], [speed = -1] }
 attach spi at spibus
 file   dev/spi/spi.c                   spi | spibus
 
diff -r 3f4784d4e6fe -r ee44a3f3fca6 sys/dev/spi/spi.c
--- a/sys/dev/spi/spi.c Wed May 15 02:44:48 2013 +0000
+++ b/sys/dev/spi/spi.c Wed May 15 13:52:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.8.6.1 2013/05/10 01:25:07 khorben Exp $ */
+/* $NetBSD: spi.c,v 1.8.6.2 2013/05/15 13:52:19 khorben Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.8.6.1 2013/05/10 01:25:07 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.8.6.2 2013/05/15 13:52:19 khorben Exp $");
 
 #include "locators.h"
 
@@ -120,6 +120,7 @@
 
        sa.sa_handle = &sc->sc_slaves[addr];
        sa.sa_intr = cf->cf_loc[SPICF_INTR];
+       sa.sa_speed = cf->cf_loc[SPICF_SPEED];
 
        if (config_match(parent, cf, &sa) > 0)
                config_attach(parent, cf, &sa, spi_print);
@@ -197,8 +198,7 @@
        if (sc->sc_speed)
                speed = min(sc->sc_speed, speed);
 
-       rv = (*tag->sct_configure)(tag->sct_cookie, sh->sh_slave,
-           mode, speed);
+       rv = (*tag->sct_configure)(tag->sct_cookie, sh->sh_slave, mode, speed);
 
        if (rv == 0) {
                sc->sc_mode = mode;
@@ -211,7 +211,6 @@
 void
 spi_transfer_init(struct spi_transfer *st)
 {
-
        mutex_init(&st->st_lock, MUTEX_DEFAULT, IPL_BIO);
        cv_init(&st->st_cv, "spicv");
 
diff -r 3f4784d4e6fe -r ee44a3f3fca6 sys/dev/spi/spivar.h
--- a/sys/dev/spi/spivar.h      Wed May 15 02:44:48 2013 +0000
+++ b/sys/dev/spi/spivar.h      Wed May 15 13:52:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spivar.h,v 1.4.20.1 2013/05/10 01:25:07 khorben Exp $ */
+/* $NetBSD: spivar.h,v 1.4.20.2 2013/05/15 13:52:19 khorben Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -83,6 +83,7 @@
 struct spi_attach_args {
        struct spi_handle       *sa_handle;
        int                     sa_intr;
+       int                     sa_speed;
 };
 
 /*



Home | Main Index | Thread Index | Old Index