[Armadeus-commitlog] armadeus branch, master, updated. latestrelease-17-g801075b
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2009-07-16 14:48:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 801075b691083b3e53cb7331aab0a11aec634a04 (commit)
from e1473089b398ae92cc3d9db1ec144612b2be0c11 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 801075b691083b3e53cb7331aab0a11aec634a04
Author: Fabien Marteau <fabien@fabien-laptop-ubuntu.(none)>
Date: Thu Jul 16 16:47:56 2009 +0200
[LINUX][DRIVER][MAX1027] Scheduling bug corrected (to be reviewed)
-----------------------------------------------------------------------
Summary of changes:
target/linux/modules/max1027/README | 22 +++++++++++++++++-----
target/linux/modules/max1027/max1027.c | 16 +++++++++++-----
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/target/linux/modules/max1027/README b/target/linux/modules/max1027/README
index 3b32f69..776ea99 100644
--- a/target/linux/modules/max1027/README
+++ b/target/linux/modules/max1027/README
@@ -1,8 +1,20 @@
+Max1027 analog to digital driver
+================================
-To compile:
-make ARCH=arm CROSS_COMPILE=/local/julien/arm-toolchain/buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-
+Compilation
+-----------
+To compile, use make in this directory:
-3 modules (gpio.ko, ppdev.ko, loadfpga.ko) will be generated, copy them in your rootfs (/lib/modules).
-copy loadgpio.sh in your /etc/init.d directory on your rootfs and launch it to insert modules and create devices file in /dev
+> make
+
+Usage
+-----
+First create all nodes using loadmax.sh script
+> ./loadmax.sh
+
+TODO
+
+Links
+-----
+Drivers usages are described on [ARMadeus Wiki](http://www.armadeus.com/wiki/index.php?title=ADC_max1027)
-Juliem
diff --git a/target/linux/modules/max1027/max1027.c b/target/linux/modules/max1027/max1027.c
index cd87585..4fd93ae 100644
--- a/target/linux/modules/max1027/max1027.c
+++ b/target/linux/modules/max1027/max1027.c
@@ -76,6 +76,10 @@
#define FIFO_SIZE 128
+//#undef pr_debug
+//#define pr_debug(fmt, ...) \
+// (printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__))
+
/* Global variables */
struct max1027_operations *driver_ops;
static int max1027_major = 0; /* Dynamic major allocation */
@@ -191,6 +195,7 @@ static void max1027_send_cmd( struct spi_device *spi, u8 cmd )
static void max1027_start_conv(struct max1027 *max1027)
{
+
/* if no convst pin */
if (max1027->cnvst < 0) {
max1027_send_cmd(current_spi, max1027->conv_reg);
@@ -211,7 +216,8 @@ static void max1027_process_results(struct max1027 *max1027)
pr_debug("%s", __FUNCTION__);
- mutex_lock(&max1027->update_lock);
+// mutex_lock(&max1027->update_lock); // XXX
+
selected_channel = GET_SELECTED_CHANNEL(max1027->conv_reg);
if (selected_channel >= NB_CHANNELS)
selected_channel = NB_CHANNELS - 1;
@@ -226,7 +232,6 @@ static void max1027_process_results(struct max1027 *max1027)
if (max1027->conv_reg & MAX1027_CONV_TEMP)
values_to_read += 1;
-
#ifdef DEBUG
for (i=0; i<values_to_read*2; i++) {
printk("%02x ", buffer[i]);
@@ -272,7 +277,7 @@ static void max1027_process_results(struct max1027 *max1027)
} else {
max1027->status = 0;
}
- mutex_unlock(&max1027->update_lock);
+// mutex_unlock(&max1027->update_lock); // XXX
}
static void max1027_reads_async( struct spi_device *spi, int num_values )
@@ -296,6 +301,7 @@ static void max1027_reads_async( struct spi_device *spi, int num_values )
if (ret)
printk(KERN_ERR "%s: error %i in SPI request\n",
__FUNCTION__, ret);
+
}
/*
@@ -348,6 +354,7 @@ static void read_conversion_results( unsigned long data )
struct max1027 *max1027 = dev_get_drvdata(&spi->dev);
int size = 0;
+
/* Get conversion results from chip (depends on conversion mode) */
switch( GET_SCAN_MODE(max1027->conv_reg) )
{
@@ -384,9 +391,8 @@ static void read_conversion_results( unsigned long data )
static irqreturn_t max1027_interrupt(int irq, void *dev_id)
{
struct max1027 *max1027 = dev_id;
-
/* schedule task for reading results from chip outside of IRQ */
- tasklet_schedule( &max1027->tasklet );
+ tasklet_hi_schedule( &max1027->tasklet );
return IRQ_HANDLED;
}
hooks/post-receive
--
armadeus
|