armadeus-commitlog Mailing List for armadeus (Page 133)
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: <ar...@us...> - 2009-01-28 16:55:39
|
Revision: 1031
http://armadeus.svn.sourceforge.net/armadeus/?rev=1031&view=rev
Author: artemys
Date: 2009-01-28 16:55:33 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
[TEST] Update touchscreen test
Modified Paths:
--------------
trunk/target/test/test_touchscreen.sh
Modified: trunk/target/test/test_touchscreen.sh
===================================================================
--- trunk/target/test/test_touchscreen.sh 2009-01-28 14:48:12 UTC (rev 1030)
+++ trunk/target/test/test_touchscreen.sh 2009-01-28 16:55:33 UTC (rev 1031)
@@ -23,7 +23,7 @@
modprobe tsc2102_ts
sleep 1
- dmesg | tail | grep "TSC2102 touchscreen driver initialized"
+ dmesg | tail | grep "TSC210x Touchscreen driver initialized"
if [ "$?" != 0 ]; then
echo "Hardware not found !"
exit_failed
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-28 14:48:17
|
Revision: 1030
http://armadeus.svn.sourceforge.net/armadeus/?rev=1030&view=rev
Author: artemys
Date: 2009-01-28 14:48:12 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
[TEST] Add a test for strace (to be improved)
Added Paths:
-----------
trunk/target/test/packages/test_strace.sh
Added: trunk/target/test/packages/test_strace.sh
===================================================================
--- trunk/target/test/packages/test_strace.sh (rev 0)
+++ trunk/target/test/packages/test_strace.sh 2009-01-28 14:48:12 UTC (rev 1030)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#
+# Script to test a Buildroot package for Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# 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.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+#DEBUG=True
+EXEC_NAME="strace"
+
+
+test_strace()
+{
+ show_test_banner "strace"
+
+ is_package_installed $EXEC_NAME
+
+ if [ "$?" == 0 ]; then
+ # Launch it
+ $EXEC_NAME echo "HELLO !!"
+ if [ "$?" == 0 ]; then
+ echo_test_ok
+ exit 0
+ fi
+ fi
+ exit_failed
+}
+
+test_strace
+
Property changes on: trunk/target/test/packages/test_strace.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-28 13:42:33
|
Revision: 1029
http://armadeus.svn.sourceforge.net/armadeus/?rev=1029&view=rev
Author: artemys
Date: 2009-01-28 13:42:31 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
[TEST] Add a test for Boa web server
Added Paths:
-----------
trunk/target/test/packages/test_boa.sh
Added: trunk/target/test/packages/test_boa.sh
===================================================================
--- trunk/target/test/packages/test_boa.sh (rev 0)
+++ trunk/target/test/packages/test_boa.sh 2009-01-28 13:42:31 UTC (rev 1029)
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+#
+# Script to test a Buildroot package for Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# 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.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+#DEBUG=True
+EXEC_NAME="boa"
+HTML_DIR="/var/www"
+HTML_FILE="$HTML_DIR/index.html"
+BOA_LOG_DIR="/var/log/boa"
+
+generate_html_test_file()
+{
+ cat << EOF > $HTML_FILE
+<html>
+ <head>
+ <title> Test of Boa Web Server </title>
+ </head>
+ <body>
+ <h1> If you can read that, then the test is OK ! ;-) </h1>
+ </body>
+</html>
+EOF
+}
+
+test_cleanup()
+{
+ rm -f "$HTML_FILE"
+ killall $EXEC_NAME
+}
+
+test_boa()
+{
+ show_test_banner "Boa"
+
+ is_package_installed $EXEC_NAME
+
+ if [ "$?" == 0 ]; then
+ mkdir -p $HTML_DIR
+ mkdir -p $BOA_LOG_DIR
+ generate_html_test_file
+ IP=`ifconfig eth0 | grep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1`
+ # Launch it
+ $EXEC_NAME
+ #
+ echo "Now you can access to http://"$IP"/index.html from your web browser"
+ sleep 8
+ if [ "$?" == 0 ]; then
+ ask_user "Did you manage to show the web page ? If OK say y"
+ if [ "$response" == "y" ]; then
+ echo_test_ok
+ test_cleanup
+ exit 0
+ fi
+ fi
+ fi
+ test_cleanup
+ exit_failed
+}
+
+test_boa
+
Property changes on: trunk/target/test/packages/test_boa.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-28 11:02:15
|
Revision: 1028
http://armadeus.svn.sourceforge.net/armadeus/?rev=1028&view=rev
Author: artemys
Date: 2009-01-28 11:02:09 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
[BUILD] Make it easier to get some important shell environment variables (for access to the most used Armadeus directories)
Modified Paths:
--------------
trunk/Makefile
trunk/Makefile.in
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2009-01-27 21:09:49 UTC (rev 1027)
+++ trunk/Makefile 2009-01-28 11:02:09 UTC (rev 1028)
@@ -1,6 +1,6 @@
-# Makefile for armadeus
+# Makefile for Armadeus
#
-# Copyright (C) 2005-2007 by <jo...@ar...>
+# Copyright (C) 2005-2009 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
@@ -23,6 +23,7 @@
#--------------------------------------------------------------
BUILDROOT_DIR = buildroot
+include ./Makefile.in
BUILDROOT_NAME=buildroot
BUILDROOT_FILE_PATH:=downloads
@@ -31,25 +32,20 @@
BUILDROOT_VERSION:=20081103
BUILDROOT_SOURCE:=buildroot-$(BUILDROOT_VERSION).tar.bz2
--include $(BUILDROOT_DIR)/.config
-LINUX_VERSION:=$(shell echo $(BR2_LINUX26_VERSION))
-BOARD_NAME:=$(shell echo $(BR2_BOARD_NAME))
-ARCH:=$(shell echo $(BR2_GCC_TARGET_ARCH))
-
ARMADEUS_TOPDIR:=$(shell pwd)
export ARMADEUS_TOPDIR
PATCH_DIR=patches
TAR_OPTIONS=--exclude=.svn -xf
-LINUX_DIR=$(BUILDROOT_DIR)/project_build_$(ARCH)/$(BOARD_NAME)/linux-$(LINUX_VERSION)
-BOARD_DIR=$(BUILDROOT_DIR)/target/device/armadeus/$(BOARD_NAME)/
+ARMADEUS_ENV_FILE=armadeus_env.sh
+
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 ./$(BUILDROOT_DIR)/target/device/armadeus -name *_defconfig|sed 's/.*\///');\
+ echo " "$(shell find $(BUILDROOT_DIR)/target/device/armadeus -name *_defconfig|sed 's/.*\///');\
echo " "; \
echo -en "\033[0m";
@@ -116,12 +112,12 @@
$(MAKE) -C $(BUILDROOT_DIR)
linux-menuconfig:
- @if [ -e "$(LINUX_DIR)/.unpacked" ] ; then \
+ @if [ -e "$(ARMADEUS_LINUX_DIR)/.unpacked" ] ; then \
$(MAKE) -C $(BUILDROOT_DIR) linux26-menuconfig ; \
fi;
linux26: $(BUILDROOT_DIR)/.configured
- @-touch $(LINUX_DIR)/.config
+ @-touch $(ARMADEUS_LINUX_DIR)/.config
@$(MAKE) -C $(BUILDROOT_DIR) linux26
linux26-clean: $(BUILDROOT_DIR)/.configured
@@ -162,7 +158,13 @@
buildroot-dirclean:
rm -rf $(BUILDROOT_DIR)
+# Generate shell's most useful variables:
+shell_env:
+ @echo ARMADEUS_LINUX_DIR=$(ARMADEUS_LINUX_DIR) > $(ARMADEUS_ENV_FILE)
+ @echo ARMADEUS_ROOTFS_DIR=$(ARMADEUS_ROOTFS_DIR) >> $(ARMADEUS_ENV_FILE)
+
+
PHONY_TARGETS+=dummy all linux-menuconfig linux26 linux26-clean buildroot-clean buildroot-dirclean
-PHONY_TARGETS+=menuconfig $(BUILDROOT_DIR)/.config
+PHONY_TARGETS+=menuconfig $(BUILDROOT_DIR)/.config shell_env
.PHONY: $(PHONY_TARGETS)
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in 2009-01-27 21:09:49 UTC (rev 1027)
+++ trunk/Makefile.in 2009-01-28 11:02:09 UTC (rev 1028)
@@ -4,6 +4,10 @@
# calling directory before including this file !!
#
+ifeq ($(ARMADEUS_BASE_DIR),)
+ARMADEUS_BASE_DIR=$(shell pwd)
+endif
+
BUILDROOT_DIR=$(ARMADEUS_BASE_DIR)/buildroot
-include $(BUILDROOT_DIR)/.config
@@ -16,4 +20,5 @@
ARMADEUS_LINUX_DIR=$(BUILDROOT_DIR)/project_build_$(ARMADEUS_TARGET_ARCH)/$(ARMADEUS_BOARD_NAME)/linux-$(ARMADEUS_LINUX_VERSION)
ARMADEUS_UCLIBC_DIR=$(BUILDROOT_DIR)/toolchain_build_$(ARMADEUS_TARGET_ARCH)/uClibc-$(ARMADEUS_UCLIBC_VERSION)
ARMADEUS_BOARD_DIR=$(BUILDROOT_DIR)/target/device/armadeus/$(ARMADEUS_BOARD_NAME)/
+ARMADEUS_ROOTFS_DIR=$(BUILDROOT_DIR)/project_build_$(ARMADEUS_TARGET_ARCH)/$(ARMADEUS_BOARD_NAME)/root
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-27 21:09:53
|
Revision: 1027
http://armadeus.svn.sourceforge.net/armadeus/?rev=1027&view=rev
Author: artemys
Date: 2009-01-27 21:09:49 +0000 (Tue, 27 Jan 2009)
Log Message:
-----------
[TEST] Add dir to store Buildroot packages tests + add mplayer one
Modified Paths:
--------------
trunk/target/test/test_helpers.sh
Added Paths:
-----------
trunk/target/test/packages/
trunk/target/test/packages/test_env.sh
trunk/target/test/packages/test_helpers.sh
trunk/target/test/packages/test_mplayer.sh
trunk/target/test/packages/test_skeleton.sh
Added: trunk/target/test/packages/test_env.sh
===================================================================
--- trunk/target/test/packages/test_env.sh (rev 0)
+++ trunk/target/test/packages/test_env.sh 2009-01-27 21:09:49 UTC (rev 1027)
@@ -0,0 +1 @@
+link ../test_env.sh
\ No newline at end of file
Property changes on: trunk/target/test/packages/test_env.sh
___________________________________________________________________
Added: svn:special
+ *
Added: trunk/target/test/packages/test_helpers.sh
===================================================================
--- trunk/target/test/packages/test_helpers.sh (rev 0)
+++ trunk/target/test/packages/test_helpers.sh 2009-01-27 21:09:49 UTC (rev 1027)
@@ -0,0 +1 @@
+link ../test_helpers.sh
\ No newline at end of file
Property changes on: trunk/target/test/packages/test_helpers.sh
___________________________________________________________________
Added: svn:special
+ *
Added: trunk/target/test/packages/test_mplayer.sh
===================================================================
--- trunk/target/test/packages/test_mplayer.sh (rev 0)
+++ trunk/target/test/packages/test_mplayer.sh 2009-01-27 21:09:49 UTC (rev 1027)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+#
+# Script to test a Buildroot package for Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# 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.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+#DEBUG=True
+EXEC_NAME="mplayer"
+VIDEO_FILE_NAME="$TEMP_DIR/apf27.mpg"
+
+test_mplayer()
+{
+ show_test_banner "Mplayer"
+
+ is_package_installed $EXEC_NAME
+
+ if [ "$?" == 0 ]; then
+ # Wake up LCD
+ echo 0 > /sys/class/graphics/fb0/blank
+ sleep 1
+ # Stop blinking cursor
+ echo 0 > /sys/class/graphics/fbcon/cursor_blink
+ # Get video
+ echo "Downloading file from Internet"
+ # Suppose that network was correctly set before
+ wget http://dl.free.fr/jVwLTYA1T -O $VIDEO_FILE_NAME
+ # Launch it
+ $EXEC_NAME -nosound -fs $VIDEO_FILE_NAME
+ if [ "$?" == 0 ]; then
+ ask_user "Was video correctly displayed ? If OK say y"
+ if [ "$response" == "y" ]; then
+ echo_test_ok
+ exit 0
+ fi
+ fi
+ fi
+ # Make cursor blink again
+ echo 1 > /sys/class/graphics/fbcon/cursor_blink
+ rm -f "$VIDEO_FILE_NAME"
+ exit_failed
+}
+
+test_mplayer
+
Property changes on: trunk/target/test/packages/test_mplayer.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/target/test/packages/test_skeleton.sh
===================================================================
--- trunk/target/test/packages/test_skeleton.sh (rev 0)
+++ trunk/target/test/packages/test_skeleton.sh 2009-01-27 21:09:49 UTC (rev 1027)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#
+# Script to test a Buildroot package for Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# 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.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+#DEBUG=True
+EXEC_NAME="echo"
+
+
+test_skeleton()
+{
+ show_test_banner "Example"
+
+ is_package_installed $EXEC_NAME
+
+ if [ "$?" == 0 ]; then
+ # Launch it
+ $EXEC_NAME some parameters ...
+ if [ "$?" == 0 ]; then
+ echo_test_ok
+ exit 0
+ fi
+ fi
+ exit_failed
+}
+
+test_skeleton
+
Property changes on: trunk/target/test/packages/test_skeleton.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/target/test/test_helpers.sh
===================================================================
--- trunk/target/test/test_helpers.sh 2009-01-20 15:55:03 UTC (rev 1026)
+++ trunk/target/test/test_helpers.sh 2009-01-27 21:09:49 UTC (rev 1027)
@@ -74,3 +74,14 @@
exit 1
}
+is_package_installed()
+{
+ EXE=`which $1 | head -n 1`
+ if [ -x "$EXE" ]; then
+ debug "$EXE"
+ return 0
+ else
+ return 1
+ fi
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-20 15:55:11
|
Revision: 1026
http://armadeus.svn.sourceforge.net/armadeus/?rev=1026&view=rev
Author: artemys
Date: 2009-01-20 15:55:03 +0000 (Tue, 20 Jan 2009)
Log Message:
-----------
[MERGE] Merge of tsc210x branch (APF27's TSC2101 integration)
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-074-armadeus-tsc2102-touchscreen.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-090-armadeus-alsa-create_imx-alsa_h.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-093-armadeus-add_ssi_registers_definition.patch
trunk/software/uboot_recover/bootloader.py
trunk/target/linux/Makefile
trunk/target/linux/debug/imxregs/imx27regs.h
trunk/target/linux/debug/imxssi/imxssi.c
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-096-armadeus-clock-add_ssi_clk.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-097-armadeus-imx-dma-improvements.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-098-armadeus-imx-dma-announce_imx_is_supporting_scatter_gather.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
trunk/target/linux/arch/arm/mach-imx/include/
trunk/target/linux/arch/arm/mach-imx/include/mach/
Removed Paths:
-------------
trunk/target/linux/arch/arm/mach-imx/include/mach/
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-20 14:59:10 UTC (rev 1025)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-20 15:55:03 UTC (rev 1026)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.2
-# Sun Dec 28 01:31:05 2008
+# Fri Jan 16 18:34:47 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -919,6 +919,7 @@
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_ARM=y
+CONFIG_SND_IMX_PCM=m
CONFIG_SND_IMX_TSC2102=m
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-20 14:59:10 UTC (rev 1025)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-20 15:55:03 UTC (rev 1026)
@@ -3,11 +3,11 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/arch/arm/mach-imx/apf9328.c
+++ linux-2.6.27.2.mod/arch/arm/mach-imx/apf9328.c
-@@ -0,0 +1,677 @@
+@@ -0,0 +1,731 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
-+ * Copyright (c) 2005 Armadeus
++ * Copyright (c) 2005-2009 Armadeus systems
+ * This work is based on scb9328.c from Sascha Hauer
+ *
+ * This program is free software; you can redistribute it and/or modify
@@ -45,14 +45,15 @@
+#include <mach/imx-uart.h>
+#include <mach/mmc.h>
+#include <mach/spi_imx.h>
-+#include <mach/imx-regs.h> // imx_gpio_mode()
++#include <mach/imx-regs.h> /* imx_gpio_mode() */
+#include <mach/imx-alsa.h>
+#include <linux/spi/max1027.h>
+#include <linux/usb/isp116x.h>
++#include <mach/imx_ssi.h>
+
+#ifdef CONFIG_DM9000
+#include <linux/dm9000.h>
-+#endif // CONFIG_DM9000
++#endif
+
+#include "generic.h"
+
@@ -188,26 +189,89 @@
+};
+
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
-+static struct imx_alsa_codec_config tsc2102_alsa_pdata;
++int apf9328_ssi_gpio_init(struct platform_device *pdev)
++{
++ /* Activate SSI on PortC */
++ imx_gpio_mode(PC3_PF_SSI_RXFS);
++ FMCR &= ~(SSI_RXFS_SEL);
++ imx_gpio_mode(PC4_PF_SSI_RXCLK);
++ FMCR &= ~(SSI_RXCLK_SEL);
++ imx_gpio_mode(PC5_PF_SSI_RXDAT);
++ FMCR &= ~(SSI_RXDAT_SEL);
++ imx_gpio_mode(PC6_PF_SSI_TXDAT);
++ imx_gpio_mode(PC7_PF_SSI_TXFS);
++ FMCR &= ~(SSI_TXFS_SEL);
++ imx_gpio_mode(PC8_PF_SSI_TXCLK);
++ FMCR &= ~(SSI_TXCLK_SEL);
++
++ printk("SSI pins configured\n");
++ return 0;
++}
+
++static struct imx_ssi_platform_data apf9328_ssi_pdata = {
++ .init = apf9328_ssi_gpio_init,
++};
++
+static struct resource ssi_resources[] = {
-+ [0] = {
-+ .start = (IMX_SSI_BASE),
-+ .end = (IMX_SSI_BASE + 0x28),
-+ .flags = IORESOURCE_MEM,
-+ },
++ [0] = {
++ .start = (0x00218000),
++ .end = (0x00218000 + 0x28),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = SSI_TX_INT,
++ .end = SSI_TX_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [2] = {
++ .start = SSI_TX_ERR_INT,
++ .end = SSI_TX_ERR_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [3] = {
++ .start = SSI_RX_INT,
++ .end = SSI_RX_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [4] = {
++ .start = SSI_RX_ERR_INT,
++ .end = SSI_RX_ERR_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [5] = {
++ .name = "tx0",
++ .start = DMA_REQ_SSI_T,
++ .end = DMA_REQ_SSI_T,
++ .flags = IORESOURCE_DMA
++ },
++ [6] = {
++ .name = "rx0",
++ .start = DMA_REQ_SSI_R,
++ .end = DMA_REQ_SSI_R,
++ .flags = IORESOURCE_DMA
++ },
+};
+
++static struct platform_device apf9328_ssi_device = {
++ .name = "imx-ssi",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(ssi_resources),
++ .resource = ssi_resources,
++ .dev = {
++ .platform_data = &apf9328_ssi_pdata,
++ }
++};
++
++static struct imx_sound_platform_data apf9328_alsa_pdata;
++
+static struct platform_device tsc2102_alsa_device = {
-+ .name = "tsc2102-alsa", // Should be the same as the driver name
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(ssi_resources),
-+ .resource = ssi_resources,
-+ .dev = {
-+ .platform_data = &tsc2102_alsa_pdata,
-+ }
++ .name = "tsc210x-alsa",
++ .id = 0,
++ .dev = {
++ .platform_data = &apf9328_alsa_pdata,
++ }
+};
-+#endif // defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
++#endif /* defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE) */
+
+
+// --- SERIAL RESSOURCE ---
@@ -417,19 +481,6 @@
+ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
+ //imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );
+
-+ // Activate SSI on PortC ----
-+ imx_gpio_mode( PC3_PF_SSI_RXFS );
-+ FMCR &= ~(SSI_RXFS_SEL);
-+ imx_gpio_mode( PC4_PF_SSI_RXCLK );
-+ FMCR &= ~(SSI_RXCLK_SEL);
-+ imx_gpio_mode( PC5_PF_SSI_RXDAT );
-+ FMCR &= ~(SSI_RXDAT_SEL);
-+ imx_gpio_mode( PC6_PF_SSI_TXDAT );
-+ imx_gpio_mode( PC7_PF_SSI_TXFS );
-+ FMCR &= ~(SSI_TXFS_SEL);
-+ imx_gpio_mode( PC8_PF_SSI_TXCLK );
-+ FMCR &= ~(SSI_TXCLK_SEL);
-+
+ printk("TSC2102 GPIOs initialized\n");
+ return 0;
+}
@@ -448,12 +499,14 @@
+ .cs_control = tsc2102_cs,
+};
+
-+static struct tsc2102_config apf9328_tsc2102_config = {
-+ .use_internal = 1, // -> use internal voltage reference
-+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
-+ .init = tsc2102_init_gpio
-+/* .apm_report = palmte_get_power_status,
-+ .alsa_config = &palmte_alsa_config,*/
++static struct tsc210x_config apf9328_tsc2102_config = {
++ .use_internal = 1, // -> use internal voltage reference
++ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
++ .init = tsc2102_init_gpio,
++/* .apm_report = palmte_get_power_status,*/
++/*#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
++ .alsa_config = &apf9328_alsa_pdata,
++#endif*/
+};
+
+#endif // CONFIG_SPI_TSC2102
@@ -518,7 +571,7 @@
+#endif // CONFIG_SENSORS_MAX1027
+#ifdef CONFIG_SPI_TSC2102
+{
-+ .modalias = "tsc2102",
++ .modalias = "tsc210x",
+ .controller_data = &tsc2102_hw,
+ .max_speed_hz = 8000000,
+ .bus_num = 2, // SPI2
@@ -570,23 +623,24 @@
+static struct platform_device *devices[] __initdata = {
+ &imx_uart1_device,
+ &imx_uart2_device,
-+#ifdef CONFIG_DM9000
++#ifdef CONFIG_DM9000
+ &dm9000x_device,
-+#endif // CONFIG_DM9000
++#endif
+#ifdef CONFIG_SPI_IMX
+ &imx_spi1,
+ &imx_spi2,
-+#endif //CONFIG_SPI_IMX
++#endif
+ &imx_pwm_device,
+#ifdef CONFIG_IMX_BACKLIGHT
+ &imxbl_device,
-+#endif // CONFIG_IMX_BACKLIGHT
++#endif
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+ &tsc2102_alsa_device,
-+#endif // CONFIG_SND_IMX_TSC2102 || CONFIG_SND_IMX_TSC2102_MODULE
++ &apf9328_ssi_device,
++#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
+ &devfull_isp1761_device,
-+#endif // CONFIG_ARMADEUS_ISP1761
++#endif
+};
+
+static void __init apf9328_init(void)
@@ -891,7 +945,7 @@
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.2.original/arch/arm/mach-imx/include/mach/apf9328.h
-+++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/apf9328.h
++++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/apf9328.h
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch 2009-01-20 14:59:10 UTC (rev 1025)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch 2009-01-20 15:55:03 UTC (rev 1026)
@@ -20,7 +20,7 @@
#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
-@@ -591,4 +591,146 @@
+@@ -591,4 +591,132 @@
#define UTS_RXFULL (1<<3) /* RxFIFO full */
#define UTS_SOFTRST (1<<0) /* Software reset */
@@ -142,20 +142,6 @@
+#define USB_ENDIAN (1<<28) /* Endian of USB modules */
+#define USB_POWER (1<<0) /* Power mode of USB modules */
+
-+/*
-+ * SSI register
-+ */
-+#define SSI_STX __REG(IMX_SSI_BASE)
-+#define SSI_SRX __REG(IMX_SSI_BASE + 0x4)
-+#define SSI_SCSR __REG(IMX_SSI_BASE + 0x8)
-+#define SSI_STCR __REG(IMX_SSI_BASE + 0xC)
-+#define SSI_SRCR __REG(IMX_SSI_BASE + 0x10)
-+#define SSI_STCCR __REG(IMX_SSI_BASE + 0x14)
-+#define SSI_SRCCR __REG(IMX_SSI_BASE + 0x18)
-+#define SSI_STSR __REG(IMX_SSI_BASE + 0x1C)
-+#define SSI_SFCSR __REG(IMX_SSI_BASE + 0x20)
-+#define SSI_STR __REG(IMX_SSI_BASE + 0x24)
-+#define SSI_SOR __REG(IMX_SSI_BASE + 0x28)
+
+#define SPI1_RXDATA __REG(IMX_SPI1_BASE + 0x0)
+#define SPI1_TXDATA __REG(IMX_SPI1_BASE + 0x4)
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-20 14:59:10 UTC (rev 1025)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-20 15:55:03 UTC (rev 1026)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/include/linux/spi/tsc2102.h
+++ linux-2.6.27.2.mod/include/linux/spi/tsc2102.h
-@@ -0,0 +1,177 @@
+@@ -0,0 +1,299 @@
+/*
+ * include/linux/spi/tsc2102.h
+ *
@@ -31,7 +31,8 @@
+
+struct apm_power_info;
+
-+struct tsc2102_config {
++struct tsc210x_config {
++ unsigned int mclk; /* Main clock, fixed if TSC is master */
+ int use_internal; /* Use internal reference voltage */
+ uint32_t monitor; /* What inputs are relevant */
+ void (*apm_report)(struct apm_power_info *info, int *battery);
@@ -43,123 +44,174 @@
+
+#define TSC_BAT1 (1 << 0)
+#define TSC_BAT2 (1 << 1)
-+#define TSC_AUX (1 << 2)
++#define TSC_AUX (1 << 2)
++#define TSC_AUX1 (1 << 2) /* TSC2101 has 2 Aux inputs */
++#define TSC_AUX2 (1 << 3)
+#define TSC_TEMP (1 << 4)
+
-+extern u16 tsc2102_read_sync(int page, u8 address);
-+extern void tsc2102_reads_sync(int page, u8 startaddress, u16 *data,
++extern u16 tsc210x_read_sync(int page, u8 address);
++extern void tsc210x_reads_sync(int page, u8 startaddress, u16 *data,
+ int numregs);
-+extern void tsc2102_write_sync(int page, u8 address, u16 data);
++extern void tsc210x_write_sync(int page, u8 address, u16 data);
+
-+typedef void (*tsc2102_touch_t)(int touching);
-+typedef void (*tsc2102_coords_t)(int x, int y, int z1, int z2);
-+typedef void (*tsc2102_ports_t)(int bat1, int bat2, int aux);
-+typedef void (*tsc2102_temp_t)(int temp);
-+extern int tsc2102_touch_cb(tsc2102_touch_t handler);
-+extern int tsc2102_coords_cb(tsc2102_coords_t handler);
-+extern int tsc2102_ports_cb(tsc2102_ports_t handler);
-+extern int tsc2102_temp1_cb(tsc2102_temp_t handler);
++typedef void (*tsc210x_touch_t)(int touching);
++typedef void (*tsc210x_coords_t)(int x, int y, int z1, int z2);
++typedef void (*tsc210x_ports_t)(int bat1, int bat2, int aux);
++typedef void (*tsc210x_temp_t)(int temp);
++extern int tsc210x_touch_cb(tsc210x_touch_t handler);
++extern int tsc210x_coords_cb(tsc210x_coords_t handler);
++extern int tsc210x_ports_cb(tsc210x_ports_t handler);
++extern int tsc210x_temp1_cb(tsc210x_temp_t handler);
+
+#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE)
-+extern void tsc2102_set_volume(uint8_t left_ch, uint8_t right_ch);
-+extern void tsc2102_set_mute(int left_ch, int right_ch);
-+extern void tsc2102_get_mute(int *left_ch, int *right_ch);
-+extern void tsc2102_dac_power(int state);
-+extern int tsc2102_set_rate(int rate);
-+extern void tsc2102_set_i2s_master(int state);
-+extern void tsc2102_set_deemphasis(int enable);
-+extern void tsc2102_set_bassboost(int enable);
++extern void tsc210x_set_dac_volume(uint8_t left_ch, uint8_t right_ch);
++extern void tsc210x_set_dac_mute(int left_ch, int right_ch);
++extern void tsc210x_get_dac_mute(int *left_ch, int *right_ch);
++extern void tsc210x_dac_power(int state);
++extern int tsc210x_set_rate(int rate);
++extern void tsc210x_set_i2s_master(int state);
++extern void tsc210x_set_deemphasis(int enable);
++extern void tsc210x_set_bassboost(int enable);
+#endif // CONFIG_SOUND || CONFIG_SOUND_MODULE
+
-+extern void tsc2102_keyclick(int amplitude, int freq, int length);
++extern void tsc210x_keyclick(int amplitude, int freq, int length);
+
-+#define TSC2102_REG(pg, addr) pg, addr
++#define TSC210X_REG(pg, addr) pg, addr
+
+/* Page 0, Touch Screen & Keypad Data registers */
-+#define TSC2102_TS_X TSC2102_REG(0, 0x00)
-+#define TSC2102_TS_Y TSC2102_REG(0, 0x01)
-+#define TSC2102_TS_Z1 TSC2102_REG(0, 0x02)
-+#define TSC2102_TS_Z2 TSC2102_REG(0, 0x03)
-+#define TSC2102_TS_BAT1 TSC2102_REG(0, 0x05)
-+#define TSC2102_TS_BAT2 TSC2102_REG(0, 0x06)
-+#define TSC2102_TS_AUX TSC2102_REG(0, 0x07)
-+#define TSC2102_TS_TEMP1 TSC2102_REG(0, 0x09)
-+#define TSC2102_TS_TEMP2 TSC2102_REG(0, 0x0a)
++#define TSC2102_TS_X TSC210X_REG(0, 0x00)
++#define TSC2102_TS_Y TSC210X_REG(0, 0x01)
++#define TSC2102_TS_Z1 TSC210X_REG(0, 0x02)
++#define TSC2102_TS_Z2 TSC210X_REG(0, 0x03)
++#define TSC2102_TS_BAT1 TSC210X_REG(0, 0x05)
++#define TSC2102_TS_BAT2 TSC210X_REG(0, 0x06)
++#define TSC2102_TS_AUX TSC210X_REG(0, 0x07)
++#define TSC2102_TS_TEMP1 TSC210X_REG(0, 0x09)
++#define TSC2102_TS_TEMP2 TSC210X_REG(0, 0x0a)
+
+/* Page 1, Touch Screen & Keypad Control registers */
-+#define TSC2102_TS_ADC_CTRL TSC2102_REG(1, 0x00)
-+#define TSC2102_TS_STATUS_CTRL TSC2102_REG(1, 0x01)
-+#define TSC2102_TS_REF_CTRL TSC2102_REG(1, 0x03)
-+#define TSC2102_TS_RESET_CTRL TSC2102_REG(1, 0x04)
-+#define TSC2102_TS_CONFIG_CTRL TSC2102_REG(1, 0x05)
++#define TSC2102_TS_ADC_CTRL TSC210X_REG(1, 0x00)
++#define TSC2102_TS_STATUS_CTRL TSC210X_REG(1, 0x01)
++#define TSC2102_TS_REF_CTRL TSC210X_REG(1, 0x03)
++#define TSC2102_TS_RESET_CTRL TSC210X_REG(1, 0x04)
++#define TSC2102_TS_CONFIG_CTRL TSC210X_REG(1, 0x05)
+
+/* Page 2, Audio Control registers */
-+#define TSC2102_AUDIO1_CTRL TSC2102_REG(2, 0x00)
-+#define TSC2102_DAC_GAIN_CTRL TSC2102_REG(2, 0x02)
-+#define TSC2102_AUDIO2_CTRL TSC2102_REG(2, 0x04)
-+#define TSC2102_DAC_POWER_CTRL TSC2102_REG(2, 0x05)
-+#define TSC2102_AUDIO3_CTRL TSC2102_REG(2, 0x06)
-+#define TSC2102_LCH_BASS_BOOST_N0 TSC2102_REG(2, 0x07)
-+#define TSC2102_LCH_BASS_BOOST_N1 TSC2102_REG(2, 0x08)
-+#define TSC2102_LCH_BASS_BOOST_N2 TSC2102_REG(2, 0x09)
-+#define TSC2102_LCH_BASS_BOOST_N3 TSC2102_REG(2, 0x0a)
-+#define TSC2102_LCH_BASS_BOOST_N4 TSC2102_REG(2, 0x0b)
-+#define TSC2102_LCH_BASS_BOOST_N5 TSC2102_REG(2, 0x0c)
-+#define TSC2102_LCH_BASS_BOOST_D1 TSC2102_REG(2, 0x0d)
-+#define TSC2102_LCH_BASS_BOOST_D2 TSC2102_REG(2, 0x0e)
-+#define TSC2102_LCH_BASS_BOOST_D4 TSC2102_REG(2, 0x0f)
-+#define TSC2102_LCH_BASS_BOOST_D5 TSC2102_REG(2, 0x10)
-+#define TSC2102_RCH_BASS_BOOST_N0 TSC2102_REG(2, 0x11)
-+#define TSC2102_RCH_BASS_BOOST_N1 TSC2102_REG(2, 0x12)
-+#define TSC2102_RCH_BASS_BOOST_N2 TSC2102_REG(2, 0x13)
-+#define TSC2102_RCH_BASS_BOOST_N3 TSC2102_REG(2, 0x14)
-+#define TSC2102_RCH_BASS_BOOST_N4 TSC2102_REG(2, 0x15)
-+#define TSC2102_RCH_BASS_BOOST_N5 TSC2102_REG(2, 0x16)
-+#define TSC2102_RCH_BASS_BOOST_D1 TSC2102_REG(2, 0x17)
-+#define TSC2102_RCH_BASS_BOOST_D2 TSC2102_REG(2, 0x18)
-+#define TSC2102_RCH_BASS_BOOST_D4 TSC2102_REG(2, 0x19)
-+#define TSC2102_RCH_BASS_BOOST_D5 TSC2102_REG(2, 0x1a)
-+#define TSC2102_PLL1_CTRL TSC2102_REG(2, 0x1b)
-+#define TSC2102_PLL2_CTRL TSC2102_REG(2, 0x1c)
-+#define TSC2102_AUDIO4_CTRL TSC2102_REG(2, 0x1d)
++#define TSC2102_AUDIO1_CTRL TSC210X_REG(2, 0x00)
++#define TSC210X_DAC_GAIN_CTRL TSC210X_REG(2, 0x02)
++#define TSC2101_HEADSET_GAIN_CTRL TSC210X_REG(2, 0x01) /* TSC2101 only */
++#define TSC2101_MIXER_PGA_CTRL TSC210X_REG(2, 0x03) /* TSC2101 only */
++#define TSC2102_AUDIO2_CTRL TSC210X_REG(2, 0x04)
++#define TSC210X_CODEC_POWER_CTRL TSC210X_REG(2, 0x05)
++#define TSC2102_AUDIO3_CTRL TSC210X_REG(2, 0x06)
++#define TSC2102_LCH_BASS_BOOST_N0 TSC210X_REG(2, 0x07)
++#define TSC2102_LCH_BASS_BOOST_N1 TSC210X_REG(2, 0x08)
++#define TSC2102_LCH_BASS_BOOST_N2 TSC210X_REG(2, 0x09)
++#define TSC2102_LCH_BASS_BOOST_N3 TSC210X_REG(2, 0x0a)
++#define TSC2102_LCH_BASS_BOOST_N4 TSC210X_REG(2, 0x0b)
++#define TSC2102_LCH_BASS_BOOST_N5 TSC210X_REG(2, 0x0c)
++#define TSC2102_LCH_BASS_BOOST_D1 TSC210X_REG(2, 0x0d)
++#define TSC2102_LCH_BASS_BOOST_D2 TSC210X_REG(2, 0x0e)
++#define TSC2102_LCH_BASS_BOOST_D4 TSC210X_REG(2, 0x0f)
++#define TSC2102_LCH_BASS_BOOST_D5 TSC210X_REG(2, 0x10)
++#define TSC2102_RCH_BASS_BOOST_N0 TSC210X_REG(2, 0x11)
++#define TSC2102_RCH_BASS_BOOST_N1 TSC210X_REG(2, 0x12)
++#define TSC2102_RCH_BASS_BOOST_N2 TSC210X_REG(2, 0x13)
++#define TSC2102_RCH_BASS_BOOST_N3 TSC210X_REG(2, 0x14)
++#define TSC2102_RCH_BASS_BOOST_N4 TSC210X_REG(2, 0x15)
++#define TSC2102_RCH_BASS_BOOST_N5 TSC210X_REG(2, 0x16)
++#define TSC2102_RCH_BASS_BOOST_D1 TSC210X_REG(2, 0x17)
++#define TSC2102_RCH_BASS_BOOST_D2 TSC210X_REG(2, 0x18)
++#define TSC2102_RCH_BASS_BOOST_D4 TSC210X_REG(2, 0x19)
++#define TSC2102_RCH_BASS_BOOST_D5 TSC210X_REG(2, 0x1a)
++#define TSC210X_PLL1_CTRL TSC210X_REG(2, 0x1b)
++#define TSC210X_PLL2_CTRL TSC210X_REG(2, 0x1c)
++#define TSC2102_AUDIO4_CTRL TSC210X_REG(2, 0x1d)
++#define TSC2101_HANDSET_PGA_CTRL TSC210X_REG(2, 0x1e)
++#define TSC2101_CELL_BUZZER_PGA_CTRL TSC210X_REG(2, 0x1f)
++#define TSC2101_AUDIO5_CTRL TSC210X_REG(2, 0x20)
++#define TSC2101_AUDIO6_CTRL TSC210X_REG(2, 0x21)
++#define TSC2101_AUDIO7_CTRL TSC210X_REG(2, 0x22)
++#define TSC2101_GPIO_CTRL TSC210X_REG(2, 0x23)
++#define TSC2101_AGP_CPIN_CTRL TSC210X_REG(2, 0x24)
++#define TSC2101_POWERDOWN_STATUS TSC210X_REG(2, 0x25)
++#define TSC2101_MIC_AGC_CTRL TSC210X_REG(2, 0x26)
++#define TSC2101_CELL_PHONE_AGC_CTRL TSC210X_REG(2, 0x27)
+
+/* Field masks for Audio Control 1 */
++#define AC1_ADCHPF(ARG) (((ARG) & 0x03) << 14) /* TSC2101 only */
+#define AC1_WLEN(ARG) (((ARG) & 0x03) << 10)
+#define AC1_DATFM(ARG) (((ARG) & 0x03) << 8)
-+#define AC1_DACFS_MASK (0x3f)
-+#define AC1_DACFS(ARG) ((ARG) & AC1_DACFS_MASK)
++#define AC1_DACFS(ARG) (((ARG) & 0x07) << 3)
++#define AC1_ADCFS(ARG) (((ARG) & 0x07) << 0)
++/* on TSC2102 always set ADCFS = DACFS */
+
++/* Field masks for Gain Control for Headset/Aux Input */
++/* TSC2101 only */
++#define HGC_ADMUT_HED(ARG) (1 << 15)
++#define HGC_ADPGA_HED(ARG) (((ARG) & 0x7f) << 8)
++#define HGC_AGCTG_HED(ARG) (((ARG) & 0x07) << 5)
++#define HGC_AGCTC_HED(ARG) (((ARG) & 0x0f) << 1)
++#define HGC_AGCEN_HED(ARG) (1 << 0)
++
+/* Field masks for TSC2102_DAC_GAIN_CTRL */
+#define DGC_DALMU (1 << 15)
+#define DGC_DALVL(ARG) (((ARG) & 0x7f) << 8)
+#define DGC_DARMU (1 << 7)
+#define DGC_DARVL(ARG) (((ARG) & 0x7f))
+
++/* Field masks for Mixer PGA Control */
++/* TSC2101 only: */
++#define MPC_ASTMU (1 << 15)
++#define MPC_ASTG(ARG) (((ARG) & 0x7f) << 8)
++#define MPC_MICSEL(ARG) (((ARG) & 0x07) << 5)
++#define MPC_MICADC (1 << 4)
++#define MPC_CPADC (1 << 3)
++#define MPC_ASTGF (1 << 0)
++
+/* Field formats for TSC2102_AUDIO2_CTRL */
+#define AC2_KCLEN (1 << 15)
+#define AC2_KCLAC(ARG) (((ARG) & 0x07) << 12)
++#define AC2_APGASS (1 << 11) /* TSC2101 only */
+#define AC2_KCLFRQ(ARG) (((ARG) & 0x07) << 8)
+#define AC2_KCLLN(ARG) (((ARG) & 0x0f) << 4)
+#define AC2_DLGAF (1 << 3)
+#define AC2_DRGAF (1 << 2)
+#define AC2_DASTC (1 << 1)
++#define AC2_ADGAF (1 << 0) /* TSC2101 only */
+
-+/* Field masks for TSC2102_DAC_POWER_CTRL */
++/* Field masks for TSC2102_CODEC_POWER_CTRL */
+#define CPC_PWDNC (1 << 15)
+#define CPC_DAODRC (1 << 12)
+#define CPC_DAPWDN (1 << 10)
+#define CPC_VGPWDN (1 << 8)
+#define CPC_DAPWDF (1 << 6)
+#define CPC_BASSBC (1 << 1)
-+#define CPC_DEEMPF (0x01)
++#define CPC_DEEMPF (1 << 0)
++/* TSC2101 specific bits */
++#define CPC_MBIAS_HND (1 << 15)
++#define CPC_MBIAS_HED (1 << 14)
++#define CPC_ASTPWD (1 << 13)
++#define CPC_SP1PWDN (1 << 12)
++#define CPC_SP2PWDN (1 << 11)
++#define CPC_ADPWDN (1 << 9)
++#define CPC_COPWDN (1 << 7)
++#define CPC_LSPWDN (1 << 6)
++#define CPC_ADPWDF (1 << 5)
++#define CPC_LDAPWDF (1 << 4)
++#define CPC_RDAPWDF (1 << 3)
++#define CPC_ASTPWF (1 << 2)
++#define CPC_EFFCTL (1 << 1)
+
-+/* Field masks for TSC2101_AUDIO_CTRL_3 */
++/* Field masks for TSC210x_AUDIO_CTRL_3 */
+#define AC3_DMSVOL(ARG) (((ARG) & 0x03) << 14)
+#define AC3_REFFS (1 << 13)
+#define AC3_DAXFM (1 << 12)
+#define AC3_SLVMS (1 << 11)
++#define AC3_ADCOVF (1 << 8) /* TSC2101 only */
+#define AC3_DALOVF (1 << 7)
+#define AC3_DAROVF (1 << 6)
++#define AC3_CLPST (1 << 3) /* TSC2101 only */
+#define AC3_REVID(ARG) (((ARG) & 0x07))
+
+/* Field masks for TSC2102_PLL1_CTRL */
@@ -171,10 +223,80 @@
+/* Field masks for TSC2102_PLL2_CTRL */
+#define PLL2_D_VAL(ARG) (((ARG) & 0x3fff) << 2)
+
-+/* Field masks for TSC2101_AUDIO_CTRL_4 */
++/* Field masks for TSC210x_AUDIO_CTRL_4 */
+#define AC4_DASTPD (1 << 14)
++/* TSC2101 only: */
++#define AC4_ADSTPD (1 << 15)
++#define AC4_ASSTPD (1 << 13)
++#define AC4_CISTPD (1 << 12)
++#define AC4_BISTPD (1 << 11)
++#define AC4_AGCHYS(ARG) (((ARG) & 0x03) << 9)
++#define AC4_MB_HED(ARG) (((ARG) & 0x03) << 7)
++#define AC4_MB_HND (1 << 6)
++#define AC4_SCPFL (1 << 1)
+
-+struct tsc2102_rate_info_s {
++/* !! FOLLOWING REGISTERS ARE ONLY AVAILABLE ON TSC2101 !! */
++
++/* Field masks for TSC2101_HANDSET_PGA_CTRL */
++#define HIGC_ADMUT_HND (1 << 15)
++#define HIGC_ADPGA_HND(ARG) (((ARG) & 0x7f) << 8)
++#define HIGC_AGCTG_HND(ARG) (((ARG) & 0x07) << 5)
++#define HIGC_AGCTC_HND(ARG) (((ARG) & 0x0f) << 1)
++#define HIGC_AGCEN_HND(ARG) (1 << 0)
++
++/* Field masks for TSC2101_CELL_BUZZER_PGA_CTRL */
++#define CPBGC_MUT_CP (1 << 15)
++#define CPBGC_CPGA(ARG) (((ARG) & 0x7f) << 8)
++#define CPBGC_CPGF (1 << 7)
++#define CPBGC_MUT_BU (1 << 6)
++#define CPBGC_BPGA(ARG) (((ARG) & 0x0f) << 2)
++#define CPBGC_BUGF (1 << 1)
++
++/* Field masks for TSC2101_AUDIO_CTRL_5 */
++#define AC5_DIFFIN (1 << 15)
++#define AC5_DAC2SPK1(ARG) (((ARG) & 0x03) << 13)
++#define AC5_AST2SPK1 (1 << 12)
++#define AC5_BUZ2SPK1 (1 << 11)
++#define AC5_KCL2SPK1 (1 << 10)
++#define AC5_CPI2SPK1 (1 << 9)
++#define AC5_DAC2SPK2(ARG) (((ARG) & 0x03) << 7)
++#define AC5_AST2SPK2 (1 << 6)
++#define AC5_BUZ2SPK2 (1 << 5)
++#define AC5_KCL2SPK2 (1 << 4)
++#define AC5_CPI2SPK2 (1 << 3)
++#define AC5_MUTSPK1 (1 << 2)
++#define AC5_MUTSPK2 (1 << 1)
++#define AC5_HDSCPTC (1 << 0)
++
++/* Field masks for TSC2101_AUDIO_CTRL_6 */
++#define AC6_SPL2LSK (1 << 15)
++#define AC6_AST2LSK (1 << 14)
++#define AC6_BUZ2LSK (1 << 13)
++#define AC6_KCL2LSK (1 << 12)
++#define AC6_CPI2LSK (1 << 11)
++#define AC6_MIC2CPO (1 << 10)
++#define AC6_SPL2CPO (1 << 9)
++#define AC6_SPR2CPO (1 << 8)
++#define AC6_MUTLSPK (1 << 7)
++#define AC6_MUTSPK2 (1 << 6)
++#define AC6_LDSCPTC (1 << 5)
++#define AC6_VGNDSCPTC (1 << 4)
++#define AC6_CAPINTF (1 << 3)
++
++/* Field masks for TSC2101_AUDIO_CTRL_7 */
++#define AC7_DETECT (1 << 15)
++#define AC7_HESTYPE(ARG) (((ARG) & 0x03) << 13)
++#define AC7_HDDETFL (1 << 12)
++#define AC7_BDETFL (1 << 11)
++#define AC7_HDDEBNPG(ARG) (((ARG) & 0x03) << 9)
++#define AC7_BDEBNPG(ARG) (((ARG) & 0x03) << 6)
++#define AC7_DGPIO2 (1 << 4)
++#define AC7_DGPIO1 (1 << 3)
++#define AC7_CLKGPIO2 (1 << 2)
++#define AC7_ADWSF(ARG) ((ARG) & 0x03)
++
++
++struct tsc210x_rate_info_s {
+ u16 sample_rate;
+ u8 divisor;
+ u8 fs_44k; /* 44.1 kHz Fsref if 1, 48 kHz if 0 */
@@ -186,7 +308,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/drivers/spi/tsc2102.c
+++ linux-2.6.27.2.mod/drivers/spi/tsc2102.c
-@@ -0,0 +1,1000 @@
+@@ -0,0 +1,1114 @@
+/*
+ * drivers/spi/tsc2102.c
+ *
@@ -229,17 +351,11 @@
+#include <asm/system.h>
+#include <asm/irq.h>
+#include <asm/io.h>
-+/*#include <asm/mach-types.h>
-+#include <asm/hardware.h>*/
+
+#ifdef CONFIG_APM
+#include <asm/apm.h>
+#endif
+
-+#ifdef CONFIG_MACH_APF9328 // TODO: Put MCLK choice in Kconfig ??
-+#define MCLK_16M 1
-+#endif // CONFIG_MACH_APF9328
-+
+/* #define DEBUG */
+#define DEBUG_AUDIO
+
@@ -263,32 +379,20 @@
+#define TSC2102_PS_DAV 0x0078
+#define TSC2102_T1_DAV 0x0004
+#define TSC2102_T2_DAV 0x0002
++#define TSC2101_DAC_ON 0x0000
++#define TSC2101_DAC_OFF 0xe7fc
+#define TSC2102_DAC_ON 0x3ba0
+#define TSC2102_DAC_OFF 0xafa0
-+#define TSC2102_FS44K (1 << 13)
-+#define TSC2102_PLL1_OFF 0x0000
-+#ifdef MCLK_16M /* 16Mhz master clock */
-+#define TSC2102_PLL1_44K (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(5))
-+#define TSC2102_PLL1_48K (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(6))
-+#define TSC2102_PLL2_44K (PLL2_D_VAL(6448))
-+#define TSC2102_PLL2_48K (PLL2_D_VAL(1440))
-+#else
-+#define TSC2102_PLL1_44K 0x811c
-+#define TSC2102_PLL1_48K 0x8120
-+#define TSC2102_PLL2_44K (5462 << 2)
-+#define TSC2102_PLL2_48K (1920 << 2)
-+#endif // MCLK_16M
-+#define TSC2102_SLVMS (1 << 11)
-+#define TSC2102_DEEMPF (1 << 0)
-+#define TSC2102_BASSBC (1 << 1)
-+#define TSC2102_KEYCLICK_OFF 0x0000
++#define TSC210X_PLL1_OFF 0x0000
++#define TSC210x_AUDIO1_INIT_VAL (AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0) | AC1_ADCFS(0))
++#define TSC210X_KEYCLICK_OFF 0x0000
+
+#define CS_CHANGE(val) 0
+
+#define SM_BAT_AUX 0
+#define SM_TEMP1 1
+
-+struct tsc2102_spi_req {
++struct tsc210x_spi_req {
+ struct spi_device *dev;
+ uint16_t command;
+ uint16_t data;
@@ -296,27 +400,32 @@
+ struct spi_message message;
+};
+
-+struct tsc2102_dev {
-+ struct tsc2102_config *pdata;
++struct tsc210x_dev {
++ enum tsc_type {
++ tsc2101,
++ tsc2102,
++ } kind;
++ struct tsc210x_config *pdata;
+ spinlock_t lock;
+ struct mutex lock_sync;
-+// struct clk *bclk_ck; TODO add clock mechanism to i.MX ???
++ struct clk *mclk_ck;
++ unsigned int mclk;
+
+ int state; /* Scan modes */
+ struct timer_list ts_timer; /* Busy-wait for PEN UP */
+ struct timer_list mode_timer; /* Change .state every some time */
+
+ uint16_t status, adc_status, adc_data[4];
-+ tsc2102_touch_t touch_cb;
-+ tsc2102_coords_t coords_cb;
-+ tsc2102_ports_t ports_cb;
-+ tsc2102_temp_t temp1_cb;
++ tsc210x_touch_t touch_cb;
++ tsc210x_coords_t coords_cb;
++ tsc210x_ports_t ports_cb;
++ tsc210x_temp_t temp1_cb;
+ unsigned int ts_msecs; /* Interval for .ts_timer */
+ unsigned int mode_msecs; /* Interval for .mode_timer */
+
+ struct spi_device *spi;
+
-+ int bat[2], aux[1], temp;
++ int bat[2], aux[2], temp;
+ struct device *hwmondev;
+ struct work_struct work;
+ unsigned long todo;
@@ -324,7 +433,7 @@
+
+};
+
-+static struct tsc2102_dev tsc;
++static struct tsc210x_dev tsc;
+
+module_param_named(touch_check_msecs, tsc.ts_msecs, uint, 0);
+MODULE_PARM_DESC(touch_check_msecs, "Pen-up polling interval in msecs");
@@ -332,9 +441,9 @@
+module_param_named(sensor_scan_msecs, tsc.mode_msecs, uint, 0);
+MODULE_PARM_DESC(sensor_scan_msecs, "Temperature & battery scan interval");
+
-+void tsc2102_write_sync(int page, u8 address, u16 data)
++void tsc210x_write_sync(int page, u8 address, u16 data)
+{
-+ static struct tsc2102_spi_req req;
++ static struct tsc210x_spi_req req;
+ static struct spi_transfer transfer[2];
+ int ret;
+
@@ -364,9 +473,9 @@
+ __FUNCTION__, ret);
+}
+
-+void tsc2102_reads_sync(int page, u8 startaddress, u16 *data, int numregs)
++void tsc210x_reads_sync(int page, u8 startaddress, u16 *data, int numregs)
+{
-+ static struct tsc2102_spi_req req;
++ static struct tsc210x_spi_req req;
+ static struct spi_transfer transfer[6];
+ int ret, i, j;
+
@@ -402,47 +511,53 @@
+ __FUNCTION__, ret);
+}
+
-+u16 tsc2102_read_sync(int page, u8 address)
++u16 tsc210x_read_sync(int page, u8 address)
+{
+ u16 ret;
-+ tsc2102_reads_sync(page, address, &ret, 1);
++ tsc210x_reads_sync(page, address, &ret, 1);
+ return ret;
+}
+
+static void tsc_work(struct work_struct *work)
+{
+#define Z2STAT (1<<7)
-+#define AXSTAT (1<<4)
++#define AXSTAT (3<<3)
+#define T1STAT (1<<2)
+
+ int status;
+
+ mutex_lock(&tsc.lock_sync);
++
+ /* state of SM has to be changed ? */
+ if( test_and_clear_bit( WORK_CHANGE_MODE,&tsc.todo) ){
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL, TSC2102_ADC_ADST);
+ /* change state of SM */
+ if( tsc.state == SM_TEMP1 ){
+ tsc.state = SM_BAT_AUX;
-+ tsc2102_write_sync(TSC2102_TS_STATUS_CTRL,
++ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL,
+ TSC2102_ADC_DAV);
-+ tsc2102_write_sync(TSC2102_TS_ADC_CTRL,
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL,
+ TSC2102_ADC_SCAN_CONTROL);
+ }
+ else{
+ tsc.state = SM_TEMP1;
-+ tsc2102_write_sync(TSC2102_TS_STATUS_CTRL,
++ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL,
+ TSC2102_ADC_DAV);
-+ tsc2102_write_sync(TSC2102_TS_ADC_CTRL,
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL,
+ TSC2102_ADC_T1_CONTROL);
+ }
++ /* restart mode timer */
++ mod_timer(&tsc.mode_timer, jiffies +
++ msecs_to_jiffies(tsc.mode_msecs));
+ }
-+
-+ status = tsc2102_read_sync(TSC2102_TS_STATUS_CTRL);
++ status = tsc210x_read_sync(TSC2102_TS_STATUS_CTRL);
+
-+ if( status & Z2STAT){
-+ int pendown;
-+ tsc2102_reads_sync( TSC2102_TS_X, tsc.adc_data, 4);
-+ pendown = tsc2102_read_sync(TSC2102_TS_ADC_CTRL) & TSC2102_ADC_PSTCM;
++ if (status & Z2STAT) {
++ /* get pendown status */
++ int pendown = tsc210x_read_sync(TSC2102_TS_ADC_CTRL) & TSC2102_ADC_PSTCM;
++ /* postponed next interrupt to avoid processor overload */
++ msleep(3);
++ tsc210x_reads_sync( TSC2102_TS_X, tsc.adc_data, 4);
+ /* avoid sending data if pen is up*/
+ if (tsc.coords_cb && pendown){
+ tsc.coords_cb(tsc.adc_data[0], tsc.adc_data[1],
@@ -450,34 +565,35 @@
+ }
+ }
+
-+ if( status & AXSTAT ){
-+ tsc2102_reads_sync( TSC2102_TS_BAT1, tsc.adc_data, 3);
++ if (status & AXSTAT) {
++ tsc210x_reads_sync(TSC2102_TS_BAT1, tsc.adc_data, 4);
+ if (tsc.ports_cb)
+ tsc.ports_cb(tsc.adc_data[0], tsc.adc_data[1],
+ tsc.adc_data[2]);
+ tsc.bat[0] = tsc.adc_data[0];
+ tsc.bat[1] = tsc.adc_data[1];
+ tsc.aux[0] = tsc.adc_data[2];
++ tsc.aux[1] = tsc.adc_data[3];
+ /* switch to pintdav and TS control */
-+ tsc2102_write_sync( TSC2102_TS_ADC_CTRL,
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL,
+ TSC2102_ADC_TS_CONTROL);
-+ tsc2102_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_PINTDAV);
++ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_PINTDAV);
+ }
-+ else if( status & T1STAT) {
-+ tsc.temp = tsc2102_read_sync(TSC2102_TS_TEMP1);
++ else if (status & T1STAT) {
++ tsc.temp = tsc210x_read_sync(TSC2102_TS_TEMP1);
+ if (tsc.temp1_cb)
+ tsc.temp1_cb(tsc.temp);
+ /* switch to pintdav and TS control */
-+ tsc2102_write_sync( TSC2102_TS_ADC_CTRL,
++ tsc210x_write_sync( TSC2102_TS_ADC_CTRL,
+ TSC2102_ADC_TS_CONTROL);
-+ tsc2102_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_PINTDAV);
++ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_PINTDAV);
+ }
+
+ mutex_unlock(&tsc.lock_sync);
+}
+
-+#define tsc2102_cb_register_func(cb, cb_t) \
-+int tsc2102_ ## cb(cb_t handler) \
++#define tsc210x_cb_register_func(cb, cb_t) \
++int tsc210x_ ## cb(cb_t handler) \
+{ \
+ spin_lock(&tsc.lock); \
+ \
@@ -496,17 +612,17 @@
+}
+
+
-+tsc2102_cb_register_func(touch_cb, tsc2102_touch_t)
-+EXPORT_SYMBOL(tsc2102_touch_cb);
-+tsc2102_cb_register_func(coords_cb, tsc2102_coords_t)
-+EXPORT_SYMBOL(tsc2102_coords_cb);
-+tsc2102_cb_register_func(ports_cb, tsc2102_ports_t)
-+tsc2102_cb_register_func(temp1_cb, tsc2102_temp_t)
++tsc210x_cb_register_func(touch_cb, tsc210x_touch_t)
++EXPORT_SYMBOL(tsc210x_touch_cb);
++tsc210x_cb_register_func(coords_cb, tsc210x_coords_t)
++EXPORT_SYMBOL(tsc210x_coords_cb);
++tsc210x_cb_register_func(ports_cb, tsc210x_ports_t)
++tsc210x_cb_register_func(temp1_cb, tsc210x_temp_t)
+
+#ifdef DEBUG
+static void tsc2102_print_dav(void)
+{
-+ u16 status = tsc2102_read_sync(TSC2102_TS_STATUS_CTRL);
++ u16 status = tsc210x_read_sync(TSC2102_TS_STATUS_CTRL);
+ if (status & 0x0fff)
+ printk("TSC2102: data in");
+ if (status & 0x0400)
@@ -538,19 +654,18 @@
+
+static void tsc2102_mode(unsigned long data)
+{
-+ struct tsc2102_dev *dev = (struct tsc2102_dev *) data;
-+ /* request change of SM state */
-+ set_bit(WORK_CHANGE_MODE, &dev->todo);
-+ schedule_work(&dev->work);
-+ /* restart mode timer */
-+ mod_timer(&dev->mode_timer, jiffies +
-+ msecs_to_jiffies(dev->mode_msecs));
++ struct tsc210x_dev *dev = (struct tsc210x_dev *) data;
++// if(!test_bit( PENDOWN,&dev->todo)){
++ /* request change of SM state */
++ set_bit(WORK_CHANGE_MODE, &dev->todo);
++ schedule_work(&dev->work);
++// }
+}
+
+/* TSC has new data for us available. */
+static irqreturn_t tsc2102_handler(int irq, void *dev_id)
+{
-+ struct tsc2102_dev *dev = (struct tsc2102_dev *) dev_id;
++ struct tsc210x_dev *dev = (struct tsc210x_dev *) dev_id;
+ /* restart pen up timer */
+ mod_timer(&tsc.ts_timer, jiffies +
+ msecs_to_jiffies(tsc.ts_msecs));
@@ -561,7 +676,9 @@
+
+static void tsc2102_pressure(unsigned long data)
+{
-+ struct tsc2102_dev *dev = (struct tsc2102_dev *) data;
++ struct tsc210x_dev *dev = (struct tsc210x_dev *) data;
++ //printk("pen up\n");
++ //clear_bit(PENDOWN, &dev->todo);
+ if (dev->touch_cb)
+ dev->touch_cb(0);
+}
@@ -572,238 +689,323 @@
+ * Volume level values should be in the range [0, 127].
+ * Higher values mean lower volume.
+ */
-+void tsc2102_set_volume(uint8_t left_ch, uint8_t right_ch)
++void tsc210x_set_dac_volume(uint8_t left_ch, uint8_t right_ch)
+{
+ u16 val;
-+ if (left_ch == 0x00 || left_ch == 0x7f) /* All 0's or all 1's */
-+ left_ch ^= 0x7f;
-+ if (right_ch == 0x00 || right_ch == 0x7f)
-+ right_ch ^= 0x7f;
+
++ if (tsc.kind == tsc2102) {
++ /* On TSC2102, 127 means 0dB and 0 -63,5 dB */
++ if (left_ch == 0x00 || left_ch == 0x7f)
++ left_ch ^= 0x7f;
++ if (right_ch == 0x00 || right_ch == 0x7f)
++ right_ch ^= 0x7f;
++ }
+ mutex_lock(&tsc.lock_sync);
-+ val = tsc2102_read_sync(TSC2102_DAC_GAIN_CTRL);
++ val = tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL);
++ /* ?? No check ?? */
+
-+ val &= 0x8080; /* Preserve mute-bits */
-+ val |= (left_ch << 8) | right_ch;
++ val &= (DGC_DALMU | DGC_DARMU); /* Preserve mute-bits */
++ val |= DGC_DALVL(left_ch) | DGC_DARVL(right_ch);
+
-+ tsc2102_write_sync(TSC2102_DAC_GAIN_CTRL, val);
++ tsc210x_write_sync(TSC210X_DAC_GAIN_CTRL, val);
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_set_volume);
++EXPORT_SYMBOL(tsc210x_set_dac_volume);
+
-+void tsc2102_set_mute(int left_ch, int right_ch)
++void tsc210x_set_dac_mute(int left_ch, int right_ch)
+{
+ u16 val;
+ mutex_lock(&tsc.lock_sync);
+
-+ val = tsc2102_read_sync(TSC2102_DAC_GAIN_CTRL);
++ val = tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL);
++ /* ?? No check ?? */
+
-+ val &= 0x7f7f; /* Preserve volume settings */
-+ val |= (left_ch << 15) | (right_ch << 7);
++ val &= DGC_DALVL(0x7f) | DGC_DARVL(0x7f); /* Preserve volume settings */
++ if (left_ch)
++ val |= DGC_DALMU;
++ if (right_ch)
++ val |= DGC_DARMU;
+
-+ tsc2102_write_sync(TSC2102_DAC_GAIN_CTRL, val);
++ tsc210x_write_sync(TSC210X_DAC_GAIN_CTRL, val);
+
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_set_mute);
++EXPORT_SYMBOL(tsc210x_set_dac_mute);
+
-+void tsc2102_get_mute(int *left_ch, int *right_ch)
++void tsc210x_get_dac_mute(int *left_ch, int *right_ch)
+{
+ u16 val;
+ mutex_lock(&tsc.lock_sync);
+
-+ val = tsc2102_read_sync(TSC2102_DAC_GAIN_CTRL);
++ val = tsc210x_read_sync(TSC210X_DAC_GAIN_CTRL);
+
+ mutex_unlock(&tsc.lock_sync);
+
-+ *left_ch = !!(val & (1 << 15));
-+ *right_ch = !!(val & (1 << 7));
++ *left_ch = !!(val & DGC_DALMU);
++ *right_ch = !!(val & DGC_DARMU);
+}
-+EXPORT_SYMBOL(tsc2102_get_mute);
++EXPORT_SYMBOL(tsc210x_get_dac_mute);
+
-+void tsc2102_set_deemphasis(int enable)
++void tsc210x_set_deemphasis(int enable)
+{
+ u16 val;
+ mutex_lock(&tsc.lock_sync);
-+ val = tsc2102_read_sync(TSC2102_DAC_POWER_CTRL);
++ val = tsc210x_read_sync(TSC210X_CODEC_POWER_CTRL);
+
+ if (enable)
-+ val &= ~TSC2102_DEEMPF;
++ val &= ~CPC_DEEMPF;
+ else
-+ val |= TSC2102_DEEMPF;
++ val |= CPC_DEEMPF;
+
-+ tsc2102_write_sync(TSC2102_DAC_POWER_CTRL, val);
++ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, val);
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_set_deemphasis);
++EXPORT_SYMBOL(tsc210x_set_deemphasis);
+
-+void tsc2102_set_bassboost(int enable)
++void tsc210x_set_bassboost(int enable)
+{
+ u16 val;
++
+ mutex_lock(&tsc.lock_sync);
-+ val = tsc2102_read_sync(TSC2102_DAC_POWER_CTRL);
++ val = tsc210x_read_sync(TSC210X_CODEC_POWER_CTRL);
+
+ if (enable)
-+ val &= ~TSC2102_BASSBC;
++ val &= ~CPC_BASSBC;
+ else
-+ val |= TSC2102_BASSBC;
++ val |= CPC_BASSBC;
+
-+ tsc2102_write_sync(TSC2102_DAC_POWER_CTRL, val);
++ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, val);
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_set_bassboost);
++EXPORT_SYMBOL(tsc210x_set_bassboost);
+
-+/* {rate, divisor, fsref?=44,1k} */
-+static const struct tsc2102_rate_info_s tsc2102_rates[] = {
++/* {rate, divisor (for AC1), fsref} */
++static const struct tsc210x_rate_info_s tsc210x_rates[] = {
+ /* Fsref / 6.0 */
-+ {7350, 63, 1},
-+ {8000, 63, 0},
-+ /* Fsref / 6.0 */
-+ {7350, 54, 1},
-+ {8000, 54, 0},
++ {7350, 7, 1},
++ {8000, 7, 0},
++ /* Fsref / 5.5 */
++ {7350, 6, 1},
++ {8000, 6, 0},
+ /* Fsref / 5.0 */
-+ {8820, 45, 1},
-+ {9600, 45, 0},
++ {8820, 5, 1},
++ {9600, 5, 0},
+ /* Fsref / 4.0 */
-+ {11025, 36, 1},
-+ {12000, 36, 0},
++ {11025, 4, 1},
++ {12000, 4, 0},
+ /* Fsref / 3.0 */
-+ {14700, 27, 1},
-+ {16000, 27, 0},
++ {14700, 3, 1},
++ {16000, 3, 0},
+ /* Fsref / 2.0 */
-+ {22050, 18, 1},
-+ {24000, 18, 0},
++ {22050, 2, 1},
++ {24000, 2, 0},
+ /* Fsref / 1.5 */
-+ {29400, 9, 1},
-+ {32000, 9, 0},
++ {29400, 1, 1},
++ {32000, 1, 0},
+ /* Fsref */
+ {44100, 0, 1},
+ {48000, 0, 0},
-+
+ /* end of struct */
+ {0, 0, 0},
+};
+
-+int tsc2102_set_rate(int rate)
++struct pll_values {
++ u16 pll1;
++ u16 pll2;
++};
++
++static void tsc210x_calculate_pll(struct pll_values* pll, unsigned int mclk, unsigned int fsref)
+{
++ if (fsref == 44100) {
++ switch(mclk)
++ {
++ case 12288000:
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(7));
++ pll->pll2 = (PLL2_D_VAL(3500));
++ break;
++
++ case 16000000:
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(5));
++ pll->pll2 = (PLL2_D_VAL(6448));
++ break;
++
++ default:
++ pll->pll1 = 0x811c;
++ pll->pll2 = (PLL2_D_VAL(5462));
++ break;
++ }
++ } else { /* 48000 */
++ switch(mclk)
++ {
++ case 12288000:
++ /*pll->pll1 = (PLL1_Q_VAL(2)) -> doesn't work without enabling PLL */
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(8));
++ pll->pll2 = (PLL2_D_VAL(0));
++ break;
++
++ case 16000000:
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(6));
++ pll->pll2 = (PLL2_D_VAL(1440));
++ break;
++
++ default:
++ pll->pll1 = 0x8120;
++ pll->pll2 = (PLL2_D_VAL(1920));
++ break;
++ }
++ }
++}
++
++static void tsc210x_set_fsref(unsigned int fsref)
++{
++ struct pll_values pll;
++
++ tsc210x_calculate_pll(&pll, tsc.mclk, fsref);
++ /* Enable Phase-locked-loop & set up clock dividers */
++ tsc210x_write_sync(TSC210X_PLL1_CTRL, pll.pll1);
++ tsc210x_write_sync(TSC210X_PLL2_CTRL, pll.pll2);
++}
++
++int tsc210x_set_rate(int rate)
++{
+ int i;
-+ uint16_t val;
++ int val;
++ const struct tsc210x_rate_info_s *rates;
+
-+ for (i = 0; tsc2102_rates[i].sample_rate; i ++)
-+ if (tsc2102_rates[i].sample_rate == rate)
++ rates = tsc210x_rates;
++
++ for (i = 0; rates[i].sample_rate; i ++)
++ if (rates[i].sample_rate == rate)
+ break;
-+ if (tsc2102_rates[i].sample_rate == 0) {
++ if (rates[i].sample_rate == 0) {
+ printk(KERN_ERR "Unknown sampling rate %i.0 Hz\n", rate);
+ return -EINVAL;
+ }
+
+ mutex_lock(&tsc.lock_sync);
+
-+ val = tsc2102_read_sync(TSC2102_AUDIO1_CTRL) & ~AC1_DACFS_MASK;
-+ tsc2102_write_sync(TSC2102_AUDIO1_CTRL, val | AC1_DACFS(tsc2102_rates[i].divisor) );
++ val = tsc210x_read_sync(TSC2102_AUDIO1_CTRL);
++ if (val < 0) {
++ printk(KERN_ERR "%s, err %d\n", __FUNCTION__, val);
++ return val;
++ }
+
-+ val = tsc2102_read_sync(TSC2102_AUDIO3_CTRL);
++ val &= ~AC1_DACFS(0xff) & ~AC1_ADCFS(0xff);
++ val |= AC1_DACFS(rates[i].divisor);
++ val |= AC1_ADCFS(rates[i].divisor);
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, val );
+
-+ if (tsc2102_rates[i].fs_44k) {
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, val | TSC2102_FS44K);
-+ /* Enable Phase-locked-loop, set up clock dividers */
-+ tsc2102_write_sync(TSC2102_PLL1_CTRL, TSC2102_PLL1_44K);
-+ tsc2102_write_sync(TSC2102_PLL2_CTRL, TSC2102_PLL2_44K);
++ val = tsc210x_read_sync(TSC2102_AUDIO3_CTRL);
++
++ if (rates[i].fs_44k) {
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, val | AC3_REFFS);
++ tsc210x_set_fsref(44100);
+ } else {
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, val & ~TSC2102_FS44K);
-+ /* Enable Phase-locked-loop, set up clock dividers */
-+ tsc2102_write_sync(TSC2102_PLL1_CTRL, TSC2102_PLL1_48K);
-+ tsc2102_write_sync(TSC2102_PLL2_CTRL, TSC2102_PLL2_48K);
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, val & ~AC3_REFFS);
++ tsc210x_set_fsref(48000);
+ }
+
+ mutex_unlock(&tsc.lock_sync);
+ return 0;
+}
-+EXPORT_SYMBOL(tsc2102_set_rate);
++EXPORT_SYMBOL(tsc210x_set_rate);
+
+/*
+ * Perform basic set-up with default values and power the DAC on.
+ */
-+void tsc2102_dac_power(int state)
++void tsc210x_dac_power(int state)
+{
+ mutex_lock(&tsc.lock_sync);
+
+ if (state) {
+ /* 16-bit words, I2S mode, sample at Fsref */
-+ tsc2102_write_sync(TSC2102_AUDIO1_CTRL, AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0) );
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0) );
+ /* Keyclicks off, soft-stepping at normal rate */
-+ tsc2102_write_sync(TSC2102_AUDIO2_CTRL, TSC2102_KEYCLICK_OFF);
++ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, TSC210X_KEYCLICK_OFF);
+ /* 44.1 kHz Fsref, continuous transfer mode, master DAC */
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, 0x2800);
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, 0x2800);
+ /* Soft-stepping enabled */
-+ tsc2102_write_sync(TSC2102_AUDIO4_CTRL, 0x0000);
-+
++ tsc210x_write_sync(TSC2102_AUDIO4_CTRL, 0x0000);
+ /* PLL generates 44.1 kHz */
-+ tsc2102_write_sync(TSC2102_PLL1_CTRL, TSC2102_PLL1_44K);
-+ tsc2102_write_sync(TSC2102_PLL2_CTRL, TSC2102_PLL2_44K);
-+
++ tsc210x_set_fsref(44100);
+ /* Codec & DAC power up, virtual ground disabled */
-+ tsc2102_write_sync(TSC2102_DAC_POWER_CTRL, TSC2102_DAC_ON);
++ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL,
++ (tsc.kind == tsc2101) ? TSC2101_DAC_ON : TSC2102_DAC_ON);
+ } else {
+ /* All off */
-+ tsc2102_write_sync(TSC2102_AUDIO4_CTRL, TSC2102_KEYCLICK_OFF);
-+ tsc2102_write_sync(TSC2102_PLL1_CTRL, TSC2102_PLL1_OFF);
++ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, TSC210X_KEYCLICK_OFF);
++ tsc210x_write_sync(TSC210X_PLL1_CTRL, TSC210X_PLL1_OFF);
+ }
+
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_dac_power);
++EXPORT_SYMBOL(tsc210x_dac_power);
+
-+void tsc2102_set_i2s_master(int state)
++void tsc210x_set_i2s_master(int state)
+{
+ uint16_t val;
+ mutex_lock(&tsc.lock_sync);
+
-+ val = tsc2102_read_sync(TSC2102_AUDIO3_CTRL);
++ val = tsc210x_read_sync(TSC2102_AUDIO3_CTRL);
++ /* if (val < 0) { ?? no check ??
++ printk(KERN_ERR "%s, err %d\n", __FUNCTION__, val);
++ return;
++ }*/
+
+ if (state)
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, val | TSC2102_SLVMS);
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, val | AC3_SLVMS);
+ else
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, val & ~TSC2102_SLVMS);
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, val & ~AC3_SLVMS);
+
+ mutex_unlock(&tsc.lock_sync);
+}
-+EXPORT_SYMBOL(tsc2102_set_i2s_master);
++EXPORT_SYMBOL(tsc210x_set_i2s_master);
+#endif /* CONFIG_SOUND || CONFIG_SOUND_MODULE */
+
-+static int tsc2102_configure(struct tsc2102_dev *dev)
++static int tsc2102_configure(struct tsc210x_dev *dev)
+{
+ /* Reset the chip */
-+ tsc2102_write_sync(TSC2102_TS_RESET_CTRL, TSC2102_RESET);
++ tsc210x_write_sync(TSC2102_TS_RESET_CTRL, TSC2102_RESET);
+
+ /* Reference mode, 100 usec delay, 2.5V reference */
+ if (dev->pdata->use_internal)
-+ tsc2102_write_sync(TSC2102_TS_REF_CTRL, TSC2102_ADC_REF);
++ tsc210x_write_sync(TSC2102_TS_REF_CTRL, TSC2102_ADC_REF);
+ else
-+ tsc2102_write_sync(TSC2102_TS_REF_CTRL, TSC2102_ADC_EXT_REF);
++ tsc210x_write_sync(TSC2102_TS_REF_CTRL, TSC2102_ADC_EXT_REF);
+
+ /* 84 usec precharge time, 32 usec sense time */
-+ tsc2102_write_sync(TSC2102_TS_CONFIG_CTRL, TSC2102_CONFIG_TIMES);
++ tsc210x_write_sync(TSC2102_TS_CONFIG_CTRL, TSC2102_CONFIG_TIMES);
+
+ /* PINT/DAV acts as PINT */
-+ tsc2102_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_DAV);
++ tsc210x_write_sync(TSC2102_TS_STATUS_CTRL, TSC2102_ADC_DAV);
+
-+#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE)
++#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE)
+ /* 16-bit words, I2S mode, sample at Fsref */
-+ tsc2102_write_sync(TSC2102_AUDIO1_CTRL, AC1_WLEN(0) | AC1_DATFM(0) | AC1_DACFS(0) );
++ tsc210x_write_sync(TSC2102_AUDIO1_CTRL, TSC210x_AUDIO1_INIT_VAL );
+ /* Keyclicks off, soft-stepping at normal rate */
-+ tsc2102_write_sync(TSC2102_AUDIO2_CTRL, TSC2102_KEYCLICK_OFF);
++ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, TSC210X_KEYCLICK_OFF);
+ /* 48 kHz Fsref, continuous transfer mode, master DAC */
-+ tsc2102_write_sync(TSC2102_AUDIO3_CTRL, 0x0800);
++ tsc210x_write_sync(TSC2102_AUDIO3_CTRL, 0x0800);
+ /* Soft-stepping enabled */
-+ tsc2102_write_sync(TSC2102_AUDIO4_CTRL, 0x0000);
++ tsc210x_write_sync(TSC2102_AUDIO4_CTRL, 0x0000);
+ /* FSRef = 44,1k */
-+ tsc2102_write_sync(TSC2102_PLL1_CTRL, TSC2102_PLL1_44K);
-+ tsc2102_write_sync(TSC2102_PLL2_CTRL, TSC2102_PLL2_44K);
++ tsc210x_set_fsref(44100);
+
-+ tsc2102_write_sync(TSC2102_DAC_GAIN_CTRL, 0xA0A0);
-+ tsc2102_write_sync(TSC2102_DAC_POWER_CTRL, 0x3BA0);
-+ tsc2102_write_sync(TSC2102_DAC_GAIN_CTRL, 0x7F7F);
++ if (tsc.kind == tsc2101) {
++ tsc210x_write_sync(TSC2101_AUDIO5_CTRL, /*AC5_AST2SPK1 |*/ AC5_DAC2SPK1(1) | AC5_DAC2SPK2(2));
++ tsc210x_write_sync(TSC2101_MIXER_PGA_CTRL, /*0x7f00*/ 0xc500 /* reset value */ | MPC_MICSEL(1) | MPC_MICADC);
++ tsc210x_write_sync(TSC2101_HEADSET_GAIN_CTRL, HGC_ADPGA_HED(0));
++ tsc210x_write_sync(TSC2101_HANDSET_PGA_CTRL, 0x0000);
++// tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, 0x00fc);
++ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, 0xe2fc);
++ }
++ else
++ tsc210x_write_sync(TSC210X_CODEC_POWER_CTRL, TSC2102_DAC_ON);
++ /* Un-mute + volume max */
++ if (tsc.kind == tsc2101)
++ tsc210x_write_sync(TSC210X_DAC_GAIN_CTRL, 0x0000);
++ else
++ tsc210x_write_sync(TSC210X_DAC_GAIN_CTRL, 0x7F7F);
+#endif /* CONFIG_SOUND || CONFIG_SOUND_MODULE */
+
+ /* Init mode state machine */
@@ -816,11 +1018,11 @@
+}
+
+/*
-+ * Retrieves chip revision. Should be always 1.
++ * Retrieves chip revision. Should be 1 for TSC2102 and 4 for TSC2101
+ */
+int tsc2102_get_revision(void)
+{
-+ return tsc2102_read_sync(TSC2102_AUDIO3_CTRL) & 7;
++ return AC3_REVID(tsc210x_read_sync(TSC2102_AUDIO3_CTRL));
+}
+
+/*
@@ -834,42 +1036,44 @@
+ * This function sleeps but doesn't sleep until the sound has
+ * finished.
+ */
-+void tsc2102_keyclick(int amplitude, int freq, int length)
++void tsc210x_keyclick(int amplitude, int freq, int length)
+{
+ u16 val;
++
+ mutex_lock(&tsc.lock_sync);
-+ val = tsc2102_read_sync(TSC2102_AUDIO2_CTRL);
-+ val &= 0x800f;
++ val = tsc210x_read_sync(TSC2102_AUDIO2_CTRL);
++ /* Keeps current control values: */
++ val &= AC2_KCLEN | AC2_APGASS | AC2_DLGAF | AC2_DRGAF | AC2_DASTC | AC2_ADGAF;
+
+ /* Set amplitude */
+ switch (amplitude) {
+ case 1:
-+ val |= 4 << 12;
++ val |= AC2_KCLAC(4);
+ break;
+ case 2:
-+ val |= 7 << 12;
++ val |= AC2_KCLAC(7);
+ break;
+ default:
+ break;
+ }
+
+ /* Frequency */
-+ val |= (freq & 0x7) << 8;
++ val |= AC2_KCLFRQ(0x7);
+
+ /* Round to nearest supported length */
-+ if (length > 20)
-+ val |= 4 << 4;
++ if (length > 8)
++ val |= AC2_KCLLN(4);
+ else if (length > 6)
-+ val |= 3 << 4;
++ val |= AC2_KCLLN(3);
+ else if (length > 4)
-+ val |= 2 << 4;
++ val |= AC2_KCLLN(2);
+ else if (length > 2)
-+ val |= 1 << 4;
++ val |= AC2_KCLLN(1);
+
+ /* Enable keyclick */
-+ val |= 0x8000;
++ val |= AC2_KCLEN;
+
-+ tsc2102_write_sync(TSC2102_AUDIO2_CTRL, val);
++ tsc210x_write_sync(TSC2102_AUDIO2_CTRL, val);
+ mutex_unlock(&tsc.lock_sync);
+}
+
@@ -878,7 +1082,7 @@
+static ssize_t show_ ## devname(struct device *dev, \
+ struct device_attribute *devattr, char *buf) \
+{ \
-+ struct tsc2102_dev *devhwmon = dev_get_drvdata(dev); \
++ struct tsc210x_dev *devhwmon = dev_get_drvdata(dev); \
+ int value = devhwmon->field; \
+ return sprintf(buf, "%i\n", value); \
+} \
@@ -887,12 +1091,13 @@
+TSC2102_INPUT(in0, bat[0])
+TSC2102_INPUT(in1, bat[1])
+TSC2102_INPUT(in2, aux[0])
-+TSC2102_INPUT(in3, temp)
++TSC2102_INPUT(in3, aux[1])
++TSC2102_INPUT(in4, temp)
+
+static ssize_t show_temp1(struct device *dev,
+ struct device_attribute *devattr, char *buf)
+{
-+ struct tsc2102_dev *devhwmon = dev_get_drvdata(dev);
++ struct tsc210x_dev *devhwmon = dev_get_drvdata(dev);
+ int value;
+
+ value = (-devhwmon->temp*7 + 8400)*50 ; /* Celcius millidegree */
@@ -914,9 +1119,9 @@
+ * Suspend the chip.
+ */
+static int
-+tsc2102_suspend(struct spi_device *spi, pm_message_t state)
++tsc210x_suspend(struct spi_device *spi, pm_message_t state)
+{
-+ struct tsc2102_dev *dev = dev_get_drvdata(&spi->dev);
++ struct tsc210x_dev *dev = dev_get_drvdata(&spi->dev);
+
+ if (!dev)
+ return 0;
@@ -931,7 +1136,7 @@
+ dev->touch_cb(0);
+
+ /* Abort current conversion and power down the ADC */
-+ tsc2102_write_sync(TSC2102_TS_ADC_CTRL, TSC2102_ADC_ADST);
++ tsc210x_write_sync(TSC2102_TS_ADC_CTRL, TSC2102_ADC_ADST);
+
+ dev->spi->dev.power.power_state = state;
+ mutex_unlock(&dev->lock_sync);
@@ -942,9 +1147,9 @@
+/*
+ * Resume chip operation.
+ */
-+static int tsc2102_resume(struct spi_device *spi)
++static int tsc210x_resume(struct spi_device *spi)
+{
-+ struct tsc2102_dev *dev = dev_get_drvdata(&spi->dev);
++ struct tsc210x_dev *dev = dev_get_drvdata(&spi->dev);
+ int err;
+
+ if (!dev)
@@ -960,39 +1165,49 @@
+ return err;
+}
+#else
-+#define tsc2102_suspend NULL
-+#define tsc2102_resume NULL
++#define tsc210x_suspend NULL
++#define tsc210x_resume NULL
+#endif
+
-+static struct platform_device tsc2102_ts_device = {
-+ .name = "tsc2102-ts",
++/* REVISIT don't make these static */
++static struct platform_device tsc210x_ts_device = {
++ .name = "tsc210x-ts",
+ .id = -1,
+};
+
-+static struct platform_device tsc2102_alsa_device = {
-+ .name = "tsc2102-alsa",
++/* TODO
++static struct platform_device tsc210x_hwmon_device = {
++ .name = "tsc210x-hwmon",
++ .id = -1,
++};
++*/
++
++static struct platform_device tsc210x_alsa_device = {
++ .name = "tsc210x-alsa",
+ .id = -1,
+};
+
-+static int tsc2102_probe(struct spi_device *spi)
++static int tsc210x_probe(struct spi_device *spi)
+{
-+ struct tsc2102_config *pdata = spi->dev.platform_data;
++ struct tsc210x_config *pdata = spi->dev.platform_data;
+ struct spi_transfer *spi_buffer;
+ int err = -EINVAL;
++ u16 rev_id = 0;
+
+ if (!pdata) {
-+ printk(KERN_ERR "TSC2102: Platform data not supplied\n");
++ printk(KERN_ERR "TSC210x: Platform data not supplied\n");
+ return -ENOENT;
+ }
+
+ if (!spi->irq) {
-+ printk(KERN_ERR "TSC2102: Invalid irq value\n");
++ printk(KERN_ERR "TSC210x: Invalid irq value\n");
+ return -ENOENT;
+ }
+
+ tsc.pdata = pdata;
+ tsc.ts_msecs = 30;
+ tsc.mode_msecs = 500;
++ tsc.todo = 0;
+ tsc.spi = spi;
+ INIT_WORK(&tsc.work, tsc_work);
+
@@ -1011,7 +1226,7 @@
+ if (pdata->init)
+ pdata->init();
+
-+#ifdef IMX_CLOCK_CONFIG
++#ifdef CONFIG_TSC_SLAVE
+ tsc.bclk_ck = clk_get(0, "bclk"); TODO add clock mechanism to i.MX ???
+ if (!tsc.bclk_ck) {
+ printk(KERN_ERR "Unable to get the clock BCLK\n");
@@ -1020,7 +1235,13 @@
+ }
+
+ clk_enable(tsc.bclk_ck);
-+#endif //IMX_CLOCK_CONFIG
++#else
++ /* Retrieve Master Clock from platform data */
++ if (pdata->mclk)
++ tsc.mclk = pdata->mclk;
++ else
++ tsc.mclk = 16000000; /* 16 MHz by default */
++#endif /* CONFIG_TSC_SLAVE */
+
+ if (request_irq(spi->irq, tsc2102_handler, IRQF_DISABLED | IRQF_SHARED | IRQF_TRIGGER_FALLING, "tsc2102", &tsc)) {
+ printk(KERN_ERR "Could not allocate touchscreen IRQ (n %d)\n", spi->irq);
@@ -1043,8 +1264,15 @@
+ goto err_timer;
+
+ /* Now try to detect the chip, make first contact */
-+ if (tsc2102_get_revision() != 0x1) {
-+ printk(KERN_ERR "No TI TSC2102 chip found! Bad revision: %x\n", tsc2102_get_revision());
++ rev_id = tsc2102_get_revision();
++ if (rev_id == 0x01) {
++ printk("TSC2102 detected\n");
++ tsc.kind = tsc2102;
++ } else if (rev_id == 0x04) {
++ printk("TSC2101 detected\n");
++ tsc.kind = tsc2101;
++ } else {
++ printk(KERN_ERR "No TI TSC210x chip found! Bad revision: %x\n", rev_id);
+ goto err_timer;
+ }
+
@@ -1052,16 +1280,16 @@
+ if (err)
+ goto err_timer;
+
-+ /* Register devices controlled by TSC 2102 */
-+ tsc2102_ts_device.dev.platform_data = pdata;
-+ tsc2102_ts_device.dev.parent = &spi->dev;
-+ err = platform_device_register(&tsc2102_ts_device);
++ /* Register devices controlled by TSC2101 / TSC2102 */
++ tsc210x_ts_device.dev.platform_data = pdata;
++ tsc210x_ts_device.dev.parent = &spi->dev;
++ err = platform_device_register(&tsc210x_ts_device);
+ if (err)
+ goto err_timer;
+
-+ tsc2102_alsa_device.dev.platform_data = pdata->alsa_config;
-+ tsc2102_alsa_device.dev.parent = &spi->dev;
-+ err = platform_device_register(&tsc2102_alsa_device);
++ tsc210x_alsa_device.dev.platform_data = pdata->alsa_config;
++ tsc210x_alsa_device.dev.parent = &spi->dev;
++ err = platform_device_register(&tsc210x_alsa_device);
+ if (err)
+ goto err_ts;
+
@@ -1077,11 +1305,13 @@
+ err |= device_create_file(&spi->dev, &dev_attr_in0_input);
+ if (pdata->monitor & TSC_BAT2)
+ err |= device_create_file(&spi->dev, &dev_attr_in1_input);
-+ if (pdata->monitor & TSC_AUX)
++ if (pdata->monitor & TSC_AUX1)
+ err |= device_create_file(&spi->dev, &dev_attr_in2_input);
++ if (pdata->monitor & TSC_AUX2)
++ err |= device_create_file(&spi->dev, &dev_attr_in3_input);
+ if (pdata->monitor & TSC_TEMP) {
+ err |= device_create_file(&spi->dev, &dev_attr_temp1_input);
-+ err |= device_create_file(&spi->dev, &dev_attr_in3_input);
++ err |= device_create_file(&spi->dev, &dev_attr_in4_input);
+ }
+
+ if (err)
@@ -1099,9 +1329,9 @@
+ goto done;
+
+err_alsa:
-+ platform_device_unregister(&tsc2102_alsa_device);
++ platform_device_unregister(&tsc210x_alsa_device);
+err_ts:
-+ platform_device_unregister(&tsc2102_ts_device);
++ platform_device_unregister(&tsc210x_ts_device);
+err_timer:
+ del_timer(&tsc.ts_timer);
+ del_timer(&tsc.mode_timer);
@@ -1116,13 +1346,13 @@
+ return err;
+}
+
-+static int tsc2102_remove(struct spi_device *spi)
++static int tsc210x_remove(struct spi_device *spi)
+{
-+ struct tsc2102_dev *dev = dev_get_drvdata(&spi->dev);
++ struct tsc210x_dev *dev = dev_get_drvdata(&spi->dev);
+ mutex_lock(&dev->lock_sync);
+
-+ platform_device_unregister(&tsc2102_ts_device);
-+ platform_device_unregister(&tsc2102_alsa_device);
++ platform_device_unregister(&tsc210x_ts_device);
++ platform_device_unregister(&tsc210x_alsa_device);
+
+ dev_set_drvdata(&spi->dev, NULL);
+
@@ -1130,9 +1360,11 @@
+ if (dev->pdata->exit)
+ dev->pdata->exit();
+
++#ifdef CONFIG_TSC_SLAVE
+ /* Release the BCLK */
-+/* clk_disable(dev->bclk_ck); TODO add clock mechanism to i.MX ???
-+ clk_put(dev->bclk_ck); */
++ clk_disable(dev->bclk_ck);
++ clk_put(dev->bclk_ck);
++#endif
+
+ del_timer(&tsc.mode_timer);
+ del_timer(&tsc.ts_timer);
@@ -1151,39 +1383,43 @@
+ return 0;
+}
+
-+static struct spi_driver tsc2102_driver = {
-+ .probe = tsc2102_probe,
-+ .remove = tsc2102_remove,
-+ .suspend = tsc2102_suspend,
-+ .resume = tsc2102_resume,
++static struct spi_driver tsc210x_driver = {
++ .probe = tsc210x_probe,
++ .remove = tsc210x_remove,
++ .suspend = tsc210x_suspend,
++ .resume = tsc210x_resume,
+ .driver = {
-+ .name = "tsc2102",
++ .name = "tsc210x",
+ .owner = THIS_MODULE,
+ .bus = &spi_bus_type,
+ },
+};
+
-+static char __initdata banner[] = KERN_INFO "TI TSC2102 driver initializing\n";
++static char __initdata banner[] = KERN_INFO "TI TSC210x driver initializing\n";
+
-+static int __init tsc2102_init(void)
++static int __init tsc210x_init(void)
+{
++ int err;
+ printk(banner);
-+ return spi_register_driver(&tsc2102_driver);
++
++ err = spi_register_driver(&tsc210x_driver);
++
++ return err;
+}
+
-+static void __exit tsc2102_exit(void)
++static void __exit tsc210x_exit(void)
+{
-+ spi_unregister_driver(&tsc2102_driver);
++ spi_unregist...
[truncated message content] |
|
From: <ar...@us...> - 2009-01-20 14:59:23
|
Revision: 1025
http://armadeus.svn.sourceforge.net/armadeus/?rev=1025&view=rev
Author: artemys
Date: 2009-01-20 14:59:10 +0000 (Tue, 20 Jan 2009)
Log Message:
-----------
[BUILDROOT] Removes no more used alsa-driver package
Removed Paths:
-------------
trunk/buildroot/package/alsa-driver/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-19 19:37:12
|
Revision: 1024
http://armadeus.svn.sourceforge.net/armadeus/?rev=1024&view=rev
Author: artemys
Date: 2009-01-19 19:37:04 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
[BUILDROOT] Makes madplayer work again
Modified Paths:
--------------
trunk/buildroot/package/audio/madplay/madplay-audio-alsa.patch
Modified: trunk/buildroot/package/audio/madplay/madplay-audio-alsa.patch
===================================================================
--- trunk/buildroot/package/audio/madplay/madplay-audio-alsa.patch 2009-01-19 15:09:57 UTC (rev 1023)
+++ trunk/buildroot/package/audio/madplay/madplay-audio-alsa.patch 2009-01-19 19:37:04 UTC (rev 1024)
@@ -1,11 +1,12 @@
-Now this patch is needed for madplay to compile when ALSA is configured with
- --with-versioned=no option.
-madplay is compiling but still crashes when used... :-(
-cf SF bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2184767&group_id=122057&atid=692259
+* needed for madplay to compile when ALSA is configured with
+ --with-versioned=no option.
+* fix allocation of buffer, buffer_size is number of frames
+* use default 16 bit depth (some hardware has small buffers, 16/24 bit
+ difference is very small)
---- madplay-0.15.2b/audio_alsa.c 2004-02-23 22:35:23.000000000 +0100
-+++ madplay-0.15.2b-new/audio_alsa.c 2007-12-02 16:40:38.000000000 +0100
-@@ -28,31 +28,28 @@
+--- madplay-0.15.2b.org/audio_alsa.c 2004-02-23 22:35:23.000000000 +0100
++++ madplay-0.15.2b/audio_alsa.c 2009-01-19 19:18:36.000000000 +0100
+@@ -28,31 +28,30 @@
#include <errno.h>
@@ -19,8 +20,14 @@
-char *buf = NULL;
-int paused = 0;
-+unsigned char *buf = NULL;
-+int paused = 0;
++#define BUFFER_TIME_MAX 500000
++unsigned char *buf = NULL;
++int paused = 0;
++
++unsigned int rate = 0;
++unsigned int channels = -1;
++unsigned int bitdepth = -1;
++unsigned int sample_size= -1;
-int rate = -1;
-int channels = -1;
@@ -29,28 +36,44 @@
-
-int buffer_time = 500000;
-int period_time = 100000;
--char *defaultdev = "plughw:0,0";
-+unsigned int rate = 0;
-+unsigned int channels = -1;
-+unsigned int bitdepth = -1;
-+unsigned int sample_size = -1;
-+
-+unsigned int buffer_time = 500000;
-+unsigned int period_time = 100000;
-+char *defaultdev = "plughw:0,0";
++unsigned int buffer_time;
++unsigned int period_time;
+ char *defaultdev = "plughw:0,0";
snd_pcm_hw_params_t *alsa_hwparams;
snd_pcm_sw_params_t *alsa_swparams;
--snd_pcm_sframes_t buffer_size;
+ snd_pcm_sframes_t buffer_size;
-snd_pcm_sframes_t period_size;
-+snd_pcm_uframes_t buffer_size;
++snd_pcm_uframes_t period_size;
snd_pcm_format_t alsa_format = -1;
snd_pcm_access_t alsa_access = SND_PCM_ACCESS_MMAP_INTERLEAVED;
-@@ -87,29 +84,28 @@
+@@ -66,7 +65,7 @@
+ snd_pcm_hw_params_t *params,
+ snd_pcm_access_t access)
+ {
+- int err, dir;
++ int err;
+
+ /* choose all parameters */
+ err = snd_pcm_hw_params_any(handle,params);
+@@ -74,6 +73,12 @@
+ printf("Access type not available for playback: %s\n", snd_strerror(err));
return err;
}
++ /* set the access type */
++ err = snd_pcm_hw_params_set_access(handle, params, alsa_access);
++ if (err < 0) {
++ printf("Sample format not available for playback: %s\n", snd_strerror(err));
++ return err;
++ }
+ /* set the sample format */
+ err = snd_pcm_hw_params_set_format(handle, params, alsa_format);
+ if (err < 0) {
+@@ -87,29 +92,42 @@
+ return err;
+ }
/* set the stream rate */
- err = snd_pcm_hw_params_set_rate_near(handle, params, rate, 0);
+ err = snd_pcm_hw_params_set_rate(handle, params, rate, 0);
@@ -59,34 +82,53 @@
return err;
}
- if (err != rate) {
-- printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
-- return -EINVAL;
-- }
++ /*if (err != rate) {
+ printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
+ return -EINVAL;
++ }*/
++ err = snd_pcm_hw_params_get_buffer_time_max(params, &buffer_time, NULL);
++ if (err < 0) {
++ printf("Unable to retrieve buffer time: %s\n", snd_strerror(err));
++ return err;
+ }
++ if (buffer_time > BUFFER_TIME_MAX)
++ buffer_time = BUFFER_TIME_MAX;
/* set buffer time */
- err = snd_pcm_hw_params_set_buffer_time_near(handle, params, buffer_time, &dir);
-+ err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, &dir);
++ err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, NULL);
if (err < 0) {
printf("Unable to set buffer time %i for playback: %s\n", buffer_time, snd_strerror(err));
return err;
}
- buffer_size = snd_pcm_hw_params_get_buffer_size(params);
-+ err = snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
-+ if (err < 0) {
-+ printf("Unable to retrieve buffer size: %s\n", snd_strerror(err));
-+ return err;
-+ }
++ if (period_time * 4 > buffer_time)
++ period_time = buffer_time / 4;
/* set period time */
- err = snd_pcm_hw_params_set_period_time_near(handle, params, period_time, &dir);
-+ err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, &dir);
++ err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, NULL);
if (err < 0) {
printf("Unable to set period time %i for playback: %s\n", period_time, snd_strerror(err));
return err;
}
- period_size = snd_pcm_hw_params_get_period_size(params, &dir);
++ /* retrieve buffer size */
++ err = snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
++ if (err < 0) {
++ printf("Unable to retrieve buffer size: %s\n", snd_strerror(err));
++ return err;
++ }
/* write the parameters to device */
err = snd_pcm_hw_params(handle, params);
if (err < 0) {
-@@ -136,13 +132,7 @@
+@@ -123,6 +141,7 @@
+ int set_swparams(snd_pcm_t *handle,
+ snd_pcm_sw_params_t *params)
+ {
++ unsigned int start_threshold;
+ int err;
+
+ /* get current swparams */
+@@ -136,13 +155,7 @@
if (err < 0) {
printf("Unable to set start threshold mode for playback: %s\n", snd_strerror(err));
return err;
@@ -101,7 +143,25 @@
/* align all transfers to 1 samples */
err = snd_pcm_sw_params_set_xfer_align(handle, params, 1);
if (err < 0) {
-@@ -279,7 +269,7 @@
+@@ -190,7 +203,7 @@
+ rate = config->speed;
+
+ if ( bitdepth == 0 )
+- config->precision = bitdepth = 32;
++ config->precision = bitdepth = 16;
+
+ switch (bitdepth)
+ {
+@@ -241,7 +254,7 @@
+ return -1;
+ }
+
+- buf = malloc(buffer_size);
++ buf = malloc(buffer_size * sample_size);
+ if (buf == NULL) {
+ audio_error="unable to allocate output buffer table";
+ return -1;
+@@ -279,7 +292,7 @@
int play(struct audio_play *play)
{
int err, len;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-19 15:10:04
|
Revision: 1023
http://armadeus.svn.sourceforge.net/armadeus/?rev=1023&view=rev
Author: artemys
Date: 2009-01-19 15:09:57 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Correct some merge problems in i.MX SSI alsa driver
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch 2009-01-19 09:21:41 UTC (rev 1022)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch 2009-01-19 15:09:57 UTC (rev 1023)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-ssi.c
+++ linux-2.6.27.2.mod/sound/arm/imx-ssi.c
-@@ -0,0 +1,514 @@
+@@ -0,0 +1,511 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Juergen Beisert, ke...@pe...
@@ -337,23 +337,20 @@
+int imx_ssi_prepare(struct snd_pcm_substream *substream,
+ int ssi_id)
+{
-+// SSI_SCSR |= SSI_SCSR_EN;
+ set_reg_bits(SSI_SCSR_EN, SSI_SCSR_EN, SSI_SCSR, ssi_id);
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+// SSI_STCR |= SSI_MAE;
+ set_reg_bits(SSI_MAE, SSI_MAE, SSI_STCR, ssi_id);
+ else
-+// SSI_SRCR |= SSI_MAE;
+ set_reg_bits(SSI_MAE, SSI_MAE, SSI_SRCR, ssi_id);
+
+ return 0;
+}
++EXPORT_SYMBOL(imx_ssi_prepare);
+
+void imx_ssi_shutdown(struct snd_pcm_substream *substream,
+ int ssi_id)
+{
-+// SSI_SCSR &= ~SSI_SCSR_EN;
+ set_reg_bits(SSI_SCSR_EN, 0, SSI_SCSR, ssi_id);
+
+}
@@ -545,8 +542,8 @@
+#ifndef __SOUND_ARM_IMX_SSI_H
+#define __SOUND_ARM_IMX_SSI_H
+
-+int imx_ssi_prepare(struct snd_pcm_substream *substream, int ssi_id);
-+void imx_ssi_shutdown(struct snd_pcm_substream *substream, int ssi_id);
++extern int imx_ssi_prepare(struct snd_pcm_substream *substream, int ssi_id);
++extern void imx_ssi_shutdown(struct snd_pcm_substream *substream, int ssi_id);
+extern int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd, int ssi_id);
+
+extern int imx_ssi_get_dma_tx_channel(int, int);
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch 2009-01-19 09:21:41 UTC (rev 1022)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch 2009-01-19 15:09:57 UTC (rev 1023)
@@ -44,7 +44,7 @@
-obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
-snd-imx-alsa-tsc2102-objs := imx-alsa.o imx-alsa-tsc2102.o imx-alsa-tsc2102-mixer.o
-+obj-$(CONFIG_SND_IMX) += snd-imx.o
++obj-$(CONFIG_SND_IMX_PCM) += snd-imx.o
+snd-imx-objs :=imx-ssi.o
+
+obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-19 09:21:51
|
Revision: 1022
http://armadeus.svn.sourceforge.net/armadeus/?rev=1022&view=rev
Author: artemys
Date: 2009-01-19 09:21:41 +0000 (Mon, 19 Jan 2009)
Log Message:
-----------
[LINUX] Add i.MX27 like scatter-gather support for i.MXL
Added Paths:
-----------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-097-armadeus-imx-dma-improvements.patch
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-098-armadeus-imx-dma-announce_imx_is_supporting_scatter_gather.patch
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-097-armadeus-imx-dma-improvements.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-097-armadeus-imx-dma-improvements.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-097-armadeus-imx-dma-improvements.patch 2009-01-19 09:21:41 UTC (rev 1022)
@@ -0,0 +1,411 @@
+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.2.original/arch/arm/mach-imx/include/mach/imx-dma.h
++++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/imx-dma.h
+@@ -47,6 +47,7 @@
+ const char *name;
+ void (*irq_handler) (int, void *);
+ void (*err_handler) (int, void *, int errcode);
++ void (*prog_handler) (int, void *, struct scatterlist *);
+ void *data;
+ dmamode_t dma_mode;
+ struct scatterlist *sg;
+@@ -54,19 +55,38 @@
+ unsigned int sgcount;
+ unsigned int resbytes;
+ int dma_num;
++
++ int in_use;
++
++ int hw_chaining;
+ };
+
+ extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
+
+-#define IMX_DMA_ERR_BURST 1
+-#define IMX_DMA_ERR_REQUEST 2
+-#define IMX_DMA_ERR_TRANSFER 4
+-#define IMX_DMA_ERR_BUFFER 8
++#define IMX_DMA_MEMSIZE_32 (0 << 4)
++#define IMX_DMA_MEMSIZE_8 (1 << 4)
++#define IMX_DMA_MEMSIZE_16 (2 << 4)
++#define IMX_DMA_TYPE_LINEAR (0 << 10)
++#define IMX_DMA_TYPE_2D (1 << 10)
++#define IMX_DMA_TYPE_FIFO (2 << 10)
++
++#define IMX_DMA_ERR_BURST (1 << 0)
++#define IMX_DMA_ERR_REQUEST (1 << 1)
++#define IMX_DMA_ERR_TRANSFER (1 << 2)
++#define IMX_DMA_ERR_BUFFER (1 << 3)
++#define IMX_DMA_ERR_TIMEOUT (1 << 4)
+
+ /* The type to distinguish channel numbers parameter from ordinal int type */
+ typedef int imx_dmach_t;
+
+ int
++imx_dma_config_channel(int channel, unsigned int config_port,
++ unsigned int config_mem, unsigned int dmareq, int hw_chaining);
++
++void
++imx_dma_config_burstlen(int channel, unsigned int burstlen);
++
++int
+ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
+ unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode);
+
+@@ -80,6 +100,10 @@
+ void (*irq_handler) (int, void *),
+ void (*err_handler) (int, void *, int), void *data);
+
++int
++imx_dma_setup_progression_handler(int channel,
++ void (*prog_handler) (int, void*, struct scatterlist*));
++
+ void imx_dma_enable(imx_dmach_t dma_ch);
+
+ void imx_dma_disable(imx_dmach_t dma_ch);
+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.2.original/arch/arm/mach-imx/dma.c
++++ linux-2.6.27.2.mod/arch/arm/mach-imx/dma.c
+@@ -27,6 +27,7 @@
+ #include <linux/kernel.h>
+ #include <linux/interrupt.h>
+ #include <linux/errno.h>
++#include <linux/scatterlist.h>
+
+ #include <asm/system.h>
+ #include <asm/irq.h>
+@@ -36,6 +37,26 @@
+
+ struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
+
++static int imx_dma_hw_chain(struct imx_dma_channel *imxdma)
++{
++#ifdef CONFIG_ARCH_MX2
++ if (cpu_is_mx27())
++ return imxdma->hw_chaining;
++ else
++#endif
++ return 0;
++}
++
++static void dump_channels(void)
++{
++ int i = 0;
++
++ printk("Channel | Owner\n");
++ for (i=0; i<IMX_DMA_CHANNELS; i++) {
++ printk(" %2d | %s\n", i, imx_dma_channels[i].name);
++ }
++}
++
+ /*
+ * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation
+ * @dma_ch: i.MX DMA channel number
+@@ -46,55 +67,31 @@
+ * during last block. Zero value can be used for @lastcount to setup DMA
+ * for the first chunk.
+ */
+-static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount)
++static inline int imx_dma_sg_next(imx_dmach_t channel, struct scatterlist *sg)
+ {
+- struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+- unsigned int nextcount;
+- unsigned int nextaddr;
++ struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
++ unsigned long now;
+
+ if (!imxdma->name) {
+ printk(KERN_CRIT "%s: called for not allocated channel %d\n",
+- __func__, dma_ch);
+- return 0;
+- }
+-
+- imxdma->resbytes -= lastcount;
+-
+- if (!imxdma->sg) {
+- pr_debug("imxdma%d: no sg data\n", dma_ch);
++ __func__, channel);
+ return 0;
+ }
+
+- imxdma->sgbc += lastcount;
+- if ((imxdma->sgbc >= imxdma->sg->length) || !imxdma->resbytes) {
+- if ((imxdma->sgcount <= 1) || !imxdma->resbytes) {
+- pr_debug("imxdma%d: sg transfer limit reached\n",
+- dma_ch);
+- imxdma->sgcount=0;
+- imxdma->sg = NULL;
+- return 0;
+- } else {
+- imxdma->sgcount--;
+- imxdma->sg++;
+- imxdma->sgbc = 0;
+- }
+- }
+- nextcount = imxdma->sg->length - imxdma->sgbc;
+- nextaddr = imxdma->sg->dma_address + imxdma->sgbc;
+-
+- if(imxdma->resbytes < nextcount)
+- nextcount = imxdma->resbytes;
++ now = min(imxdma->resbytes, sg->length);
++ imxdma->resbytes -= now;
+
+ if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
+- DAR(dma_ch) = nextaddr;
++ DAR(channel) = sg->dma_address;
+ else
+- SAR(dma_ch) = nextaddr;
++ SAR(channel) = sg->dma_address;
+
+- CNTR(dma_ch) = nextcount;
++ CNTR(channel) = now
++;
+ pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, size 0x%08x\n",
+- dma_ch, DAR(dma_ch), SAR(dma_ch), CNTR(dma_ch));
++ channel, DAR(channel), SAR(channel), CNTR(channel));
+
+- return nextcount;
++ return now;
+ }
+
+ /*
+@@ -145,7 +142,6 @@
+ imxdma->sg = NULL;
+ imxdma->sgcount = 0;
+ imxdma->dma_mode = dmamode;
+- imxdma->resbytes = dma_length;
+
+ if (!dma_address) {
+ printk(KERN_ERR "imxdma%d: imx_dma_setup_single null address\n",
+@@ -228,8 +224,10 @@
+ int res;
+ struct imx_dma_channel *imxdma = &imx_dma_channels[dma_ch];
+
+- imxdma->sg = NULL;
+- imxdma->sgcount = 0;
++ if (imxdma->in_use)
++ return -EBUSY;
++
++ imxdma->sg = sg;
+ imxdma->dma_mode = dmamode;
+ imxdma->resbytes = dma_length;
+
+@@ -259,14 +257,43 @@
+ return -EINVAL;
+ }
+
+- res = imx_dma_setup_sg_base(dma_ch, sg, sgcount);
+- if (res <= 0) {
+- printk(KERN_ERR "imxdma%d: no sg chunk ready\n", dma_ch);
+- return -EINVAL;
+- }
++ imx_dma_sg_next(dma_ch, sg);
++
++ return 0;
++}
++
++int
++imx_dma_config_channel(int channel, unsigned int config_dest,
++ unsigned int config_src, unsigned int dmareq, int hw_chaining)
++{
++ struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
++ u32 dreq = 0;
++
++ imxdma->hw_chaining = 0;
++
++// if (hw_chaining) {
++// imxdma->hw_chaining = 1;
++// if (!imx_dma_hw_chain(imxdma))
++// return -EINVAL;
++// }
++
++ if (dmareq)
++ dreq = CCR_REN;
++
++ CCR(channel) = config_src | (config_dest << 2) | dreq;
++// imxdma->ccr_to_device = config_mem | (config_port << 2) | dreq;
++
++ RSSR(channel) = dmareq;
+
+ return 0;
+ }
++EXPORT_SYMBOL(imx_dma_config_channel);
++
++void imx_dma_config_burstlen(int channel, unsigned int burstlen)
++{
++ BLR(channel) = burstlen;
++}
++EXPORT_SYMBOL(imx_dma_config_burstlen);
+
+ /**
+ * imx_dma_setup_handlers - setup i.MX DMA channel end and error notification handlers
+@@ -302,6 +329,32 @@
+ }
+
+ /**
++ * imx_dma_setup_progression_handler - setup i.MX DMA channel progression
++ * handlers
++ * @channel: i.MX DMA channel number
++ * @prog_handler: the pointer to the function called if the transfer progresses
++ */
++int
++imx_dma_setup_progression_handler(int channel,
++ void (*prog_handler) (int, void*, struct scatterlist*))
++{
++ struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
++ unsigned long flags;
++
++ if (!imxdma->name) {
++ printk(KERN_CRIT "%s: called for not allocated channel %d\n",
++ __func__, channel);
++ return -ENODEV;
++ }
++
++ local_irq_save(flags);
++ imxdma->prog_handler = prog_handler;
++ local_irq_restore(flags);
++ return 0;
++}
++EXPORT_SYMBOL(imx_dma_setup_progression_handler);
++
++/**
+ * imx_dma_enable - function to start i.MX DMA channel operation
+ * @dma_ch: i.MX DMA channel number
+ *
+@@ -325,10 +378,15 @@
+ return;
+ }
+
++ if (imxdma->in_use)
++ return;
++
+ local_irq_save(flags);
+ DISR = (1 << dma_ch);
+ DIMR &= ~(1 << dma_ch);
+ CCR(dma_ch) |= CCR_CEN;
++ imxdma->in_use = 1;
++
+ local_irq_restore(flags);
+ }
+
+@@ -336,16 +394,18 @@
+ * imx_dma_disable - stop, finish i.MX DMA channel operatin
+ * @dma_ch: i.MX DMA channel number
+ */
+-void imx_dma_disable(imx_dmach_t dma_ch)
++void imx_dma_disable(int channel)
+ {
++ struct imx_dma_channel *imxdma = &imx_dma_channels[channel];
+ unsigned long flags;
+
+- pr_debug("imxdma%d: imx_dma_disable\n", dma_ch);
++ pr_debug("imxdma%d: imx_dma_disable\n", channel);
+
+ local_irq_save(flags);
+- DIMR |= (1 << dma_ch);
+- CCR(dma_ch) &= ~CCR_CEN;
+- DISR = (1 << dma_ch);
++ DIMR |= (1 << channel);
++ CCR(channel) &= ~CCR_CEN;
++ DISR = (1 << channel);
++ imxdma->in_use = 0;
+ local_irq_restore(flags);
+ }
+
+@@ -381,6 +441,7 @@
+ imxdma->data = NULL;
+ imxdma->sg = NULL;
+ local_irq_restore(flags);
++
+ return 0;
+ }
+
+@@ -452,6 +513,7 @@
+ }
+
+ printk(KERN_ERR "%s: no free DMA channel found\n", __func__);
++ dump_channels();
+
+ return -ENODEV;
+ }
+@@ -512,6 +574,46 @@
+ return IRQ_HANDLED;
+ }
+
++static void dma_irq_handle_channel(int chno)
++{
++ struct imx_dma_channel *channel = &imx_dma_channels[chno];
++
++ if (!channel->name) {
++ /*
++ * IRQ for an unregistered DMA channel:
++ * let's clear the interrupts and disable it.
++ */
++ printk(KERN_WARNING
++ "spurious IRQ for DMA channel %d\n", chno);
++ return;
++ }
++
++ if (channel->sg) {
++ struct scatterlist *current_sg = channel->sg;
++ channel->sg = sg_next(channel->sg);
++
++ if (channel->sg) {
++ imx_dma_sg_next(chno, channel->sg);
++
++ CCR(chno) &= ~CCR_CEN;
++ mb();
++ CCR(chno) |= CCR_CEN;
++
++ if (channel->prog_handler)
++ channel->prog_handler(chno, channel->data,
++ current_sg);
++
++ return;
++ }
++ }
++
++ CCR(chno) = 0;
++ channel->in_use = 0;
++
++ if (channel->irq_handler)
++ channel->irq_handler(chno, channel->data);
++}
++
+ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
+ {
+ int i, disr = DISR;
+@@ -521,27 +623,8 @@
+
+ DISR = disr;
+ for (i = 0; i < IMX_DMA_CHANNELS; i++) {
+- if (disr & (1 << i)) {
+- struct imx_dma_channel *channel = &imx_dma_channels[i];
+- if (channel->name) {
+- if (imx_dma_sg_next(i, CNTR(i))) {
+- CCR(i) &= ~CCR_CEN;
+- mb();
+- CCR(i) |= CCR_CEN;
+- } else {
+- if (channel->irq_handler)
+- channel->irq_handler(i,
+- channel->data);
+- }
+- } else {
+- /*
+- * IRQ for an unregistered DMA channel:
+- * let's clear the interrupts and disable it.
+- */
+- printk(KERN_WARNING
+- "spurious IRQ for DMA channel %d\n", i);
+- }
+- }
++ if (disr & (1 << i))
++ dma_irq_handle_channel(i);
+ }
+ return IRQ_HANDLED;
+ }
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-098-armadeus-imx-dma-announce_imx_is_supporting_scatter_gather.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-098-armadeus-imx-dma-announce_imx_is_supporting_scatter_gather.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-098-armadeus-imx-dma-announce_imx_is_supporting_scatter_gather.patch 2009-01-19 09:21:41 UTC (rev 1022)
@@ -0,0 +1,12 @@
+--- linux-2.6.27.2.org/arch/arm/mach-imx/include/mach/hardware.h 2009-01-14 16:24:29.000000000 +0100
++++ linux-2.6.27.2/arch/arm/mach-imx/include/mach/hardware.h 2009-01-12 13:50:47.000000000 +0100
+@@ -23,6 +23,9 @@
+ #include <asm/sizes.h>
+ #include "imx-regs.h"
+
++/* the DMA code supports SG list chaining */
++#define ARCH_HAS_SG_CHAIN
++
+ #ifndef __ASSEMBLY__
+ # define __REG8(x) (*((volatile u8 *)IO_ADDRESS(x)))
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-16 17:40:35
|
Revision: 1021
http://armadeus.svn.sourceforge.net/armadeus/?rev=1021&view=rev
Author: artemys
Date: 2009-01-16 17:40:30 +0000 (Fri, 16 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Makes alsa driver work on APF27 too
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
Added Paths:
-----------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
branches/tsc210x/target/linux/arch/arm/mach-imx/include/
branches/tsc210x/target/linux/arch/arm/mach-imx/include/mach/
Modified: branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.27.2.config 2009-01-16 17:40:30 UTC (rev 1021)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.2
-# Sun Dec 28 01:31:05 2008
+# Fri Jan 16 18:34:47 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -919,6 +919,7 @@
# CONFIG_SND_DEBUG is not set
# CONFIG_SND_DRIVERS is not set
CONFIG_SND_ARM=y
+CONFIG_SND_IMX_PCM=m
CONFIG_SND_IMX_TSC2102=m
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-073-armadeus-tsc2102.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -308,7 +308,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/drivers/spi/tsc2102.c
+++ linux-2.6.27.2.mod/drivers/spi/tsc2102.c
-@@ -0,0 +1,1113 @@
+@@ -0,0 +1,1114 @@
+/*
+ * drivers/spi/tsc2102.c
+ *
@@ -837,8 +837,9 @@
+ } else { /* 48000 */
+ switch(mclk)
+ {
-+ case 12288000:
-+ pll->pll1 = (PLL1_Q_VAL(2));
++ case 12288000:
++ /*pll->pll1 = (PLL1_Q_VAL(2)) -> doesn't work without enabling PLL */
++ pll->pll1 = (PLL1_PLLEN | PLL1_Q_VAL(0) | PLL1_P_VAL(1) | PLL1_J_VAL(8));
+ pll->pll2 = (PLL2_D_VAL(0));
+ break;
+
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-16 13:47:04 UTC (rev 1020)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa.c
-@@ -0,0 +1,658 @@
+@@ -0,0 +1,668 @@
+/*
+ * sound/arm/imx-alsa.c
+ *
@@ -49,6 +49,9 @@
+
+#ifdef CONFIG_ARCH_MX2
+#include <mach/dma-mx1-mx2.h>
++#include "imx2-ssi.h"
++#include <mach/imx_sound.h>
++#include "imx2-dam.h"
+#else
+#include <mach/imx-dma.h>
+#include "imx-ssi.h"
@@ -109,14 +112,15 @@
+/* Called by the DMA framework when an error has occured */
+static void snd_imx_dma_err_handler(int channel, void *data, int err)
+{
-+ printk("dma_err_handler %d %d\n",channel, err);
++ printk("%s %d %d\n", __func__, channel, err);
+
-+ printk("DMA timeout on channel %d -%s%s%s%s\n",
++ printk("DMA timeout on channel %d -%s%s%s%s%s\n",
+ channel,
+ err & IMX_DMA_ERR_BURST ? " burst":"",
+ err & IMX_DMA_ERR_REQUEST ? " request":"",
+ err & IMX_DMA_ERR_TRANSFER ? " transfer":"",
-+ err & IMX_DMA_ERR_BUFFER ? " buffer":"");
++ err & IMX_DMA_ERR_BUFFER ? " buffer":"",
++ err & IMX_DMA_ERR_TIMEOUT ? " hw_chain_watchdog":"");
+
+ imx_dma_disable(channel);
+}
@@ -232,7 +236,7 @@
+ return imx_ssi_trigger(substream, cmd, /*channel_info->ssi*/0);
+}
+
-+static int snd_imx_pcm_prepare(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
@@ -278,6 +282,8 @@
+ return err;
+ }
+
++ imx_ssi_prepare(substream, /*channel_info->ssi*/0);
++
+ return 0;
+}
+
@@ -305,14 +311,14 @@
+ alsa_codec_config->codec_clock_on();
+ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_playback);
-+ burstlen = SSI_DMA_BLR_TRANSMIT;
++ burstlen = DMA_TXFIFO_BURST * 2;
+ dma_req = imx_ssi_get_dma_tx_channel(0, 0);
+ printk("imx_ssi_get_dma_tx_channel = %d\n", dma_req);
+ if (dma_req < 0)
+ return dma_req;
+ } else {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_capture);
-+ burstlen = SSI_DMA_BLR;
++ burstlen = DMA_RXFIFO_BURST * 2;
+ printk("capture not supported\n");
+ dma_req = imx_ssi_get_dma_rx_channel(0, 0);
+ if (dma_req < 0)
@@ -352,7 +358,13 @@
+
+ /* configure DMA burst length for channel */
+ imx_dma_config_burstlen(chip->s[stream_id].dma_dev, burstlen);
++ pr_debug("Burstlen for DMA channel %u is now: %u\n", chip->s[stream_id].dma_dev, burstlen);
+
++#ifdef CONFIG_ARCH_MX2
++ /* route sound paths */
++ mx2_dam_configure_sync_slave(1, 1);
++#endif
++
+ return 0;
+}
+
@@ -401,7 +413,7 @@
+ pr_debug("DMA area: 0x%p, addr: 0x%p, size: %u\n",
+ runtime->dma_area, (void*)runtime->dma_addr, runtime->dma_bytes);
+
-+// channel_info->base = (void*)runtime->dma_addr;
++// channel_info->base = (void*)runtime->dma_addr; ?? why isn't it already done ??
+ channel_info->base = (void*)dma_map_single(NULL,
+ (void*)runtime->dma_area,
+ runtime->dma_bytes,
@@ -621,7 +633,6 @@
+ sprintf(card->shortname, "i.MX+%s audio", alsa_codec_config->name);
+ sprintf(card->longname, "Freescale i.MX with %s codec", alsa_codec_config->name);
+
-+ snd_imx_init_mixer();
+ snd_card_set_dev(card, &pdev->dev);
+
+ /* Register the created soundcard */
@@ -658,10 +669,9 @@
+ kfree(chip);
+
+ platform_set_drvdata(pdev, NULL);
-+
++
+ return 0;
+}
-+
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)
@@ -723,7 +733,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102.c
-@@ -0,0 +1,389 @@
+@@ -0,0 +1,393 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.c
+ *
@@ -906,6 +916,8 @@
+ */
+static void tsc2102_set_samplerate(long sample_rate)
+{
++ pr_debug("%s %d\n", __func__, sample_rate);
++
+#ifndef TSC_MASTER
+ int clkgdv = 0;
+ u16 srgr1, srgr2;
@@ -942,11 +954,13 @@
+#endif
+
+ current_rate = sample_rate;
-+ dump_tsc2102_audio_regs(1);
++ dump_tsc2102_audio_regs(0);
+}
+
+static void tsc2102_configure(void)
+{
++ pr_debug("%s\n", __func__);
++
+ tsc210x_dac_power(1);
+
+#ifdef TSC_MASTER
@@ -1170,7 +1184,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102-mixer.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102-mixer.c
-@@ -0,0 +1,293 @@
+@@ -0,0 +1,295 @@
+/*
+ * sound/arm/imx-alsa-tsc2102-mixer.c
+ *
@@ -1458,6 +1472,8 @@
+ /* TSC2101 specific part */
+ /* TBDL */
+
++ snd_imx_init_mixer();
++
+ return 0;
+}
+
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-305-apf27-armadeus-separates_imx_and_mx2_alsa_build.patch 2009-01-16 17:40:30 UTC (rev 1021)
@@ -0,0 +1,52 @@
+--- linux-2.6.27.2.original/sound/arm/Kconfig 2009-01-16 17:54:48.000000000 +0100
++++ linux-2.6.27.2/sound/arm/Kconfig 2009-01-16 18:18:48.000000000 +0100
+@@ -28,6 +28,17 @@
+ select SND_PCM
+ select SND_AC97_CODEC
+
++config SND_IMX_PCM
++ tristate "i.MX1/L SSI driver"
++ depends on SND && ARCH_IMX
++ select SND_PCM
++ help
++ Say Y here to include support for i.MX1/L based CPU cards with
++ sound output.
++
++ To compile this driver as a module, choose M here: the module
++ will be called snd-imx.
++
+ config SND_PXA2XX_PCM
+ tristate
+ select SND_PCM
+@@ -42,13 +53,13 @@
+ the PXA2xx AC97 interface.
+
+ config SND_IMX_TSC2102
+- tristate "i.MX1/L TSC2102 alsa driver"
+- depends on ARCH_IMX && SND
++ tristate "TSC210x alsa driver"
++ depends on (SND_IMX_PCM || SND_IMX2_PCM)
+ select SND_PCM
+ select SPI_TSC2102
+ help
+- Say Y here if you have an i.MX1/L platform board
+- and a TSC2102 audio chip.
++ Say Y here if you have an i.MX platform board
++ and a TSC210x audio chip.
+
+ To compile this driver as a module, choose M here: the module
+ will be called snd-imx-tsc2102.
+--- linux-2.6.27.2.original/sound/arm/Makefile 2009-01-16 17:54:48.000000000 +0100
++++ linux-2.6.27.2/sound/arm/Makefile 2009-01-16 18:10:07.000000000 +0100
+@@ -14,6 +14,9 @@
+ obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
+ snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
+
+-obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
+-snd-imx-alsa-tsc2102-objs := imx-alsa.o imx-alsa-tsc2102.o imx-alsa-tsc2102-mixer.o
++obj-$(CONFIG_SND_IMX) += snd-imx.o
++snd-imx-objs :=imx-ssi.o
++
++obj-$(CONFIG_SND_IMX_TSC2102) += snd-imx-alsa-tsc2102.o
++snd-imx-alsa-tsc2102-objs := imx-alsa.o imx-alsa-tsc2102.o imx-alsa-tsc2102-mixer.o devdma.o
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-16 13:47:14
|
Revision: 1020
http://armadeus.svn.sourceforge.net/armadeus/?rev=1020&view=rev
Author: artemys
Date: 2009-01-16 13:47:04 +0000 (Fri, 16 Jan 2009)
Log Message:
-----------
[DEBUG] wrong registers in imxssi & imxregs
Modified Paths:
--------------
branches/tsc210x/target/linux/debug/imxregs/imx27regs.h
branches/tsc210x/target/linux/debug/imxssi/imxssi.c
Modified: branches/tsc210x/target/linux/debug/imxregs/imx27regs.h
===================================================================
--- branches/tsc210x/target/linux/debug/imxregs/imx27regs.h 2009-01-16 13:35:27 UTC (rev 1019)
+++ branches/tsc210x/target/linux/debug/imxregs/imx27regs.h 2009-01-16 13:47:04 UTC (rev 1020)
@@ -89,7 +89,7 @@
{ "BLR4", 0x10001194, 0, 0xffffffff, 'x', "Channel 4 Burst Length Register" },
{ "RTOR4", 0x10001198, 0, 0xffffffff, 'x', "Channel 4 Request Time-Out Register" },
{ "BUCR4", 0x10001198, 0, 0xffffffff, 'x', "Channel 4 Bus Utilization Control Register" },
-{ "CCNR", 0x1000119C, 0, 0xffffffff, 'x', "4 Channel 4 Channel Counter Register" },
+{ "CCNR4", 0x1000119C, 0, 0xffffffff, 'x', "Channel 4 Channel Counter Register" },
{ "SAR5", 0x100011C0, 0, 0xffffffff, 'x', "Channel 5 Source Address Register" },
{ "DAR5", 0x100011C4, 0, 0xffffffff, 'x', "Channel 5 Destination Address Register" },
{ "CNTR5", 0x100011C8, 0, 0xffffffff, 'x', "Channel 5 Count Register" },
Modified: branches/tsc210x/target/linux/debug/imxssi/imxssi.c
===================================================================
--- branches/tsc210x/target/linux/debug/imxssi/imxssi.c 2009-01-16 13:35:27 UTC (rev 1019)
+++ branches/tsc210x/target/linux/debug/imxssi/imxssi.c 2009-01-16 13:47:04 UTC (rev 1020)
@@ -273,13 +273,13 @@
setreg("SCSR", 0xDB41);
#else
setreg("PCCR0", 0xd5010013);
- setreg("PPCR1", 0xa21a0e30);
+ setreg("PCCR1", 0xa21a0e30);
setreg("PPCR1", 0x00001000);
setreg("HPCR1", 0xcc007000);
setreg("STCR_1", 0x0000028d); /* I2S mode */
setreg("SRCR_1", 0x0000028d); /* I2S mode */
- setreg("STCCR_1", 0x0004e000);
- setreg("SCR_1", 0x000000d7); /* I2S mode */
+ setreg("STCCR_1", 0x0000e000);
+ setreg("SCR_1", 0x00000057); /* I2S mode */
#endif
sscanf(argv[1],"%i",&type);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-16 13:35:37
|
Revision: 1019
http://armadeus.svn.sourceforge.net/armadeus/?rev=1019&view=rev
Author: artemys
Date: 2009-01-16 13:35:27 +0000 (Fri, 16 Jan 2009)
Log Message:
-----------
[TOOLS] Update patch generation tool
Modified Paths:
--------------
branches/tsc210x/target/linux/Makefile
Modified: branches/tsc210x/target/linux/Makefile
===================================================================
--- branches/tsc210x/target/linux/Makefile 2009-01-14 15:22:10 UTC (rev 1018)
+++ branches/tsc210x/target/linux/Makefile 2009-01-16 13:35:27 UTC (rev 1019)
@@ -31,7 +31,7 @@
### ALSA/TSC2102 Patches: ---
-DEP1=include/asm-arm/arch-imx/imx-alsa.h
+DEP1=arch/arm/mach-imx/include/mach/imx-alsa.h
TARGET1:=$(TMP_DIR)/$(LINUX_NAME)-090-armadeus-alsa-create_imx-alsa_h.patch
$(TARGET1): $(DEP1)
@$(START_CMD)
@@ -71,10 +71,20 @@
PATCHES+=$(TARGET4)
FILES+=$(DEP4)
+DEP_SSI=sound/arm/imx-ssi.c sound/arm/imx-ssi.h arch/arm/mach-imx/include/mach/imx_ssi.h
+TARGET_SSI:=$(TMP_DIR)/$(LINUX_NAME)-095-armadeus-imx-ssi-add_driver.patch
+$(TARGET_SSI): $(DEP_SSI)
+ @$(START_CMD)
+ @$(GENERATE_PATCH_FROM_MULTIPLE_DEPENDS)
+ @$(CLEAN_PATCH_CMD)
+ @echo
+PATCHES+=$(TARGET_SSI)
+FILES+=$(DEP_SSI)
+
### APF9328 Patches: ---
-DEP5=arch/arm/mach-imx/apf9328.c arch/arm/mach-imx/apf9328_lcd_config.h include/asm-arm/arch-imx/apf9328.h
+DEP5=arch/arm/mach-imx/apf9328.c arch/arm/mach-imx/apf9328_lcd_config.h arch/arm/mach-imx/include/mach/apf9328.h
TARGET5:=$(TMP_DIR)/$(LINUX_NAME)-021-armadeus-apf9328.patch
$(TARGET5): $(DEP5)
@$(START_CMD)
@@ -84,19 +94,30 @@
PATCHES+=$(TARGET5)
FILES+=$(DEP5)
-### APF27 Patches: ---
-
-DEP21=arch/arm/mach-mx2/apf27.c
-TARGET21:=$(TMP_DIR)/$(LINUX_NAME)-281-apf27-armadeus-add_apf27.c.patch
-$(TARGET21): $(DEP21)
+DEP_DMA=arch/arm/mach-imx/include/mach/imx-dma.h arch/arm/mach-imx/dma.c
+TARGET_DMA:=$(TMP_DIR)/$(LINUX_NAME)-097-armadeus-imx-dma-improvements.patch
+$(TARGET_DMA): $(DEP_DMA)
@$(START_CMD)
- @$(GENERATE_PATCH_FROM_SINGLE_DEPEND)
+ @$(GENERATE_PATCH_FROM_MULTIPLE_DEPENDS)
@$(CLEAN_PATCH_CMD)
@echo
-PATCHES+=$(TARGET21)
-FILES+=$(DEP21)
+PATCHES+=$(TARGET_DMA)
+FILES+=$(DEP_DMA)
+### APF27 Patches: ---
+
+#DEP21=arch/arm/mach-mx2/apf27.c
+#TARGET21:=$(TMP_DIR)/$(LINUX_NAME)-281-apf27-armadeus-add_apf27.c.patch
+#$(TARGET21): $(DEP21)
+# @$(START_CMD)
+# @$(GENERATE_PATCH_FROM_SINGLE_DEPEND)
+# @$(CLEAN_PATCH_CMD)
+# @echo
+#PATCHES+=$(TARGET21)
+#FILES+=$(DEP21)
+
+
### Other Patches: ---
# Special case: drivers/video/imxfb.h doesn't exist
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1018
http://armadeus.svn.sourceforge.net/armadeus/?rev=1018&view=rev
Author: artemys
Date: 2009-01-14 15:22:10 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Update alsa include
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-090-armadeus-alsa-create_imx-alsa_h.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-090-armadeus-alsa-create_imx-alsa_h.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-090-armadeus-alsa-create_imx-alsa_h.patch 2009-01-14 14:21:01 UTC (rev 1017)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-090-armadeus-alsa-create_imx-alsa_h.patch 2009-01-14 15:22:10 UTC (rev 1018)
@@ -3,13 +3,13 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/arch/arm/mach-imx/include/mach/imx-alsa.h
+++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/imx-alsa.h
-@@ -0,0 +1,131 @@
+@@ -0,0 +1,151 @@
+/*
+ * linux/include/asm-arm/arch-imx/imx-alsa.h
+ *
-+ * Alsa Driver for AIC23 and TSC2101 codecs on iMX platform boards.
++ * Alsa Driver for i.MX platform based boards.
+ *
-+ * Copyright (C) 2008 Armadeus <nic...@ar...>
++ * Copyright (C) 2008 Armadeus systems <nic...@ar...>
+ * Based on the omap alsa driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
@@ -81,8 +81,12 @@
+ int periods; /* current count of periods registered in the DMA engine */
+ spinlock_t dma_lock; /* for locking in DMA operations */
+ struct snd_pcm_substream *stream; /* the pcm stream */
-+ int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */
-+ int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */
++
++ void *base; /* physical address of the DMA buffer in memory */
++ void *adr; /* virtual address of the DMA buffer */
++ int size; /* buffer size */
++ int sg_count;
++ struct scatterlist *sg_list;
+};
+
+
@@ -97,8 +101,7 @@
+};
+
+/* Codec specific information and function pointers.
-+ * Codec imx-alsa-tsc2101.c
-+ * is responsible for defining the function pointers.
++ * Codec is responsible for defining the function pointers.
+ */
+struct imx_alsa_codec_config {
+ char *name;
@@ -109,11 +112,28 @@
+ void (*codec_configure_dev)(void);
+ void (*codec_set_samplerate)(long);
+ void (*codec_clock_setup)(void);
-+ int (*codec_clock_on)(void);
-+ int (*codec_clock_off)(void);
-+ int (*get_default_samplerate)(void);
++ int (*codec_clock_on)(void);
++ int (*codec_clock_off)(void);
++ int (*get_default_samplerate)(void);
+};
+
++#ifdef CONFIG_ARCH_IMX
++#define IMX_SUPPORTED_SSI_UNITS 1
++#elif CONFIG_ARCH_MX2
++#define IMX_SUPPORTED_SSI_UNITS 2
++#endif
++
++struct imx_sound_connection {
++ int cpu_port; /* from 1 to 4 on i.MX27, 0 unused */
++ int dev_port; /* I2S device specific. 1 to 2 for PMIC MC13783, 0 unused */
++};
++
++struct imx_sound_platform_data {
++ struct imx_sound_connection connection[IMX_SUPPORTED_SSI_UNITS];
++ int (*init)(struct platform_device *pdev);
++ void (*exit)(struct platform_device *pdev);
++};
++
+/*********** Mixer function prototypes *************************/
+int snd_imx_mixer(struct snd_card_imx_codec *);
+void snd_imx_init_mixer(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Fa...@us...> - 2009-01-14 14:21:16
|
Revision: 1017
http://armadeus.svn.sourceforge.net/armadeus/?rev=1017&view=rev
Author: FabM
Date: 2009-01-14 14:21:01 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[POD] Driver generation mechanisme updated
Modified Paths:
--------------
trunk/Makefile
trunk/target/linux/modules/fpga/POD/Kconfig
trunk/target/linux/modules/fpga/POD/Makefile
trunk/target/linux/modules/fpga/POD/void/Makefile
Removed Paths:
-------------
trunk/target/linux/modules/fpga/POD/void/Kconfig
trunk/target/linux/modules/fpga/podscript.sh
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/Makefile 2009-01-14 14:21:01 UTC (rev 1017)
@@ -116,11 +116,6 @@
$(MAKE) -C $(BUILDROOT_DIR)
linux-menuconfig:
- @if [ ! -e "target/linux/modules/fpga/POD/.pod" ] ; then \
- if [ -x target/linux/modules/fpga/podscript.sh ]; then \
- target/linux/modules/fpga/podscript.sh ; \
- fi \
- fi;
@if [ -e "$(LINUX_DIR)/.unpacked" ] ; then \
$(MAKE) -C $(BUILDROOT_DIR) linux26-menuconfig ; \
fi;
Modified: trunk/target/linux/modules/fpga/POD/Kconfig
===================================================================
--- trunk/target/linux/modules/fpga/POD/Kconfig 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/target/linux/modules/fpga/POD/Kconfig 2009-01-14 14:21:01 UTC (rev 1017)
@@ -6,13 +6,9 @@
#
config POD_DRIVERS
- boolean "Drivers generated by POD"
+ tristate "Drivers generated by POD"
default n
depends on ARMADEUS_FPGA_DRIVERS
---help---
All drivers for FPGA components
-
-
-source "drivers/armadeus/fpga/POD/void/Kconfig"
-
Modified: trunk/target/linux/modules/fpga/POD/Makefile
===================================================================
--- trunk/target/linux/modules/fpga/POD/Makefile 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/target/linux/modules/fpga/POD/Makefile 2009-01-14 14:21:01 UTC (rev 1017)
@@ -8,17 +8,18 @@
ifneq ($(KERNELRELEASE),)
# Part executed when called from kernel build system:
-obj-$(CONFIG_POD_DRIVERS) += void/
+obj-$(CONFIG_POD_DRIVERS) += $(shell ls -F drivers/armadeus/fpga/POD/ | grep \/$)
else
# Part executed when called from standard make in this directory:
-ARMADEUS_BASE_DIR=../../../../..
-include $(ARMADEUS_BASE_DIR)/Makefile.in
-
+BASE_DIR:=../../../../buildroot/
+REL:=$(shell grep "BR2_PACKAGE_LINUX_VERSION=" $(BASE_DIR).config | sed -e 's/BR2_PACKAGE_LINUX_VERSION=//' | sed -e 's/"//g')
+#
+ARMADEUS_KERNEL_DIR:=$(BASE_DIR)build_arm/linux-$(REL)
ifeq ($(LINUX_DIR),)
-LINUX_DIR:=$(ARMADEUS_LINUX_DIR)
+LINUX_DIR:=$(ARMADEUS_KERNEL_DIR)
endif
PWD:= $(shell pwd)
Deleted: trunk/target/linux/modules/fpga/POD/void/Kconfig
===================================================================
--- trunk/target/linux/modules/fpga/POD/void/Kconfig 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/target/linux/modules/fpga/POD/void/Kconfig 2009-01-14 14:21:01 UTC (rev 1017)
@@ -1,10 +0,0 @@
-#
-#
-
-config VOID_DRIVER
- tristate "Useless, just to avoid error"
- default n
- depends on POD_DRIVERS
- ---help---
- Useless, just to avoid error
-
Modified: trunk/target/linux/modules/fpga/POD/void/Makefile
===================================================================
--- trunk/target/linux/modules/fpga/POD/void/Makefile 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/target/linux/modules/fpga/POD/void/Makefile 2009-01-14 14:21:01 UTC (rev 1017)
@@ -5,7 +5,7 @@
# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_VOID_DRIVER) += void.o
+obj-$(CONFIG_POD_DRIVERS) += void.o
# Part executed when called from standard make in this directory:
# (preferably use Makefile in parent directory)
Deleted: trunk/target/linux/modules/fpga/podscript.sh
===================================================================
--- trunk/target/linux/modules/fpga/podscript.sh 2009-01-14 14:16:13 UTC (rev 1016)
+++ trunk/target/linux/modules/fpga/podscript.sh 2009-01-14 14:21:01 UTC (rev 1017)
@@ -1,88 +0,0 @@
-#!/bin/bash
-
-FPGADIR="target/linux/modules/fpga"
-PODDIR="/POD"
-
-echo "***********************"
-echo "*Generating POD config*"
-echo "***********************"
-
-echo """
-#
-# Armadeus custom drivers configuration
-#
-#
-
-#
-config POD_DRIVERS
- boolean \"Drivers generated by POD\"
- default n
- depends on ARMADEUS_FPGA_DRIVERS
- ---help---
- All drivers for FPGA components
-
-""" > $FPGADIR$PODDIR/Kconfig
-
-
-line=""
-for i in `ls $FPGADIR$PODDIR`
-do
- if [ -d $FPGADIR$PODDIR/$i ]
- then
- echo $i
- name=$i
-
- echo """
-source \"drivers/armadeus/fpga/POD/$name/Kconfig\"
-""" >> "${FPGADIR}${PODDIR}/Kconfig"
-
- line="${line} $name/"
- fi;
-done;
-
-# fill Makefile
-echo """
-#
-# Main Makefile for the Armadeus FPGA related drivers
-#
-# Add your subdirectories to obj- target
-#
-
-ifneq (\$(KERNELRELEASE),)
-
-# Part executed when called from kernel build system:
-obj-\$(CONFIG_POD_DRIVERS) += ${line}
-
-else
-
-# Part executed when called from standard make in this directory:
-
-BASE_DIR:=../../../../buildroot/
-REL:=\$(shell grep \"BR2_PACKAGE_LINUX_VERSION=\" \$(BASE_DIR).config | \
- sed -e 's/BR2_PACKAGE_LINUX_VERSION=//' | sed -e 's/\"//g')
-#`grep \"BR2_PACKAGE_LINUX_VERSION=\" \$(BASE_DIR).config | \
-# sed \"s/BR2_PACKAGE_LINUX_VERSION=\\\"//\" | sed \"s/\\\"//\"`
-ARMADEUS_KERNEL_DIR:=\$(BASE_DIR)build_arm/linux-\$(REL)
-ifeq (\$(LINUX_DIR),)
-LINUX_DIR:=\$(ARMADEUS_KERNEL_DIR)
-endif
-PWD:= \$(shell pwd)
-
-default:
- echo \"Your Linux source dir is: \$(LINUX_DIR)\"
- \$(MAKE) -C \$(LINUX_DIR) SUBDIRS=\$(PWD) zImage modules
-
-clean:
- echo \"Your Linux source dir is: \$(LINUX_DIR)\"
- \$(MAKE) -C \$(LINUX_DIR) SUBDIRS=\$(PWD) clean
-
-install:
- echo \"Installing Armadeus drivers...\"
- \$(MAKE) -C \$(LINUX_DIR) SUBDIRS=\$(PWD) INSTALL_MOD_PATH=\$(TARGET_DIR) modules_install
-
-endif
-
-""" > "${FPGADIR}${PODDIR}/Makefile";
-# ok config generated
-touch "$FPGADIR$PODDIR/.pod"
-echo "ok"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1016
http://armadeus.svn.sourceforge.net/armadeus/?rev=1016&view=rev
Author: artemys
Date: 2009-01-14 14:16:13 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Add SSI device declaration to apf9328
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-14 12:59:57 UTC (rev 1015)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-14 14:16:13 UTC (rev 1016)
@@ -3,11 +3,11 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/arch/arm/mach-imx/apf9328.c
+++ linux-2.6.27.2.mod/arch/arm/mach-imx/apf9328.c
-@@ -0,0 +1,677 @@
+@@ -0,0 +1,731 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
-+ * Copyright (c) 2005 Armadeus
++ * Copyright (c) 2005-2009 Armadeus systems
+ * This work is based on scb9328.c from Sascha Hauer
+ *
+ * This program is free software; you can redistribute it and/or modify
@@ -45,14 +45,15 @@
+#include <mach/imx-uart.h>
+#include <mach/mmc.h>
+#include <mach/spi_imx.h>
-+#include <mach/imx-regs.h> // imx_gpio_mode()
++#include <mach/imx-regs.h> /* imx_gpio_mode() */
+#include <mach/imx-alsa.h>
+#include <linux/spi/max1027.h>
+#include <linux/usb/isp116x.h>
++#include <mach/imx_ssi.h>
+
+#ifdef CONFIG_DM9000
+#include <linux/dm9000.h>
-+#endif // CONFIG_DM9000
++#endif
+
+#include "generic.h"
+
@@ -188,24 +189,87 @@
+};
+
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
-+static struct imx_alsa_codec_config tsc2102_alsa_pdata;
++int apf9328_ssi_gpio_init(struct platform_device *pdev)
++{
++ /* Activate SSI on PortC */
++ imx_gpio_mode(PC3_PF_SSI_RXFS);
++ FMCR &= ~(SSI_RXFS_SEL);
++ imx_gpio_mode(PC4_PF_SSI_RXCLK);
++ FMCR &= ~(SSI_RXCLK_SEL);
++ imx_gpio_mode(PC5_PF_SSI_RXDAT);
++ FMCR &= ~(SSI_RXDAT_SEL);
++ imx_gpio_mode(PC6_PF_SSI_TXDAT);
++ imx_gpio_mode(PC7_PF_SSI_TXFS);
++ FMCR &= ~(SSI_TXFS_SEL);
++ imx_gpio_mode(PC8_PF_SSI_TXCLK);
++ FMCR &= ~(SSI_TXCLK_SEL);
++
++ printk("SSI pins configured\n");
++ return 0;
++}
+
++static struct imx_ssi_platform_data apf9328_ssi_pdata = {
++ .init = apf9328_ssi_gpio_init,
++};
++
+static struct resource ssi_resources[] = {
-+ [0] = {
-+ .start = (IMX_SSI_BASE),
-+ .end = (IMX_SSI_BASE + 0x28),
-+ .flags = IORESOURCE_MEM,
-+ },
++ [0] = {
++ .start = (0x00218000),
++ .end = (0x00218000 + 0x28),
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = SSI_TX_INT,
++ .end = SSI_TX_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [2] = {
++ .start = SSI_TX_ERR_INT,
++ .end = SSI_TX_ERR_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [3] = {
++ .start = SSI_RX_INT,
++ .end = SSI_RX_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [4] = {
++ .start = SSI_RX_ERR_INT,
++ .end = SSI_RX_ERR_INT,
++ .flags = IORESOURCE_IRQ
++ },
++ [5] = {
++ .name = "tx0",
++ .start = DMA_REQ_SSI_T,
++ .end = DMA_REQ_SSI_T,
++ .flags = IORESOURCE_DMA
++ },
++ [6] = {
++ .name = "rx0",
++ .start = DMA_REQ_SSI_R,
++ .end = DMA_REQ_SSI_R,
++ .flags = IORESOURCE_DMA
++ },
+};
+
++static struct platform_device apf9328_ssi_device = {
++ .name = "imx-ssi",
++ .id = 0,
++ .num_resources = ARRAY_SIZE(ssi_resources),
++ .resource = ssi_resources,
++ .dev = {
++ .platform_data = &apf9328_ssi_pdata,
++ }
++};
++
++static struct imx_sound_platform_data apf9328_alsa_pdata;
++
+static struct platform_device tsc2102_alsa_device = {
-+ .name = "tsc210x-alsa", // Should be the same as the driver name
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(ssi_resources),
-+ .resource = ssi_resources,
-+ .dev = {
-+ .platform_data = &tsc2102_alsa_pdata,
-+ }
++ .name = "tsc210x-alsa",
++ .id = 0,
++ .dev = {
++ .platform_data = &apf9328_alsa_pdata,
++ }
+};
+#endif /* defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE) */
+
@@ -417,19 +481,6 @@
+ imx_gpio_mode( GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS );
+ //imx_gpio_irq_type( IRQ_GPIOD(8), __IRQT_FALEDGE );
+
-+ // Activate SSI on PortC ----
-+ imx_gpio_mode( PC3_PF_SSI_RXFS );
-+ FMCR &= ~(SSI_RXFS_SEL);
-+ imx_gpio_mode( PC4_PF_SSI_RXCLK );
-+ FMCR &= ~(SSI_RXCLK_SEL);
-+ imx_gpio_mode( PC5_PF_SSI_RXDAT );
-+ FMCR &= ~(SSI_RXDAT_SEL);
-+ imx_gpio_mode( PC6_PF_SSI_TXDAT );
-+ imx_gpio_mode( PC7_PF_SSI_TXFS );
-+ FMCR &= ~(SSI_TXFS_SEL);
-+ imx_gpio_mode( PC8_PF_SSI_TXCLK );
-+ FMCR &= ~(SSI_TXCLK_SEL);
-+
+ printk("TSC2102 GPIOs initialized\n");
+ return 0;
+}
@@ -449,11 +500,13 @@
+};
+
+static struct tsc210x_config apf9328_tsc2102_config = {
-+ .use_internal = 1, // -> use internal voltage reference
-+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
-+ .init = tsc2102_init_gpio
-+/* .apm_report = palmte_get_power_status,
-+ .alsa_config = &palmte_alsa_config,*/
++ .use_internal = 1, // -> use internal voltage reference
++ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
++ .init = tsc2102_init_gpio,
++/* .apm_report = palmte_get_power_status,*/
++/*#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
++ .alsa_config = &apf9328_alsa_pdata,
++#endif*/
+};
+
+#endif // CONFIG_SPI_TSC2102
@@ -570,23 +623,24 @@
+static struct platform_device *devices[] __initdata = {
+ &imx_uart1_device,
+ &imx_uart2_device,
-+#ifdef CONFIG_DM9000
++#ifdef CONFIG_DM9000
+ &dm9000x_device,
-+#endif // CONFIG_DM9000
++#endif
+#ifdef CONFIG_SPI_IMX
+ &imx_spi1,
+ &imx_spi2,
-+#endif //CONFIG_SPI_IMX
++#endif
+ &imx_pwm_device,
+#ifdef CONFIG_IMX_BACKLIGHT
+ &imxbl_device,
-+#endif // CONFIG_IMX_BACKLIGHT
++#endif
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+ &tsc2102_alsa_device,
-+#endif // CONFIG_SND_IMX_TSC2102 || CONFIG_SND_IMX_TSC2102_MODULE
++ &apf9328_ssi_device,
++#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
+ &devfull_isp1761_device,
-+#endif // CONFIG_ARMADEUS_ISP1761
++#endif
+};
+
+static void __init apf9328_init(void)
@@ -891,7 +945,7 @@
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.2.original/arch/arm/mach-imx/include/mach/apf9328.h
-+++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/apf9328.h
++++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/apf9328.h
@@ -0,0 +1,63 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1015
http://armadeus.svn.sourceforge.net/armadeus/?rev=1015&view=rev
Author: artemys
Date: 2009-01-14 12:59:57 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Makes alsa pcm driver independent of i.MXL (at least try to) + makes it use DMA scatter-gather + removes i.MX dependancies in TSC mixer
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-14 09:37:05 UTC (rev 1014)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-091-armadeus-alsa-add_imx_ssi_tsc2102_driver.patch 2009-01-14 12:59:57 UTC (rev 1015)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa.c
-@@ -0,0 +1,683 @@
+@@ -0,0 +1,658 @@
+/*
+ * sound/arm/imx-alsa.c
+ *
@@ -34,138 +34,134 @@
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
++#define DEBUG
+
+#include <linux/platform_device.h>
-+#include <linux/spi/tsc2102.h>
+#ifdef CONFIG_PM
+#include <linux/pm.h>
+#endif
+#include <sound/core.h>
+#include <sound/pcm.h>
++#include <sound/pcm_params.h>
+
+#include <mach/imx-alsa.h>
+#include <linux/dma-mapping.h>
++
++#ifdef CONFIG_ARCH_MX2
++#include <mach/dma-mx1-mx2.h>
++#else
+#include <mach/imx-dma.h>
++#include "imx-ssi.h"
++#endif
+
++#include "devdma.h"
++
++#define DRIVER_NAME "imx-alsa"
+#define TSC_MASTER
+
-+#define TRANSMIT_WM_LEVEL 8 // (in free places)
-+#define SSI_DMA_BLR_TRANSMIT 16 // (3*2) // DMA Burst Length (in bytes)
++#define SSI_DMA_BLR_TRANSMIT 16 /* (3*2) DMA Burst Length (in bytes) */
+#define SSI_DMA_BLR 8
+
+MODULE_AUTHOR("Nicolas Colombain / Julien Boibessot - Armadeus Systems");
+MODULE_LICENSE("GPL");
-+MODULE_DESCRIPTION("i.MX1/L driver for ALSA");
++MODULE_DESCRIPTION("i.MX1/L PCM driver for ALSA");
+MODULE_ALIAS("iMX_alsa_ssi");
+
+static struct snd_card_imx_codec *alsa_codec = NULL;
+static struct imx_alsa_codec_config *alsa_codec_config = NULL;
+
+
-+/*
-+ * HW interface start and stop helper functions
-+ */
-+static int audio_ifc_start(void)
-+{
-+ printk("Starting HW\n");
-+ SSI_SCSR |= SSI_TE; /* TE enable */
-+ return 0;
-+}
-+
-+static int audio_ifc_stop(void)
++/* Called by the DMA framework when a period has elapsed */
++static void snd_imx_dma_progression(int channel, void *data,
++ struct scatterlist *sg)
+{
-+ printk("Stopping HW\n");
-+ SSI_SCSR &= ~SSI_TE; /* TE disable */
-+ return 0;
-+}
++ struct audio_stream *s = data;
++ struct snd_pcm_substream *substream = s->stream;
++ struct snd_pcm_runtime *runtime;
+
-+#ifdef DEBUG
-+static void dump_ssi_registers(void)
-+{
-+ printk("SSI_STX: 0x%x\n", SSI_STX);
-+ printk("SSI_SRX: 0x%x\n", SSI_SRX);
-+ printk("SSI_SCSR: 0x%x\n", SSI_SCSR);
-+ printk("SSI_STCR: 0x%x\n", SSI_STCR);
-+ printk("SSI_SRCR: 0x%x\n", SSI_SRCR);
-+ printk("SSI_STCCR: 0x%x\n", SSI_STCCR);
-+ printk("SSI_SRCCR: 0x%x\n", SSI_SRCCR);
-+ printk("SSI_STSR: 0x%x\n", SSI_STSR);
-+ printk("SSI_SFCSR: 0x%x\n", SSI_SFCSR);
-+ printk("SSI_STR: 0x%x\n", SSI_STR);
-+ printk("SSI_SOR: 0x%x\n", SSI_SOR);
++ runtime = substream->runtime;
++
++ if (sg) {
++/* channel_info->offset = (unsigned long)sg->dma_address -
++ (unsigned long)channel_info->base;*/
++ s->periods++;
++ s->periods %= runtime->periods;
++
++ snd_pcm_period_elapsed(substream);
++ }
+}
-+#endif
+
-+static void imx_alsa_audio_init(struct snd_card_imx_codec *imx_alsa)
++/* called when the DMA unit has finished the buffer.
++ * it should not happen, but whith a playback or capturing
++ * size of 2^32 bytes it will happen!
++ */
++static void snd_imx_dma_callback(int channel, void *data)
+{
-+ /* Setup DMA stuff */
-+ imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].id = "Alsa imx out";
-+ imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].stream_id =
-+ SNDRV_PCM_STREAM_PLAYBACK;
-+ imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].dma_dev =
-+ IMX_DMA_CHANNELS-1;
-+ imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].hw_start =
-+ audio_ifc_start;
-+ imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].hw_stop =
-+ audio_ifc_stop;
++ struct audio_stream *s = data;
++ struct snd_pcm_substream *substream = s->stream;
+
-+ imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].id = "Alsa imx in";
-+ imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].stream_id =
-+ SNDRV_PCM_STREAM_CAPTURE;
-+ imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].dma_dev =
-+ IMX_DMA_CHANNELS-2;
-+ imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].hw_start =
-+ audio_ifc_start;
-+ imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].hw_stop =
-+ audio_ifc_stop;
++ pr_err("%s shouldn't be called\n", __func__);
++
++ /* report period's end */
++ snd_pcm_period_elapsed(substream);
+}
+
-+static void dma_err_handler(int channel, void *data, int errcode)
++/* Called by the DMA framework when an error has occured */
++static void snd_imx_dma_err_handler(int channel, void *data, int err)
+{
-+ printk("dma_err_handler %d %d\n",channel, errcode);
++ printk("dma_err_handler %d %d\n",channel, err);
+
++ printk("DMA timeout on channel %d -%s%s%s%s\n",
++ channel,
++ err & IMX_DMA_ERR_BURST ? " burst":"",
++ err & IMX_DMA_ERR_REQUEST ? " request":"",
++ err & IMX_DMA_ERR_TRANSFER ? " transfer":"",
++ err & IMX_DMA_ERR_BUFFER ? " buffer":"");
++
+ imx_dma_disable(channel);
+}
+
-+/*
-+ * DMA functions
-+ * Depends on imx-alsa-dma.c functions and (imx) dma.c
-+ *
-+ */
-+static int audio_dma_request(struct audio_stream *s,
-+ void (*callback) (int, void *))
++/* configure DMA channel of a given substream */
++static int snd_imx_dma_request(struct audio_stream *s)
+{
+ int err=0, chan=0;
+ ADEBUG();
+
-+ chan = imx_dma_request_by_prio(s->id, DMA_PRIO_HIGH);
++ chan = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_HIGH);
+ if (chan < 0) {
-+ printk(KERN_ERR "Unable to grab dma channel: %d\n", s->dma_dev);
-+ } else {
-+ s->dma_dev = chan;
-+ err = imx_dma_setup_handlers(s->dma_dev,
-+ snd_imx_alsa_dma_interrupt,
-+ dma_err_handler,
-+ s);
-+ if (err < 0)
-+ printk(KERN_ERR "Unable to setup dma handler for channel %d\n", s->dma_dev);
++ printk(KERN_ERR "Unable to grab a DMA channel\n");
++ err = chan;
++ goto on_error_1;
+ }
-+ printk("audio_dma_request done (%d)\n", s->dma_dev);
-+ imx_dma_disable(s->dma_dev);
-+ return err;
-+}
++ s->dma_dev = chan;
+
-+static int audio_dma_free(struct audio_stream *s)
-+{
-+ int err = 0;
-+ ADEBUG();
++ err = imx_dma_setup_handlers(s->dma_dev,
++ snd_imx_dma_callback,
++ snd_imx_dma_err_handler, s);
++ if (err < 0) {
++ printk(KERN_ERR "Unable to setup DMA handler for channel %d\n", s->dma_dev);
++ err = -EIO;
++ goto on_error_2;
++ }
+
-+ imx_dma_free(s->dma_dev); // doesn't return an error if failed
++ err = imx_dma_setup_progression_handler(s->dma_dev,
++ snd_imx_dma_progression);
++ if (err != 0) {
++ pr_err("Failed to setup the DMA handler\n");
++ err = -EIO;
++ goto on_error_2;
++ }
+
++ pr_debug("snd_imx_dma_request done (%d)\n", s->dma_dev);
++ imx_dma_disable(s->dma_dev);
++ return 0;
++
++on_error_2:
++ imx_dma_free(s->dma_dev);
++on_error_1:
+ return err;
+}
+
-+
+/*
+ * This function should calculate the current position of the dma in the
+ * buffer. It will help alsa middle layer to continue update the buffer.
@@ -201,174 +197,87 @@
+}
+
+/*
-+ * this stops the dma and clears the dma ptrs
-+ */
-+static void audio_stop_dma(struct audio_stream *s)
-+{
-+ unsigned long flags;
-+ ADEBUG();
-+
-+ spin_lock_irqsave(&s->dma_lock, flags);
-+ s->active = 0;
-+ s->period = 0;
-+ s->periods = 0;
-+
-+ /* this stops the dma channel and clears the buffer ptrs */
-+ imx_dma_disable(s->dma_dev);
-+
-+ spin_unlock_irqrestore(&s->dma_lock, flags);
-+}
-+
-+/*
-+ * Main dma routine, requests dma according where you are in main alsa buffer
-+ */
-+static void audio_process_dma(struct audio_stream *s)
-+{
-+ //#define IMX_SSI_BASE (0x00218000) /* a retrouver depuis le plateform data !!! */
-+ struct snd_pcm_substream *substream = s->stream;
-+ struct snd_pcm_runtime *runtime;
-+ unsigned int dma_size;
-+ unsigned int offset;
-+ int ret;
-+ dma_addr_t source;
-+
-+ runtime = substream->runtime;
-+ imx_dma_disable(s->dma_dev);
-+
-+ if (s->active) {
-+ dma_size = frames_to_bytes(runtime, runtime->period_size);
-+ offset = dma_size * s->period;
-+// printk("dma_size %d, off %d psize %d from 0x%x\n", dma_size, offset, runtime->period_size, (dma_addr_t)runtime->dma_area);
-+ snd_assert(dma_size <= DMA_BUF_SIZE,);
-+
-+ source = dma_map_single(NULL,
-+ runtime->dma_area + offset,
-+ dma_size,
-+ DMA_TO_DEVICE);
-+ if (dma_mapping_error((struct device*)NULL, source)) {
-+ printk("Unable to map DMA buffer\n");
-+ return;
-+ }
-+
-+ ret = imx_dma_setup_single(s->dma_dev,
-+ source, dma_size,
-+ 0x00218000, DMA_MODE_WRITE);
-+ if (ret) {
-+ printk(KERN_ERR
-+ "audio_process_dma: cannot queue DMA buffer (%i)\n", ret);
-+ return;
-+ }
-+ imx_dma_enable(s->dma_dev);
-+
-+ s->dma_in_progress = 1;
-+ s->period++;
-+ s->period %= runtime->periods;
-+// s->periods++;
-+ s->offset = offset;
-+
-+ } else {
-+ printk("stream not active\n");
-+ }
-+}
-+
-+/*
-+ * This is called when dma IRQ occurs at the end of each transmited block
-+ */
-+void snd_imx_alsa_dma_interrupt(int channel, void *data)
-+{
-+ struct audio_stream *s = data;
-+ struct snd_pcm_substream *substream = s->stream;
-+ struct snd_pcm_runtime *runtime;
-+// unsigned int dma_size;
-+// unsigned int offset;
-+// unsigned long temp;
-+// int ret, i;
-+// dma_addr_t source;
-+
-+ runtime = substream->runtime;
-+
-+ //printk("[%x] <dma %d>\n",IMX_TCN(IMX_TIM2_BASE), channel);
-+/* // Reset DMA channel
-+ CCR(channel) &= ~CCR_CEN; TO REMOVE
-+ CCR(channel) |= CCR_CEN;*/
-+ /*
-+ * If we are getting a callback for an active stream then we inform
-+ * the PCM middle layer we've finished a period
-+ */
-+ if (s->active)
-+ snd_pcm_period_elapsed(s->stream);
-+
-+ spin_lock(&s->dma_lock);
-+ s->dma_in_progress = 0;
-+ s->periods++;
-+ s->periods %= runtime->periods;
-+
-+// if (s->periods > 0)
-+// s->periods--;
-+
-+ /* Trig next DMA transfer */
-+ audio_process_dma(s);
-+ spin_unlock(&s->dma_lock);
-+}
-+
-+/*
+ * Alsa section
+ * PCM settings and callbacks
+ */
+static int snd_imx_alsa_trigger(struct snd_pcm_substream * substream, int cmd)
+{
-+ struct snd_card_imx_codec *chip =
-+ snd_pcm_substream_chip(substream);
++ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ int stream_id = substream->pstr->stream;
+ struct audio_stream *s = &chip->s[stream_id];
-+ int err = 0;
-+ u32 temp;
+
-+ /* note local interrupts are already disabled in the midlevel code */
++ pr_debug("%s called\n", __func__);
+
++ /* note: local interrupts are already disabled in the midlevel code */
+ spin_lock(&s->dma_lock);
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ /* requested stream startup */
-+ // clear SSI underrun
-+ temp = SSI_SCSR;
-+ SSI_STX = 0x0000;
-+
-+ s->active = 1;
-+ s->dma_in_progress = 0;
-+ audio_process_dma(s);
-+ SSI_SCSR |= SSI_TE;
++ imx_dma_enable(s->dma_dev);
+ break;
+
+ case SNDRV_PCM_TRIGGER_STOP:
+ /* requested stream shutdown */
-+ audio_stop_dma(s);
-+ SSI_SCSR &= ~SSI_TE;
++ imx_dma_disable(s->dma_dev);
+ break;
+
+ default:
+ printk("Not supported (yet?) ALSA trigger: 0x%x\n", cmd);
-+ err = -EINVAL;
++ return -EINVAL;
+ break;
+ }
+ spin_unlock(&s->dma_lock);
+
-+ return err;
++ /* SSI activation done here */
++ return imx_ssi_trigger(substream, cmd, /*channel_info->ssi*/0);
+}
+
-+static int snd_imx_alsa_prepare(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_prepare(struct snd_pcm_substream * substream)
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
-+ struct audio_stream *s = &chip->s[substream->pstr->stream];
-+
++ struct audio_stream *channel_info = &chip->s[substream->pstr->stream];
++// int stream_id = substream->pstr->stream;
++ unsigned int dma_chan = channel_info->dma_dev;
++ int err = -EINVAL;
++ void __iomem *fifo_io;
++
++ pr_debug("%s called\n", __func__);
++
+ /* set requested samplerate */
+ alsa_codec_config->codec_set_samplerate(runtime->rate);
+ chip->samplerate = runtime->rate;
+
-+ s->period = 0;
-+ s->periods = 0;
++ channel_info->period = 0;
++ channel_info->periods = 0;
+
++#ifdef TSC_MASTER
++ imx_ssi_setup_unit_to_iis_slave(0);
++#else
++ imx_ssi_setup_unit_to_iis_master(0);
++#endif /* TSC_MASTER */
++
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
++ fifo_io = imx_ssi_get_dma_tx_address(/*channel_info->ssi*/0, 0);
++ err = imx_dma_setup_sg(dma_chan, channel_info->sg_list,
++ channel_info->sg_count,
++ -1, /* TODO largest possible size */
++ (unsigned int)fifo_io,
++ DMA_MODE_WRITE);
++ }
++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
++ fifo_io = imx_ssi_get_dma_rx_address(/*channel_info->ssi*/0, 0);
++ err = imx_dma_setup_sg(dma_chan, channel_info->sg_list,
++ channel_info->sg_count,
++ -1, /* TODO largest possible size */
++ (unsigned int)fifo_io,
++ DMA_MODE_READ);
++ }
++ if (err < 0) {
++ pr_err("Can't setup scatter/gather DMA\n");
++ return err;
++ }
++
+ return 0;
+}
+
@@ -380,98 +289,222 @@
+ return audio_get_dma_pos(&chip->s[substream->pstr->stream]);
+}
+
-+static int snd_card_imx_alsa_open(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_open(struct snd_pcm_substream * substream)
+{
-+ struct snd_card_imx_codec *chip =
-+ snd_pcm_substream_chip(substream);
++ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ int stream_id = substream->pstr->stream;
-+ int err;
++ int err, dma_req;
++ char *type;
++ unsigned int burstlen;
+
-+ printk ("%s substream @: 0x%x\n", __func__, (unsigned int)substream);
++ type = (stream_id == SNDRV_PCM_STREAM_PLAYBACK ? "Playback" : "Capture");
++ printk ("%s %s stream @: 0x%x\n", __func__, type, (unsigned int)substream);
++
+ chip->s[stream_id].stream = substream;
+ alsa_codec_config->codec_clock_on();
+ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_playback);
-+ }
-+ else{
++ burstlen = SSI_DMA_BLR_TRANSMIT;
++ dma_req = imx_ssi_get_dma_tx_channel(0, 0);
++ printk("imx_ssi_get_dma_tx_channel = %d\n", dma_req);
++ if (dma_req < 0)
++ return dma_req;
++ } else {
+ runtime->hw = *(alsa_codec_config->snd_imx_alsa_capture);
-+ printk ("capture not supported\n");
++ burstlen = SSI_DMA_BLR;
++ printk("capture not supported\n");
++ dma_req = imx_ssi_get_dma_rx_channel(0, 0);
++ if (dma_req < 0)
++ return dma_req;
+ }
+ if ((err = snd_pcm_hw_constraint_integer(runtime,
-+ SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
++ SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+ return err;
+
-+ printk ("playback supported %d\n",runtime->hw.rate_min);
++ printk("playback supported\n");
+ if ((err = snd_pcm_hw_constraint_list(runtime,
+ 0,
+ SNDRV_PCM_HW_PARAM_RATE,
-+ alsa_codec_config->hw_constraints_rates)) < 0)
++ alsa_codec_config->hw_constraints_rates)) < 0)
+ return err;
-+ printk("success\n");
++
++ /* request DMA channel */
++ err = snd_imx_dma_request(&chip->s[stream_id]);
++ if (err < 0)
++ return err;
++
++ /* configure i.MX DMA control register for given channel */
++ if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
++ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
++ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
++ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
++ dma_req, 1);
++ } else {
++ err = imx_dma_config_channel(chip->s[stream_id].dma_dev,
++ IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
++ IMX_DMA_MEMSIZE_16 | IMX_DMA_TYPE_FIFO,
++ dma_req, 1);
++ }
++ if (err < 0) {
++ printk("Cannot configure DMA for %s channel\n", type);
++ }
++
++ /* configure DMA burst length for channel */
++ imx_dma_config_burstlen(chip->s[stream_id].dma_dev, burstlen);
++
+ return 0;
+}
+
-+static int snd_card_imx_alsa_close(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_close(struct snd_pcm_substream * substream)
+{
+ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
-+
++ int stream_id = substream->pstr->stream;
++ struct audio_stream *channel_info = &chip->s[substream->pstr->stream];
++
+ ADEBUG();
++
++ imx_dma_disable(chip->s[stream_id].dma_dev);
++ imx_dma_free(chip->s[stream_id].dma_dev);
++
+ alsa_codec_config->codec_clock_off();
++
++ if (channel_info->sg_list != NULL)
++ kfree(channel_info->sg_list);
++
+ chip->s[substream->pstr->stream].stream = NULL;
+
+ return 0;
+}
+
+/* HW params & free */
-+static int snd_imx_alsa_hw_params(struct snd_pcm_substream * substream,
++static int snd_imx_pcm_hw_params(struct snd_pcm_substream * substream,
+ struct snd_pcm_hw_params * hw_params)
+{
++ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
++ struct audio_stream *channel_info = &chip->s[substream->pstr->stream];
++ struct snd_pcm_runtime *runtime = substream->runtime;
++ unsigned char *dma_adr;
++ int err = -EINVAL, i;
++
++ pr_debug("%s called\n", __func__);
++
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ err = devdma_hw_alloc(chip[0].card->dev, substream,
++ params_buffer_bytes(hw_params));
++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
++ err = devdma_hw_alloc(chip[1].card->dev, substream,
++ params_buffer_bytes(hw_params));
++ if (err < 0)
++ return err;
++
++ pr_debug("DMA area: 0x%p, addr: 0x%p, size: %u\n",
++ runtime->dma_area, (void*)runtime->dma_addr, runtime->dma_bytes);
++
++// channel_info->base = (void*)runtime->dma_addr;
++ channel_info->base = (void*)dma_map_single(NULL,
++ (void*)runtime->dma_area,
++ runtime->dma_bytes,
++ DMA_TO_DEVICE);
++ pr_debug("DMA phys: 0x%p\n", channel_info->base);
++ channel_info->adr = runtime->dma_area ;
++ channel_info->offset = 0;
++ channel_info->size = params_buffer_bytes(hw_params);
++ channel_info->periods = params_periods(hw_params);
++ channel_info->period = params_period_bytes(hw_params);
++
++ pr_debug("Size: %d periods: %d period_size: %d\n", channel_info->size, channel_info->periods, channel_info->period);
++ dma_adr = channel_info->base;
++
++ if (channel_info->sg_count != channel_info->periods) {
++ if (channel_info->sg_list)
++ kfree(channel_info->sg_list);
++ /* using sg_alloc_table() instead? */
++ channel_info->sg_list = kcalloc(channel_info->periods + 1,
++ sizeof(struct scatterlist), GFP_KERNEL);
++ pr_debug("Allocating scatter/gather list with %d+1 entries\n",
++ channel_info->periods);
++ if (!channel_info->sg_list)
++ return -ENOMEM;
++ channel_info->sg_count = channel_info->periods + 1;
++ } else
++ pr_debug("Reuse previous scatter/gather memory\n");
++
++ sg_init_table(channel_info->sg_list, channel_info->sg_count);
++
++ for (i = 0; i < channel_info->periods; i++) {
++ channel_info->sg_list[i].page_link = 0;
++ channel_info->sg_list[i].offset = 0; /* FIXME */
++ channel_info->sg_list[i].dma_address = (dma_addr_t)dma_adr;
++ channel_info->sg_list[i].length = channel_info->period;
++
++ dma_adr += channel_info->period;
++ }
++
++ /* close the loop */
++ sg_chain(channel_info->sg_list, channel_info->sg_count, channel_info->sg_list);
++
++ pr_debug("Activating %d periods with %d bytes each\n",
++ channel_info->periods, channel_info->period);
++
+ return snd_pcm_lib_malloc_pages(substream,
+ params_buffer_bytes(hw_params));
+}
+
-+static int snd_imx_alsa_hw_free(struct snd_pcm_substream * substream)
++static int snd_imx_pcm_hw_free(struct snd_pcm_substream * substream)
+{
++ struct snd_card_imx_codec *chip = snd_pcm_substream_chip(substream);
++ struct audio_stream *channel_info = &chip->s[substream->pstr->stream];
++// struct snd_pcm_runtime *runtime = substream->runtime;
++
++ pr_debug("%s called\n", __func__);
++
++ if (channel_info->sg_list != NULL) {
++ kfree(channel_info->sg_list);
++ channel_info->sg_list = NULL;
++ }
++
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ devdma_hw_free(chip[0].card->dev, substream);
++ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
++ devdma_hw_free(chip[1].card->dev, substream);
++
+ return snd_pcm_lib_free_pages(substream);
+}
+
+/* pcm operations */
-+static struct snd_pcm_ops snd_card_imx_alsa_playback_ops = {
-+ .open = snd_card_imx_alsa_open,
-+ .close = snd_card_imx_alsa_close,
++static struct snd_pcm_ops snd_card_imx_ops = {
++ .open = snd_imx_pcm_open,
++ .close = snd_imx_pcm_close,
+ .ioctl = snd_pcm_lib_ioctl,
-+ .hw_params = snd_imx_alsa_hw_params,
-+ .hw_free = snd_imx_alsa_hw_free,
-+ .prepare = snd_imx_alsa_prepare,
++ .hw_params = snd_imx_pcm_hw_params,
++ .hw_free = snd_imx_pcm_hw_free,
++ .prepare = snd_imx_pcm_prepare,
+ .trigger = snd_imx_alsa_trigger,
+ .pointer = snd_imx_alsa_pointer,
+};
+
-+static struct snd_pcm_ops snd_card_imx_alsa_capture_ops = {
-+ .open = snd_card_imx_alsa_open,
-+ .close = snd_card_imx_alsa_close,
-+ .ioctl = snd_pcm_lib_ioctl,
-+ .hw_params = snd_imx_alsa_hw_params,
-+ .hw_free = snd_imx_alsa_hw_free,
-+ .prepare = snd_imx_alsa_prepare,
-+ .trigger = snd_imx_alsa_trigger,
-+ .pointer = snd_imx_alsa_pointer,
-+};
-+
+/*
+ * Alsa init and exit section
-+ *
++ *
+ * Inits pcm alsa structures, allocate the alsa buffer, suspend, resume
+ */
-+static int __init snd_card_imx_alsa_pcm(struct snd_card_imx_codec *imx_alsa,
++#define CHIP_NAME "i.MX SSI"
++static int __init snd_imx_new_pcm(struct snd_card_imx_codec *imx_alsa,
+ int device)
+{
+ struct snd_pcm *pcm;
+ int err;
+
+ ADEBUG();
-+ if ((err = snd_pcm_new(imx_alsa->card, "IMX PCM", device, 1, 1, &pcm)) < 0)
++ err = snd_pcm_new(imx_alsa->card,
++ CHIP_NAME,
++ device,
++ 1, /* one playback strean */
++ 1, /* one capture stream */
++ &pcm);
++
++ if (err < 0)
+ return err;
+
+ /* sets up initial buffer with continuous allocation */
@@ -481,63 +514,14 @@
+ (GFP_KERNEL),
+ 8 * 1024, 8 * 1024);
+
-+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
-+ &snd_card_imx_alsa_playback_ops);
++ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
++ &snd_card_imx_ops);
+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
-+ &snd_card_imx_alsa_capture_ops);
++ &snd_card_imx_ops);
+ pcm->private_data = imx_alsa;
+ pcm->info_flags = 0;
-+ strcpy(pcm->name, "imx alsa pcm");
++ strcpy(pcm->name, CHIP_NAME);
+
-+ imx_alsa_audio_init(imx_alsa);
-+
-+ /* request DMA channels */
-+ audio_dma_request(&imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK],
-+ snd_imx_alsa_dma_interrupt);
-+ audio_dma_request(&imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE],
-+ snd_imx_alsa_dma_interrupt);
-+
-+ /* configure i.MXL DMA control register for given channels */
-+ CCR(imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].dma_dev) =
-+ CCR_DMOD_FIFO |
-+ CCR_SMOD_LINEAR |
-+ CCR_SSIZ_32 | CCR_DSIZ_16 |
-+ CCR_REN;
-+ CCR(imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].dma_dev) =
-+ CCR_DMOD_LINEAR |
-+ CCR_SMOD_FIFO |
-+ CCR_SSIZ_16 | CCR_DSIZ_32 |
-+ CCR_REN;
-+ /* configure i.MXL DMA request channel */
-+ RSSR(imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].dma_dev) = DMA_REQ_SSI_T;
-+ RSSR(imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].dma_dev) = DMA_REQ_SSI_R;
-+ /* configure DMA burst length per channel */
-+ BLR(imx_alsa->s[SNDRV_PCM_STREAM_PLAYBACK].dma_dev) = SSI_DMA_BLR_TRANSMIT;
-+ BLR(imx_alsa->s[SNDRV_PCM_STREAM_CAPTURE].dma_dev) = SSI_DMA_BLR;
-+
-+ /* Reset SSI before configuring it */
-+ SSI_SCSR &= ~SSI_EN;
-+ SSI_SCSR |= SSI_EN;
-+ /* SSI FIFO watermark */
-+ SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
-+#ifdef TSC_MASTER
-+ /* Clocks */
-+ SSI_STCCR = SSI_WL_16 | SSI_DC(0);
-+ SSI_SRCCR = SSI_WL_16 | SSI_DC(0);
-+ /* Control */
-+ SSI_SCSR = SSI_I2S_SLAVE_MODE | SSI_SYN | SSI_EN;
-+ /* Transmit config */
-+ SSI_STCR = SSI_MAE | SSI_FEN | SSI_SCKP | SSI_FSI | SSI_EFS;
-+#else
-+ /* Clocks */
-+ SSI_STCCR = 0x00006103;
-+ SSI_SRCCR = 0x00006103;
-+ /* Transmit config */
-+ SSI_STCR = SSI_MAE | SSI_FEN | SSI_FDIR | SSI_DIR | SSI_SCKP | SSI_FSI | SSI_EFS;
-+ /* Control */
-+ SSI_SCSR = /*SSI_SYS_CLK_EN |*/ SSI_I2S_MASTER_MODE | SSI_SYN | /*SSI_TE |*/ SSI_EN;
-+#endif // TSC_MASTER
-+
+ imx_alsa->pcm = pcm;
+
+ return 0;
@@ -571,7 +555,7 @@
+ struct snd_card_imx_codec *chip;
+ struct snd_card *card = platform_get_drvdata(pdev);
+
-+ if (card->power_state != SNDRV_CTL_POWER_D0) {
++ if (card->power_state != SNDRV_CTL_POWER_D0) {
+ chip = card->private_data;
+ if (chip->card->power_state != SNDRV_CTL_POWER_D0) {
+ snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0);
@@ -584,90 +568,81 @@
+
+#endif /* CONFIG_PM */
+
-+void snd_imx_alsa_free(struct snd_card * card)
-+{
-+ struct snd_card_imx_codec *chip = card->private_data;
-+
-+ /*
-+ * Turn off codec after it is done.
-+ * Can't do it immediately, since it may still have
-+ * buffered data.
-+ */
-+ schedule_timeout_interruptible(2);
-+
-+/* omap_mcbsp_stop(AUDIO_MCBSP);
-+ omap_mcbsp_free(AUDIO_MCBSP);
-+*/
-+ audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]);
-+ audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
-+}
-+
+/* module init & exit */
+
-+/*
++/*
+ * Inits alsa soundcard structure.
+ * Called by the probe method in codec after function pointers has been set.
+ */
+int snd_imx_alsa_post_probe(struct platform_device *pdev, struct imx_alsa_codec_config *config)
+{
+ int err = 0;
-+ int def_rate;
+ struct snd_card *card;
-+
-+ alsa_codec_config = config;
++ struct imx_sound_platform_data *pdata;
+
++ pr_debug("%s\n", __func__);
++
++ pdata = pdev->dev.platform_data;
++ if (pdata == NULL) {
++ pr_err("No platform data available. Giving up\n");
++ err = -ENODEV;
++ goto nodev1;
++ }
++
++ alsa_codec_config = config;
+ alsa_codec_config->codec_clock_setup();
-+ alsa_codec_config->codec_clock_on();
++ alsa_codec_config->codec_clock_on();
+
+ if (alsa_codec_config && alsa_codec_config->codec_configure_dev)
+ alsa_codec_config->codec_configure_dev();
+
+ alsa_codec_config->codec_clock_off();
+
-+ /* create the soundcard */
-+ card = snd_card_new(-1, "IMX-ALSA", THIS_MODULE, sizeof(alsa_codec));
++ /* instantiate a new soundcard */
++ card = snd_card_new(-1, "IMX-ALSA", THIS_MODULE, sizeof(*alsa_codec));
+ if (card == NULL)
+ goto nodev1;
++ alsa_codec = card->private_data;
++ alsa_codec->card = card;
+
-+ alsa_codec = kcalloc(1, sizeof(*alsa_codec), GFP_KERNEL);
-+ if (alsa_codec == NULL)
-+ goto nodev2;
-+
-+ card->private_data = (void *)alsa_codec;
-+ card->private_free = snd_imx_alsa_free;
-+ alsa_codec->card = card;
-+ def_rate = alsa_codec_config->get_default_samplerate();
-+ alsa_codec->samplerate = def_rate;
++ alsa_codec->samplerate = alsa_codec_config->get_default_samplerate();
+ spin_lock_init(&alsa_codec->s[0].dma_lock);
+ spin_lock_init(&alsa_codec->s[1].dma_lock);
+
-+ /* mixer */
++ /* add it a mixer */
+ if ((err = snd_imx_mixer(alsa_codec)) < 0)
-+ goto nodev3;
++ goto nodev2;
+
-+ /* PCM */
-+ if ((err = snd_card_imx_alsa_pcm(alsa_codec, 0)) < 0)
-+ goto nodev3;
-+ strcpy(card->driver, "IMXALSA");
-+ strcpy(card->shortname, "ARMADEUS IMX_ALSA");
-+ sprintf(card->longname, "ARMADEUS IMX_ALSA");
++ /* add it a PCM interface */
++ if ((err = snd_imx_new_pcm(alsa_codec, 0)) < 0)
++ goto nodev2;
+
++ strcpy(card->driver, "i.MX");
++ sprintf(card->shortname, "i.MX+%s audio", alsa_codec_config->name);
++ sprintf(card->longname, "Freescale i.MX with %s codec", alsa_codec_config->name);
++
+ snd_imx_init_mixer();
+ snd_card_set_dev(card, &pdev->dev);
+
+ /* Register the created soundcard */
-+ if ((err = snd_card_register(card)) == 0) {
-+ printk(KERN_INFO "audio support initialized\n");
-+ platform_set_drvdata(pdev, card);
-+ return 0;
++ err = snd_card_register(card);
++ if (err < 0) {
++ pr_err("Cannot register sound card. Giving up\n");
++ goto nodev2;
+ }
+
-+nodev3:
-+ kfree(alsa_codec);
++ pr_info("audio support initialized\n");
++ platform_set_drvdata(pdev, card);
++
++ /* activate the external SSI pins (should be done in imx-ssi !?) */
++ if (pdata->init)
++ pdata->init(pdev);
++
++ return 0;
++
+nodev2:
+ snd_card_free(card);
+nodev1:
-+
+ return err;
+}
+
@@ -748,7 +723,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102.c
-@@ -0,0 +1,378 @@
+@@ -0,0 +1,389 @@
+/*
+ * sound/arm/imx-alsa-tsc2102.c
+ *
@@ -822,7 +797,7 @@
+ .fifo_size = 0,
+};
+
-+#define DUMP_TSC2102_AUDIO_REGISTERS 1
++// #define DUMP_TSC2102_AUDIO_REGISTERS 1
+#ifdef DUMP_TSC2102_AUDIO_REGISTERS
+static void dump_tsc2102_audio_regs(int show_coef)
+{
@@ -913,6 +888,11 @@
+ tsc210x_read_sync(TSC2101_CELL_PHONE_AGC_CTRL));
+// #endif /* CONFIG_TSC2101 */
+}
++#else
++static void dump_tsc2102_audio_regs(int show_coef)
++{
++ return;
++}
+#endif /* DUMP_TSC2102_AUDIO_REGISTERS */
+
+/*
@@ -1066,21 +1046,27 @@
+
+static int __init snd_imx_alsa_tsc210x_probe(struct platform_device *pdev)
+{
-+ int ret = 0;
-+ struct imx_alsa_codec_config *codec_cfg = pdev->dev.platform_data;
++ int ret;
++ struct imx_alsa_codec_config *codec_cfg;
++// pdev->dev.platform_data;
+
++ printk("*** snd_imx_alsa_tsc2102_probe\n");
++
++ codec_cfg = kmalloc(sizeof(*codec_cfg), GFP_KERNEL);
+ if (codec_cfg) {
-+ codec_cfg->hw_constraints_rates =
-+ &tsc2102_hw_constraints_rates;
-+ codec_cfg->snd_imx_alsa_playback =
-+ &tsc2102_snd_imx_alsa_playback;
-+ codec_cfg->codec_configure_dev = tsc2102_configure;
-+ codec_cfg->codec_set_samplerate = tsc2102_set_samplerate;
-+ codec_cfg->codec_clock_setup = tsc2102_clock_setup;
-+ codec_cfg->codec_clock_on = tsc2102_clock_on;
-+ codec_cfg->codec_clock_off = tsc2102_clock_off;
++ codec_cfg->name = "TSC210x";
++ codec_cfg->hw_constraints_rates =
++ &tsc2102_hw_constraints_rates;
++ codec_cfg->snd_imx_alsa_playback =
++ &tsc2102_snd_imx_alsa_playback;
++ codec_cfg->codec_configure_dev = tsc2102_configure;
++ codec_cfg->codec_set_samplerate = tsc2102_set_samplerate;
++ codec_cfg->codec_clock_setup = tsc2102_clock_setup;
++ codec_cfg->codec_clock_on = tsc2102_clock_on;
++ codec_cfg->codec_clock_off = tsc2102_clock_off;
+ codec_cfg->get_default_samplerate =
-+ tsc2102_get_default_samplerate;
++ tsc2102_get_default_samplerate;
++ /* forward codec config to PCM layer */
+ ret = snd_imx_alsa_post_probe(pdev, codec_cfg);
+ } else
+ ret = -ENODEV;
@@ -1184,13 +1170,13 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-alsa-tsc2102-mixer.c
+++ linux-2.6.27.2.mod/sound/arm/imx-alsa-tsc2102-mixer.c
-@@ -0,0 +1,287 @@
+@@ -0,0 +1,293 @@
+/*
+ * sound/arm/imx-alsa-tsc2102-mixer.c
+ *
-+ * Alsa codec driver for TSC2102 chip for iMXL platforms.
++ * Alsa mixer driver for TSC210x chips.
+ *
-+ * Copyright (c) 2008 Jorasse <jo...@ar...>
++ * Copyright (c) 2008 Armadeus systems - Jorasse <jo...@ar...>
+ * Code based on the TSC2101 ALSA driver for omap platforms.
+ * Copyright (c) 2006 Andrzej Zaborowski <ba...@za...>
+ * Code based on the TSC2101 ALSA driver.
@@ -1275,7 +1261,7 @@
+}
+
+/*
-+ * Initializes TSC 2102 and playback target.
++ * Initializes TSC210x and playback target.
+ */
+void snd_imx_init_mixer(void)
+{
@@ -1435,12 +1421,12 @@
+};
+
+#ifdef CONFIG_PM
-+void snd_imx_suspend_mixer(void)
++void snd_tsc210x_suspend_mixer(void)
+{
+ /* Nothing to do */
+}
+
-+void snd_imx_resume_mixer(void)
++void snd_tsc210x_resume_mixer(void)
+{
+ /* The chip was reset, restore the last used values */
+ set_dac_gain_stereo(vol[0], vol[1]);
@@ -1451,24 +1437,30 @@
+}
+#endif
+
-+int snd_imx_mixer(struct snd_card_imx_codec *tsc2102)
++/* To be called by upper layer to add a tsc210x mixer to a given soundcard */
++int snd_imx_mixer(struct snd_card_imx_codec *tsc210x)
+{
+ int i, err;
+
-+ if (!tsc2102)
++ if (!tsc210x)
+ return -EINVAL;
+
++ /* TSC2102/TSC2101 common part */
+ for (i = 0; i < ARRAY_SIZE(tsc2102_control); i ++) {
-+ err = snd_ctl_add(tsc2102->card,
-+ snd_ctl_new1(&tsc2102_control[i],
-+ tsc2102->card));
++ err = snd_ctl_add(tsc210x->card,
++ snd_ctl_new1(&tsc2102_control[i],
++ tsc210x->card));
+
+ if (err < 0)
+ return err;
+ }
++
++ /* TSC2101 specific part */
++ /* TBDL */
++
+ return 0;
+}
+
+MODULE_AUTHOR("Andrzej Zaborowski, Eric Jarrige, Julien Boibessot");
-+MODULE_DESCRIPTION("Interface driver for TI TSC210x chips.");
++MODULE_DESCRIPTION("Mixer interface driver for TI TSC210x chips.");
+MODULE_LICENSE("GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-14 09:37:09
|
Revision: 1014
http://armadeus.svn.sourceforge.net/armadeus/?rev=1014&view=rev
Author: artemys
Date: 2009-01-14 09:37:05 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Remove old i.MXL SSI registers definition -> build is now broken
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-093-armadeus-add_ssi_registers_definition.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch 2009-01-14 09:32:35 UTC (rev 1013)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-030-armadeus-add_USB_registers.patch 2009-01-14 09:37:05 UTC (rev 1014)
@@ -20,7 +20,7 @@
#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
-@@ -591,4 +591,146 @@
+@@ -591,4 +591,132 @@
#define UTS_RXFULL (1<<3) /* RxFIFO full */
#define UTS_SOFTRST (1<<0) /* Software reset */
@@ -142,20 +142,6 @@
+#define USB_ENDIAN (1<<28) /* Endian of USB modules */
+#define USB_POWER (1<<0) /* Power mode of USB modules */
+
-+/*
-+ * SSI register
-+ */
-+#define SSI_STX __REG(IMX_SSI_BASE)
-+#define SSI_SRX __REG(IMX_SSI_BASE + 0x4)
-+#define SSI_SCSR __REG(IMX_SSI_BASE + 0x8)
-+#define SSI_STCR __REG(IMX_SSI_BASE + 0xC)
-+#define SSI_SRCR __REG(IMX_SSI_BASE + 0x10)
-+#define SSI_STCCR __REG(IMX_SSI_BASE + 0x14)
-+#define SSI_SRCCR __REG(IMX_SSI_BASE + 0x18)
-+#define SSI_STSR __REG(IMX_SSI_BASE + 0x1C)
-+#define SSI_SFCSR __REG(IMX_SSI_BASE + 0x20)
-+#define SSI_STR __REG(IMX_SSI_BASE + 0x24)
-+#define SSI_SOR __REG(IMX_SSI_BASE + 0x28)
+
+#define SPI1_RXDATA __REG(IMX_SPI1_BASE + 0x0)
+#define SPI1_TXDATA __REG(IMX_SPI1_BASE + 0x4)
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-093-armadeus-add_ssi_registers_definition.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-093-armadeus-add_ssi_registers_definition.patch 2009-01-14 09:32:35 UTC (rev 1013)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-093-armadeus-add_ssi_registers_definition.patch 2009-01-14 09:37:05 UTC (rev 1014)
@@ -14,93 +14,3 @@
#define CCR_DMOD_LINEAR ( 0x0 << 12 )
#define CCR_DMOD_2D ( 0x1 << 12 )
#define CCR_DMOD_FIFO ( 0x2 << 12 )
-@@ -609,21 +609,76 @@
- #define USB_ENDIAN (1<<28) /* Endian of USB modules */
- #define USB_POWER (1<<0) /* Power mode of USB modules */
-
--/*
-- * SSI register
-+/*
-+ * SSI registers
- */
--#define SSI_STX __REG(IMX_SSI_BASE)
--#define SSI_SRX __REG(IMX_SSI_BASE + 0x4)
--#define SSI_SCSR __REG(IMX_SSI_BASE + 0x8)
--#define SSI_STCR __REG(IMX_SSI_BASE + 0xC)
--#define SSI_SRCR __REG(IMX_SSI_BASE + 0x10)
--#define SSI_STCCR __REG(IMX_SSI_BASE + 0x14)
--#define SSI_SRCCR __REG(IMX_SSI_BASE + 0x18)
--#define SSI_STSR __REG(IMX_SSI_BASE + 0x1C)
--#define SSI_SFCSR __REG(IMX_SSI_BASE + 0x20)
--#define SSI_STR __REG(IMX_SSI_BASE + 0x24)
--#define SSI_SOR __REG(IMX_SSI_BASE + 0x28)
-+#define SSI_STX __REG(IMX_SSI_BASE) /* Transmit Data */
-+#define SSI_SRX __REG(IMX_SSI_BASE + 0x4) /* Receive Data */
-+#define SSI_SCSR __REG(IMX_SSI_BASE + 0x8) /* Control/Status */
-+#define SSI_STCR __REG(IMX_SSI_BASE + 0xC) /* Transmit Config */
-+#define SSI_SRCR __REG(IMX_SSI_BASE + 0x10) /* Receive Donfig */
-+#define SSI_STCCR __REG(IMX_SSI_BASE + 0x14) /* Transmit Clock Ctrl */
-+#define SSI_SRCCR __REG(IMX_SSI_BASE + 0x18) /* Receive Clock Ctrl */
-+#define SSI_STSR __REG(IMX_SSI_BASE + 0x1C) /* Time Slot */
-+#define SSI_SFCSR __REG(IMX_SSI_BASE + 0x20) /* FIFO Control/Status */
-+#define SSI_SOR __REG(IMX_SSI_BASE + 0x28) /* Option */
-+
-+/* SSI Control/Status Register bit fields */
-+#define SSI_SYS_CLK_EN (1<<15) /* System Clock Enable */
-+#define SSI_NORMAL_MODE (0x00<<13) /* Normal Mode Select */
-+#define SSI_I2S_MASTER_MODE (0x01<<13) /* I2S Master Select */
-+#define SSI_I2S_SLAVE_MODE (0x02<<13) /* I2S Slave Select */
-+#define SSI_SYN (1<<12) /* Synchronous Mode */
-+#define SSI_NET (1<<11) /* Network Mode */
-+#define SSI_RE (1<<10) /* Receive Enable */
-+#define SSI_TE (1<<9) /* Transmit Enable */
-+#define SSI_EN (1<<8) /* SSI Enable*/
-+#define SSI_RDR (1<<7) /* Receive Data Ready */
-+#define SSI_TDE (1<<6) /* Transmit Data Register Empty */
-+#define SSI_ROE (1<<5) /* Receive Overrun Error */
-+#define SSI_TUE (1<<4) /* Transmitter Underrun Error */
-+#define SSI_TFS (1<<3) /* Transmit Frame Sync */
-+#define SSI_RFS (1<<2) /* Receive Frame Sync */
-+#define SSI_RFF (1<<1) /* Receive FIFO Full */
-+#define SSI_TFE (1<<0) /* Transmit FIFO Empty */
-+
-+/* SSI Transmit/Receive Configuration Registers bit fields */
-+#define SSI_BIT0 (1<<10) /* Transmit/Receive Bit0 */
-+#define SSI_MAE (1<<9) /* Transmit/Receive DMA Enable */
-+#define SSI_IE (1<<8) /* Transmit/Receive Interrupt Enable */
-+#define SSI_FEN (1<<7) /* Transmit/Receive FIFO Enable */
-+#define SSI_FDIR (1<<6) /* Transmit/Receive Frame Direction */
-+#define SSI_DIR (1<<5) /* Transmit/Receive Direction */
-+#define SSI_SHFD (1<<4) /* Transmit/Receive Shift Direction */
-+#define SSI_SCKP (1<<3) /* Transmit/Receive Clock Polarity */
-+#define SSI_FSI (1<<2) /* Transmit/Receive Frame Sync Invert */
-+#define SSI_FSL (1<<1) /* Transmit/Receive Frame Sync Length */
-+#define SSI_EFS (1<<0) /* Transmit/Receive Early Frame Sync */
-+
-+/* SSI Transmit/Receive Clock Control Registers bit fields */
-+#define SSI_PSR (1<<15) /* Prescaler Range */
-+#define SSI_WL_8 (0x00<<13) /* Word Length = 8 bits */
-+#define SSI_WL_10 (0x01<<13) /* Word Length = 10 bits */
-+#define SSI_WL_12 (0x02<<13) /* Word Length = 12 bits */
-+#define SSI_WL_16 (0x03<<13) /* Word Length = 16 bits */
-+#define SSI_DC(x) ((x&0x1F)<<8) /* Frame Rate Divider Control */
-+#define SSI_PM(x) ((x&0xFF)<<0) /* Prescaler Modulus Select */
-+
-+/* SSI FIFO Control/Status Register bit fields */
-+#define SSI_RFCNT(x) ((x&0x0F)<<12) /* Receive FIFO Counter */
-+#define SSI_TFCNT(x) ((x&0x0F)<<8) /* Transmit FIFO Counter */
-+#define SSI_RFWM(x) ((x&0x0F)<<4) /* Receive FIFO Full Watermark */
-+#define SSI_TFWM(x) ((x&0x0F)<<0) /* Transmit FIFO Empty Watermark */
-+
-+/* SSI Option Register bit fields */
-+#define SSI_CLKOFF (1<<6) /* Clock Off */
-+#define SSI_RX_CLR (1<<5) /* Receiver Clear */
-+#define SSI_TX_CLR (1<<4) /* Transmitter Clear */
-+#define SSI_SYNRST (1<<0) /* Frame Sync Reset */
-
-+/*
-+ * SPI registers
-+ */
- #define SPI1_RXDATA __REG(IMX_SPI1_BASE + 0x0)
- #define SPI1_TXDATA __REG(IMX_SPI1_BASE + 0x4)
- #define SPI1_CONTROL __REG(IMX_SPI1_BASE + 0x8)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1013
http://armadeus.svn.sourceforge.net/armadeus/?rev=1013&view=rev
Author: artemys
Date: 2009-01-14 09:32:35 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Add SSI to i.MXL clock infrastructure
Added Paths:
-----------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-096-armadeus-clock-add_ssi_clk.patch
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-096-armadeus-clock-add_ssi_clk.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-096-armadeus-clock-add_ssi_clk.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-096-armadeus-clock-add_ssi_clk.patch 2009-01-14 09:32:35 UTC (rev 1013)
@@ -0,0 +1,22 @@
+--- linux-2.6.27.2.original/arch/arm/mach-imx/clock.c 2009-01-14 10:20:49.000000000 +0100
++++ linux-2.6.27.2/arch/arm/mach-imx/clock.c 2009-01-14 09:55:02.000000000 +0100
+@@ -151,6 +151,11 @@
+ .get_rate = imx_get_perclk3,
+ };
+
++static struct clk clk_ssi_clk = {
++ .name = "ssi_clk",
++ .get_rate = imx_get_perclk3,
++};
++
+ static struct clk clk_usb_clk = {
+ .name = "usb_clk",
+ .get_rate = imx_get_usb_clk,
+@@ -165,6 +170,7 @@
+ &clk_mcu_clk,
+ &clk_uart_clk,
+ &clk_usb_clk,
++ &clk_ssi_clk,
+ };
+
+ static LIST_HEAD(clocks);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1012
http://armadeus.svn.sourceforge.net/armadeus/?rev=1012&view=rev
Author: artemys
Date: 2009-01-14 08:07:18 +0000 (Wed, 14 Jan 2009)
Log Message:
-----------
[TSC BRANCH] [LINUX] Makes imx-ssi looks more like i.MX27 mxc-ssi
Modified Paths:
--------------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
Modified: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch 2009-01-13 16:46:04 UTC (rev 1011)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch 2009-01-14 08:07:18 UTC (rev 1012)
@@ -3,7 +3,7 @@
(Take a look at armadeus/target/linux/ directory to know how to generate it)
--- linux-2.6.27.2.original/sound/arm/imx-ssi.c
+++ linux-2.6.27.2.mod/sound/arm/imx-ssi.c
-@@ -0,0 +1,504 @@
+@@ -0,0 +1,514 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Juergen Beisert, ke...@pe...
@@ -130,19 +130,25 @@
+
+int imx_ssi_setup_unit_to_iis_slave(int id)
+{
-+// BUG_ON(unit[id].io == NULL);
++ u32 scsr;
+
+ pr_debug("%s called for unit %d\n", __func__, id);
++ BUG_ON(unit[id].io == NULL); /* (only one on i.MXL/1) */
+
-+ /* disable this unit (only one on i.MXL/1) */
-+ SSI_SCSR &= ~SSI_EN;
++ /* choose mode */
++ scsr = SSI_SCSR_I2S_MODE_SLAVE | SSI_SCSR_SYN;
+
++ /* disable this unit */
++ set_reg(scsr, SSI_SCSR, id);
++// SSI_SCSR &= ~SSI_SCSR_EN;
++
+ /* Transmit config */
-+ SSI_STCR = SSI_MAE | /* Activate DMA */
-+ SSI_FEN | /* FIFO enabled */
-+ SSI_SCKP | /* send @falling edge */
-+ SSI_FSI | /* Frame sync active low */
-+ SSI_EFS; /* one bit shift */
++ set_reg(SSI_MAE | /* Activate DMA */
++ SSI_FEN | /* FIFO enabled */
++ SSI_SCKP | /* send @falling edge */
++ SSI_FSI | /* Frame sync active low */
++ SSI_EFS, /* one bit shift */
++ SSI_STCR, id);
+
+// set_reg(SSI_STCR_TFEN0 | /* FIFO 0 enabled */
+// SSI_STCR_TXBIT0 | /* MSB first, data bits 0...15 are valid */
@@ -170,23 +176,22 @@
+ * words (left/right) there
+ */
+ /* SSI FIFO watermark */
-+ SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
-+// set_reg(SSI_SFCSR_RFWM0(DMA_RXFIFO_BURST) |
-+// SSI_SFCSR_TFWM0(DMA_TXFIFO_BURST), SSI_SFCSR, id);
++// SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
++ set_reg(SSI_SFCSR_RFWM(8) | SSI_SFCSR_TFWM(TRANSMIT_WM_LEVEL), SSI_SFCSR, id);
+
+ /*
+ * We want to provide I2S. This means we always need two words per
+ * sample signal. In this case 16 bit per word, 32 bit per sample.
+ * PMIC sends always 4 words (=2 samples) per sync!
+ */
-+ SSI_STCCR = SSI_WL_16 | SSI_DC(0);
-+// set_reg(SSI_STCCR_WL(16) | SSI_STCCR_DC(1), SSI_STCCR, id);
-+ SSI_SRCCR = SSI_WL_16 | SSI_DC(0);
-+// set_reg(SSI_SRCCR_WL(16) | SSI_SRCCR_DC(3), SSI_SRCCR, id);
++// SSI_STCCR = SSI_WL_16 | SSI_DC(0);
++ set_reg(SSI_WL_16 | SSI_DC(0), SSI_STCCR, id);
++// SSI_SRCCR = SSI_WL_16 | SSI_DC(0);
++ set_reg(SSI_WL_16 | SSI_DC(0), SSI_SRCCR, id);
+
+ /* enable the unit */
-+ SSI_SCSR = SSI_I2S_SLAVE_MODE | SSI_SYN | SSI_EN;
-+// set_reg(scr | SSI_SCR_SSIEN, SSI_SCR, id);
++// SSI_SCSR = SSI_SCSR_I2S_MODE_SLAVE | SSI_SCSR_SYN | SSI_SCSR_EN;
++ set_reg(scsr | SSI_SCSR_EN, SSI_SCSR, id);
+
+ return 0;
+}
@@ -194,21 +199,26 @@
+
+int imx_ssi_setup_unit_to_iis_master(int id)
+{
-+ BUG_ON(unit[id].io == NULL);
++ u32 scsr;
+
+ pr_debug("%s called for unit %d\n", __func__, id);
++ BUG_ON(unit[id].io == NULL); /* (only one on i.MXL/1) */
+
-+ /* disable this unit (only one on i.MXL/1) */
-+ SSI_SCSR &= ~SSI_EN;
++ /* choose mode */
++ scsr = SSI_SCSR_I2S_MODE_MSTR | SSI_SCSR_SYN;
+
++ /* disable this unit */
++ set_reg(scsr, SSI_SCSR, id);
++
+ /* Transmit config */
-+ SSI_STCR = SSI_MAE | /* Activate DMA */
-+ SSI_FEN | /* FIFO enabled */
-+ SSI_FDIR | /* Frame sync internally generated */
-+ SSI_DIR | /* Clock internally generated */
-+ SSI_SCKP | /* send @falling edge */
-+ SSI_FSI | /* Frame sync active low */
-+ SSI_EFS; /* one bit shift */
++ set_reg(SSI_MAE | /* Activate DMA */
++ SSI_FEN | /* FIFO enabled */
++ SSI_FDIR | /* Frame sync internally generated */
++ SSI_DIR | /* Clock internally generated */
++ SSI_SCKP | /* send @falling edge */
++ SSI_FSI | /* Frame sync active low */
++ SSI_EFS, /* one bit shift */
++ SSI_STCR, id);
+
+ /*
+ * Watermark settings:
@@ -222,18 +232,18 @@
+ * words (left/right) there
+ */
+ /* SSI FIFO watermark */
-+ SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
++ set_reg(SSI_SFCSR_RFWM(8) | SSI_SFCSR_TFWM(TRANSMIT_WM_LEVEL), SSI_SFCSR, id);
+
+ /*
+ * We want to provide I2S. This means we always need two words per
+ * sample signal. In this case 16 bit per word, 32 bit per sample.
+ * PMIC sends always 4 words (=2 samples) per sync!
+ */
-+ SSI_STCCR = 0x00006103;
-+ SSI_SRCCR = 0x00006103;
++// SSI_STCCR = 0x00006103;
++// SSI_SRCCR = 0x00006103;
+
+ /* enable the unit */
-+ SSI_SCSR = /*SSI_SYS_CLK_EN |*/ SSI_I2S_MASTER_MODE | SSI_SYN | /*SSI_TE |*/ SSI_EN;
++// SSI_SCSR = /*SSI_SYS_CLK_EN |*/ SSI_SCSR_I2S_MODE_MSTR | SSI_SCSR_SYN | /*SSI_TE |*/ SSI_SCSR_EN;
+
+ return 0;
+}
@@ -327,15 +337,15 @@
+int imx_ssi_prepare(struct snd_pcm_substream *substream,
+ int ssi_id)
+{
-+ SSI_SCSR |= SSI_EN;
-+// set_reg_bits(SSI_SCR_SSIEN, SSI_SCR_SSIEN, SSI_SCR, ssi_id);
++// SSI_SCSR |= SSI_SCSR_EN;
++ set_reg_bits(SSI_SCSR_EN, SSI_SCSR_EN, SSI_SCSR, ssi_id);
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ SSI_STCR |= SSI_MAE;
-+/* set_reg_bits(SSI_SIER_TDMAE, SSI_SIER_TDMAE, SSI_SIER, ssi_id);*/
++// SSI_STCR |= SSI_MAE;
++ set_reg_bits(SSI_MAE, SSI_MAE, SSI_STCR, ssi_id);
+ else
-+ SSI_SRCR |= SSI_MAE;
-+// set_reg_bits(SSI_SIER_RDMAE, SSI_SIER_RDMAE, SSI_SIER, ssi_id);
++// SSI_SRCR |= SSI_MAE;
++ set_reg_bits(SSI_MAE, SSI_MAE, SSI_SRCR, ssi_id);
+
+ return 0;
+}
@@ -343,14 +353,14 @@
+void imx_ssi_shutdown(struct snd_pcm_substream *substream,
+ int ssi_id)
+{
-+ SSI_SCSR &= ~SSI_EN;
-+// set_reg_bits(SSI_SCR_SSIEN, 0, SSI_SCR, ssi_id);
++// SSI_SCSR &= ~SSI_SCSR_EN;
++ set_reg_bits(SSI_SCSR_EN, 0, SSI_SCSR, ssi_id);
+
+}
+
+int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd, int ssi_id)
+{
-+// u32 scr = get_reg(SSI_SCR, ssi_id);
++ u32 scsr = get_reg(SSI_SCSR, ssi_id);
+ u32 temp;
+
+ pr_debug("%s called\n", __func__);
@@ -358,30 +368,30 @@
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ /* clear SSI underrun (needed ??) */
-+ temp = SSI_SCSR;
-+ SSI_STX = 0x0000;
++ temp = get_reg(SSI_SCSR, ssi_id);
++ set_reg(0x0000, SSI_STX, ssi_id);
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ SSI_SCSR |= SSI_TE;
++ scsr |= SSI_SCSR_TE;
+ else
-+ SSI_SCSR |= SSI_RE;
++ scsr |= SSI_SCSR_RE;
+ break;
+
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-+ SSI_SCSR &= ~SSI_TE;
++ scsr &= ~SSI_SCSR_TE;
+ else
-+ SSI_SCSR &= ~SSI_RE;
++ scsr &= ~SSI_SCSR_RE;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
-+// set_reg(scr, SSI_SCR, ssi_id);
++ set_reg(scsr, SSI_SCSR, ssi_id);
+
+ return 0;
+}
@@ -554,3 +564,113 @@
+#define DMA_RXFIFO_BURST 0x4
+
+#endif /* __SOUND_ARM_IMX_SSI_H */
+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.2.original/arch/arm/mach-imx/include/mach/imx_ssi.h
++++ linux-2.6.27.2.mod/arch/arm/mach-imx/include/mach/imx_ssi.h
+@@ -0,0 +1,104 @@
++/*
++ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2008 Juergen Beisert, ke...@pe...
++ * Copyright 2009 Armadeus systems, <jul...@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.
++ */
++
++#ifndef __ASM_ARCH_IMX_SSI_H
++#define __ASM_ARCH_IMX_SSI_H
++
++#include <linux/platform_device.h>
++
++struct imx_ssi_platform_data {
++ int (*init)(struct platform_device *pdev);
++ int (*exit)(struct platform_device *pdev);
++};
++
++/* Transmit Data Register */
++#define SSI_STX 0x00
++
++/* Receive Data Register */
++#define SSI_SRX 0x04
++
++/* Control/Status Register */
++#define SSI_SCSR 0x08
++# define SSI_SCSR_SYS_CLK_EN (1<<15) /* System Clock Enable */
++# define SSI_SCSR_I2S_MODE_NORM (0x00<<13) /* Normal Mode Select */
++# define SSI_SCSR_I2S_MODE_MSTR (0x01<<13) /* I2S Master Select */
++# define SSI_SCSR_I2S_MODE_SLAVE (0x02<<13) /* I2S Slave Select */
++# define SSI_SCSR_SYN (1<<12) /* Synchronous Mode */
++# define SSI_SCSR_NET (1<<11) /* Network Mode */
++# define SSI_SCSR_RE (1<<10) /* Receive Enable */
++# define SSI_SCSR_TE (1<<9) /* Transmit Enable */
++# define SSI_SCSR_EN (1<<8) /* SSI Enable*/
++# define SSI_SCSR_RDR (1<<7) /* Receive Data Ready */
++# define SSI_SCSR_TDE (1<<6) /* Transmit Data Reg. Empty */
++# define SSI_SCSR_ROE (1<<5) /* Receive Overrun Error */
++# define SSI_SCSR_TUE (1<<4) /* Transmitter Underrun Error */
++# define SSI_SCSR_TFS (1<<3) /* Transmit Frame Sync */
++# define SSI_SCSR_RFS (1<<2) /* Receive Frame Sync */
++# define SSI_SCSR_RFF (1<<1) /* Receive FIFO Full */
++# define SSI_SCSR_TFE (1<<0) /* Transmit FIFO Empty */
++# define SSI_SCSR_I2S_MODE_SHIFT 13
++
++/* Transmit Configuration Register */
++#define SSI_STCR 0x0c
++/* Receive Configuration Register */
++#define SSI_SRCR 0x10
++/* STCR & SRCR have the same bit fields */
++# define SSI_BIT0 (1<<10) /* Transmit/Receive Bit0 */
++# define SSI_MAE (1<<9) /* Transmit/Receive DMA Enable */
++# define SSI_IE (1<<8) /* Transmit/Receive Interrupt Enable */
++# define SSI_FEN (1<<7) /* Transmit/Receive FIFO Enable */
++# define SSI_FDIR (1<<6) /* Transmit/Receive Frame Direction */
++# define SSI_DIR (1<<5) /* Transmit/Receive Direction */
++# define SSI_SHFD (1<<4) /* Transmit/Receive Shift Direction */
++# define SSI_SCKP (1<<3) /* Transmit/Receive Clock Polarity */
++# define SSI_FSI (1<<2) /* Transmit/Receive Frame Sync Invert */
++# define SSI_FSL (1<<1) /* Transmit/Receive Frame Sync Length */
++# define SSI_EFS (1<<0) /* Transmit/Receive Early Frame Sync */
++
++/* Transmit Clock Control Register */
++#define SSI_STCCR 0x14
++/* Receive Clock Control Register */
++#define SSI_SRCCR 0x18
++/* STCCR & SRCCR have the same bit fields */
++# define SSI_PSR (1 << 15) /* Prescaler Range */
++# define SSI_WL_8 (0x00 << 13) /* Word Length = 8 bits */
++# define SSI_WL_10 (0x01 << 13) /* Word Length = 10 bits */
++# define SSI_WL_12 (0x02 << 13) /* Word Length = 12 bits */
++# define SSI_WL_16 (0x03 << 13) /* Word Length = 16 bits */
++# define SSI_DC(x) (((x) & 0x1f) << 8) /* Frame Rate Divider Control */
++# define SSI_PM(x) (((x) & 0xff) << 0) /* Prescaler Modulus Select */
++
++/* Time Slot Register */
++#define SSI_STSR 0x1c
++
++/* FIFO Control/Status Register */
++#define SSI_SFCSR 0x20
++# define SSI_SFCSR_RFCNT(x) (((x) & 0x0f) << 12) /* Receive FIFO Counter */
++# define SSI_SFCSR_TFCNT(x) (((x) & 0x0f) << 8) /* Transmit FIFO Counter */
++# define SSI_SFCSR_RFWM(x) (((x) & 0x0f) << 4) /* RX FIFO Full Watermark */
++# define SSI_SFCSR_TFWM(x) (((x) & 0x0f) << 0) /* TX FIFO Empty Watermark */
++
++/* Option Register */
++#define SSI_SOR 0x28
++# define SSI_SOR_CLKOFF (1<<6) /* Clock Off */
++# define SSI_SOR_RX_CLR (1<<5) /* Receiver Clear */
++# define SSI_SOR_TX_CLR (1<<4) /* Transmitter Clear */
++# define SSI_SOR_SYNRST (1<<0) /* Frame Sync Reset */
++
++#endif /* __ASM_ARCH_IMX_SSI_H */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1011
http://armadeus.svn.sourceforge.net/armadeus/?rev=1011&view=rev
Author: artemys
Date: 2009-01-13 16:46:04 +0000 (Tue, 13 Jan 2009)
Log Message:
-----------
[BRANCH] [LINUX]: add imx-ssi driver (to be improved later)
Added Paths:
-----------
branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
Added: branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch
===================================================================
--- branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch (rev 0)
+++ branches/tsc210x/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-095-armadeus-imx-ssi-add_driver.patch 2009-01-13 16:46:04 UTC (rev 1011)
@@ -0,0 +1,556 @@
+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.2.original/sound/arm/imx-ssi.c
++++ linux-2.6.27.2.mod/sound/arm/imx-ssi.c
+@@ -0,0 +1,504 @@
++/*
++ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2008 Juergen Beisert, ke...@pe...
++ *
++ * 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.
++ *
++ * Note: This implementation was done very close the external PMIC MC13783.
++ * The MC13783 seems like a regular I2S device, but it isn't. It does various
++ * things in a very special way. But also this SSI unit does some things in
++ * very special way. And the datasheet keeps silent.
++ */
++#define DEBUG
++
++#include <linux/platform_device.h>
++#include <linux/interrupt.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <sound/pcm.h>
++#include <mach/imx_ssi.h>
++#include "imx-ssi.h"
++
++#define DRV_NAME "imx-ssi"
++
++struct ssi_private {
++ void __iomem *io;
++ struct platform_device *pdev;
++ struct clk *clk;
++};
++
++/* global data for all SSI units */
++static struct ssi_private unit[2];
++
++static void set_reg_bits(unsigned int mask, unsigned int data,
++ unsigned int offset, unsigned int id)
++{
++ u32 reg;
++
++ reg = readl(unit[id].io + offset);
++ reg = (reg & ~mask) | data;
++ writel(reg, unit[id].io + offset);
++}
++
++
++static unsigned long get_reg(unsigned int offset, unsigned int id)
++{
++ return readl(unit[id].io + offset);
++}
++
++static void set_reg(unsigned int data, int offset, unsigned int id)
++{
++ writel(data, unit[id].io + offset);
++}
++
++#ifdef DEBUG
++static void dump_ssi_registers(void)
++{
++ printk("SSI_STX: 0x%x\n", SSI_STX);
++ printk("SSI_SRX: 0x%x\n", SSI_SRX);
++ printk("SSI_SCSR: 0x%x\n", SSI_SCSR);
++ printk("SSI_STCR: 0x%x\n", SSI_STCR);
++ printk("SSI_SRCR: 0x%x\n", SSI_SRCR);
++ printk("SSI_STCCR: 0x%x\n", SSI_STCCR);
++ printk("SSI_SRCCR: 0x%x\n", SSI_SRCCR);
++ printk("SSI_STSR: 0x%x\n", SSI_STSR);
++ printk("SSI_SFCSR: 0x%x\n", SSI_SFCSR);
++// printk("SSI_STR: 0x%x\n", SSI_STR);
++ printk("SSI_SOR: 0x%x\n", SSI_SOR);
++}
++#endif
++
++/*
++ * Setup an SSI channel to I2S slave mode.
++ *****************
++ * Note: This setup is for an external MC13783! I guess it will not work
++ * with any other I2S device!
++ *****************
++ *
++ * What we want:
++ * FS: __################________________##
++ * TX: ..FEDCBA9876543210FEDCBA9876543210..
++ * rigth left
++ * This seems to work only with i2s master mode. Not slave.
++ *
++ * Do not use the i2s slave mode! Its useless, as it only transfers one word
++ * per sync. All other bits to define more than one word will be ignored.
++ * Same with "normal mode" without network. No chance to get it work with an
++ * external standard i2s device.
++ *
++ * Only "normal mode" plus "network mode" will work like an i2s bus.
++ *
++ * In normal + network mode DC determines "Words Per Frame":
++ * WS=16 DC=2
++ * FS: __#_______________________________#_
++ * TX: ..FEDCBA9876543210FEDCBA9876543210..
++ * | rigth || left |
++ *
++ * From the datasheet:
++ * If STFS is configured as input, the external device should drive STFS
++ * during rising edge of STCK or SRCK.
++ *
++ * The external device must provide:
++ * - high active FS for one bit
++ * - new data in falling edge, stable at rising edge
++ *
++ * The receive side. PMIC sends (depends on its setup!):
++ * WS=16 DC=4
++ * FS: __#______________________________________________________________#
++ * TX: ..FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210FEDCBA9876543210..
++ * --| rigth || left |--------------------------------
++ *
++ */
++#define TRANSMIT_WM_LEVEL 8 /* (in free places) */
++
++int imx_ssi_setup_unit_to_iis_slave(int id)
++{
++// BUG_ON(unit[id].io == NULL);
++
++ pr_debug("%s called for unit %d\n", __func__, id);
++
++ /* disable this unit (only one on i.MXL/1) */
++ SSI_SCSR &= ~SSI_EN;
++
++ /* Transmit config */
++ SSI_STCR = SSI_MAE | /* Activate DMA */
++ SSI_FEN | /* FIFO enabled */
++ SSI_SCKP | /* send @falling edge */
++ SSI_FSI | /* Frame sync active low */
++ SSI_EFS; /* one bit shift */
++
++// set_reg(SSI_STCR_TFEN0 | /* FIFO 0 enabled */
++// SSI_STCR_TXBIT0 | /* MSB first, data bits 0...15 are valid */
++// SSI_STCR_TSCKP | /* send @falling edge */
++// SSI_STCR_TFSL | /* one-bit-long-frame */
++// SSI_STCR_TEFS, /* shift */
++// SSI_STCR, id);
++//
++// set_reg(SSI_SRCR_RFEN0 | /* FIFO 0 enabled */
++// SSI_SRCR_RXBIT0 |
++// SSI_SRCR_RSCKP | /* capture @rising edge */
++// SSI_SRCR_RFSL | /* one-bit-long-frame */
++// SSI_SRCR_REFS,
++// SSI_SRCR, id);
++
++ /*
++ * Watermark settings:
++ * TX FIFO: Set to 6. This means the request is active if more than
++ * five FIFO slots are empty. For this case the DMA burst length
++ * can be up to six words (three samples = six slots)
++ * RX FIFO: Set to 4. This means the request is active when 4 or more
++ * slots are in the FIFO.
++ *
++ * Note: A word is 8, 16 or 24 bit, a sample is of two
++ * words (left/right) there
++ */
++ /* SSI FIFO watermark */
++ SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
++// set_reg(SSI_SFCSR_RFWM0(DMA_RXFIFO_BURST) |
++// SSI_SFCSR_TFWM0(DMA_TXFIFO_BURST), SSI_SFCSR, id);
++
++ /*
++ * We want to provide I2S. This means we always need two words per
++ * sample signal. In this case 16 bit per word, 32 bit per sample.
++ * PMIC sends always 4 words (=2 samples) per sync!
++ */
++ SSI_STCCR = SSI_WL_16 | SSI_DC(0);
++// set_reg(SSI_STCCR_WL(16) | SSI_STCCR_DC(1), SSI_STCCR, id);
++ SSI_SRCCR = SSI_WL_16 | SSI_DC(0);
++// set_reg(SSI_SRCCR_WL(16) | SSI_SRCCR_DC(3), SSI_SRCCR, id);
++
++ /* enable the unit */
++ SSI_SCSR = SSI_I2S_SLAVE_MODE | SSI_SYN | SSI_EN;
++// set_reg(scr | SSI_SCR_SSIEN, SSI_SCR, id);
++
++ return 0;
++}
++EXPORT_SYMBOL(imx_ssi_setup_unit_to_iis_slave);
++
++int imx_ssi_setup_unit_to_iis_master(int id)
++{
++ BUG_ON(unit[id].io == NULL);
++
++ pr_debug("%s called for unit %d\n", __func__, id);
++
++ /* disable this unit (only one on i.MXL/1) */
++ SSI_SCSR &= ~SSI_EN;
++
++ /* Transmit config */
++ SSI_STCR = SSI_MAE | /* Activate DMA */
++ SSI_FEN | /* FIFO enabled */
++ SSI_FDIR | /* Frame sync internally generated */
++ SSI_DIR | /* Clock internally generated */
++ SSI_SCKP | /* send @falling edge */
++ SSI_FSI | /* Frame sync active low */
++ SSI_EFS; /* one bit shift */
++
++ /*
++ * Watermark settings:
++ * TX FIFO: Set to 6. This means the request is active if more than
++ * five FIFO slots are empty. For this case the DMA burst length
++ * can be up to six words (three samples = six slots)
++ * RX FIFO: Set to 4. This means the request is active when 4 or more
++ * slots are in the FIFO.
++ *
++ * Note: A word is 8, 16 or 24 bit, a sample is of two
++ * words (left/right) there
++ */
++ /* SSI FIFO watermark */
++ SSI_SFCSR = SSI_RFWM(8) | SSI_TFWM(TRANSMIT_WM_LEVEL);
++
++ /*
++ * We want to provide I2S. This means we always need two words per
++ * sample signal. In this case 16 bit per word, 32 bit per sample.
++ * PMIC sends always 4 words (=2 samples) per sync!
++ */
++ SSI_STCCR = 0x00006103;
++ SSI_SRCCR = 0x00006103;
++
++ /* enable the unit */
++ SSI_SCSR = /*SSI_SYS_CLK_EN |*/ SSI_I2S_MASTER_MODE | SSI_SYN | /*SSI_TE |*/ SSI_EN;
++
++ return 0;
++}
++
++/* id: SSI unit, fifo: FIFO 0 or 1 of this unit */
++int imx_ssi_get_dma_tx_channel(int id, int fifo)
++{
++ struct resource *res;
++
++ BUG_ON(unit[id].io == NULL);
++
++ if (fifo < 0 || fifo > 1) /* FIXME maybe i.MX27 specific */
++ return -ENODEV;
++
++ res = platform_get_resource_byname(unit[id].pdev,
++ IORESOURCE_DMA, fifo ? "tx1" : "tx0");
++
++ if (!res)
++ return -1;
++
++ return res->start;
++}
++EXPORT_SYMBOL(imx_ssi_get_dma_tx_channel);
++
++/* return physical address of the FIFO register */
++void __iomem *imx_ssi_get_dma_tx_address(int id, int fifo)
++{
++ struct resource *res;
++ void __iomem *adr;
++
++ pr_debug("%s\n", __func__);
++ BUG_ON(unit[id].io == NULL);
++
++ if (fifo < 0 || fifo > 1) /* FIXME imx27 specific */
++ return NULL;
++
++ res = platform_get_resource(unit[id].pdev, IORESOURCE_MEM, 0);
++
++ if (!res)
++ return NULL;
++
++ adr = (void __iomem *)res->start /*+ (fifo ? SSI_STX1 : SSI_STX0)*/;
++
++ return adr;
++}
++EXPORT_SYMBOL(imx_ssi_get_dma_tx_address);
++
++/* id: SSI unit, fifo: FIFO 0 or 1 of this unit */
++int imx_ssi_get_dma_rx_channel(int id, int fifo)
++{
++ struct resource *res;
++
++ BUG_ON(unit[id].io == NULL);
++
++ if (fifo < 0 || fifo > 1) /* FIXME imx27 specific */
++ return -ENODEV;
++
++ res = platform_get_resource_byname(unit[id].pdev,
++ IORESOURCE_DMA, fifo ? "rx1" : "rx0");
++
++ if (!res)
++ return -1;
++
++ return res->start;
++}
++EXPORT_SYMBOL(imx_ssi_get_dma_rx_channel);
++
++/* return physical address of the FIFO register */
++void __iomem *imx_ssi_get_dma_rx_address(int id, int fifo)
++{
++ struct resource *res;
++ void __iomem *adr;
++
++ pr_debug("%s\n", __func__);
++ BUG_ON(unit[id].io == NULL);
++
++ if (fifo < 0 || fifo > 1) /* FIXME imx27 specific */
++ return NULL;
++
++ res = platform_get_resource(unit[id].pdev, IORESOURCE_MEM, 0);
++
++ if (!res)
++ return NULL;
++
++ adr = (void __iomem *)res->start /*+ (fifo ? SSI_SRX1 : SSI_SRX0)*/;
++
++ return adr;
++}
++EXPORT_SYMBOL(imx_ssi_get_dma_rx_address);
++
++int imx_ssi_prepare(struct snd_pcm_substream *substream,
++ int ssi_id)
++{
++ SSI_SCSR |= SSI_EN;
++// set_reg_bits(SSI_SCR_SSIEN, SSI_SCR_SSIEN, SSI_SCR, ssi_id);
++
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ SSI_STCR |= SSI_MAE;
++/* set_reg_bits(SSI_SIER_TDMAE, SSI_SIER_TDMAE, SSI_SIER, ssi_id);*/
++ else
++ SSI_SRCR |= SSI_MAE;
++// set_reg_bits(SSI_SIER_RDMAE, SSI_SIER_RDMAE, SSI_SIER, ssi_id);
++
++ return 0;
++}
++
++void imx_ssi_shutdown(struct snd_pcm_substream *substream,
++ int ssi_id)
++{
++ SSI_SCSR &= ~SSI_EN;
++// set_reg_bits(SSI_SCR_SSIEN, 0, SSI_SCR, ssi_id);
++
++}
++
++int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd, int ssi_id)
++{
++// u32 scr = get_reg(SSI_SCR, ssi_id);
++ u32 temp;
++
++ pr_debug("%s called\n", __func__);
++
++ switch (cmd) {
++ case SNDRV_PCM_TRIGGER_START:
++ /* clear SSI underrun (needed ??) */
++ temp = SSI_SCSR;
++ SSI_STX = 0x0000;
++ case SNDRV_PCM_TRIGGER_RESUME:
++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ SSI_SCSR |= SSI_TE;
++ else
++ SSI_SCSR |= SSI_RE;
++ break;
++
++ case SNDRV_PCM_TRIGGER_STOP:
++ case SNDRV_PCM_TRIGGER_SUSPEND:
++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
++ SSI_SCSR &= ~SSI_TE;
++ else
++ SSI_SCSR &= ~SSI_RE;
++ break;
++
++ default:
++ return -EINVAL;
++ }
++
++// set_reg(scr, SSI_SCR, ssi_id);
++
++ return 0;
++}
++EXPORT_SYMBOL(imx_ssi_trigger);
++
++static int __devinit imx_ssi_probe(struct platform_device *pdev)
++{
++ struct imx_ssi_platform_data *pdata;
++ struct resource *res;
++ int ret, id;
++
++ pdata = pdev->dev.platform_data;
++
++ id = pdev->id;
++ pr_info("Probing i.MX SSI unit %d\n", id);
++
++ if (unit[id].io != NULL)
++ return -EBUSY;
++
++ unit[id].pdev = pdev;
++
++ /* FIXME do it later, when someone wants to play a sound */
++ if (pdata->init)
++ pdata->init(pdev);
++
++ unit[id].clk = clk_get(&pdev->dev, "ssi_clk");
++ if (unit[id].clk == NULL) {
++ dev_err(&pdev->dev, "Cannot get the clock for IMX SSI unit %d\n",
++ pdev->id);
++ ret = -ENODEV;
++ goto err1;
++ }
++ /* FIXME do it later, when someone wants to play a sound */
++ ret = clk_enable(unit[id].clk);
++ if (ret != 0) {
++ dev_err(&pdev->dev, "Cannot enable the clock for IMX SSI unit %d\n",
++ pdev->id);
++ ret = -ENODEV;
++ goto err2;
++ }
++
++ /* external clock (if used) should never be greater than 1/4 ipg_clk! */
++ pr_debug("Main clock for SSI is: %luHz\n", clk_get_rate(unit[id].clk));
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ ret = -ENODEV;
++ goto err2;
++ }
++
++ if (!request_mem_region(res->start, res->end - res->start + 1, DRV_NAME)) {
++ dev_err(&pdev->dev, "request_mem_region failed for IMX SSI %d\n",
++ pdev->id);
++ ret = -EBUSY;
++ goto err2;
++ }
++ unit[id].io = ioremap(res->start, res->end - res->start + 1);
++ if (unit[id].io == NULL) {
++ dev_err(&pdev->dev, "Mapping region failed for IMX SSI %d\n",
++ pdev->id);
++ ret = -ENODEV;
++ goto err3;
++ }
++
++ return 0;
++
++err3:
++ release_mem_region(res->start, res->end - res->start + 1);
++ clk_disable(unit[id].clk);
++err2:
++ clk_put(unit[id].clk);
++err1:
++ if (pdata->exit)
++ (pdata->exit)(pdev);
++ return ret;
++}
++
++static int __devexit imx_ssi_remove(struct platform_device *pdev)
++{
++ struct imx_ssi_platform_data *pdata = pdev->dev.platform_data;
++ struct resource *res;
++ int id;
++
++ id = pdev->id;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ clk_disable(unit[id].clk);
++ clk_put(unit[id].clk);
++ if (pdata->exit)
++ pdata->exit(pdev);
++ release_mem_region(res->start, res->end - res->start + 1);
++ iounmap(unit[id].io);
++ unit[id].io = NULL;
++
++ return 0;
++}
++
++static struct platform_driver imx_ssi_driver = {
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++ .probe = imx_ssi_probe,
++ .remove = __devexit_p(imx_ssi_remove),
++#ifdef CONFIG_PM
++ .suspend = NULL, /* TODO imx_ssi_suspend */
++ .resume = NULL /* TODO imx_ssi_resume */
++#endif
++};
++
++int __init imx_ssi_init(void)
++{
++ return platform_driver_register(&imx_ssi_driver);
++}
++
++void __exit imx_ssi_exit(void)
++{
++ platform_driver_unregister(&imx_ssi_driver);
++}
++
++module_init(imx_ssi_init);
++module_exit(imx_ssi_exit);
++
++MODULE_AUTHOR("Julien Boibessot, <jul...@ar...>");
++MODULE_DESCRIPTION("i.MX SSI Driver");
++MODULE_LICENSE("GPL");
+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.2.original/sound/arm/imx-ssi.h
++++ linux-2.6.27.2.mod/sound/arm/imx-ssi.h
+@@ -0,0 +1,40 @@
++/*
++ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2008 Juergen Beisert, ke...@pe...
++ *
++ * 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.
++ */
++
++#ifndef __SOUND_ARM_IMX_SSI_H
++#define __SOUND_ARM_IMX_SSI_H
++
++int imx_ssi_prepare(struct snd_pcm_substream *substream, int ssi_id);
++void imx_ssi_shutdown(struct snd_pcm_substream *substream, int ssi_id);
++extern int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd, int ssi_id);
++
++extern int imx_ssi_get_dma_tx_channel(int, int);
++extern int imx_ssi_get_dma_rx_channel(int, int);
++extern void __iomem *imx_ssi_get_dma_tx_address(int, int);
++extern void __iomem *imx_ssi_get_dma_rx_address(int, int);
++extern int imx_ssi_setup_unit_to_iis_slave(int);
++
++/* to handle it like a module */
++extern int imx_ssi_init(void);
++extern void imx_ssi_exit(void);
++
++/* possible DMA bursts in FIFO entries */
++#define DMA_TXFIFO_BURST 0x6
++#define DMA_RXFIFO_BURST 0x4
++
++#endif /* __SOUND_ARM_IMX_SSI_H */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <th...@us...> - 2009-01-12 17:35:59
|
Revision: 1010
http://armadeus.svn.sourceforge.net/armadeus/?rev=1010&view=rev
Author: thom25
Date: 2009-01-12 17:35:51 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
[BOOTLOADER] Add 32Mo support
Modified Paths:
--------------
branches/tsc210x/software/uboot_recover/bootloader.py
Modified: branches/tsc210x/software/uboot_recover/bootloader.py
===================================================================
--- branches/tsc210x/software/uboot_recover/bootloader.py 2009-01-12 13:08:36 UTC (rev 1009)
+++ branches/tsc210x/software/uboot_recover/bootloader.py 2009-01-12 17:35:51 UTC (rev 1010)
@@ -70,6 +70,21 @@
self.put("221000","B10A9267","l")
self.get("8023000", "4","b")
self.put("221000","810A9267","l")
+ elif self.ramSize == 32:
+ self.put("221000","911A9267","l")
+ self.get("8400000", "4","b")
+ self.put("221000","A11A9267","l")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.get("8000000", "4","b")
+ self.put("221000","B11A9267","l")
+ self.get("8446000", "4","b")
+ self.put("221000","811A9267","l")
else:
print "Warning ramSize %d not supported" % self.ramSize
#--------------------------------------------------------------
@@ -155,7 +170,7 @@
self.put("00220004", "00000D01", "l") # Configure CS0 as 16bits wide bus
self.put("10000000", "0060", "w") # Clear block lock bit
self.put("10000000", "00D0", "w") # Clear block lock bit
-
+ self.waitFlashReady()
self.eraseFlashBlock("10000000")
self.eraseFlashBlock("10020000")
if eraseAll == 'y':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-01-12 13:08:47
|
Revision: 1009
http://armadeus.svn.sourceforge.net/armadeus/?rev=1009&view=rev
Author: jorasse
Date: 2009-01-12 13:08:36 +0000 (Mon, 12 Jan 2009)
Log Message:
-----------
[UBOOT] Fixed relocation status & some compilation warnings
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf9328/apf9328.h
trunk/buildroot/target/u-boot/u-boot-1.3.4-110-apf9328.patch
trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328.h
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328.h 2009-01-10 15:20:57 UTC (rev 1008)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328.h 2009-01-12 13:08:36 UTC (rev 1009)
@@ -33,7 +33,7 @@
#define __CONFIG_H
#define CONFIG_ENV_VERSION "3.5"
-#define CONFIG_IDENT_STRING " apf9328 patch 3.7"
+#define CONFIG_IDENT_STRING " apf9328 patch 3.8"
#define CONFIG_ARM920T 1 /* this is an ARM920T CPU */
#define CONFIG_IMX 1 /* in a Motorola MC9328MXL Chip */
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-110-apf9328.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-110-apf9328.patch 2009-01-10 15:20:57 UTC (rev 1008)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-110-apf9328.patch 2009-01-12 13:08:36 UTC (rev 1009)
@@ -1,6 +1,6 @@
--- ref/u-boot-1.3.4/board/armadeus/apf9328/apf9328.c 1970-01-01 01:00:00.000000000 +0100
+++ u-boot-1.3.4/board/armadeus/apf9328/apf9328.c 2008-11-14 00:48:19.000000000 +0100
-@@ -0,0 +1,98 @@
+@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
+ *
@@ -37,6 +37,9 @@
+ gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
+ gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_ADDR;
+
++ /* On apf9328 U-Boot is always in the relocatated stated */
++ gd->flags |= GD_FLG_RELOC;
++
+ return 0;
+}
+
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch 2009-01-10 15:20:57 UTC (rev 1008)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-111-apf9328-DM9000.patch 2009-01-12 13:08:36 UTC (rev 1009)
@@ -1,11 +1,11 @@
--- ref/u-boot-1.3.4/drivers/net/dm9000x.c 2008-08-12 16:08:38.000000000 +0200
-+++ u-boot-1.3.4/drivers/net/dm9000x.c 2009-01-09 13:55:49.000000000 +0100
++++ u-boot-1.3.4/drivers/net/dm9000x.c 2009-01-12 13:53:57.000000000 +0100
@@ -130,6 +130,8 @@ static int dm9000_probe(void);
static u16 phy_read(int);
static void phy_write(int, u16);
u16 read_srom_word(int);
+void write_srom_word(int offset, u16 val);
-+static void program_eeprom(char* mac_addr);
++static void program_eeprom(unsigned char* mac_addr);
static u8 DM9000_ior(int);
static void DM9000_iow(int reg, u8 value);
@@ -18,17 +18,16 @@
id_val);
return 0;
} else {
-@@ -408,6 +410,9 @@ eth_init(bd_t * bd)
+@@ -408,6 +410,8 @@ eth_init(bd_t * bd)
u8 io_mode;
struct board_info *db = &dm9000_info;
+ unsigned char hw_enetaddr[6] = {0,0,0,0,0,0};
-+ char *end;
+
DM9000_DBG("eth_init()\n");
/* RESET device */
-@@ -419,19 +424,19 @@ eth_init(bd_t * bd)
+@@ -419,19 +423,19 @@ eth_init(bd_t * bd)
switch (io_mode) {
case 0x0: /* 16-bit mode */
@@ -51,7 +50,7 @@
db->outblk = dm9000_outblk_8bit;
db->inblk = dm9000_inblk_8bit;
db->rx_status = dm9000_rx_status_8bit;
-@@ -473,8 +478,8 @@ eth_init(bd_t * bd)
+@@ -473,8 +477,8 @@ eth_init(bd_t * bd)
/* Set Node address */
#ifndef CONFIG_AT91SAM9261EK
@@ -62,7 +61,7 @@
#endif
if (is_zero_ether_addr(bd->bi_enetaddr) ||
-@@ -491,6 +496,38 @@ eth_init(bd_t * bd)
+@@ -491,6 +495,38 @@ eth_init(bd_t * bd)
}
}
@@ -101,7 +100,7 @@
printf("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", bd->bi_enetaddr[0],
bd->bi_enetaddr[1], bd->bi_enetaddr[2], bd->bi_enetaddr[3],
bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
-@@ -699,6 +736,28 @@ write_srom_word(int offset, u16 val)
+@@ -699,6 +735,28 @@ write_srom_word(int offset, u16 val)
DM9000_iow(DM9000_EPCR, 0);
}
@@ -111,7 +110,7 @@
+ * we don't have valid content on a new board
+ */
+static void
-+program_eeprom(char* mac_addr)
++program_eeprom(unsigned char* mac_addr)
+{
+ u16 eeprom[] = { 0x8180, 0x8382, 0x8584, /* MAC Address */
+ 0x0000 /*0x1455*/, /* Autoload: accept nothing */
@@ -120,7 +119,7 @@
+ 0x0180, /* 0x0180 Wake-up mode control, PHY DIS*/
+ 0, 0, 0, 0
+ };
-+ u16* tmp = mac_addr;
++ u16* tmp = (u16*)mac_addr;
+ int i;
+ for (i = 0; i < 3; i++)
+ eeprom[i] = *tmp++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ar...@us...> - 2009-01-10 15:21:02
|
Revision: 1008
http://armadeus.svn.sourceforge.net/armadeus/?rev=1008&view=rev
Author: artemys
Date: 2009-01-10 15:20:57 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
[LINUX] Correct wrong PWM init value for MTF-035 LCD
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-09 15:44:50 UTC (rev 1007)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-021-armadeus-apf9328.patch 2009-01-10 15:20:57 UTC (rev 1008)
@@ -793,7 +793,7 @@
+
+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(7),
-+ .pwmr = 0x000003ff, // Contrast with PWM @ Pixel clock / 256, max width by default
++ .pwmr = 0x00000150, /* Contrast with PWM @ Line Pulse / 256, medium width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power = apf9328_lcd_backlight_power,
+};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-01-09 15:44:54
|
Revision: 1007
http://armadeus.svn.sourceforge.net/armadeus/?rev=1007&view=rev
Author: jorasse
Date: 2009-01-09 15:44:50 +0000 (Fri, 09 Jan 2009)
Log Message:
-----------
[UBOOT] Fixed typo
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf9328/apf9328.h
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328.h
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328.h 2009-01-09 13:17:21 UTC (rev 1006)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328.h 2009-01-09 15:44:50 UTC (rev 1007)
@@ -32,8 +32,8 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define CONFIG_ENV_VERSION "3.4"
-#define CONFIG_IDENT_STRING " apf9328 patch 3.6"
+#define CONFIG_ENV_VERSION "3.5"
+#define CONFIG_IDENT_STRING " apf9328 patch 3.7"
#define CONFIG_ARM920T 1 /* this is an ARM920T CPU */
#define CONFIG_IMX 1 /* in a Motorola MC9328MXL Chip */
@@ -158,26 +158,30 @@
"run addmmcargs addipargs; bootm ${kernel_addr}\0" \
"firmware_autoload=0\0" \
"flash_uboot=protect off ${uboot_addr} +${uboot_len};" \
+ "echo Erasing FLASH;" \
"era ${uboot_addr} +${uboot_len};" \
"if cp.b ${fileaddr} ${uboot_addr} ${filesize};" \
"then protect on ${uboot_addr} +${uboot_len};" \
- "echo Flashing uboot succeed;" \
- "else echo Flashing uboot failed;" \
+ "echo Flashing of uboot succeed;" \
+ "else echo Flashing of uboot failed;" \
"fi; \0" \
- "flash_firmware=era ${firmware_addr} +${firmware_len};" \
+ "flash_firmware=echo Erasing FLASH;" \
+ "era ${firmware_addr} +${firmware_len};" \
"if cp.b ${fileaddr} ${firmware_addr} ${filesize} ;" \
- "then echo Flashing Firmware succeed;" \
- "else echo Flashing Firmware failed;" \
+ "then echo Flashing of Firmware succeed;" \
+ "else echo Flashing of Firmware failed;" \
"fi\0" \
- "flash_kernel=era ${kernel_addr} +${kernel_len};" \
+ "flash_kernel=echo Erasing FLASH;" \
+ "era ${kernel_addr} +${kernel_len};" \
"if cp.b ${fileaddr} ${kernel_addr} ${filesize} ;" \
- "then echo Flashing kernel succeed;" \
- "else echo Flashing kernel failed;" \
+ "then echo Flashing of kernel succeed;" \
+ "else echo Flashing of kernel failed;" \
"fi\0" \
- "flash_rootfs=era ${rootfs_addr} +${rootfs_len};" \
+ "flash_rootfs=echo Erasing FLASH;" \
+ "era ${rootfs_addr} +${rootfs_len};" \
"if cp.b ${fileaddr} ${rootfs_addr} ${filesize};" \
- "then echo Flashing rootfs succeed;" \
- "else echo Flashing rootfs failed;" \
+ "then echo Flashing of rootfs succeed;" \
+ "else echo Flashing of rootfs failed;" \
"fi\0" \
"flash_reset_env=protect off ${env_addr} +${env_len};" \
"era ${env_addr} +${env_len};" \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|