armadeus-commitlog Mailing List for armadeus (Page 97)
Brought to you by:
sszy
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(43) |
Feb
(8) |
Mar
(7) |
Apr
(8) |
May
(14) |
Jun
(6) |
Jul
(4) |
Aug
(17) |
Sep
(18) |
Oct
(19) |
Nov
(52) |
Dec
(30) |
| 2008 |
Jan
(6) |
Feb
(6) |
Mar
(15) |
Apr
(22) |
May
(13) |
Jun
(11) |
Jul
(41) |
Aug
(10) |
Sep
(14) |
Oct
(21) |
Nov
(4) |
Dec
(66) |
| 2009 |
Jan
(67) |
Feb
(57) |
Mar
(90) |
Apr
(54) |
May
(64) |
Jun
(76) |
Jul
(14) |
Aug
(18) |
Sep
(18) |
Oct
(20) |
Nov
(15) |
Dec
(36) |
| 2010 |
Jan
(28) |
Feb
(25) |
Mar
(32) |
Apr
(23) |
May
(22) |
Jun
(62) |
Jul
(36) |
Aug
(16) |
Sep
(12) |
Oct
(20) |
Nov
(44) |
Dec
(25) |
| 2011 |
Jan
(36) |
Feb
(49) |
Mar
(28) |
Apr
(38) |
May
(26) |
Jun
(52) |
Jul
(33) |
Aug
(32) |
Sep
(19) |
Oct
(26) |
Nov
(13) |
Dec
(32) |
| 2012 |
Jan
(38) |
Feb
(34) |
Mar
(91) |
Apr
(35) |
May
(31) |
Jun
(72) |
Jul
(23) |
Aug
(13) |
Sep
(33) |
Oct
(47) |
Nov
(18) |
Dec
(22) |
| 2013 |
Jan
(31) |
Feb
(22) |
Mar
(26) |
Apr
(11) |
May
(38) |
Jun
(15) |
Jul
(37) |
Aug
(68) |
Sep
(34) |
Oct
(11) |
Nov
(26) |
Dec
(31) |
| 2014 |
Jan
(60) |
Feb
(55) |
Mar
(21) |
Apr
(31) |
May
(17) |
Jun
(35) |
Jul
(24) |
Aug
(17) |
Sep
(11) |
Oct
(23) |
Nov
(10) |
Dec
(23) |
| 2015 |
Jan
(15) |
Feb
(34) |
Mar
(46) |
Apr
(23) |
May
(12) |
Jun
(14) |
Jul
(18) |
Aug
(22) |
Sep
(6) |
Oct
(2) |
Nov
(1) |
Dec
(6) |
| 2016 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
(10) |
May
(17) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
(22) |
Oct
(8) |
Nov
(9) |
Dec
(5) |
| 2017 |
Jan
(11) |
Feb
(12) |
Mar
(27) |
Apr
(9) |
May
(1) |
Jun
(5) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
(10) |
Nov
(4) |
Dec
(6) |
| 2018 |
Jan
(6) |
Feb
(13) |
Mar
(9) |
Apr
(7) |
May
(10) |
Jun
(9) |
Jul
(21) |
Aug
(13) |
Sep
(10) |
Oct
(4) |
Nov
(6) |
Dec
(1) |
| 2019 |
Jan
(6) |
Feb
(2) |
Mar
(5) |
Apr
(6) |
May
(19) |
Jun
(14) |
Jul
(18) |
Aug
(3) |
Sep
(5) |
Oct
(7) |
Nov
(8) |
Dec
(4) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(9) |
Apr
(7) |
May
(2) |
Jun
(18) |
Jul
(3) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
| 2021 |
Jan
(9) |
Feb
(6) |
Mar
(4) |
Apr
(11) |
May
(7) |
Jun
(5) |
Jul
(2) |
Aug
(4) |
Sep
(10) |
Oct
(9) |
Nov
(5) |
Dec
|
| 2022 |
Jan
(2) |
Feb
(12) |
Mar
(3) |
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
(4) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2023 |
Jan
(5) |
Feb
(3) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(1) |
Jun
(13) |
Jul
(7) |
Aug
(1) |
Sep
(6) |
Oct
(5) |
Nov
(11) |
Dec
(7) |
| 2025 |
Jan
(3) |
Feb
(1) |
Mar
(6) |
Apr
(4) |
May
(4) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(4) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2026 |
Jan
(3) |
Feb
(7) |
Mar
(3) |
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: jscheer <js...@us...> - 2011-02-24 13:21:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 6b496a5cea9b63aaf9c47073921d637e92d22735 (commit)
from bd2235dac1a955d748720d3313a337f7f9232fa8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6b496a5cea9b63aaf9c47073921d637e92d22735
Author: Jeremie Scheer <jer...@ar...>
Date: Thu Feb 24 14:20:44 2011 +0100
[BUILDROOT] Add QWS Cursor option to Qt's Buildroot menuconfig.
-----------------------------------------------------------------------
Summary of changes:
...-qt-full_integration_with_cross_compiling.patch | 39 +++++++++++++++----
...-qt-full_integration_with_cross_compiling.patch | 41 ++++++++++++++++----
2 files changed, 64 insertions(+), 16 deletions(-)
diff --git a/patches/buildroot/132-qt-full_integration_with_cross_compiling.patch b/patches/buildroot/132-qt-full_integration_with_cross_compiling.patch
index a7e215e..ab04674 100644
--- a/patches/buildroot/132-qt-full_integration_with_cross_compiling.patch
+++ b/patches/buildroot/132-qt-full_integration_with_cross_compiling.patch
@@ -5,9 +5,22 @@ Signed-off-by: Jérémie Scheer <jer...@ar...>
Index: buildroot/package/qtopia4/Config.in
===================================================================
---- buildroot.orig/package/qtopia4/Config.in 2011-01-03 10:54:42.000000000 +0100
-+++ buildroot/package/qtopia4/Config.in 2011-01-03 10:54:42.000000000 +0100
-@@ -325,4 +325,14 @@
+--- buildroot.orig/package/qtopia4/Config.in 2011-02-24 12:16:39.000000000 +0100
++++ buildroot/package/qtopia4/Config.in 2011-02-24 13:51:52.000000000 +0100
+@@ -214,6 +214,12 @@
+ bool "Use Qt bundled libtiff"
+ endchoice
+
++config BR2_PACKAGE_QT_QWS_CURSOR
++ bool "QWS cursor"
++ default y
++ help
++ Display a QWS cursor on the target GUI.
++
+ endif # BR2_PACKAGE_QT_GUI_MODULE
+
+ choice
+@@ -325,4 +331,14 @@
Build the Qt Script Tools module.
if unsure, say n.
@@ -24,8 +37,8 @@ Index: buildroot/package/qtopia4/Config.in
endif # BR2_PACKAGE_QT
Index: buildroot/package/qtopia4/qtopia4.mk
===================================================================
---- buildroot.orig/package/qtopia4/qtopia4.mk 2011-01-03 10:54:42.000000000 +0100
-+++ buildroot/package/qtopia4/qtopia4.mk 2011-01-03 17:22:36.000000000 +0100
+--- buildroot.orig/package/qtopia4/qtopia4.mk 2011-02-24 12:16:39.000000000 +0100
++++ buildroot/package/qtopia4/qtopia4.mk 2011-02-24 13:52:27.000000000 +0100
@@ -17,6 +17,7 @@
QT_SITE:=http://get.qt.nokia.com/qt/source
QT_CAT:=$(ZCAT)
@@ -34,7 +47,17 @@ Index: buildroot/package/qtopia4/qtopia4.mk
QT_CONFIGURE:=#empty
-@@ -345,6 +346,14 @@
+@@ -256,6 +257,9 @@
+ endif
+ endif
+
++ifneq ($(BR2_PACKAGE_QT_QWS_CURSOR),y)
++QT_CONFIGURE+= -DQT_NO_QWS_CURSOR
++endif
+
+ QT_FONTS = $(addprefix $(STAGING_DIR)/usr/lib/fonts/, $(addsuffix *.qpf, \
+ $(if $(BR2_PACKAGE_QT_FONT_MICRO),micro) \
+@@ -345,6 +349,14 @@
QT_CONFIGURE+= -no-stl
endif
@@ -49,7 +72,7 @@ Index: buildroot/package/qtopia4/qtopia4.mk
# ccache and precompiled headers don't play well together
ifeq ($(BR2_CCACHE),y)
QT_CONFIGURE += -no-pch
-@@ -483,11 +492,11 @@
+@@ -483,11 +495,11 @@
-no-accessibility \
-no-separate-debug-info \
-prefix /usr \
@@ -63,7 +86,7 @@ Index: buildroot/package/qtopia4/qtopia4.mk
)
touch $@
-@@ -560,8 +569,19 @@
+@@ -560,8 +572,19 @@
cp -dpf $(STAGING_DIR)/usr/lib/libQtScriptTools.so.* $(TARGET_DIR)/usr/lib/
endif
diff --git a/patches/buildroot/2010.11/132-qt-full_integration_with_cross_compiling.patch b/patches/buildroot/2010.11/132-qt-full_integration_with_cross_compiling.patch
index 985a279..586b14e 100644
--- a/patches/buildroot/2010.11/132-qt-full_integration_with_cross_compiling.patch
+++ b/patches/buildroot/2010.11/132-qt-full_integration_with_cross_compiling.patch
@@ -4,8 +4,8 @@ Signed-off-by: Jérémie Scheer <jer...@ar...>
Index: buildroot/package/qt/Config.in
===================================================================
---- buildroot.orig/package/qt/Config.in 2010-11-08 10:24:59.000000000 +0100
-+++ buildroot/package/qt/Config.in 2011-01-03 14:04:23.000000000 +0100
+--- buildroot.orig/package/qt/Config.in 2010-11-30 16:52:43.000000000 +0100
++++ buildroot/package/qt/Config.in 2011-02-24 13:41:41.000000000 +0100
@@ -17,7 +17,12 @@
If unsure, say N.
@@ -20,11 +20,25 @@ Index: buildroot/package/qt/Config.in
help
If unsure, say N.
+@@ -219,6 +224,13 @@
+ bool "Use Qt bundled libtiff"
+ endchoice
+
++config BR2_PACKAGE_QT_QWS_CURSOR
++ bool "QWS cursor"
++ default y
++ help
++ Display a QWS cursor on the target GUI.
++
++
+ endif # BR2_PACKAGE_QT_GUI_MODULE
+
+ choice
Index: buildroot/package/qt/qt.mk
===================================================================
---- buildroot.orig/package/qt/qt.mk 2010-11-08 10:24:59.000000000 +0100
-+++ buildroot/package/qt/qt.mk 2011-01-03 17:33:36.000000000 +0100
-@@ -49,10 +49,16 @@
+--- buildroot.orig/package/qt/qt.mk 2010-11-30 16:52:43.000000000 +0100
++++ buildroot/package/qt/qt.mk 2011-02-24 13:41:10.000000000 +0100
+@@ -49,11 +49,17 @@
endif
ifeq ($(BR2_PACKAGE_QT_DEMOS),y)
@@ -33,13 +47,24 @@ Index: buildroot/package/qt/qt.mk
else
-QT_CONFIGURE+= -nomake examples -nomake demos
+QT_CONFIGURE+= -nomake demos
- endif
++endif
+ifeq ($(BR2_PACKAGE_QT_EXAMPLES),y)
+QT_CONFIGURE+= -examplesdir $(TARGET_DIR)/usr/share/qt/examples
+else
+QT_CONFIGURE+= -nomake examples
-+endif
-+
+ endif
++
# ensure glib is built first if enabled for Qt's glib support
ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+ QT_DEP_LIBS+=libglib2
+@@ -244,6 +250,9 @@
+ endif
+ endif
+
++ifneq ($(BR2_PACKAGE_QT_QWS_CURSOR),y)
++QT_CONFIGURE+= -DQT_NO_QWS_CURSOR
++endif
+
+ QT_FONTS = $(addprefix $(STAGING_DIR)/usr/lib/fonts/, $(addsuffix *.qpf, \
+ $(if $(BR2_PACKAGE_QT_FONT_MICRO),micro) \
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-24 10:34:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via bd2235dac1a955d748720d3313a337f7f9232fa8 (commit)
via bd8242b7c308be444022ce2634f7c39d1b573b06 (commit)
from 2a49d808b9e8be5d52413af7a94031e56b3f9673 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bd2235dac1a955d748720d3313a337f7f9232fa8
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 24 11:33:58 2011 +0100
[BUILDROOT] Updates default APF27 config
commit bd8242b7c308be444022ce2634f7c39d1b573b06
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 24 11:16:13 2011 +0100
Change main Makefile to detect PPS configs
-----------------------------------------------------------------------
Summary of changes:
Makefile | 5 +++--
.../target/device/armadeus/apf27/apf27_defconfig | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index ac452d6..2fc5ab9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Makefile for Armadeus
#
-# Copyright (C) 2005-2009 by the Armadeus Team
+# Copyright (C) 2005-2011 by the Armadeus Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ ECHO_CONFIGURATION_NOT_DEFINED:= echo -en "\033[1m"; \
echo " "; \
echo " System not configured. Use make <board>_defconfig " >&2; \
echo " armadeus valid configurations are: " >&2; \
- echo " "$(shell find $(ARMADEUS_CONFIG_DIR) -name "apf*_defconfig" | sed 's/.*\///');\
+ echo " "$(shell find $(ARMADEUS_CONFIG_DIR) -name "[ap][fp][fs]*_defconfig" | sed 's/.*\///');\
echo " "; \
echo -en "\033[0m";
@@ -70,6 +70,7 @@ help:
@echo 'First, choose the platform:'
@echo ' apf9328_defconfig - get default config for an APF9328 board'
@echo ' apf27_defconfig - get default config for an APF27 board'
+ @echo ' pps_defconfig - get default config for an APF27_PPS board'
@echo ' apf51_defconfig - get default config for an APF51 board'
@echo ''
@echo 'Cleaning:'
diff --git a/buildroot/target/device/armadeus/apf27/apf27_defconfig b/buildroot/target/device/armadeus/apf27/apf27_defconfig
index 39222fb..8048b05 100644
--- a/buildroot/target/device/armadeus/apf27/apf27_defconfig
+++ b/buildroot/target/device/armadeus/apf27/apf27_defconfig
@@ -370,6 +370,7 @@ BR2_PACKAGE_IMXREGS=y
BR2_PACKAGE_MAX5821CTRL=y
# BR2_PACKAGE_ARMADEUS_PPS_UTILITIES is not set
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+# BR2_PACKAGE_TFP410CTRL is not set
# BR2_DATABASE_SUPPORT is not set
BR2_TEXTEDIT_SUPPORT=y
# BR2_PACKAGE_ED is not set
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-24 09:08:35
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 2a49d808b9e8be5d52413af7a94031e56b3f9673 (commit)
from 195c7af37b12f3aadb73b56a0fd02578cdeb34f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2a49d808b9e8be5d52413af7a94031e56b3f9673
Author: Fabien Marteau <fab...@ar...>
Date: Thu Feb 24 10:07:33 2011 +0100
[buildroot][rootfs_skeleton] restore S13portmap init script
-----------------------------------------------------------------------
Summary of changes:
.../rootfs/target_skeleton/etc/init.d/S13portmap | 44 ++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
create mode 100755 buildroot/target/device/armadeus/rootfs/target_skeleton/etc/init.d/S13portmap
diff --git a/buildroot/target/device/armadeus/rootfs/target_skeleton/etc/init.d/S13portmap b/buildroot/target/device/armadeus/rootfs/target_skeleton/etc/init.d/S13portmap
new file mode 100755
index 0000000..573a16a
--- /dev/null
+++ b/buildroot/target/device/armadeus/rootfs/target_skeleton/etc/init.d/S13portmap
@@ -0,0 +1,44 @@
+#! /bin/sh
+
+[ -f /sbin/portmap ] || exit 0
+
+start() {
+ echo -n "Starting portmap: "
+ portmap
+ mkdir -p /var/lock/subsys
+ touch /var/lock/subsys/portmap
+ echo "done"
+}
+
+
+stop() {
+ echo -n "Stopping portmap: "
+ echo
+ killall portmap
+ rm -rf /var/lock/subsys
+ echo "done"
+}
+
+restart() {
+ stop
+ start
+ rm -f /var/run/portmap.state
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart}"
+ exit 1
+esac
+
+exit $?
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-23 21:07:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 195c7af37b12f3aadb73b56a0fd02578cdeb34f4 (commit)
from 05974f339d5321a56b9d2e6cb4ca4940fc7ceec1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 195c7af37b12f3aadb73b56a0fd02578cdeb34f4
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 23 22:07:13 2011 +0100
[BUILDROOT] Updates default APF9328 config
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf9328/apf9328_defconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf9328/apf9328_defconfig b/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
index d0a8c7e..e829d5c 100644
--- a/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
+++ b/buildroot/target/device/armadeus/apf9328/apf9328_defconfig
@@ -370,6 +370,7 @@ BR2_PACKAGE_PKGCONFIG=y
BR2_PACKAGE_MAX5821CTRL=y
# BR2_PACKAGE_ARMADEUS_PPS_UTILITIES is not set
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+# BR2_PACKAGE_TFP410CTRL is not set
# BR2_DATABASE_SUPPORT is not set
BR2_TEXTEDIT_SUPPORT=y
# BR2_PACKAGE_ED is not set
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-23 15:06:27
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 05974f339d5321a56b9d2e6cb4ca4940fc7ceec1 (commit)
from 87a23082a7e5186717b1cad0703c400c0520fbab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 05974f339d5321a56b9d2e6cb4ca4940fc7ceec1
Author: Fabien Marteau <fab...@ar...>
Date: Wed Feb 23 15:44:43 2011 +0100
[as_devices] Adding import AsI2c in AsDevices python init module
-----------------------------------------------------------------------
Summary of changes:
.../as_devices/python/AsDevices/__init__.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/target/packages/as_devices/python/AsDevices/__init__.py b/target/packages/as_devices/python/AsDevices/__init__.py
index 64208f5..2b9eaf1 100644
--- a/target/packages/as_devices/python/AsDevices/__init__.py
+++ b/target/packages/as_devices/python/AsDevices/__init__.py
@@ -38,3 +38,4 @@ import wrappers
from AsGpio import *
from AsAdc import *
from AsDac import *
+from AsI2c import *
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-23 14:08:19
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 87a23082a7e5186717b1cad0703c400c0520fbab (commit)
via 1084387623200c67ab17612eda301d50a4b35955 (commit)
via 46c17462a400e262f040a499f04cc0a10c5e7b68 (commit)
from 301f5550a43101957e80424f216bb9f77cf07052 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 87a23082a7e5186717b1cad0703c400c0520fbab
Merge: 1084387623200c67ab17612eda301d50a4b35955 301f5550a43101957e80424f216bb9f77cf07052
Author: Fabien Marteau <fab...@ar...>
Date: Wed Feb 23 15:05:01 2011 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 1084387623200c67ab17612eda301d50a4b35955
Author: Fabien Marteau <fab...@ar...>
Date: Wed Feb 23 15:04:04 2011 +0100
[as_devices] Adding i2c python class wrapper
commit 46c17462a400e262f040a499f04cc0a10c5e7b68
Author: Fabien Marteau <fab...@ar...>
Date: Wed Feb 23 14:31:08 2011 +0100
[as_devices] Suppress multiton implementation under python classes
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/Makefile | 5 +-
.../as_devices/python/AsDevices/Apf27Pwm.py | 286 ++++++------------
.../packages/as_devices/python/AsDevices/AsAdc.py | 64 +---
.../packages/as_devices/python/AsDevices/AsDac.py | 63 +---
.../packages/as_devices/python/AsDevices/AsGpio.py | 224 ++++++---------
.../packages/as_devices/python/AsDevices/AsI2c.py | 133 +++++++++
target/packages/as_devices/python/Makefile | 1 +
target/packages/as_devices/python/src/AsI2c_wrap.c | 310 ++++++++++++++++++++
.../python/src/{AsAdc_wrap.h => AsI2c_wrap.h} | 20 +-
9 files changed, 679 insertions(+), 427 deletions(-)
create mode 100644 target/packages/as_devices/python/AsDevices/AsI2c.py
create mode 100644 target/packages/as_devices/python/src/AsI2c_wrap.c
copy target/packages/as_devices/python/src/{AsAdc_wrap.h => AsI2c_wrap.h} (59%)
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index cba285c..1cb0161 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -13,14 +13,15 @@ OBJ += as_gpio_2_6_29.o
else
OBJ += as_gpio.o
endif
+OBJ += as_dac.o
+OBJ += as_adc.o
+
OBJ += as_93lcxx.o
OBJ += as_spi.o
OBJ += as_as1531.o
OBJ += as_max1027.o
OBJ += as_max5821.o
-OBJ += as_dac.o
OBJ += as_helpers.o
-OBJ += as_adc.o
LIBRARY=as_devices
LIB_VERS=1
diff --git a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
index ee34690..70284a3 100644
--- a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
+++ b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
@@ -29,15 +29,13 @@
#
#-----------------------------------------------------------------------------
-__doc__ = "This class drive pwm under apf27. It's implemented as a multiton"
+__doc__ = "This class drive pwm under apf27."
__version__ = "1.0.0"
__versionTime__ = "08/10/2009"
__author__ = "Fabien Marteau <fab...@ar...>"
import wrappers
-NUMBER_OF_PWM = 2
-
class Apf27PwmError(Exception):
def __init__(self, value):
self.value = value
@@ -47,197 +45,99 @@ class Apf27PwmError(Exception):
class Apf27Pwm:
""" Drive pwm on apf27
"""
-
- __pwm = [None for i in range(NUMBER_OF_PWM)]
-
- ################################################################$
- class __impl:
- """ implementation
+ def __init__(self, pwm_num):
+ self.__pwm_num = pwm_num
+ try:
+ self.wrapper = wrappers.Apf27Pwm_wrap
+ self.wrapper.init(self.__pwm_num)
+ except Exception, e:
+ raise Apf27PwmError("Can't init pwm "+str(self.__pwm_num)+\
+ ": "+str(e))
+
+ def __del__(self):
+ try:
+ self.wrapper.pwm_close(self.pwm_num)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def setFrequency(self, aFrequency):
+ """ Set frequency of pwm
+ \param aFrequency frequency in Hz
"""
- def __init__(self, pwm_num):
- self.__pwm_num = pwm_num
- try:
- self.wrapper = wrappers.Apf27Pwm_wrap
- self.wrapper.init(self.__pwm_num)
- except Exception, e:
- raise Apf27PwmError("Can't init pwm "+str(self.__pwm_num)+\
- ": "+str(e))
-
- def __del__(self):
- try:
- self.wrapper.pwm_close(self.pwm_num)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def setFrequency(self, aFrequency):
- """ Set frequency of pwm
- \param aFrequency frequency in Hz
- """
- try:
- self.wrapper.setFrequency(self.__pwm_num, aFrequency)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def getFrequency(self):
- """ Get frequency of pwm
- \return frequency in Hz
- """
- try:
- return self.wrapper.getFrequency(self.__pwm_num)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def setPeriod(self, aPeriod):
- """ Set period in us
- \param aPeriod period in us
- """
- try:
- self.wrapper.setPeriod(self.__pwm_num, aPeriod)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def getPeriod(self):
- """ Get period in us
- \return period in us
- """
- try:
- return self.wrapper.getPeriod(self.__pwm_num)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def setDuty(self, aDuty):
- """ Set duty in 1/1000
- \param aDuty in 1/1000
- """
- try:
- self.wrapper.setDuty(self.__pwm_num, aDuty)
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def getDuty(self):
- """ Get duty in 1/1000
- \return duty in 1/1000
- """
- try:
- return self.wrapper.getDuty(self.__pwm_num)
- except Exception,e:
- raise Apf27PwmError(str(e))
-
- def activate(self, aEnable):
- """ Activate pwm
- \param aEnable if True enable, else disable
- \return aEnable
- """
- try:
- if aEnable:
- self.wrapper.activate(self.__pwm_num, 1)
- return True
- else:
- self.wrapper.activate(self.__pwm_num, 0)
- return False
- except Exception, e:
- raise Apf27PwmError(str(e))
-
- def getState(self):
- """ Get state of pwm
- \return boolean
- """
- try:
- if self.wrapper.getState(self.__pwm_num) == 1:
- return True
- else:
- return False
- except Exception, e:
- raise Apf27PwmError(str(e))
-
-
- ################################################################
-
- @classmethod
- def getInstance(cls, pwm_num):
- if type(pwm_num)!=int:
- raise Exception("pwm_num argunent must be 'int'")
- if pwm_num < 0:
- raise Exception("pwm_num must be positive")
- if pwm_num >= NUMBER_OF_PWM:
- raise Exception("There is no pwm number "+\
- str(pwm_num)+", max is "+str(NUMBER_OF_PWM-1))
- if Apf27Pwm.__pwm[pwm_num] is None:
- Apf27Pwm.__pwm[pwm_num] = cls.__impl(pwm_num)
-
- return Apf27Pwm.__pwm[pwm_num]
-
- def __init__(self):
- """ Initialize pwm
+ try:
+ self.wrapper.setFrequency(self.__pwm_num, aFrequency)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def getFrequency(self):
+ """ Get frequency of pwm
+ \return frequency in Hz
"""
- raise Exception("This constructor is private")
-
-if __name__ == "__main__":
- import os
- def pressEnterToContinue():
- print "Press enter to continue"
- raw_input()
-
- print "Apf27Pwm class test\n"
- print Apf27Pwm.__doc__
-
- pwm0 = Apf27Pwm.getInstance(0)
-
- keyInput = "0"
-
- while keyInput is not "q":
- os.system("clear")
- print "***********************************************"
- print "* Testing pwm python class *"
- print "***********************************************"
- print "Choose ('q' to quit):"
- print " 1) set Frequency"
- print " 2) get Frequency"
- print " 3) set Period"
- print " 4) get Period"
- print " 5) set Duty"
- print " 6) get Duty"
- print " 7) activate/desactivate"
- print " 8) get state"
- print "> ",
-
- keyInput = raw_input()
-
- if keyInput == "1" :
- print "Give frequency :",
- freq = raw_input()
- pwm0.setFrequency(int(freq,10))
- pressEnterToContinue()
- elif keyInput == "2" :
- print "Current pwm frequency is "+str(pwm0.getFrequency())
- pressEnterToContinue()
- elif keyInput == "3" :
- print "Give period :",
- period = raw_input()
- pwm0.setFrequency(int(period,10))
- pressEnterToContinue()
- elif keyInput == "4" :
- print "Current period is "+str(pwm0.getPeriod())
- pressEnterToContinue()
- elif keyInput == "5" :
- print "Give duty :",
- duty = raw_input()
- pwm0.setDuty(int(duty,10))
- pressEnterToContinue()
- elif keyInput == "6" :
- print "Current duty is "+str(pwm0.getDuty())
- pressEnterToContinue()
- elif keyInput == "7" :
- print "activate 'a' or desactivat 'd' ?",
- response = raw_input()
- if response == 'a':
- pwm0.activate(True)
+ try:
+ return self.wrapper.getFrequency(self.__pwm_num)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def setPeriod(self, aPeriod):
+ """ Set period in us
+ \param aPeriod period in us
+ """
+ try:
+ self.wrapper.setPeriod(self.__pwm_num, aPeriod)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def getPeriod(self):
+ """ Get period in us
+ \return period in us
+ """
+ try:
+ return self.wrapper.getPeriod(self.__pwm_num)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def setDuty(self, aDuty):
+ """ Set duty in 1/1000
+ \param aDuty in 1/1000
+ """
+ try:
+ self.wrapper.setDuty(self.__pwm_num, aDuty)
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def getDuty(self):
+ """ Get duty in 1/1000
+ \return duty in 1/1000
+ """
+ try:
+ return self.wrapper.getDuty(self.__pwm_num)
+ except Exception,e:
+ raise Apf27PwmError(str(e))
+
+ def activate(self, aEnable):
+ """ Activate pwm
+ \param aEnable if True enable, else disable
+ \return aEnable
+ """
+ try:
+ if aEnable:
+ self.wrapper.activate(self.__pwm_num, 1)
+ return True
else:
- pwm0.activate(False)
- pressEnterToContinue()
- elif keyInput == "8" :
- if pwm0.getState():
- print "pwm is active"
+ self.wrapper.activate(self.__pwm_num, 0)
+ return False
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
+ def getState(self):
+ """ Get state of pwm
+ \return boolean
+ """
+ try:
+ if self.wrapper.getState(self.__pwm_num) == 1:
+ return True
else:
- print "pwm is inactive"
- pressEnterToContinue()
+ return False
+ except Exception, e:
+ raise Apf27PwmError(str(e))
+
diff --git a/target/packages/as_devices/python/AsDevices/AsAdc.py b/target/packages/as_devices/python/AsDevices/AsAdc.py
index 43bbb6c..11d54f5 100644
--- a/target/packages/as_devices/python/AsDevices/AsAdc.py
+++ b/target/packages/as_devices/python/AsDevices/AsAdc.py
@@ -45,56 +45,24 @@ class AsAdcError(Exception):
class AsAdc:
""" Drive adc
"""
-
- # Dictionary of adc multiton classes
- __adc = {}
-
- ################################################################
- class __impl:
- """ implementation
- """
- def __init__(self, aAdcType, aDeviceNum, aVRef):
- try:
- self.__device = wrapper.adc_open(aAdcType, aDeviceNum, aVRef)
- except Exception, e:
- raise AsAdcError("Can't open adc port type "+str(aAdcType)+\
- " num "+str(aDeviceNum))
-
- def __del__(self):
- try:
- wrapper.adc_close(self.__device)
- except Exception, e:
- pass
-
- def getValueInMillivolts(self, aChannel):
- """ Get value in millivolts
- """
- try:
- return wrapper.getValueInMillivolts(self.__device, aChannel)
- except Exception, e:
- raise AsAdcError(str(e))
-
- ################################################################
-
- @classmethod
- def getInstance(cls, aAdcType, aDeviceNum, aVRef):
+ def __init__(self, aAdcType, aDeviceNum, aVRef):
try:
- return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
- except KeyError:
- AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)] =\
- cls.__impl(aAdcType, aDeviceNum, aVRef)
+ self.__device = wrapper.adc_open(aAdcType, aDeviceNum, aVRef)
+ except Exception, e:
+ raise AsAdcError("Can't open adc port type "+str(aAdcType)+\
+ " num "+str(aDeviceNum))
- return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
+ def __del__(self):
+ try:
+ wrapper.adc_close(self.__device)
+ except Exception, e:
+ pass
- def __init__(self):
- """ Initialize adc
+ def getValueInMillivolts(self, aChannel):
+ """ Get value in millivolts
"""
- raise Exception("This constructor is private, to instanciate object do:"+\
- "AsAdc.getInstance(adctype, deviceNum, vref)")
-
-if __name__ == "__main__":
- import os
- def pressEnterToContinue():
- print "Press enter to continue"
- raw_input()
+ try:
+ return wrapper.getValueInMillivolts(self.__device, aChannel)
+ except Exception, e:
+ raise AsAdcError(str(e))
diff --git a/target/packages/as_devices/python/AsDevices/AsDac.py b/target/packages/as_devices/python/AsDevices/AsDac.py
index 983345f..d235663 100644
--- a/target/packages/as_devices/python/AsDevices/AsDac.py
+++ b/target/packages/as_devices/python/AsDevices/AsDac.py
@@ -39,56 +39,25 @@ class AsDacError(Exception):
class AsDac:
""" Drive dac
"""
-
- # Dictionary of dac multiton classes
- __dac = {}
-
- ################################################################
- class __impl:
- """ implementation
- """
- def __init__(self, aDacType, aBusNumber, aAddress, aVRef):
- try:
- self.__device = wrapper.dac_open(aDacType, aBusNumber, aAddress, aVRef)
- except Exception, e:
- raise AsDacError("Can't open dac port type "+str(aDacType)+\
- " num "+str(aBusNumber))
-
- def __del__(self):
- try:
- wrapper.dac_close(self.__device)
- except Exception, e:
- pass
-
- def setValueInMillivolts(self, aChannel, aValue):
- """ Get value in millivolts
- """
- try:
- return wrapper.dac_setValueInMillivolts(self.__device, aChannel, aValue)
- except Exception, e:
- raise AsDacError(str(e))
-
- ################################################################
-
- @classmethod
- def getInstance(cls, aDacType, aBusNumber, aAddress, aVRef):
+ def __init__(self, aDacType, aBusNumber, aAddress, aVRef):
try:
- return AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)]
- except KeyError:
- AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)] =\
- cls.__impl(aDacType, aBusNumber, aAddress, aVRef)
+ self.__device = wrapper.dac_open(aDacType, aBusNumber, aAddress, aVRef)
+ except Exception, e:
+ raise AsDacError("Can't open dac port type "+str(aDacType)+\
+ " num "+str(aBusNumber))
- return AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)]
+ def __del__(self):
+ try:
+ wrapper.dac_close(self.__device)
+ except Exception, e:
+ pass
- def __init__(self):
- """ Initialize dac
+ def setValueInMillivolts(self, aChannel, aValue):
+ """ Get value in millivolts
"""
- raise Exception("This constructor is private, to instanciate object do:"+\
- "AsDac.getInstance(dactype, busnumber, address, vref)")
+ try:
+ return wrapper.dac_setValueInMillivolts(self.__device, aChannel, aValue)
+ except Exception, e:
+ raise AsDacError(str(e))
-if __name__ == "__main__":
- import os
- def pressEnterToContinue():
- print "Press enter to continue"
- raw_input()
diff --git a/target/packages/as_devices/python/AsDevices/AsGpio.py b/target/packages/as_devices/python/AsDevices/AsGpio.py
index 9c9f357..2ea71c1 100644
--- a/target/packages/as_devices/python/AsDevices/AsGpio.py
+++ b/target/packages/as_devices/python/AsDevices/AsGpio.py
@@ -40,145 +40,103 @@ class AsGpioError(Exception):
class AsGpio:
""" Drive GPIO
"""
+ def __init__(self, aPortLetter, aPinNum):
+ try:
+ self.__device = wrapper.gpio_open(aPortLetter, aPinNum)
+ except Exception, e:
+ raise AsGpioError("Can't open GPIO port "+str(aPortLetter)+\
+ " pin "+str(aPinNum)+": "+str(e))
+
+ def __del__(self):
+ try:
+ wrapper.gpio_close(self.__device)
+ except Exception, e:
+ pass
+
+ def setPinDirection(self, aDirection):
+ """ Set period in us
+ \param aDirection pin direction 0:input 1:output
+ """
+ try:
+ wrapper.setPinDirection(self.__device, aDirection)
+ except Exception, e:
+ raise AsGpioError(str(e))
+
+ def getPinDirection(self):
+ """ Set period in us
+ \param aDirection pin direction 0:input 1:output
+ """
+ try:
+ return wrapper.getPinDirection(self.__device)
+ except Exception, e:
+ raise AsGpioError(str(e))
+
+ def setPinValue(self, aValue):
+ """ Set pin value
+ \param aValue value to write
+ """
+ try:
+ wrapper.setPinValue(self.__device, aValue)
+ except Exception, e:
+ raise AsGpioError(str(e))
- # Dictionary of gpio multiton classes
- __gpio = {}
+ def getPinValue(self):
+ """ Get pin value
+ \param return pin value
+ """
+ try:
+ return wrapper.getPinValue(self.__device)
+ except Exception, e:
+ raise AsGpioError(str(e))
- ################################################################
- class __impl:
- """ implementation
+ def blockingGetPinValue(self, aDelay_s, aDelay_us=0):
+ """ Get pin value (blocking mode)
+ \param return pin value
"""
- def __init__(self, aPortLetter, aPinNum):
- try:
- self.__device = wrapper.gpio_open(aPortLetter, aPinNum)
- except Exception, e:
- raise AsGpioError("Can't open GPIO port "+str(aPortLetter)+\
- " pin "+str(aPinNum)+": "+str(e))
-
- def __del__(self):
- try:
- wrapper.gpio_close(self.__device)
- except Exception, e:
- pass
-
- def setPinDirection(self, aDirection):
- """ Set period in us
- \param aDirection pin direction 0:input 1:output
- """
- try:
- wrapper.setPinDirection(self.__device, aDirection)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def getPinDirection(self):
- """ Set period in us
- \param aDirection pin direction 0:input 1:output
- """
- try:
- return wrapper.getPinDirection(self.__device)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def setPinValue(self, aValue):
- """ Set pin value
- \param aValue value to write
- """
- try:
- wrapper.setPinValue(self.__device, aValue)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def getPinValue(self):
- """ Get pin value
- \param return pin value
- """
- try:
- return wrapper.getPinValue(self.__device)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def blockingGetPinValue(self, aDelay_s, aDelay_us=0):
- """ Get pin value (blocking mode)
- \param return pin value
- """
- try:
- return wrapper.blockingGetPinValue(self.__device,
- aDelay_s,
- aDelay_us)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def setIrqMode(self, aMode):
- """ Set irq Mode
- \param aMode.
- 1:MODE_NOINT
- 2:MODE_RISING
- 3:MODE_FALLING
- 4:MODE_BOTH
- """
- try:
- return wrapper.setIrqMode(self.__device, aMode)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def getIrqMode(self):
- """ get irq mode
- """
- try:
- return wrapper.getIrqMode(self.__device)
- except Exception, e:
- raise AsGpioError(str(e))
-
-
- def getPinNumber(self):
- """ Get pin number
- \param return pin number
- """
- try:
- return wrapper.getPinNumber(self.__device)
- except Exception, e:
- raise AsGpioError(str(e))
-
- def getPortLetter(self):
- """ Get pin letter
- \param return pin letter
- """
- try:
- return wrapper.getPortLetter(self.__device)
- except Exception, e:
- raise AsGpioError(str(e))
-
-
- ################################################################
-
- @classmethod
- def getInstance(cls, aPort_letter, aPinNumber):
- if type(aPort_letter)!=str:
- raise Exception("port letter must be a character")
- if ((aPort_letter[0] < 'A') or (aPort_letter[0] > 'Z')):
- raise Exception("Port letter must be an UPPER case letter")
- if type(aPinNumber)!=int:
- raise Exception("Pin number must be a int")
- if aPinNumber < 0 or aPinNumber > 31:
- raise Exception("Pin number must be between 0 and 31")
+ try:
+ return wrapper.blockingGetPinValue(self.__device,
+ aDelay_s,
+ aDelay_us)
+ except Exception, e:
+ raise AsGpioError(str(e))
+
+ def setIrqMode(self, aMode):
+ """ Set irq Mode
+ \param aMode.
+ 1:MODE_NOINT
+ 2:MODE_RISING
+ 3:MODE_FALLING
+ 4:MODE_BOTH
+ """
+ try:
+ return wrapper.setIrqMode(self.__device, aMode)
+ except Exception, e:
+ raise AsGpioError(str(e))
+ def getIrqMode(self):
+ """ get irq mode
+ """
try:
- return AsGpio.__gpio["%s%d"%(aPort_letter[0],aPinNumber)]
- except KeyError:
- AsGpio.__gpio["%s%d"%(aPort_letter[0],aPinNumber)] =\
- cls.__impl(aPort_letter[0], aPinNumber)
+ return wrapper.getIrqMode(self.__device)
+ except Exception, e:
+ raise AsGpioError(str(e))
- return AsGpio.__gpio["%s%d"%(aPort_letter[0],aPinNumber)]
- def __init__(self):
- """ Initialize pwm
+ def getPinNumber(self):
+ """ Get pin number
+ \param return pin number
"""
- raise Exception("This constructor is private, to instanciate object do:"+\
- "AsGpio.getInstance(port_letter, pin_number)")
-
-if __name__ == "__main__":
- import os
- def pressEnterToContinue():
- print "Press enter to continue"
- raw_input()
+ try:
+ return wrapper.getPinNumber(self.__device)
+ except Exception, e:
+ raise AsGpioError(str(e))
+
+ def getPortLetter(self):
+ """ Get pin letter
+ \param return pin letter
+ """
+ try:
+ return wrapper.getPortLetter(self.__device)
+ except Exception, e:
+ raise AsGpioError(str(e))
diff --git a/target/packages/as_devices/python/AsDevices/AsI2c.py b/target/packages/as_devices/python/AsDevices/AsI2c.py
new file mode 100644
index 0000000..2963b2e
--- /dev/null
+++ b/target/packages/as_devices/python/AsDevices/AsI2c.py
@@ -0,0 +1,133 @@
+#! /usr/bin/python
+# -*- coding: utf-8 -*-
+#-----------------------------------------------------------------------------
+# Name: AsI2c.py
+# Purpose:
+# Author: Fabien Marteau <fab...@ar...>
+# Created: 23/02/2011
+#-----------------------------------------------------------------------------
+# Copyright (2011) Armadeus Systems
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#-----------------------------------------------------------------------------
+
+__doc__ = "This class drive ARMadeus Board I²C"
+__version__ = "0.1"
+__author__ = "Fabien Marteau <fab...@ar...>"
+
+import wrappers.AsI2c_wrap as wrapper
+
+class AsI2cError(Exception):
+ def __init__(self, value):
+ self.value = value
+ def __str__(self):
+ return repr(self.value)
+
+class AsI2c:
+ """
+ """
+
+ def __init__(self, aBusNumber):
+ try:
+ self.__device = wrapper.i2c_open(aBusNumber)
+ except Exception, e:
+ raise AsI2cError("Can't open i2c bus number "+str(aBusNumber)+\
+ ": "+str(e))
+
+ def __def__(self):
+ try:
+ wrappers.i2c_close(self.__device)
+ except Exception, e:
+ pass
+
+ def setSlaveAddr(self, aAddr):
+ """ Set address of slave
+ """
+ try:
+ return wrapper.i2c_set_slave_addr(self.__device, aAddr)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
+ def getSlaveAddr(self):
+ """ Get address of slave
+ """
+ try:
+ return wrapper.i2c_get_slave_addr(self.__device)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
+ def read(self, aNumber):
+ """ read aNumber of bytes on i2c bus
+ """
+ try:
+ rString = wrapper.i2c_read(self.__device, aNumber)
+ except Exception, e:
+ raise AsI2cError(str(e))
+ rList = []
+ for character in rString:
+ rList.append(ord(character))
+ return rList
+
+ def write(self, aList):
+ """ read a list of bytes on i2c bus
+ """
+ aString = ''
+ for character in aList:
+ aString += chr(character)
+ try:
+ return wrapper.i2c_write(self.__device, aString)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
+ def readReg(self, aReg, aNumber):
+ """ read a list of bytes at aReg register address
+ """
+ try:
+ rString = wrapper.i2c_read_reg(self.__device, aReg, aNumber)
+ except Exception, e:
+ raise AsI2cError(str(e))
+ rList = []
+ for character in rString:
+ rList.append(ord(character))
+ return rList
+
+ def writeReg(self, aReg, aList):
+ """ write a list of bytes at aReg register address
+ """
+ aString = ''
+ for character in aList:
+ aString += chr(character)
+ try:
+ return wrapper.i2c_write_reg(self.__device, aReg, aString)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
+ def readRegByte(self, aReg):
+ """ Read one byte at aReg register address
+ """
+ try:
+ return wrapper.i2c_read_reg_byte(self.__device, aReg)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
+ def writeRegByte(self, aReg, aValue):
+ """ write one byte at aReg register address
+ """
+ try:
+ return wrapper.i2c_write_reg_byte(self.__device, aReg, aValue)
+ except Exception, e:
+ raise AsI2cError(str(e))
+
diff --git a/target/packages/as_devices/python/Makefile b/target/packages/as_devices/python/Makefile
index 8368d4e..375b6e2 100644
--- a/target/packages/as_devices/python/Makefile
+++ b/target/packages/as_devices/python/Makefile
@@ -18,6 +18,7 @@ LIBNAME=AsDevices
WRAPPER_LIBS=AsGpio_wrap.so
WRAPPER_LIBS+= AsAdc_wrap.so
WRAPPER_LIBS+= AsDac_wrap.so
+WRAPPER_LIBS+= AsI2c_wrap.so
WRAPPER_DIR=src
PYTHON_VERS=2.4
diff --git a/target/packages/as_devices/python/src/AsI2c_wrap.c b/target/packages/as_devices/python/src/AsI2c_wrap.c
new file mode 100644
index 0000000..b25184f
--- /dev/null
+++ b/target/packages/as_devices/python/src/AsI2c_wrap.c
@@ -0,0 +1,310 @@
+/*
+** The ARMadeus Project
+**
+** Copyright (C) 2011 The armadeus systems team
+** Fabien Marteau <fab...@ar...>
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#include "AsI2c_wrap.h"
+#include "as_i2c.h"
+
+#define MAX_DATA_SIZE 20
+
+/* Methods definitions */
+static PyMethodDef AsI2c_wrap_methods[] = {
+ {"i2c_open" , i2c_open , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_close" , i2c_close , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_set_slave_addr", i2c_set_slave_addr, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_get_slave_addr", i2c_get_slave_addr, METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_read" , i2c_read , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_write" , i2c_write , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_read_reg" , i2c_read_reg , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_write_reg" , i2c_write_reg , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_read_reg_byte" , i2c_read_reg_byte , METH_VARARGS, "as_i2c function wrapped"},
+ {"i2c_write_reg_byte", i2c_write_reg_byte, METH_VARARGS, "as_i2c function wrapped"},
+ {NULL, NULL, 0, NULL} /* Sentinel */
+};
+
+
+/* Init module */
+void initAsI2c_wrap() /* called on first import */
+{ /* name matter if called dynamically */
+ (void) Py_InitModule("AsI2c_wrap", AsI2c_wrap_methods); /* mod name, table ptr */
+}
+
+static PyObject * i2c_open(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ int aBusNumber;
+
+ struct as_i2c_device *dev;
+ PyObject *ret;
+ char buff[300];
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "i", &aBusNumber))
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+ dev = as_i2c_open(aBusNumber);
+ if (dev == NULL)
+ {
+ snprintf(buff, 300,
+ "Initialization error for i2c bus %d.", aBusNumber);
+ PyErr_SetString(PyExc_IOError,buff);
+ return NULL;
+ }
+ ret = Py_BuildValue("l", (long)dev);
+
+ return ret;
+}
+
+static PyObject * i2c_close(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+
+ /* return value */
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+ ret = as_i2c_close(aDev);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError, "Can't close i2c");
+ return Py_BuildValue("i", -1);
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_set_slave_addr(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ int aSlaveAddr;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSlaveAddr))
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_set_slave_addr(aDev, aSlaveAddr);
+ if (ret < 0)
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Can't set slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_get_slave_addr(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev))
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_get_slave_addr(aDev);
+ if (ret < 0)
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_read(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aData[MAX_DATA_SIZE];
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aSize))
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_read(aDev, aData, aSize);
+ if (ret < 0)
+ {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("s#", (unsigned char *)aData, aSize);
+}
+
+static PyObject * i2c_write(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t *aData;
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "ls#", (long *)&aDev, (unsigned char *)&aData, &aSize)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write(aDev, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_read_reg(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t aData[MAX_DATA_SIZE];
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aSize)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_read_reg(aDev, aReg, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("s#", (unsigned char *)aData, aSize);
+}
+
+static PyObject * i2c_write_reg(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t *aData;
+ int aSize;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lis#", (long *)&aDev, &aReg, (unsigned char *)&aData, &aSize)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write_reg(aDev, aReg, aData, aSize);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_read_reg_byte(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "li", (long *)&aDev, &aReg)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_read_reg_byte(aDev, aReg);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
+static PyObject * i2c_write_reg_byte(PyObject *self, PyObject *args)
+{
+ /* parameters */
+ struct as_i2c_device *aDev;
+ uint8_t aReg;
+ uint8_t aVal;
+
+ int ret;
+
+ /* Get arguments */
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aReg, &aVal)) {
+ PyErr_SetString(PyExc_IOError,
+ "Wrong parameters.");
+ return NULL;
+ }
+
+ ret = as_i2c_write_reg_byte(aDev, aReg, aVal);
+ if (ret < 0) {
+ PyErr_SetString(PyExc_IOError,
+ "Can't get slave address");
+ return NULL;
+ }
+
+ return Py_BuildValue("i", ret);
+}
+
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.h b/target/packages/as_devices/python/src/AsI2c_wrap.h
similarity index 59%
copy from target/packages/as_devices/python/src/AsAdc_wrap.h
copy to target/packages/as_devices/python/src/AsI2c_wrap.h
index 7fa0b8f..b4f0b47 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.h
+++ b/target/packages/as_devices/python/src/AsI2c_wrap.h
@@ -19,14 +19,26 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#include <Python.h>
/* Init module */
-void initAsAdc_wrap();
+void initAsI2c_wrap();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject * adc_open(PyObject *self, PyObject *args);
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args);
-static PyObject * adc_close(PyObject *self, PyObject *args);
+static PyObject * i2c_open(PyObject *self, PyObject *args);
+static PyObject * i2c_close(PyObject *self, PyObject *args);
+
+static PyObject * i2c_set_slave_addr(PyObject *self, PyObject *args);
+static PyObject * i2c_get_slave_addr(PyObject *self, PyObject *args);
+
+static PyObject * i2c_read(PyObject *self, PyObject *args);
+static PyObject * i2c_write(PyObject *self, PyObject *args);
+
+static PyObject * i2c_read_reg(PyObject *self, PyObject *args);
+static PyObject * i2c_write_reg(PyObject *self, PyObject *args);
+
+static PyObject * i2c_read_reg_byte(PyObject *self, PyObject *args);
+static PyObject * i2c_write_reg_byte(PyObject *self, PyObject *args);
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-02-23 13:15:27
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 301f5550a43101957e80424f216bb9f77cf07052 (commit)
from d7f962b32c27e2fa832f415bcbdacaa1842bd75a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 301f5550a43101957e80424f216bb9f77cf07052
Author: Jeremie Scheer <jer...@ar...>
Date: Wed Feb 23 14:14:55 2011 +0100
[BUILDROOT] [2010.05] Run same command as for old BR in linux26-clean target.
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 31b0e6a..ac452d6 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,7 @@ linux26: $(BUILDROOT_DIR)/.configured
@$(MAKE) -C $(BUILDROOT_DIR) linux26
linux26-clean: $(BUILDROOT_DIR)/.configured
-ifeq ($(BUILDROOT_VERSION),20081103)
+ifneq (,$(filter $(BUILDROOT_VERSION),20081103 2010.05))
@$(MAKE) -C $(BUILDROOT_DIR) linux26clean
else
@$(MAKE) -C $(BUILDROOT_DIR) linux26-clean
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-22 19:04:31
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d7f962b32c27e2fa832f415bcbdacaa1842bd75a (commit)
via 114e42b0694e070667624b9caddcfe6fa0263192 (commit)
from 81250d10b68c6d279dc12153d36661caad232e43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d7f962b32c27e2fa832f415bcbdacaa1842bd75a
Merge: 114e42b0694e070667624b9caddcfe6fa0263192 81250d10b68c6d279dc12153d36661caad232e43
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 22 20:02:20 2011 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 114e42b0694e070667624b9caddcfe6fa0263192
Author: Julien Boibessot <jul...@ar...>
Date: Tue Feb 22 19:56:47 2011 +0100
[BUILDROOT] [2010.11] Add linux26-clean target
-----------------------------------------------------------------------
Summary of changes:
Makefile | 4 ++++
.../135-linux-add_linux26-clean_target.patch | 11 +++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 patches/buildroot/2010.11/135-linux-add_linux26-clean_target.patch
diff --git a/Makefile b/Makefile
index bf52991..31b0e6a 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,11 @@ linux26: $(BUILDROOT_DIR)/.configured
@$(MAKE) -C $(BUILDROOT_DIR) linux26
linux26-clean: $(BUILDROOT_DIR)/.configured
+ifeq ($(BUILDROOT_VERSION),20081103)
@$(MAKE) -C $(BUILDROOT_DIR) linux26clean
+else
+ @$(MAKE) -C $(BUILDROOT_DIR) linux26-clean
+endif
%_defconfig: $(BUILDROOT_DIR)/.patched
@if [ -e "$(ARMADEUS_CONFIG_DIR)/$@" ] || [ -e "$(ARMADEUS_CONFIG_DIR)/$(patsubst %_defconfig,%,$@)/$@" ]; then \
diff --git a/patches/buildroot/2010.11/135-linux-add_linux26-clean_target.patch b/patches/buildroot/2010.11/135-linux-add_linux26-clean_target.patch
new file mode 100644
index 0000000..31ecf9c
--- /dev/null
+++ b/patches/buildroot/2010.11/135-linux-add_linux26-clean_target.patch
@@ -0,0 +1,11 @@
+Index: buildroot/linux/linux.mk
+===================================================================
+--- buildroot.orig/linux/linux.mk 2011-02-22 19:48:10.000000000 +0100
++++ buildroot/linux/linux.mk 2011-02-22 19:48:45.000000000 +0100
+@@ -188,3 +188,6 @@
+ endif
+
+ endif
++
++linux26-clean:
++ $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) clean
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-22 16:52:27
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 81250d10b68c6d279dc12153d36661caad232e43 (commit)
from 2157ffdab3d52df1d9be6d3eb76839316f0d24d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 81250d10b68c6d279dc12153d36661caad232e43
Author: Fabien Marteau <fab...@ar...>
Date: Tue Feb 22 17:51:31 2011 +0100
[linux] Adding driver for MCP4912 DAC chip, adding platform data for apf51dev
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 25 +-
...-armadeus-BACKPORT_iio_linux-next20110221.patch | 4519 ++++++++++++++++++++
...3-armadeus-adding_mcp4912_dac_chip_driver.patch | 394 ++
3 files changed, 4929 insertions(+), 9 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/422-armadeus-BACKPORT_iio_linux-next20110221.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/423-armadeus-adding_mcp4912_dac_chip_driver.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index dc6a63d..79ab67f 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -4,8 +4,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-18 10:13:10.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-18 10:33:41.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-22 15:08:04.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-22 17:49:07.000000000 +0100
@@ -167,12 +167,32 @@
select SOC_IMX51
select IMX_HAVE_PLATFORM_IMX_UART
@@ -43,8 +43,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-18 10:13:10.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-18 10:33:03.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-22 15:08:04.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-22 17:49:07.000000000 +0100
@@ -8,6 +8,7 @@
obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -56,8 +56,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-18 10:13:10.000000000 +0100
-@@ -0,0 +1,431 @@
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-22 17:25:43.000000000 +0100
+@@ -0,0 +1,438 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -90,6 +90,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+#include <mach/ssi.h>
+#include <linux/can/platform/mcp251x.h>
+
++#include "../../../drivers/staging/iio/dac/mcp49x2.h"
+#include "devices-imx51.h"
+#include "devices.h"
+
@@ -142,6 +143,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
+ (_MX51_PAD_CSPI1_SS0__GPIO4_24 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)),
+ (_MX51_PAD_CSPI1_SS1__GPIO4_25 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)),
++ (_MX51_PAD_CSPI1_RDY__GPIO4_26 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)), /* LDAC for mcp4912 */
+
+ (_MX51_PAD_NANDF_D14__GPIO3_26 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)), /* ADC_SSTRB */
+
@@ -259,6 +261,11 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+#define APF51DEV_ECSPI1_SS0 IMX_GPIO_NR(4, 24)
+#define APF51DEV_ECSPI1_SS1 IMX_GPIO_NR(4, 25)
+
++static struct mcp49x2_config mcp4912_dat = {
++ .ldac_pin = IMX_GPIO_NR(4, 26), /* GPIO4-26 */
++ .vref_mv = {3100, 3100},
++};
++
+static struct spi_board_info apf51dev_spi1_board_info[] __initdata = {
+ {
+ .modalias = "as1531",
@@ -274,7 +281,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ .bus_num = 0,
+ .chip_select = 1,
+ .mode = SPI_MODE_0,
-+ .platform_data = NULL,
++ .platform_data = &mcp4912_dat,
+ },
+};
+
@@ -303,7 +310,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+#define APF51DEV_ECSPI2_SS1 IMX_GPIO_NR(3, 28)
+#define APF51DEV_ECSPI2_SS2 IMX_GPIO_NR(3, 27)
+
-+static struct spi_board_info apf51dev_spi2_board_info[] __initdata = {
++static struct spi_board_info apf51dev_spi2_board_info[] = {
+ {
+ .modalias = "mcp2515",
+ .max_speed_hz = 8000000,
@@ -319,7 +326,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ .bus_num = 1,
+ .chip_select = 1,
+ .mode = SPI_MODE_0,
-+ .platform_data = NULL,
++ .platform_data = &mcp4912_dat,
+ },
+};
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/422-armadeus-BACKPORT_iio_linux-next20110221.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/422-armadeus-BACKPORT_iio_linux-next20110221.patch
new file mode 100644
index 0000000..7bb31ee
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/422-armadeus-BACKPORT_iio_linux-next20110221.patch
@@ -0,0 +1,4519 @@
+Backport all drivers from iio staging directory
+
+Signed-off-by: Fabien Marteau <fab...@ar...>
+Index: linux-2.6.38-rc3/drivers/staging/iio/accel/Kconfig
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/accel/Kconfig 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/accel/Kconfig 2011-02-21 18:29:49.000000000 +0100
+@@ -66,12 +66,33 @@
+ tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver"
+ depends on SPI
+ select IIO_TRIGGER if IIO_RING_BUFFER
+- select IIO_SW_RING if IIO_RING_BUFFER
++ depends on !IIO_RING_BUFFER || IIO_KFIFO_BUF || IIO_SW_RING
+ help
+ Say yes here to build SPI support for the ST microelectronics
+ accelerometer. The driver supplies direct access via sysfs files
+ and an event interface via a character device.
+
++choice
++ prompt "Buffer type"
++ depends on LIS3L02DQ && IIO_RING_BUFFER
++
++config LIS3L02DQ_BUF_KFIFO
++ depends on IIO_KFIFO_BUF
++ bool "Simple FIFO"
++ help
++ Kfifo based FIFO. Does not provide any events so it is up
++ to userspace to ensure it reads often enough that data is not
++ lost.
++
++config LIS3L02DQ_BUF_RING_SW
++ depends on IIO_SW_RING
++ bool "IIO Software Ring"
++ help
++ Original IIO ring buffer implementation. Provides simple
++ buffer events, half full etc.
++
++endchoice
++
+ config SCA3000
+ depends on IIO_RING_BUFFER
+ depends on SPI
+Index: linux-2.6.38-rc3/drivers/staging/iio/accel/lis3l02dq.h
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/accel/lis3l02dq.h 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/accel/lis3l02dq.h 2011-02-21 18:29:49.000000000 +0100
+@@ -196,6 +196,16 @@
+ int lis3l02dq_configure_ring(struct iio_dev *indio_dev);
+ void lis3l02dq_unconfigure_ring(struct iio_dev *indio_dev);
+
++#ifdef CONFIG_LIS3L02DQ_BUF_RING_SW
++#define lis3l02dq_free_buf iio_sw_rb_free
++#define lis3l02dq_alloc_buf iio_sw_rb_allocate
++#define lis3l02dq_register_buf_funcs iio_ring_sw_register_funcs
++#endif
++#ifdef CONFIG_LIS3L02DQ_BUF_KFIFO
++#define lis3l02dq_free_buf iio_kfifo_free
++#define lis3l02dq_alloc_buf iio_kfifo_allocate
++#define lis3l02dq_register_buf_funcs iio_kfifo_register_funcs
++#endif
+ #else /* CONFIG_IIO_RING_BUFFER */
+
+ static inline void lis3l02dq_remove_trigger(struct iio_dev *indio_dev)
+Index: linux-2.6.38-rc3/drivers/staging/iio/accel/lis3l02dq_ring.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/accel/lis3l02dq_ring.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/accel/lis3l02dq_ring.c 2011-02-21 18:29:49.000000000 +0100
+@@ -13,6 +13,7 @@
+ #include "../iio.h"
+ #include "../sysfs.h"
+ #include "../ring_sw.h"
++#include "../kfifo_buf.h"
+ #include "accel.h"
+ #include "../trigger.h"
+ #include "lis3l02dq.h"
+@@ -484,7 +485,7 @@
+ void lis3l02dq_unconfigure_ring(struct iio_dev *indio_dev)
+ {
+ kfree(indio_dev->pollfunc);
+- iio_sw_rb_free(indio_dev->ring);
++ lis3l02dq_free_buf(indio_dev->ring);
+ }
+
+ int lis3l02dq_configure_ring(struct iio_dev *indio_dev)
+@@ -495,13 +496,13 @@
+ INIT_WORK(&h->work_trigger_to_ring, lis3l02dq_trigger_bh_to_ring);
+ h->get_ring_element = &lis3l02dq_get_ring_element;
+
+- ring = iio_sw_rb_allocate(indio_dev);
++ ring = lis3l02dq_alloc_buf(indio_dev);
+ if (!ring)
+ return -ENOMEM;
+
+ indio_dev->ring = ring;
+ /* Effectively select the ring buffer implementation */
+- iio_ring_sw_register_funcs(&ring->access);
++ lis3l02dq_register_buf_funcs(&ring->access);
+ ring->bpe = 2;
+ ring->scan_el_attrs = &lis3l02dq_scan_el_group;
+ ring->scan_timestamp = true;
+@@ -522,6 +523,6 @@
+ return 0;
+
+ error_iio_sw_rb_free:
+- iio_sw_rb_free(indio_dev->ring);
++ lis3l02dq_free_buf(indio_dev->ring);
+ return ret;
+ }
+Index: linux-2.6.38-rc3/drivers/staging/iio/adc/ad7476_core.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/adc/ad7476_core.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/adc/ad7476_core.c 2011-02-21 18:29:49.000000000 +0100
+@@ -190,7 +190,7 @@
+ goto error_disable_reg;
+ }
+
+- /* Estabilish that the iio_dev is a child of the i2c device */
++ /* Establish that the iio_dev is a child of the spi device */
+ st->indio_dev->dev.parent = &spi->dev;
+ st->indio_dev->attrs = &ad7476_attribute_group;
+ st->indio_dev->dev_data = (void *)(st);
+Index: linux-2.6.38-rc3/drivers/staging/iio/dac/Kconfig
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/dac/Kconfig 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/dac/Kconfig 2011-02-21 18:29:49.000000000 +0100
+@@ -19,3 +19,13 @@
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad5446.
++
++config MAX517
++ tristate "Maxim MAX517/518/519 DAC driver"
++ depends on I2C && EXPERIMENTAL
++ help
++ If you say yes here you get support for the Maxim chips MAX517,
++ MAX518 and MAX519 (I2C 8-Bit DACs with rail-to-rail outputs).
++
++ This driver can also be built as a module. If so, the module
++ will be called max517.
+Index: linux-2.6.38-rc3/drivers/staging/iio/dac/Makefile
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/dac/Makefile 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/dac/Makefile 2011-02-21 18:29:49.000000000 +0100
+@@ -4,3 +4,4 @@
+
+ obj-$(CONFIG_AD5624R_SPI) += ad5624r_spi.o
+ obj-$(CONFIG_AD5446) += ad5446.o
++obj-$(CONFIG_MAX517) += max517.o
+Index: linux-2.6.38-rc3/drivers/staging/iio/dac/max517.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.38-rc3/drivers/staging/iio/dac/max517.c 2011-02-21 18:29:49.000000000 +0100
+@@ -0,0 +1,298 @@
++/*
++ * max517.c - Support for Maxim MAX517, MAX518 and MAX519
++ *
++ * Copyright (C) 2010, 2011 Roland Stigge <st...@an...>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/jiffies.h>
++#include <linux/i2c.h>
++#include <linux/err.h>
++
++#include "../iio.h"
++#include "dac.h"
++
++#include "max517.h"
++
++#define MAX517_DRV_NAME "max517"
++
++/* Commands */
++#define COMMAND_CHANNEL0 0x00
++#define COMMAND_CHANNEL1 0x01 /* for MAX518 and MAX519 */
++#define COMMAND_PD 0x08 /* Power Down */
++
++enum max517_device_ids {
++ ID_MAX517,
++ ID_MAX518,
++ ID_MAX519,
++};
++
++struct max517_data {
++ struct iio_dev *indio_dev;
++ struct i2c_client *client;
++ unsigned short vref_mv[2];
++};
++
++/*
++ * channel: bit 0: channel 1
++ * bit 1: channel 2
++ * (this way, it's possible to set both channels at once)
++ */
++static ssize_t max517_set_value(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count, int channel)
++{
++ struct iio_dev *dev_info = dev_get_drvdata(dev);
++ struct max517_data *data = iio_dev_get_devdata(dev_info);
++ struct i2c_client *client = data->client;
++ u8 outbuf[4]; /* 1x or 2x command + value */
++ int outbuf_size = 0;
++ int res;
++ long val;
++
++ res = strict_strtol(buf, 10, &val);
++
++ if (res)
++ return res;
++
++ if (val < 0 || val > 255)
++ return -EINVAL;
++
++ if (channel & 1) {
++ outbuf[outbuf_size++] = COMMAND_CHANNEL0;
++ outbuf[outbuf_size++] = val;
++ }
++ if (channel & 2) {
++ outbuf[outbuf_size++] = COMMAND_CHANNEL1;
++ outbuf[outbuf_size++] = val;
++ }
++
++ /*
++ * At this point, there are always 1 or 2 two-byte commands in
++ * outbuf. With 2 commands, the device can set two outputs
++ * simultaneously, latching the values upon the end of the I2C
++ * transfer.
++ */
++
++ res = i2c_master_send(client, outbuf, outbuf_size);
++ if (res < 0)
++ return res;
++
++ return count;
++}
++
++static ssize_t max517_set_value_1(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ return max517_set_value(dev, attr, buf, count, 1);
++}
++static IIO_DEV_ATTR_OUT_RAW(1, max517_set_value_1, 0);
++
++static ssize_t max517_set_value_2(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ return max517_set_value(dev, attr, buf, count, 2);
++}
++static IIO_DEV_ATTR_OUT_RAW(2, max517_set_value_2, 1);
++
++static ssize_t max517_set_value_both(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ return max517_set_value(dev, attr, buf, count, 3);
++}
++static IIO_DEVICE_ATTR_NAMED(out1and2_raw, out1&2_raw, S_IWUSR, NULL,
++ max517_set_value_both, -1);
++
++static ssize_t max517_show_scale(struct device *dev,
++ struct device_attribute *attr,
++ char *buf, int channel)
++{
++ struct iio_dev *dev_info = dev_get_drvdata(dev);
++ struct max517_data *data = iio_dev_get_devdata(dev_info);
++ /* Corresponds to Vref / 2^(bits) */
++ unsigned int scale_uv = (data->vref_mv[channel - 1] * 1000) >> 8;
++
++ return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
++}
++
++static ssize_t max517_show_scale1(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ return max517_show_scale(dev, attr, buf, 1);
++}
++static IIO_DEVICE_ATTR(out1_scale, S_IRUGO, max517_show_scale1, NULL, 0);
++
++static ssize_t max517_show_scale2(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ return max517_show_scale(dev, attr, buf, 2);
++}
++static IIO_DEVICE_ATTR(out2_scale, S_IRUGO, max517_show_scale2, NULL, 0);
++
++/* On MAX517 variant, we have one output */
++static struct attribute *max517_attributes[] = {
++ &iio_dev_attr_out1_raw.dev_attr.attr,
++ &iio_dev_attr_out1_scale.dev_attr.attr,
++ NULL
++};
++
++static struct attribute_group max517_attribute_group = {
++ .attrs = max517_attributes,
++};
++
++/* On MAX518 and MAX519 variant, we have two outputs */
++static struct attribute *max518_attributes[] = {
++ &iio_dev_attr_out1_raw.dev_attr.attr,
++ &iio_dev_attr_out1_scale.dev_attr.attr,
++ &iio_dev_attr_out2_raw.dev_attr.attr,
++ &iio_dev_attr_out2_scale.dev_attr.attr,
++ &iio_dev_attr_out1and2_raw.dev_attr.attr,
++ NULL
++};
++
++static struct attribute_group max518_attribute_group = {
++ .attrs = max518_attributes,
++};
++
++static int max517_suspend(struct i2c_client *client, pm_message_t mesg)
++{
++ u8 outbuf = COMMAND_PD;
++
++ return i2c_master_send(client, &outbuf, 1);
++}
++
++static int max517_resume(struct i2c_client *client)
++{
++ u8 outbuf = 0;
++
++ return i2c_master_send(client, &outbuf, 1);
++}
++
++static int max517_probe(struct i2c_client *client,
++ const struct i2c_device_id *id)
++{
++ struct max517_data *data;
++ struct max517_platform_data *platform_data = client->dev.platform_data;
++ int err;
++
++ data = kzalloc(sizeof(struct max517_data), GFP_KERNEL);
++ if (!data) {
++ err = -ENOMEM;
++ goto exit;
++ }
++
++ i2c_set_clientdata(client, data);
++
++ data->client = client;
++
++ data->indio_dev = iio_allocate_device();
++ if (data->indio_dev == NULL) {
++ err = -ENOMEM;
++ goto exit_free_data;
++ }
++
++ /* establish that the iio_dev is a child of the i2c device */
++ data->indio_dev->dev.parent = &client->dev;
++
++ /* reduced attribute set for MAX517 */
++ if (id->driver_data == ID_MAX517)
++ data->indio_dev->attrs = &max517_attribute_group;
++ else
++ data->indio_dev->attrs = &max518_attribute_group;
++ data->indio_dev->dev_data = (void *)(data);
++ data->indio_dev->driver_module = THIS_MODULE;
++ data->indio_dev->modes = INDIO_DIRECT_MODE;
++
++ /*
++ * Reference voltage on MAX518 and default is 5V, else take vref_mv
++ * from platform_data
++ */
++ if (id->driver_data == ID_MAX518 || !platform_data) {
++ data->vref_mv[0] = data->vref_mv[1] = 5000; /* mV */
++ } else {
++ data->vref_mv[0] = platform_data->vref_mv[0];
++ data->vref_mv[1] = platform_data->vref_mv[1];
++ }
++
++ err = iio_device_register(data->indio_dev);
++ if (err)
++ goto exit_free_device;
++
++ dev_info(&client->dev, "DAC registered\n");
++
++ return 0;
++
++exit_free_device:
++ iio_free_device(data->indio_dev);
++exit_free_data:
++ kfree(data);
++exit:
++ return err;
++}
++
++static int max517_remove(struct i2c_client *client)
++{
++ struct max517_data *data = i2c_get_clientdata(client);
++
++ iio_free_device(data->indio_dev);
++ kfree(data);
++
++ return 0;
++}
++
++static const struct i2c_device_id max517_id[] = {
++ { "max517", ID_MAX517 },
++ { "max518", ID_MAX518 },
++ { "max519", ID_MAX519 },
++ { }
++};
++MODULE_DEVICE_TABLE(i2c, max517_id);
++
++static struct i2c_driver max517_driver = {
++ .driver = {
++ .name = MAX517_DRV_NAME,
++ },
++ .probe = max517_probe,
++ .remove = max517_remove,
++ .suspend = max517_suspend,
++ .resume = max517_resume,
++ .id_table = max517_id,
++};
++
++static int __init max517_init(void)
++{
++ return i2c_add_driver(&max517_driver);
++}
++
++static void __exit max517_exit(void)
++{
++ i2c_del_driver(&max517_driver);
++}
++
++MODULE_AUTHOR("Roland Stigge <st...@an...>");
++MODULE_DESCRIPTION("MAX517/MAX518/MAX519 8-bit DAC");
++MODULE_LICENSE("GPL");
++
++module_init(max517_init);
++module_exit(max517_exit);
+Index: linux-2.6.38-rc3/drivers/staging/iio/dac/max517.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.38-rc3/drivers/staging/iio/dac/max517.h 2011-02-21 18:29:49.000000000 +0100
+@@ -0,0 +1,19 @@
++/*
++ * MAX517 DAC driver
++ *
++ * Copyright 2011 Roland Stigge <st...@an...>
++ *
++ * Licensed under the GPL-2 or later.
++ */
++#ifndef IIO_DAC_MAX517_H_
++#define IIO_DAC_MAX517_H_
++
++/*
++ * TODO: struct max517_platform_data needs to go into include/linux/iio
++ */
++
++struct max517_platform_data {
++ u16 vref_mv[2];
++};
++
++#endif /* IIO_DAC_MAX517_H_ */
+Index: linux-2.6.38-rc3/drivers/staging/iio/dds/ad9832.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/dds/ad9832.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/dds/ad9832.c 2011-02-21 18:29:49.000000000 +0100
+@@ -1,228 +1,336 @@
+ /*
+- * Driver for ADI Direct Digital Synthesis ad9832
++ * AD9832 SPI DDS driver
+ *
+- * Copyright (c) 2010 Analog Devices Inc.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License version 2 as
+- * published by the Free Software Foundation.
++ * Copyright 2011 Analog Devices Inc.
+ *
++ * Licensed under the GPL-2.
+ */
+-#include <linux/types.h>
+-#include <linux/mutex.h>
++
+ #include <linux/device.h>
+-#include <linux/spi/spi.h>
++#include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/sysfs.h>
++#include <linux/spi/spi.h>
++#include <linux/regulator/consumer.h>
++#include <linux/err.h>
++#include <asm/div64.h>
+
+ #include "../iio.h"
+ #include "../sysfs.h"
++#include "dds.h"
+
+-#define DRV_NAME "ad9832"
+-
+-#define value_mask (u16)0xf000
+-#define cmd_shift 12
+-#define add_shift 8
+-#define AD9832_SYNC (1 << 13)
+-#define AD9832_SELSRC (1 << 12)
+-#define AD9832_SLEEP (1 << 13)
+-#define AD9832_RESET (1 << 12)
+-#define AD9832_CLR (1 << 11)
+-
+-#define ADD_FREQ0LL 0x0
+-#define ADD_FREQ0HL 0x1
+-#define ADD_FREQ0LM 0x2
+-#define ADD_FREQ0HM 0x3
+-#define ADD_FREQ1LL 0x4
+-#define ADD_FREQ1HL 0x5
+-#define ADD_FREQ1LM 0x6
+-#define ADD_FREQ1HM 0x7
+-#define ADD_PHASE0L 0x8
+-#define ADD_PHASE0H 0x9
+-#define ADD_PHASE1L 0xa
+-#define ADD_PHASE1H 0xb
+-#define ADD_PHASE2L 0xc
+-#define ADD_PHASE2H 0xd
+-#define ADD_PHASE3L 0xe
+-#define ADD_PHASE3H 0xf
+-
+-#define CMD_PHA8BITSW 0x1
+-#define CMD_PHA16BITSW 0x0
+-#define CMD_FRE8BITSW 0x3
+-#define CMD_FRE16BITSW 0x2
+-#define CMD_SELBITSCTL 0x6
+-
+-struct ad9832_setting {
+- u16 freq0[4];
+- u16 freq1[4];
+- u16 phase0[2];
+- u16 phase1[2];
+- u16 phase2[2];
+- u16 phase3[2];
+-};
++#include "ad9832.h"
+
+-struct ad9832_state {
+- struct mutex lock;
+- struct iio_dev *idev;
+- struct spi_device *sdev;
+-};
++static unsigned long ad9832_calc_freqreg(unsigned long mclk, unsigned long fout)
++{
++ unsigned long long freqreg = (u64) fout *
++ (u64) ((u64) 1L << AD9832_FREQ_BITS);
++ do_div(freqreg, mclk);
++ return freqreg;
++}
+
+-static ssize_t ad9832_set_parameter(struct device *dev,
+- struct device_attribute *attr,
+- const char *buf,
+- size_t len)
++static int ad9832_write_frequency(struct ad9832_state *st,
++ unsigned addr, unsigned long fout)
+ {
+- struct spi_message msg;
+- struct spi_transfer xfer;
+- int ret;
+- struct ad9832_setting config;
+- struct iio_dev *idev = dev_get_drvdata(dev);
+- struct ad9832_state *st = idev->dev_data;
+-
+- config.freq0[0] = (CMD_FRE8BITSW << add_shift | ADD_FREQ0LL << add_shift | buf[0]);
+- config.freq0[1] = (CMD_FRE16BITSW << add_shift | ADD_FREQ0HL << add_shift | buf[1]);
+- config.freq0[2] = (CMD_FRE8BITSW << add_shift | ADD_FREQ0LM << add_shift | buf[2]);
+- config.freq0[3] = (CMD_FRE16BITSW << add_shift | ADD_FREQ0HM << add_shift | buf[3]);
+- config.freq1[0] = (CMD_FRE8BITSW << add_shift | ADD_FREQ1LL << add_shift | buf[4]);
+- config.freq1[1] = (CMD_FRE16BITSW << add_shift | ADD_FREQ1HL << add_shift | buf[5]);
+- config.freq1[2] = (CMD_FRE8BITSW << add_shift | ADD_FREQ1LM << add_shift | buf[6]);
+- config.freq1[3] = (CMD_FRE16BITSW << add_shift | ADD_FREQ1HM << add_shift | buf[7]);
+-
+- config.phase0[0] = (CMD_PHA8BITSW << add_shift | ADD_PHASE0L << add_shift | buf[9]);
+- config.phase0[1] = (CMD_PHA16BITSW << add_shift | ADD_PHASE0H << add_shift | buf[10]);
+- config.phase1[0] = (CMD_PHA8BITSW << add_shift | ADD_PHASE1L << add_shift | buf[11]);
+- config.phase1[1] = (CMD_PHA16BITSW << add_shift | ADD_PHASE1H << add_shift | buf[12]);
+- config.phase2[0] = (CMD_PHA8BITSW << add_shift | ADD_PHASE2L << add_shift | buf[13]);
+- config.phase2[1] = (CMD_PHA16BITSW << add_shift | ADD_PHASE2H << add_shift | buf[14]);
+- config.phase3[0] = (CMD_PHA8BITSW << add_shift | ADD_PHASE3L << add_shift | buf[15]);
+- config.phase3[1] = (CMD_PHA16BITSW << add_shift | ADD_PHASE3H << add_shift | buf[16]);
+-
+- xfer.len = 2 * len;
+- xfer.tx_buf = &config;
+- mutex_lock(&st->lock);
+-
+- spi_message_init(&msg);
+- spi_message_add_tail(&xfer, &msg);
+- ret = spi_sync(st->sdev, &msg);
+- if (ret)
+- goto error_ret;
+-error_ret:
+- mutex_unlock(&st->lock);
++ unsigned long regval;
+
+- return ret ? ret : len;
+-}
++ if (fout > (st->mclk / 2))
++ return -EINVAL;
+
+-static IIO_DEVICE_ATTR(dds, S_IWUSR, NULL, ad9832_set_parameter, 0);
++ regval = ad9832_calc_freqreg(st->mclk, fout);
+
+-static struct attribute *ad9832_attributes[] = {
+- &iio_dev_attr_dds.dev_attr.attr,
+- NULL,
+-};
++ st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) |
++ (addr << ADD_SHIFT) |
++ ((regval >> 24) & 0xFF));
++ st->freq_data[1] = cpu_to_be16((AD9832_CMD_FRE16BITSW << CMD_SHIFT) |
++ ((addr - 1) << ADD_SHIFT) |
++ ((regval >> 16) & 0xFF));
++ st->freq_data[2] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) |
++ ((addr - 2) << ADD_SHIFT) |
++ ((regval >> 8) & 0xFF));
++ st->freq_data[3] = cpu_to_be16((AD9832_CMD_FRE16BITSW << CMD_SHIFT) |
++ ((addr - 3) << ADD_SHIFT) |
++ ((regval >> 0) & 0xFF));
+
+-static const struct attribute_group ad9832_attribute_group = {
+- .name = DRV_NAME,
+- .attrs = ad9832_attributes,
+-};
++ return spi_sync(st->spi, &st->freq_msg);;
++}
+
+-static void ad9832_init(struct ad9832_state *st)
++static int ad9832_write_phase(struct ad9832_state *st,
++ unsigned long addr, unsigned long phase)
+ {
+- struct spi_message msg;
+- struct spi_transfer xfer;
+- int ret;
+- u16 config = 0;
++ if (phase > (1 << AD9832_PHASE_BITS))
++ return -EINVAL;
+
+- config = 0x3 << 14 | AD9832_SLEEP | AD9832_RESET | AD9832_CLR;
++ st->phase_data[0] = cpu_to_be16((AD9832_CMD_PHA8BITSW << CMD_SHIFT) |
++ (addr << ADD_SHIFT) |
++ ((phase >> 8) & 0xFF));
++ st->phase_data[1] = cpu_to_be16((AD9832_CMD_PHA16BITSW << CMD_SHIFT) |
++ ((addr - 1) << ADD_SHIFT) |
++ (phase & 0xFF));
+
+- mutex_lock(&st->lock);
++ return spi_sync(st->spi, &st->phase_msg);
++}
+
+- xfer.len = 2;
+- xfer.tx_buf = &config;
++static ssize_t ad9832_write(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf,
++ size_t len)
++{
++ struct iio_dev *dev_info = dev_get_drvdata(dev);
++ struct ad9832_state *st = dev_info->dev_data;
++ struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
++ int ret;
++ long val;
+
+- spi_message_init(&msg);
+- spi_message_add_tail(&xfer, &msg);
+- ret = spi_sync(st->sdev, &msg);
++ ret = strict_strtoul(buf, 10, &val);
+ if (ret)
+ goto error_ret;
+
+- config = 0x2 << 14 | AD9832_SYNC | AD9832_SELSRC;
+- xfer.len = 2;
+- xfer.tx_buf = &config;
+-
+- spi_message_init(&msg);
+- spi_message_add_tail(&xfer, &msg);
+- ret = spi_sync(st->sdev, &msg);
+- if (ret)
+- goto error_ret;
++ mutex_lock(&dev_info->mlock);
++ switch (this_attr->address) {
++ case AD9832_FREQ0HM:
++ case AD9832_FREQ1HM:
++ ret = ad9832_write_frequency(st, this_attr->address, val);
++ break;
++ case AD9832_PHASE0H:
++ case AD9832_PHASE1H:
++ case AD9832_PHASE2H:
++ case AD9832_PHASE3H:
++ ret = ad9832_write_phase(st, this_attr->address, val);
++ break;
++ case AD9832_PINCTRL_EN:
++ if (val)
++ st->ctrl_ss &= ~AD9832_SELSRC;
++ else
++ st->ctrl_ss |= AD9832_SELSRC;
++ st->data = cpu_to_be16((AD9832_CMD_SYNCSELSRC << CMD_SHIFT) |
++ st->ctrl_ss);
++ ret = spi_sync(st->spi, &st->msg);
++ break;
++ case AD9832_FREQ_SYM:
++ if (val == 1)
++ st->ctrl_fp |= AD9832_FREQ;
++ else if (val == 0)
++ st->ctrl_fp &= ~AD9832_FREQ;
++ else {
++ ret = -EINVAL;
++ break;
++ }
++ st->data = cpu_to_be16((AD9832_CMD_FPSELECT << CMD_SHIFT) |
++ st->ctrl_fp);
++ ret = spi_sync(st->spi, &st->msg);
++ break;
++ case AD9832_PHASE_SYM:
++ if (val < 0 || val > 3) {
++ ret = -EINVAL;
++ break;
++ }
++
++ st->ctrl_fp &= ~AD9832_PHASE(3);
++ st->ctrl_fp |= AD9832_PHASE(val);
++
++ st->data = cpu_to_be16((AD9832_CMD_FPSELECT << CMD_SHIFT) |
++ st->ctrl_fp);
++ ret = spi_sync(st->spi, &st->msg);
++ break;
++ case AD9832_OUTPUT_EN:
++ if (val)
++ st->ctrl_src &= ~(AD9832_RESET | AD9832_SLEEP |
++ AD9832_CLR);
++ else
++ st->ctrl_src |= AD9832_RESET;
++
++ st->data = cpu_to_be16((AD9832_CMD_SLEEPRESCLR << CMD_SHIFT) |
++ st->ctrl_src);
++ ret = spi_sync(st->spi, &st->msg);
++ break;
++ default:
++ ret = -ENODEV;
++ }
++ mutex_unlock(&dev_info->mlock);
+
+- config = CMD_SELBITSCTL << cmd_shift;
+- xfer.len = 2;
+- xfer.tx_buf = &config;
+-
+- spi_message_init(&msg);
+- spi_message_add_tail(&xfer, &msg);
+- ret = spi_sync(st->sdev, &msg);
+- if (ret)
+- goto error_ret;
++error_ret:
++ return ret ? ret : len;
++}
+
+- config = 0x3 << 14;
++static ssize_t ad9832_show_name(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct iio_dev *dev_info = dev_get_drvdata(dev);
++ struct ad9832_state *st = iio_dev_get_devdata(dev_info);
+
+- xfer.len = 2;
+- xfer.tx_buf = &config;
++ return sprintf(buf, "%s\n", spi_get_device_id(st->spi)->name);
++}
++static IIO_DEVICE_ATTR(name, S_IRUGO, ad9832_show_name, NULL, 0);
+
+- spi_message_init(&msg);
+- spi_message_add_tail(&xfer, &msg);
+- ret = spi_sync(st->sdev, &msg);
+- if (ret)
+- goto error_ret;
+-error_ret:
+- mutex_unlock(&st->lock);
++/**
++ * see dds.h for further information
++ */
+
++static IIO_DEV_ATTR_FREQ(0, 0, S_IWUSR, NULL, ad9832_write, AD9832_FREQ0HM);
++static IIO_DEV_ATTR_FREQ(0, 1, S_IWUSR, NULL, ad9832_write, AD9832_FREQ1HM);
++static IIO_DEV_ATTR_FREQSYMBOL(0, S_IWUSR, NULL, ad9832_write, AD9832_FREQ_SYM);
++static IIO_CONST_ATTR_FREQ_SCALE(0, "1"); /* 1Hz */
++
++static IIO_DEV_ATTR_PHASE(0, 0, S_IWUSR, NULL, ad9832_write, AD9832_PHASE0H);
++static IIO_DEV_ATTR_PHASE(0, 1, S_IWUSR, NULL, ad9832_write, AD9832_PHASE1H);
++static IIO_DEV_ATTR_PHASE(0, 2, S_IWUSR, NULL, ad9832_write, AD9832_PHASE2H);
++static IIO_DEV_ATTR_PHASE(0, 3, S_IWUSR, NULL, ad9832_write, AD9832_PHASE3H);
++static IIO_DEV_ATTR_PHASESYMBOL(0, S_IWUSR, NULL,
++ ad9832_write, AD9832_PHASE_SYM);
++static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/
++
++static IIO_DEV_ATTR_PINCONTROL_EN(0, S_IWUSR, NULL,
++ ad9832_write, AD9832_PINCTRL_EN);
++static IIO_DEV_ATTR_OUT_ENABLE(0, S_IWUSR, NULL,
++ ad9832_write, AD9832_OUTPUT_EN);
+
++static struct attribute *ad9832_attributes[] = {
++ &iio_dev_attr_dds0_freq0.dev_attr.attr,
++ &iio_dev_attr_dds0_freq1.dev_attr.attr,
++ &iio_const_attr_dds0_freq_scale.dev_attr.attr,
++ &iio_dev_attr_dds0_phase0.dev_attr.attr,
++ &iio_dev_attr_dds0_phase1.dev_attr.attr,
++ &iio_dev_attr_dds0_phase2.dev_attr.attr,
++ &iio_dev_attr_dds0_phase3.dev_attr.attr,
++ &iio_const_attr_dds0_phase_scale.dev_attr.attr,
++ &iio_dev_attr_dds0_pincontrol_en.dev_attr.attr,
++ &iio_dev_attr_dds0_freqsymbol.dev_attr.attr,
++ &iio_dev_attr_dds0_phasesymbol.dev_attr.attr,
++ &iio_dev_attr_dds0_out_enable.dev_attr.attr,
++ &iio_dev_attr_name.dev_attr.attr,
++ NULL,
++};
+
+-}
++static const struct attribute_group ad9832_attribute_group = {
++ .attrs = ad9832_attributes,
++};
+
+ static int __devinit ad9832_probe(struct spi_device *spi)
+ {
++ struct ad9832_platform_data *pdata = spi->dev.platform_data;
+ struct ad9832_state *st;
+- int ret = 0;
++ int ret;
++
++ if (!pdata) {
++ dev_dbg(&spi->dev, "no platform data?\n");
++ return -ENODEV;
++ }
+
+ st = kzalloc(sizeof(*st), GFP_KERNEL);
+ if (st == NULL) {
+ ret = -ENOMEM;
+ goto error_ret;
+ }
+- spi_set_drvdata(spi, st);
+
+- mutex_init(&st->lock);
+- st->sdev = spi;
++ st->reg = regulator_get(&spi->dev, "vcc");
++ if (!IS_ERR(st->reg)) {
++ ret = regulator_enable(st->reg);
++ if (ret)
++ goto error_put_reg;
++ }
+
+- st->idev = iio_allocate_device();
+- if (st->idev == NULL) {
++ st->mclk = pdata->mclk;
++
++ spi_set_drvdata(spi, st);
++ st->spi = spi;
++
++ st->indio_dev = iio_allocate_device();
++ if (st->indio_dev == NULL) {
+ ret = -ENOMEM;
+- goto error_free_st;
++ goto error_disable_reg;
+ }
+- st->idev->dev.parent = &spi->dev;
+- st->idev->num_interrupt_lines = 0;
+- st->idev->event_attrs = NULL;
+-
+- st->idev->attrs = &ad9832_attribute_group;
+- st->idev->dev_data = (void *)(st);
+- st->idev->driver_module = THIS_MODULE;
+- st->idev->modes = INDIO_DIRECT_MODE;
+
+- ret = iio_device_register(st->idev);
++ st->indio_dev->dev.parent = &spi->dev;
++ st->indio_dev->attrs = &ad9832_attribute_group;
++ st->indio_dev->dev_data = (void *) st;
++ st->indio_dev->driver_module = THIS_MODULE;
++ st->indio_dev->modes = INDIO_DIRECT_MODE;
++
++ /* Setup default messages */
++
++ st->xfer.tx_buf = &st->data;
++ st->xfer.len = 2;
++
++ spi_message_init(&st->msg);
++ spi_message_add_tail(&st->xfer, &st->msg);
++
++ st->freq_xfer[0].tx_buf = &st->freq_data[0];
++ st->freq_xfer[0].len = 2;
++ st->freq_xfer[0].cs_change = 1;
++ st->freq_xfer[1].tx_buf = &st->freq_data[1];
++ st->freq_xfer[1].len = 2;
++ st->freq_xfer[1].cs_change = 1;
++ st->freq_xfer[2].tx_buf = &st->freq_data[2];
++ st->freq_xfer[2].len = 2;
++ st->freq_xfer[2].cs_change = 1;
++ st->freq_xfer[3].tx_buf = &st->freq_data[3];
++ st->freq_xfer[3].len = 2;
++
++ spi_message_init(&st->freq_msg);
++ spi_message_add_tail(&st->freq_xfer[0], &st->freq_msg);
++ spi_message_add_tail(&st->freq_xfer[1], &st->freq_msg);
++ spi_message_add_tail(&st->freq_xfer[2], &st->freq_msg);
++ spi_message_add_tail(&st->freq_xfer[3], &st->freq_msg);
++
++ st->phase_xfer[0].tx_buf = &st->phase_data[0];
++ st->phase_xfer[0].len = 2;
++ st->phase_xfer[0].cs_change = 1;
++ st->phase_xfer[1].tx_buf = &st->phase_data[1];
++ st->phase_xfer[1].len = 2;
++
++ spi_message_init(&st->phase_msg);
++ spi_message_add_tail(&st->phase_xfer[0], &st->phase_msg);
++ spi_message_add_tail(&st->phase_xfer[1], &st->phase_msg);
++
++ st->ctrl_src = AD9832_SLEEP | AD9832_RESET | AD9832_CLR;
++ st->data = cpu_to_be16((AD9832_CMD_SLEEPRESCLR << CMD_SHIFT) |
++ st->ctrl_src);
++ ret = spi_sync(st->spi, &st->msg);
++ if (ret) {
++ dev_err(&spi->dev, "device init failed\n");
++ goto error_free_device;
++ }
++
++ ret = ad9832_write_frequency(st, AD9832_FREQ0HM, pdata->freq0);
++ if (ret)
++ goto error_free_device;
++
++ ret = ad9832_write_frequency(st, AD9832_FREQ1HM, pdata->freq1);
++ if (ret)
++ goto error_free_device;
++
++ ret = ad9832_write_phase(st, AD9832_PHASE0H, pdata->phase0);
++ if (ret)
++ goto error_free_device;
++
++ ret = ad9832_write_phase(st, AD9832_PHASE1H, pdata->phase1);
++ if (ret)
++ goto error_free_device;
++
++ ret = ad9832_write_phase(st, AD9832_PHASE2H, pdata->phase2);
+ if (ret)
+- goto error_free_dev;
+- spi->max_speed_hz = 2000000;
+- spi->mode = SPI_MODE_3;
+- spi->bits_per_word = 16;
+- spi_setup(spi);
+- ad9832_init(st);
++ goto error_free_device;
++
++ ret = ad9832_write_phase(st, AD9832_PHASE3H, pdata->phase3);
++ if (ret)
++ goto error_free_device;
++
++ ret = iio_device_register(st->indio_dev);
++ if (ret)
++ goto error_free_device;
++
+ return 0;
+
+-error_free_dev:
+- iio_free_device(st->idev);
+-error_free_st:
++error_free_device:
++ iio_free_device(st->indio_dev);
++error_disable_reg:
++ if (!IS_ERR(st->reg))
++ regulator_disable(st->reg);
++error_put_reg:
++ if (!IS_ERR(st->reg))
++ regulator_put(st->reg);
+ kfree(st);
+ error_ret:
+ return ret;
+@@ -232,33 +340,45 @@
+ {
+ struct ad9832_state *st = spi_get_drvdata(spi);
+
+- iio_device_unregister(st->idev);
++ iio_device_unregister(st->indio_dev);
++ if (!IS_ERR(st->reg)) {
++ regulator_disable(st->reg);
++ regulator_put(st->reg);
++ }
+ kfree(st);
+-
+ return 0;
+ }
+
++static const struct spi_device_id ad9832_id[] = {
++ {"ad9832", 0},
++ {"ad9835", 0},
++ {}
++};
++
+ static struct spi_driver ad9832_driver = {
+ .driver = {
+- .name = DRV_NAME,
+- .owner = THIS_MODULE,
++ .name = "ad9832",
++ .bus = &spi_bus_type,
++ .owner = THIS_MODULE,
+ },
+- .probe = ad9832_probe,
+- .remove = __devexit_p(ad9832_remove),
++ .probe = ad9832_probe,
++ .remove = __devexit_p(ad9832_remove),
++ .id_table = ad9832_id,
+ };
+
+-static __init int ad9832_spi_init(void)
++static int __init ad9832_init(void)
+ {
+ return spi_register_driver(&ad9832_driver);
+ }
+-module_init(ad9832_spi_init);
++module_init(ad9832_init);
+
+-static __exit void ad9832_spi_exit(void)
++static void __exit ad9832_exit(void)
+ {
+ spi_unregister_driver(&ad9832_driver);
+ }
+-module_exit(ad9832_spi_exit);
++module_exit(ad9832_exit);
+
+-MODULE_AUTHOR("Cliff Cai");
+-MODULE_DESCRIPTION("Analog Devices ad9832 driver");
++MODULE_AUTHOR("Michael Hennerich <hen...@bl...>");
++MODULE_DESCRIPTION("Analog Devices AD9832/AD9835 DDS");
+ MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("spi:ad9832");
+Index: linux-2.6.38-rc3/drivers/staging/iio/dds/ad9832.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.38-rc3/drivers/staging/iio/dds/ad9832.h 2011-02-21 18:29:49.000000000 +0100
+@@ -0,0 +1,128 @@
++/*
++ * AD9832 SPI DDS driver
++ *
++ * Copyright 2011 Analog Devices Inc.
++ *
++ * Licensed under the GPL-2 or later.
++ */
++#ifndef IIO_DDS_AD9832_H_
++#define IIO_DDS_AD9832_H_
++
++/* Registers */
++
++#define AD9832_FREQ0LL 0x0
++#define AD9832_FREQ0HL 0x1
++#define AD9832_FREQ0LM 0x2
++#define AD9832_FREQ0HM 0x3
++#define AD9832_FREQ1LL 0x4
++#define AD9832_FREQ1HL 0x5
++#define AD9832_FREQ1LM 0x6
++#define AD9832_FREQ1HM 0x7
++#define AD9832_PHASE0L 0x8
++#define AD9832_PHASE0H 0x9
++#define AD9832_PHASE1L 0xA
++#define AD9832_PHASE1H 0xB
++#define AD9832_PHASE2L 0xC
++#define AD9832_PHASE2H 0xD
++#define AD9832_PHASE3L 0xE
++#define AD9832_PHASE3H 0xF
++
++#define AD9832_PHASE_SYM 0x10
++#define AD9832_FREQ_SYM 0x11
++#define AD9832_PINCTRL_EN 0x12
++#define AD9832_OUTPUT_EN 0x13
++
++/* Command Control Bits */
++
++#define AD9832_CMD_PHA8BITSW 0x1
++#define AD9832_CMD_PHA16BITSW 0x0
++#define AD9832_CMD_FRE8BITSW 0x3
++#define AD9832_CMD_FRE16BITSW 0x2
++#define AD9832_CMD_FPSELECT 0x6
++#define AD9832_CMD_SYNCSELSRC 0x8
++#define AD9832_CMD_SLEEPRESCLR 0xC
++
++#define AD9832_FREQ (1 << 11)
++#define AD9832_PHASE(x) (((x) & 3) << 9)
++#define AD9832_SYNC (1 << 13)
++#define AD9832_SELSRC (1 << 12)
++#define AD9832_SLEEP (1 << 13)
++#define AD9832_RESET (1 << 12)
++#define AD9832_CLR (1 << 11)
++#define CMD_SHIFT 12
++#define ADD_SHIFT 8
++#define AD9832_FREQ_BITS 32
++#define AD9832_PHASE_BITS 12
++#define RES_MASK(bits) ((1 << (bits)) - 1)
++
++/**
++ * struct ad9832_state - driver instance specific data
++ * @indio_dev: the industrial I/O device
++ * @spi: spi_device
++ * @reg: supply regulator
++ * @mclk: external master clock
++ * @ctrl_fp: cached frequency/phase control word
++ * @ctrl_ss: cached sync/selsrc control word
++ * @ctrl_src: cached sleep/reset/clr word
++ * @xfer: default spi transfer
++ * @msg: default spi message
++ * @freq_xfer: tuning word spi transfer
++ * @freq_msg: tuning word spi message
++ * @phase_xfer: tuning word spi transfer
++ * @phase_msg: tuning word spi message
++ * @data: spi transmit buffer
++ * @phase_data: tuning word spi transmit buffer
++ * @freq_data: tuning word spi transmit buffer
++ */
++
++struct ad9832_state {
++ struct iio_dev *indio_dev;
++ struct spi_device *spi;
++ struct regulator *reg;
++ unsigned long mclk;
++ unsigned short ctrl_fp;
++ unsigned short ctrl_ss;
++ unsigned short ctrl_src;
++ struct spi_transfer xfer;
++ struct spi_message msg;
++ struct spi_transfer freq_xfer[4];
++ struct spi_message freq_msg;
++ struct spi_transfer phase_xfer[2];
++ struct spi_message phase_msg;
++ /*
++ * DMA (thus cache coherency maintenance) requires the
++ * transfer buffers to live in their own cache lines.
++ */
++ union {
++ unsigned short freq_data[4]____cacheline_aligned;
++ unsigned short phase_data[2];
++ unsigned short data;
++ };
++};
++
++/*
++ * TODO: struct ad9832_platform_data needs to go into include/linux/iio
++ */
++
++/**
++ * struct ad9832_platform_data - platform specific information
++ * @mclk: master clock in Hz
++ * @freq0: power up freq0 tuning word in Hz
++ * @freq1: power up freq1 tuning word in Hz
++ * @phase0: power up phase0 value [0..4095] correlates with 0..2PI
++ * @phase1: power up phase1 value [0..4095] correlates with 0..2PI
++ * @phase2: power up phase2 value [0..4095] correlates with 0..2PI
++ * @phase3: power up phase3 value [0..4095] correlates with 0..2PI
++ */
++
++struct ad9832_platform_data {
++ unsigned long mclk;
++ unsigned long freq0;
++ unsigned long freq1;
++ unsigned short phase0;
++ unsigned short phase1;
++ unsigned short phase2;
++ unsigned short phase3;
++};
++
++#endif /* IIO_DDS_AD9832_H_ */
+Index: linux-2.6.38-rc3/drivers/staging/iio/dds/Kconfig
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/dds/Kconfig 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/dds/Kconfig 2011-02-21 18:29:49.000000000 +0100
+@@ -15,7 +15,10 @@
+ depends on SPI
+ help
+ Say yes here to build support for Analog Devices DDS chip
+- ad9832 and ad9835, provides direct access via sysfs.
++ AD9832 and AD9835, provides direct access via sysfs.
++
++ To compile this driver as a module, choose M here: the
++ module will be called ad9832.
+
+ config AD9834
+ tristate "Analog Devices ad9833/4/ driver"
+Index: linux-2.6.38-rc3/drivers/staging/iio/Documentation/dac/max517
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.38-rc3/drivers/staging/iio/Documentation/dac/max517 2011-02-21 18:29:49.000000000 +0100
+@@ -0,0 +1,41 @@
++Kernel driver max517
++====================
++
++Supported chips:
++ * Maxim MAX517, MAX518, MAX519
++ Prefix: 'max517'
++ Datasheet: Publicly available at the Maxim website
++ http://www.maxim-ic.com/
++
++Author:
++ Roland Stigge <st...@an...>
++
++Description
++-----------
++
++The Maxim MAX517/518/519 is an 8-bit DAC on the I2C bus. The following table
++shows the different feature sets of the variants MAX517, MAX518 and MAX519:
++
++Feature MAX517 MAX518 MAX519
++--------------------------------------------------------------------------
++One output channel X
++Two output channels X X
++Simultaneous output updates X X
++Supply voltage as reference X
++Separate reference input X
++Reference input for each DAC X
++
++Via the iio sysfs interface, there are three attributes available: out1_raw,
++out2_raw and out12_raw. With out1_raw and out2_raw, the current output values
++(0..255) of the DACs can be written to the device. out12_raw can be used to set
++both output channel values simultaneously.
++
++With MAX517, only out1_raw is available.
++
++Via out1_scale (and where appropriate, out2_scale), the current scaling factor
++in mV can be read.
++
++When the operating system goes to a power down state, the Power Down function
++of the chip is activated, reducing the supply current to 4uA.
++
++On power-up, the device is in 0V-output state.
+Index: linux-2.6.38-rc3/drivers/staging/iio/Documentation/generic_buffer.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/Documentation/generic_buffer.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/Documentation/generic_buffer.c 2011-02-21 18:29:49.000000000 +0100
+@@ -26,11 +26,9 @@
+ #include <sys/stat.h>
+ #include <sys/dir.h>
+ #include <linux/types.h>
++#include <string.h>
+ #include "iio_utils.h"
+
+-const int buf_len = 128;
+-const int num_loops = 2;
+-
+ /**
+ * size_from_channelarray() - calculate the storage size of a scan
+ * @channels: the channel info array
+@@ -118,6 +116,11 @@
+
+ int main(int argc, char **argv)
+ {
++ unsigned long num_loops = 2;
++ unsigned long timedelay = 1000000;
++ unsigned long buf_len = 128;
++
++
+ int ret, c, i, j, toread;
+
+ FILE *fp_ev;
+@@ -134,10 +137,12 @@
+ int dev_num, trig_num;
+ char *buffer_access, *buffer_event;
+ int scan_size;
++ int noevents = 0;
++ char *dummy;
+
+ struct iio_channel_info *infoarray;
+
+- while ((c = getopt(argc, argv, "t:n:")) != -1) {
++ while ((c = getopt(argc, argv, "l:w:c:et:n:")) != -1) {
+ switch (c) {
+ case 'n':
+ device_name = optarg;
+@@ -146,6 +151,18 @@
+ trigger_name = optarg;
+ datardytrigger = 0;
+ break;
++ case 'e':
++ noevents = 1;
++ break;
++ case 'c':
++ num_loops = strtoul(optarg, &dummy, 10);
++ break;
++ case 'w':
++ timedelay = strtoul(optarg, &dummy, 10);
++ break;
++ case 'l':
++ buf_len = strtoul(optarg, &dummy, 10);
++ break;
+ case '?':
+ return -1;
+ }
+@@ -260,22 +277,30 @@
+
+ /* Wait for events 10 times */
+ for (j = 0; j < num_loops; j++) {
+- read_size = fread(&dat, 1, sizeof(struct iio_event_data),
+- fp_ev);
+- switch (dat.id) {
+- case IIO_EVENT_CODE_RING_100_FULL:
+- toread = buf_len;
+- break;
+- case IIO_EVENT_CODE_RING_75_FULL:
+- toread = buf_len*3/4;
+- break;
+- case IIO_EVENT_CODE_RING_50_FULL:
+- toread = buf_len/2;
+- break;
+- default:
+- printf("Unexpecteded event code\n");
+- continue;
++ if (!noevents) {
++ read_size = fread(&dat,
++ 1,
++ sizeof(struct iio_event_data),
++ fp_ev);
++ switch (dat.id) {
++ case IIO_EVENT_CODE_RING_100_FULL:
++ toread = buf_len;
++ break;
++ case IIO_EVENT_CODE_RING_75_FULL:
++ toread = buf_len*3/4;
++ break;
++ case IIO_EVENT_CODE_RING_50_FULL:
++ toread = buf_len/2;
++ break;
++ default:
++ printf("Unexpecteded event code\n");
++ continue;
++ }
++ } else {
++ usleep(timedelay);
++ toread = 64;
+ }
++
+ read_size = read(fp,
+ data,
+ toread*scan_size);
+Index: linux-2.6.38-rc3/drivers/staging/iio/Documentation/iio_utils.h
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/Documentation/iio_utils.h 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/Documentation/iio_utils.h 2011-02-21 18:29:49.000000000 +0100
+@@ -398,7 +398,7 @@
+ return 0;
+
+ error_cleanup_array:
+- for (i = count - 1; i >= 0; i++)
++ for (i = count - 1; i >= 0; i--)
+ free((*ci_array)[i].name);
+ free(*ci_array);
+ error_close_dir:
+Index: linux-2.6.38-rc3/drivers/staging/iio/Documentation/sysfs-bus-iio
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/Documentation/sysfs-bus-iio 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/Documentation/sysfs-bus-iio 2011-02-21 18:29:49.000000000 +0100
+@@ -168,6 +168,7 @@
+ What: /sys/bus/iio/devices/deviceX/inY_scale
+ What: /sys/bus/iio/devices/deviceX/inY_supply_scale
+ What: /sys/bus/iio/devices/deviceX/in_scale
++What: /sys/bus/iio/devices/deviceX/outY_scale
+ What: /sys/bus/iio/devices/deviceX/accel_scale
+ What: /sys/bus/iio/devices/deviceX/accel_peak_scale
+ What: /sys/bus/iio/devices/deviceX/gyro_scale
+@@ -222,6 +223,23 @@
+ If a discrete set of scale values are available, they
+ are listed in this attribute.
+
++What: /sys/bus/iio/devices/deviceX/outY_raw
++KernelVersion: 2.6.37
++Contact: lin...@vg...
++Description:
++ Raw (unscaled, no bias etc.) output voltage for
++ channel Y. The number must always be specified and
++ unique if the output corresponds to a single channel.
++
++What: /sys/bus/iio/devices/deviceX/outY&Z_raw
++KernelVersion: 2.6.37
++Contact: lin...@vg...
++Description:
++ Raw (unscaled, no bias etc.) output voltage for an aggregate of
++ channel Y, channel Z, etc. This interface is available in cases
++ where a single output sets the value for multiple channels
++ simultaneously.
++
+ What: /sys/bus/iio/devices/deviceX/deviceX:eventY
+ KernelVersion: 2.6.35
+ Contact: lin...@vg...
+Index: linux-2.6.38-rc3/drivers/staging/iio/Documentation/sysfs-bus-iio-trigger-sysfs
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.38-rc3/drivers/staging/iio/Documentation/sysfs-bus-iio-trigger-sysfs 2011-02-21 18:29:49.000000000 +0100
+@@ -0,0 +1,11 @@
++What: /sys/bus/iio/devices/triggerX/trigger_now
++KernelVersion: 2.6.38
++Contact: lin...@vg...
++Description:
++ This file is provided by the iio-trig-sysfs stand-alone trigger
++ driver. Writing this file with any value triggers an event
++ driven driver, associated with this trigger, to capture data
++ into an in kernel buffer. This approach can be valuable during
++ automated testing or in situations, where other trigger methods
++ are not applicable. For example no RTC or spare GPIOs.
++ X is the IIO index of the trigger.
+Index: linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16060_core.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/gyro/adis16060_core.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16060_core.c 2011-02-21 18:29:49.000000000 +0100
+@@ -25,11 +25,9 @@
+
+ #include "adis16060.h"
+
+-#define DRIVER_NAME "adis16060"
++static struct adis16060_state *adis16060_st;
+
+-struct adis16060_state *adis16060_st;
+-
+-int adis16060_spi_write(struct device *dev,
++static int adis16060_spi_write(struct device *dev,
+ u8 val)
+ {
+ int ret;
+@@ -47,7 +45,7 @@
+ return ret;
+ }
+
+-int adis16060_spi_read(struct device *dev,
++static int adis16060_spi_read(struct device *dev,
+ u16 *val)
+ {
+ int ret;
+@@ -58,12 +56,15 @@
+
+ ret = spi_read(st->us_r, st->rx, 3);
+
+- /* The internal successive approximation ADC begins the conversion process
+- * on the falling edge of MSEL1 and starts to place data MSB first on the
+- * DOUT line at the 6th falling edge of SCLK
++ /* The internal successive approximation ADC begins the
++ * conversion process on the falling edge of MSEL1 and
++ * starts to place data MSB first on the DOUT line at
++ * the 6th falling edge of SCLK
+ */
+ if (ret == 0)
+- *val = ((st->rx[0] & 0x3) << 12) | (st->rx[1] << 4) | ((st->rx[2] >> 4) & 0xF);
++ *val = ((st->rx[0] & 0x3) << 12) |
++ (st->rx[1] << 4) |
++ ((st->rx[2] >> 4) & 0xF);
+ mutex_unlock(&st->buf_lock);
+
+ return ret;
+@@ -74,7 +75,7 @@
+ char *buf)
+ {
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+- u16 val;
++ u16 val = 0;
+ ssize_t ret;
+
+ /* Take the iio_dev status lock */
+@@ -174,45 +175,14 @@
+ st->indio_dev->driver_module = THIS_MODULE;
+ st->indio_dev->modes = INDIO_DIRECT_MODE;
+
+- ret = adis16060_configure_ring(st->indio_dev);
+- if (ret)
+- goto error_free_dev;
+-
+ ret = iio_device_register(st->indio_dev);
+ if (ret)
+- goto error_unreg_ring_funcs;
++ goto error_free_dev;
+ regdone = 1;
+
+- ret = adis16060_initialize_ring(st->indio_dev->ring);
+- if (ret) {
+- printk(KERN_ERR "failed to initialize the ring\n");
+- goto error_unreg_ring_funcs;
+- }
+-
+- if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
+- ret = iio_register_interrupt_line(spi->irq,
+- st->indio_dev,
+- 0,
+- IRQF_TRIGGER_RISING,
+- "adis16060");
+- if (ret)
+- goto error_uninitialize_ring;
+-
+- ret = adis16060_probe_trigger(st->indio_dev);
+- if (ret)
+- goto error_unregister_line;
+- }
+-
+ adis16060_st = st;
+ return 0;
+
+-error_unregister_line:
+- if (st->indio_dev->modes & INDIO_RING_TRIGGERED)
+- iio_unregister_interrupt_line(st->indio_dev, 0);
+-error_uninitialize_ring:
+- adis16060_uninitialize_ring(st->indio_dev->ring);
+-error_unreg_ring_funcs:
+- adis16060_unconfigure_ring(st->indio_dev);
+ error_free_dev:
+ if (regdone)
+ iio_device_unregister(st->indio_dev);
+@@ -236,12 +206,9 @@
+
+ flush_scheduled_work();
+
+- adis16060_remove_trigger(indio_dev);
+ if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
+ iio_unregister_interrupt_line(indio_dev, 0);
+
+- adis16060_uninitialize_ring(indio_dev->ring);
+- adis16060_unconfigure_ring(indio_dev);
+ iio_device_unregister(indio_dev);
+ kfree(st->tx);
+ kfree(st->rx);
+@@ -315,5 +282,5 @@
+ module_exit(adis16060_exit);
+
+ MODULE_AUTHOR("Barry Song <21...@gm...>");
+-MODULE_DESCRIPTION("Analog Devices ADIS16060 Yaw Rate Gyroscope with SPI driver");
++MODULE_DESCRIPTION("Analog Devices ADIS16060 Yaw Rate Gyroscope Driver");
+ MODULE_LICENSE("GPL v2");
+Index: linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16060.h
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/gyro/adis16060.h 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16060.h 2011-02-21 18:29:49.000000000 +0100
+@@ -14,11 +14,7 @@
+ /**
+ * struct adis16060_state - device instance specific data
+ * @us_w: actual spi_device to write data
+- * @work_trigger_to_ring: bh for triggered event handling
+- * @inter: used to check if new interrupt has been triggered
+- * @last_timestamp: passing timestamp from th to bh of interrupt handler
+ * @indio_dev: industrial I/O device structure
+- * @trig: data ready trigger registered with iio
+ * @tx: transmit buffer
+ * @rx: recieve buffer
+ * @buf_lock: mutex to protect tx and rx
+@@ -26,76 +22,10 @@
+ struct adis16060_state {
+ struct spi_device *us_w;
+ struct spi_device *us_r;
+- struct work_struct work_trigger_to_ring;
+- s64 last_timestamp;
+ struct iio_dev *indio_dev;
+- struct iio_trigger *trig;
+ u8 *tx;
+ u8 *rx;
+ struct mutex buf_lock;
+ };
+
+-#if defined(CONFIG_IIO_RING_BUFFER) && defined(THIS_HAS_RING_BUFFER_SUPPORT)
+-/* At the moment triggers are only used for ring buffer
+- * filling. This may change!
+- */
+-
+-enum adis16060_scan {
+- ADIS16060_SCAN_GYRO,
+- ADIS16060_SCAN_TEMP,
+- ADIS16060_SCAN_ADC_1,
+- ADIS16060_SCAN_ADC_2,
+-};
+-
+-void adis16060_remove_trigger(struct iio_dev *indio_dev);
+-int adis16060_probe_trigger(struct iio_dev *indio_dev);
+-
+-ssize_t adis16060_read_data_from_ring(struct device *dev,
+- struct device_attribute *attr,
+- char *buf);
+-
+-
+-int adis16060_configure_ring(struct iio_dev *indio_dev);
+-void adis16060_unconfigure_ring(struct iio_dev *indio_dev);
+-
+-int adis16060_initialize_ring(struct iio_ring_buffer *ring);
+-void adis16060_uninitialize_ring(struct iio_ring_buffer *ring);
+-#else /* CONFIG_IIO_RING_BUFFER */
+-
+-static inline void adis16060_remove_trigger(struct iio_dev *indio_dev)
+-{
+-}
+-
+-static inline int adis16060_probe_trigger(struct iio_dev *indio_dev)
+-{
+- return 0;
+-}
+-
+-static inline ssize_t
+-adis16060_read_data_from_ring(struct device *dev,
+- struct device_attribute *attr,
+- char *buf)
+-{
+- return 0;
+-}
+-
+-static int adis16060_configure_ring(struct iio_dev *indio_dev)
+-{
+- return 0;
+-}
+-
+-static inline void adis16060_unconfigure_ring(struct iio_dev *indio_dev)
+-{
+-}
+-
+-static inline int adis16060_initialize_ring(struct iio_ring_buffer *ring)
+-{
+- return 0;
+-}
+-
+-static inline void adis16060_uninitialize_ring(struct iio_ring_buffer *ring)
+-{
+-}
+-
+-#endif /* CONFIG_IIO_RING_BUFFER */
+ #endif /* SPI_ADIS16060_H_ */
+Index: linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16080_core.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/gyro/adis16080_core.c 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16080_core.c 2011-02-21 18:29:49.000000000 +0100
+@@ -25,11 +25,7 @@
+
+ #include "adis16080.h"
+
+-#define DRIVER_NAME "adis16080"
+-
+-struct adis16080_state *adis16080_st;
+-
+-int adis16080_spi_write(struct device *dev,
++static int adis16080_spi_write(struct device *dev,
+ u16 val)
+ {
+ int ret;
+@@ -46,7 +42,7 @@
+ return ret;
+ }
+
+-int adis16080_spi_read(struct device *dev,
++static int adis16080_spi_read(struct device *dev,
+ u16 *val)
+ {
+ int ret;
+@@ -69,7 +65,7 @@
+ char *buf)
+ {
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+- u16 val;
++ u16 val = 0;
+ ssize_t ret;
+
+ /* Take the iio_dev status lock */
+@@ -169,45 +165,13 @@
+ st->indio_dev->driver_module = THIS_MODULE;
+ st->indio_dev->modes = INDIO_DIRECT_MODE;
+
+- ret = adis16080_configure_ring(st->indio_dev);
+- if (ret)
+- goto error_free_dev;
+-
+ ret = iio_device_register(st->indio_dev);
+ if (ret)
+- goto error_unreg_ring_funcs;
++ goto error_free_dev;
+ regdone = 1;
+
+- ret = adis16080_initialize_ring(st->indio_dev->ring);
+- if (ret) {
+- printk(KERN_ERR "failed to initialize the ring\n");
+- goto error_unreg_ring_funcs;
+- }
+-
+- if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
+- ret = iio_register_interrupt_line(spi->irq,
+- st->indio_dev,
+- 0,
+- IRQF_TRIGGER_RISING,
+- "adis16080");
+- if (ret)
+- goto error_uninitialize_ring;
+-
+- ret = adis16080_probe_trigger(st->indio_dev);
+- if (ret)
+- goto error_unregister_line;
+- }
+-
+- adis16080_st = st;
+ return 0;
+
+-error_unregister_line:
+- if (st->indio_dev->modes & INDIO_RING_TRIGGERED)
+- iio_unregister_interrupt_line(st->indio_dev, 0);
+-error_uninitialize_ring:
+- adis16080_uninitialize_ring(st->indio_dev->ring);
+-error_unreg_ring_funcs:
+- adis16080_unconfigure_ring(st->indio_dev);
+ error_free_dev:
+ if (regdone)
+ iio_device_unregister(st->indio_dev);
+@@ -229,14 +193,6 @@
+ struct adis16080_state *st = spi_get_drvdata(spi);
+ struct iio_dev *indio_dev = st->indio_dev;
+
+- flush_scheduled_work();
+-
+- adis16080_remove_trigger(indio_dev);
+- if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
+- iio_unregister_interrupt_line(indio_dev, 0);
+-
+- adis16080_uninitialize_ring(indio_dev->ring);
+- adis16080_unconfigure_ring(indio_dev);
+ iio_device_unregister(indio_dev);
+ kfree(st->tx);
+ kfree(st->rx);
+@@ -267,5 +223,5 @@
+ module_exit(adis16080_exit);
+
+ MODULE_AUTHOR("Barry Song <21...@gm...>");
+-MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope with SPI driver");
++MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope Driver");
+ MODULE_LICENSE("GPL v2");
+Index: linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16080.h
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/staging/iio/gyro/adis16080.h 2011-02-01 04:05:49.000000000 +0100
++++ linux-2.6.38-rc3/drivers/staging/iio/gyro/adis16080.h 2011-02-21 18:29:49.000000000 +0100
+@@ -1,14 +1,19 @@
+ #ifndef SPI_ADIS16080_H_
+ #define SPI_ADIS16080_H_
+
+-#define ADIS16080_DIN_CODE 4 /* Output data format setting. 0: Twos complement. 1: Offset binary. */
++/* Output data format setting. 0: Twos complement. 1: Offset binary. */
++#define ADIS16080_DIN_CODE 4
+ #define ADIS16080_DIN_GYRO (0 << 10) /* Gyroscope output */
+ #define ADIS16080_DIN_TEMP (1 << 10) /* Temperature output */
+ #define ADIS16080_DIN_AIN1 (2 << 10)
+ #define ADIS16080_DIN_AIN2 (3 << 10)
+-#define ADIS16080_DIN_WRITE (1 << 15) /* 1: Write contents on DIN to con...
[truncated message content] |
|
From: jscheer <js...@us...> - 2011-02-21 17:11:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 2157ffdab3d52df1d9be6d3eb76839316f0d24d8 (commit)
from 97b1b34049e90c70b036a2347cea78c466400c78 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2157ffdab3d52df1d9be6d3eb76839316f0d24d8
Author: Jeremie Scheer <jer...@ar...>
Date: Mon Feb 21 18:10:58 2011 +0100
[BUILDROOT] Add package TFP410CTRL setting (not set) in PPS' Buildroot configs.
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/pps_defconfig | 4 +++-
buildroot/target/device/armadeus/pps/pps_defconfig | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/buildroot/configs/pps_defconfig b/buildroot/configs/pps_defconfig
index a7851be..4eff67c 100644
--- a/buildroot/configs/pps_defconfig
+++ b/buildroot/configs/pps_defconfig
@@ -1,6 +1,7 @@
#
# Automatically generated make config: don't edit
-# Mon Nov 1 17:03:11 2010
+# Buildroot version: 2010.11-00354-g97b1b34-dirty
+# Mon Feb 21 17:54:45 2011
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="2010.11-git"
@@ -264,6 +265,7 @@ BR2_PACKAGE_MAX5821CTRL=y
BR2_PACKAGE_ARMADEUS_PPS_UTILITIES=y
BR2_PACKAGE_ARMADEUS_PPS_TEST_SCRIPTS=y
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+# BR2_PACKAGE_TFP410CTRL is not set
#
# Audio and video libraries and applications
diff --git a/buildroot/target/device/armadeus/pps/pps_defconfig b/buildroot/target/device/armadeus/pps/pps_defconfig
index b4859f6..cb8ed74 100644
--- a/buildroot/target/device/armadeus/pps/pps_defconfig
+++ b/buildroot/target/device/armadeus/pps/pps_defconfig
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Tue Jan 18 14:24:53 2011
+# Mon Feb 21 18:06:25 2011
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="0.10.0-svn"
@@ -372,6 +372,7 @@ BR2_PACKAGE_MAX5821CTRL=y
BR2_PACKAGE_ARMADEUS_PPS_UTILITIES=y
BR2_PACKAGE_ARMADEUS_PPS_TEST_SCRIPTS=y
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+# BR2_PACKAGE_TFP410CTRL is not set
# BR2_DATABASE_SUPPORT is not set
BR2_TEXTEDIT_SUPPORT=y
# BR2_PACKAGE_ED is not set
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-02-21 16:41:56
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 97b1b34049e90c70b036a2347cea78c466400c78 (commit)
from a5b466c72a2bccbb73b32c06414d894d680f15c3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 97b1b34049e90c70b036a2347cea78c466400c78
Author: Jeremie Scheer <jer...@ar...>
Date: Mon Feb 21 17:41:34 2011 +0100
[LINUX] Add renamed patch 365-pps-armadeus-add_pps_baseboard.patch.
-----------------------------------------------------------------------
Summary of changes:
.../365-pps-armadeus-add_pps_baseboard.patch | 369 ++++++++++++++++++++
1 files changed, 369 insertions(+), 0 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/365-pps-armadeus-add_pps_baseboard.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/365-pps-armadeus-add_pps_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/365-pps-armadeus-add_pps_baseboard.patch
new file mode 100644
index 0000000..525edd1
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/365-pps-armadeus-add_pps_baseboard.patch
@@ -0,0 +1,369 @@
+
+Adds support for APF27's PPS baseboard.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-2.6.29.6/arch/arm/mach-mx2/pps.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/arch/arm/mach-mx2/pps.c 2010-10-28 15:25:13.000000000 +0200
+@@ -0,0 +1,329 @@
++ /*
++ * pps.c
++ * Support of PPS baseboard
++ *
++ * Copyright (C) 2009 Armadeus Systems
++ * Authors: Julien Boibessot <jul...@ar...>
++ * Nicolas Colombain <nic...@ar...>
++ * Fabien Marteau <fab...@ar...>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/i2c.h>
++#include <linux/serial.h>
++#include <linux/delay.h>
++#include <linux/irq.h>
++#include <linux/clk.h>
++#include <linux/dma-mapping.h>
++#include <asm/io.h>
++#include <asm/mach/arch.h>
++#include <asm/mach-types.h>
++#include <asm/mach/time.h>
++#include <mach/common.h>
++#include <mach/hardware.h>
++#include <mach/iomux-mx1-mx2.h>
++#include <mach/gpio.h>
++#include <mach/imx_i2c.h>
++#include <../mach-imx/include/mach/spi_imx.h>
++#include <mach/imx-uart.h>
++#include <mach/board-apf27.h>
++#include <asm/mach/map.h>
++#include <mach/mxc_nand.h>
++#include <mach/mxc_ehci.h>
++#include <mach/ulpi.h>
++#include <mach/mmc.h>
++
++#include "devices.h"
++#include "crm_regs.h"
++
++/*********/
++/* Wi2Wi */
++/*********/
++
++#define BT_RESETn (GPIO_PORTE | 11) /* UART3_RTS */
++#define WIFI_PWRDNn (GPIO_PORTE | 10) /* UART3_CTS */
++
++static int bt_wifi_pins[] = {
++ (BT_RESETn | GPIO_OUT | GPIO_GPIO),
++ (WIFI_PWRDNn | GPIO_OUT | GPIO_GPIO),
++};
++
++/* SDHC2 is used for WiFi */
++static int mxc_sdhc2_pins[] = {
++ PB4_PF_SDHC2_D0,
++ PB5_PF_SDHC2_D1,
++ PB6_PF_SDHC2_D2,
++ PB7_PF_SDHC2_D3,
++ PB8_PF_SDHC2_CMD,
++ PB9_PF_SDHC2_CLK,
++};
++
++static int sdhc2_init(struct device *dev, irq_handler_t handler, void *data)
++{
++ return mxc_gpio_setup_multiple_pins(mxc_sdhc2_pins,
++ ARRAY_SIZE(mxc_sdhc2_pins),
++ "SDHC2");
++}
++
++static void sdhc2_exit(struct device *pdev, void *data)
++{
++ mxc_gpio_release_multiple_pins(mxc_sdhc2_pins, ARRAY_SIZE(mxc_sdhc2_pins));
++}
++
++static struct imxmmc_platform_data sdhc2_pdata = {
++ .init = sdhc2_init,
++ .exit = sdhc2_exit,
++};
++
++static int bt_wifi_init(void)
++{
++ int res=0;
++
++ res = mxc_gpio_setup_multiple_pins(bt_wifi_pins,
++ ARRAY_SIZE(bt_wifi_pins), "BT_WIFI");
++ if(!res){
++ mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
++ gpio_set_value(WIFI_PWRDNn, 1); /* WiFi on */
++ gpio_set_value(BT_RESETn, 1); /* Bluetooth on */
++ }
++
++ mxc_gpio_release_multiple_pins(bt_wifi_pins, ARRAY_SIZE(bt_wifi_pins));
++
++ return res;
++}
++
++/***********/
++/* USBH1 */
++/***********/
++
++/* Adds an USB PHY ISP1105 on i.MX27 USB_HOST port 2 (pps schematic page 2) */
++static int mxc_usbh1_pins[] = {
++ PB22_PF_USBH1_SUSP,
++ PB23_PF_USB_PWR,
++ PB24_PF_USB_OC_B,
++ PB25_PF_USBH1_RCV,
++ PB26_PF_USBH1_FS,
++ PB27_PF_USBH1_OE_B,
++ PB28_PF_USBH1_TXDM,
++ PB29_PF_USBH1_TXDP,
++ PB30_PF_USBH1_RXDM,
++ PB31_PF_USBH1_RXDP
++};
++
++static int apf27_usbh1_init(struct platform_device *pdev)
++{
++ int ret;
++ uint32_t temp;
++
++ ret = mxc_gpio_setup_multiple_pins(mxc_usbh1_pins,
++ ARRAY_SIZE(mxc_usbh1_pins), "usbh1");
++ if (ret)
++ return ret;
++
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
++ pr_debug("USB_CTRL before: 0x%08x\n", temp);
++ temp &= ~( (3 << 13) | (1 << 8) | 1 );
++ temp |= (1 << 4) | (1 << 11) ;
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
++ pr_debug("USB_CTRL after: 0x%08x\n", temp);
++
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x384);
++ pr_debug("PORTSC1 before: 0x%08x\n", temp);
++ temp &= ~(3 << 30);
++ temp |= 3 << 30;
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x384);
++ pr_debug("PORTSC1 after: 0x%08x\n", temp);
++ mdelay(10);
++
++ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x340);
++ temp |= 0x02; /* reset controller */
++ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x340);
++ pr_debug("reset controller: 0x%08x\n", temp);
++ mdelay(10);
++
++ return ret;
++}
++
++struct mxc_usb2_platform_data ehci1_pdata = {
++ .init = apf27_usbh1_init,
++};
++
++/***********/
++/* USBH2 */
++/***********/
++/* define USB registers XXX */
++#define USB_CTRL (IO_ADDRESS(OTG_BASE_ADDR) + 0x600)
++#define UOG_PORTSC1 (IO_ADDRESS(OTG_BASE_ADDR) + 0x184)
++#define UOG_USBCMD (IO_ADDRESS(OTG_BASE_ADDR) + 0x140)
++#define UOG_ULPIVIEW (IO_ADDRESS(OTG_BASE_ADDR) + 0x170)
++#define UH2_PORTSC1 (IO_ADDRESS(OTG_BASE_ADDR) + 0x584)
++#define UH2_USBCMD (IO_ADDRESS(OTG_BASE_ADDR) + 0x540)
++#define UH2_ULPIVIEW (IO_ADDRESS(OTG_BASE_ADDR) + 0x570)
++
++#define USBH2_RST_n_GPIO (GPIO_PORTB | 10)
++#define USBH2_RST_n (USBH2_RST_n_GPIO | GPIO_GPIO | GPIO_OUT)
++
++static int mxc_usbh2_reset_pin[] = {
++ USBH2_RST_n,
++};
++
++/* CONFIG EHCI2 USBH2 */
++static int mxc_usbh2_pins[] = {
++ PA0_PF_USBH2_CLK,
++ PA1_PF_USBH2_DIR,
++ PA3_PF_USBH2_NXT,
++ PA4_PF_USBH2_STP,
++ PD22_AF_USBH2_DATA0,
++ PD24_AF_USBH2_DATA1,
++ PD23_AF_USBH2_DATA2,
++ PD20_AF_USBH2_DATA3,
++ PD19_AF_USBH2_DATA4,
++ PD26_AF_USBH2_DATA5,
++ PD21_AF_USBH2_DATA6,
++ PA2_PF_USBH2_DATA7,
++
++};
++
++static int usb3315_set_vbus_power(void __iomem *view, int on)
++{
++ int vid, pid, ret = 0;
++
++ vid = (ulpi_read(USB3315_VID_HIGH, view) << 8) |
++ ulpi_read(USB3315_VID_LOW, view);
++ pid = (ulpi_read(USB3315_PID_HIGH, view) << 8) |
++ ulpi_read(USB3315_PID_LOW, view);
++
++ pr_info("ULPI h2 Vendor ID 0x%x Product ID 0x%x\n", vid, pid);
++ if (vid != 0x424 || pid != 0x6) { //XXX
++ pr_err("No USB3315 found\n");
++ return -1;
++ }
++
++ if (on) {
++ /* force disconnection of the DM/DP signals. This
++ avoid powering the connected device through these lines */
++ ulpi_set(RESET, USB3315_FCNCTL, view);
++ mdelay(10); /*wait until the supply is really down*/
++ ulpi_clear(RESET, USB3315_FCNCTL, view);
++ mdelay(1);
++
++ ret = ulpi_set(DRV_VBUS_EXT | /* enable external Vbus */
++ DRV_VBUS | /* enable internal Vbus */
++ USE_EXT_VBUS_IND | /* use external indicator */
++ CHRG_VBUS, /* charge Vbus */
++ USB3315_OTGCTL, view);
++ } else {
++ ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */
++ DRV_VBUS, /* disable internal Vbus */
++ USB3315_OTGCTL, view);
++
++ ret |= ulpi_set(USE_EXT_VBUS_IND | /* use external indicator */
++ DISCHRG_VBUS, /* discharge Vbus */
++ USB3315_OTGCTL, view);
++ }
++
++ return ret;
++}
++
++static void usb3315_suspend(void __iomem *view)
++{
++ /* usb3315_set_vbus_power(view, 0); needed ? */
++ ulpi_clear(SUSPENDM, USB3315_FCNCTL, view);
++}
++
++static int apf27_usbh2_init(struct platform_device *pdev)
++{
++ int ret;
++ uint32_t temp;
++
++ gpio_set_value(USBH2_RST_n_GPIO, 1); /* reset off */
++
++ ret = mxc_gpio_setup_multiple_pins(mxc_usbh2_reset_pin,
++ ARRAY_SIZE(mxc_usbh2_reset_pin), "USBH2_RESET");
++
++ ret = mxc_gpio_setup_multiple_pins(mxc_usbh2_pins,
++ ARRAY_SIZE(mxc_usbh2_pins), "USBH2");
++ if (ret)
++ return ret;
++
++ temp = readl(USB_CTRL);
++
++ pr_debug("USB_CTRL before: 0x%08x\n", temp);
++ /* H2SIC = 3 */
++ temp &= ~( (3 << 21) | 1 );
++ /* H2PM=1, H2WIE=1, H2UIE=1 */
++ temp |= (1 << 16) | (1 << 19) | (1 << 20);
++ writel(temp, USB_CTRL);
++ pr_debug("USB_CTRL after: 0x%08x\n", temp);
++
++ temp = readl(UH2_PORTSC1);
++ pr_debug("PORTSC1 before: 0x%08x\n", temp);
++ /* XXX: ? */
++ temp &= ~(3 << 30);
++ temp |= 2 << 30;
++ writel(temp, UH2_PORTSC1);
++ pr_debug("PORTSC1 after: 0x%08x\n", temp);
++
++ mdelay(10);
++
++ temp = readl(UH2_USBCMD);
++ temp |= 0x02; /* reset controller */
++ writel(temp, UH2_USBCMD);
++ pr_debug("reset controller: 0x%08x\n", temp);
++ mdelay(50);
++
++ if (ret)
++ mxc_gpio_release_multiple_pins(mxc_usbh2_pins,
++ ARRAY_SIZE(mxc_usbh2_pins));
++
++ ret = usb3315_set_vbus_power(
++ (void __iomem *)UH2_ULPIVIEW, 1);
++
++ return ret;
++}
++
++struct mxc_usb2_platform_data ehci2_pdata = {
++ .init = apf27_usbh2_init,
++};
++
++/******************/
++/* Baseboard init */
++/******************/
++void apf27_baseboard_resume(void)
++{
++ /* TO BE DONE */
++}
++
++void apf27_baseboard_suspend(void)
++{
++ /* TO BE DONE */
++}
++
++void __init apf27_baseboard_init(void)
++{
++ printk("\n** Registering PPS ressources: **\n");
++
++ /* Init USB */
++ mxc_register_device(&mxc_ehci1, &ehci1_pdata);
++ mxc_register_device(&mxc_ehci2, &ehci2_pdata);
++
++ /* init Wi2Wi */
++ bt_wifi_init();
++
++ printk("done\n");
++}
++
+Index: linux-2.6.29.6/arch/arm/mach-mx2/Kconfig
+===================================================================
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/Kconfig 2010-10-28 15:15:50.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/Kconfig 2010-10-28 15:15:53.000000000 +0200
+@@ -63,6 +63,13 @@
+ activates the devices you want to use if you have the "Full"
+ version.
+
++config MACH_PPS
++ prompt "Armadeus Systems APF27 PPS Secured Gateway"
++ bool
++ depends on MACH_APF27
++ help
++ This selects the APF27 PPS as baseboard.
++
+ endchoice
+
+ config MACH_APF27_DEV_EXT
+Index: linux-2.6.29.6/arch/arm/mach-mx2/Makefile
+===================================================================
+--- linux-2.6.29.6.orig/arch/arm/mach-mx2/Makefile 2010-10-28 15:15:51.000000000 +0200
++++ linux-2.6.29.6/arch/arm/mach-mx2/Makefile 2010-10-28 15:15:53.000000000 +0200
+@@ -15,6 +15,7 @@
+ obj-$(CONFIG_MACH_APF27_DEV) += apf27-dev.o
+ obj-$(CONFIG_MACH_APF27_DEV) += apf27-lcd.o
+ obj-$(CONFIG_MACH_APF27_DEV_EXT_WIRELESS) += apf27-dev-ext-apw.o
++obj-$(CONFIG_MACH_PPS) += pps.o
+ obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
+ obj-$(CONFIG_MACH_PCM038) += pcm038.o
+ obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
hooks/post-receive
--
armadeus
|
|
From: jscheer <js...@us...> - 2011-02-21 16:38:06
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via a5b466c72a2bccbb73b32c06414d894d680f15c3 (commit)
from 634a454c36fd16a4a3d2f016697fc8f7ed048ef7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a5b466c72a2bccbb73b32c06414d894d680f15c3
Author: Jeremie Scheer <jer...@ar...>
Date: Mon Feb 21 17:37:31 2011 +0100
[LINUX] Change number of patch 500-pps-armadeus-add_pps_baseboard.patch to 365.
-----------------------------------------------------------------------
Summary of changes:
.../500-pps-armadeus-add_pps_baseboard.patch | 369 --------------------
1 files changed, 0 insertions(+), 369 deletions(-)
delete mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/500-pps-armadeus-add_pps_baseboard.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/500-pps-armadeus-add_pps_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/500-pps-armadeus-add_pps_baseboard.patch
deleted file mode 100644
index 525edd1..0000000
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/500-pps-armadeus-add_pps_baseboard.patch
+++ /dev/null
@@ -1,369 +0,0 @@
-
-Adds support for APF27's PPS baseboard.
-
-Signed-off-by: Julien Boibessot <jul...@ar...>
-
-Index: linux-2.6.29.6/arch/arm/mach-mx2/pps.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/arch/arm/mach-mx2/pps.c 2010-10-28 15:25:13.000000000 +0200
-@@ -0,0 +1,329 @@
-+ /*
-+ * pps.c
-+ * Support of PPS baseboard
-+ *
-+ * Copyright (C) 2009 Armadeus Systems
-+ * Authors: Julien Boibessot <jul...@ar...>
-+ * Nicolas Colombain <nic...@ar...>
-+ * Fabien Marteau <fab...@ar...>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2
-+ * of the License, or (at your option) any later version.
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-+ */
-+
-+#include <linux/platform_device.h>
-+#include <linux/spi/spi.h>
-+#include <linux/i2c.h>
-+#include <linux/serial.h>
-+#include <linux/delay.h>
-+#include <linux/irq.h>
-+#include <linux/clk.h>
-+#include <linux/dma-mapping.h>
-+#include <asm/io.h>
-+#include <asm/mach/arch.h>
-+#include <asm/mach-types.h>
-+#include <asm/mach/time.h>
-+#include <mach/common.h>
-+#include <mach/hardware.h>
-+#include <mach/iomux-mx1-mx2.h>
-+#include <mach/gpio.h>
-+#include <mach/imx_i2c.h>
-+#include <../mach-imx/include/mach/spi_imx.h>
-+#include <mach/imx-uart.h>
-+#include <mach/board-apf27.h>
-+#include <asm/mach/map.h>
-+#include <mach/mxc_nand.h>
-+#include <mach/mxc_ehci.h>
-+#include <mach/ulpi.h>
-+#include <mach/mmc.h>
-+
-+#include "devices.h"
-+#include "crm_regs.h"
-+
-+/*********/
-+/* Wi2Wi */
-+/*********/
-+
-+#define BT_RESETn (GPIO_PORTE | 11) /* UART3_RTS */
-+#define WIFI_PWRDNn (GPIO_PORTE | 10) /* UART3_CTS */
-+
-+static int bt_wifi_pins[] = {
-+ (BT_RESETn | GPIO_OUT | GPIO_GPIO),
-+ (WIFI_PWRDNn | GPIO_OUT | GPIO_GPIO),
-+};
-+
-+/* SDHC2 is used for WiFi */
-+static int mxc_sdhc2_pins[] = {
-+ PB4_PF_SDHC2_D0,
-+ PB5_PF_SDHC2_D1,
-+ PB6_PF_SDHC2_D2,
-+ PB7_PF_SDHC2_D3,
-+ PB8_PF_SDHC2_CMD,
-+ PB9_PF_SDHC2_CLK,
-+};
-+
-+static int sdhc2_init(struct device *dev, irq_handler_t handler, void *data)
-+{
-+ return mxc_gpio_setup_multiple_pins(mxc_sdhc2_pins,
-+ ARRAY_SIZE(mxc_sdhc2_pins),
-+ "SDHC2");
-+}
-+
-+static void sdhc2_exit(struct device *pdev, void *data)
-+{
-+ mxc_gpio_release_multiple_pins(mxc_sdhc2_pins, ARRAY_SIZE(mxc_sdhc2_pins));
-+}
-+
-+static struct imxmmc_platform_data sdhc2_pdata = {
-+ .init = sdhc2_init,
-+ .exit = sdhc2_exit,
-+};
-+
-+static int bt_wifi_init(void)
-+{
-+ int res=0;
-+
-+ res = mxc_gpio_setup_multiple_pins(bt_wifi_pins,
-+ ARRAY_SIZE(bt_wifi_pins), "BT_WIFI");
-+ if(!res){
-+ mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata);
-+ gpio_set_value(WIFI_PWRDNn, 1); /* WiFi on */
-+ gpio_set_value(BT_RESETn, 1); /* Bluetooth on */
-+ }
-+
-+ mxc_gpio_release_multiple_pins(bt_wifi_pins, ARRAY_SIZE(bt_wifi_pins));
-+
-+ return res;
-+}
-+
-+/***********/
-+/* USBH1 */
-+/***********/
-+
-+/* Adds an USB PHY ISP1105 on i.MX27 USB_HOST port 2 (pps schematic page 2) */
-+static int mxc_usbh1_pins[] = {
-+ PB22_PF_USBH1_SUSP,
-+ PB23_PF_USB_PWR,
-+ PB24_PF_USB_OC_B,
-+ PB25_PF_USBH1_RCV,
-+ PB26_PF_USBH1_FS,
-+ PB27_PF_USBH1_OE_B,
-+ PB28_PF_USBH1_TXDM,
-+ PB29_PF_USBH1_TXDP,
-+ PB30_PF_USBH1_RXDM,
-+ PB31_PF_USBH1_RXDP
-+};
-+
-+static int apf27_usbh1_init(struct platform_device *pdev)
-+{
-+ int ret;
-+ uint32_t temp;
-+
-+ ret = mxc_gpio_setup_multiple_pins(mxc_usbh1_pins,
-+ ARRAY_SIZE(mxc_usbh1_pins), "usbh1");
-+ if (ret)
-+ return ret;
-+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ pr_debug("USB_CTRL before: 0x%08x\n", temp);
-+ temp &= ~( (3 << 13) | (1 << 8) | 1 );
-+ temp |= (1 << 4) | (1 << 11) ;
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x600);
-+ pr_debug("USB_CTRL after: 0x%08x\n", temp);
-+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x384);
-+ pr_debug("PORTSC1 before: 0x%08x\n", temp);
-+ temp &= ~(3 << 30);
-+ temp |= 3 << 30;
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x384);
-+ pr_debug("PORTSC1 after: 0x%08x\n", temp);
-+ mdelay(10);
-+
-+ temp = readl(IO_ADDRESS(OTG_BASE_ADDR) + 0x340);
-+ temp |= 0x02; /* reset controller */
-+ writel(temp, IO_ADDRESS(OTG_BASE_ADDR) + 0x340);
-+ pr_debug("reset controller: 0x%08x\n", temp);
-+ mdelay(10);
-+
-+ return ret;
-+}
-+
-+struct mxc_usb2_platform_data ehci1_pdata = {
-+ .init = apf27_usbh1_init,
-+};
-+
-+/***********/
-+/* USBH2 */
-+/***********/
-+/* define USB registers XXX */
-+#define USB_CTRL (IO_ADDRESS(OTG_BASE_ADDR) + 0x600)
-+#define UOG_PORTSC1 (IO_ADDRESS(OTG_BASE_ADDR) + 0x184)
-+#define UOG_USBCMD (IO_ADDRESS(OTG_BASE_ADDR) + 0x140)
-+#define UOG_ULPIVIEW (IO_ADDRESS(OTG_BASE_ADDR) + 0x170)
-+#define UH2_PORTSC1 (IO_ADDRESS(OTG_BASE_ADDR) + 0x584)
-+#define UH2_USBCMD (IO_ADDRESS(OTG_BASE_ADDR) + 0x540)
-+#define UH2_ULPIVIEW (IO_ADDRESS(OTG_BASE_ADDR) + 0x570)
-+
-+#define USBH2_RST_n_GPIO (GPIO_PORTB | 10)
-+#define USBH2_RST_n (USBH2_RST_n_GPIO | GPIO_GPIO | GPIO_OUT)
-+
-+static int mxc_usbh2_reset_pin[] = {
-+ USBH2_RST_n,
-+};
-+
-+/* CONFIG EHCI2 USBH2 */
-+static int mxc_usbh2_pins[] = {
-+ PA0_PF_USBH2_CLK,
-+ PA1_PF_USBH2_DIR,
-+ PA3_PF_USBH2_NXT,
-+ PA4_PF_USBH2_STP,
-+ PD22_AF_USBH2_DATA0,
-+ PD24_AF_USBH2_DATA1,
-+ PD23_AF_USBH2_DATA2,
-+ PD20_AF_USBH2_DATA3,
-+ PD19_AF_USBH2_DATA4,
-+ PD26_AF_USBH2_DATA5,
-+ PD21_AF_USBH2_DATA6,
-+ PA2_PF_USBH2_DATA7,
-+
-+};
-+
-+static int usb3315_set_vbus_power(void __iomem *view, int on)
-+{
-+ int vid, pid, ret = 0;
-+
-+ vid = (ulpi_read(USB3315_VID_HIGH, view) << 8) |
-+ ulpi_read(USB3315_VID_LOW, view);
-+ pid = (ulpi_read(USB3315_PID_HIGH, view) << 8) |
-+ ulpi_read(USB3315_PID_LOW, view);
-+
-+ pr_info("ULPI h2 Vendor ID 0x%x Product ID 0x%x\n", vid, pid);
-+ if (vid != 0x424 || pid != 0x6) { //XXX
-+ pr_err("No USB3315 found\n");
-+ return -1;
-+ }
-+
-+ if (on) {
-+ /* force disconnection of the DM/DP signals. This
-+ avoid powering the connected device through these lines */
-+ ulpi_set(RESET, USB3315_FCNCTL, view);
-+ mdelay(10); /*wait until the supply is really down*/
-+ ulpi_clear(RESET, USB3315_FCNCTL, view);
-+ mdelay(1);
-+
-+ ret = ulpi_set(DRV_VBUS_EXT | /* enable external Vbus */
-+ DRV_VBUS | /* enable internal Vbus */
-+ USE_EXT_VBUS_IND | /* use external indicator */
-+ CHRG_VBUS, /* charge Vbus */
-+ USB3315_OTGCTL, view);
-+ } else {
-+ ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */
-+ DRV_VBUS, /* disable internal Vbus */
-+ USB3315_OTGCTL, view);
-+
-+ ret |= ulpi_set(USE_EXT_VBUS_IND | /* use external indicator */
-+ DISCHRG_VBUS, /* discharge Vbus */
-+ USB3315_OTGCTL, view);
-+ }
-+
-+ return ret;
-+}
-+
-+static void usb3315_suspend(void __iomem *view)
-+{
-+ /* usb3315_set_vbus_power(view, 0); needed ? */
-+ ulpi_clear(SUSPENDM, USB3315_FCNCTL, view);
-+}
-+
-+static int apf27_usbh2_init(struct platform_device *pdev)
-+{
-+ int ret;
-+ uint32_t temp;
-+
-+ gpio_set_value(USBH2_RST_n_GPIO, 1); /* reset off */
-+
-+ ret = mxc_gpio_setup_multiple_pins(mxc_usbh2_reset_pin,
-+ ARRAY_SIZE(mxc_usbh2_reset_pin), "USBH2_RESET");
-+
-+ ret = mxc_gpio_setup_multiple_pins(mxc_usbh2_pins,
-+ ARRAY_SIZE(mxc_usbh2_pins), "USBH2");
-+ if (ret)
-+ return ret;
-+
-+ temp = readl(USB_CTRL);
-+
-+ pr_debug("USB_CTRL before: 0x%08x\n", temp);
-+ /* H2SIC = 3 */
-+ temp &= ~( (3 << 21) | 1 );
-+ /* H2PM=1, H2WIE=1, H2UIE=1 */
-+ temp |= (1 << 16) | (1 << 19) | (1 << 20);
-+ writel(temp, USB_CTRL);
-+ pr_debug("USB_CTRL after: 0x%08x\n", temp);
-+
-+ temp = readl(UH2_PORTSC1);
-+ pr_debug("PORTSC1 before: 0x%08x\n", temp);
-+ /* XXX: ? */
-+ temp &= ~(3 << 30);
-+ temp |= 2 << 30;
-+ writel(temp, UH2_PORTSC1);
-+ pr_debug("PORTSC1 after: 0x%08x\n", temp);
-+
-+ mdelay(10);
-+
-+ temp = readl(UH2_USBCMD);
-+ temp |= 0x02; /* reset controller */
-+ writel(temp, UH2_USBCMD);
-+ pr_debug("reset controller: 0x%08x\n", temp);
-+ mdelay(50);
-+
-+ if (ret)
-+ mxc_gpio_release_multiple_pins(mxc_usbh2_pins,
-+ ARRAY_SIZE(mxc_usbh2_pins));
-+
-+ ret = usb3315_set_vbus_power(
-+ (void __iomem *)UH2_ULPIVIEW, 1);
-+
-+ return ret;
-+}
-+
-+struct mxc_usb2_platform_data ehci2_pdata = {
-+ .init = apf27_usbh2_init,
-+};
-+
-+/******************/
-+/* Baseboard init */
-+/******************/
-+void apf27_baseboard_resume(void)
-+{
-+ /* TO BE DONE */
-+}
-+
-+void apf27_baseboard_suspend(void)
-+{
-+ /* TO BE DONE */
-+}
-+
-+void __init apf27_baseboard_init(void)
-+{
-+ printk("\n** Registering PPS ressources: **\n");
-+
-+ /* Init USB */
-+ mxc_register_device(&mxc_ehci1, &ehci1_pdata);
-+ mxc_register_device(&mxc_ehci2, &ehci2_pdata);
-+
-+ /* init Wi2Wi */
-+ bt_wifi_init();
-+
-+ printk("done\n");
-+}
-+
-Index: linux-2.6.29.6/arch/arm/mach-mx2/Kconfig
-===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/Kconfig 2010-10-28 15:15:50.000000000 +0200
-+++ linux-2.6.29.6/arch/arm/mach-mx2/Kconfig 2010-10-28 15:15:53.000000000 +0200
-@@ -63,6 +63,13 @@
- activates the devices you want to use if you have the "Full"
- version.
-
-+config MACH_PPS
-+ prompt "Armadeus Systems APF27 PPS Secured Gateway"
-+ bool
-+ depends on MACH_APF27
-+ help
-+ This selects the APF27 PPS as baseboard.
-+
- endchoice
-
- config MACH_APF27_DEV_EXT
-Index: linux-2.6.29.6/arch/arm/mach-mx2/Makefile
-===================================================================
---- linux-2.6.29.6.orig/arch/arm/mach-mx2/Makefile 2010-10-28 15:15:51.000000000 +0200
-+++ linux-2.6.29.6/arch/arm/mach-mx2/Makefile 2010-10-28 15:15:53.000000000 +0200
-@@ -15,6 +15,7 @@
- obj-$(CONFIG_MACH_APF27_DEV) += apf27-dev.o
- obj-$(CONFIG_MACH_APF27_DEV) += apf27-lcd.o
- obj-$(CONFIG_MACH_APF27_DEV_EXT_WIRELESS) += apf27-dev-ext-apw.o
-+obj-$(CONFIG_MACH_PPS) += pps.o
- obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o
- obj-$(CONFIG_MACH_PCM038) += pcm038.o
- obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-21 15:46:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 634a454c36fd16a4a3d2f016697fc8f7ed048ef7 (commit)
via ef1c781d21d84b267e245fa533dea4bc83ce9039 (commit)
via 4e30cc713952955e1ff49bb9b5064a4187fae23e (commit)
via 1550b94546abe3e756e42e7b6924c6d117f09c73 (commit)
via 165a6db56763840b3c6f339f983dbce57b053823 (commit)
via a368f490253739fdf3427a87fc118574a777ed20 (commit)
via 9c9879199fe6cde9e5c5b6b91996716924396793 (commit)
via 8ad5d5bcb61624c6457fa2ef247a829ea95e0d2c (commit)
via a6ee47b3814dcdb437f34d498c988b0d4507ead1 (commit)
from 6b83bc2d5d5ccbf47be5c1b169404497f53f3bbe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 634a454c36fd16a4a3d2f016697fc8f7ed048ef7
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:45:53 2011 +0100
[as_devices] Fix some bugs in dac C and Python class
commit ef1c781d21d84b267e245fa533dea4bc83ce9039
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:21:41 2011 +0100
[as_devices] Adding Dac python class
commit 4e30cc713952955e1ff49bb9b5064a4187fae23e
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:20:40 2011 +0100
[as_devices] suppressing some warnings
commit 1550b94546abe3e756e42e7b6924c6d117f09c73
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:17:10 2011 +0100
[as_devices] fix api bug in as_dac wrapper
commit 165a6db56763840b3c6f339f983dbce57b053823
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:12:41 2011 +0100
[as_devices] Change name of API for dac setting value
commit a368f490253739fdf3427a87fc118574a777ed20
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:04:57 2011 +0100
[as_devices] Adding C wrapper for dac
commit 9c9879199fe6cde9e5c5b6b91996716924396793
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 16:00:17 2011 +0100
[as_devices] Change license for python wrappers (to GNU Lesser General License)
commit 8ad5d5bcb61624c6457fa2ef247a829ea95e0d2c
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 15:29:00 2011 +0100
[as_devices] Adding generic dac class
commit a6ee47b3814dcdb437f34d498c988b0d4507ead1
Author: Fabien Marteau <fab...@ar...>
Date: Mon Feb 21 15:27:25 2011 +0100
[as_devices] Adding as1531 chip class for adc
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/Makefile | 3 +-
target/packages/as_devices/c/as_as1531.c | 83 ++++++++++++++++
.../{python/src/AsAdc_wrap.h => c/as_as1531.h} | 28 ++++--
target/packages/as_devices/c/as_dac.c | 69 +++++++++++++
target/packages/as_devices/c/as_dac.h | 83 ++++++++++++++++
target/packages/as_devices/c/as_helpers.c | 1 -
target/packages/as_devices/c/as_max1027.c | 2 +-
target/packages/as_devices/c/as_max5821.c | 102 +++++++++++++++-----
target/packages/as_devices/c/as_max5821.h | 24 +++---
.../as_devices/python/AsDevices/Apf27Pwm.py | 4 +-
.../packages/as_devices/python/AsDevices/AsAdc.py | 8 +-
.../python/AsDevices/{AsAdc.py => AsDac.py} | 68 ++++++-------
.../packages/as_devices/python/AsDevices/AsGpio.py | 4 +-
.../as_devices/python/AsDevices/__init__.py | 7 +-
.../python/AsDevices/wrappers/__init__.py | 6 +-
target/packages/as_devices/python/Makefile | 1 +
.../python/src/{AsAdc_wrap.c => AsDac_wrap.c} | 52 +++++-----
.../python/src/{AsAdc_wrap.h => AsDac_wrap.h} | 8 +-
18 files changed, 423 insertions(+), 130 deletions(-)
create mode 100644 target/packages/as_devices/c/as_as1531.c
copy target/packages/as_devices/{python/src/AsAdc_wrap.h => c/as_as1531.h} (65%)
create mode 100644 target/packages/as_devices/c/as_dac.c
create mode 100644 target/packages/as_devices/c/as_dac.h
copy target/packages/as_devices/python/AsDevices/{AsAdc.py => AsDac.py} (54%)
copy target/packages/as_devices/python/src/{AsAdc_wrap.c => AsDac_wrap.c} (63%)
copy target/packages/as_devices/python/src/{AsAdc_wrap.h => AsDac_wrap.h} (81%)
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 3d20edf..cba285c 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -17,7 +17,8 @@ OBJ += as_93lcxx.o
OBJ += as_spi.o
OBJ += as_as1531.o
OBJ += as_max1027.o
-#OBJ += as_max5821.o
+OBJ += as_max5821.o
+OBJ += as_dac.o
OBJ += as_helpers.o
OBJ += as_adc.o
diff --git a/target/packages/as_devices/c/as_as1531.c b/target/packages/as_devices/c/as_as1531.c
new file mode 100644
index 0000000..6924cb0
--- /dev/null
+++ b/target/packages/as_devices/c/as_as1531.c
@@ -0,0 +1,83 @@
+#include "as_as1531.h"
+#include "as_helpers.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h> /* for close() */
+
+#define AS_AS1531_MAX_VALUE 2500
+#define BUFF_SIZE (300)
+
+#undef ERROR
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
+
+struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef) {
+ struct as_adc_device *dev;
+ int ret;
+ int fname;
+ char buf[BUFF_SIZE];
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/hwmon/hwmon%d/device/name", aDeviceNum);
+ fname = open(buf, O_RDONLY);
+ if (fname < 0) {
+ ERROR("Can't open file %s, is as1531 modprobed ?\n", buf);
+ return NULL;
+ }
+
+ ret = read(fname, buf, BUFF_SIZE);
+ if (ret <= 0) {
+ ERROR("Can't read name\n");
+ return NULL;
+ }
+
+ ret = strncmp(AS_AS1531_NAME, buf, strlen(AS_AS1531_NAME));
+ if (ret != 0) {
+ ERROR("Wrong driver name %s\n",buf);
+ return NULL;
+ }
+
+ close(fname);
+
+ dev = malloc(sizeof(struct as_adc_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for as_adc structure\n");
+ return NULL;
+ }
+
+ dev->device_type = "as1531";
+ dev->device_num = aDeviceNum;
+ dev->vref = aVRef;
+ return dev;
+}
+
+int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel) {
+ int ret;
+ int finput;
+ int value;
+ char buf[BUFF_SIZE];
+
+ snprintf(buf, BUFF_SIZE,
+ "/sys/class/hwmon/hwmon%d/device/in%d_input",
+ aDev->device_num, aChannel);
+ finput = open(buf, O_RDONLY);
+ if (finput < 0) {
+ ERROR("Can't open file %s.\n", buf);
+ return -1;
+ }
+
+ ret = as_read_int(finput, &value);
+ if (ret < 0) {
+ ERROR("Can't read value on channel %d\n", aChannel);
+ return -1;
+ }
+ close(finput);
+
+ if (AS_AS1531_MAX_VALUE == aDev->vref) return value;
+
+ return (value*aDev->vref)/AS_AS1531_MAX_VALUE;
+}
+
+int32_t as_adc_close_as1531(struct as_adc_device *aDev) {
+ return 0;
+}
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.h b/target/packages/as_devices/c/as_as1531.h
similarity index 65%
copy from target/packages/as_devices/python/src/AsAdc_wrap.h
copy to target/packages/as_devices/c/as_as1531.h
index 7fa0b8f..507fdaf 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.h
+++ b/target/packages/as_devices/c/as_as1531.h
@@ -1,5 +1,5 @@
/*
-** THE ARMadeus Systems
+** The ARMadeus Project
**
** Copyright (C) 2011 The armadeus systems team
** Fabien Marteau <fab...@ar...>
@@ -19,14 +19,22 @@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Python.h>
+#ifndef __ASAS1531_H__
+#define __ASAS1531_H__
-/* Init module */
-void initAsAdc_wrap();
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
-/*********************/
-/* Functions wrapped */
-/*********************/
-static PyObject * adc_open(PyObject *self, PyObject *args);
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args);
-static PyObject * adc_close(PyObject *self, PyObject *args);
+#include "as_adc.h"
+
+struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef);
+
+int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel);
+
+int32_t as_adc_close_as1531(struct as_adc_device *aDev);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __ASAS1531_H__ */
diff --git a/target/packages/as_devices/c/as_dac.c b/target/packages/as_devices/c/as_dac.c
new file mode 100644
index 0000000..e492b0d
--- /dev/null
+++ b/target/packages/as_devices/c/as_dac.c
@@ -0,0 +1,69 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ * Copyright (C) 2011 Fabien Marteau <fab...@ar...>
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h> /* for close() */
+#include <string.h>
+
+#include "as_dac.h"
+#include "as_max5821.h"
+
+#undef ERROR
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
+
+struct as_dac_device *as_dac_open(const char *aDacType, int aBusNumber,
+ int aAddress, int aVRef)
+{
+ if (strncmp(AS_MAX5821_TYPE, aDacType, strlen(AS_MAX5821_TYPE)) == 0)
+ return as_dac_open_max5821(aBusNumber, aAddress, aVRef);
+ /* TODO: mcp4912 */
+ ERROR("Undefined DAC type '%s'\n", aDacType);
+ return NULL;
+}
+
+int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
+ int aChannel,
+ int aValue)
+{
+ if (strncmp(AS_MAX5821_TYPE, aDev->device_type, strlen(AS_MAX5821_TYPE)) == 0) {
+ if ((aChannel == 0) || (aChannel == 1))
+ return as_dac_set_value_max5821(aDev, aChannel + 'A', aValue);
+ else {
+ ERROR("Wrong channel number %d\n",aChannel);
+ return -1;
+ }
+ }
+
+ ERROR("Undefined DAC type '%s'\n", aDev->device_type);
+ return -1;
+}
+
+
+int32_t as_dac_close(struct as_dac_device *aDev)
+{
+ if (strncmp(AS_MAX5821_TYPE, aDev->device_type, strlen(AS_MAX5821_TYPE)) == 0)
+ as_dac_close_max5821(aDev);
+
+ free(aDev);
+ return 0;
+}
+
diff --git a/target/packages/as_devices/c/as_dac.h b/target/packages/as_devices/c/as_dac.h
new file mode 100644
index 0000000..6b569a3
--- /dev/null
+++ b/target/packages/as_devices/c/as_dac.h
@@ -0,0 +1,83 @@
+/*
+ * This software is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ * Copyright (C) 2011 Fabien Marteau <fab...@ar...>
+ *
+ */
+
+
+#ifndef AS_DAC_H_
+#define AS_DAC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "as_dac.h"
+
+#define AS_MAX5821_TYPE "max5821"
+#define AS_MCP4912
+
+/**
+ * Store dac parameters
+ */
+struct as_dac_device {
+ int bus_number;
+ int chip_address;
+ int vref;
+ const char *device_type;
+ void *chip_param;
+};
+
+/** @brief Open dac
+ *
+ * @param aDacType type name of adc ("max5821" or "mcp4912")
+ * @param aBusNumber bus number used
+ * @param aAddress i2c address for i2c chip, and CS number for SPI chip
+ * @param aVRef voltage reference in milivolt
+ * @param aVDefault default voltage value at open
+ *
+ * @return as_dac_device structure pointer on success, NULL on error
+ */
+struct as_dac_device *as_dac_open(const char *aDacType, int aBusNumber,
+ int aAddress, int aVRef);
+
+
+/** @brief set a channel value.
+ *
+ * @param aDev structure pointer of dac device
+ * @param aChannel channel number (A:0, B:1,...)
+ * @param aValue channel value in milivolt
+ *
+ * @return negative value on error
+ */
+int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
+ int aChannel,
+ int aValue);
+
+/** @brief close device
+ *
+ * @param aDev structure pointer of dac device
+ *
+ * @return negative value on error
+ */
+int32_t as_dac_close(struct as_dac_device *aDev);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* AS_DAC_H_ */
diff --git a/target/packages/as_devices/c/as_helpers.c b/target/packages/as_devices/c/as_helpers.c
index a3dc318..e2fa27c 100644
--- a/target/packages/as_devices/c/as_helpers.c
+++ b/target/packages/as_devices/c/as_helpers.c
@@ -62,7 +62,6 @@ int as_write_buffer(int fd, int value)
int as_write_buffer_string(int fd, char *string)
{
int ret;
- char buffer[SIZE_OF_BUFF];
int string_len;
string_len = strlen(string);
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
index 0008abe..3887701 100644
--- a/target/packages/as_devices/c/as_max1027.c
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -204,7 +204,7 @@ int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *aDev, int a
file = open(buffer, O_WRONLY);
if (file < 0) {
ERROR("Can't open conversion file\n");
- return NULL;
+ return -1;
}
ret = as_write_buffer(file, MAX1027_CONV |
MAX1027_CONV_CHSEL(aChannel) |
diff --git a/target/packages/as_devices/c/as_max5821.c b/target/packages/as_devices/c/as_max5821.c
index 168fbd6..33959b8 100644
--- a/target/packages/as_devices/c/as_max5821.c
+++ b/target/packages/as_devices/c/as_max5821.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "as_dac.h"
#include "as_max5821.h"
#include "as_i2c.h"
@@ -44,39 +45,80 @@
/*-----------------------------------------------------------------------------*/
-struct as_max5821_device *as_max5821_open(int aI2cBus, int aI2cAddress)
+struct as_dac_device *as_dac_open_max5821(int aI2cBus, int aI2cAddress, int aVRef)
{
- struct as_max5821_device *dev;
+ struct as_max5821_device *max5821_dev;
+ struct as_dac_device *dev;
+ struct as_i2c_device *i2c_dev;
+ int ret;
- dev = (struct as_max5821_device *)malloc(sizeof(struct as_max5821_device));
- if (dev == NULL)
- {
- ERROR("can't allocate memory for device structure\n");
+ i2c_dev = as_i2c_open(aI2cBus);
+ if (i2c_dev == NULL) {
+ ERROR("Can't open i2c bus number %d\n", aI2cBus);
return NULL;
}
- dev->i2c_bus = as_i2c_open(aI2cBus);
- if (dev->i2c_bus < 0)
- {
- ERROR("Can't open i2c bus number %d\n",aI2cBus);
- free(dev);
- return NULL;
+ ret = as_i2c_set_slave_addr(i2c_dev, aI2cAddress);
+ if (ret < 0) {
+ ERROR("Can't set i2c address 0x%02x\n",aI2cAddress);
+ goto close_i2c_err;
+ }
+
+ dev = (struct as_dac_device *)malloc(sizeof(struct as_dac_device));
+ if (dev == NULL) {
+ ERROR("can't allocate memory for device structure\n");
+ goto close_i2c_err;
+ }
+ max5821_dev = (struct as_max5821_device *)malloc(sizeof(struct as_max5821_device));
+ if (max5821_dev == NULL) {
+ ERROR("can't allocate memory for device structure\n");
+ goto free_dev_err;
}
- dev->i2c_address = aI2cAddress;
+
+
+ max5821_dev->i2c_dev = i2c_dev;
+
+ dev->bus_number = aI2cBus;
+ dev->chip_address = aI2cAddress;
+ dev->device_type = AS_MAX5821_TYPE;
+ dev->vref = aVRef;
+ dev->chip_param = (void *)max5821_dev;
+
+ ret = as_dac_max5821_power(dev, 'A', MAX5821_POWER_UP);
+ if (ret < 0) {
+ ERROR("Can't power up MAX5821 channel A\n");
+ goto free_max5821_dev_err;
+ }
+ ret = as_dac_max5821_power(dev, 'B', MAX5821_POWER_UP);
+ if (ret < 0) {
+ ERROR("Can't power up MAX5821 channel B\n");
+ goto free_max5821_dev_err;
+ }
return dev;
+
+free_max5821_dev_err:
+ free(max5821_dev);
+free_dev_err:
+ free(dev);
+close_i2c_err:
+ as_i2c_close(i2c_dev);
+ return NULL;
}
/*-----------------------------------------------------------------------------*/
-int32_t as_max5821_power(struct as_max5821_device *aDev,
+int32_t as_dac_max5821_power(struct as_dac_device *aDev,
char aChannel,
AS_max5821_power_mode aMode)
{
+ struct as_max5821_device *max5821_dev;
int ret;
unsigned char buff[2];
+ max5821_dev = aDev->chip_param;
+
switch(aChannel)
{
case 'a':
@@ -88,13 +130,13 @@ int32_t as_max5821_power(struct as_max5821_device *aDev,
default: ERROR("Wrong channel name %c\n", aChannel);
return -1;
}
-
+
buff[0] = MAX5821_EXTENDED_COMMAND_MODE;
- ret = as_i2c_write(aDev->i2c_bus, aDev->i2c_address, buff, 2);
+ ret = as_i2c_write(max5821_dev->i2c_dev, buff, 2);
if (ret < 0) {
ERROR("can't write on i2c bus %d, address %d, value %x %x\n",
- aDev->i2c_bus,aDev->i2c_address,buff[0], buff[1]);
+ aDev->bus_number, aDev->chip_address,buff[0], buff[1]);
return -1;
}
@@ -103,13 +145,16 @@ int32_t as_max5821_power(struct as_max5821_device *aDev,
/*-----------------------------------------------------------------------------*/
-int32_t as_max5821_set_one_value(struct as_max5821_device *aDev,
+int32_t as_dac_set_value_max5821(struct as_dac_device *aDev,
char aChannel,
int aValue)
{
+ struct as_max5821_device *max5821_dev;
int ret;
unsigned char buff[2];
+ max5821_dev = aDev->chip_param;
+
switch(aChannel)
{
case 'a':
@@ -124,7 +169,7 @@ int32_t as_max5821_set_one_value(struct as_max5821_device *aDev,
buff[1] =(unsigned char)((aValue << 2) & 0x00FC);
- ret = as_i2c_write(aDev->i2c_bus, aDev->i2c_address, buff, 2);
+ ret = as_i2c_write(max5821_dev->i2c_dev, buff, 2);
if (ret < 0) {
ERROR("can't write on i2c bus\n");
return -1;
@@ -135,16 +180,19 @@ int32_t as_max5821_set_one_value(struct as_max5821_device *aDev,
/*-----------------------------------------------------------------------------*/
-int32_t as_max5821_set_both_value(struct as_max5821_device *aDev,
+int32_t as_max5821_set_both_value(struct as_dac_device *aDev,
int aValue)
{
+ struct as_max5821_device *max5821_dev;
int ret;
unsigned char buff[2];
+ max5821_dev = aDev->chip_param;
+
buff[0] = 0xC0 | ((unsigned char)((aValue >> 6)) & 0x0F);
buff[1] = (unsigned char)((aValue << 2) & 0x00FC);
-
- ret = as_i2c_write(aDev->i2c_bus, aDev->i2c_address, buff, 2);
+
+ ret = as_i2c_write(max5821_dev->i2c_dev, buff, 2);
if (ret < 0) {
ERROR("can't write on i2c bus\n");
return -1;
@@ -155,10 +203,14 @@ int32_t as_max5821_set_both_value(struct as_max5821_device *aDev,
/*-----------------------------------------------------------------------------*/
-int32_t as_max5821_close(struct as_max5821_device *aDev)
+int32_t as_dac_close_max5821(struct as_dac_device *aDev)
{
- as_i2c_close(aDev->i2c_bus);
- free(aDev);
+ struct as_max5821_device *max5821_dev;
+
+ max5821_dev = (struct as_max5821_device *)(aDev->chip_param);
+ as_i2c_close(max5821_dev->i2c_dev);
+ free(max5821_dev);
+ aDev->chip_param = NULL;
return 0;
}
diff --git a/target/packages/as_devices/c/as_max5821.h b/target/packages/as_devices/c/as_max5821.h
index 580d1bc..8c17d10 100644
--- a/target/packages/as_devices/c/as_max5821.h
+++ b/target/packages/as_devices/c/as_max5821.h
@@ -27,16 +27,13 @@ extern "C" {
#include "as_i2c.h"
-/**
- * Store max5821 parameters
- */
struct as_max5821_device {
- int i2c_bus;
- int i2c_address;
+ struct as_i2c_device *i2c_dev;
};
+
typedef enum {
- MAX5821_POWER_UP = 0,
+ MAX5821_POWER_UP = 0,
MAX5821_POWER_DOWN_MODE0,
MAX5821_POWER_DOWN_MODE1,
MAX5821_POWER_DOWN_MODE2
@@ -46,11 +43,14 @@ typedef enum {
*
* @param aI2cBus i2c bus number
* @param aI2cAddress i2c chip address
+ * @param aVRef reference voltage
+ * @param aVDefault voltage required when device opened
*
* @return as_max5821_device structure on success, NULL on error
*/
-struct as_max5821_device *as_max5821_open(int aI2cBus, int aI2cAddress);
-
+struct as_dac_device *as_dac_open_max5821(int aI2cBus,
+ int aI2cAddress,
+ int aVRef);
/** @brief Power a channel
*
* @param aDev pointer to device structure
@@ -59,7 +59,7 @@ struct as_max5821_device *as_max5821_open(int aI2cBus, int aI2cAddress);
*
* @return negative value on header.
*/
-int32_t as_max5821_power(struct as_max5821_device *aDev,
+int32_t as_dac_max5821_power(struct as_dac_device *aDev,
char aChannel,
AS_max5821_power_mode aMode);
@@ -71,7 +71,7 @@ int32_t as_max5821_power(struct as_max5821_device *aDev,
*
* @return negative value on error.
*/
-int32_t as_max5821_set_one_value(struct as_max5821_device *aDev,
+int32_t as_dac_set_value_max5821(struct as_dac_device *aDev,
char aChannel,
int aValue);
@@ -82,7 +82,7 @@ int32_t as_max5821_set_one_value(struct as_max5821_device *aDev,
*
* @return negative value on error
*/
-int32_t as_max5821_set_both_value(struct as_max5821_device *aDev,
+int32_t as_max5821_set_both_value(struct as_dac_device *aDev,
int aValue);
/** @brief Close max5821
@@ -91,7 +91,7 @@ int32_t as_max5821_set_both_value(struct as_max5821_device *aDev,
*
* @return negative value on error
*/
-int32_t as_max5821_close(struct as_max5821_device *aDev);
+int32_t as_dac_close_max5821(struct as_dac_device *aDev);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
index ac19491..ee34690 100644
--- a/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
+++ b/target/packages/as_devices/python/AsDevices/Apf27Pwm.py
@@ -16,9 +16,9 @@
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
diff --git a/target/packages/as_devices/python/AsDevices/AsAdc.py b/target/packages/as_devices/python/AsDevices/AsAdc.py
index d46aa05..43bbb6c 100644
--- a/target/packages/as_devices/python/AsDevices/AsAdc.py
+++ b/target/packages/as_devices/python/AsDevices/AsAdc.py
@@ -9,16 +9,16 @@
# Copyright (2011) Armadeus Systems
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
@@ -30,7 +30,7 @@
#
#-----------------------------------------------------------------------------
-__doc__ = "This class drive ARMadeus board ADCs"
+__doc__ = "This class drive ARMadeus boards ADCs"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
diff --git a/target/packages/as_devices/python/AsDevices/AsAdc.py b/target/packages/as_devices/python/AsDevices/AsDac.py
similarity index 54%
copy from target/packages/as_devices/python/AsDevices/AsAdc.py
copy to target/packages/as_devices/python/AsDevices/AsDac.py
index d46aa05..983345f 100644
--- a/target/packages/as_devices/python/AsDevices/AsAdc.py
+++ b/target/packages/as_devices/python/AsDevices/AsDac.py
@@ -1,96 +1,90 @@
#! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
-# Name: AsAdc.py
-# Purpose:
+# Name: AsDac.py
+# Purpose:
# Author: Fabien Marteau <fab...@ar...>
-# Created: 04/02/2011
+# Created: 21/02/2011
#-----------------------------------------------------------------------------
# Copyright (2011) Armadeus Systems
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# created :Â 04/02/2011
-#-----------------------------------------------------------------------------
-# Revision list :
-#
-# Date By Changes
-#
#-----------------------------------------------------------------------------
-__doc__ = "This class drive ARMadeus board ADCs"
+__doc__ = "This class drive ARMadeus boards DACs"
__version__ = "0.1"
__author__ = "Fabien Marteau <fab...@ar...>"
-import wrappers.AsAdc_wrap as wrapper
+import wrappers.AsDac_wrap as wrapper
-class AsAdcError(Exception):
+class AsDacError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
-class AsAdc:
- """ Drive adc
+class AsDac:
+ """ Drive dac
"""
- # Dictionary of adc multiton classes
- __adc = {}
+ # Dictionary of dac multiton classes
+ __dac = {}
################################################################
class __impl:
""" implementation
"""
- def __init__(self, aAdcType, aDeviceNum, aVRef):
+ def __init__(self, aDacType, aBusNumber, aAddress, aVRef):
try:
- self.__device = wrapper.adc_open(aAdcType, aDeviceNum, aVRef)
+ self.__device = wrapper.dac_open(aDacType, aBusNumber, aAddress, aVRef)
except Exception, e:
- raise AsAdcError("Can't open adc port type "+str(aAdcType)+\
- " num "+str(aDeviceNum))
+ raise AsDacError("Can't open dac port type "+str(aDacType)+\
+ " num "+str(aBusNumber))
def __del__(self):
try:
- wrapper.adc_close(self.__device)
+ wrapper.dac_close(self.__device)
except Exception, e:
pass
- def getValueInMillivolts(self, aChannel):
+ def setValueInMillivolts(self, aChannel, aValue):
""" Get value in millivolts
"""
try:
- return wrapper.getValueInMillivolts(self.__device, aChannel)
+ return wrapper.dac_setValueInMillivolts(self.__device, aChannel, aValue)
except Exception, e:
- raise AsAdcError(str(e))
+ raise AsDacError(str(e))
################################################################
@classmethod
- def getInstance(cls, aAdcType, aDeviceNum, aVRef):
+ def getInstance(cls, aDacType, aBusNumber, aAddress, aVRef):
try:
- return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
+ return AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)]
except KeyError:
- AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)] =\
- cls.__impl(aAdcType, aDeviceNum, aVRef)
+ AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)] =\
+ cls.__impl(aDacType, aBusNumber, aAddress, aVRef)
- return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
+ return AsDac.__dac["%s:%d-0x%02x"%(aDacType, aBusNumber, aAddress)]
def __init__(self):
- """ Initialize adc
+ """ Initialize dac
"""
raise Exception("This constructor is private, to instanciate object do:"+\
- "AsAdc.getInstance(adctype, deviceNum, vref)")
+ "AsDac.getInstance(dactype, busnumber, address, vref)")
if __name__ == "__main__":
import os
diff --git a/target/packages/as_devices/python/AsDevices/AsGpio.py b/target/packages/as_devices/python/AsDevices/AsGpio.py
index 1ac7eb9..9c9f357 100644
--- a/target/packages/as_devices/python/AsDevices/AsGpio.py
+++ b/target/packages/as_devices/python/AsDevices/AsGpio.py
@@ -16,9 +16,9 @@
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
diff --git a/target/packages/as_devices/python/AsDevices/__init__.py b/target/packages/as_devices/python/AsDevices/__init__.py
index 5d9150a..64208f5 100644
--- a/target/packages/as_devices/python/AsDevices/__init__.py
+++ b/target/packages/as_devices/python/AsDevices/__init__.py
@@ -9,16 +9,16 @@
# Copyright (2008) Armadeus Systems
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
@@ -37,3 +37,4 @@ __author__ = "Fabien Marteau <fab...@ar...>"
import wrappers
from AsGpio import *
from AsAdc import *
+from AsDac import *
diff --git a/target/packages/as_devices/python/AsDevices/wrappers/__init__.py b/target/packages/as_devices/python/AsDevices/wrappers/__init__.py
index a699242..47ab497 100644
--- a/target/packages/as_devices/python/AsDevices/wrappers/__init__.py
+++ b/target/packages/as_devices/python/AsDevices/wrappers/__init__.py
@@ -9,16 +9,16 @@
# Copyright (2008) Armadeus Systems
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
+# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
diff --git a/target/packages/as_devices/python/Makefile b/target/packages/as_devices/python/Makefile
index f2714b1..8368d4e 100644
--- a/target/packages/as_devices/python/Makefile
+++ b/target/packages/as_devices/python/Makefile
@@ -17,6 +17,7 @@ LIBNAME=AsDevices
WRAPPER_LIBS=AsGpio_wrap.so
WRAPPER_LIBS+= AsAdc_wrap.so
+WRAPPER_LIBS+= AsDac_wrap.so
WRAPPER_DIR=src
PYTHON_VERS=2.4
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.c b/target/packages/as_devices/python/src/AsDac_wrap.c
similarity index 63%
copy from target/packages/as_devices/python/src/AsAdc_wrap.c
copy to target/packages/as_devices/python/src/AsDac_wrap.c
index 6179052..7f76582 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.c
+++ b/target/packages/as_devices/python/src/AsDac_wrap.c
@@ -18,50 +18,51 @@
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "AsAdc_wrap.h"
-#include "as_adc.h"
-
+#include "AsDac_wrap.h"
+#include "as_dac.h"
/* Methods definitions */
-static PyMethodDef AsAdc_wrap_methods[] = {
- {"adc_open", adc_open, METH_VARARGS, "Initialize adc"},
- {"getValueInMillivolts", getValueInMillivolts, METH_VARARGS, "Get Channel value in millivolts"},
- {"adc_close", adc_close, METH_VARARGS, "Close adc"},
+static PyMethodDef AsDac_wrap_methods[] = {
+ {"dac_open", dac_open, METH_VARARGS, "Initialize dac"},
+ {"dac_setValueInMillivolts", dac_setValueInMillivolts, METH_VARARGS, "Set Channel value in millivolts"},
+ {"dac_close", dac_close, METH_VARARGS, "Close dac"},
{NULL, NULL, 0, NULL} /* Sentinel */
};
/* Init module */
-void initAsAdc_wrap() /* called on first import */
+void initAsDac_wrap() /* called on first import */
{ /* name matter if called dynamically */
- (void) Py_InitModule("AsAdc_wrap", AsAdc_wrap_methods); /* mod name, table ptr */
+ (void) Py_InitModule("AsDac_wrap", AsDac_wrap_methods); /* mod name, table ptr */
}
/** @brief Initialize pin port access
* @return PyObject
*/
-static PyObject * adc_open(PyObject *self, PyObject *args)
+static PyObject * dac_open(PyObject *self, PyObject *args)
{
/* parameters */
- char *aAdcType;
- int aDeviceNum;
+ char *aDacType;
+ int aBusNumber;
+ int aAddress;
int aVref;
- struct as_adc_device *dev;
+ struct as_dac_device *dev;
PyObject *ret;
char buff[300];
/* Get arguments */
- if (!PyArg_ParseTuple(args, "sii", &aAdcType, &aDeviceNum, &aVref))
+ if (!PyArg_ParseTuple(args, "siii", &aDacType,
+ &aBusNumber, &aAddress, &aVref))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
return NULL;
}
- dev = as_adc_open(aAdcType, aDeviceNum, aVref);
+ dev = as_dac_open(aDacType, aBusNumber, aAddress, aVref);
if (dev == NULL)
{
snprintf(buff, 300,
- "Initialization error for ADC type %s bus %d. Is kernel module loaded ?",
- aAdcType, aDeviceNum);
+ "Initialization error for DAC type %s bus %d. Is kernel module loaded ?",
+ aDacType, aBusNumber);
PyErr_SetString(PyExc_IOError,buff);
return NULL;
}
@@ -71,23 +72,24 @@ static PyObject * adc_open(PyObject *self, PyObject *args)
return ret;
}
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args)
+static PyObject * dac_setValueInMillivolts(PyObject *self, PyObject *args)
{
/* parameters */
- struct as_adc_device *aFdev;
+ struct as_dac_device *aDev;
int aChannel;
+ int aValue;
int ret;
/* Get arguments */
- if (!PyArg_ParseTuple(args, "li", (long *)&aFdev, &aChannel))
+ if (!PyArg_ParseTuple(args, "lii", (long *)&aDev, &aChannel, &aValue))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
return NULL;
}
- ret = as_adc_get_value_in_millivolts(aFdev, aChannel);
+ ret = as_dac_set_value_in_millivolts(aDev, aChannel, aValue);
if (ret < 0)
{
PyErr_SetString(PyExc_IOError,
@@ -98,22 +100,22 @@ static PyObject * getValueInMillivolts(PyObject *self, PyObject *args)
return Py_BuildValue("i", ret);
}
-static PyObject * adc_close(PyObject *self, PyObject *args)
+static PyObject * dac_close(PyObject *self, PyObject *args)
{
/* parameters */
- struct as_adc_device *aFdev;
+ struct as_dac_device *aDev;
int ret;
/* Get arguments */
- if (!PyArg_ParseTuple(args, "l", (long *)&aFdev))
+ if (!PyArg_ParseTuple(args, "l", (long *)&aDev))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
return NULL;
}
- ret = as_adc_close(aFdev);
+ ret = as_dac_close(aDev);
if (ret < 0)
{
PyErr_SetString(PyExc_IOError,
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.h b/target/packages/as_devices/python/src/AsDac_wrap.h
similarity index 81%
copy from target/packages/as_devices/python/src/AsAdc_wrap.h
copy to target/packages/as_devices/python/src/AsDac_wrap.h
index 7fa0b8f..6ba91a7 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.h
+++ b/target/packages/as_devices/python/src/AsDac_wrap.h
@@ -22,11 +22,11 @@
#include <Python.h>
/* Init module */
-void initAsAdc_wrap();
+void initAsDac_wrap();
/*********************/
/* Functions wrapped */
/*********************/
-static PyObject * adc_open(PyObject *self, PyObject *args);
-static PyObject * getValueInMillivolts(PyObject *self, PyObject *args);
-static PyObject * adc_close(PyObject *self, PyObject *args);
+static PyObject * dac_open(PyObject *self, PyObject *args);
+static PyObject * dac_setValueInMillivolts(PyObject *self, PyObject *args);
+static PyObject * dac_close(PyObject *self, PyObject *args);
hooks/post-receive
--
armadeus
|
|
From: Gwenhael <gwe...@us...> - 2011-02-20 11:47:22
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 6b83bc2d5d5ccbf47be5c1b169404497f53f3bbe (commit)
via 75ce71199bd149ecca34e56fc05f0aa5091af475 (commit)
via 77a61db331b8e9b2f2c4e66f4b750ec08eda3339 (commit)
via a7fb02b5776dd434e6a81b90d4e3b7f1a28dfebe (commit)
from e286942d6a1f5ab26ef7cab9f6ed331a11253421 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6b83bc2d5d5ccbf47be5c1b169404497f53f3bbe
Author: gwenhael <gw...@tr...>
Date: Sun Feb 20 12:38:05 2011 +0100
[LINUX][2.6.38][APF9328] add data structure for SPI on IMX1.
commit 75ce71199bd149ecca34e56fc05f0aa5091af475
Author: gwenhael <gw...@tr...>
Date: Sun Feb 20 12:37:42 2011 +0100
Split 030-armadeus-imx-devices.tofix SPI part in a dedicated patch and adds functions for SPI registration
commit 77a61db331b8e9b2f2c4e66f4b750ec08eda3339
Author: gwenhael <gw...@tr...>
Date: Sun Feb 20 12:35:24 2011 +0100
[LINUX][2.6.38][APF9328] Adapt #define interrupt name and base address for SPI .
commit a7fb02b5776dd434e6a81b90d4e3b7f1a28dfebe
Author: gwenhael <gw...@tr...>
Date: Sun Feb 20 12:33:41 2011 +0100
[LINUX][2.6.38][APF9328] adapt 021-armadeus-apf9328.patch to 2.6.38-rc3 kernel
-----------------------------------------------------------------------
Summary of changes:
.../2.6.38/021-armadeus-apf9328.patch | 23 +++++------
.../029-armadeus-add_csi_and_spi_registers.patch | 42 +++++++++++++++----
...rmadeus-devices-imx1-add_spi_registration.patch | 15 +++++++
.../2.6.38/030-armadeus-imx-devices.tofix | 14 -------
...adeus-platform-spi_imx-add_data_structure.patch | 20 +++++++++
5 files changed, 78 insertions(+), 36 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-devices-imx1-add_spi_registration.patch
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/075-armadeus-platform-spi_imx-add_data_structure.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/021-armadeus-apf9328.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/021-armadeus-apf9328.patch
index 4a2164d..01a3e7d 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/021-armadeus-apf9328.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/021-armadeus-apf9328.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c 2011-02-08 19:33:09.000000000 +0100
-@@ -0,0 +1,587 @@
+--- /dev/null
++++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c
+@@ -0,0 +1,584 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -63,7 +63,6 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c
+#endif
+#include <mach/imxfb.h>
+#include "devices-imx1.h"
-+#include "devices.h"
+
+#define IMX_FB_VIRT 0xF1000000
+#define IMX_FB_SIZE (256*1024)
@@ -582,8 +581,6 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c
+
+MACHINE_START(APF9328, "Armadeus APF9328")
+ /* Maintainer: Julien Boibessot, Armadeus */
-+ .phys_io = MX1_IO_BASE_ADDR,
-+ .io_pg_offst = (MX1_IO_BASE_ADDR_VIRT >> 18) & 0xfffc,
+ .boot_params = MX1_PHYS_OFFSET + 0x100,
+ .map_io = apf9328_map_io,
+ .init_irq = apf9328_init_irq,
@@ -592,8 +589,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328.c
+MACHINE_END
Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328_lcd_config.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328_lcd_config.h 2011-02-08 21:42:50.000000000 +0100
+--- /dev/null
++++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328_lcd_config.h
@@ -0,0 +1,329 @@
+/*
+ *
@@ -926,8 +923,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328_lcd_config.h
+#endif /* APF_LCD_CONFIG_H */
Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/board-apf9328.h
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/board-apf9328.h 2011-02-08 19:33:09.000000000 +0100
+--- /dev/null
++++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/board-apf9328.h
@@ -0,0 +1,71 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
@@ -1002,8 +999,8 @@ Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/board-apf9328.h
+#endif /* __ASM_ARCH_APF9328_H */
Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328-dev.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328-dev.c 2011-02-08 19:33:09.000000000 +0100
+--- /dev/null
++++ linux-2.6.38-rc3/arch/arm/mach-imx/apf9328-dev.c
@@ -0,0 +1,325 @@
+/*
+ * apf9328-dev.c
@@ -1059,7 +1056,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-imx/apf9328-dev.c
+#include <mach/ssi.h>
+#include <mach/iomux-mx1.h>
+#include <mach/iomux-v1.h>
-+#include "devices.h"
++#include "devices-imx1.h"
+#include <mach/imxfb.h>
+//#include "generic.h"
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/029-armadeus-add_csi_and_spi_registers.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/029-armadeus-add_csi_and_spi_registers.patch
index d4dc5d3..101de48 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/029-armadeus-add_csi_and_spi_registers.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/029-armadeus-add_csi_and_spi_registers.patch
@@ -1,5 +1,7 @@
---- linux-2.6.36/drivers/spi/spi_imx.c 2010-10-20 22:30:22.000000000 +0200
-+++ linux-2.6.36.new/drivers/spi/spi_imx.c 2010-11-29 08:00:31.000000000 +0100
+Index: linux-2.6.38-rc3/drivers/spi/spi_imx.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/spi/spi_imx.c
++++ linux-2.6.38-rc3/drivers/spi/spi_imx.c
@@ -43,6 +43,9 @@
#define MXC_CSPITXDATA 0x04
#define MXC_CSPICTRL 0x08
@@ -10,8 +12,10 @@
#define MXC_RESET 0x1c
#define MX3_CSPISTAT 0x14
---- linux-2.6.36/drivers/media/video/mx1_camera.c 2010-10-20 22:30:22.000000000 +0200
-+++ linux-2.6.36.new/drivers/media/video/mx1_camera.c 2010-11-29 08:04:20.000000000 +0100
+Index: linux-2.6.38-rc3/drivers/media/video/mx1_camera.c
+===================================================================
+--- linux-2.6.38-rc3.orig/drivers/media/video/mx1_camera.c
++++ linux-2.6.38-rc3/drivers/media/video/mx1_camera.c
@@ -50,9 +50,13 @@
* CSI registers
*/
@@ -37,13 +41,33 @@
#define CSICR1_DATA_POL (1 << 2)
#define CSICR1_REDGE (1 << 1)
#define CSICR1_EN (1 << 0)
---- a/arch/arm/plat-mxc/include/mach/mx1.h 2010-11-29 09:20:02.000000000 +0100
-+++ b/arch/arm/plat-mxc/include/mach/mx1.h 2010-11-29 09:20:19.000000000 +0100
-@@ -109,6 +109,7 @@
+Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/mx1.h
+===================================================================
+--- linux-2.6.38-rc3.orig/arch/arm/plat-mxc/include/mach/mx1.h
++++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/mx1.h
+@@ -54,13 +54,13 @@
+ #define MX1_AIPI2_BASE_ADDR (0x10000 + MX1_IO_BASE_ADDR)
+ #define MX1_SIM_BASE_ADDR (0x11000 + MX1_IO_BASE_ADDR)
+ #define MX1_USBD_BASE_ADDR (0x12000 + MX1_IO_BASE_ADDR)
+-#define MX1_SPI1_BASE_ADDR (0x13000 + MX1_IO_BASE_ADDR)
++#define MX1_CSPI1_BASE_ADDR (0x13000 + MX1_IO_BASE_ADDR)
+ #define MX1_MMC_BASE_ADDR (0x14000 + MX1_IO_BASE_ADDR)
+ #define MX1_ASP_BASE_ADDR (0x15000 + MX1_IO_BASE_ADDR)
+ #define MX1_BTA_BASE_ADDR (0x16000 + MX1_IO_BASE_ADDR)
+ #define MX1_I2C_BASE_ADDR (0x17000 + MX1_IO_BASE_ADDR)
+ #define MX1_SSI_BASE_ADDR (0x18000 + MX1_IO_BASE_ADDR)
+-#define MX1_SPI2_BASE_ADDR (0x19000 + MX1_IO_BASE_ADDR)
++#define MX1_CSPI2_BASE_ADDR (0x19000 + MX1_IO_BASE_ADDR)
+ #define MX1_MSHC_BASE_ADDR (0x1A000 + MX1_IO_BASE_ADDR)
+ #define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR)
+ #define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR)
+@@ -112,7 +112,8 @@
#define MX1_PWM_INT 34
#define MX1_SDHC_INT 35
#define MX1_INT_I2C 39
-+#define MX1_SPI2_INT 40
- #define MX1_CSPI_INT 41
+-#define MX1_CSPI_INT 41
++#define MX1_INT_CSPI2 40
++#define MX1_INT_CSPI1 41
#define MX1_SSI_TX_INT 42
#define MX1_SSI_TX_ERR_INT 43
+ #define MX1_SSI_RX_INT 44
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-devices-imx1-add_spi_registration.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-devices-imx1-add_spi_registration.patch
new file mode 100644
index 0000000..a4eb42a
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-devices-imx1-add_spi_registration.patch
@@ -0,0 +1,15 @@
+Add registration functions for SPI.
+diff -ru a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
+--- a/arch/arm/mach-imx/devices-imx1.h 2011-02-01 04:05:49.000000000 +0100
++++ b/arch/arm/mach-imx/devices-imx1.h 2011-02-07 06:53:23.000000000 +0100
+@@ -18,3 +18,10 @@
+ imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata)
+ #define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata)
+ #define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata)
++
++extern const struct imx_spi_imx_data imx1_cspi_data[] __initconst;
++#define imx1_add_cspi(id, pdata) \
++ imx_add_spi_imx(&imx1_cspi_data[id], pdata)
++
++#define imx1_add_spi_imx0(pdata) imx1_add_cspi(0, pdata)
++#define imx1_add_spi_imx1(pdata) imx1_add_cspi(1, pdata)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-imx-devices.tofix b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-imx-devices.tofix
index a00785c..7e46de6 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-imx-devices.tofix
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/030-armadeus-imx-devices.tofix
@@ -46,17 +46,3 @@
#endif
#if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27)
---- a/arch/arm/mach-imx/devices-imx1.h 2010-10-20 22:30:22.000000000 +0200
-+++ b/arch/arm/mach-imx/devices-imx1.h 2010-11-22 18:41:14.000000000 +0100
-@@ -15,4 +15,10 @@
- #define imx1_add_imx_uart0(pdata) \
- imx_add_imx_uart_3irq(0, MX1_UART1_BASE_ADDR, 0xd0, MX1_INT_UART1RX, MX1_INT_UART1TX, MX1_INT_UART1RTS, pdata)
- #define imx1_add_imx_uart1(pdata) \
-- imx_add_imx_uart_3irq(0, MX1_UART2_BASE_ADDR, 0xd0, MX1_INT_UART2RX, MX1_INT_UART2TX, MX1_INT_UART2RTS, pdata)
-+ imx_add_imx_uart_3irq(1, MX1_UART2_BASE_ADDR, 0xd0, MX1_INT_UART2RX, MX1_INT_UART2TX, MX1_INT_UART2RTS, pdata)
-+
-+#define imx1_add_spi_imx0(pdata) \
-+ imx_add_spi_imx(0, MX1_SPI1_BASE_ADDR, SZ_4K, MX1_CSPI_INT, pdata)
-+#define imx1_add_spi_imx1(pdata) \
-+ imx_add_spi_imx(1, MX1_SPI2_BASE_ADDR, SZ_4K, MX1_SPI2_INT, pdata)
-+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/075-armadeus-platform-spi_imx-add_data_structure.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/075-armadeus-platform-spi_imx-add_data_structure.patch
new file mode 100644
index 0000000..887bf1c
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/075-armadeus-platform-spi_imx-add_data_structure.patch
@@ -0,0 +1,20 @@
+MX1: Add data structure for SPI
+diff a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
+--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c 2011-02-01 04:05:49.000000000 +0100
++++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c 2011-02-08 07:18:28.000000000 +0100
+@@ -21,6 +21,15 @@
+ #define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size) \
+ [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size)
+
++#ifdef CONFIG_SOC_IMX1
++const struct imx_spi_imx_data imx1_cspi_data[] __initconst = {
++#define imx1_cspi_data_entry(_id, _hwid) \
++ imx_spi_imx_data_entry(MX1, CSPI, "imx1-cspi", _id, _hwid, SZ_4K)
++ imx1_cspi_data_entry(0, 1),
++ imx1_cspi_data_entry(1, 2),
++};
++#endif
++
+ #ifdef CONFIG_SOC_IMX21
+ const struct imx_spi_imx_data imx21_cspi_data[] __initconst = {
+ #define imx21_cspi_data_entry(_id, _hwid) \
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-18 17:39:14
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via e286942d6a1f5ab26ef7cab9f6ed331a11253421 (commit)
via 8c6b69bbc3a98ef648103c3f8c4ba2ec01ea25f1 (commit)
via 69fc8638b9d20e837a1750f52127c5e74001e07d (commit)
via c33b4201d49245363521260789d8716cf1339718 (commit)
from d716aadd2589cfdb196cf52c2d08f09d11018097 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e286942d6a1f5ab26ef7cab9f6ed331a11253421
Merge: 8c6b69bbc3a98ef648103c3f8c4ba2ec01ea25f1 d716aadd2589cfdb196cf52c2d08f09d11018097
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 18:38:49 2011 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 8c6b69bbc3a98ef648103c3f8c4ba2ec01ea25f1
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 18:38:23 2011 +0100
[as_devices] Return error if read fail
commit 69fc8638b9d20e837a1750f52127c5e74001e07d
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 18:37:56 2011 +0100
[as_devices] Adding generic as_adc class, with specific calls to as1531 and max1027 chip
commit c33b4201d49245363521260789d8716cf1339718
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 18:33:26 2011 +0100
[as_devices] Adding python dependency for wrapper
-----------------------------------------------------------------------
Summary of changes:
.../package/armadeus/as_devices/as_devices.mk | 4 +-
target/packages/as_devices/c/Makefile | 3 +-
target/packages/as_devices/c/as_adc.c | 116 +----
target/packages/as_devices/c/as_adc.h | 11 +-
target/packages/as_devices/c/as_helpers.c | 1 +
target/packages/as_devices/c/as_max1027.c | 480 +++++++-------------
target/packages/as_devices/c/as_max1027.h | 67 +---
.../packages/as_devices/python/AsDevices/AsAdc.py | 6 +-
target/packages/as_devices/python/src/AsAdc_wrap.c | 9 +-
9 files changed, 219 insertions(+), 478 deletions(-)
diff --git a/buildroot/package/armadeus/as_devices/as_devices.mk b/buildroot/package/armadeus/as_devices/as_devices.mk
index 678068e..5cc203b 100644
--- a/buildroot/package/armadeus/as_devices/as_devices.mk
+++ b/buildroot/package/armadeus/as_devices/as_devices.mk
@@ -64,11 +64,11 @@ endif
ifeq ($(strip $(BR2_PACKAGE_AS_DEVICES_PYTHON)),y)
-$(TARGET_DIR)/$(AS_DEVICES_PYTHON_TARGET_BINARY): $(AS_DEVICES_DIR)/python/AsDevices/wrappers/$(AS_DEVICES_PYTHON_BINARY)
+$(TARGET_DIR)/$(AS_DEVICES_PYTHON_TARGET_BINARY): python $(AS_DEVICES_DIR)/python/AsDevices/wrappers/$(AS_DEVICES_PYTHON_BINARY)
cp -rf $(AS_DEVICES_DIR)/python/AsDevices $(TARGET_DIR)/$(AS_DEVICES_PYTHON_TARGET_DIR)
$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/$(AS_DEVICES_PYTHON_TARGET_BINARY)/wrappers/*.so
-$(AS_DEVICES_DIR)/python/AsDevices/wrappers/$(AS_DEVICES_PYTHON_BINARY): $(AS_DEVICES_DIR)/python/Makefile
+$(AS_DEVICES_DIR)/python/AsDevices/wrappers/$(AS_DEVICES_PYTHON_BINARY): python $(AS_DEVICES_DIR)/python/Makefile
$(TARGET_CONFIGURE_OPTS) $(MAKE) CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" -C $(AS_DEVICES_DIR)/python
endif
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index ba754b7..3d20edf 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -15,7 +15,8 @@ OBJ += as_gpio.o
endif
OBJ += as_93lcxx.o
OBJ += as_spi.o
-#OBJ += as_max1027.o
+OBJ += as_as1531.o
+OBJ += as_max1027.o
#OBJ += as_max5821.o
OBJ += as_helpers.o
OBJ += as_adc.o
diff --git a/target/packages/as_devices/c/as_adc.c b/target/packages/as_devices/c/as_adc.c
index 91bcf89..eb702f4 100644
--- a/target/packages/as_devices/c/as_adc.c
+++ b/target/packages/as_devices/c/as_adc.c
@@ -32,111 +32,47 @@
#include "as_helpers.h"
#include "as_adc.h"
-#define BUFF_SIZE (300)
-
-#define AS_MAX1027_NAME "max1027"
-
-#define AS_AS1531_NAME "as1531"
-#define AS_AS1531_MAX_VALUE 2500
+#include "as_max1027.h"
+#include "as_as1531.h"
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-/*------------------------------------------------------------------------------*/
-
-struct as_adc_device *as_adc_open_max1027(int aDeviceNum, int aVRef) {
- ERROR("Max1027 not yet supported by as_adc class\n");
- return NULL;
-}
-
-struct as_adc_device *as_adc_open_as1531(int aDeviceNum, int aVRef) {
- struct as_adc_device *dev;
- int ret;
- int fname;
- char buf[BUFF_SIZE];
-
- snprintf(buf, BUFF_SIZE, "/sys/class/hwmon/hwmon%d/device/name", aDeviceNum);
- fname = open(buf, O_RDONLY);
- if (fname < 0) {
- ERROR("Can't open file %s, is as1531 modprobed ?\n", buf);
- return NULL;
- }
-
- ret = read(fname, buf, BUFF_SIZE);
- if (ret <= 0) {
- ERROR("Can't read name\n");
- return NULL;
- }
-
- ret = strncmp(AS_AS1531_NAME, buf, strlen(AS_AS1531_NAME));
- if (ret != 0) {
- ERROR("Wrong driver name %s\n",buf);
- return NULL;
- }
-
- close(fname);
- dev = malloc(sizeof(struct as_adc_device));
- if (dev == NULL) {
- ERROR("Can't allocate memory for as_adc structure\n");
- return NULL;
- }
+struct as_adc_device *as_adc_open(const char *aAdcType, int aDeviceNum, int aVRef) {
+ if (strncmp(AS_MAX1027_NAME, aAdcType, strlen(AS_MAX1027_NAME)) == 0)
+ return as_adc_open_max1027(aDeviceNum, aVRef);
+ if (strncmp(AS_AS1531_NAME, aAdcType, strlen(AS_AS1531_NAME)) == 0)
+ return as_adc_open_as1531(aDeviceNum, aVRef);
- dev->device_type = AS_AS1531_TYPE;
- dev->device_num = aDeviceNum;
- dev->vref = aVRef;
- return dev;
+ ERROR("Undefined ADC type '%s'\n",aAdcType);
+ return NULL;
}
-struct as_adc_device *as_adc_open(int aAdcType, int aDeviceNum, int aVRef) {
+int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev, int aChannel) {
+ if (strncmp(AS_MAX1027_NAME, aDev->device_type, strlen(AS_MAX1027_NAME)) == 0)
+ return as_adc_get_value_in_millivolts_max1027(aDev, aChannel);
- switch(aAdcType) {
- case AS_MAX1027_TYPE: return as_adc_open_max1027(aDeviceNum, aVRef);
- case AS_AS1531_TYPE : return as_adc_open_as1531(aDeviceNum, aVRef);
- default : ERROR("Undefined ADC type %d\n",aAdcType);
- return NULL;
- }
-}
+ if (strncmp(AS_AS1531_NAME, aDev->device_type, strlen(AS_AS1531_NAME)) == 0)
+ return as_adc_get_value_in_millivolts_as1531(aDev, aChannel);
-int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *aDev, int aChannel) {
- ERROR("max1027 not supported yet\n");
+ ERROR("Undefined ADC type '%s'\n", aDev->device_type);
return -1;
}
-int32_t as_adc_get_value_in_millivolts_as1531(struct as_adc_device *aDev, int aChannel) {
+int32_t as_adc_close(struct as_adc_device *aDev) {
int ret;
- int finput;
- int value;
- char buf[BUFF_SIZE];
-
- snprintf(buf, BUFF_SIZE, "/sys/class/hwmon/hwmon%d/device/in%d_input", aDev->device_num, aChannel);
- finput = open(buf, O_RDONLY);
- if (finput < 0) {
- ERROR("Can't open file %s.\n", buf);
- return -1;
+ if (strncmp(AS_MAX1027_NAME, aDev->device_type, strlen(AS_MAX1027_NAME)) == 0) {
+ ret = as_adc_close(aDev);
+ free(aDev);
+ return ret;
}
-
- ret = as_read_int(finput, &value);
- if (ret < 0) {
- ERROR("Can't read value on channel %d\n", aChannel);
- return -1;
+ if (strncmp(AS_AS1531_NAME, aDev->device_type, strlen(AS_AS1531_NAME)) == 0) {
+ ret = as_adc_close_max1027(aDev);
+ free(aDev);
+ return ret;
}
- close(finput);
- if (AS_AS1531_MAX_VALUE == aDev->vref) return value;
-
- return (value*aDev->vref)/AS_AS1531_MAX_VALUE;
-}
-
-int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev, int aChannel) {
- switch(aDev->device_type) {
- case AS_MAX1027_TYPE: return as_adc_get_value_in_millivolts_max1027(aDev, aChannel);
- case AS_AS1531_TYPE : return as_adc_get_value_in_millivolts_as1531(aDev, aChannel);
- default : ERROR("Undefined ADC type %d\n", aDev->device_type);
- return -1;
- }
-}
-
-int32_t as_adc_close(struct as_adc_device *aDev) {
- return 0;
+ ERROR("Undefined ADC type '%s'\n", aDev->device_type);
+ return -1;
}
diff --git a/target/packages/as_devices/c/as_adc.h b/target/packages/as_devices/c/as_adc.h
index dd04e87..5c9b678 100644
--- a/target/packages/as_devices/c/as_adc.h
+++ b/target/packages/as_devices/c/as_adc.h
@@ -28,16 +28,17 @@
extern "C" {
#endif /* __cplusplus */
-#define AS_MAX1027_TYPE 0
-#define AS_AS1531_TYPE 1
+#define AS_MAX1027_NAME "max1027"
+#define AS_AS1531_NAME "as1531"
/**
* Store adc parameters
*/
struct as_adc_device {
- int device_type;
+ const char *device_type; /* Name of device type as1531 or max1027 */
int device_num;
- int vref; /* reference tension in millivolts */
+ int vref; /* reference tension in millivolts */
+ void *chip_param; /* chip specific parameters */
};
/** @brief Initialize port access
@@ -48,7 +49,7 @@ struct as_adc_device {
*
* @return error if negative value
*/
-struct as_adc_device *as_adc_open(int aDeviceNum, int aAdcType, int aVRef);
+struct as_adc_device *as_adc_open(const char *aAdcType, int aDeviceNum, int aVRef);
/** @brief get value in millivolts
*
diff --git a/target/packages/as_devices/c/as_helpers.c b/target/packages/as_devices/c/as_helpers.c
index 7fb6e7d..a3dc318 100644
--- a/target/packages/as_devices/c/as_helpers.c
+++ b/target/packages/as_devices/c/as_helpers.c
@@ -106,6 +106,7 @@ int as_read_int(int fd, int *value_res)
int value;
ret = as_read_buffer(fd, buf, SIZEOFBUFF);
+ if (ret < 0) return ret;
buf[ret-1] = '\0';
value = strtol(buf, NULL, 10);
*value_res = value;
diff --git a/target/packages/as_devices/c/as_max1027.c b/target/packages/as_devices/c/as_max1027.c
index 52b0752..0008abe 100644
--- a/target/packages/as_devices/c/as_max1027.c
+++ b/target/packages/as_devices/c/as_max1027.c
@@ -32,6 +32,7 @@
typedef unsigned char u8;
#include "as_max1027.h"
+#include "as_helpers.h"
/* Redundant with <linux/spi/max1027.h>, but... */
/* 00 : Scans channels 0 through N.
@@ -42,384 +43,239 @@ typedef unsigned char u8;
#define SCAN_MODE_01 1
#define SCAN_MODE_10 2
#define SCAN_MODE_11 3
-#define MAX1027_CONV 0x80
-#define MAX1027_CONV_TEMP 0x01
-#define MAX1027_SETUP 0x40
-#define MAX1027_AVG 0x20
+#define MAX1027_SETUP (0x40)
+#define MAX1027_SETUP_CLKSEL(x) ((x&0x03)<<4)
+#define MAX1027_SETUP_REFSEL(x) ((x&0x03)<<2)
+#define MAX1027_SETUP_DIFFSEL(x) (x&0x03)
+#define MAX1027_CONV (0x80)
+#define MAX1027_CONV_CHSEL(x) ((x&0x0f)<<3)
+#define MAX1027_CONV_SCAN(x) ((x&0x03)<<1)
+#define MAX1027_CONV_TEMP 0x01
+#define GET_SCAN_MODE(conv) ( (conv & 0x06) >> 1 )
+#define MAX1027_AVG (0x20)
+#define MAX1027_AVG_AVGON(x) ((x&0x01)<<4)
+#define MAX1027_AVG_NAVG(x) ((x&0x03)<<2)
+#define MAX1027_AVG_NSCAN(x) (x&0x03)
#define BUFFER_SIZE (70)
-#define PATH_SIZE (50)
-#define SYS_PATH "/sys/bus/spi/devices/spi%d.0/"
+#define SYS_PATH "/sys/class/hwmon/hwmon%d/device/"
#define TEMP_NAME "temp1_input"
#define SLOW_INPUT_NAME "in%d_input"
-#define FAST_INPUT_PATH "/dev/max1027/AIN%d"
-//#define DEBUG
-#ifdef DEBUG
-# define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-#else
-# define ERROR(fmt, ...) /*fmt, ##__VA_ARGS__*/
-#endif
+#undef ERROR
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-/** @brief Function used to write in /sys file
- *
- * @param aFile_handler /sys file handler
- * @param aValue int value to write
- *
- * @return negative value on error
- */
-int32_t as_max1027_write_buffer(int aFile_handler, int aValue)
-{
+int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv){
+ uint8_t avg_register = 0;
+ char buffer[BUFFER_SIZE];
+ int file;
int ret;
- char buffer[50];
- int buffer_len;
- ret = snprintf(buffer, 50, "%d", aValue);
- if (ret < 0)
- return -1;
- buffer_len = strlen(buffer);
- ret = write(aFile_handler, buffer, buffer_len);
- if (ret < 0)
+ switch (aNbConv)
{
- ERROR("Can't write file ");
- return -1;
+ case 1: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(0);
+ aDev->scan_mode = SCAN_MODE_11; /* no scan */
+ break;
+ case 4: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 8: avg_register = MAX1027_AVG_NAVG(1) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 16: avg_register = MAX1027_AVG_NAVG(2) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ case 32: avg_register = MAX1027_AVG_NAVG(3) | MAX1027_AVG_AVGON(1);
+ aDev->scan_mode = SCAN_MODE_10; /* scan */
+ break;
+ default:
+ ERROR("%s: unsupported setting\n", __func__);
+ return -1;
}
- ret = lseek(aFile_handler, 0, SEEK_SET);
- if (ret < 0)
- {
- ERROR("lseek error ");
+
+ /* select averaging */
+ snprintf(buffer, BUFFER_SIZE, "%s%s", aDev->path, "averaging");
+ file = open(buffer, O_WRONLY);
+ if (file < 0) {
+ ERROR("Can't open averaging file\n");
return -1;
}
-
- return buffer_len;
-}
-
-/** @brief function used to read int value in /sys file
- *
- * @param aFile_handler /sys file handler
- * @param aValueRead pointer to int value read
- *
- * @return negative value on error,
- */
-int32_t as_max1027_read_buffer(int aFile_handler, int *aValueRead)
-{
- const int SIZEOFBUFF = 20;
- ssize_t ret;
- char valueRead[SIZEOFBUFF];
- int value;
-
- ret = read(aFile_handler, valueRead, SIZEOFBUFF);
+ avg_register |= MAX1027_AVG | MAX1027_AVG_NSCAN(2);
+ ret = as_write_buffer(file, avg_register);
if (ret < 0)
{
- ERROR("Error, reading buffer file\n");
+ ERROR("Error, setting averaging\n");
return -1;
}
- valueRead[ret-1] = '\0';
+ close(file);
- ret = lseek(aFile_handler, 0, SEEK_SET);
- if (ret < 0)
- return -1;
- value = strtol(valueRead, NULL, 10);
- *aValueRead = value;
- return 0;
+ return aNbConv;
}
-struct as_max1027_device *as_max1027_open(int aSpiNum,
- AS_max1027_mode aMode)
-{
+
+struct as_adc_device *as_adc_open_max1027(int aDeviceNum, int aVRef) {
+ struct as_adc_device *adc_dev;
struct as_max1027_device *dev;
- int i;
- int fConversion, fSetup, fAveraging;
- int fTemperature;
- int fLowSpeed[NUMBER_OF_CHANNELS];
- int fHighSpeed[NUMBER_OF_CHANNELS];
- char path[PATH_SIZE];
+ int file;
char buffer[BUFFER_SIZE];
- char slow_input_name[20];
int ret;
- /** XXX */
- if (aMode == AS_MAX1027_FAST)
- {
- printf("Error, fast mode not supported yet\n");
- return NULL;
- }
+ dev = (struct as_max1027_device *)malloc(sizeof(struct as_max1027_device));
- ret = snprintf(path, PATH_SIZE, SYS_PATH, aSpiNum);
+ ret = snprintf(dev->path, PATH_SIZE, SYS_PATH, aDeviceNum);
if (ret<0)
{
ERROR("Error in path writing\n");
- return NULL;
+ goto err;
}
- /* Open file handler register */
- /* conversion */
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "conversion");
- if (ret<0)
- {
- ERROR("Error in path writing\n");
- return NULL;
+ /* Check driver name */
+ snprintf(buffer, BUFFER_SIZE, "%s%s", dev->path, "modalias");
+ file = open(buffer, O_RDONLY);
+ if (file < 0) {
+ ERROR("Error, can't open modalias file.\n");
+ goto err;
}
- fConversion = open(buffer, O_RDWR);
- if (fConversion < 0)
- {
- ERROR("Error, can't open conversion file. Is max1027 modprobed ?\n");
- return NULL;
+
+ ret = read(file, buffer, BUFFER_SIZE);
+ if (ret <= 0) {
+ ERROR("Can't read name\n");
+ goto err;
}
- /* setup */
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "setup");
- if (ret<0)
- {
- ERROR("Error in path writing\n");
- return NULL;
+
+ ret = strncmp(AS_MAX1027_NAME, buffer, strlen(AS_MAX1027_NAME));
+ if (ret != 0) {
+ ERROR("Wrong driver name %s\n", buffer);
+ goto err;
}
- fSetup = open(buffer, O_RDWR);
- if (fSetup < 0)
- {
+ close(file);
+
+ snprintf(buffer, BUFFER_SIZE, "%s%s", dev->path, "setup");
+ file = open(buffer, O_WRONLY);
+ if (file < 0) {
ERROR("Error, can't open setup file.\n");
- return NULL;
+ goto err;
}
- ret = as_max1027_write_buffer(fSetup,
- MAX1027_SETUP |
- MAX1027_SETUP_CLKSEL(0) |
- MAX1027_SETUP_REFSEL(0) |
- MAX1027_SETUP_DIFFSEL(0));
- if (ret < 0)
- {
+ ret = as_write_buffer(file, MAX1027_SETUP |
+ MAX1027_SETUP_CLKSEL(0) |
+ MAX1027_SETUP_REFSEL(0) |
+ MAX1027_SETUP_DIFFSEL(0));
+ if (ret < 0) {
ERROR("Error, can't set default setup parameters\n");
- return NULL;
- }
- /* averaging */
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "averaging");
- if (ret<0) {
- ERROR("Error in path writing\n");
- return NULL;
- }
-
- fAveraging = open(buffer, O_RDWR);
- if (fAveraging < 0)
- {
- ERROR("Error, can't open averaging file.\n");
- return NULL;
+ goto err;
}
+ close(file);
- /* temperature */
- if (aMode == AS_MAX1027_SLOW)
- {
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, "temp1_input");
- if (ret<0)
- {
- ERROR("Error in path writing\n");
- return NULL;
- }
- fTemperature = open(buffer, O_RDONLY);
- if (fTemperature < 0)
- {
- ERROR("Error, can't open temperature file.\n");
- return NULL;
- }
- } else {
- fTemperature = -1;
- }
+ adc_dev = (struct as_adc_device *)malloc(sizeof(struct as_adc_device));
- /* Open each channels (0 to 6)*/
- for(i=0 ; i<NUMBER_OF_CHANNELS ; i++){
- fLowSpeed[i] = -1;
- fHighSpeed[i] = -1;
- if (aMode == AS_MAX1027_SLOW)
- {
- ret = snprintf(slow_input_name, 20, SLOW_INPUT_NAME, i);
- if (ret < 0)
- {
- ERROR("Error in path writing\n");
- return NULL;
- }
-
- ret = snprintf(buffer, BUFFER_SIZE, "%s%s", path, slow_input_name);
- if (ret < 0)
- {
- ERROR("Error in path writing\n");
- return NULL;
- }
-
- fLowSpeed[i] = open(buffer, O_RDONLY);
- if (fLowSpeed[i] < 0)
- {
- ERROR("Error, can't open %s\n", buffer);
- return NULL;
- }
- }
- else if ((aMode == AS_MAX1027_FAST))
- {
- ret = snprintf(buffer, BUFFER_SIZE, FAST_INPUT_PATH, i);
- if (ret < 0)
- {
- ERROR("Error in path writing\n");
- return NULL;
- }
-
- fHighSpeed[i] = open(buffer, O_RDONLY);
- if (fHighSpeed[i] < 0)
- {
- ERROR("Error, can't open %s\nIs loadmax.sh launched ?\n", buffer);
- return NULL;
- }
-
- }
- }
+ dev->mode = AS_MAX1027_FAST ;
+ dev->scan_mode = SCAN_MODE_11;
- dev = (struct as_max1027_device *)malloc(sizeof(struct as_max1027_device));
+ adc_dev->chip_param = (void *)dev;
+ adc_dev->device_type = "max1027";
+ adc_dev->device_num = aDeviceNum;
+ adc_dev->vref = 2500; /* Voltage reference is always 2.5V */
- dev->mode = aMode;
- dev->scan_mode = SCAN_MODE_11;
- dev->fConversion = fConversion;
- dev->fSetup = fSetup;
- dev->fAveraging = fAveraging;
- for(i=0 ; i<NUMBER_OF_CHANNELS ; i++)
- {
- dev->fLowSpeed[i] = fLowSpeed[i];
- dev->fHighSpeed[i] = fHighSpeed[i];
- }
- dev->fTemperature = fTemperature;
+ as_max1027_set_averaging(dev, 4);
+ return adc_dev;
- return dev;
+err:
+ free(dev);
+ return NULL;
}
-int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
- int *aTemperature)
-{
+int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *aDev, int aChannel) {
int32_t ret;
+ int32_t value;
+ int file;
+ char buffer[BUFFER_SIZE];
+ struct as_max1027_device *dev;
- /* temperature is read only on slow mode */
- if (aDev->mode != AS_MAX1027_SLOW)
+ dev = (struct as_max1027_device *)aDev->chip_param;
+
+ if ((aChannel >= NUMBER_OF_CHANNELS) || (aChannel < 0)) {
+ ERROR("Wrong num channel\n");
return -1;
+ }
/* launch conversion */
- ret = as_max1027_write_buffer(aDev->fConversion,
- MAX1027_CONV |
- MAX1027_CONV_CHSEL(0) |
- MAX1027_CONV_SCAN(aDev->scan_mode) |
- MAX1027_CONV_TEMP);
- if (ret < 0)
- {
+ snprintf(buffer, BUFFER_SIZE, "%s%s", dev->path, "conversion");
+ file = open(buffer, O_WRONLY);
+ if (file < 0) {
+ ERROR("Can't open conversion file\n");
+ return NULL;
+ }
+ ret = as_write_buffer(file, MAX1027_CONV |
+ MAX1027_CONV_CHSEL(aChannel) |
+ MAX1027_CONV_SCAN(dev->scan_mode));
+ if (ret < 0) {
ERROR("Error launching conversion\n");
return -1;
}
+ close(file);
/* read value */
- ret = as_max1027_read_buffer(aDev->fTemperature, aTemperature);
- if (ret < 0)
- {
- ERROR("Error, reading fTemperature\n");
+ snprintf(buffer, BUFFER_SIZE, "%sin%d_input", dev->path, aChannel);
+ file = open(buffer, O_RDONLY);
+ if (file < 0) {
+ ERROR("Can't open in%d_input file\n", aChannel);
return -1;
}
-
- return 0;
-}
-
-int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv){
- uint8_t avg_register = 0;
- int ret;
-
- switch (aNbConv)
- {
- case 1: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(0);
- aDev->scan_mode = SCAN_MODE_11; /* no scan */
- break;
- case 4: avg_register = MAX1027_AVG_NAVG(0) | MAX1027_AVG_AVGON(1);
- aDev->scan_mode = SCAN_MODE_10; /* scan */
- break;
- case 8: avg_register = MAX1027_AVG_NAVG(1) | MAX1027_AVG_AVGON(1);
- aDev->scan_mode = SCAN_MODE_10; /* scan */
- break;
- case 16: avg_register = MAX1027_AVG_NAVG(2) | MAX1027_AVG_AVGON(1);
- aDev->scan_mode = SCAN_MODE_10; /* scan */
- break;
- case 32: avg_register = MAX1027_AVG_NAVG(3) | MAX1027_AVG_AVGON(1);
- aDev->scan_mode = SCAN_MODE_10; /* scan */
- break;
- default:
- ERROR("%s: unsupported setting\n", __func__);
- return -1;
- }
-
- /* select averaging */
- avg_register |= MAX1027_AVG | MAX1027_AVG_NSCAN(2);
- ret = as_max1027_write_buffer(aDev->fAveraging, avg_register);
- if (ret < 0)
- {
- ERROR("Error, setting averaging\n");
+ ret = as_read_int(file, &value);
+ if (ret < 0) {
+ ERROR("Can't read input file\n");
return -1;
}
+ close(file);
- return aNbConv;
+ return value;
}
-int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev,
- int aChannelNum, int *aValue)
-{
- int32_t ret;
-
- if ((aChannelNum >= NUMBER_OF_CHANNELS) || (aChannelNum < 0))
- {
- ERROR("Wrong num channel\n");
- return -1;
- }
-
- if (aDev->mode == AS_MAX1027_SLOW)
- {
- /* launch conversion */
- ret = as_max1027_write_buffer(aDev->fConversion,
- MAX1027_CONV |
- MAX1027_CONV_CHSEL(aChannelNum) |
- MAX1027_CONV_SCAN(aDev->scan_mode));
- if (ret < 0)
- {
- ERROR("Error launching conversion\n");
- return -1;
- }
-
- /* read value */
- ret = as_max1027_read_buffer(aDev->fLowSpeed[aChannelNum], aValue);
- if (ret < 0)
- {
- ERROR("Error, reading fLowSpeed[%d]\n", aChannelNum);
- return -1;
- }
- }
- else if (aDev->mode == AS_MAX1027_FAST)
- {
- ERROR("TODO: fast mode channel reading\n");
- return -1;
- }
- else
- {
- ERROR("Unknown mode\n");
- return -1;
- }
+int32_t as_adc_close_max1027(struct as_adc_device *aDev) {
+ struct as_max1027_device *dev =
+ (struct as_max1027_device *)aDev->chip_param;
+ free(dev);
return 0;
}
-int32_t as_max1027_close(struct as_max1027_device *aDev)
-{
- int i;
- if (aDev->fConversion > 0) close(aDev->fConversion);
- if (aDev->fSetup > 0) close(aDev->fSetup);
- if (aDev->fAveraging > 0) close(aDev->fAveraging);
+/**************************/
+/* old Not used functions */
+/**************************/
+
+//int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
+// int *aTemperature)
+//{
+// int32_t ret;
+//
+// /* temperature is read only on slow mode */
+// if (aDev->mode != AS_MAX1027_SLOW)
+// return -1;
+//
+// /* launch conversion */
+// ret = as_write_buffer(aDev->fConversion,
+// MAX1027_CONV |
+// MAX1027_CONV_CHSEL(0) |
+// MAX1027_CONV_SCAN(aDev->scan_mode) |
+// MAX1027_CONV_TEMP);
+// if (ret < 0)
+// {
+// ERROR("Error launching conversion\n");
+// return -1;
+// }
+//
+// /* read value */
+// ret = as_read_int(aDev->fTemperature, aTemperature);
+// if (ret < 0)
+// {
+// ERROR("Error, reading fTemperature\n");
+// return -1;
+// }
+//
+// return 0;
+//}
- if (aDev->fTemperature > 0) close(aDev->fTemperature);
- for (i=0 ; i<NUMBER_OF_CHANNELS; i++)
- {
- if (aDev->fLowSpeed[i] > 0) close(aDev->fLowSpeed[i]);
- if (aDev->fHighSpeed[i] > 0) close(aDev->fHighSpeed[i]);
- }
-
- free(aDev);
-
- return 0;
-}
diff --git a/target/packages/as_devices/c/as_max1027.h b/target/packages/as_devices/c/as_max1027.h
index c094831..edd071f 100644
--- a/target/packages/as_devices/c/as_max1027.h
+++ b/target/packages/as_devices/c/as_max1027.h
@@ -25,78 +25,25 @@
extern "C" {
#endif
+#include "as_adc.h"
#define NUMBER_OF_CHANNELS (7)
+#define PATH_SIZE (50)
typedef enum {
AS_MAX1027_FAST,
AS_MAX1027_SLOW
} AS_max1027_mode;
-/**
- * Store max1027 parameters
- */
struct as_max1027_device {
AS_max1027_mode mode;
uint8_t scan_mode;
- uint8_t fConversion; /**< File handler for conversion register */
- uint8_t fSetup; /**< File handler for setup register */
- uint8_t fAveraging; /**< File handler for averaging register */
- uint8_t fLowSpeed[NUMBER_OF_CHANNELS]; /**< Files handlers for lowspeed */
- uint8_t fHighSpeed[NUMBER_OF_CHANNELS]; /**< Files handlers for high speed */
- uint8_t fTemperature; /**< File handler for temperature */
-
+ char path[PATH_SIZE];
};
-/** @brief Open max1027
- *
- * @param aSpiNum spi bus number used
- * @param aMode enum to set mode (fast or slow)
- *
- * @return as_max1027_device structure pointer, NULL if error
- */
-struct as_max1027_device *as_max1027_open(int aSpiNum,
- AS_max1027_mode aMode);
-
-/** @brief set averaging measurement
- *
- * @param as_max1027_device structure pointer.
- * @param aNbConv number of conversions to do for the averaging (4, 8, 16, 32). Set to 1 for disabling averaging.
- *
- * @return negative value on error and aNbConv on success
- */
-int32_t as_max1027_set_averaging(struct as_max1027_device *aDev, uint8_t aNbConv);
-
-/** @brief read temperature in milidegree â°C
- *
- * @param as_max1027_device structure pointer.
- * @param aTemperature pointer for temperature result.
- *
- * @return negative value on error
- *
- * @note Only slow mode can read temperature value.
- */
-int32_t as_max1027_read_temperature_mC(struct as_max1027_device *aDev,
- int *aTemperature);
-
-/** @brief read milivoltage value
- *
- * @param as_max1027_device structure pointer.
- * @param aChannelNum channel number to read.
- * @param *aValue pointer to returned value.
- *
- * @return negative value on error
- */
-int32_t as_max1027_get_value_milliVolt(struct as_max1027_device *aDev,
- int aChannelNum,
- int *aValue);
-
-/** @brief Close max1027
- *
- * @param aDev structure device pointer
- *
- * @return negative value on error
- */
-int32_t as_max1027_close(struct as_max1027_device *aDev);
+struct as_adc_device *as_adc_open_max1027(int aDeviceNum, int aVRef);
+int32_t as_adc_get_value_in_millivolts_max1027(struct as_adc_device *aDev,
+ int aChannel);
+int32_t as_adc_close_max1027(struct as_adc_device *aDev);
#ifdef __cplusplus
}
diff --git a/target/packages/as_devices/python/AsDevices/AsAdc.py b/target/packages/as_devices/python/AsDevices/AsAdc.py
index ff1f876..d46aa05 100644
--- a/target/packages/as_devices/python/AsDevices/AsAdc.py
+++ b/target/packages/as_devices/python/AsDevices/AsAdc.py
@@ -79,12 +79,12 @@ class AsAdc:
@classmethod
def getInstance(cls, aAdcType, aDeviceNum, aVRef):
try:
- return AsAdc.__adc["%d:%d"%(aAdcType, aDeviceNum)]
+ return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
except KeyError:
- AsAdc.__adc["%d:%d"%(aAdcType, aDeviceNum)] =\
+ AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)] =\
cls.__impl(aAdcType, aDeviceNum, aVRef)
- return AsAdc.__adc["%d:%d"%(aAdcType, aDeviceNum)]
+ return AsAdc.__adc["%s:%d"%(aAdcType, aDeviceNum)]
def __init__(self):
""" Initialize adc
diff --git a/target/packages/as_devices/python/src/AsAdc_wrap.c b/target/packages/as_devices/python/src/AsAdc_wrap.c
index e841f62..6179052 100644
--- a/target/packages/as_devices/python/src/AsAdc_wrap.c
+++ b/target/packages/as_devices/python/src/AsAdc_wrap.c
@@ -42,26 +42,25 @@ void initAsAdc_wrap() /* called on first import */
static PyObject * adc_open(PyObject *self, PyObject *args)
{
/* parameters */
+ char *aAdcType;
int aDeviceNum;
- int aAdcType;
int aVref;
struct as_adc_device *dev;
PyObject *ret;
char buff[300];
/* Get arguments */
- if (!PyArg_ParseTuple(args, "iii", &aDeviceNum, &aAdcType, &aVref))
+ if (!PyArg_ParseTuple(args, "sii", &aAdcType, &aDeviceNum, &aVref))
{
PyErr_SetString(PyExc_IOError,
"Wrong parameters.");
return NULL;
}
-
- dev = as_adc_open(aDeviceNum, aAdcType, aVref);
+ dev = as_adc_open(aAdcType, aDeviceNum, aVref);
if (dev == NULL)
{
snprintf(buff, 300,
- "Initialization error for ADC type %d bus %d. Is kernel module loaded ?",
+ "Initialization error for ADC type %s bus %d. Is kernel module loaded ?",
aAdcType, aDeviceNum);
PyErr_SetString(PyExc_IOError,buff);
return NULL;
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-18 16:36:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d716aadd2589cfdb196cf52c2d08f09d11018097 (commit)
via 12234d1b392e8d5d0bc27184db00914f17cc3cc1 (commit)
via 23154c1f3f3b347e8393187257aeb3b444ea801d (commit)
via 8f16e7457e33f0c59fdfaae6c83419a1019be3d8 (commit)
from 012699cff0a02fe5b235aba9c675e3c4c305c6c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d716aadd2589cfdb196cf52c2d08f09d11018097
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 17:35:03 2011 +0100
[DEBUG] Makes apf27_recover progress infos cutier
commit 12234d1b392e8d5d0bc27184db00914f17cc3cc1
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 17:32:48 2011 +0100
[DEBUG] Add apf51_recover tool (preliminary version)
commit 23154c1f3f3b347e8393187257aeb3b444ea801d
Merge: 8f16e7457e33f0c59fdfaae6c83419a1019be3d8 012699cff0a02fe5b235aba9c675e3c4c305c6c7
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 14:55:10 2011 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 8f16e7457e33f0c59fdfaae6c83419a1019be3d8
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 12:26:50 2011 +0100
[LINUX] 2.6.38: Makes APF51Dev default baseboard for APF51
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 7 +-
software/uboot_recover/apf27_recover.py | 14 +-
software/uboot_recover/apf51_recover.py | 574 ++++++++++++++++++++
3 files changed, 584 insertions(+), 11 deletions(-)
create mode 100644 software/uboot_recover/apf51_recover.py
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index a663e5b..6c43b58 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38-rc3 Kernel Configuration
-# Wed Feb 16 17:40:42 2011
+# Fri Feb 18 12:09:19 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -256,6 +256,7 @@ CONFIG_ARCH_MXC=y
CONFIG_IMX_HAVE_PLATFORM_FEC=y
CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS=y
CONFIG_IMX_HAVE_PLATFORM_IMX_I2C=y
+CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD=y
CONFIG_IMX_HAVE_PLATFORM_IMX_SSI=y
CONFIG_IMX_HAVE_PLATFORM_IMX_UART=y
CONFIG_IMX_HAVE_PLATFORM_MXC_NAND=y
@@ -288,8 +289,8 @@ CONFIG_SOC_IMX51=y
# CONFIG_MACH_MX53_LOCO is not set
CONFIG_MACH_APF51=y
CONFIG_MACH_APF51_HAS_BASEBOARD=y
-# CONFIG_MACH_APF51_DEV is not set
-CONFIG_MACH_APF51_PROTO=y
+CONFIG_MACH_APF51_DEV=y
+# CONFIG_MACH_APF51_PROTO is not set
# CONFIG_MXC_IRQ_PRIOR is not set
CONFIG_MXC_TZIC=y
# CONFIG_MXC_PWM is not set
diff --git a/software/uboot_recover/apf27_recover.py b/software/uboot_recover/apf27_recover.py
index d96b252..30500d6 100644
--- a/software/uboot_recover/apf27_recover.py
+++ b/software/uboot_recover/apf27_recover.py
@@ -1,7 +1,7 @@
#
# APF27 bootloader recovering tool
#
-# Copyright (2008) ARMADEUS
+# Copyright (C) 2008-2009 ARMadeus Systems
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -118,6 +118,7 @@ class apf27Bootloader:
def __displayProgress(self, text):
sys.stdout.write(chr(13))
print text,
+ sys.stdout.flush()
# addr: address to read
# count: number of bytes to read
@@ -203,10 +204,10 @@ class apf27Bootloader:
self.port.write(data)
count = count + 16
- if (count % 512) == 0:
- self.__displayProgress( "%d bytes " % count )
+ if (count % 1024) == 0:
+ self.__displayProgress("%06d bytes" % count)
data = f.read(16)
- self.__displayProgress( "%d bytes transfered" % count )
+ self.__displayProgress("%d bytes transfered" % count)
print ""
f.close()
self.getstatus()
@@ -327,7 +328,7 @@ class UBoot:
if not os.path.exists(BINARY):
raise Error("file "+BINARY+" doesn't exit",0)
fsize = "%08x" % os.path.getsize(BINARY) #os.stat(filesize)[6]
- self.bootstrap.download("A0000000",BINARY, fsize)
+ self.bootstrap.download("A0000000", BINARY, fsize)
def resetenv(self):
self.serial.write("run flash_reset_env\n")
@@ -383,6 +384,3 @@ if __name__ == "__main__":
del ser
-
-
-
diff --git a/software/uboot_recover/apf51_recover.py b/software/uboot_recover/apf51_recover.py
new file mode 100644
index 0000000..955a505
--- /dev/null
+++ b/software/uboot_recover/apf51_recover.py
@@ -0,0 +1,574 @@
+#
+# APF51 bootloader recovering tool
+#
+# Copyright (C) 2010-2011 ARMadeus Systems
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# authors: nic...@ar..., eri...@ar...
+#
+#
+
+import sys
+import time
+from struct import *
+import os
+import serial
+import thread
+import re
+
+class Error(Exception):
+ """ Manage specific error
+
+ attributes:
+ message -- the message
+ level -- the exception level
+ """
+
+ def __init__(self,message,level=0):
+ self._message = message
+ self.level = level
+ Exception.__init__(self,message)
+
+ def __repr__(self):
+ return self.message
+
+ def _get_message(self):
+ return self._message
+ def _set_message(self, message):
+ self._message = message
+ message = property(_get_message, _set_message)
+
+
+ def __str__(self):
+ print self.message
+
+ def setLevel(self,level):
+ self.level = int(str(level))
+ def getLevel(self):
+ return self.level
+
+class apf51Bootloader:
+
+ statuscode = { 0x8D: 'data specified is out of bounds',
+ 0x55: 'error during assert verification',
+ 0x36: 'hash verification failed',
+ 0x33: 'certificate parsing failed or the certificate contained an unsupported key',
+ 0x35: 'signature verification failed',
+ 0x47: 'Super-Root key installation failed',
+ 0x39: 'Failure not matching any other description',
+ 0x4B: 'CSF command sequence contains unsupported command identifier',
+ 0x4E: 'absence of expected CSF header',
+ 0x4D: 'CSF length is unsupported',
+ 0x2E: 'CSF TYPE does not match processor TYPE',
+ 0x2D: 'CSF UID does not match either processor UID or generic UID',
+ 0x3A: 'CSF customer/product code does not match processor customer/product code',
+ 0x87: 'key indexis either unsupported, or an attempt is made to overwrite the SRK from a CSF command',
+ 0xF0: 'successful operation completion',
+ 0x17: 'SCC unexpectedly not in secure state',
+ 0x1E: 'secureRAM secret key invalid',
+ 0x1D: 'secureRAM initialization failure',
+ 0x1B: 'secureRAM self test failure',
+ 0x2B: 'secureRAM internal failure',
+ 0x27: 'secureRAM secrect key unexpectedly in use',
+ 0x3C: 'SAHARA failure',
+ 0x59: 'SAHARA/SCC connectivity failure',
+ 0xA3: 'All RTIC regions are allocated',
+ 0x93: 'RTIC/SCC connectivity failure',
+ 0x0F: 'SHW is not enabled',
+ 0x8B: 'an attempt is made to read a key from the list of subordinate public keys at a location where no key is installed',
+ 0x8E: 'algorithm type is either invalid or ortherwise unsupported',
+ 0x66: 'write operation to register failed',
+ 0x88: 'Successful download completion' }
+
+
+ def __init__(self, serialport ):
+ self.port = serialport
+
+
+ def getstatus(self):
+ self.port.flushInput()
+ #print 'get Status'
+ self.port.write( self.buildcmd("0505" ,"00000000","l","00000000","00000000","0" ))
+ result = self.port.read(4)
+ if len(result) > 0:
+ try:
+ print self.statuscode[ord(result[0])]
+ for i in range(len(result)):
+ print '%02x' % ord(result[i]),
+ except KeyError,e:
+ print "Unknown status "+str(ord(result[0]))
+ else:
+ print '\nread timeout'
+
+ def __displayProgress(self, text):
+ sys.stdout.write(chr(13))
+ print text,
+ sys.stdout.flush()
+
+# addr: address to read
+# count: number of bytes to read
+# mode: b, w, l for byte, word, long
+
+ def get( self, addr, count, mode ):
+ assert len(addr) <= 8, 'address too long'
+ assert int(count,16) > 0, 'zero length get'
+ assert int(count,16) < 0xffffffff, 'Too long get, should be < 31 bytes'
+ self.port.write( self.buildcmd("0101" ,addr,mode,count.zfill(9-len(count)),"00000000","0" ) )
+
+ #nbbyte = 1
+ #if mode == 'w':
+ # nbbyte = 2
+ #if mode == 'l':
+ # nbbyte = 4
+
+ #nbbyte = nbbyte * int(count)
+ temp = self.port.read(int(count)+4) # read n+4 char
+ if len(temp) == 0:
+ print 'read timeout'
+ return
+ #print '\nread ACK:',
+ #for i in range (len(temp)):
+ # print '%02x' % ord(temp[i]),
+
+ #print 'read data:',
+ result = []
+ for i in range (4,len(temp)):
+
+ result += '%02x' % ord(temp[len(temp)-i+3]),
+ print ''.join(result)
+ return ''.join(result)
+
+
+# addr: address where the data have to be written
+# data: data to write. must match the given mode
+
+# mode: b, w, l for byte, word, long
+
+ def put(self, addr, data, mode):
+ assert len(data) > 0, 'zero length put'
+ assert len(addr) == 8, 'address too long'
+ self.port.write( self.buildcmd("0202" ,addr,mode,"00000000",data,"0" ))
+ result = self.port.read(4) #ack
+ if len(result) == 0:
+ print 'read timeout'
+ return
+ #print ' \nwrite ACK:',
+ # for i in range (len(result)):
+ # print '%02x' % ord(result[i]),
+
+ result = self.port.read(4)
+ if len(result) == 0:
+ print 'read timeout'
+ return
+
+ #print '\nwrite success:',
+ #for i in range (len(result)):
+ #print '%02x' % ord(result[i]),
+
+
+ def download(self, addr, data, size, type):
+ assert size > 0, 'file empty'
+ f=open(data, 'rb')
+ self.port.write(self.buildcmd("0404" ,addr,"x", size, "00000000",type))
+ result = self.port.read(4) #ack
+ if len(result) == 0:
+ print '\nread timeout'
+ return
+
+ data = f.read(16)
+ count = int(size,16)
+ total = 0
+ b = 0
+ print '\nTransfering:'
+ while count >= 0: #len(data):
+ n = len(data)
+ b = 16-n # ensure always 4 bytes
+ #tr = unpack('B'*n,data)
+ self.port.write(data)
+ count = count - 16
+ if count < 16:
+ total = total + count
+ else:
+ total = total + 16
+ if (count % 1024) == 0:
+ self.__displayProgress("%06d bytes" % total)
+ data = f.read(16)
+ self.__displayProgress("%d bytes transfered" % total)
+ print ""
+ f.close()
+ return
+
+ def buildcmd(self, cmd, addr, ds, cnt, data, ft):
+ if ds == 'b':
+ datatmp = ('%c' % int('00',16)) + ('%c' % int('00',16)) + ('%c' % int('00',16)) + ('%c' % int(data[0:2],16))
+ datasize = "08"
+ elif ds == 'w':
+ datasize = "10"
+ datatmp = ('%c' % int('00',16)) + ('%c' % int('00',16)) + ('%c' % int(data[0:2],16)) + ('%c' % int(data[2:4],16))
+ elif ds == 'l':
+ datasize = "20"
+ datatmp = ('%c' % int(data[0:2],16)) + ('%c' % int(data[2:4],16)) + ('%c' % int(data[4:6],16)) + ('%c' % int(data[6:8],16))
+ else:
+ datasize = "00"
+ datatmp = ('%c' % int(data[0:2],16)) + ('%c' % int(data[2:4],16)) + ('%c' % int(data[4:6],16)) + ('%c' % int(data[6:8],16))
+
+ result = ('%c' % int(cmd[0:2],16)) + ('%c' % int(cmd[2:4],16)) + \
+ ('%c' % int(addr[0:2],16)) + ('%c' % int(addr[2:4],16)) + ('%c' % int(addr[4:6],16)) + ('%c' % int(addr[6:8],16)) + \
+ ('%c' % int(datasize,16)) + \
+ ('%c' % int(cnt[0:2],16)) + ('%c' % int(cnt[2:4],16)) + ('%c' % int(cnt[4:6],16)) + ('%c' % int(cnt[6:8],16)) + \
+ datatmp + ('%c' % int(ft,16))
+
+ # for i in range(len(result)):
+ # print '%02x' % ord(result[i]),
+ #print cnt
+ return result
+
+ def initIOMUX(self):
+ print "SDRAM INIT IOMUX APF",
+ # RAS
+ self.put("73FA84A4","00000006","l")
+ # CAS
+ self.put("73FA84A8","00000006","l")
+ # SDWE
+ self.put("73FA84AC","000000E6","l")
+ # SDCKE0
+ self.put("73FA84B0","000000E6","l")
+ # SDCKE1
+ self.put("73FA84B4","000000E6","l")
+ # SDCLK
+ self.put("73FA84B8","000000E6","l")
+ # SDQS0
+ self.put("73FA84BC","000000C6","l")
+ # SDQS1
+ self.put("73FA84C0","000000C6","l")
+ # SDQS2
+ self.put("73FA84C4","000000C6","l")
+ # SDQS3
+ self.put("73FA84C8","000000C6","l")
+ # CS0
+ self.put("73FA84CC","000000E6","l")
+ # CS1
+ self.put("73FA84D0","000000E6","l")
+ # DQM0
+ self.put("73FA84D4","000000E6","l")
+ # DQM1
+ self.put("73FA84D8","000000E6","l")
+ # DQM2
+ self.put("73FA84DC","000000E6","l")
+ # DQM3
+ self.put("73FA84E0","000000E6","l")
+ # DDRPKS
+ self.put("73FA8820","00000040","l")
+ # DRAM_B4
+ self.put("73FA882C","00000006","l")
+ # PKEDDR
+ self.put("73FA8838","00000080","l")
+ # DDR_A0
+ self.put("73FA883C","00000006","l")
+ # DDR_A1
+ self.put("73FA8848","00000006","l")
+ # DRAM_SR_B0
+ self.put("73FA8878","00000000","l")
+ # DDRAPKS
+ self.put("73FA887C","00000040","l")
+ # DRAM_SR_B1
+ self.put("73FA8880","00000000","l")
+ # DDRPUS
+ self.put("73FA8884","00000020","l")
+ # DRAM_SR_B2
+ self.put("73FA888C","00000000","l")
+ # PKEADDR
+ self.put("73FA8890","00000080","l")
+ # DRAM_SR_B4
+ self.put("73FA889C","00000000","l")
+ # DRAM_B0
+ self.put("73FA88A4","00000006","l")
+ # DRAM_B1
+ self.put("73FA88AC","00000006","l")
+ # DDR_SR_A0
+ self.put("73FA88B0","00000000","l")
+ # DRAM_B2
+ self.put("73FA88B8","00000006","l")
+ # DDR_SR_A1
+ self.put("73FA88BC","00000000","l")
+
+ def initSDRAM2(self):
+ print "SDRAM INIT2 APF",
+ #ESDCTL0: 13 ROW, 10 COL, 32Bit
+ self.put("83FD9008","82220000","l")
+ #ESDSCR: Precharge command
+ self.put("83FD9014","0400800C","l")
+ #ESDSCR: Refresh command
+ self.put("83FD9014","00008014","l")
+ #ESDSCR: Refresh command
+ self.put("83FD9014","00008014","l")
+ #ESDSCR: LMR with CAS=3 and BL=3 (Burst Length = 8)
+ self.put("83FD9014","0033801C","l")
+ #ESDSCR: EMR with full Drive strength
+ self.put("83FD9014","0000801E","l")
+ #ESDCTL0: 13 ROW, 10 COL, 32Bit, SREF=4
+ self.put("83FD9008","B2420000","l")
+ #ESDCFG0: tRFC:22clks, tXSR:28clks, tXP:3clks, tWTR:2clk, tRP:3clks, tMRD:2clks
+ #tRAS:8clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:11clks
+ self.put("83FD900C","C33574AA","l")
+ #ESDMISC: AP=10, Bank interleaving on, MIF3 en, RALAT=2
+ self.put("83FD9010","000a1700","l")
+
+ def initSDRAM1(self, sdramType):
+ print "SDRAM INIT1 APF",
+ #ESDCTL0: 13 ROW, 10 COL, 32Bit
+ self.put("83FD9000","82220000","l")
+# self.put("83FD9000","82120000","l") # 64MB
+ #ESDSCR: Precharge command
+ self.put("83FD9014","04008008","l")
+ #ESDSCR: Refresh command
+ self.put("83FD9014","00008010","l")
+ #ESDSCR: Refresh command
+ self.put("83FD9014","00008010","l")
+ #ESDSCR: LMR with CAS=3 and BL=3 (Burst Length = 8)
+ self.put("83FD9014","00338018","l")
+ #ESDSCR: EMR with full Drive strength
+ self.put("83FD9014","0000801a","l")
+ #ESDCTL0: 13 ROW, 10 COL, 32Bit, SREF=4
+ self.put("83FD9000","B2420000","l")
+# self.put("83FD9000","D2120000","l") # 64MB
+ #ESDCFG0: tRFC:22clks, tXSR:28clks, tXP:3clks, tWTR:2clk, tRP:3clks, tMRD:2clks
+ #tRAS:8clks, tRRD:2clks, tWR:3clks, tRCD:3clks, tRC:11clks
+ self.put("83FD9004","00459429","l")
+# self.put("83FD9004","FFFFFFFF","l") # 64MB
+ #ESDMISC: AP=10, Bank interleaving on, MIF3 en, RALAT=2
+ self.put("83FD9010","000a1120","l")
+
+ def consoleDump(tid):
+ while 1:
+ sys.stdout.write(tid.read(1))
+ # print '%s' % tid.read(1),
+
+
+class UBoot:
+ """
+ """
+ def __init__(self, bootstrap, serial):
+ self.bootstrap = bootstrap
+ self.serial = serial
+
+ def __getOutput(self,error_msg=None):
+ """ This function waits for U-Boot response and return response"""
+ #debugser = serial.Serial("/dev/tty0",115200,timeout=1)
+ response = ""
+ while not re.search(r'BIOS>',response):
+ char = self.serial.read(1)
+ if char == '':
+ raise Error(response)
+ response = response + char
+ if error_msg!=None:
+ if re.search(error_msg,response):
+ raise Error("getOutput error")
+
+ sys.stdout.write(response)
+ #debugser.write(char)
+ #debugser.close()
+ return response
+
+ def load(self):
+ BINARY = "apf51-u-boot.bin"
+ if not os.path.exists(BINARY):
+ raise Error("file "+BINARY+" doesn't exit",0)
+ fsize = "%08x" % os.path.getsize(BINARY) #os.stat(filesize)[6]
+ print "Loading %s, size = %d bytes" % (BINARY, os.path.getsize(BINARY))
+ self.bootstrap.download("90000000", BINARY, fsize, "AA")
+ self.bootstrap.put("90000000", "90000004", "l")
+ #self.bootstrap.download("1FFE2000",BINARY, "00000400", "AA")
+ self.bootstrap.getstatus()
+
+ def resetenv(self):
+ self.serial.write("run flash_reset_env\n")
+ return self.__getOutput()
+
+ def waitForPrompt(self):
+ time.sleep(1)
+ self.serial.write("\n")
+ return self.__getOutput()
+
+ def flash(self):
+ """ flash uboot """
+ self.serial.write("run flash_uboot\n")
+ try:
+ ret = self.__getOutput()
+ except Error,e:
+ raise Error("Flashing U-Boot")
+ if not re.search(r'uboot succeed',ret):
+ print ret
+ raise Error("U-Boot flash failed",0)
+ return ret
+
+
+if __name__ == "__main__":
+
+ SPEED = 115200
+
+ print "\nAPF51 Bootstrap Tool\n"
+ print "!!! Do not forget to put the bootstrap jumper and to reset your board !!!"
+ print "(be sure to have a u-boot.bin file in current dir too)\n"
+ port = raw_input('Enter serial port number or name to use (/dev/ttyUSBx under Linux or COMx under Windows): ')
+ try:
+ ser = serial.Serial(port, SPEED, timeout=2)
+ except Exception, msg:
+ print "unable to open serial port %s" % port
+ print msg
+ sys.exit()
+ ser.flush()
+
+ apfBootloader = apf51Bootloader(ser)
+ uboot = UBoot(apfBootloader, ser)
+
+ apfBootloader.getstatus()
+# apfBootloader.get("CFFF0000","4", "l")
+# apfBootloader.get("CFFF0004","4", "l")
+# apfBootloader.get("CFFF0008","4", "l")
+# apfBootloader.get("CFFF000C","4", "l")
+# apfBootloader.get("CFFF0400","4", "l")
+# apfBootloader.get("CFFF0404","4", "l")
+# apfBootloader.get("CFFF0408","4", "l")
+# apfBootloader.get("CFFF040C","4", "l")
+# apfBootloader.get("1FFE1A98","4", "l")
+# apfBootloader.get("1FFE0800","4", "l")
+# apfBootloader.get("1FFE0804","4", "l")
+# apfBootloader.get("1FFE0808","4", "l")
+# apfBootloader.get("1FFE080C","4", "l")
+# apfBootloader.get("1FFE0810","4", "l")
+# apfBootloader.get("1FFE2000","4", "l")
+# apfBootloader.get("1FFE2004","4", "l")
+# apfBootloader.get("1FFE2008","4", "l")
+# apfBootloader.get("1FFE200C","4", "l")
+# apfBootloader.get("1FFE0810","4", "l")
+# apfBootloader.get("73FD0000","4", "l")
+# apfBootloader.get("73FD0004","4", "l")
+# apfBootloader.get("73FD0008","4", "l")
+# apfBootloader.get("73FD0014","4", "l")
+ apfBootloader.initIOMUX()
+ apfBootloader.initSDRAM1("APF51")
+
+ #clear configuration request
+ apfBootloader.put("83FD9014","00000000","l")
+
+ apfBootloader.put("90000000", "00000001", "l")
+ apfBootloader.put("90000004", "00000002", "l")
+ apfBootloader.put("90000008", "00000004", "l")
+ apfBootloader.put("90000010", "00000008", "l")
+ apfBootloader.put("90000020", "00000010", "l")
+ apfBootloader.put("9000002C", "00000020", "l")
+ apfBootloader.put("90000040", "00000040", "l")
+ apfBootloader.put("90000080", "00000080", "l")
+ apfBootloader.put("90000100", "00000100", "l")
+ apfBootloader.put("90000200", "00000200", "l")
+ apfBootloader.put("90000400", "00000400", "l")
+ apfBootloader.put("90000800", "00000800", "l")
+ apfBootloader.put("90001000", "00001000", "l")
+ apfBootloader.put("90001004", "00002000", "l")
+ apfBootloader.put("90002000", "00004000", "l")
+ apfBootloader.put("90004000", "00008000", "l")
+ apfBootloader.put("90010000", "00010000", "l")
+ apfBootloader.put("90020000", "00020000", "l")
+ apfBootloader.put("90040000", "00040000", "l")
+ apfBootloader.put("90080000", "00080000", "l")
+ apfBootloader.put("90100000", "00100000", "l")
+ apfBootloader.put("90200000", "00200000", "l")
+ apfBootloader.put("90400000", "00400000", "l")
+ apfBootloader.put("90800000", "00800000", "l")
+ apfBootloader.put("91000000", "01000000", "l")
+ apfBootloader.put("92000000", "02000000", "l")
+ apfBootloader.put("93000000", "04000000", "l")
+ apfBootloader.put("90000024", "08000000", "l")
+ apfBootloader.put("90000014", "10000000", "l")
+ apfBootloader.put("90000018", "20000000", "l")
+ apfBootloader.put("9000001C", "40000000", "l")
+ apfBootloader.put("90000024", "80000000", "l")
+
+ time.sleep(1)
+
+ apfBootloader.get("90000000", "4", "l")
+ apfBootloader.get("90000004", "4", "l")
+ apfBootloader.get("90000008", "4", "l")
+ apfBootloader.get("90000010", "4", "l")
+ apfBootloader.get("90000020", "4", "l")
+ apfBootloader.get("9000002C", "4", "l")
+ apfBootloader.get("90000040", "4", "l")
+ apfBootloader.get("90000080", "4", "l")
+ apfBootloader.get("90000100", "4", "l")
+ apfBootloader.get("90000200", "4", "l")
+ apfBootloader.get("90000400", "4", "l")
+ apfBootloader.get("90000800", "4", "l")
+ apfBootloader.get("90001000", "4", "l")
+ apfBootloader.get("90001004", "4", "l")
+ apfBootloader.get("90002000", "4", "l")
+ apfBootloader.get("90004000", "4", "l")
+ apfBootloader.get("90010000", "4", "l")
+ apfBootloader.get("90020000", "4", "l")
+ apfBootloader.get("90040000", "4", "l")
+ apfBootloader.get("90080000", "4", "l")
+ apfBootloader.get("90100000", "4", "l")
+ apfBootloader.get("90200000", "4", "l")
+ apfBootloader.get("90400000", "4", "l")
+ apfBootloader.get("90800000", "4", "l")
+ apfBootloader.get("91000000", "4", "l")
+ apfBootloader.get("92000000", "4", "l")
+ apfBootloader.get("93000000", "4", "l")
+ apfBootloader.get("90000024", "4", "l")
+ apfBootloader.get("90000014", "4", "l")
+ apfBootloader.get("90000018", "4", "l")
+ apfBootloader.get("9000001C", "4", "l")
+ apfBootloader.get("90000024", "4", "l")
+
+ # configure iomux as gpio for NAND_RB1 et RB2
+ # apfBootloader.put("73FA8120", "00000003", "l")
+ # apfBootloader.put("73FA8124", "00000003", "l")
+ # apfBootloader.put("73FA8128", "00000003", "l")
+ print 'NFC'
+ apfBootloader.get("83FDB02C","4", "l")
+ apfBootloader.get("83FDB024","4", "l")
+ apfBootloader.get("83FDB02C","4", "l")
+ print 'config3'
+ apfBootloader.get("83FDB028","4", "l")
+ print 'SBMR'
+ apfBootloader.get("73FD0004","4", "l")
+
+ uboot.load()
+ uboot.waitForPrompt()
+# apfBootloader.getstatus()
+ #apfBootloader.put("73fb4010","00000000", "l")
+# ser.flush()
+# apfBootloader.put("73FC0080", "00000000", "l")
+
+# apfBootloader.get("1FFE2000","4", "l")
+
+# apfBootloader.get("90000004","4", "l")
+# apfBootloader.get("90000008","4", "l")
+# apfBootloader.get("9000000C","4", "l")
+# apfBootloader.get("90000010","4", "l")
+# apfBootloader.get("90000014","4", "l")
+# apfBootloader.get("90001140","4", "l")
+# apfBootloader.get("90001148","4", "l")
+# apfBootloader.get("9000114C","4", "l")
+
+ eraseAll = raw_input('Would you like to erase the environment variables ? y/N: ')
+ if eraseAll == 'y':
+ uboot.resetenv()
+ uboot.flash()
+ print "U-Boot successfully recovered !"
+
+ del ser
+
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-02-18 10:43:02
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 012699cff0a02fe5b235aba9c675e3c4c305c6c7 (commit)
from c63b88554c43a17c1926a70d71cad84caa04502f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 012699cff0a02fe5b235aba9c675e3c4c305c6c7
Author: Nicolas Colombain <nic...@ar...>
Date: Fri Feb 18 11:42:40 2011 +0100
[LINUX] APF51Dev clean up and add CONTRAST line
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index 829a536..dc6a63d 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -57,7 +57,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-18 10:13:10.000000000 +0100
-@@ -0,0 +1,430 @@
+@@ -0,0 +1,431 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -181,6 +181,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ (_MX51_PAD_DISP1_DAT23__DISP1_DAT23 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
+ (_MX51_PAD_DI1_PIN2__DI1_PIN2 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)), /* HSYNC */
+ (_MX51_PAD_DI1_PIN3__DI1_PIN3 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)), /* VSYNC */
++ (_MX51_PAD_DI1_D1_CS__DI1_D1_CS | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)), /* CONTRAST */
+
+ /* SSI */
+ MX51_PAD_AUD3_BB_TXD__AUD3_TXD,
@@ -395,14 +396,14 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ gpio_direction_output(WIFI_RESET, 1);
+
+ /* USER */
-+ gpio_request(USER_LED_GPIO, "USER_LED_GPIO");
++ rc = gpio_request(USER_LED_GPIO, "USER_LED_GPIO");
+ if (rc){
+ pr_debug("failed to get User LED GPIO: %d\n", rc);
+ return rc;
+ }
+ gpio_direction_output(USER_LED_GPIO, 1);
+
-+ gpio_request(USER_SWITCH_GPIO, "USER_SWITCH_GPIO");
++ rc = gpio_request(USER_SWITCH_GPIO, "USER_SWITCH_GPIO");
+ if (rc){
+ pr_debug("failed to get User Switch GPIO: %d\n", rc);
+ return rc;
@@ -410,7 +411,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ gpio_direction_input(USER_SWITCH_GPIO);
+
+ /* HDMI */
-+ gpio_request(HDMI_DETECT_GPIO, "HDMI_DETECT_GPIO");
++ rc = gpio_request(HDMI_DETECT_GPIO, "HDMI_DETECT_GPIO");
+ if (rc){
+ pr_debug("failed to get HDMI detect GPIO: %d\n", rc);
+ return rc;
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-02-18 10:39:20
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via c63b88554c43a17c1926a70d71cad84caa04502f (commit)
via 1d7106835164f8ec7689381b30f11906dbfcf524 (commit)
from 508d93efeed222e611a4c7ac50d8fd00b226349a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c63b88554c43a17c1926a70d71cad84caa04502f
Merge: 1d7106835164f8ec7689381b30f11906dbfcf524 508d93efeed222e611a4c7ac50d8fd00b226349a
Author: Nicolas Colombain <nic...@ar...>
Date: Fri Feb 18 11:38:50 2011 +0100
Merge branch 'master' of ssh://thom25@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 1d7106835164f8ec7689381b30f11906dbfcf524
Author: Nicolas Colombain <nic...@ar...>
Date: Fri Feb 18 11:37:47 2011 +0100
[U-BOOT] APF51 fix contrast line state at startup
-----------------------------------------------------------------------
Summary of changes:
.../target/u-boot/u-boot-2010.03-401-apf51.patch | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
index 6bb476e..774505d 100644
--- a/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
+++ b/buildroot/target/u-boot/u-boot-2010.03-401-apf51.patch
@@ -481,7 +481,7 @@ Index: u-boot-2010.03/board/armadeus/apf51/apf51.c
+ /*
+ * Configure iomux for display 1 interface
+ */
-+ mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT0);
++ mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4);
+// missing in DS mxc_request_iomux(MX51_PIN_DI1_DISP_CLK, IOMUX_CONFIG_ALT0);
+ mxc_request_iomux(MX51_PIN_DI1_PIN2, IOMUX_CONFIG_ALT0);
+ mxc_request_iomux(MX51_PIN_DI1_PIN3, IOMUX_CONFIG_ALT0);
hooks/post-receive
--
armadeus
|
|
From: Fabien M <fa...@us...> - 2011-02-18 10:26:05
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 508d93efeed222e611a4c7ac50d8fd00b226349a (commit)
via 9a418c673a945dd7d03a7ba324b0131fe4cd97ae (commit)
via 30de9a33596cea9d5a0cb1df897383c86d38ebb4 (commit)
from 75c993f742796ed130ee404b4cacb364e77fb269 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 508d93efeed222e611a4c7ac50d8fd00b226349a
Merge: 9a418c673a945dd7d03a7ba324b0131fe4cd97ae 75c993f742796ed130ee404b4cacb364e77fb269
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 11:25:42 2011 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 9a418c673a945dd7d03a7ba324b0131fe4cd97ae
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 18 11:24:12 2011 +0100
[uclibc] adding UCLIBC_SUSV3_LEGACY option to get time in ms
commit 30de9a33596cea9d5a0cb1df897383c86d38ebb4
Author: Fabien Marteau <fab...@ar...>
Date: Fri Feb 11 18:47:27 2011 +0100
[as_devices] Changes as_i2c API
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf27/uClibc-0.9.30.config.arm | 2 +-
.../target/device/armadeus/apf27/uClibc.config.arm | 2 +-
target/packages/as_devices/c/Makefile | 2 +-
target/packages/as_devices/c/as_i2c.c | 134 +++++++++++++++-----
target/packages/as_devices/c/as_i2c.h | 101 ++++-----------
5 files changed, 134 insertions(+), 107 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm b/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm
index 0ef197a..3cb1cf7 100644
--- a/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm
+++ b/buildroot/target/device/armadeus/apf27/uClibc-0.9.30.config.arm
@@ -103,7 +103,7 @@ MALLOC_STANDARD=y
MALLOC_GLIBC_COMPAT=y
UCLIBC_DYNAMIC_ATEXIT=y
# COMPAT_ATEXIT is not set
-# UCLIBC_SUSV3_LEGACY is not set
+UCLIBC_SUSV3_LEGACY=y
# UCLIBC_SUSV3_LEGACY_MACROS is not set
# UCLIBC_HAS_STUBS is not set
UCLIBC_HAS_SHADOW=y
diff --git a/buildroot/target/device/armadeus/apf27/uClibc.config.arm b/buildroot/target/device/armadeus/apf27/uClibc.config.arm
index 1ce0190..7beee2b 100644
--- a/buildroot/target/device/armadeus/apf27/uClibc.config.arm
+++ b/buildroot/target/device/armadeus/apf27/uClibc.config.arm
@@ -95,7 +95,7 @@ MALLOC_STANDARD=y
MALLOC_GLIBC_COMPAT=y
UCLIBC_DYNAMIC_ATEXIT=y
# COMPAT_ATEXIT is not set
-# UCLIBC_SUSV3_LEGACY is not set
+UCLIBC_SUSV3_LEGACY=y
# UCLIBC_SUSV3_LEGACY_MACROS is not set
UCLIBC_HAS_SHADOW=y
# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
diff --git a/target/packages/as_devices/c/Makefile b/target/packages/as_devices/c/Makefile
index 77be4a4..ba754b7 100644
--- a/target/packages/as_devices/c/Makefile
+++ b/target/packages/as_devices/c/Makefile
@@ -16,7 +16,7 @@ endif
OBJ += as_93lcxx.o
OBJ += as_spi.o
#OBJ += as_max1027.o
-OBJ += as_max5821.o
+#OBJ += as_max5821.o
OBJ += as_helpers.o
OBJ += as_adc.o
diff --git a/target/packages/as_devices/c/as_i2c.c b/target/packages/as_devices/c/as_i2c.c
index 970bc89..2fa54c6 100644
--- a/target/packages/as_devices/c/as_i2c.c
+++ b/target/packages/as_devices/c/as_i2c.c
@@ -15,11 +15,12 @@
*
*
* Copyright (C) 2009 Benoît Ryder <be...@ry...>
+ * Copyright (C) 2010, 2011 Fabien Marteau <fab...@ar...>
*
*/
-
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -29,92 +30,156 @@
#include "as_i2c.h"
+#undef ERROR
+#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
/* Format of path to I2C devices */
#define AS_I2C_DEV_PATH_FMT "/dev/i2c-%u"
#define _STR(x) #x
#define AS_I2C_DEV_PATH_SIZE (sizeof(AS_I2C_DEV_PATH_FMT)-2+sizeof(_STR(AS_I2C_DEV_COUNT))-1)
-
-int as_i2c_open(unsigned int i2c_id)
+struct as_i2c_device *as_i2c_open(int aBusNumber)
{
char buf[AS_I2C_DEV_PATH_SIZE];
+ int fdev;
+ struct as_i2c_device *dev;
+
+ snprintf(buf, sizeof(buf), AS_I2C_DEV_PATH_FMT, aBusNumber);
+
+ fdev = open(buf, O_RDWR);
+ if (fdev < 0) {
+ ERROR("Can't open i2c bus /dev/i2c-%d\n", aBusNumber);
+ return NULL;
+ }
- snprintf(buf, sizeof(buf), AS_I2C_DEV_PATH_FMT, i2c_id);
+ dev = malloc(sizeof(struct as_i2c_device));
+ if (dev == NULL) {
+ ERROR("Can't allocate memory for device structure\n");
+ return NULL;
+ }
- return open(buf, O_RDWR);
+ dev->i2c_id = aBusNumber;
+ dev->slave_addr = 0;
+ dev->fi2c = fdev;
+
+ return dev;
}
-int as_i2c_close(int fd)
+int32_t as_i2c_close(struct as_i2c_device *aDev)
{
- return close(fd);
+ close(aDev->fi2c);
+ free(aDev);
+
+ return 0;
}
-int as_i2c_set_slave(int fd, uint8_t addr)
+int32_t as_i2c_set_slave_addr(struct as_i2c_device *aDev, uint8_t aAddr)
{
- if (ioctl(fd, I2C_SLAVE_FORCE, addr) < 0)
+ if (aAddr == 0) {
+ ERROR("Wrong slave address\n");
return -1;
+ }
+ if (ioctl(aDev->fi2c, I2C_SLAVE_FORCE, aAddr) < 0) {
+ ERROR("Can't set slave address\n");
+ return -1;
+ }
+ aDev->slave_addr = aAddr;
return 0;
}
+int32_t as_i2c_get_slave_addr(struct as_i2c_device *aDev) {
+ return aDev->slave_addr;
+}
-int as_i2c_read(int fd, uint8_t addr, uint8_t *data, size_t n)
+int32_t as_i2c_read(struct as_i2c_device *aDev,
+ uint8_t *aData, size_t n)
{
- struct i2c_msg msg = { addr, I2C_M_RD, n, data };
+ struct i2c_msg msg = { aDev->slave_addr, I2C_M_RD, n, aData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
- if (ioctl(fd, I2C_RDWR, &rdwr) < 0)
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
+
+ if (ioctl(aDev->fi2c, I2C_RDWR, &rdwr) < 0)
return -1;
return 0;
}
-int as_i2c_write(int fd, uint8_t addr, const uint8_t *data, size_t n)
+int32_t as_i2c_write(struct as_i2c_device *aDev,
+ uint8_t *aData, size_t n)
{
- struct i2c_msg msg = { addr, 0, n, (uint8_t *)data };
+ struct i2c_msg msg = { aDev->slave_addr, 0, n, (uint8_t *)aData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
- if (ioctl(fd, I2C_RDWR, &rdwr) < 0)
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
+
+ if (ioctl(aDev->fi2c, I2C_RDWR, &rdwr) < 0)
return -1;
return 0;
}
-
-int as_i2c_read_reg(int fd, uint8_t addr, uint8_t reg, uint8_t *data, size_t n)
+int32_t as_i2c_read_reg(struct as_i2c_device *aDev,
+ uint8_t aReg, uint8_t *aData, size_t n)
{
/* write reg */
- struct i2c_msg msg = { addr, 0, 1, ® };
+ struct i2c_msg msg = { aDev->slave_addr, 0, 1, &aReg };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
- if (ioctl(fd, I2C_RDWR, &rdwr) < 0)
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
+
+ if (ioctl(aDev->fi2c, I2C_RDWR, &rdwr) < 0) {
+ ERROR("Can't write on i2c\n");
return -1;
+ }
/* read data */
msg.flags = I2C_M_RD;
msg.len = n;
- msg.buf = data;
- if (ioctl(fd, I2C_RDWR, &rdwr) < 0)
+ msg.buf = aData;
+
+ if (ioctl(aDev->fi2c, I2C_RDWR, &rdwr) < 0) {
+ ERROR("Can't read on i2c\n");
return -2;
+ }
return 0;
}
-int as_i2c_write_reg(int fd, uint8_t addr, uint8_t reg, const uint8_t *data, size_t n)
+int32_t as_i2c_write_reg(struct as_i2c_device *aDev,
+ uint8_t aReg, const uint8_t *aData, size_t n)
{
uint8_t buf[n+1];
- buf[0] = reg;
- memcpy(buf+1, data, n);
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
- return as_i2c_write(fd, addr, buf, sizeof(buf));
-}
+ buf[0] = aReg;
+ memcpy(buf+1, aData, n);
+ return as_i2c_write(aDev, buf, sizeof(buf));
+}
-int as_i2c_read_reg_byte(int fd, uint8_t addr, uint8_t reg)
+int32_t as_i2c_read_reg_byte(struct as_i2c_device *aDev, uint8_t aReg)
{
uint8_t val;
- int ret = as_i2c_read_reg(fd, addr, reg, &val, 1);
+ int ret = as_i2c_read_reg(aDev, aReg, &val, 1);
+
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
if (ret < 0)
return ret;
@@ -122,9 +187,16 @@ int as_i2c_read_reg_byte(int fd, uint8_t addr, uint8_t reg)
return val;
}
-int as_i2c_write_reg_byte(int fd, uint8_t addr, uint8_t reg, uint8_t val)
+int32_t as_i2c_write_reg_byte(struct as_i2c_device *aDev,
+ uint8_t aReg, uint8_t aVal)
{
- uint8_t buf[2] = { reg, val };
+ uint8_t buf[2] = { aReg, aVal };
- return as_i2c_write(fd, addr, buf, 2);
+ if (aDev->slave_addr == 0) {
+ ERROR("Slave address must be set before\n");
+ return -1;
+ }
+
+ return as_i2c_write(aDev, buf, 2);
}
+
diff --git a/target/packages/as_devices/c/as_i2c.h b/target/packages/as_devices/c/as_i2c.h
index 2865631..bab3a95 100644
--- a/target/packages/as_devices/c/as_i2c.h
+++ b/target/packages/as_devices/c/as_i2c.h
@@ -15,25 +15,13 @@
*
*
* Copyright (C) 2009 Benoît Ryder <be...@ry...>
+ * Copyright (C) 2010, 2011 Fabien Marteau <fab...@ar...>
*
*/
#ifndef AS_I2C_H_
#define AS_I2C_H_
-/** @file
- * @brief Provide access to I2C devices.
- *
- * Once opened with as_i2c_open(), the I2C slave address to talk with should be
- * set using as_i2c_set_slave(). Then, standard \e read(), \e write() and
- * close() can be used. Otherwise, methods provided by this module can be used.
- * These methods does not use standard <em>read()/write</em> methods nor
- * combined transactions (several read/write messages in the same transaction).
- *
- * @note All methods will leave \e errno unchanged on system call errors, which
- * will happen when -1 is returned.
- */
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -41,92 +29,59 @@ extern "C" {
#include <inttypes.h>
#include <sys/types.h>
-/* Number of I2C busses on system */
-#define AS_I2C_DEV_COUNT 2
+/**
+ * Store i2c parameters
+ */
+struct as_i2c_device {
+ int i2c_id;
+ int fi2c;
+ uint8_t slave_addr;
+};
/** @brief Open an I2C bus.
- *
- * \e i2c_id is the ID of the I2C bus to open, it should be strictly lower than
- * \e AS_I2C_DEV_COUNT.
- *
- * @return the file descriptor of the opened device, -1 on error.
*/
-int as_i2c_open(unsigned int i2c_id);
+struct as_i2c_device *as_i2c_open(int aBusNumber);
/** @brief Close an I2C device.
- *
- * @return 0 on success, -1 on error.
- *
- * @note This is an alias of the standard \e close() system call.
*/
-int as_i2c_close(int fd);
+int32_t as_i2c_close(struct as_i2c_device *aDev);
-/** @brief Set chip's I2C slave address (to be used with read() & write() method)
- *
- * @return 0 on success, -1 on error.
+/** @brief Set chip's I2C slave address
+ */
+int32_t as_i2c_set_slave_addr(struct as_i2c_device *aDev, uint8_t aAddr);
+
+/** @brief Set chip's I2C slave address
*/
-int as_i2c_set_slave(int fd, uint8_t addr);
+int32_t as_i2c_get_slave_addr(struct as_i2c_device *aDev);
/** @brief Read several bytes (ioctl() method) from given chip.
- *
- * @param addr I2C address of chip to access
- *
- * @return 0 on success, -1 on error.
*/
-int as_i2c_read(int fd, uint8_t addr, uint8_t *data, size_t n);
+int32_t as_i2c_read(struct as_i2c_device *aDev,
+ uint8_t *aData, size_t n);
/** @brief Write several bytes (ioctl() method) to given chip.
- *
- * @param addr I2C address of chip to access
- *
- * @return 0 on success, -1 on error.
*/
-int as_i2c_write(int fd, uint8_t addr, const uint8_t *data, size_t n);
+int32_t as_i2c_write(struct as_i2c_device *aDev,
+ uint8_t *aData, size_t n);
/** @brief Read from given chip at a given register address (ioctl() method).
- *
- * Send the \e reg byte, then read bytes.
- *
- * @param addr I2C address of chip to access
- *
- * @return 0 on success, -1 on write error (\e reg byte), -2 on read error.
*/
-int as_i2c_read_reg(int fd, uint8_t addr, uint8_t reg, uint8_t *data, size_t n);
+int32_t as_i2c_read_reg(struct as_i2c_device *aDev,
+ uint8_t aReg, uint8_t *aData, size_t n);
/** @brief Write to given chip at a given register address (ioctl() method).
- *
- * Send the \e reg byte followed by data.
- *
- * @param addr I2C address of chip to access
- *
- * @return 0 on success, -1 on error.
*/
-int as_i2c_write_reg(int fd, uint8_t addr, uint8_t reg, const uint8_t *data, size_t n);
+int32_t as_i2c_write_reg(struct as_i2c_device *aDev,
+ uint8_t aReg, const uint8_t *aData, size_t n);
/** @brief Read a byte from the given register.
- *
- * Send the \e reg byte, then read and return a single byte.
- *
- * @param addr I2C address of chip to access
- *
- * @return the read byte, -1 on write error (\e reg byte), -2 on read error.
- *
- * @note Equivalent to \e as_i2c_read_reg() with a 1-byte buffer, but return
- * the read byte.
*/
-int as_i2c_read_reg_byte(int fd, uint8_t addr, uint8_t reg);
+int32_t as_i2c_read_reg_byte(struct as_i2c_device *aDev, uint8_t aReg);
/** @brief Write a byte to the given register.
- *
- * Send the \e reg byte followed by the \e val byte.
- *
- * @param addr I2C address of chip to access
- *
- * @return 0 on success, -1 on error.
- *
- * @note Equivalent to \e as_i2c_write() with a 2-byte buffer (reg + data).
*/
-int as_i2c_write_reg_byte(int fd, uint8_t addr, uint8_t reg, uint8_t val);
+int32_t as_i2c_write_reg_byte(struct as_i2c_device *aDev,
+ uint8_t aReg, uint8_t aVal);
#ifdef __cplusplus
}
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-18 09:52:21
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 75c993f742796ed130ee404b4cacb364e77fb269 (commit)
via 92f15f6bacab1aa0eadbec3c062584beb6e307c7 (commit)
from 23e746e2efaca438aab1f5d786dfbd2b772ac71e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 75c993f742796ed130ee404b4cacb364e77fb269
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 10:50:26 2011 +0100
[LINUX] 2.6.38: Adds keypad support to APF51Dev
commit 92f15f6bacab1aa0eadbec3c062584beb6e307c7
Author: Julien Boibessot <jul...@ar...>
Date: Fri Feb 18 09:27:49 2011 +0100
Fixes tfp410ctrl
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 67 +++++++++++++++++--
target/packages/tfp410ctrl/tfp410ctrl.c | 6 +-
2 files changed, 63 insertions(+), 10 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index 80f2bf0..829a536 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -4,9 +4,9 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-16 14:46:00.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-16 19:00:56.000000000 +0100
-@@ -167,12 +167,31 @@
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-18 10:13:10.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-18 10:33:41.000000000 +0100
+@@ -167,12 +167,32 @@
select SOC_IMX51
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_IMX_I2C
@@ -34,6 +34,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
+ select IMX_HAVE_PLATFORM_SPI_IMX
+ select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+ select IMX_HAVE_PLATFORM_IMX_SSI
++ select IMX_HAVE_PLATFORM_IMX_KEYPAD
+ help
+ This selects the APF51Dev as baseboard and adds board's specific
+ devices.
@@ -42,8 +43,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-16 14:46:00.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-16 19:00:56.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-18 10:13:10.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-18 10:33:03.000000000 +0100
@@ -8,6 +8,7 @@
obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -55,8 +56,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-16 16:47:21.000000000 +0100
-@@ -0,0 +1,378 @@
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-18 10:13:10.000000000 +0100
+@@ -0,0 +1,430 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -187,6 +188,17 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ MX51_PAD_AUD3_BB_CK__AUD3_TXC,
+ MX51_PAD_AUD3_BB_FS__AUD3_TXFS,
+
++ /* KEYPAD */
++ MX51_PAD_KEY_ROW0__KEY_ROW0,
++ MX51_PAD_KEY_ROW1__KEY_ROW1,
++ MX51_PAD_KEY_ROW2__KEY_ROW2,
++ MX51_PAD_KEY_ROW3__KEY_ROW3,
++ MX51_PAD_KEY_COL0__KEY_COL0,
++ MX51_PAD_KEY_COL1__KEY_COL1,
++ MX51_PAD_KEY_COL2__KEY_COL2,
++ MX51_PAD_KEY_COL3__KEY_COL3,
++ MX51_PAD_KEY_COL4__KEY_COL4,
++ MX51_PAD_KEY_COL5__KEY_COL5,
+
+ /* ONEWIRE */
+
@@ -408,6 +420,43 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ return 0;
+}
+
++#if defined(CONFIG_KEYBOARD_IMX) || defined(CONFIG_KEYBOARD_IMX_MODULE)
++static int apf51dev_keymap[] = {
++ KEY(0, 0, KEY_1),
++ KEY(0, 1, KEY_2),
++ KEY(0, 2, KEY_3),
++ KEY(0, 3, KEY_F1),
++ KEY(0, 4, KEY_UP),
++ KEY(0, 5, KEY_F2),
++
++ KEY(1, 0, KEY_4),
++ KEY(1, 1, KEY_5),
++ KEY(1, 2, KEY_6),
++ KEY(1, 3, KEY_LEFT),
++ KEY(1, 4, KEY_SELECT),
++ KEY(1, 5, KEY_RIGHT),
++
++ KEY(2, 0, KEY_7),
++ KEY(2, 1, KEY_8),
++ KEY(2, 2, KEY_9),
++ KEY(2, 3, KEY_F3),
++ KEY(2, 4, KEY_DOWN),
++ KEY(2, 5, KEY_F4),
++
++ KEY(3, 0, KEY_0),
++ KEY(3, 1, KEY_OK),
++ KEY(3, 2, KEY_ESC),
++ KEY(3, 3, KEY_ENTER),
++ KEY(3, 4, KEY_MENU),
++ KEY(3, 5, KEY_BACK)
++};
++
++static const struct matrix_keymap_data apf51dev_keymap_data __initconst = {
++ .keymap = apf51dev_keymap,
++ .keymap_size = ARRAY_SIZE(apf51dev_keymap),
++};
++#endif
++
+void __init apf51_baseboard_init(void)
+{
+ mxc_iomux_v3_setup_multiple_pads(apf51dev_pads,
@@ -434,4 +483,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+
+ imx51_add_ipuv3(&apf51dev_ipu_data);
+ imx51_add_imx_ssi(0, &apf27dev_ssi_pdata);
++
++#if defined(CONFIG_KEYBOARD_IMX) || defined(CONFIG_KEYBOARD_IMX_MODULE)
++ imx51_add_imx_keypad(&apf51dev_keymap_data);
++#endif
+}
diff --git a/target/packages/tfp410ctrl/tfp410ctrl.c b/target/packages/tfp410ctrl/tfp410ctrl.c
index 1282063..bb062c6 100644
--- a/target/packages/tfp410ctrl/tfp410ctrl.c
+++ b/target/packages/tfp410ctrl/tfp410ctrl.c
@@ -242,10 +242,10 @@ void load(int fd, char* fileName)
while (fgets(line, MAX_DUMP_LINE, fd_conf) != NULL) {
sscanf(line,"%2X%*c%4X", ®Addr, &val);
printf("reg %02x, value %04x\n", regAddr, val);
- if (regAddr > DE_TOP_REG
- write_word (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
+ if (regAddr > DE_TOP_REG)
+ write_word(fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
else
- write_byte (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
+ write_byte(fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
}
if (fd_conf != NULL)
fclose(fd_conf);
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-17 17:11:48
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 23e746e2efaca438aab1f5d786dfbd2b772ac71e (commit)
from 011eb0d8b9c81d76a24cf526f187ea787bd3abef (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 23e746e2efaca438aab1f5d786dfbd2b772ac71e
Author: Julien Boibessot <jul...@ar...>
Date: Thu Feb 17 18:09:47 2011 +0100
[BUILDROOT] 2010.11: updates default APF51 config
-----------------------------------------------------------------------
Summary of changes:
buildroot/configs/apf51_defconfig | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/buildroot/configs/apf51_defconfig b/buildroot/configs/apf51_defconfig
index f45af9e..521bd42 100644
--- a/buildroot/configs/apf51_defconfig
+++ b/buildroot/configs/apf51_defconfig
@@ -148,8 +148,8 @@ BR2_TOOLCHAIN_BUILDROOT=y
# BR2_KERNEL_HEADERS_2_6_36 is not set
BR2_KERNEL_HEADERS_VERSION=y
# BR2_KERNEL_HEADERS_SNAP is not set
-BR2_DEFAULT_KERNEL_VERSION="2.6.29.6"
-BR2_DEFAULT_KERNEL_HEADERS="2.6.29.6"
+BR2_DEFAULT_KERNEL_VERSION="2.6.38-rc3"
+BR2_DEFAULT_KERNEL_HEADERS="2.6.38-rc3"
#
# uClibc Options
@@ -248,16 +248,17 @@ BR2_PACKAGE_BUSYBOX_CONFIG="target/device/armadeus/busybox-$(BR2_BUSYBOX_VERSION
#
# Armadeus specific tools/utilities
#
-BR2_PACKAGE_AD9889CTRL=y
+# BR2_PACKAGE_AD9889CTRL is not set
# BR2_PACKAGE_AS_DEVICES is not set
# BR2_PACKAGE_CH7024CTRL is not set
# BR2_PACKAGE_ARMADEUS_DEMOS is not set
BR2_PACKAGE_FPGAREGS=y
BR2_PACKAGE_IMXREGS=y
# BR2_PACKAGE_IMXSSI is not set
-BR2_PACKAGE_MAX5821CTRL=y
+# BR2_PACKAGE_MAX5821CTRL is not set
# BR2_PACKAGE_ARMADEUS_PPS_UTILITIES is not set
# BR2_PACKAGE_ARMADEUS_TESTSUITE is not set
+BR2_PACKAGE_TFP410CTRL=y
#
# Audio and video libraries and applications
@@ -452,7 +453,24 @@ BR2_PACKAGE_STRACE=y
# BR2_PACKAGE_E2FSPROGS is not set
# BR2_PACKAGE_EEPROG is not set
# BR2_PACKAGE_FCONFIG is not set
-# BR2_PACKAGE_FIRMWARE is not set
+BR2_PACKAGE_FIRMWARE=y
+
+#
+# Video
+#
+
+#
+# WiFi chipsets
+#
+BR2_PACKAGE_FIRMWARE_88W8686=y
+BR2_PACKAGE_FIRMWARE_88W8686_SDIO=y
+# BR2_PACKAGE_FIRMWARE_88W8686_SDIO_V8 is not set
+BR2_PACKAGE_FIRMWARE_88W8686_SDIO_V9=y
+# BR2_PACKAGE_FIRMWARE_88W8686_GSPI is not set
+
+#
+# Others
+#
# BR2_PACKAGE_FIS is not set
# BR2_PACKAGE_GADGETFS_TEST is not set
# BR2_PACKAGE_GENEXT2FS is not set
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-16 18:15:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 011eb0d8b9c81d76a24cf526f187ea787bd3abef (commit)
via 98f40efefa04aa2ae8a08f68adb1f21014122535 (commit)
from 49c8fe03bc31155369e38de0f2621ad5300f094a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 011eb0d8b9c81d76a24cf526f187ea787bd3abef
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 19:15:01 2011 +0100
[LINUX] 2.6.38: register serial ports of APF51Dev
commit 98f40efefa04aa2ae8a08f68adb1f21014122535
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 19:06:55 2011 +0100
[LINUX] 2.6.38: Add Dynamic Frequency Scaling support to APF51
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf51/apf51-linux-2.6.38.config | 19 ++++++++++++++-
.../2.6.38/400-armadeus-add_apf51_module.patch | 24 +++++++++++--------
.../408-armadeus-add_apf51-dev_baseboard.patch | 20 +++++++++++-----
3 files changed, 45 insertions(+), 18 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
index 59efc4f..a663e5b 100644
--- a/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf51/apf51-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38-rc3 Kernel Configuration
-# Fri Feb 11 17:01:49 2011
+# Wed Feb 16 17:40:42 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -395,7 +395,22 @@ CONFIG_CMDLINE=""
#
# CPU Power Management
#
-# CONFIG_CPU_FREQ is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+CONFIG_CPU_FREQ_IMX=y
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index 8e31a6d..b358b1b 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,7 +1,7 @@
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-03 17:17:35.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-04 09:33:17.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-16 14:45:58.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-16 19:01:05.000000000 +0100
@@ -162,4 +162,17 @@
Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals.
@@ -23,7 +23,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
===================================================================
--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-01 04:05:49.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-04 09:33:17.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-16 19:01:05.000000000 +0100
@@ -7,6 +7,7 @@
obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
@@ -35,8 +35,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c 2011-02-04 09:23:58.000000000 +0100
-@@ -0,0 +1,418 @@
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c 2011-02-16 17:02:46.000000000 +0100
+@@ -0,0 +1,422 @@
+/*
+ * Support for APF51 System On Module
+ * Copyright (C) 2010-2011 Armadeus Systems
@@ -78,6 +78,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c
+
+#include "devices-imx51.h"
+#include "devices.h"
++#include "cpu_op-mx51.h"
+
+extern void apf51_baseboard_init(void);
+
@@ -406,6 +407,9 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c
+ */
+static void __init apf51_board_init(void)
+{
++#if defined(CONFIG_CPU_FREQ_IMX)
++ get_cpu_op = mx51_get_cpu_op;
++#endif
+ mxc_iomux_v3_setup_multiple_pads(apf51_pads,
+ ARRAY_SIZE(apf51_pads));
+
@@ -457,8 +461,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-02-01 04:05:49.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/uncompress.h 2011-02-03 17:17:35.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2011-02-16 14:45:59.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/uncompress.h 2011-02-16 14:46:00.000000000 +0100
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -467,7 +471,7 @@ Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/uncompress.h
#define MX50_UART1_BASE_ADDR 0x53fbc000
#define MX53_UART1_BASE_ADDR 0x53fbc000
-@@ -110,6 +111,9 @@
+@@ -111,6 +112,9 @@
case MACH_TYPE_MX53_EVK:
uart_base = MX53_UART1_BASE_ADDR;
break;
@@ -479,8 +483,8 @@ Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/uncompress.h
}
Index: linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/irqs.h
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-02-01 04:05:49.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/irqs.h 2011-02-03 17:17:35.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/plat-mxc/include/mach/irqs.h 2011-02-16 14:46:00.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/plat-mxc/include/mach/irqs.h 2011-02-16 14:46:00.000000000 +0100
@@ -53,6 +53,8 @@
#define MXC_BOARD_IRQS 80
#elif defined CONFIG_MACH_APF27
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index 910f27c..80f2bf0 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -4,8 +4,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-10 16:30:51.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-11 16:31:20.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Kconfig 2011-02-16 14:46:00.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig 2011-02-16 19:00:56.000000000 +0100
@@ -167,12 +167,31 @@
select SOC_IMX51
select IMX_HAVE_PLATFORM_IMX_UART
@@ -42,8 +42,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-10 16:30:51.000000000 +0100
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-11 16:31:20.000000000 +0100
+--- linux-2.6.38-rc3.orig/arch/arm/mach-mx5/Makefile 2011-02-16 14:46:00.000000000 +0100
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile 2011-02-16 19:00:56.000000000 +0100
@@ -8,6 +8,7 @@
obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -55,8 +55,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-11 16:26:31.000000000 +0100
-@@ -0,0 +1,370 @@
++++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-16 16:47:21.000000000 +0100
+@@ -0,0 +1,378 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -204,6 +204,11 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ (_MX51_PAD_I2C1_DAT__GPIO4_17 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)), /* HDMI_DETECT */
+};
+
++/* Serial ports */
++static struct imxuart_platform_data apf51dev_uart_pdata = {
++ .flags = IMXUART_HAVE_RTSCTS,
++};
++
+static const struct imxi2c_platform_data apf51dev_i2c_data __initconst = {
+ .bitrate = 400000,
+};
@@ -408,6 +413,9 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ mxc_iomux_v3_setup_multiple_pads(apf51dev_pads,
+ ARRAY_SIZE(apf51dev_pads));
+
++ imx51_add_imx_uart(0, &apf51dev_uart_pdata);
++/* imx51_add_imx_uart(1, &apf51dev_uart_pdata);*/
++
+ initGPIO();
+
+ imx51_add_sdhci_esdhc_imx(0, &edshc0_pdata);
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-02-16 11:39:42
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 49c8fe03bc31155369e38de0f2621ad5300f094a (commit)
from 70bc3b3b30a511848f51092e16faafe4638ef047 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 49c8fe03bc31155369e38de0f2621ad5300f094a
Author: Nicolas Colombain <nic...@ar...>
Date: Wed Feb 16 12:39:20 2011 +0100
[BUILDROOT] cleanup tftp410ctrl after review
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/Config.in | 2 +-
buildroot/package/armadeus/tfp410ctrl/Config.in | 1 -
target/packages/tfp410ctrl/tfp410ctrl.c | 56 +++++++++++-----------
3 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/buildroot/package/armadeus/Config.in b/buildroot/package/armadeus/Config.in
index 11e7d09..e407932 100644
--- a/buildroot/package/armadeus/Config.in
+++ b/buildroot/package/armadeus/Config.in
@@ -1,7 +1,6 @@
menu "Armadeus specific tools/utilities"
source package/armadeus/ad9889ctrl/Config.in
-source package/armadeus/tfp410ctrl/Config.in
source package/armadeus/as_devices/Config.in
source package/armadeus/ch7024ctrl/Config.in
source package/armadeus/demos/Config.in
@@ -11,5 +10,6 @@ source package/armadeus/imxssi/Config.in
source package/armadeus/max5821ctrl/Config.in
source package/armadeus/pps/Config.in
source package/armadeus/testsuite/Config.in
+source package/armadeus/tfp410ctrl/Config.in
endmenu
diff --git a/buildroot/package/armadeus/tfp410ctrl/Config.in b/buildroot/package/armadeus/tfp410ctrl/Config.in
index e60d138..8162cf6 100644
--- a/buildroot/package/armadeus/tfp410ctrl/Config.in
+++ b/buildroot/package/armadeus/tfp410ctrl/Config.in
@@ -1,7 +1,6 @@
config BR2_PACKAGE_TFP410CTRL
bool "tfp410ctrl"
depends on BR2_TARGET_ARMADEUS
- default n
help
Build TFP410 control tool. It allows you to configure the HDMI/DVI
output of the APF51Dev directly from Linux userspace (command tfp410ctrl).
diff --git a/target/packages/tfp410ctrl/tfp410ctrl.c b/target/packages/tfp410ctrl/tfp410ctrl.c
index 087abf0..1282063 100644
--- a/target/packages/tfp410ctrl/tfp410ctrl.c
+++ b/target/packages/tfp410ctrl/tfp410ctrl.c
@@ -221,34 +221,34 @@ void dump(int fd, FILE* destFile)
*/
void load(int fd, char* fileName)
{
- char line[MAX_DUMP_LINE];
- char tempFileName[MAX_DUMP_LINE];
- FILE *fd_conf = NULL;
- unsigned int regAddr, val;
-
- if (strlen(fileName) == 0) {
- printf("Enter file name: ");
- fgets(tempFileName, sizeof(tempFileName), stdin);
- tempFileName[strlen(tempFileName)-1] = '\0'; /* suppress \n */
- }
- else {
- strcpy(tempFileName, fileName);
- }
-
- if ((fd_conf = fopen(tempFileName, "r")) == NULL) {
- perror("Open error: ");
- exit (1);
- }
- while (fgets(line, MAX_DUMP_LINE, fd_conf) != NULL) {
- sscanf(line,"%2X%*c%4X", ®Addr, &val);
- printf("reg %02x, value %04x\n", regAddr, val);
- if (regAddr > DE_TOP_REG)
- write_word (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
- else
- write_byte (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
- }
- if (fd_conf != NULL)
- fclose(fd_conf);
+ char line[MAX_DUMP_LINE];
+ char tempFileName[MAX_DUMP_LINE];
+ FILE *fd_conf = NULL;
+ unsigned int regAddr, val;
+
+ if (strlen(fileName) == 0) {
+ printf("Enter file name: ");
+ fgets(tempFileName, sizeof(tempFileName), stdin);
+ tempFileName[strlen(tempFileName)-1] = '\0'; /* suppress \n */
+ }
+ else {
+ strcpy(tempFileName, fileName);
+ }
+
+ if ((fd_conf = fopen(tempFileName, "r")) == NULL) {
+ perror("Open error: ");
+ exit (1);
+ }
+ while (fgets(line, MAX_DUMP_LINE, fd_conf) != NULL) {
+ sscanf(line,"%2X%*c%4X", ®Addr, &val);
+ printf("reg %02x, value %04x\n", regAddr, val);
+ if (regAddr > DE_TOP_REG
+ write_word (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
+ else
+ write_byte (fd, TFP410_I2C_SLAVE_ADDR, regAddr, val);
+ }
+ if (fd_conf != NULL)
+ fclose(fd_conf);
}
void modifyRegister(int fd, int regAddr)
hooks/post-receive
--
armadeus
|
|
From: Nicolas <th...@us...> - 2011-02-16 10:21:33
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 70bc3b3b30a511848f51092e16faafe4638ef047 (commit)
via 0fc214c1af117917a330d016ab8e41d9979dee8c (commit)
from 6bbf46af9672e1ea9b525e16158245c4b76ad5bc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 70bc3b3b30a511848f51092e16faafe4638ef047
Merge: 0fc214c1af117917a330d016ab8e41d9979dee8c 6bbf46af9672e1ea9b525e16158245c4b76ad5bc
Author: Nicolas Colombain <nic...@ar...>
Date: Wed Feb 16 11:21:01 2011 +0100
Merge branch 'master' of ssh://thom25@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 0fc214c1af117917a330d016ab8e41d9979dee8c
Author: Nicolas Colombain <nic...@ar...>
Date: Wed Feb 16 11:20:09 2011 +0100
[LINUX] add apf51DEv HDMI support
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 96 +++++++++-----------
1 files changed, 45 insertions(+), 51 deletions(-)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index b1ea74b..910f27c 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -56,7 +56,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c 2011-02-11 16:26:31.000000000 +0100
-@@ -0,0 +1,376 @@
+@@ -0,0 +1,370 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -98,6 +98,8 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ PAD_CTL_PUS_47K_UP | PAD_CTL_PUE | \
+ PAD_CTL_SRE_FAST | PAD_CTL_DVS)
+
++#define APF51_LCD_PAD_CTRL (PAD_CTL_SRE_SLOW | PAD_CTL_DSE_MED)
++
+static iomux_v3_cfg_t apf51dev_pads[] = {
+ /* SD1 */
+ (_MX51_PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(APF51_SDHCI_PAD_CTRL)),
@@ -152,33 +154,32 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ (_MX51_PAD_NANDF_RB1__GPIO3_9 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)), /* CAN_INT# */
+
+ /* Display */
-+ MX51_PAD_DISP1_DAT0__DISP1_DAT0,
-+ MX51_PAD_DISP1_DAT1__DISP1_DAT1,
-+ MX51_PAD_DISP1_DAT2__DISP1_DAT2,
-+ MX51_PAD_DISP1_DAT3__DISP1_DAT3,
-+ MX51_PAD_DISP1_DAT4__DISP1_DAT4,
-+ MX51_PAD_DISP1_DAT5__DISP1_DAT5,
-+ MX51_PAD_DISP1_DAT6__DISP1_DAT6,
-+ MX51_PAD_DISP1_DAT7__DISP1_DAT7,
-+ MX51_PAD_DISP1_DAT8__DISP1_DAT8,
-+ MX51_PAD_DISP1_DAT9__DISP1_DAT9,
-+ MX51_PAD_DISP1_DAT10__DISP1_DAT10,
-+ MX51_PAD_DISP1_DAT11__DISP1_DAT11,
-+ MX51_PAD_DISP1_DAT12__DISP1_DAT12,
-+ MX51_PAD_DISP1_DAT13__DISP1_DAT13,
-+ MX51_PAD_DISP1_DAT14__DISP1_DAT14,
-+ MX51_PAD_DISP1_DAT15__DISP1_DAT15,
-+ MX51_PAD_DISP1_DAT16__DISP1_DAT16,
-+ MX51_PAD_DISP1_DAT17__DISP1_DAT17,
-+ MX51_PAD_DISP1_DAT18__DISP1_DAT18,
-+ MX51_PAD_DISP1_DAT19__DISP1_DAT19,
-+ MX51_PAD_DISP1_DAT20__DISP1_DAT20,
-+ MX51_PAD_DISP1_DAT21__DISP1_DAT21,
-+ MX51_PAD_DISP1_DAT22__DISP1_DAT22,
-+ MX51_PAD_DISP1_DAT23__DISP1_DAT23,
-+ MX51_PAD_DI1_PIN2__DI1_PIN2, /* HSYNC */
-+ MX51_PAD_DI1_PIN3__DI1_PIN3, /* VSYNC */
-+ /* CLK and OE are not muxed */
++ (_MX51_PAD_DISP1_DAT0__DISP1_DAT0 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT1__DISP1_DAT1 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT2__DISP1_DAT2 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT3__DISP1_DAT3 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT4__DISP1_DAT4 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT5__DISP1_DAT5 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT6__DISP1_DAT6 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT7__DISP1_DAT7 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT8__DISP1_DAT8 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT9__DISP1_DAT9 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT10__DISP1_DAT10 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT11__DISP1_DAT11 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT12__DISP1_DAT12 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT13__DISP1_DAT13 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT14__DISP1_DAT14 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT15__DISP1_DAT15 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT16__DISP1_DAT16 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT17__DISP1_DAT17 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT18__DISP1_DAT18 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT19__DISP1_DAT19 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT20__DISP1_DAT20 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT21__DISP1_DAT21 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT22__DISP1_DAT22 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DISP1_DAT23__DISP1_DAT23 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)),
++ (_MX51_PAD_DI1_PIN2__DI1_PIN2 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)), /* HSYNC */
++ (_MX51_PAD_DI1_PIN3__DI1_PIN3 | MUX_PAD_CTRL(APF51_LCD_PAD_CTRL)), /* VSYNC */
+
+ /* SSI */
+ MX51_PAD_AUD3_BB_TXD__AUD3_TXD,
@@ -271,27 +272,11 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+
+
+/* CAN */
-+
+#define CAN_MCP251X_INT IMX_GPIO_NR(3, 9)
+
-+static iomux_v3_cfg_t mcp251x_pins[] = {
-+ (_MX51_PAD_NANDF_RB1__GPIO3_9 | MUX_PAD_CTRL(APF51_GPIO_SPECIAL_PAD_CTRL)),
-+};
-+
-+static int mcp251x_init_irq(struct spi_device *spi)
-+{
-+ printk("%s \n", __func__);
-+
-+ /* Still needed here ?? */
-+ mxc_iomux_v3_setup_multiple_pads(mcp251x_pins, ARRAY_SIZE(mcp251x_pins));
-+
-+ return 0;
-+}
-+
-+
+static struct mcp251x_platform_data mcp251x_info = {
+ .oscillator_frequency = 16000000,
-+ .board_specific_setup = &mcp251x_init_irq,
++ .board_specific_setup =NULL,
+ .power_enable = NULL,
+ .transceiver_enable = NULL,
+};
@@ -345,14 +330,11 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+static struct i2c_board_info apf51dev_i2c2_devices[] __initdata = {
+ {
+ I2C_BOARD_INFO("tfp410", 0x38),
-+/* .platform_data = &tfp410_pdata,
-+ .irq = gpio_to_irq(APF51DEV_HDMI_DETECT),*/
+ },
-+#if 0
+ {
-+ /* EDID ? */
++ /* EDID */
++ I2C_BOARD_INFO("eeprom", 0x50),
+ },
-+#endif
+ {
+ I2C_BOARD_INFO("wm8960", 0x36),
+ .platform_data = &apf51dev_wm8960_pdata,
@@ -364,9 +346,10 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+#endif
+};
+
++#define ESDHC_CARD_DETECT (GPIO_PORTB | 29)
+static struct esdhc_platform_data edshc0_pdata = {
+ .wp_gpio = 0, /* write protect pin */
-+ .cd_gpio = (GPIO_PORTB | 29), /* card detect pin */
++ .cd_gpio = ESDHC_CARD_DETECT, /* card detect pin */
+};
+
+static int initGPIO(void)
@@ -375,9 +358,11 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+#define WIFI_RESET (GPIO_PORTB | 23)
+#define USER_LED_GPIO (GPIO_PORTA | 2)
+#define USER_SWITCH_GPIO (GPIO_PORTA | 3)
++#define HDMI_DETECT_GPIO (GPIO_PORTD | 17)
+
+ int rc;
+
++ /* WIFI */
+ rc = gpio_request(WIFI_PWRDN, "WIFI");
+ if (rc){
+ pr_debug("failed to get WIFI_PWRDN GPIO: %d\n", rc);
@@ -392,6 +377,7 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ udelay(1000);
+ gpio_direction_output(WIFI_RESET, 1);
+
++ /* USER */
+ gpio_request(USER_LED_GPIO, "USER_LED_GPIO");
+ if (rc){
+ pr_debug("failed to get User LED GPIO: %d\n", rc);
@@ -406,6 +392,14 @@ Index: linux-2.6.38-rc3/arch/arm/mach-mx5/apf51dev-baseboard.c
+ }
+ gpio_direction_input(USER_SWITCH_GPIO);
+
++ /* HDMI */
++ gpio_request(HDMI_DETECT_GPIO, "HDMI_DETECT_GPIO");
++ if (rc){
++ pr_debug("failed to get HDMI detect GPIO: %d\n", rc);
++ return rc;
++ }
++ gpio_direction_input(HDMI_DETECT_GPIO);
++
+ return 0;
+}
+
hooks/post-receive
--
armadeus
|
|
From: Julien B a. A. <ar...@us...> - 2011-02-16 10:13:31
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 6bbf46af9672e1ea9b525e16158245c4b76ad5bc (commit)
via 28af32bf15c6f53353ca631928af32b6622b9942 (commit)
via 4c58b0cc3f7cfb38b70435db60f330a88bc91d92 (commit)
via 12fbeeb652b0d6ee334dfce5d6678ce38e093872 (commit)
via 06dfaeb7e7b5698d4b8f90aa72aad7465542a46d (commit)
from 6e06b1b14267f97e001fcaf8d2c05e61a12d02be (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6bbf46af9672e1ea9b525e16158245c4b76ad5bc
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 11:06:43 2011 +0100
[LINUX] Fixes comments in patches 090 & 091
commit 28af32bf15c6f53353ca631928af32b6622b9942
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 10:57:57 2011 +0100
[BUILDROOT] [2010.11] Updates Linux firmware (libertas) to support latest kernel
commit 4c58b0cc3f7cfb38b70435db60f330a88bc91d92
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 10:51:14 2011 +0100
[LINUX] 2.6.38: Updates APF27 default config
commit 12fbeeb652b0d6ee334dfce5d6678ce38e093872
Merge: 06dfaeb7e7b5698d4b8f90aa72aad7465542a46d 6e06b1b14267f97e001fcaf8d2c05e61a12d02be
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 10:36:15 2011 +0100
Merge branch 'master' of ssh://artemys@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 06dfaeb7e7b5698d4b8f90aa72aad7465542a46d
Author: Julien Boibessot <jul...@ar...>
Date: Wed Feb 16 10:28:11 2011 +0100
Fixes commit 9366157a494b4a6e5e636ddae2411d715c13cadf
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf27/apf27-linux-2.6.38.config | 36 ++++++++-----------
.../090-armadeus-alsa-create_imx-alsa_h.patch | 3 --
...-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch | 3 --
...e-add_infrastructure_to_install_firmwares.patch | 38 ++++++++++---------
patches/buildroot/2010.11/cleanup_buildroot.sh | 1 +
5 files changed, 36 insertions(+), 45 deletions(-)
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
index 13a810d..19db7ba 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.38.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux/arm 2.6.38-rc3 Kernel Configuration
-# Tue Feb 8 11:03:24 2011
+# Mon Feb 14 16:03:29 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -993,6 +993,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
CONFIG_TOUCHSCREEN_TSC2102=m
+# CONFIG_TOUCHSCREEN_WM97XX is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
@@ -1119,7 +1120,7 @@ CONFIG_SPI_IMX_VER_0_0=y
CONFIG_SPI_IMX=y
CONFIG_SPI_MXC_SELECT1=y
CONFIG_SPI_MXC_SELECT2=y
-CONFIG_SPI_MXC_SELECT3=y
+# CONFIG_SPI_MXC_SELECT3 is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set
@@ -1293,6 +1294,7 @@ CONFIG_MFD_SUPPORT=y
# CONFIG_HTC_EGPIO is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_HTC_I2CPLD is not set
+# CONFIG_UCB1400_CORE is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
# CONFIG_TWL4030_CORE is not set
@@ -1537,12 +1539,6 @@ CONFIG_FB_CFB_IMAGEBLIT=y
# Frame buffer hardware drivers
#
CONFIG_FB_IMX=y
-# CONFIG_FB_IMX_CHIMEI_LW700AT9003_TFT is not set
-# CONFIG_FB_IMX_HITACHI_TX12D17VM1BDP_TFT is not set
-# CONFIG_FB_IMX_OPTREX_T51638D084_TFT is not set
-CONFIG_FB_IMX_SHARP_LQ043_TFT=y
-# CONFIG_FB_IMX_SHARP_LQ057_TFT is not set
-# CONFIG_FB_IMX_CUSTOM_LCD is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
@@ -1612,20 +1608,18 @@ CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
-CONFIG_SND_DRIVERS=y
-# CONFIG_SND_DUMMY is not set
-# CONFIG_SND_ALOOP is not set
-# CONFIG_SND_MTPAV is not set
-# CONFIG_SND_SERIAL_U16550 is not set
-# CONFIG_SND_MPU401 is not set
-CONFIG_SND_ARM=y
-CONFIG_SND_SPI=y
-CONFIG_SND_USB=y
-# CONFIG_SND_USB_AUDIO is not set
-# CONFIG_SND_USB_UA101 is not set
-# CONFIG_SND_USB_CAIAQ is not set
-# CONFIG_SND_SOC is not set
+# CONFIG_SND_DRIVERS is not set
+# CONFIG_SND_ARM is not set
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
+CONFIG_SND_SOC=m
+# CONFIG_SND_SOC_CACHE_LZO is not set
+CONFIG_SND_SOC_AC97_BUS=y
+CONFIG_SND_IMX_SOC=m
+CONFIG_SND_SOC_I2C_AND_SPI=m
+# CONFIG_SND_SOC_ALL_CODECS is not set
# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
# CONFIG_HIDRAW is not set
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/090-armadeus-alsa-create_imx-alsa_h.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/090-armadeus-alsa-create_imx-alsa_h.patch
index a97c0c1..be59465 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/090-armadeus-alsa-create_imx-alsa_h.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/090-armadeus-alsa-create_imx-alsa_h.patch
@@ -1,6 +1,3 @@
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.13.original/arch/arm/mach-imx/include/mach/imx-alsa.h
+++ linux-2.6.27.13.mod/arch/arm/mach-imx/include/mach/imx-alsa.h
@@ -0,0 +1,152 @@
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
index 51ba317..12311a3 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
@@ -1,6 +1,3 @@
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
Index: linux-2.6.29.6/sound/arm/imx-alsa.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
diff --git a/patches/buildroot/2010.11/106-firmware-add_infrastructure_to_install_firmwares.patch b/patches/buildroot/2010.11/106-firmware-add_infrastructure_to_install_firmwares.patch
index 3951149..5d66f61 100644
--- a/patches/buildroot/2010.11/106-firmware-add_infrastructure_to_install_firmwares.patch
+++ b/patches/buildroot/2010.11/106-firmware-add_infrastructure_to_install_firmwares.patch
@@ -5,8 +5,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: buildroot/package/Config.in
===================================================================
---- buildroot.orig/package/Config.in 2010-06-23 14:11:47.000000000 +0200
-+++ buildroot/package/Config.in 2010-06-23 14:12:57.000000000 +0200
+--- buildroot.orig/package/Config.in 2011-02-14 22:06:04.000000000 +0100
++++ buildroot/package/Config.in 2011-02-14 22:26:30.000000000 +0100
@@ -169,6 +169,7 @@
source "package/e2fsprogs/Config.in"
source "package/eeprog/Config.in"
@@ -18,7 +18,7 @@ Index: buildroot/package/Config.in
Index: buildroot/package/firmware/Config.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/firmware/Config.in 2010-06-23 14:12:57.000000000 +0200
++++ buildroot/package/firmware/Config.in 2011-02-14 22:06:04.000000000 +0100
@@ -0,0 +1,49 @@
+menuconfig BR2_PACKAGE_FIRMWARE
+ bool "linux-firmware"
@@ -72,8 +72,8 @@ Index: buildroot/package/firmware/Config.in
Index: buildroot/package/firmware/firmware.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ buildroot/package/firmware/firmware.mk 2010-06-23 14:12:57.000000000 +0200
-@@ -0,0 +1,71 @@
++++ buildroot/package/firmware/firmware.mk 2011-02-14 22:20:39.000000000 +0100
+@@ -0,0 +1,73 @@
+#############################################################
+#
+# Get and install some linux-firmware
@@ -88,16 +88,16 @@ Index: buildroot/package/firmware/firmware.mk
+FIRMWARE_NAME:=firmware-$(FIRMWARE_VERSION)
+
+
++ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_SDIO_V8)),y)
++FIRMWARE_88W8686_SDIO_VERSION:=v8
++else
++FIRMWARE_88W8686_SDIO_VERSION:=v9
++endif
+ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_SDIO)),y)
-+FIRMWARE_BINARIES+=sd8686_helper.bin sd8686.bin
++FIRMWARE_BINARIES+=sd8686_$(FIRMWARE_88W8686_SDIO_VERSION)_helper.bin sd8686_$(FIRMWARE_88W8686_SDIO_VERSION).bin
+endif
+ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_GSPI)),y)
-+FIRMWARE_BINARIES+=gspi8686_helper.bin gspi8686.bin
-+endif
-+ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_SDIO_V8)),y)
-+FIRMWARE_88W8686_SDIO_VERSION:=_v8
-+else
-+FIRMWARE_88W8686_SDIO_VERSION:=_v9
++FIRMWARE_BINARIES+=gspi8686_$(FIRMWARE_88W8686_SDIO_VERSION)_helper.bin gspi8686_$(FIRMWARE_88W8686_SDIO_VERSION).bin
+endif
+
+$(DL_DIR)/$(FIRMWARE_SOURCE):
@@ -106,21 +106,23 @@ Index: buildroot/package/firmware/firmware.mk
+ git archive --prefix=$(FIRMWARE_NAME)/ $(FIRMWARE_VERSION) | \
+ gzip > $(DL_DIR)/$(FIRMWARE_SOURCE) )
+ rm -rf $(FIRMWARE_DIR)
-+# $(WGET) -O $(DL_DIR)/$(FIRMWARE_SOURCE) "$(FIRMWARE_URL)"
+
+$(FIRMWARE_DIR)/.unpacked: $(DL_DIR)/$(FIRMWARE_SOURCE)
+ $(FIRMWARE_CAT) $(DL_DIR)/$(FIRMWARE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ touch $@
+
+$(FIRMWARE_DIR)/.installed: $(FIRMWARE_DIR)/.unpacked
-+ mkdir -p $(FIRMWARE_TARGET_DIR)
++ mkdir -p $(FIRMWARE_TARGET_DIR)/libertas
+ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_SDIO)),y)
-+ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/sd8686_v9_helper.bin $(FIRMWARE_TARGET_DIR)/sd8686_helper.bin
-+ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/sd8686_v9.bin $(FIRMWARE_TARGET_DIR)/sd8686.bin
++ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/sd8686_$(FIRMWARE_88W8686_SDIO_VERSION)_helper.bin $(FIRMWARE_TARGET_DIR)/libertas/
++ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/sd8686_$(FIRMWARE_88W8686_SDIO_VERSION).bin $(FIRMWARE_TARGET_DIR)/libertas/
++ # To be compatible with old kernels:
++ ln -sf ./libertas/sd8686_$(FIRMWARE_88W8686_SDIO_VERSION)_helper.bin $(FIRMWARE_TARGET_DIR)/sd8686_helper.bin
++ ln -sf ./libertas/sd8686_$(FIRMWARE_88W8686_SDIO_VERSION).bin $(FIRMWARE_TARGET_DIR)/sd8686.bin
+endif
+ifeq ($(strip $(BR2_PACKAGE_FIRMWARE_88W8686_GSPI)),y)
-+ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/gspi8686_v9_helper.bin $(FIRMWARE_TARGET_DIR)/gspi8686_helper.bin
-+ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/gspi8686_v9.bin $(FIRMWARE_TARGET_DIR)/gspi8686.bin
++ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/gspi8686_$(FIRMWARE_88W8686_SDIO_VERSION)_helper.bin $(FIRMWARE_TARGET_DIR)/libertas/
++ $(INSTALL) -D $(FIRMWARE_DIR)/libertas/gspi8686_$(FIRMWARE_88W8686_SDIO_VERSION).bin $(FIRMWARE_TARGET_DIR)/libertas/
+endif
+ touch $@
+
diff --git a/patches/buildroot/2010.11/cleanup_buildroot.sh b/patches/buildroot/2010.11/cleanup_buildroot.sh
index fd8d896..9b8fc8c 100755
--- a/patches/buildroot/2010.11/cleanup_buildroot.sh
+++ b/patches/buildroot/2010.11/cleanup_buildroot.sh
@@ -48,3 +48,4 @@ rm -rf buildroot/package/qwt/
rm -rf buildroot/fs/ubi/
rm -f buildroot/package/flex/flex-2.5.35-undefine_rpl_malloc_and_realloc.patch
rm -f buildroot/package/ncurses/ncurses-5.7-allows_build_with_old_ncurses_host_installation.patch
+rm -rf buildroot/package/mysql_client/
hooks/post-receive
--
armadeus
|