TPS6507x-ts driver failed with -121 on kernel v2.6.34-davinci1

2010-06-07 Thread n...@max01.eu
Hello,

i try to get running the tps6507x-ts touchscreen driver on the Kevin Hilman
Davinci kernel tree
(git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git).

I enabled the following parts in the kernelconfig:

Device Drivers - Multifunction Device Drivers - TPS6507x Power Management /
Touch Screen chips
Device Drivers - Input device support - Event Interface
Device Drivers - Input device support - Touchscreens - TPS6507x based
touchscreens


That gives a compile error : can`t find kzalloc and kfree!

After applying following patch the driver compiles.

diff --git a/drivers/mfd/tps6507x.c b/drivers/mfd/tps6507x.c
index dcddef0..dbaab1a 100644
--- a/drivers/mfd/tps6507x.c
+++ b/drivers/mfd/tps6507x.c
@@ -20,6 +20,7 @@
 #include linux/i2c.h
 #include linux/mfd/core.h
 #include linux/mfd/tps6507x.h
+#include linux/slab.h
 
 static struct mfd_cell tps6507x_devs[] = {
    {


On runtime the kernel gives the following error:

tps6507x-ts: probe of tps6507x-ts failed with error -121

Any idea whats to do now?
Thank you very much,
 
regards
 
Bastian.
 
P.S.
Hardware:
OMAP-L138 Evm-Board with ui-board___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 02/12] spi: davinci: Added support for chip select using gpio

2010-06-07 Thread Raffaele Recalcati
From: Raffaele Recalcati raffaele.recalc...@bticino.it
Date: Fri, 4 Jun 2010 16:16:37 +0200
Subject: [PATCH 02/12] spi: davinci: Added support for chip select using
gpio

Signed-off-by: Davide Bonfanti davide.bonfa...@bticino.it
---
 arch/arm/mach-davinci/dm365.c |   10 ++
 drivers/spi/davinci_spi.c |   26 +-
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a146849..42fd4a4 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -677,10 +677,12 @@ void __init dm365_init_spi0(unsigned chipselect_mask,
 davinci_cfg_reg(DM365_SPI0_SDO);

 /* not all slaves will be wired up */
-if (chipselect_mask  BIT(0))
-davinci_cfg_reg(DM365_SPI0_SDENA0);
-if (chipselect_mask  BIT(1))
-davinci_cfg_reg(DM365_SPI0_SDENA1);
+if  (!((unsigned long) info-controller_data)) {
+if (chipselect_mask  BIT(0))
+davinci_cfg_reg(DM365_SPI0_SDENA0);
+if (chipselect_mask  BIT(1))
+davinci_cfg_reg(DM365_SPI0_SDENA1);
+}

 spi_register_board_info(info, len);

diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 95afb6b..6a305ca 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -29,6 +29,7 @@
 #include linux/spi/spi_bitbang.h
 #include linux/slab.h

+#include mach/gpio.h
 #include mach/spi.h
 #include mach/edma.h

@@ -270,18 +271,25 @@ static void davinci_spi_chipselect(struct spi_device
*spi, int value)
 pdata = davinci_spi-pdata;

 /*
- * Board specific chip select logic decides the polarity and cs
- * line for the controller
- */
+* Board specific chip select logic decides the polarity and cs
+* line for the controller
+*/
 if (value == BITBANG_CS_INACTIVE) {
-set_io_bits(davinci_spi-base + SPIDEF, CS_DEFAULT);
-
-data1_reg_val |= CS_DEFAULT  SPIDAT1_CSNR_SHIFT;
-iowrite32(data1_reg_val, davinci_spi-base + SPIDAT1);
+if  ((unsigned long) spi-controller_data) {
+gpio_set_value(spi-controller_data, !(spi-mode 
SPI_CS_HIGH));
+} else {
+set_io_bits(davinci_spi-base + SPIDEF, CS_DEFAULT);

+data1_reg_val |= CS_DEFAULT  SPIDAT1_CSNR_SHIFT;
+iowrite32(data1_reg_val, davinci_spi-base + SPIDAT1);
+}
 while ((ioread32(davinci_spi-base + SPIBUF)
- SPIBUF_RXEMPTY_MASK) == 0)
+ SPIBUF_RXEMPTY_MASK) == 0)
 cpu_relax();
+} else {
+if  ((unsigned long) spi-controller_data) {
+gpio_set_value(spi-controller_data, (spi-mode 
SPI_CS_HIGH));
+}
 }
 }

-- 
1.6.3.3
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 06/12] fb: Added composite sync high active mode

2010-06-07 Thread Raffaele Recalcati
From: Davide Bonfanti davide.bonfa...@bticino.it
Date: Fri, 4 Jun 2010 14:30:12 +0200
Subject: [PATCH 06/12] fb: Added composite sync high active mode

---
 include/linux/fb.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/fb.h b/include/linux/fb.h
index c10163b..578a8de 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -212,6 +212,7 @@ struct fb_bitfield {
 /* vtotal = 144d/288n/576i = PAL  */
 /* vtotal = 121d/242n/484i = NTSC */
 #define FB_SYNC_ON_GREEN32/* sync on green */
+#define FB_SYNC_PIXCLOCK_HIGH_ACT64/* composite sync high active
*/

 #define FB_VMODE_NONINTERLACED  0/* non interlaced */
 #define FB_VMODE_INTERLACED1/* interlaced*/
-- 
1.6.3.3
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 05/12] mtd-nand: davinci: Added 16 bit wide bus for DaVinci bmx board

2010-06-07 Thread Raffaele Recalcati
From: Davide Bonfanti davide.bonfa...@bticino.it
Date: Fri, 4 Jun 2010 13:56:35 +0200
Subject: [PATCH 05/12] mtd-nand: davinci: Added 16 bit wide bus for DaVinci
bmx board

Signed-off-by: Raffaele Recalcati raffaele.recalc...@bticino.it
---
 drivers/mtd/nand/davinci_nand.c |   40
+++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c
b/drivers/mtd/nand/davinci_nand.c
index 103235e..d29685d 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -508,6 +508,38 @@ static void __init nand_dm6446evm_flash_init(struct
davinci_nand_info *info)
 }
 }

+static void __init nand_bmx_flash_init(struct davinci_nand_info *info)
+{
+uint32_t regval, a1cr;
+
+/*
+ * NAND FLASH timings @ PLL1 == 459 MHz
+ *  - AEMIF.CLK freq   = PLL1/6 = 459/6 = 76.5 MHz
+ *  - AEMIF.CLK period = 1/76.5 MHz = 13.1 ns
+ */
+regval = 0
+| (0  31)   /* selectStrobe */
+| (1  30)   /* extWait (never with NAND) */
+| (0  26)   /* writeSetup  10 ns */
+| (4  20)   /* writeStrobe 40 ns */
+| (0  17)   /* writeHold   10 ns */
+| (0  13)   /* readSetup   10 ns */
+| (4  7)/* readStrobe  60 ns */
+| (0  4)/* readHold10 ns */
+| (1  2)/* turnAround  ?? ns */
+| (1  0)/* asyncSize   16-bit bus */
+;
+a1cr = davinci_nand_readl(info, A1CR_OFFSET);
+if (a1cr != regval) {
+dev_err(info-dev, Warning: NAND config: Set A1CR  \
+   reg to 0x%08x, was 0x%08x, should be done by  \
+   bootloader.\n, regval, a1cr);
+davinci_nand_writel(info, A1CR_OFFSET, regval);
+}
+
+}
+
+
 /*--*/

 /* An ECC layout for using 4-bit ECC with small-page flash, storing
@@ -697,6 +729,14 @@ static int __init nand_davinci_probe(struct
platform_device *pdev)
  */
 if (machine_is_davinci_evm())
 nand_dm6446evm_flash_init(info);
+else if (machine_is_bmx())
+nand_bmx_flash_init(info); /* no reason to do this,
+* because the boot loader
+* is booting the kernel
+* that is in the nand flash
+* and so EMIF must already
+* configured
+*/

 spin_lock_irq(davinci_nand_lock);

-- 
1.6.3.3
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 09/12] mfd: update gfp/slab.h includes

2010-06-07 Thread Raffaele Recalcati
From: Tejun Heo t...@kernel.org
Date: Tue, 30 Mar 2010 02:52:40 +0900
Subject: [PATCH 09/12] mfd: update gfp/slab.h includes

Implicit slab.h inclusion via percpu.h is about to go away.  Make sure
gfp.h or slab.h is included as necessary.

Signed-off-by: Tejun Heo t...@kernel.org
Acked-by: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Mark Brown broo...@opensource.wolfsonmicro.com
---
 drivers/mfd/davinci_voicecodec.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c
b/drivers/mfd/davinci_voicecodec.c
index 9886aa8..3e75f02 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -23,6 +23,7 @@
 #include linux/init.h
 #include linux/module.h
 #include linux/device.h
+#include linux/slab.h
 #include linux/delay.h
 #include linux/io.h
 #include linux/clk.h
-- 
1.6.3.3
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 08/12] drivers: mfd: Kconfig Adding comment to MFD_DAVINCI_VOICECODEC

2010-06-07 Thread Raffaele Recalcati
From: Raffaele Recalcati raffaele.recalc...@bticino.it
Date: Tue, 20 Apr 2010 08:23:56 +0200
Subject: [PATCH 08/12] drivers: mfd: Kconfig  Adding comment to
MFD_DAVINCI_VOICECODEC

It makes more clear the selection.
---
 drivers/mfd/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index dfbd03f..bf584f0 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -54,7 +54,7 @@ config MFD_SH_MOBILE_SDHI
   SuperH Mobile SoCs.

 config MFD_DAVINCI_VOICECODEC
-tristate
+tristate DaVinci VoiceCodec
 select MFD_CORE

 config MFD_DM355EVM_MSP
-- 
1.6.3.3
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 10/12] DaVinci: dm365: Added clokout2 management

2010-06-07 Thread Raffaele Recalcati
From: Davide Bonfanti davide.bonfa...@bticino.it
Date: Thu, 3 Jun 2010 14:26:26 +0200
Subject: [PATCH 10/12] DaVinci: dm365: Added clokout2 management

Signed-off-by: Raffaele Recalcati raffaele.recalc...@bticino.it
---
 arch/arm/mach-davinci/clock.c  |   62

 arch/arm/mach-davinci/clock.h  |6 +++
 arch/arm/mach-davinci/dm365.c  |   58 -
 arch/arm/mach-davinci/include/mach/clock.h |3 +
 4 files changed, 126 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 054c303..f561b73 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -144,6 +144,68 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL(clk_set_rate);

+
+int clkout_set_rate(struct clk *clk, unsigned long rate)
+{
+unsigned long flags;
+int ret = -EINVAL;
+int i, err, min_err, i_min_err;
+u32 regval;
+struct pll_data *pll;
+
+
+if (clk == NULL || IS_ERR(clk))
+return ret;
+pll = clk-parent-pll_data;
+regval = __raw_readl(IO_ADDRESS(clk-sec_div_reg));
+
+if (clk-sec_div_reg)
+{
+i_min_err = min_err = INT_MAX;
+for (i=clk-sec_div_reg_max; i0; i--)
+{
+if (clk-set_rate)
+{
+ret = clk_set_rate(clk, rate * i) ;
+err = clk_get_rate(clk) - rate * i;
+if (abs(min_err)  abs(err))
+{
+min_err = err;
+i_min_err = i;
+}
+}
+}
+i = i_min_err;
+ret = clk-set_rate(clk, rate * i) ;
+
+regval = ~(clk-sec_div_reg_max  clk-sec_div_reg_shift);
+regval |= (i-1)  clk-sec_div_reg_shift;
+__raw_writel(regval,  IO_ADDRESS(clk-sec_div_reg));
+regval = __raw_readl( IO_ADDRESS(clk-out_enable_reg));
+regval |= 1  clk-out_enable_bit;
+__raw_writel(regval, IO_ADDRESS(clk-out_enable_reg));
+rate *= i;
+}
+else
+{
+if (clk-set_rate)
+ret = clk-set_rate(clk, rate);
+}
+
+spin_lock_irqsave(clockfw_lock, flags);
+if (ret == 0) {
+if (clk-recalc)
+clk-rate = clk-recalc(clk);
+propagate_rate(clk);
+regval = ~(1  clk-out_enable_bit);
+__raw_writel(regval, IO_ADDRESS(clk-out_enable_reg));
+}
+spin_unlock_irqrestore(clockfw_lock, flags);
+
+return ret;
+}
+EXPORT_SYMBOL(clkout_set_rate);
+
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
 unsigned long flags;
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 01e3648..1ca14e7 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -95,6 +95,12 @@ struct clk {
 struct list_headchildnode;/* parent's child list node */
 struct pll_data *pll_data;
 u32 div_reg;
+u32sec_div_reg;
+u32sec_div_reg_max;
+u32 sec_div_reg_shift;
+u32 out_enable_reg;
+u32 out_enable_bit;
+
 unsigned long (*recalc) (struct clk *);
 int (*set_rate) (struct clk *clk, unsigned long rate);
 int (*round_rate) (struct clk *clk, unsigned long rate);
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index e4ead0a..9968c37 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -40,6 +40,21 @@
 #include mux.h

 #define DM365_REF_FREQ2400/* 24 MHz on the DM365 EVM */
+#define PINMUX00x00
+#define PINMUX10x04
+#define PINMUX20x08
+#define PINMUX30x0c
+#define PINMUX40x10
+#define INTMUX0x18
+#define EVTMUX0x1c
+#define PERI_CLKCTL0x48
+#define CLOCKOUT2EN 2
+#define CLOCKOUT1EN 1
+#define CLOCKOUT0EN 0
+
+
+int dm365_set_pll1_rate(struct clk *clk, unsigned long rate);
+

 static struct pll_data pll1_data = {
 .num= 1,
@@ -147,6 +162,20 @@ static struct clk pll1_sysclk9 = {
 .div_reg= PLLDIV9,
 };

+static struct clk clkout2_clk = {
+.name= clkout2,
+.parent= pll1_clk,
+.flags= CLK_PLL,
+.div_reg= PLLDIV9,
+.sec_div_reg= DAVINCI_SYSTEM_MODULE_BASE + PERI_CLKCTL,
+.sec_div_reg_max= 0x0F,
+.sec_div_reg_shift= 3,
+.out_enable_reg = DAVINCI_SYSTEM_MODULE_BASE + PERI_CLKCTL,
+.out_enable_bit= CLOCKOUT2EN,
+.set_rate   = dm365_set_pll1_rate,
+};
+
+
 static struct clk pll2_clk = {
 .name= pll2,
 .parent= ref_clk,
@@ -421,6 +450,7 @@ static struct clk_lookup dm365_clks[] = {
 CLK(NULL, pll1_sysclk7, pll1_sysclk7),
 CLK(NULL, pll1_sysclk8, pll1_sysclk8),
 CLK(NULL, pll1_sysclk9, pll1_sysclk9),
+CLK(NULL, clkout2, clkout2_clk),
 CLK(NULL, pll2, pll2_clk),
 CLK(NULL, pll2_aux, pll2_aux_clk),
 CLK(NULL, clkout1, clkout1_clk),
@@ 

[PATCH 12/12] regulator: add support for Dallas DS1803 dual digital potentiometer

2010-06-07 Thread Raffaele Recalcati
From: Rodolfo Giometti giome...@linux.it
Date: Fri, 4 Jun 2010 12:47:28 +0200
Subject: [PATCH 12/12] regulator: add support for Dallas DS1803 dual digital
potentiometer

Signed-off-by: Rodolfo Giometti giome...@linux.it
Acked-by: Raffaele Recalcati raffaele.recalc...@bticino.it
Acked-by: Enrico Valtolina enrico.valtol...@bticino.it
---
 drivers/regulator/Kconfig|7 ++
 drivers/regulator/Makefile   |1 +
 drivers/regulator/ds1803.c   |  204
++
 include/linux/regulator/ds1803.h |   41 
 4 files changed, 253 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/ds1803.c
 create mode 100644 include/linux/regulator/ds1803.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 04f2e08..ebaf09b 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -201,5 +201,12 @@ config REGULATOR_88PM8607
 help
   This driver supports 88PM8607 voltage regulator chips.

+config REGULATOR_DS1803
+tristate Dallas Maxim DS1803 addressable dual digital potentiometer
+depends on I2C
+help
+  Say Y here to support the dual digital potentiometer on
+  Dallas Maxim DS1803
+
 endif

diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 4e7feec..c0fe050 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -31,5 +31,6 @@ obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
 obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
 obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
 obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
+obj-$(CONFIG_REGULATOR_DS1803) += ds1803.o

 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/ds1803.c b/drivers/regulator/ds1803.c
new file mode 100644
index 000..8621a59
--- /dev/null
+++ b/drivers/regulator/ds1803.c
@@ -0,0 +1,204 @@
+/*
+ * ds1803.c  --  Voltage regulation for the DS1803
+ *
+ * Copyright (C) 2009 Rodolfo Giometti giome...@linux.it
+ * Copyright (C) 2009 Bticino S.p.A. i...@bticino.it
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA
+ */
+
+#include linux/module.h
+#include linux/err.h
+#include linux/i2c.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/ds1803.h
+#include linux/slab.h
+
+struct ds1803_data {
+struct i2c_client *client;
+struct regulator_dev *rdev;
+
+unsigned int min_uV;/* voltage for selector value 0 */
+unsigned int max_uV;/* voltage for selector value 255 */
+unsigned int init_uV;/* initial voltage */
+};
+
+/*
+ * Low level functions
+ */
+
+static u8 ds1803_write_pot_lut[] = { 0xa9, 0xaa, /* both not supported */
};
+
+static int ds1803_set_voltage(struct regulator_dev *rdev,
+int min_uV, int max_uV)
+{
+struct ds1803_data *ds1803 = rdev_get_drvdata(rdev);
+struct i2c_client *client = ds1803-client;
+unsigned int id = rdev_get_id(rdev);
+int val;
+u8 buf[2] = { ds1803_write_pot_lut[id], 0 };
+struct i2c_msg msgs[1] = {
+{ client-addr  , 0, 2, buf },
+};
+int ret;
+
+
+val = (min_uV - ds1803-min_uV) * 255 / ds1803-max_uV;
+
+pr_notice(%s Writing %d to pot %d\n,__func__, val,id);
+
+if (val  0 || val  255)
+return -EINVAL;
+buf[1] = val;
+
+ret = i2c_transfer(client-adapter, msgs[0], 1);
+if (ret != 1) {
+dev_err(client-dev, %s: write error\n, __func__);
+return -EIO;
+}
+
+return 0;
+}
+
+static int ds1803_list_voltage(struct regulator_dev *rdev, unsigned index)
+{
+struct ds1803_data *ds1803 = rdev_get_drvdata(rdev);
+
+return (ds1803-max_uV - ds1803-min_uV) * index / 255
++ ds1803-min_uV;
+}
+
+/*
+ * Regulator methods
+ */
+
+static struct regulator_ops ds1803_voltage_ops = {
+.set_voltage = ds1803_set_voltage,
+.list_voltage = ds1803_list_voltage,
+};
+
+static char *ds1803_names[] = {
+[DS1803_100K] = trimmer_100k,
+[DS1803_50K] = trimmer_50k,
+[DS1803_10K] = trimmer_10k,
+};
+
+static struct regulator_desc ds1803_reg[] = {
+{
+.type = REGULATOR_VOLTAGE,
+.id = 0,
+.n_voltages = 256,
+.ops = ds1803_voltage_ops,
+.owner = THIS_MODULE,
+},
+{
+.type = REGULATOR_VOLTAGE,

RE: [PATCH] DM365: fixed second serial port

2010-06-07 Thread Nori, Sekhar
On Fri, Jun 04, 2010 at 16:46:28, jean-philippe francois wrote:
  Unless you insist, I would prefer to leave the define at its current place.
  First of all, many people (including me) expect to find defines somewhere
  near the beginning of a source file. More importantly, if a definition is
  valid throughout the entire file, it is easier to later add code that also
  depends on that definition, without having to move it again.
 

 As far as I am concerned, when a define is used in a single place, I
 find it easier
 to have it near the place where it is used. And I don't think we will
 need to add further reference
 to this define, since the precise purpose of this platform data is to
 stop caring about the hardware
 base address.

Agree with jean-philippe here, that's the general rule we have
been following in DaVinci tree.

Thanks,
Sekhar
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH 3/6] davinci: edma: clear events in edma_start()

2010-06-07 Thread Sudhakar Rajashekhara
Hi,

On Sat, Jun 05, 2010 at 02:05:50, Brian Niebuhr wrote:
This patch causes that the sound can not work normally 
  on OMAP_L138.
   snip
   After revert it, the audio works fine.
   
  
   This patch works fine on DM644x which has McBSP but breaks 
  audio on OMAP L138
   (as you had mentioned) which has McASP. Ideally McBSP/McASP 
  should start after
   EDMA is started. If not then this patch clears the EDMA 
  event which is actually
   set by McBSP/McASP. As this patch is working fine on 
  DM644x, I think there is
   some issue in the audio driver which needs to be debugged.
  
  In the mean time, I think it makes sense to revert $SUBJECT patch in
  davinci git until the audio driver is debugged.
 
 Kevin - 
 
 What is the process or timeline for getting this patch reapplied?  I am
 working right now on resubmitting my patch for the Davinci SPI driver,
 however that driver won't work as is without this patch.  I could
 probably hack something into the SPI driver to compensate, however if
 all are agreed that drivers shouldn't rely on DMA events that occur
 before the DMA is started, then it seems better to handle the issue in
 the DMA driver as I did in the reverted patch.
 

I debugged this further today and I noticed that the issue of audio not
playing was observed only on DA830 and DA850 but not on DM6467 which also
has McASP. The only difference between McASP present on DM6467 and DA8XX
was hardware FIFO support. So when I disabled hardware FIFO on DA8XX devices,
even with this patch, audio started working correctly. Debugging further, I
found that, after doing FIFO configurations, FIFO was being enabled in
davinci_hw_common_param() function of sound/soc/davinci/davinci-mcasp.c file.
This was causing an extra McASP EDMA event to occur which was getting cleared
during edma_start(). This resulted in a state where EDMA was waiting for an
EDMA event from McASP, but the event which was already there, had got cleared.
Following patch fixes this issue.

===
diff --git a/sound/soc/davinci/davinci-mcasp.c 
b/sound/soc/davinci/davinci-mcasp.c
index 79f0f4a..d395509 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -612,7 +612,6 @@ static void davinci_hw_common_param(struct 
davinci_audio_dev *dev, int stream)
NUMDMA_MASK);
mcasp_mod_bits(dev-base + DAVINCI_MCASP_WFIFOCTL,
((dev-txnumevt * tx_ser)  8), NUMEVT_MASK);
-   mcasp_set_bits(dev-base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE);
}

if (dev-rxnumevt  stream == SNDRV_PCM_STREAM_CAPTURE) {
@@ -623,7 +622,6 @@ static void davinci_hw_common_param(struct 
davinci_audio_dev *dev, int stream)
NUMDMA_MASK);
mcasp_mod_bits(dev-base + DAVINCI_MCASP_RFIFOCTL,
((dev-rxnumevt * rx_ser)  8), NUMEVT_MASK);
-   mcasp_set_bits(dev-base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE);
}
 }
===

I'll be submitting this patch to the list soon.

Regards,
Sudhakar


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 01/12] ASoC: DaVinci: Added support for stereo I2S

2010-06-07 Thread Sergei Shtylyov

Hello.

Raffaele Recalcati wrote:

From: Raffaele Recalcati raffaele.recalc...@bticino.it 
mailto:raffaele.recalc...@bticino.it


   I think mailto:; should be omitted.


Date: Thu, 3 Jun 2010 14:40:05 +0200
Subject: [PATCH 01/12] ASoC: DaVinci: Added support for stereo I2S



 - Frame Sync master and Clock master (internally generated)
 - Frame Sync master and Clock slave

Signed-off-by: Davide Bonfanti davide.bonfa...@bticino.it 


   Where's your own signoff? Is it your patch or Davide's?


mailto:davide.bonfa...@bticino.it


   Same about mailto:;...


---
 sound/soc/davinci/davinci-i2s.c |  137 
++-

 1 files changed, 121 insertions(+), 16 deletions(-)

diff --git a/sound/soc/davinci/davinci-i2s.c 
b/sound/soc/davinci/davinci-i2s.c

index adadcd3..c1281c5 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -9,6 +9,8 @@
  * published by the Free Software Foundation.
  */
 
+#define DEBUG 3

+
 #include linux/init.h
 #include linux/module.h
 #include linux/device.h
@@ -68,16 +70,23 @@
 #define DAVINCI_MCBSP_RCR_RDATDLY(v)((v)  16)
 #define DAVINCI_MCBSP_RCR_RFIG(1  18)
 #define DAVINCI_MCBSP_RCR_RWDLEN2(v)((v)  21)
+#define DAVINCI_MCBSP_RCR_RFRLEN2(v)((v)  24)
+#define DAVINCI_MCBSP_RCR_RPHASE(1  31)
 
 #define DAVINCI_MCBSP_XCR_XWDLEN1(v)((v)  5)

 #define DAVINCI_MCBSP_XCR_XFRLEN1(v)((v)  8)
 #define DAVINCI_MCBSP_XCR_XDATDLY(v)((v)  16)
 #define DAVINCI_MCBSP_XCR_XFIG(1  18)
 #define DAVINCI_MCBSP_XCR_XWDLEN2(v)((v)  21)
+#define DAVINCI_MCBSP_XCR_XFRLEN2(v)((v)  24)
+#define DAVINCI_MCBSP_XCR_XPHASE(1  31)
+
 
+#define CLKGDV(v)(v) /* Bits 0:7 */

 #define DAVINCI_MCBSP_SRGR_FWID(v)((v)  8)
 #define DAVINCI_MCBSP_SRGR_FPER(v)((v)  16)
 #define DAVINCI_MCBSP_SRGR_FSGM(1  28)
+#define DAVINCI_MCBSP_SRGR_CLKSM(1  29)
 
 #define DAVINCI_MCBSP_PCR_CLKRP(1  0)

 #define DAVINCI_MCBSP_PCR_CLKXP(1  1)
@@ -89,6 +98,11 @@
 #define DAVINCI_MCBSP_PCR_FSRM(1  10)
 #define DAVINCI_MCBSP_PCR_FSXM(1  11)
 
+/* this define works when both clock and FS are output for the cpu

+   and makes clock very fast (FS is not simmetrical, but sampling
+   frequency is better approximated */


   See chapter 8 of the Documentation/CodingStyle for the preferrable 
style of multi-line comments, it should be:


/*
 * blah
 * blah
 */


@@ -146,6 +160,14 @@ struct davinci_mcbsp_dev {
 unsigned enable_channel_combine:1;
 };
 
+struct davinci_mcbsp_data {

+unsigned intfmt;
+int clk_div;
+};
+
+static struct davinci_mcbsp_data mcbsp_data;
+
+


   Extra newline?


 static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev,
int reg, u32 val)
 {
@@ -197,7 +219,7 @@ static void davinci_mcbsp_start(struct 
davinci_mcbsp_dev *dev,

 int ret = platform-pcm_ops-trigger(substream,
 SNDRV_PCM_TRIGGER_STOP);
 if (ret  0)
-printk(KERN_DEBUG Playback DMA stop failed\n);
+pr_debug(Playback DMA stop failed\n);
 }
 
 /* Enable the transmitter */


   Your mailer has converted all tabes to spaces. Patches can't be 
applied until you dealt with this and resend.


@@ -219,7 +241,7 @@ static void davinci_mcbsp_start(struct 
davinci_mcbsp_dev *dev,

 int ret = platform-pcm_ops-trigger(substream,
 SNDRV_PCM_TRIGGER_START);
 if (ret  0)
-printk(KERN_DEBUG Playback DMA start failed\n);
+pr_debug(Playback DMA start failed\n);


   Unrelated change.


 }
 }
 
@@ -254,12 +276,15 @@ static int davinci_i2s_set_dai_fmt(struct 
snd_soc_dai *cpu_dai,

 struct davinci_mcbsp_dev *dev = cpu_dai-private_data;
 unsigned int pcr;
 unsigned int srgr;
-srgr = DAVINCI_MCBSP_SRGR_FSGM |
+srgr = DAVINCI_MCBSP_SRGR_FSGM |
 DAVINCI_MCBSP_SRGR_FPER(DEFAULT_BITPERSAMPLE * 2 - 1) |
 DAVINCI_MCBSP_SRGR_FWID(DEFAULT_BITPERSAMPLE - 1);
+/* Attention srgr is updated by hw_params! */
 
+mcbsp_data.fmt = fmt;

 /* set master/slave audio interface */
 switch (fmt  SND_SOC_DAIFMT_MASTER_MASK) {
+case SND_SOC_DAIFMT_CBS_CFM:
 case SND_SOC_DAIFMT_CBS_CFS:
 /* cpu is master */
 pcr = DAVINCI_MCBSP_PCR_FSXM |
@@ -279,7 +304,7 @@ static int davinci_i2s_set_dai_fmt(struct 
snd_soc_dai *cpu_dai,

 pcr = 0;
 break;
 default:
-printk(KERN_ERR %s:bad master\n, __func__);
+dev_err(dev, %s:bad master\n, __func__);


   Unrelated change.

@@ -310,7 +335,7 @@ static int davinci_i2s_set_dai_fmt(struct 
snd_soc_dai *cpu_dai,

 dev-mode = MOD_DSP_B;
 break;
 default:
-printk(KERN_ERR %s:bad format\n, __func__);
+dev_err(dev, %s:bad format\n, __func__);


   ... and again.


 return -EINVAL;
 }
 
@@ 

RE: usb 1-1: device descriptor read/64, error -110

2010-06-07 Thread Alok Kumar
Appreciate your responses.

 

When USB drive was in not detected state, I restarted the unit, a fresh
power up did not fix the issue. However when we pulled out the USB key
device and inserted again, it was detected, enumerated, mounted.
Subsequent power up, did not show any issues (at least for time being)

 

The area, I don't understand how a re-inserting USB pen drive worked
successfully(detected, enumerated, mounted) , but power reset to board
did not fix the issue.

 

Any thoughts what I can do in this situation ?

 

Thanks

Alok

 

 

 

From: Stephen Berry [mailto:s...@i-d-2.com] 
Sent: Friday, June 04, 2010 10:07 PM
To: Alok Kumar
Cc: davinci-linux-open-source@linux.davincidsp.com
Subject: Re: usb 1-1: device descriptor read/64, error -110

 

It looks like the device descriptor wasn't read correctly. Without that
the kernel can't attach the device.

Did you try removing it and hot-plugging to see if it works? 

If a USB device doesn't respond to configuration requests appropriately,
then it is usually because it is :

a - damaged
b - the hardware (pen drive) has a power issue
c - firmware is too slow on the device to respond.

Try a new pen drive.

You can certainly detect that a device you expect isn't mounted, not
sure how to tell udev to try to reconfigure it again after it failed the
first time around...

Steve

On 6/4/2010 4:16 PM, Alok Kumar wrote: 

Correction Error number is -110 (timeout)

 

From: Alok Kumar 
Sent: Friday, June 04, 2010 4:25 PM
To: 'davinci-linux-open-source@linux.davincidsp.com'
Subject: usb 1-1: device descriptor read/64, error -11

 

Hi,

 

I am using Davinci 6446 with git tree kernel 2.6.30. We use USB drive
(pen drive) to collect the data periodically.

Sometimes (once in 3-4 months) , after reboot an earlier working USB
drive is not recognized (no /dev/sda1 etc)  and I see following errors
and USB is was not detected.

 

kernel: usb 1-1: new high speed USB device using musb_hdrc and address 2

kernel: Initializing USB Mass Storage driver...

kernel: usbcore: registered new interface driver usb-storage

kernel: USB Mass Storage support registered.

kernel: musb_h_ep0_irq 1067: no URB for end 0

kernel: usb 1-1: device descriptor read/64, error -110

 

I see some comments in musb/musb_host.c for 'no URB for end 0', saying
this should never happen.

 

My question is how to fix this error. What kind of recovery mechanism ,
I can put to auto detect it and fix it.

Any help will be greatly appreciated.

 

Thanks

Alok

NOTICE: The information contained in this email and any document
attached hereto is intended only for the named recipient(s). It is the
property of Cernium Corporation and shall not be used, disclosed or
reproduced without the express written consent of Cernium Corporation.
If you are not the intended recipient (or the employee or agent
responsible for delivering this message in confidence to the intended
recipient(s)), you are hereby notified that you have received this
transmittal in error, and any review, dissemination, distribution or
copying of this transmittal or its attachments is strictly prohibited.
If you have received this transmittal and/or attachments in error,
please notify me immediately by reply email or telephone and immediately
delete this message and all its attachments. Thank you. 

 
 
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
  


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: usb 1-1: device descriptor read/64, error -110

2010-06-07 Thread Steve Poulsen

Can you measure the VBUS on a reboot and see if it is getting disabled?

On 06/07/2010 08:41 AM, Alok Kumar wrote:


Appreciate your responses.

When USB drive was in not detected state, I restarted the unit, a 
fresh power up did not fix the issue. However when we pulled out the 
USB key device and inserted again, it was detected, enumerated, 
mounted. Subsequent power up, did not show any issues (at least for 
time being)


The area, I don't understand how a re-inserting USB pen drive worked 
successfully(detected, enumerated, mounted) , but power reset to board 
did not fix the issue.


Any thoughts what I can do in this situation ?

Thanks

Alok

*From:* Stephen Berry [mailto:s...@i-d-2.com]
*Sent:* Friday, June 04, 2010 10:07 PM
*To:* Alok Kumar
*Cc:* davinci-linux-open-source@linux.davincidsp.com
*Subject:* Re: usb 1-1: device descriptor read/64, error -110

It looks like the device descriptor wasn't read correctly. Without 
that the kernel can't attach the device.


Did you try removing it and hot-plugging to see if it works?

If a USB device doesn't respond to configuration requests 
appropriately, then it is usually because it is :


a - damaged
b - the hardware (pen drive) has a power issue
c - firmware is too slow on the device to respond.

Try a new pen drive.

You can certainly detect that a device you expect isn't mounted, not 
sure how to tell udev to try to reconfigure it again after it failed 
the first time around...


Steve

On 6/4/2010 4:16 PM, Alok Kumar wrote:

Correction Error number is -110 (timeout)

*From:* Alok Kumar
*Sent:* Friday, June 04, 2010 4:25 PM
*To:* 'davinci-linux-open-source@linux.davincidsp.com 
mailto:davinci-linux-open-source@linux.davincidsp.com'

*Subject:* usb 1-1: device descriptor read/64, error -11

Hi,

I am using Davinci 6446 with git tree kernel 2.6.30. We use USB drive 
(pen drive) to collect the data periodically.


Sometimes (once in 3-4 months) , after reboot an earlier working USB 
drive is not recognized (no /dev/sda1 etc)  and I see following errors 
and USB is was not detected.


*kernel: usb 1-1: new high speed USB device using musb_hdrc and address 2*

*kernel: Initializing USB Mass Storage driver...*

*kernel: usbcore: registered new interface driver usb-storage*

*kernel: USB Mass Storage support registered.*

*kernel: musb_h_ep0_irq 1067: no URB for end 0*

*kernel: usb 1-1: device descriptor read/64, error -11**0*

* *

I see some comments in musb/musb_host.c for 'no URB for end 0', saying 
this should never happen.


My question is how to fix this error. What kind of recovery mechanism 
, I can put to auto detect it and fix it.


Any help will be greatly appreciated.

Thanks

Alok

NOTICE: The information contained in this email and any document 
attached hereto is intended only for the named recipient(s). It is the 
property of Cernium Corporation and shall not be used, disclosed or 
reproduced without the express written consent of Cernium Corporation. 
If you are not the intended recipient (or the employee or agent 
responsible for delivering this message in confidence to the intended 
recipient(s)), you are hereby notified that you have received this 
transmittal in error, and any review, dissemination, distribution or 
copying of this transmittal or its attachments is strictly prohibited. 
If you have received this transmittal and/or attachments in error, 
please notify me immediately by reply email or telephone and 
immediately delete this message and all its attachments. Thank you.


  
  
___

Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com  
mailto:Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
   

NOTICE: The information contained in this email and any document 
attached hereto is intended only for the named recipient(s). It is the 
property of Cernium Corporation and shall not be used, disclosed or 
reproduced without the express written consent of Cernium Corporation. 
If you are not the intended recipient (or the employee or agent 
responsible for delivering this message in confidence to the intended 
recipient(s)), you are hereby notified that you have received this 
transmittal in error, and any review, dissemination, distribution or 
copying of this transmittal or its attachments is strictly prohibited. 
If you have received this transmittal and/or attachments in error, 
please notify me immediately by reply email or telephone and 
immediately delete this message and all its attachments. Thank you.

--
This message has been scanned for viruses and
dangerous content by *MailScanner* http://www.mailscanner.info/, and is
believed to be clean.




--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
Davinci-linux-open-source mailing list

Re: [PATCH] DM365: fixed second serial port

2010-06-07 Thread Thomas Koeller
On Monday 07 June 2010 16:22:37 thomas.koel...@baslerweb.com wrote:
 From: Thomas Koeller thomas.koel...@baslerweb.com

 The register base address for the second serial port (UART1) was
 wrong.

 Signed-off-by: Thomas Koeller thomas.koel...@baslerweb.com
Sorry, was too quick to send. This patch is broken - please ignore.

Thomas
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] DM365: fixed second serial port

2010-06-07 Thread Thomas Koeller
On Monday 07 June 2010 16:27:38 thomas.koel...@baslerweb.com wrote:
 From: Thomas Koeller thomas.koel...@baslerweb.com

 The register base address for the second serial port (UART1) was
 wrong.

 Signed-off-by: Thomas Koeller thomas.koel...@baslerweb.com
 ---
Still struggling with git - please ignore

Thomas
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 0/3] davinci: spi: replace existing SPI driver

2010-06-07 Thread Brian Niebuhr
NOTE

This patch requires the EDMA patch at:

http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2010-March/018022.html

which has since been reverted out of the davinci kernel.


INTRODUCTION

I have been working on a custom OMAP-L138 board that has multiple spi
devices (seven) on one controller.  These devices have a wide range of
transfer parameters (speed, phase, polarity, internal and gpio chip
selects).  During my testing I found multiple errors in the davinci spi
driver as a result of this complex setup.  The primary issues were:

1. There is a race condition due to the SPIBUF read busy-waits for slow
devices
2. I found some DMA transfer length errors under some conditions
3. The chip select code caused extra byte transfers (with no chip
select active) due to writes to SPIDAT1
4. Several issues prevented using multiple SPI devices, especially
the DMA code, as disucussed previously on the davinci list.

The fixes to these problems were not simple.  I ended up making fairly
large changes to the driver, and those changes are contained in these
patches.  The full list of changes follows.

CHANGE LIST

1. davinci_spi_chipelect() now performs both activation and deactivation
of chip selects.  This lets spi_bitbang fully control chip
select activation, as intended by the SPI API.
2. Chip select activation does not cause extra writes to the SPI bus
3. Chip select activation does not use SPIDEF for control.  This change
will also allow for implementation of inverted (active high)
chip selects in the future.
4. Added back gpio chip select capability from the old driver
5. Fixed prescale calculation for non-integer fractions of spi clock
6. Allow specification of SPI transfer parameters on a per-device
(instead of per-controller) basis
7. Allow specification of polled, interrupt-based, or DMA operation on
a per-device basis
8. Allow DMA with when more than one device is connected
9. Combined pio and dma txrx_bufs functions into one since they share
large parts of their functionality, and to simplify item (8).
10. Use only SPIFMT0 to allow more than 4 devices

TESTING

I have tested the driver using a custom SPI stress test on my
OMAP-L138-based board with three devices connected.  I have tested
configurations with all three devices polled, all three interrupt-based,
all three DMA, and a mixture.

I have compiled with the davinci_all_defconfig, but I don't have EVMs
for the other davinci platforms to test with.

SUMMARY

This patch solves a lot of issues that should save a lot of people time
down the road.  Since I posted the original patch I have had at least 5
people contact me personally to get help applying the patch because SPI
was broken on their boards.  I have heard back from at least 2 that the
original patch worked for them.  

I appreciate any testing and feedback that others can provide.

Brian Niebuhr (3):
  davinci: spi: remove old Davinci SPI driver
  davinci: spi: add replacement SPI driver
  davinci: spi: modify platform data for updated SPI driver

 arch/arm/mach-davinci/board-dm355-evm.c |   10 +
 arch/arm/mach-davinci/board-dm355-leopard.c |   10 +
 arch/arm/mach-davinci/board-dm365-evm.c |   10 +
 arch/arm/mach-davinci/dm355.c   |6 -
 arch/arm/mach-davinci/dm365.c   |6 -
 arch/arm/mach-davinci/include/mach/spi.h|   41 +-
 drivers/spi/davinci_spi.c   | 1196 ++-
 drivers/spi/davinci_spi.h   |  186 +
 8 files changed, 681 insertions(+), 784 deletions(-)
 create mode 100644 drivers/spi/davinci_spi.h

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 1/3] davinci: spi: remove old Davinci SPI driver

2010-06-07 Thread Brian Niebuhr

Signed-off-by: Brian Niebuhr bnieb...@efjohnson.com
---
 drivers/spi/davinci_spi.c | 1256 -
 1 files changed, 0 insertions(+), 1256 deletions(-)
 delete mode 100644 drivers/spi/davinci_spi.c

diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
deleted file mode 100644
index 95afb6b..000
--- a/drivers/spi/davinci_spi.c
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*
- * Copyright (C) 2009 Texas Instruments.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include linux/interrupt.h
-#include linux/io.h
-#include linux/gpio.h
-#include linux/module.h
-#include linux/delay.h
-#include linux/platform_device.h
-#include linux/err.h
-#include linux/clk.h
-#include linux/dma-mapping.h
-#include linux/spi/spi.h
-#include linux/spi/spi_bitbang.h
-#include linux/slab.h
-
-#include mach/spi.h
-#include mach/edma.h
-
-#define SPI_NO_RESOURCE((resource_size_t)-1)
-
-#define SPI_MAX_CHIPSELECT 2
-
-#define CS_DEFAULT 0xFF
-
-#define SPI_BUFSIZ (SMP_CACHE_BYTES + 1)
-#define DAVINCI_DMA_DATA_TYPE_S8   0x01
-#define DAVINCI_DMA_DATA_TYPE_S16  0x02
-#define DAVINCI_DMA_DATA_TYPE_S32  0x04
-
-#define SPIFMT_PHASE_MASK  BIT(16)
-#define SPIFMT_POLARITY_MASK   BIT(17)
-#define SPIFMT_DISTIMER_MASK   BIT(18)
-#define SPIFMT_SHIFTDIR_MASK   BIT(20)
-#define SPIFMT_WAITENA_MASKBIT(21)
-#define SPIFMT_PARITYENA_MASK  BIT(22)
-#define SPIFMT_ODD_PARITY_MASK BIT(23)
-#define SPIFMT_WDELAY_MASK 0x3f00u
-#define SPIFMT_WDELAY_SHIFT24
-#define SPIFMT_CHARLEN_MASK0x001Fu
-
-/* SPIGCR1 */
-#define SPIGCR1_SPIENA_MASK0x0100u
-
-/* SPIPC0 */
-#define SPIPC0_DIFUN_MASK  BIT(11) /* MISO */
-#define SPIPC0_DOFUN_MASK  BIT(10) /* MOSI */
-#define SPIPC0_CLKFUN_MASK BIT(9)  /* CLK */
-#define SPIPC0_SPIENA_MASK BIT(8)  /* nREADY */
-#define SPIPC0_EN1FUN_MASK BIT(1)
-#define SPIPC0_EN0FUN_MASK BIT(0)
-
-#define SPIINT_MASKALL 0x0101035F
-#define SPI_INTLVL_1   0x01FFu
-#define SPI_INTLVL_0   0xu
-
-/* SPIDAT1 */
-#define SPIDAT1_CSHOLD_SHIFT   28
-#define SPIDAT1_CSNR_SHIFT 16
-#define SPIGCR1_CLKMOD_MASKBIT(1)
-#define SPIGCR1_MASTER_MASK BIT(0)
-#define SPIGCR1_LOOPBACK_MASK  BIT(16)
-
-/* SPIBUF */
-#define SPIBUF_TXFULL_MASK BIT(29)
-#define SPIBUF_RXEMPTY_MASKBIT(31)
-
-/* Error Masks */
-#define SPIFLG_DLEN_ERR_MASK   BIT(0)
-#define SPIFLG_TIMEOUT_MASKBIT(1)
-#define SPIFLG_PARERR_MASK BIT(2)
-#define SPIFLG_DESYNC_MASK BIT(3)
-#define SPIFLG_BITERR_MASK BIT(4)
-#define SPIFLG_OVRRUN_MASK BIT(6)
-#define SPIFLG_RX_INTR_MASKBIT(8)
-#define SPIFLG_TX_INTR_MASKBIT(9)
-#define SPIFLG_BUF_INIT_ACTIVE_MASKBIT(24)
-#define SPIFLG_MASK(SPIFLG_DLEN_ERR_MASK \
-   | SPIFLG_TIMEOUT_MASK | SPIFLG_PARERR_MASK \
-   | SPIFLG_DESYNC_MASK | SPIFLG_BITERR_MASK \
-   | SPIFLG_OVRRUN_MASK | SPIFLG_RX_INTR_MASK \
-   | SPIFLG_TX_INTR_MASK \
-   | SPIFLG_BUF_INIT_ACTIVE_MASK)
-
-#define SPIINT_DLEN_ERR_INTR   BIT(0)
-#define SPIINT_TIMEOUT_INTRBIT(1)
-#define SPIINT_PARERR_INTR BIT(2)
-#define SPIINT_DESYNC_INTR BIT(3)
-#define SPIINT_BITERR_INTR BIT(4)
-#define SPIINT_OVRRUN_INTR BIT(6)
-#define SPIINT_RX_INTR BIT(8)
-#define SPIINT_TX_INTR BIT(9)
-#define SPIINT_DMA_REQ_EN  BIT(16)
-#define SPIINT_ENABLE_HIGHZBIT(24)
-
-#define SPI_T2CDELAY_SHIFT 16
-#define SPI_C2TDELAY_SHIFT 24
-
-/* SPI Controller registers */
-#define SPIGCR00x00
-#define SPIGCR10x04
-#define SPIINT 0x08
-#define SPILVL 0x0c
-#define SPIFLG 0x10
-#define SPIPC0 0x14
-#define SPIPC1 0x18
-#define SPIPC2 0x1c
-#define SPIPC3 0x20
-#define SPIPC4 0x24
-#define SPIPC5 0x28
-#define SPIPC6 0x2c
-#define SPIPC7 0x30
-#define SPIPC8 0x34
-#define SPIDAT00x38
-#define SPIDAT10x3c
-#define SPIBUF 0x40
-#define 

RE: usb 1-1: device descriptor read/64, error -110

2010-06-07 Thread Alok Kumar
Thanks for the response.

 

My problem is this is not reproducible (once in 2-3 months). I noticed
this device (I have 2 like this different make) stopped recording and
dmesg has lots of error like below. Fsck.ext3  does not fix it.

 

Any suggestions what I could infer from these messages. 

 

a)  Periodic reset high speed USB device

--Syslog ---

 

4 16:21:47 (none) kernel: usb 1-1: reset high speed USB device using
musb_hdrc and address 2

Jun  4 17:44:32 (none) kernel: usb 1-1: reset high speed USB device
using musb_hdrc and address 2

Jun  4 19:07:17 (none) kernel: usb 1-1: reset high speed USB device
using musb_hdrc and address 2

 

b)  sd 0:0:0:0: [sda] Unhandled sense code

 

dmesg---
-

 

Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1310951

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1835111

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1835143

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1835159

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1835183

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1914463

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1914543

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 1914623

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 2097223

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 2097239

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 2458087

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 2472839

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 2472903

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 3407935

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 3409287

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 3670079

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 3671591

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 ASCQ=0x0

end_request: I/O error, dev sda, sector 63

sd 0:0:0:0: [sda] Unhandled sense code

sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08

sd 0:0:0:0: [sda] Sense Key : 0x7 [current]

sd 0:0:0:0: [sda] ASC=0x27 

Re: [PATCH] DM365: fixed second serial port

2010-06-07 Thread Sergei Shtylyov

Hello.

thomas.koel...@baslerweb.com wrote:


From: Thomas Koeller thomas.koel...@baslerweb.com



The register base address for the second serial port (UART1) was
wrong.



Signed-off-by: Thomas Koeller thomas.koel...@baslerweb.com
---
 arch/arm/mach-davinci/dm365.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)



diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a146849..cf08950 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -41,6 +41,9 @@
 
 #define DM365_REF_FREQ		2400	/* 24 MHz on the DM365 EVM */
 
+#undef DAVINCI_UART1_BASE	/* Value in serial.h is wrong for DM365 */

+#define DAVINCI_UART1_BASE (IO_PHYS + 0x106000)
+
 static struct pll_data pll1_data = {
.num= 1,
.phys_base  = DAVINCI_PLL1_BASE,
@@ -1020,6 +1023,9 @@ static struct davinci_timer_info dm365_timer_info = {
.clocksource_id = T0_TOP,
 };
 
+#undef DAVINCI_UART1_BASE	/* Value in serial.h is wrong for DM365 */

+#define DAVINCI_UART1_BASE (IO_PHYS + 0x106000)
+
 static struct plat_serial8250_port dm365_serial_platform_data[] = {
{
.mapbase= DAVINCI_UART0_BASE,


   Why do it twice in the same file?!

WBR, Sergei
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


DM365EVM USB on KHilman Git Tree

2010-06-07 Thread Kieran Bingham

Hi Guys,

Anyone know why the USB is disabled on the DM365EVM in the Khilman tree:

on branch master @ 
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git


I've tried adding

static void dm365evm_usb_configure(void)
{
   davinci_cfg_reg(DM365_GPIO33);
   gpio_request(33, usb);
   gpio_direction_output(33, 1);
   davinci_setup_usb(500, 8);
}

and calling that from within dm365_evm_init()

but it just causes the kernel to crash early on.

I'll have to get the CCS / JTAG out to find out where its stalled - but 
thought it was worth chasing on here


Has anyone tested the USB Host on the DM365EVM on the latest KHilman kernel?
--
Regards

Kieran Bingham
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: DM365EVM USB on KHilman Git Tree

2010-06-07 Thread Sergei Shtylyov

Hello.

Kieran Bingham wrote:


Anyone know why the USB is disabled on the DM365EVM in the Khilman tree:


on branch master @ 
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git



I've tried adding



static void dm365evm_usb_configure(void)
{
   davinci_cfg_reg(DM365_GPIO33);
   gpio_request(33, usb);
   gpio_direction_output(33, 1);
   davinci_setup_usb(500, 8);
}



and calling that from within dm365_evm_init()



but it just causes the kernel to crash early on.


I'll have to get the CCS / JTAG out to find out where its stalled - but 
thought it was worth chasing on here


   You can patch printk() with printascii() call and enable 
CONFIG_DEBUG_LL in the Kernel hacking menu to get the early kernel log.


Has anyone tested the USB Host on the DM365EVM on the latest KHilman 
kernel?


   Apparently not, as it's still not enabled.


--
Regards


WBR, Sergei

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: Touchscreen - MFD driver for TPS6507x family

2010-06-07 Thread Nicolas Luna
Hi Todd,

I got custum hardware based on OMAP-L138 EVM, with OMAPL138 and TPS65070.
It's ok you answered my question why the INT pins is not used.

I did more tests and you are right, the touchscreen driver is not locking
out all other access to the I2C bus, that was a mistake from my side. So
everything seems to be ok even if there's a lot a communication on the bus.

Thank you.

Nicolas



On Fri, Jun 4, 2010 at 4:33 PM, Todd Fischer todd.fisc...@ridgerun.comwrote:

  Hi Nicolas,


 On Fri, 2010-06-04 at 16:15 -0400, Nicolas Luna wrote:

 Hi,



  I downloaded and tried the kernel v2.6.34 from *
 linux/kernel/git/khilman/linux-davinci.git**/ *to get the touchscreen
 patch. It is working well, but I wonder if it is normal that the touchscreen
 constantly use the I2C bus, even if I don't touch to the touchscreen.

 No, that is not normal.  The hardware I was using doesn't have the TPS6507x
 interrupt pin connected, so I couldn't test that code path (and thus didn't
 attempt to include it).  What hardware are you using?


  Because of that, it is not possible to have an other device on the bus. Is
 there any specific reason why the driver do not use the INT pin from the
 TPS6507x to free a little bit the I2C bus.


 Also, I didn't think the driver was locking out all other access to the I2C
 bus.  I will enhance my test suite to check for that case.

 Todd

  Thanks



  Nicolas




  ___
 Davinci-linux-open-source mailing 
 listdavinci-linux-open-sou...@linux.davincidsp.comhttp://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: Touchscreen - MFD driver for TPS6507x family

2010-06-07 Thread n...@max01.eu

Dear Nicolas,
 

 Hi,

 I downloaded and tried the kernel v2.6.34 from *
 linux/kernel/git/khilman/linux-davinci.git**/ *to get the touchscreen patch.
 
can you please tell me which kernel tree and branch you use, exactly, and what
your
.config file looks like?
 
I have trouble to get the touch-screen driver running on an OMAP-L138 EVM board.
 
Regards,
 
Bastian. 
 
 
 
 ___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source