Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/omap Configure the right pads for non-0 modules.



details:   https://anonhg.NetBSD.org/src/rev/be63f3e3156a
branches:  trunk
changeset: 786165:be63f3e3156a
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Apr 17 20:29:16 2013 +0000

description:
Configure the right pads for non-0 modules.

diffstat:

 sys/arch/arm/omap/ti_iic.c |  25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diffs (58 lines):

diff -r 002fdb8b85b2 -r be63f3e3156a sys/arch/arm/omap/ti_iic.c
--- a/sys/arch/arm/omap/ti_iic.c        Wed Apr 17 20:16:53 2013 +0000
+++ b/sys/arch/arm/omap/ti_iic.c        Wed Apr 17 20:29:16 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.2 2013/04/17 20:16:53 bouyer Exp $ */
+/* $NetBSD: ti_iic.c,v 1.3 2013/04/17 20:29:16 bouyer Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.2 2013/04/17 20:16:53 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.3 2013/04/17 20:29:16 bouyer Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -197,6 +197,7 @@
        int i;
        const char *mode;
        u_int state;
+       char buf[20];
 #endif
 
        aprint_naive("\n");
@@ -237,20 +238,22 @@
                }
        }
        KASSERT(i < __arraycount(am335x_iic));
-       if (sitara_cm_padconf_get("I2C0_SDA", &mode, &state) == 0) {
+       sprintf(buf, "%s_SDA", am335x_iic[i].as_name);
+       if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
                aprint_debug(": SDA mode %s state %d ", mode, state);
        }
-       if (sitara_cm_padconf_get("I2C0_SCL", &mode, &state) == 0) {
+       if (sitara_cm_padconf_set(buf, buf,
+           (0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
+               aprint_error(": can't switch %s pad\n", buf);
+               return;
+       }
+       sprintf(buf, "%s_SCL", am335x_iic[i].as_name);
+       if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
                aprint_debug(": SCL mode %s state %d ", mode, state);
        }
-       if (sitara_cm_padconf_set("I2C0_SDA", "I2C0_SDA",
+       if (sitara_cm_padconf_set(buf, buf,
            (0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-               aprint_error(": can't switch SDA pad\n");
-               return;
-       }
-       if (sitara_cm_padconf_set("I2C0_SCL", "I2C0_SCL",
-           (0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-               aprint_error(": can't switch SCL pad\n");
+               aprint_error(": can't switch %s pad\n", buf);
                return;
        }
 #endif



Home | Main Index | Thread Index | Old Index