Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/khorben-n900]: src/sys/dev/i2c Moved register values to a separate file
details: https://anonhg.NetBSD.org/src/rev/a8a42975c384
branches: khorben-n900
changeset: 786701:a8a42975c384
user: khorben <khorben%NetBSD.org@localhost>
date: Sat May 11 17:48:22 2013 +0000
description:
Moved register values to a separate file
diffstat:
sys/dev/i2c/tps65950.c | 44 ++-------------------------
sys/dev/i2c/tps65950reg.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 40 deletions(-)
diffs (148 lines):
diff -r 69e4c6f1ca8e -r a8a42975c384 sys/dev/i2c/tps65950.c
--- a/sys/dev/i2c/tps65950.c Sat May 11 17:28:51 2013 +0000
+++ b/sys/dev/i2c/tps65950.c Sat May 11 17:48:22 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tps65950.c,v 1.3 2012/12/31 21:45:36 jmcneill Exp $ */
+/* $NetBSD: tps65950.c,v 1.3.10.1 2013/05/11 17:48:22 khorben Exp $ */
/*-
* Copyright (c) 2012 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tps65950.c,v 1.3 2012/12/31 21:45:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tps65950.c,v 1.3.10.1 2013/05/11 17:48:22 khorben Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -47,49 +47,13 @@
#include <dev/clock_subr.h>
#include <dev/sysmon/sysmonvar.h>
+#include <dev/i2c/tps65950reg.h>
+
/* Default watchdog period, in seconds */
#ifndef TPS65950_WDOG_DEFAULT_PERIOD
#define TPS65950_WDOG_DEFAULT_PERIOD 30
#endif
-/* I2C Bus Addressing */
-#define TPS65950_ADDR_ID1 0x48 /* GP */
-#define TPS65950_ADDR_ID2 0x49 /* GP */
-#define TPS65950_ADDR_ID3 0x4a /* GP */
-#define TPS65950_ADDR_ID4 0x4b /* GP */
-#define TPS65950_ADDR_ID5 0x12 /* SmartReflex */
-
-/* ID2 */
-#define TPS65950_ID2_IDCODE_7_0 0x85
-#define TPS65950_ID2_IDCODE_15_8 0x86
-#define TPS65950_ID2_IDCODE_23_16 0x87
-#define TPS65950_ID2_IDCODE_31_24 0x88
-#define TPS65950_ID2_UNLOCK_TEST_REG 0x97
-#define TPS65950_ID2_UNLOCK_TEST_REG_MAGIC 0x49
-
-/* ID3 */
-#define TPS65950_LED_BASE 0xee
-#define TPS65950_ID3_REG_LED (TPS65950_LED_BASE + 0)
-#define TPS65950_ID3_REG_LED_LEDAON __BIT(0)
-#define TPS65950_ID3_REG_LED_LEDBON __BIT(1)
-#define TPS65950_ID3_REG_LED_LEDAPWM __BIT(4)
-#define TPS65950_ID3_REG_LED_LEDBPWM __BIT(5)
-
-/* ID4 */
-#define TPS65950_PM_RECEIVER_BASE 0x5b
-#define TPS65950_ID4_REG_WATCHDOG_CFG (TPS65950_PM_RECEIVER_BASE + 3)
-#define TPS65950_RTC_BASE 0x1c
-#define TPS65950_ID4_REG_SECONDS_REG (TPS65950_RTC_BASE + 0)
-#define TPS65950_ID4_REG_MINUTES_REG (TPS65950_RTC_BASE + 1)
-#define TPS65950_ID4_REG_HOURS_REG (TPS65950_RTC_BASE + 2)
-#define TPS65950_ID4_REG_DAYS_REG (TPS65950_RTC_BASE + 3)
-#define TPS65950_ID4_REG_MONTHS_REG (TPS65950_RTC_BASE + 4)
-#define TPS65950_ID4_REG_YEARS_REG (TPS65950_RTC_BASE + 5)
-#define TPS65950_ID4_REG_WEEKS_REG (TPS65950_RTC_BASE + 6)
-#define TPS65950_ID4_REG_RTC_CTRL_REG (TPS65950_RTC_BASE + 13)
-#define TPS65950_ID4_REG_RTC_CTRL_REG_GET_TIME __BIT(6)
-#define TPS65950_ID4_REG_RTC_CTRL_REG_STOP_RTC __BIT(1)
-
struct tps65950_softc {
device_t sc_dev;
i2c_tag_t sc_i2c;
diff -r 69e4c6f1ca8e -r a8a42975c384 sys/dev/i2c/tps65950reg.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2c/tps65950reg.h Sat May 11 17:48:22 2013 +0000
@@ -0,0 +1,74 @@
+/* $NetBSD: tps65950reg.h,v 1.1.2.1 2013/05/11 17:48:22 khorben Exp $ */
+
+/*-
+ * Copyright (c) 2012 Jared D. McNeill <jmcneill%invisible.ca@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _DEV_I2C_TPS65950REG_H_
+#define _DEV_I2C_TPS65950REG_H_
+
+/*
+ * TI TPS65950 OMAP Power Management and System Companion Device
+ */
+
+/* I2C Bus Addressing */
+#define TPS65950_ADDR_ID1 0x48 /* GP */
+#define TPS65950_ADDR_ID2 0x49 /* GP */
+#define TPS65950_ADDR_ID3 0x4a /* GP */
+#define TPS65950_ADDR_ID4 0x4b /* GP */
+#define TPS65950_ADDR_ID5 0x12 /* SmartReflex */
+
+/* ID2 */
+#define TPS65950_ID2_IDCODE_7_0 0x85
+#define TPS65950_ID2_IDCODE_15_8 0x86
+#define TPS65950_ID2_IDCODE_23_16 0x87
+#define TPS65950_ID2_IDCODE_31_24 0x88
+#define TPS65950_ID2_UNLOCK_TEST_REG 0x97
+#define TPS65950_ID2_UNLOCK_TEST_REG_MAGIC 0x49
+
+/* ID3 */
+#define TPS65950_LED_BASE 0xee
+#define TPS65950_ID3_REG_LED (TPS65950_LED_BASE + 0)
+#define TPS65950_ID3_REG_LED_LEDAON __BIT(0)
+#define TPS65950_ID3_REG_LED_LEDBON __BIT(1)
+#define TPS65950_ID3_REG_LED_LEDAPWM __BIT(4)
+#define TPS65950_ID3_REG_LED_LEDBPWM __BIT(5)
+
+/* ID4 */
+#define TPS65950_PM_RECEIVER_BASE 0x5b
+#define TPS65950_ID4_REG_WATCHDOG_CFG (TPS65950_PM_RECEIVER_BASE + 3)
+#define TPS65950_RTC_BASE 0x1c
+#define TPS65950_ID4_REG_SECONDS_REG (TPS65950_RTC_BASE + 0)
+#define TPS65950_ID4_REG_MINUTES_REG (TPS65950_RTC_BASE + 1)
+#define TPS65950_ID4_REG_HOURS_REG (TPS65950_RTC_BASE + 2)
+#define TPS65950_ID4_REG_DAYS_REG (TPS65950_RTC_BASE + 3)
+#define TPS65950_ID4_REG_MONTHS_REG (TPS65950_RTC_BASE + 4)
+#define TPS65950_ID4_REG_YEARS_REG (TPS65950_RTC_BASE + 5)
+#define TPS65950_ID4_REG_WEEKS_REG (TPS65950_RTC_BASE + 6)
+#define TPS65950_ID4_REG_RTC_CTRL_REG (TPS65950_RTC_BASE + 13)
+#define TPS65950_ID4_REG_RTC_CTRL_REG_GET_TIME __BIT(6)
+#define TPS65950_ID4_REG_RTC_CTRL_REG_STOP_RTC __BIT(1)
+
+#endif /* !_DEV_I2C_TPS65950REG_H_ */
Home |
Main Index |
Thread Index |
Old Index