Re: [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-19 Thread Vimal Singh
On Wed, Nov 18, 2009 at 10:33 PM, Tony Lindgren t...@atomide.com wrote:
 * Vimal Singh vimal.neww...@gmail.com [091118 07:25]:
 On Fri, Nov 13, 2009 at 2:10 AM, Tony Lindgren t...@atomide.com wrote:
  * Vimal Singh vimal.neww...@gmail.com [091110 02:08]:
  From 42f080e0915bbce1509fc8ab3773569fec0a44f1 Mon Sep 17 00:00:00 2001
  From: Vimal Singh vimalsi...@ti.com
  Date: Tue, 10 Nov 2009 11:39:39 +0530
  Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards
 

 [...]

  +     if (!(__raw_readw(fpga_map_addr + REG_FPGA_REV)))
  +             /* we dont have an DEBUG FPGA??? */
  +             /* Depend on #defines!! default to strata boot return param 
  */
  +             return 0x0;
 
  Should iounmap before returning, or goto unmap.

 will correct it in next version.

 
 
  +     /* S8-DIP-OFF = 1, S8-DIP-ON = 0 */
  +     cs = __raw_readw(fpga_map_addr + REG_FPGA_DIP_SWITCH_INPUT2)  0xf;
  +
  +     /* ES2.0 SDP's onwards 4 dip switches are provided for CS */
  +     if (omap_rev() = OMAP3430_REV_ES1_0)
  +             /* change (S8-1:4=DS-2:0) to (S8-4:1=DS-2:0) */
  +             cs = ((cs  8)  3) | ((cs  4)  1) |
  +                     ((cs  2)  1) | ((cs  1)  3);
  +     else
  +             /* change (S8-1:3=DS-2:0) to (S8-3:1=DS-2:0) */
  +             cs = ((cs  4)  2) | (cs  2) | ((cs  1)  2);
  +
  +     iounmap(fpga_map_addr);
  +     return cs;
  +}
  +
  +/**
  + * sdp3430_flash_init - Identify devices connected to GPMC and register.
  + *
  + * @return - void.
  + */
  +void __init sdp_flash_init(void)
  +{
  +     u8              cs = 0;
  +     u8              nandcs = GPMC_CS_NUM + 1;
  +     u8              onenandcs = GPMC_CS_NUM + 1;
  +     u8              idx;
  +     unsigned char   *config_sel = NULL;
  +
  +     /* REVISIT: Is this return correct idx for 2430 SDP?
  +      * for which cs configuration matches for 2430 SDP?
  +      */
  +     idx = get_gpmc0_type();
  +     if (idx = MAX_SUPPORTED_GPMC_CONFIG) {
  +             printk(KERN_ERR %s: Invalid chip select: %d\n, __func__, 
  cs);
  +             return;
  +     }
  +     config_sel = (unsigned char *)(chip_sel_sdp[idx]);
  +
  +     /* Configure start address and size of NOR device */
  +     if (omap_rev() = OMAP3430_REV_ES1_0) {
  +             sdp_nor_resource.start  = FLASH_BASE_SDPV2;
  +             sdp_nor_resource.end    = FLASH_BASE_SDPV2
  +                                             + FLASH_SIZE_SDPV2 - 1;
  +     } else {
  +             sdp_nor_resource.start  = FLASH_BASE_SDPV1;
  +             sdp_nor_resource.end    = FLASH_BASE_SDPV1
  +                                             + FLASH_SIZE_SDPV1 - 1;
  +     }
 
  This should be done with gpmc_cs_request using the chip select and size.
  Please see gpmc_smc91x_init() for an example.

 I do not think this should be done with 'gpmc_cs_request'. NOR flashes
 have been treated somehow differently.

 Can you please specify what the issue using gpmc_cs_request is?

 To me it seems that if you're not doing gpmc_cs_request, the gpmc can
 be in uninitialized state. I don't think we want to build our kernel
 assuming some hardcoded GPMC settings from the bootloader.

Sorry I was a bit confused. I will fix this too in my next version.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards

2009-11-19 Thread Vimal Singh
On Wed, Nov 18, 2009 at 10:37 PM, Tony Lindgren t...@atomide.com wrote:
 * Vimal Singh vimal.neww...@gmail.com [091118 06:38]:
 Tony,

 On Fri, Nov 13, 2009 at 2:14 AM, Tony Lindgren t...@atomide.com wrote:
  * Vimal Singh vimal.neww...@gmail.com [091110 02:08]:
  From 6f535d7128ca392458dd0cb31d138cda84747c06 Mon Sep 17 00:00:00 2001
  From: Vimal Singh vimalsi...@ti.com
  Date: Tue, 10 Nov 2009 11:42:45 +0530
  Subject: [PATCH] OMAP3: Add support for NAND on ZOOM2/LDP boards

 [...]

  +static int omap_ldp_nand_unlock(struct mtd_info *mtd, loff_t ofs, 
  uint64_t len)
  +{
  +     int ret = 0;
  +     int chipnr;
  +     int status;
  +     unsigned long page;
  +     struct nand_chip *this = mtd-priv;
  +     printk(KERN_INFO nand_unlock: start: %08x, length: %d!\n,
  +                     (int)ofs, (int)len);
  +
  +     /* select the NAND device */
  +     chipnr = (int)(ofs  this-chip_shift);
  +     this-select_chip(mtd, chipnr);
  +     /* check the WP bit */
  +     this-cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
  +     if ((this-read_byte(mtd)  0x80) == 0) {
  +             printk(KERN_ERR nand_unlock: Device is write 
  protected!\n);
  +             ret = -EINVAL;
  +             goto out;
  +     }
  +
  +     if ((ofs  (mtd-writesize - 1)) != 0) {
  +             printk(KERN_ERR nand_unlock: Start address must be
  +                             beginning of nand page!\n);
  +             ret = -EINVAL;
  +             goto out;
  +     }
  +
  +     if (len == 0 || (len  (mtd-writesize - 1)) != 0) {
  +             printk(KERN_ERR nand_unlock: Length must be a multiple of 
  +                             nand page size!\n);
  +             ret = -EINVAL;
  +             goto out;
  +     }
  +
  +     /* submit address of first page to unlock */
  +     page = (unsigned long)(ofs  this-page_shift);
  +     this-cmdfunc(mtd, NAND_CMD_UNLOCK1, -1, page  this-pagemask);
  +
  +     /* submit ADDRESS of LAST page to unlock */
  +     page += (unsigned long)((ofs + len)  this-page_shift) ;
  +     this-cmdfunc(mtd, NAND_CMD_UNLOCK2, -1, page  this-pagemask);
  +
  +     /* call wait ready function */
  +     status = this-waitfunc(mtd, this);
  +     udelay(1000);
  +     /* see if device thinks it succeeded */
  +     if (status  0x01) {
  +             /* there was an error */
  +             printk(KERN_ERR nand_unlock: error status =0x%08x , 
  status);
  +             ret = -EIO;
  +             goto out;
  +     }
  +
  + out:
  +     /* de-select the NAND device */
  +     this-select_chip(mtd, -1);
  +     return ret;
  +}
 
  Isn't the unlocking generic to the NAND device driver? Or is it somehow 
  board
  specific?

 Yes, zoom2 boards come up with whole NAND locked, whereas it is not
 case for SDP boards.

 But the procedure should be done under drivers/mtd I believe using some
 standard tools.

OK, I'll take this discussion to mtd mailing list. For now I'll remove
this from here.


 
 
  +static struct mtd_partition ldp_nand_partitions[] = {
  +     /* All the partition sizes are listed in terms of NAND block size */
  +     {
  +             .name           = X-Loader-NAND,
  +             .offset         = 0,
  +             .size           = 4 * (64 * 2048),      /* 512KB, 0x8 */
  +             .mask_flags     = MTD_WRITEABLE,        /* force read-only 
  */
  +     },
  +     {
  +             .name           = U-Boot-NAND,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x8 
  */
  +             .size           = 10 * (64 * 2048),     /* 1.25MB, 0x14 
  */
  +             .mask_flags     = MTD_WRITEABLE,        /* force read-only 
  */
  +     },
  +     {
  +             .name           = Boot Env-NAND,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0x1c */
  +             .size           = 2 * (64 * 2048),      /* 256KB, 0x4 */
  +     },
  +     {
  +             .name           = Kernel-NAND,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0x020*/
  +             .size           = 240 * (64 * 2048),    /* 30M, 0x1E0 */
  +     },
  +#ifdef CONFIG_MACH_OMAP_ZOOM2
  +     {
  +             .name           = system,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0x200 */
  +             .size           = 1280 * (64 * 2048),   /* 160M, 0xA00 
  */
  +     },
  +     {
  +             .name           = userdata,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0xC00 */
  +             .size           = 256 * (64 * 2048),    /* 32M, 0x200 */
  +     },
  +     {
  +             .name           = cache,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0xE00 */
  +             .size           = 256 * (64 * 2048),    /* 32M, 0x200 */
  +     },
  +#else
  +     {
  +             .name           = File System - NAND,
  +             .offset         = MTDPART_OFS_APPEND,   /* Offset = 
  0x200 */
  +   

[PATCH 0/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread G.N, Vijayakumar
With 3 patches I am trying to 
1. Remove hardcoded VDD1 OPP values and make threshold generic
2. Remove hardcoded VDD2 OPP values and make threshold generic
3. adding new api inplace of MIN/MAX_VDD1/VDD2_OPP 
 to support 3630 OPP constraning along with the existing 3430 
constraint.

Patches are rebased on the 2.6.32-rc7.

Patches have been tested for 3630 for 2.6.32-rc5.


Thanks and Regards
Vijay
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread G.N, Vijayakumar
From e5e225fc19410178ad378acc74183a1bf1f0251a Mon Sep 17 00:00:00 2001
From: Vijay Kumar vijaykumar...@ti.com
Date: Thu, 19 Nov 2009 14:39:59 +0530
Subject: [PATCH 1/3] omap3: pm: Adding facility to support OPP dynamically
 introduce  new accessor api's for
 1. Correcting VDD2 DVFS OPP threshold
 2. Removing hardcoded VDD1 OPP values and make threshold generic


Signed-off-by: Vijay Kumar vijaykumar...@ti.com
Signed-off-by: Charulatha V ch...@ti.com
---
 arch/arm/mach-omap2/clock34xx.c|2 +-
 arch/arm/mach-omap2/pm.c   |5 ++-
 arch/arm/mach-omap2/pm34xx.c   |   39 
 arch/arm/mach-omap2/resource34xx.c |3 +-
 arch/arm/plat-omap/include/plat/omap-pm.h  |   27 +++
 arch/arm/plat-omap/include/plat/omap34xx.h |   11 +---
 6 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index da5bc1f..9cfc7a0 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -1042,7 +1042,7 @@ static unsigned long omap3_clkoutx2_recalc(struct clk 
*clk)
 #if defined(CONFIG_ARCH_OMAP3)
 
 #ifdef CONFIG_CPU_FREQ
-static struct cpufreq_frequency_table freq_table[MAX_VDD1_OPP+1];
+static struct cpufreq_frequency_table freq_table[MAX_VDD1_OPPS+1];
 
 void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
 {
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index b324315..ba018f8 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -14,6 +14,7 @@
 
 #include plat/resource.h
 #include plat/omap34xx.h
+#include plat/omap-pm.h
 
 #include pm.h
 
@@ -92,13 +93,13 @@ static ssize_t vdd_opp_store(struct kobject *kobj, struct 
kobj_attribute *attr,
}
 
if (attr == vdd1_opp_attr) {
-   if (value  1 || value  5) {
+   if (value  MIN_VDD1_OPP || value  MAX_VDD1_OPP) {
printk(KERN_ERR vdd_opp_store: Invalid value\n);
return -EINVAL;
}
resource_set_opp_level(VDD1_OPP, value, flags);
} else if (attr == vdd2_opp_attr) {
-   if (value  2 || value  3) {
+   if (value  MIN_VDD2_OPP || value  3) {
printk(KERN_ERR vdd_opp_store: Invalid value\n);
return -EINVAL;
}
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c328164..1ed7f53 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1059,6 +1059,45 @@ void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
prm_setup.vdd1_off = setup_vc-vdd1_off;
 }
 
+int omap3_get_max_vdd1_opp(void)
+{
+   if (cpu_is_omap3630())
+   return VDD1_OPP4;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD1_OPP5;
+}
+EXPORT_SYMBOL(omap3_get_max_vdd1_opp);
+
+int omap3_get_min_vdd1_opp(void)
+{
+   if (cpu_is_omap3630())
+   return VDD1_OPP1;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD1_OPP1;
+}
+EXPORT_SYMBOL(omap3_get_min_vdd1_opp);
+
+int omap3_get_max_vdd2_opp(void)
+{
+   if (cpu_is_omap3630())
+   return VDD2_OPP3;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD2_OPP3;
+
+}
+EXPORT_SYMBOL(omap3_get_max_vdd2_opp);
+
+int omap3_get_min_vdd2_opp(void)
+{
+   if (cpu_is_omap3630())
+   return VDD2_OPP2;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD2_OPP1;
+
+}
+EXPORT_SYMBOL(omap3_get_min_vdd2_opp);
+
+
 static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
 {
struct power_state *pwrst;
diff --git a/arch/arm/mach-omap2/resource34xx.c 
b/arch/arm/mach-omap2/resource34xx.c
index 04be4d2..cc85601 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -382,7 +382,8 @@ int set_opp(struct shared_resource *resp, u32 target_level)
 * throughput in KiB/s for 100 Mhz = 100 * 1000 * 4.
 */
if (target_level = 3)
-   resource_request(vdd2_opp, vdd2_dev, 40);
+   resource_request(vdd2_opp, vdd2_dev,
+   (4 * (l3_opps + MAX_VDD2_OPP)-rate / 1000));
 
} else if (resp == vdd2_resp) {
tput = target_level;
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h 
b/arch/arm/plat-omap/include/plat/omap-pm.h
index 583e540..b089ccc 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -322,5 +322,32 @@ unsigned long omap_pm_cpu_get_freq(void);
  */
 int omap_pm_get_dev_context_loss_count(struct device *dev);
 
+/**
+ * omap3_get_max_opp - report Max OPP entries available for supplied VDD1 
resource
+ *
+ * Returns the Max OPP entries available for 

[PATCH 2/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread G.N, Vijayakumar
From 3a4213ec9284c04e1a6a3b14094819e70ac951d9 Mon Sep 17 00:00:00 2001
From: Vijay Kumar vijaykumar...@ti.com
Date: Thu, 19 Nov 2009 15:06:30 +0530
Subject: [PATCH 2/3] Correct VDD2 DVFS OPP threshold

VDD2 OPP is linked with VDD1 OPP. THis patch removes hardcoded VDD2 OPP
values and make threshold generic

Signed-off-by: Vishwanath B.S. vishwanath...@ti.com
Signed-off-by: Vijay Kumar vijaykumar...@ti.com
---
 arch/arm/mach-omap2/resource34xx.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/resource34xx.c 
b/arch/arm/mach-omap2/resource34xx.c
index cc85601..3bdb1f9 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -372,7 +372,7 @@ int set_opp(struct shared_resource *resp, u32 target_level)
int ind;
 
if (resp == vdd1_resp) {
-   if (target_level  3)
+   if (target_level  MAX_VDD2_OPP)
resource_release(vdd2_opp, vdd2_dev);
 
resource_set_opp_level(VDD1_OPP, target_level, 0);
@@ -381,7 +381,7 @@ int set_opp(struct shared_resource *resp, u32 target_level)
 * is at 100Mhz or above.
 * throughput in KiB/s for 100 Mhz = 100 * 1000 * 4.
 */
-   if (target_level = 3)
+   if (target_level  MIN_VDD2_OPP)
resource_request(vdd2_opp, vdd2_dev,
(4 * (l3_opps + MAX_VDD2_OPP)-rate / 1000));
 
@@ -391,7 +391,7 @@ int set_opp(struct shared_resource *resp, u32 target_level)
/* Convert the tput in KiB/s to Bus frequency in MHz */
req_l3_freq = (tput * 1000)/4;
 
-   for (ind = 2; ind = MAX_VDD2_OPP; ind++)
+   for (ind = MIN_VDD2_OPP; ind = MAX_VDD2_OPP; ind++)
if ((l3_opps + ind)-rate = req_l3_freq) {
target_level = ind;
break;
-- 
1.5.4.3




Thanks and Regards
Vijay--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread G.N, Vijayakumar
From 202416dbdf3fce31bfd76f1e74dda89b382a78c3 Mon Sep 17 00:00:00 2001
From: Vijay Kumar vijaykumar...@ti.com
Date: Thu, 19 Nov 2009 15:07:38 +0530
Subject: [PATCH 3/3] OMAP 3630: Update VDD2 values
 The OMAP3630 VDD2 minimum value is 1 and Maximum value is 2. The VDD2
 API's are updated to return proper VDD2 values.


Signed-off-by: Charulatha V ch...@ti.com
Signed-off-by: Manjunath GK manj...@ti.com
Signed-off-by: Vijay Kumar vijaykumar...@ti.com
---
 arch/arm/mach-omap2/pm34xx.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 1ed7f53..c240804 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1080,7 +1080,7 @@ EXPORT_SYMBOL(omap3_get_min_vdd1_opp);
 int omap3_get_max_vdd2_opp(void)
 {
if (cpu_is_omap3630())
-   return VDD2_OPP3;
+   return VDD2_OPP2;
else /* Place holder for other 34xx (3430/3440) */
return VDD2_OPP3;
 
@@ -1090,9 +1090,9 @@ EXPORT_SYMBOL(omap3_get_max_vdd2_opp);
 int omap3_get_min_vdd2_opp(void)
 {
if (cpu_is_omap3630())
-   return VDD2_OPP2;
-   else /* Place holder for other 34xx (3430/3440) */
return VDD2_OPP1;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD2_OPP2;
 
 }
 EXPORT_SYMBOL(omap3_get_min_vdd2_opp);
-- 
1.5.4.3
 



Thanks and Regards
Vijay--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread Menon, Nishanth
G.N, Vijayakumar said the following on 11/19/2009 05:24 AM:
 From e5e225fc19410178ad378acc74183a1bf1f0251a Mon Sep 17 00:00:00 2001
 From: Vijay Kumar vijaykumar...@ti.com
 Date: Thu, 19 Nov 2009 14:39:59 +0530
 Subject: [PATCH 1/3] omap3: pm: Adding facility to support OPP dynamically
  introduce  new accessor api's for
  1. Correcting VDD2 DVFS OPP threshold
  2. Removing hardcoded VDD1 OPP values and make threshold generic


 Signed-off-by: Vijay Kumar vijaykumar...@ti.com
 Signed-off-by: Charulatha V ch...@ti.com
 ---
  arch/arm/mach-omap2/clock34xx.c|2 +-
  arch/arm/mach-omap2/pm.c   |5 ++-
  arch/arm/mach-omap2/pm34xx.c   |   39 
 
  arch/arm/mach-omap2/resource34xx.c |3 +-
  arch/arm/plat-omap/include/plat/omap-pm.h  |   27 +++
  arch/arm/plat-omap/include/plat/omap34xx.h |   11 +---
  6 files changed, 79 insertions(+), 8 deletions(-)

 diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
 index da5bc1f..9cfc7a0 100644
 --- a/arch/arm/mach-omap2/clock34xx.c
 +++ b/arch/arm/mach-omap2/clock34xx.c
 @@ -1042,7 +1042,7 @@ static unsigned long omap3_clkoutx2_recalc(struct clk 
 *clk)
  #if defined(CONFIG_ARCH_OMAP3)
  
  #ifdef CONFIG_CPU_FREQ
 -static struct cpufreq_frequency_table freq_table[MAX_VDD1_OPP+1];
 +static struct cpufreq_frequency_table freq_table[MAX_VDD1_OPPS+1];
  
  void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
  {
 diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
 index b324315..ba018f8 100644
 --- a/arch/arm/mach-omap2/pm.c
 +++ b/arch/arm/mach-omap2/pm.c
 @@ -14,6 +14,7 @@
  
  #include plat/resource.h
  #include plat/omap34xx.h
 +#include plat/omap-pm.h
  
  #include pm.h
  
 @@ -92,13 +93,13 @@ static ssize_t vdd_opp_store(struct kobject *kobj, struct 
 kobj_attribute *attr,
   }
  
   if (attr == vdd1_opp_attr) {
 - if (value  1 || value  5) {
 + if (value  MIN_VDD1_OPP || value  MAX_VDD1_OPP) {
   printk(KERN_ERR vdd_opp_store: Invalid value\n);
   return -EINVAL;
   }
   resource_set_opp_level(VDD1_OPP, value, flags);
   } else if (attr == vdd2_opp_attr) {
 - if (value  2 || value  3) {
 + if (value  MIN_VDD2_OPP || value  3) {
   printk(KERN_ERR vdd_opp_store: Invalid value\n);
   return -EINVAL;
   }
 diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
 index c328164..1ed7f53 100644
 --- a/arch/arm/mach-omap2/pm34xx.c
 +++ b/arch/arm/mach-omap2/pm34xx.c
 @@ -1059,6 +1059,45 @@ void omap3_pm_init_vc(struct prm_setup_vc *setup_vc)
   prm_setup.vdd1_off = setup_vc-vdd1_off;
  }
  
 +int omap3_get_max_vdd1_opp(void)
 +{
 + if (cpu_is_omap3630())
 + return VDD1_OPP4;
 + else /* Place holder for other 34xx (3430/3440) */
 + return VDD1_OPP5;
 +}
 +EXPORT_SYMBOL(omap3_get_max_vdd1_opp);
 +
 +int omap3_get_min_vdd1_opp(void)
 +{
 + if (cpu_is_omap3630())
 + return VDD1_OPP1;
 + else /* Place holder for other 34xx (3430/3440) */
 + return VDD1_OPP1;
 +}
 +EXPORT_SYMBOL(omap3_get_min_vdd1_opp);
 +
 +int omap3_get_max_vdd2_opp(void)
 +{
 + if (cpu_is_omap3630())
 + return VDD2_OPP3;
 + else /* Place holder for other 34xx (3430/3440) */
 + return VDD2_OPP3;
 +
 +}
 +EXPORT_SYMBOL(omap3_get_max_vdd2_opp);
 +
 +int omap3_get_min_vdd2_opp(void)
 +{
 + if (cpu_is_omap3630())
 + return VDD2_OPP2;
 + else /* Place holder for other 34xx (3430/3440) */
 + return VDD2_OPP1;
 +
 +}
 +EXPORT_SYMBOL(omap3_get_min_vdd2_opp);
 +
 +
  static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
  {
   struct power_state *pwrst;
 diff --git a/arch/arm/mach-omap2/resource34xx.c 
 b/arch/arm/mach-omap2/resource34xx.c
 index 04be4d2..cc85601 100644
 --- a/arch/arm/mach-omap2/resource34xx.c
 +++ b/arch/arm/mach-omap2/resource34xx.c
 @@ -382,7 +382,8 @@ int set_opp(struct shared_resource *resp, u32 
 target_level)
* throughput in KiB/s for 100 Mhz = 100 * 1000 * 4.
*/
   if (target_level = 3)
 - resource_request(vdd2_opp, vdd2_dev, 40);
 + resource_request(vdd2_opp, vdd2_dev,
 + (4 * (l3_opps + MAX_VDD2_OPP)-rate / 1000));
   
  
   } else if (resp == vdd2_resp) {
   tput = target_level;
 diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h 
 b/arch/arm/plat-omap/include/plat/omap-pm.h
 index 583e540..b089ccc 100644
 --- a/arch/arm/plat-omap/include/plat/omap-pm.h
 +++ b/arch/arm/plat-omap/include/plat/omap-pm.h
 @@ -322,5 +322,32 @@ unsigned long omap_pm_cpu_get_freq(void);
   */
  int omap_pm_get_dev_context_loss_count(struct device *dev);
  
 +/**
 + * 

Re: [PATCH 2/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread Nishanth Menon
G.N, Vijayakumar said the following on 11/19/2009 05:25 AM:
 From 3a4213ec9284c04e1a6a3b14094819e70ac951d9 Mon Sep 17 00:00:00 2001
 From: Vijay Kumar vijaykumar...@ti.com
 Date: Thu, 19 Nov 2009 15:06:30 +0530
 Subject: [PATCH 2/3] Correct VDD2 DVFS OPP threshold

 VDD2 OPP is linked with VDD1 OPP. THis patch removes hardcoded VDD2 OPP
 values and make threshold generic

 Signed-off-by: Vishwanath B.S. vishwanath...@ti.com
 Signed-off-by: Vijay Kumar vijaykumar...@ti.com
 ---
  arch/arm/mach-omap2/resource34xx.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

 diff --git a/arch/arm/mach-omap2/resource34xx.c 
 b/arch/arm/mach-omap2/resource34xx.c
 index cc85601..3bdb1f9 100644
 --- a/arch/arm/mach-omap2/resource34xx.c
 +++ b/arch/arm/mach-omap2/resource34xx.c
 @@ -372,7 +372,7 @@ int set_opp(struct shared_resource *resp, u32 
 target_level)
   int ind;
  
   if (resp == vdd1_resp) {
 - if (target_level  3)
 + if (target_level  MAX_VDD2_OPP)
   resource_release(vdd2_opp, vdd2_dev);
  
   resource_set_opp_level(VDD1_OPP, target_level, 0);
 @@ -381,7 +381,7 @@ int set_opp(struct shared_resource *resp, u32 
 target_level)
* is at 100Mhz or above.
* throughput in KiB/s for 100 Mhz = 100 * 1000 * 4.
*/
 - if (target_level = 3)
 + if (target_level  MIN_VDD2_OPP)
   resource_request(vdd2_opp, vdd2_dev,
   (4 * (l3_opps + MAX_VDD2_OPP)-rate / 1000));
  
 @@ -391,7 +391,7 @@ int set_opp(struct shared_resource *resp, u32 
 target_level)
   /* Convert the tput in KiB/s to Bus frequency in MHz */
   req_l3_freq = (tput * 1000)/4;
  
 - for (ind = 2; ind = MAX_VDD2_OPP; ind++)
 + for (ind = MIN_VDD2_OPP; ind = MAX_VDD2_OPP; ind++)
   if ((l3_opps + ind)-rate = req_l3_freq) {
   target_level = ind;
   break;
   

IMHO, important catch, but as the previous patch was NAKed (for
MAX_VDDn_OPP), NAK to this too.
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread Menon, Nishanth
G.N, Vijayakumar said the following on 11/19/2009 05:26 AM:
 From 202416dbdf3fce31bfd76f1e74dda89b382a78c3 Mon Sep 17 00:00:00 2001
 From: Vijay Kumar vijaykumar...@ti.com
 Date: Thu, 19 Nov 2009 15:07:38 +0530
 Subject: [PATCH 3/3] OMAP 3630: Update VDD2 values
  The OMAP3630 VDD2 minimum value is 1 and Maximum value is 2. The VDD2
  API's are updated to return proper VDD2 values.


 Signed-off-by: Charulatha V ch...@ti.com
 Signed-off-by: Manjunath GK manj...@ti.com
 Signed-off-by: Vijay Kumar vijaykumar...@ti.com
 ---
  arch/arm/mach-omap2/pm34xx.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

 diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
 index 1ed7f53..c240804 100644
 --- a/arch/arm/mach-omap2/pm34xx.c
 +++ b/arch/arm/mach-omap2/pm34xx.c
 @@ -1080,7 +1080,7 @@ EXPORT_SYMBOL(omap3_get_min_vdd1_opp);
  int omap3_get_max_vdd2_opp(void)
  {
   if (cpu_is_omap3630())
 - return VDD2_OPP3;
 + return VDD2_OPP2;
   else /* Place holder for other 34xx (3430/3440) */
   return VDD2_OPP3;
  
 @@ -1090,9 +1090,9 @@ EXPORT_SYMBOL(omap3_get_max_vdd2_opp);
  int omap3_get_min_vdd2_opp(void)
  {
   if (cpu_is_omap3630())
 - return VDD2_OPP2;
 - else /* Place holder for other 34xx (3430/3440) */
   return VDD2_OPP1;
 + else /* Place holder for other 34xx (3430/3440) */
   
this is redundant.
 + return VDD2_OPP2;
  
  }
  EXPORT_SYMBOL(omap3_get_min_vdd2_opp);
   
I NAK this patch on the principle that these are redundant unashamedly
copies of each function without handling all scenarios:
e.g.
a) what if board x wants to disable vdd2 opp1? how can he get mainline
support with hacking on this?
b) if you have 3630-1000 device, how do you handle it cleanly?
c) you believe in OPP ID here, I DO NOT - I believe we should do things
based off frequencies.

Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 9/9 v2] omap3: pm: introduce 3630 opps

2009-11-19 Thread Sripathy, Vishwanath


 -Original Message-
 From: Menon, Nishanth
 Sent: Friday, November 13, 2009 11:35 AM
 To: linux-omap
 Cc: Menon, Nishanth; Cousson, Benoit; Hunter, Jon; Kevin Hilman; Chikkature
 Rajashekar, Madhusudhan; Paul Walmsley; Dasgupta, Romit; Premi, Sanjeev;
 Shilimkar, Santosh; Aguirre, Sergio; Lam, SuiLun; Gopinath, Thara; Sripathy,
 Vishwanath
 Subject: [PATCH 9/9 v2] omap3: pm: introduce 3630 opps
 
 Introduce the OMAP3630 OPPs including the defined OPP tuples.
 
 Further information on OMAP3630 can be found here:
 http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?templateId=6123nav
 igationId=12836contentId=52606
 
 OMAP36xx family introduces:
 VDD1 with 4 OPPs, of which OPP3  4 are available only on devices yet
 to be introduced in 36xx family. Meanwhile, VDD2 has 2 opps.
 
 Range of OPPs supported by Devices(tentative)-
|-3630-600-| (default)
|-  3630-800  -| (device: TBD)
|-  3630-1000 -| (device: TBD)
 H/w OPP- OPP50 OPP100   OPP-Turbo   OPP1G-SB
 VDD1  OPP1  OPP2 OPP3OPP4
 VDD2  OPP1  OPP2 OPP2OPP2
 
 Note:
 a) TI h/w naming for OPPs are now standardized in terms of OPP50, 100,
Turbo and SB. This maps as shown above to the opp IDs (s/w term).
 b) For boards which need custom VDD1/2 OPPs, the opp table can be
updated by the board file on a need basis after the
omap3_pm_init_opp_table call. The OPPs introduced here are the
official OPP table at this point in time.
 
 Tested on: SDP3430, SDP3630
 
 Cc: Benoit Cousson b-cous...@ti.com
 Cc: Jon Hunter jon-hun...@ti.com
 Cc: Kevin Hilman khil...@deeprootsystems.com
 Cc: Madhusudhan Chikkature Rajashekar madhu...@ti.com
 Cc: Paul Walmsley p...@pwsan.com
 Cc: Romit Dasgupta ro...@ti.com
 Cc: Sanjeev Premi pr...@ti.com
 Cc: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Sergio Alberto Aguirre Rodriguez saagui...@ti.com
 Cc: SuiLun Lam s-...@ti.com
 Cc: Thara Gopinath th...@ti.com
 Cc: Vishwanath Sripathy vishwanath...@ti.com
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
  arch/arm/mach-omap2/omap3-opp.h |9 
  arch/arm/mach-omap2/pm34xx.c|   87
 +++---
  2 files changed, 80 insertions(+), 16 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap3-opp.h b/arch/arm/mach-omap2/omap3-
 opp.h
 index 7f27f44..a5880b8 100644
 --- a/arch/arm/mach-omap2/omap3-opp.h
 +++ b/arch/arm/mach-omap2/omap3-opp.h
 @@ -4,22 +4,31 @@
  #include plat/omap-pm.h
 
  /* MPU speeds */
 +#define S1000M  10
 +#define S800M   8
  #define S600M   6
  #define S550M   55000
  #define S500M   5
 +#define S300M   3
  #define S250M   25000
  #define S125M   12500
 
  /* DSP speeds */
 +#define S875M   87500
 +#define S660M   66000
 +#define S520M   52000
  #define S430M   43000
  #define S400M   4
  #define S360M   36000
 +#define S260M   26000
  #define S180M   18000
  #define S90M9000
 
  /* L3 speeds */
  #define S83M8300
 +#define S100M   1
  #define S166M   16600
 +#define S200M   2
 
  extern struct omap_opp *omap3_mpu_rate_table;
  extern struct omap_opp *omap3_dsp_rate_table;
 diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
 index 14131f8..86137bb 100644
 --- a/arch/arm/mach-omap2/pm34xx.c
 +++ b/arch/arm/mach-omap2/pm34xx.c
 @@ -141,6 +141,41 @@ static __initdata struct omap_opp
 omap34xx_dsp_rate_table[] = {
   {0, 0, 0, 0},
  };
 
 +static __initdata struct omap_opp omap36xx_mpu_rate_table[] = {
 + {0, 0, 0, 0},
 + /*OPP1 - 930mV - OPP50*/
 + {true, S300M, VDD1_OPP1, 0x1a},
 + /*OPP2 - 1.100V - OPP100*/
 + {true, S600M, VDD1_OPP2, 0x28},
 + /*OPP3 - 1.260V - OPP-Turbo*/
 + {false, S800M, VDD1_OPP3, 0x34},
 + /*OPP4 - 1.310V - OPP-SB*/
 + {false, S1000M, VDD1_OPP4, 0x38},
 + {0, 0, 0, 0},
 +};

OPP Table vsel values seem to be wrong. Eg: for OPP1 to get 930mV, vsel should 
be 0x1b. vsel=Ceiling((930-600)/12.5)

 +
 +static __initdata struct omap_opp omap36xx_l3_rate_table[] = {
 + {0, 0, 0, 0},
 + /*OPP1 - 930mV - OPP50 */
 + {true, S100M, VDD2_OPP1, 0x1a},
 + /*OPP2 - 1.375V - OPP100, OPP-Turbo, OPP-SB*/
 + {true, S200M, VDD2_OPP2, 0x2b},
 + {0, 0, 0, 0},
 +};
 +


Same case

 +static __initdata struct omap_opp omap36xx_dsp_rate_table[] = {
 + {0, 0, 0, 0},
 + /*OPP1 - OPP50*/
 + {true, S260M, VDD1_OPP1, 0x1a},
 + /*OPP2 - OPP100*/
 + {true, S520M, VDD1_OPP2, 0x28},
 + /*OPP3 - OPP-Turbo*/
 + {false, S660M, VDD1_OPP3, 0x34},
 + /*OPP4 - OPP-SB*/
 + {false, S875M, VDD1_OPP4, 0x38},
 + {0, 0, 0, 0},
 +};
 +

Same case

  struct omap_opp *omap3_mpu_rate_table;
  struct omap_opp *omap3_dsp_rate_table;
  struct omap_opp *omap3_l3_rate_table;
 @@ -1287,22 +1322,42 @@ static void __init configure_vc(void)
  void __init omap3_pm_init_opp_table(void)
  {
   

[PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
Here is the v6 of this patch series. I am cc'ing mtd list too this time.


From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 19:28:11 +0530

This patch series adds flash support for NAND (in sdp, zoom and ldp),
OneNAND and NOR (in sdp)

Tested on Zoom2 and 3430SDP

Vimal Singh (4):
[PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
[PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
[PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
[PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig


v6 :
1. Implemented Tony's comments on below threads:

[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
http://marc.info/?l=linux-omapm=125805845217778w=2

[PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
http://marc.info/?l=linux-omapm=125805867318269w=2

[PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module
http://marc.info/?l=linux-omapm=125787938923028w=2

2. Creating 'mach-omap2/gpmc-nand.c' to handle GPMC related setups for
the driver.
3. Removed all 'gpmc_cs_read_reg' and 'gpmc_cs_write_reg' calls from
'nand/omap2.c'
4. Corrected macro 'GPMC_CONFIG1_DEVICETYPE_NAND' for NAND
5. Removed 'nand unlock' routine in patch 2/4, will take this
discussion to mtd list.

v4-v5:
[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
Implemented Tony's comments.

-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
Sorry, forgot to append diffstat. Listing below this time.

On Thu, Nov 19, 2009 at 7:38 PM, Vimal Singh vimal.neww...@gmail.com wrote:
 Here is the v6 of this patch series. I am cc'ing mtd list too this time.


 From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
 From: Vimal Singh vimalsi...@ti.com
 Date: Thu, 19 Nov 2009 19:28:11 +0530

 This patch series adds flash support for NAND (in sdp, zoom and ldp),
 OneNAND and NOR (in sdp)

 Tested on Zoom2 and 3430SDP

 Vimal Singh (4):
 [PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards
 [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards
 [PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig
 [PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig


 v6 :
 1. Implemented Tony's comments on below threads:

 [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards
 http://marc.info/?l=linux-omapm=125805845217778w=2

 [PATCH-v5 2/4] OMAP3: Add support for NAND on ZOOM2/LDP boards
 http://marc.info/?l=linux-omapm=125805867318269w=2

 [PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module
 http://marc.info/?l=linux-omapm=125787938923028w=2

 2. Creating 'mach-omap2/gpmc-nand.c' to handle GPMC related setups for
 the driver.
 3. Removed all 'gpmc_cs_read_reg' and 'gpmc_cs_write_reg' calls from
 'nand/omap2.c'
 4. Corrected macro 'GPMC_CONFIG1_DEVICETYPE_NAND' for NAND
 5. Removed 'nand unlock' routine in patch 2/4, will take this
 discussion to mtd list.

 v4-v5:
 [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
 Implemented Tony's comments.

 arch/arm/configs/omap_3430sdp_defconfig  |  140 +++
 arch/arm/configs/omap_zoom2_defconfig|  344 +++---
 arch/arm/mach-omap2/Makefile |8 +
 arch/arm/mach-omap2/board-2430sdp.c  |2 +
 arch/arm/mach-omap2/board-3430sdp.c  |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-sdp-flash.c|  315 +++
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 +++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/mach-omap2/gpmc-nand.c  |  128 ++
 arch/arm/plat-omap/include/plat/board-sdp.h  |   15 ++
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +++
 arch/arm/plat-omap/include/plat/gpmc.h   |4 +-
 arch/arm/plat-omap/include/plat/nand.h   |6 +
 drivers/mtd/nand/omap2.c |   33 +--
 15 files changed, 969 insertions(+), 160 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards

2009-11-19 Thread Vimal Singh
From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 14:37:44 +0530
Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards

Adding NAND support for ZOOM2/3 and LDP board.
I have tested it for ZOOM2 boards. Someone can verify it for LDP
and ZOOM3 boards, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
  Future boards will be called Zoom2/3/4 etc.
  LDP is a Zoom1. Somhow the LDP name got stuck to that.

Signed-off-by: Vimal Singh vimalsi...@ti.com
Cc: Vikram Pandita vikram.pand...@ti.com
Cc: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
 5 files changed, 135 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b0e5b46..c2ca76e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += 
board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
\
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..8aebdf9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include asm/delay.h
 #include plat/control.h
 #include plat/usb.h
+#include plat/board-zoom.h

 #include mmc-twl4030.h

@@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
b/arch/arm/mach-omap2/board-zoom-flash.c
new file mode 100644
index 000..1867d6a
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,92 @@
+/*
+ * board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Vimal Singh vimalsi...@ti.com
+ *Rohit Choraria rohi...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+#include linux/types.h
+#include linux/io.h
+
+#include asm/mach/flash.h
+#include plat/board.h
+#include plat/gpmc.h
+#include plat/nand.h
+
+#include plat/board-zoom.h
+
+static struct mtd_partition zoom_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader-NAND,
+   .offset = 0,
+   .size   = 4 * (64 * 2048),  /* 512KB, 0x8 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048), /* 1.25MB, 0x14 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   

[PATCH-v6 3/4] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

2009-11-19 Thread Vimal Singh
From 8bc97108cf9c78216f1ea5407ccbd900e6b63dc2 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 19:23:18 +0530
Subject: [PATCH] OMAP: Zoom2: Enable NAND and JFFS2 support in defconfig

Enable NAND (and other necessary options too) and JFFS2
options by default in zoom2_defconfig file.
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh vimalsi...@ti.com
---
 arch/arm/configs/omap_zoom2_defconfig |  344 -
 1 files changed, 250 insertions(+), 94 deletions(-)

diff --git a/arch/arm/configs/omap_zoom2_defconfig
b/arch/arm/configs/omap_zoom2_defconfig
index eef9362..8397d9e 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -1,15 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.30-omap1
-# Fri Jun 12 17:25:46 2009
+# Linux kernel version: 2.6.32-rc7
+# Thu Nov 19 19:18:46 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0x
 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
+CONFIG_CONSTRUCTORS=y

 #
 # General setup
@@ -46,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_GROUP_SCHED=y
@@ -59,8 +58,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-# CONFIG_SYSFS_DEPRECATED=y is not set
-# CONFIG_SYSFS_DEPRECATED_V2=y is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -77,7 +75,6 @@ CONFIG_UID16=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
@@ -90,18 +87,25 @@ CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_AIO=y
+
+#
+# Kernel Performance Events And Counters
+#
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
 # CONFIG_SLOW_WORK is not set
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
@@ -114,7 +118,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BLOCK=y
-# CONFIG_LBD is not set
+CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set

@@ -135,19 +139,22 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_VERSATILE is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -156,25 +163,27 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
 # CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_LOKI is not set
 # CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSM is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # 

[PATCH-v6 4/4] OMAP: 3430SDP: Enable NAND in defconfig

2009-11-19 Thread Vimal Singh
From cff30e52d3702c154310557145090b2375c870c3 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 19:17:38 +0530
Subject: [PATCH] OMAP: 3430SDP: Enable NAND in defconfig

Enable NAND by default in 3430sdp_defconfig file.
Other changes in defconfig come from make menuconfig syncup

Signed-off-by: Vimal Singh vimalsi...@ti.com
---
 arch/arm/configs/omap_3430sdp_defconfig |  140 +--
 1 files changed, 96 insertions(+), 44 deletions(-)

diff --git a/arch/arm/configs/omap_3430sdp_defconfig
b/arch/arm/configs/omap_3430sdp_defconfig
index 8482958..f1e79aa 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1,14 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.31-rc9-omap1
-# Tue Sep 15 16:48:34 2009
+# Linux kernel version: 2.6.32-rc7
+# Thu Nov 19 19:15:31 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -17,6 +16,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
@@ -44,11 +44,12 @@ CONFIG_BSD_PROCESS_ACCT=y
 #
 # RCU Subsystem
 #
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
 # CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -58,8 +59,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUPS is not set
-# CONFIG_SYSFS_DEPRECATED=y is not set
-# CONFIG_SYSFS_DEPRECATED_V2=y is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -90,16 +90,14 @@ CONFIG_SHMEM=y
 CONFIG_AIO=y

 #
-# Performance Counters
+# Kernel Performance Events And Counters
 #
 CONFIG_VM_EVENT_COUNTERS=y
-# CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_COMPAT_BRK=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
 # CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
@@ -143,6 +141,7 @@ CONFIG_FREEZER=y
 #
 # System Type
 #
+CONFIG_MMU=y
 # CONFIG_ARCH_AAEC2000 is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_REALVIEW is not set
@@ -157,6 +156,7 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_STMP3XXX is not set
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_NOMADIK is not set
 # CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
@@ -179,11 +179,13 @@ CONFIG_FREEZER=y
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5PC1XX is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
 # CONFIG_ARCH_U300 is not set
 # CONFIG_ARCH_DAVINCI is not set
 CONFIG_ARCH_OMAP=y
+# CONFIG_ARCH_BCMRING is not set

 #
 # TI OMAP Implementations
@@ -212,6 +214,7 @@ CONFIG_OMAP_DM_TIMER=y
 CONFIG_OMAP_LL_DEBUG_UART1=y
 # CONFIG_OMAP_LL_DEBUG_UART2 is not set
 # CONFIG_OMAP_LL_DEBUG_UART3 is not set
+# CONFIG_OMAP_LL_DEBUG_NONE is not set
 # CONFIG_OMAP_PM_NONE is not set
 CONFIG_OMAP_PM_NOOP=y
 CONFIG_ARCH_OMAP34XX=y
@@ -224,10 +227,15 @@ CONFIG_ARCH_OMAP3430=y
 # CONFIG_MACH_OMAP_LDP is not set
 # CONFIG_MACH_OVERO is not set
 # CONFIG_MACH_OMAP3EVM is not set
+# CONFIG_MACH_OMAP3517EVM is not set
 # CONFIG_MACH_OMAP3_PANDORA is not set
 CONFIG_MACH_OMAP_3430SDP=y
 # CONFIG_MACH_NOKIA_RX51 is not set
 # CONFIG_MACH_OMAP_ZOOM2 is not set
+# CONFIG_MACH_OMAP_ZOOM3 is not set
+# CONFIG_MACH_CM_T35 is not set
+# CONFIG_MACH_IGEP0020 is not set
+# CONFIG_MACH_OMAP_3630SDP is not set

 #
 # Processor Type
@@ -237,7 +245,7 @@ CONFIG_CPU_32v6K=y
 CONFIG_CPU_V7=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
-CONFIG_CPU_PABRT_IFAR=y
+CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_CACHE_V7=y
 CONFIG_CPU_CACHE_VIPT=y
 CONFIG_CPU_COPY_V6=y
@@ -255,6 +263,7 @@ CONFIG_ARM_THUMB=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_BPREDICT_DISABLE is not set
 CONFIG_HAS_TLS_REG=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
 # CONFIG_ARM_ERRATA_430973 is not set
 # CONFIG_ARM_ERRATA_458693 is not set
 # CONFIG_ARM_ERRATA_460075 is not set
@@ -278,8 +287,11 @@ CONFIG_VMSPLIT_3G=y
 # CONFIG_VMSPLIT_2G is not set
 # CONFIG_VMSPLIT_1G is not set
 CONFIG_PAGE_OFFSET=0xC000
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
 CONFIG_HZ=128
+# CONFIG_THUMB2_KERNEL is not set
 

Re: [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards

2009-11-19 Thread Nishanth Menon

Vimal Singh had written, on 11/19/2009 08:16 AM, the following:

From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 14:37:44 +0530
Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards

Adding NAND support for ZOOM2/3 and LDP board.
I have tested it for ZOOM2 boards. Someone can verify it for LDP
and ZOOM3 boards, hopefully it should not have any problem.

The size of the U-Boot environment partition was increased to 1.25MB.

Vikram: Changed ldp name to zoom.
  Future boards will be called Zoom2/3/4 etc.
  LDP is a Zoom1. Somhow the LDP name got stuck to that.

Signed-off-by: Vimal Singh vimalsi...@ti.com
Cc: Vikram Pandita vikram.pand...@ti.com
Cc: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile |3 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 ++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
 5 files changed, 135 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b0e5b46..c2ca76e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)   += 
board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-zoom-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   mmc-twl4030.o
@@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
\
   board-rx51-peripherals.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   mmc-twl4030.o \
   board-zoom-debugboard.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index c062238..8aebdf9 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -42,6 +42,7 @@
 #include asm/delay.h
 #include plat/control.h
 #include plat/usb.h
+#include plat/board-zoom.h

 #include mmc-twl4030.h

@@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init();
+   zoom_flash_init();

twl4030_mmc_init(mmc);
/* link regulators to MMC adapters */
diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
b/arch/arm/mach-omap2/board-zoom-flash.c
new file mode 100644
index 000..1867d6a
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-flash.c
@@ -0,0 +1,92 @@
+/*
+ * board-zoom-flash.c
+ *
+ * Copyright (C) 2008-09 Texas Instruments Inc.
+ *
+ * Modified from mach-omap2/board-2430sdp-flash.c
+ * Author(s): Vimal Singh vimalsi...@ti.com
+ *Rohit Choraria rohi...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+#include linux/types.h
+#include linux/io.h
+
+#include asm/mach/flash.h
+#include plat/board.h
+#include plat/gpmc.h
+#include plat/nand.h
+
+#include plat/board-zoom.h
+
+static struct mtd_partition zoom_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader-NAND,
+   .offset = 0,
+   .size   = 4 * (64 * 2048),  /* 512KB, 0x8 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048), /* 1.25MB, 0x14 */
+   .mask_flags 

Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Nishanth Menon

Vimal Singh had written, on 11/19/2009 08:11 AM, the following:
[...]



v4-v5:
[PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
Implemented Tony's comments.


 arch/arm/configs/omap_3430sdp_defconfig  |  140 +++
 arch/arm/configs/omap_zoom2_defconfig|  344 +++---


how about zoom3 and sdp3630?


 arch/arm/mach-omap2/Makefile |8 +
 arch/arm/mach-omap2/board-2430sdp.c  |2 +
 arch/arm/mach-omap2/board-3430sdp.c  |2 +
 arch/arm/mach-omap2/board-ldp.c  |2 +
 arch/arm/mach-omap2/board-sdp-flash.c|  315 +++
 arch/arm/mach-omap2/board-zoom-flash.c   |   92 +++
 arch/arm/mach-omap2/board-zoom-peripherals.c |2 +
 arch/arm/mach-omap2/gpmc-nand.c  |  128 ++
 arch/arm/plat-omap/include/plat/board-sdp.h  |   15 ++
 arch/arm/plat-omap/include/plat/board-zoom.h |   36 +++
 arch/arm/plat-omap/include/plat/gpmc.h   |4 +-
 arch/arm/plat-omap/include/plat/nand.h   |6 +
 drivers/mtd/nand/omap2.c |   33 +--
 15 files changed, 969 insertions(+), 160 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
 create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v6 1/4] OMAP2/3: Add support for flash on SDP boards

2009-11-19 Thread Vimal Singh
From ac109bb5f47577b323673699a94f9b6a4a7e2431 Mon Sep 17 00:00:00 2001
From: Vimal Singh vimalsi...@ti.com
Date: Thu, 19 Nov 2009 19:01:11 +0530
Subject: [PATCH] OMAP2/3: Add support for flash on SDP boards

Add support for flash on SDP boards. NAND, NOR and OneNAND
are supported.

This patch also implements Tony's comments on:
http://marc.info/?l=linux-omapm=125787938923028w=2

This is done by creating 'mach-omap2/gpmc-nand.c' file, to handle
GPMC related setups for the device driver.

Only tested on 3430SDP (ES2 and ES3.1), somebody please test on
2430SDP and check the chips select for 2430SDP.

Also note that:
For OneNAND: in the earlier 2430SDP code the kernel partition
was set to only 1MB instead of 2MB on 3430SDP. If people want
the old partition sizes back on 2430SDP, please provide a patch.

For NAND: 'U-Boot', 'Boot Env' and 'Kernel' partitions sizes increased
by few blocks to provide few spare blocks for NAND bab block management
in u-boot. If people want old partition sizes, please provide a patch.

Signed-off-by: Vimal Singh vimalsi...@ti.com
Cc: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile|5 +
 arch/arm/mach-omap2/board-2430sdp.c |2 +
 arch/arm/mach-omap2/board-3430sdp.c |2 +
 arch/arm/mach-omap2/board-sdp-flash.c   |  315 +++
 arch/arm/mach-omap2/gpmc-nand.c |  128 +++
 arch/arm/plat-omap/include/plat/board-sdp.h |   15 ++
 arch/arm/plat-omap/include/plat/gpmc.h  |4 +-
 arch/arm/plat-omap/include/plat/nand.h  |6 +
 drivers/mtd/nand/omap2.c|   33 +--
 9 files changed, 488 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
 create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
 create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 59b0ccc..b0e5b46 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_OMAP_IOMMU)  += $(iommu-y)
 obj-$(CONFIG_MACH_OMAP_GENERIC)+= board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)+= board-2430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)+= board-apollon.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)+= board-omap3beagle.o \
@@ -69,6 +70,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)   += board-omap3evm.o \
 obj-$(CONFIG_MACH_OMAP3_PANDORA)   += board-omap3pandora.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
+  board-sdp-flash.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
@@ -105,3 +107,6 @@ obj-y   += $(onenand-m) 
$(onenand-y)

 smc91x-$(CONFIG_SMC91X):= gpmc-smc91x.o
 obj-y  += $(smc91x-m) $(smc91x-y)
+
+nand-$(CONFIG_MTD_NAND_OMAP2)  := gpmc-nand.o
+obj-y  += $(nand-m) $(nand-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c
b/arch/arm/mach-omap2/board-2430sdp.c
index db9374b..5676ab9 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -38,6 +38,7 @@
 #include plat/usb.h
 #include plat/gpmc-smc91x.h

+#include plat/board-sdp.h
 #include mmc-twl4030.h

 #define SDP2430_CS0_BASE   0x0400
@@ -205,6 +206,7 @@ static void __init omap_2430sdp_init(void)
twl4030_mmc_init(mmc);
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();

/* Turn off secondary LCD backlight */
ret = gpio_request(SECONDARY_LCD_GPIO, Secondary LCD backlight);
diff --git a/arch/arm/mach-omap2/board-3430sdp.c
b/arch/arm/mach-omap2/board-3430sdp.c
index 491364e..f2ed1ab 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,7 @@
 #include plat/control.h
 #include plat/gpmc-smc91x.h

+#include plat/board-sdp.h
 #include sdram-qimonda-hyb18m512160af-6.h
 #include mmc-twl4030.h

@@ -521,6 +522,7 @@ static void __init omap_3430sdp_init(void)
omap_serial_init();
usb_musb_init();
board_smc91x_init();
+   sdp_flash_init();
enable_board_wakeup_source();
usb_ehci_init(ehci_pdata);
 }
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c
b/arch/arm/mach-omap2/board-sdp-flash.c
new file mode 100644
index 000..e5fc309
--- /dev/null
+++ b/arch/arm/mach-omap2/board-sdp-flash.c
@@ -0,0 +1,315 @@
+/*
+ * board-sdp-flash.c
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ * Copyright (C) 2009 Texas 

Re: [PATCH-v6 0/4] OMAP: Adding flash support to SDP, ZOOM2 and LDP boards

2009-11-19 Thread Vimal Singh
On Thu, Nov 19, 2009 at 7:52 PM, Nishanth Menon n...@ti.com wrote:
 Vimal Singh had written, on 11/19/2009 08:11 AM, the following:
 [...]


 v4-v5:
 [PATCH-v5 1/4] OMAP2/3: Add support for flash on SDP boards:
 Implemented Tony's comments.

  arch/arm/configs/omap_3430sdp_defconfig      |  140 +++
  arch/arm/configs/omap_zoom2_defconfig        |  344
 +++---

 how about zoom3 and sdp3630?

I do not have these boards. Could someone test for these and drop a
patch for same?


  arch/arm/mach-omap2/Makefile                 |    8 +
  arch/arm/mach-omap2/board-2430sdp.c          |    2 +
  arch/arm/mach-omap2/board-3430sdp.c          |    2 +
  arch/arm/mach-omap2/board-ldp.c              |    2 +
  arch/arm/mach-omap2/board-sdp-flash.c        |  315
 +++
  arch/arm/mach-omap2/board-zoom-flash.c       |   92 +++
  arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +
  arch/arm/mach-omap2/gpmc-nand.c              |  128 ++
  arch/arm/plat-omap/include/plat/board-sdp.h  |   15 ++
  arch/arm/plat-omap/include/plat/board-zoom.h |   36 +++
  arch/arm/plat-omap/include/plat/gpmc.h       |    4 +-
  arch/arm/plat-omap/include/plat/nand.h       |    6 +
  drivers/mtd/nand/omap2.c                     |   33 +--
  15 files changed, 969 insertions(+), 160 deletions(-)
  create mode 100644 arch/arm/mach-omap2/board-sdp-flash.c
  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
  create mode 100644 arch/arm/mach-omap2/gpmc-nand.c
  create mode 100644 arch/arm/plat-omap/include/plat/board-sdp.h
  create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



 --
 Regards,
 Nishanth Menon




-- 
Regards,
Vimal Singh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards

2009-11-19 Thread Vimal Singh
On Thu, Nov 19, 2009 at 7:50 PM, Nishanth Menon n...@ti.com wrote:
 Vimal Singh had written, on 11/19/2009 08:16 AM, the following:

 From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001
 From: Vimal Singh vimalsi...@ti.com
 Date: Thu, 19 Nov 2009 14:37:44 +0530
 Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards

 Adding NAND support for ZOOM2/3 and LDP board.
 I have tested it for ZOOM2 boards. Someone can verify it for LDP
 and ZOOM3 boards, hopefully it should not have any problem.

 The size of the U-Boot environment partition was increased to 1.25MB.

 Vikram: Changed ldp name to zoom.
      Future boards will be called Zoom2/3/4 etc.
      LDP is a Zoom1. Somhow the LDP name got stuck to that.

 Signed-off-by: Vimal Singh vimalsi...@ti.com
 Cc: Vikram Pandita vikram.pand...@ti.com
 Cc: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/Makefile                 |    3 +
  arch/arm/mach-omap2/board-ldp.c              |    2 +
  arch/arm/mach-omap2/board-zoom-flash.c       |   92
 ++
  arch/arm/mach-omap2/board-zoom-peripherals.c |    2 +
  arch/arm/plat-omap/include/plat/board-zoom.h |   36 ++
  5 files changed, 135 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c
  create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h

 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index b0e5b46..c2ca76e 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON)               +=
 board-apollon.o
  obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o \
                                           mmc-twl4030.o
  obj-$(CONFIG_MACH_OMAP_LDP)            += board-ldp.o \
 +                                          board-zoom-flash.o \
                                           mmc-twl4030.o
  obj-$(CONFIG_MACH_OVERO)               += board-overo.o \
                                           mmc-twl4030.o
 @@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51)               +=
 board-rx51.o \
                                           board-rx51-peripherals.o \
                                           mmc-twl4030.o
  obj-$(CONFIG_MACH_OMAP_ZOOM2)          += board-zoom2.o \
 +                                          board-zoom-flash.o \
                                           board-zoom-peripherals.o \
                                           mmc-twl4030.o \
                                           board-zoom-debugboard.o
  obj-$(CONFIG_MACH_OMAP_ZOOM3)          += board-zoom3.o \
 +                                          board-zoom-flash.o \
                                           board-zoom-peripherals.o \
                                           mmc-twl4030.o \
                                           board-zoom-debugboard.o
 diff --git a/arch/arm/mach-omap2/board-ldp.c
 b/arch/arm/mach-omap2/board-ldp.c
 index c062238..8aebdf9 100644
 --- a/arch/arm/mach-omap2/board-ldp.c
 +++ b/arch/arm/mach-omap2/board-ldp.c
 @@ -42,6 +42,7 @@
  #include asm/delay.h
  #include plat/control.h
  #include plat/usb.h
 +#include plat/board-zoom.h

  #include mmc-twl4030.h

 @@ -385,6 +386,7 @@ static void __init omap_ldp_init(void)
        ads7846_dev_init();
        omap_serial_init();
        usb_musb_init();
 +       zoom_flash_init();

        twl4030_mmc_init(mmc);
        /* link regulators to MMC adapters */
 diff --git a/arch/arm/mach-omap2/board-zoom-flash.c
 b/arch/arm/mach-omap2/board-zoom-flash.c
 new file mode 100644
 index 000..1867d6a
 --- /dev/null
 +++ b/arch/arm/mach-omap2/board-zoom-flash.c
 @@ -0,0 +1,92 @@
 +/*
 + * board-zoom-flash.c
 + *
 + * Copyright (C) 2008-09 Texas Instruments Inc.
 + *
 + * Modified from mach-omap2/board-2430sdp-flash.c
 + * Author(s): Vimal Singh vimalsi...@ti.com
 + *            Rohit Choraria rohi...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +#include linux/kernel.h
 +#include linux/delay.h
 +#include linux/platform_device.h
 +#include linux/mtd/mtd.h
 +#include linux/mtd/partitions.h
 +#include linux/mtd/nand.h
 +#include linux/types.h
 +#include linux/io.h
 +
 +#include asm/mach/flash.h
 +#include plat/board.h
 +#include plat/gpmc.h
 +#include plat/nand.h
 +
 +#include plat/board-zoom.h
 +
 +static struct mtd_partition zoom_nand_partitions[] = {
 +       /* All the partition sizes are listed in terms of NAND block size
 */
 +       {
 +               .name           = X-Loader-NAND,
 +               .offset         = 0,
 +               .size           = 4 * (64 * 2048),      /* 512KB, 0x8
 */
 +               .mask_flags     = MTD_WRITEABLE,        /* force read-only
 */
 +       },
 +       {
 +               .name           = U-Boot-NAND,
 +               

[PATCH 0/3] Introducing TouchScreen TSC2004 driver support

2009-11-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

This is first version of TSC2004 driver support, which has been
validated on AM3517EVM platform. Driver is derived from existing
touchscreen driver TSC2007.

Vaibhav Hiremath (3):
  Mux configuration for AM3517 TouchScreen support
  Input:TouchScreen: Introduce TSC2004 driver support
  AM3517: Add support for TSC2004 driver

 arch/arm/mach-omap2/board-am3517evm.c |   62 
 arch/arm/mach-omap2/mux.c |3 +
 arch/arm/plat-omap/include/plat/mux.h |1 +
 drivers/input/touchscreen/Kconfig |   11 +
 drivers/input/touchscreen/Makefile|1 +
 drivers/input/touchscreen/tsc2004.c   |  525 +
 include/linux/i2c/tsc2004.h   |   17 +
 7 files changed, 620 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tsc2004.c
 create mode 100644 include/linux/i2c/tsc2004.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] Mux configuration for AM3517 TouchScreen support

2009-11-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/mux.c |3 +++
 arch/arm/plat-omap/include/plat/mux.h |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index c18a94e..f64ce14 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -566,6 +566,9 @@ MUX_CFG_34XX(AF9_34XX_GPIO22, 0x5ec,
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 MUX_CFG_34XX(U3_34XX_GPIO61, 0x0c8,
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+ /*Touch-screen*/
+ MUX_CFG_34XX(U1_34XX_GPIO65, 0x0d2,
+   OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 };
 
 #define OMAP34XX_PINS_SZ   ARRAY_SIZE(omap34xx_pins)
diff --git a/arch/arm/plat-omap/include/plat/mux.h 
b/arch/arm/plat-omap/include/plat/mux.h
index ba77de6..244afee 100644
--- a/arch/arm/plat-omap/include/plat/mux.h
+++ b/arch/arm/plat-omap/include/plat/mux.h
@@ -854,6 +854,7 @@ enum omap34xx_index {
AH14_34XX_GPIO21,
AF9_34XX_GPIO22,
U3_34XX_GPIO61,
+   U1_34XX_GPIO65,
 };
 
 struct omap_mux_cfg {
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] Input:TouchScreen: Introduce TSC2004 driver support

2009-11-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com

Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 drivers/input/touchscreen/Kconfig   |   11 +
 drivers/input/touchscreen/Makefile  |1 +
 drivers/input/touchscreen/tsc2004.c |  525 +++
 include/linux/i2c/tsc2004.h |   17 ++
 4 files changed, 554 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tsc2004.c
 create mode 100644 include/linux/i2c/tsc2004.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 8cc453c..08aba0b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -512,6 +512,17 @@ config TOUCHSCREEN_TSC2007
  To compile this driver as a module, choose M here: the
  module will be called tsc2007.
 
+config TOUCHSCREEN_TSC2004
+   tristate TSC2004 based touchscreens
+   depends on I2C
+   help
+ Say Y here if you have a TSC2004 based touchscreen.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called tsc2004.
+
 config TOUCHSCREEN_W90X900
tristate W90P910 touchscreen driver
depends on HAVE_CLK
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 15fa62c..4ac5b81 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213)  += touchit213.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT)   += touchright.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2007)  += tsc2007.o
+obj-$(CONFIG_TOUCHSCREEN_TSC2004)  += tsc2004.o
 obj-$(CONFIG_TOUCHSCREEN_UCB1400)  += ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001)  += wacom_w8001.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX)   += wm97xx-ts.o
diff --git a/drivers/input/touchscreen/tsc2004.c 
b/drivers/input/touchscreen/tsc2004.c
new file mode 100644
index 000..0bba2e6
--- /dev/null
+++ b/drivers/input/touchscreen/tsc2004.c
@@ -0,0 +1,525 @@
+/*
+ * drivers/input/touchscreen/tsc2004.c
+ *
+ * Copyright (C) 2009 Texas Instruments Inc
+ * Author: Vaibhav Hiremath hvaib...@ti.com
+ *
+ * Using code from:
+ *  - tsc2007.c
+ *
+ * This package is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include linux/module.h
+#include linux/slab.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/i2c.h
+#include linux/i2c/tsc2004.h
+
+
+#define TS_POLL_DELAY  1 /* ms delay between samples */
+#define TS_POLL_PERIOD 1 /* ms delay between samples */
+
+/* Control byte 0 */
+#define TSC2004_CMD0(addr, pnd, rw) ((addr3)|(pnd1)|rw)
+/* Control byte 1 */
+#define TSC2004_CMD1(cmd, mode, rst) ((17)|(cmd4)|(mode2)|(rst1))
+
+/* Command Bits */
+#define READ_REG   1
+#define WRITE_REG  0
+#define SWRST_TRUE 1
+#define SWRST_FALSE0
+#define PND0_TRUE  1
+#define PND0_FALSE 0
+
+/* Converter function mapping */
+enum convertor_function {
+   MEAS_X_Y_Z1_Z2, /* Measure X,Y,z1 and Z2:   0x0 */
+   MEAS_X_Y,   /* Measure X and Y only:0x1 */
+   MEAS_X, /* Measure X only:  0x2 */
+   MEAS_Y, /* Measure Y only:  0x3 */
+   MEAS_Z1_Z2, /* Measure Z1 and Z2 only:  0x4 */
+   MEAS_AUX,   /* Measure Auxillary input: 0x5 */
+   MEAS_TEMP1, /* Measure Temparature1:0x6 */
+   MEAS_TEMP2, /* Measure Temparature2:0x7 */
+   MEAS_AUX_CONT,  /* Continuously measure Auxillary input: 0x8 */
+   X_DRV_TEST, /* X-Axis drivers tested0x9 */
+   Y_DRV_TEST, /* Y-Axis drivers tested0xA */
+   /*Command Reserved*/
+   SHORT_CKT_TST = 0xC,/* Short circuit test:  0xC */
+   XP_XN_DRV_STAT, /* X+,Y- drivers status:0xD */
+   YP_YN_DRV_STAT, /* X+,Y- drivers status:0xE */
+   YP_XN_DRV_STAT  /* Y+,X- drivers status:0xF */
+};
+
+/* Register address mapping */
+enum register_address {
+   X_REG,  /* X register:  0x0 */
+   Y_REG,  /* Y register:  0x1 */
+   Z1_REG, /* Z1 register: 0x2 */
+   Z2_REG, /* Z2 register: 0x3 */
+   AUX_REG,/* AUX register:0x4 */
+   TEMP1_REG,  /* Temp1 

[PATCH 3/3] AM3517: Add support for TSC2004 driver

2009-11-19 Thread hvaibhav
From: Vaibhav Hiremath hvaib...@ti.com


Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
---
 arch/arm/mach-omap2/board-am3517evm.c |   62 +
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 415a13d..ae47b51 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,8 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/gpio.h
+#include linux/irq.h
+#include linux/i2c/tsc2004.h
 
 #include mach/hardware.h
 #include asm/mach-types.h
@@ -27,10 +29,64 @@
 #include asm/mach/map.h
 
 #include plat/board.h
+#include plat/mux.h
 #include plat/common.h
 #include plat/usb.h
 
 /*
+ * TSC 2004 Support
+ */
+#defineGPIO_TSC2004_IRQ65
+
+static int tsc2004_init_irq(void)
+{
+   int ret = 0;
+
+   ret = gpio_request(GPIO_TSC2004_IRQ, tsc2004-irq);
+   if (ret  0) {
+   printk(KERN_WARNING failed to request GPIO#%d: %d\n,
+   GPIO_TSC2004_IRQ, ret);
+   return ret;
+   }
+
+   if (gpio_direction_input(GPIO_TSC2004_IRQ)) {
+   printk(KERN_WARNING GPIO#%d cannot be configured as 
+   input\n, GPIO_TSC2004_IRQ);
+   return -ENXIO;
+   }
+
+   omap_set_gpio_debounce(GPIO_TSC2004_IRQ, 1);
+   omap_set_gpio_debounce_time(GPIO_TSC2004_IRQ, 0xa);
+   return ret;
+}
+
+static void tsc2004_exit_irq(void)
+{
+   gpio_free(GPIO_TSC2004_IRQ);
+}
+
+static int tsc2004_get_irq_level(void)
+{
+   return gpio_get_value(GPIO_TSC2004_IRQ) ? 0 : 1;
+}
+
+struct tsc2004_platform_data am3517evm_tsc2004data = {
+   .model = 2004,
+   .x_plate_ohms = 180,
+   .get_pendown_state = tsc2004_get_irq_level,
+   .init_platform_hw = tsc2004_init_irq,
+   .exit_platform_hw = tsc2004_exit_irq,
+};
+
+static struct i2c_board_info __initdata am3517evm_tsc_i2c_boardinfo[] = {
+   {
+   I2C_BOARD_INFO(tsc2004, 0x4B),
+   .type   = tsc2004,
+   .platform_data  = am3517evm_tsc2004data,
+   },
+};
+
+/*
  * Board initialization
  */
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
@@ -67,6 +123,12 @@ static void __init am3517_evm_init(void)
 
omap_serial_init();
usb_ehci_init(ehci_pdata);
+
+   /* TSC 2004 */
+   omap_cfg_reg(U1_34XX_GPIO65);
+   am3517evm_tsc_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_TSC2004_IRQ);
+   i2c_register_board_info(1, am3517evm_tsc_i2c_boardinfo,
+   ARRAY_SIZE(am3517evm_tsc_i2c_boardinfo));
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 3/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread G.N, Vijayakumar
My apologies for the noise generated for the below patches submitted by me.
 
http://patchwork.kernel.org/patch/61277/
http://patchwork.kernel.org/patch/61276/
http://patchwork.kernel.org/patch/61275/
 
 
I was not aware of the discussions happening on dynamic OPP management for 
supporting multiple OMAP cpu types.
 
Please disregard the above patch series


Best Regards
Vijay




-Original Message-
From: linux-omap-ow...@vger.kernel.org 
[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of G.N, Vijayakumar
Sent: Thursday, November 19, 2009 4:56 PM
To: khil...@deeprootsystems.com; linux-omap@vger.kernel.org
Subject: [PATCH 3/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make 
threshold generic

From 202416dbdf3fce31bfd76f1e74dda89b382a78c3 Mon Sep 17 00:00:00 2001
From: Vijay Kumar vijaykumar...@ti.com
Date: Thu, 19 Nov 2009 15:07:38 +0530
Subject: [PATCH 3/3] OMAP 3630: Update VDD2 values  The OMAP3630 VDD2 minimum 
value is 1 and Maximum value is 2. The VDD2  API's are updated to return proper 
VDD2 values.


Signed-off-by: Charulatha V ch...@ti.com
Signed-off-by: Manjunath GK manj...@ti.com
Signed-off-by: Vijay Kumar vijaykumar...@ti.com
---
 arch/arm/mach-omap2/pm34xx.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 
1ed7f53..c240804 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1080,7 +1080,7 @@ EXPORT_SYMBOL(omap3_get_min_vdd1_opp);
 int omap3_get_max_vdd2_opp(void)
 {
if (cpu_is_omap3630())
-   return VDD2_OPP3;
+   return VDD2_OPP2;
else /* Place holder for other 34xx (3430/3440) */
return VDD2_OPP3;

@@ -1090,9 +1090,9 @@ EXPORT_SYMBOL(omap3_get_max_vdd2_opp);
 int omap3_get_min_vdd2_opp(void)
 {
if (cpu_is_omap3630())
-   return VDD2_OPP2;
-   else /* Place holder for other 34xx (3430/3440) */
return VDD2_OPP1;
+   else /* Place holder for other 34xx (3430/3440) */
+   return VDD2_OPP2;

 }
 EXPORT_SYMBOL(omap3_get_min_vdd2_opp);
--
1.5.4.3




Thanks and Regards
Vijay--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] VFP context save/restore support for OMAP3

2009-11-19 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

These two patches add support for VFP context save and restore. These patches
are a collaboration from several people (listed in CC), I have mainly
split the original patch in two parts (one generic ARM, one for OMAP3 PM),
and optimized the code a bit. No sign-offs added from anybody except myself
at the moment because I have modified the patches quite heavily.

I think patch #1 should actually go to linux-arm list, however I thought to
get some comments about the patches on omap list first.

These will apply on top of PM branch.

-Tero


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] OMAP3: Implemented VFP restore/save context

2009-11-19 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

VFP save context is called before MPU/NEON off. Restore is not needed as
the next VFP trap will restore context automatically. Uses the support
routine implemented in arch/arm/vfp/vfpmodule.c.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
Cc: Vishwanath Sripathy vishwanath...@ti.com
Cc: Rajendra Nayak rna...@ti.com
Cc: Richard Woodruff r-woodru...@ti.com
Cc: Peter 'p2' De Schrijver peter.de-schrij...@nokia.com
---
 arch/arm/mach-omap2/pm.h |1 +
 arch/arm/mach-omap2/pm34xx.c |   21 -
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 4f22107..dd5bbaf 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -18,6 +18,7 @@ extern u32 sleep_while_idle;
 extern u32 voltage_off_while_idle;
 
 extern void *omap3_secure_ram_storage;
+extern void vfp_pm_save_context(void);
 extern void omap3_pm_off_mode_enable(int);
 extern void omap_sram_idle(void);
 extern int omap3_can_sleep(void);
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b26ae5b..4b01303 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -321,6 +321,18 @@ static void restore_control_register(u32 val)
__asm__ __volatile__ (mcr p15, 0, %0, c1, c0, 0 : : r (val));
 }
 
+static inline void omap3_save_neon_context(void)
+{
+#ifdef CONFIG_VFP
+   vfp_pm_save_context();
+#endif
+}
+
+static inline void omap3_restore_neon_context(void)
+{
+   return;
+}
+
 /* Function to restore the table entry that was modified for enabling MMU */
 static void restore_table_entry(void)
 {
@@ -365,6 +377,7 @@ void omap_sram_idle(void)
/* save_state = 3 = L1, L2 and logic lost */
int save_state = 0;
int mpu_next_state = PWRDM_POWER_ON;
+   int neon_next_state = PWRDM_POWER_ON;
int per_next_state = PWRDM_POWER_ON;
int core_next_state = PWRDM_POWER_ON;
int core_prev_state, per_prev_state;
@@ -398,8 +411,12 @@ void omap_sram_idle(void)
pwrdm_pre_transition();
 
/* NEON control */
-   if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
+   if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) {
pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
+   neon_next_state = mpu_next_state;
+   if (neon_next_state == PWRDM_POWER_OFF)
+   omap3_save_neon_context();
+   }
 
/* PER */
per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
@@ -537,6 +554,8 @@ void omap_sram_idle(void)
omap3_disable_io_chain();
}
 
+   if (neon_next_state == PWRDM_POWER_OFF)
+   omap3_restore_neon_context();
 
pwrdm_post_transition();
 }
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ARM: Implemented support for VFP PM context saving

2009-11-19 Thread Tero Kristo
From: Tero Kristo tero.kri...@nokia.com

In some ARM architectures, like OMAP3, the VFP context can be lost during
dynamic sleep cycle. For this purpose, there is now a function
vfp_pm_save_context() that should be called before the VFP is assumed to
lose context. Next VFP trap will then restore context automatically.

We need to have the last_VFP_context[cpu] cleared after the save in idle,
else the restore would fail to restore when it sees that the last_VFP_context
is same as the current threads vfp_state. This happens when the same
process/thread traps an exception post idle.

Main work for this patch was done by Peter and Rajendra. Some cleanup and
optimization by Tero.

Signed-off-by: Tero Kristo tero.kri...@nokia.com
Cc: Vishwanath Sripathy vishwanath...@ti.com
Cc: Rajendra Nayak rna...@ti.com
Cc: Richard Woodruff r-woodru...@ti.com
Cc: Peter 'p2' De Schrijver peter.de-schrij...@nokia.com
---
 arch/arm/vfp/vfpmodule.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 2d7423a..80a08bd 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -329,6 +329,31 @@ static void vfp_enable(void *unused)
 #ifdef CONFIG_PM
 #include linux/sysdev.h
 
+void vfp_pm_save_context(void)
+{
+   struct thread_info *thread = current_thread_info();
+   u32 fpexc = fmrx(FPEXC);
+   __u32 cpu = thread-cpu;
+
+   if (last_VFP_context[cpu]) {
+   if (!(fpexc  FPEXC_EN)) {
+   /* enable vfp now to save context */
+   vfp_enable(NULL);
+   fmxr(FPEXC, fmrx(FPEXC) | FPEXC_EN);
+   }
+   vfp_save_state(last_VFP_context[cpu], fpexc);
+
+   /* Disable vfp. The next inst traps an exception and restores*/
+   fmxr(FPEXC, fmrx(FPEXC)  ~FPEXC_EN);
+
+   /*
+* This is needed else the restore might fail if it sees
+* last_VFP_context if same as the current threads vfp_state.
+*/
+   last_VFP_context[cpu] = NULL;
+   }
+}
+
 static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
 {
struct thread_info *ti = current_thread_info();
-- 
1.5.4.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] AI TB: Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Gregoire Gentil

This series adds support for Always Innovating OMAP3-based Touch Book.

I also attach the patches as it seems that the last time, the indentation
was screwed up by the mailer.

Gregoire Gentil (8):
  defconfig file of Always Innovating OMAP3-based Touch Book
  Board file of Always Innovating OMAP3-based Touch Book
  Freescale MMA7455 accelerometer driver
  Driver for Always Innovating OMAP3-based Touch Book keyboard
  HID file for Always Innovating OMAP3-based Touch Book keyboard
  Audio driver of Always Innovating OMAP3-based Touch Book
  Video driver of Always Innovating OMAP3-based Touch Book
  Additional files for Always Innovating OMAP3-based Touch Book

 arch/arm/configs/omap3_touchbook_defconfig | 2441 
 arch/arm/mach-omap2/Kconfig|5 +
 arch/arm/mach-omap2/Makefile   |2 +
 arch/arm/mach-omap2/board-omap3touchbook.c |  683 
 drivers/hid/Kconfig|7 +
 drivers/hid/Makefile   |1 +
 drivers/hid/hid-alwaysinnovating.c |  262 +++
 drivers/hid/hid-core.c |1 +
 drivers/hid/hid-ids.h  |3 +
 drivers/input/misc/Kconfig |9 +
 drivers/input/misc/Makefile|2 +-
 drivers/input/misc/mma7455l.c  |  626 +++
 drivers/video/omap/lcd_omap3touchbook.c|  130 ++
 include/linux/mma7455l.h   |   11 +
 sound/soc/omap/Kconfig |8 +
 sound/soc/omap/Makefile|2 +
 sound/soc/omap/omap3touchbook.c|  211 +++
 17 files changed, 4403 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/configs/omap3_touchbook_defconfig
 create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
 create mode 100644 drivers/hid/hid-alwaysinnovating.c
 create mode 100644 drivers/input/misc/mma7455l.c
 create mode 100644 drivers/video/omap/lcd_omap3touchbook.c
 create mode 100644 include/linux/mma7455l.h
 create mode 100644 sound/soc/omap/omap3touchbook.c

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/8] Board file of Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 arch/arm/mach-omap2/board-omap3touchbook.c |  683 
 1 files changed, 683 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c

diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c 
b/arch/arm/mach-omap2/board-omap3touchbook.c
new file mode 100644
index 000..ad3ef6e
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -0,0 +1,683 @@
+/*
+ * linux/arch/arm/mach-omap2/board-omap3touchbook.c
+ *
+ * Copyright (C) 2009 Always Innovating
+ *
+ * Modified from mach-omap2/board-omap3beagleboard.c
+ *
+ * Initial code: Grégoire Gentil, Tim Yamin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/clk.h
+#include linux/io.h
+#include linux/leds.h
+#include linux/gpio.h
+#include linux/input.h
+#include linux/gpio_keys.h
+
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand.h
+
+#include plat/mcspi.h
+#include linux/spi/spi.h
+
+#include linux/spi/ads7846.h
+#include linux/mma7455l.h
+
+#include plat/dmtimer.h
+#include linux/backlight.h
+
+#include linux/regulator/machine.h
+#include linux/i2c/twl4030.h
+
+#include mach/hardware.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include asm/mach/flash.h
+
+#include plat/board.h
+#include plat/common.h
+#include plat/gpmc.h
+#include plat/nand.h
+#include plat/mux.h
+#include plat/usb.h
+#include plat/timer-gp.h
+
+#include mmc-twl4030.h
+
+#include asm/setup.h
+
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
+#define OMAP3_AC_GPIO  136
+#define OMAP3_TS_GPIO  162
+#define TB_BL_PWM_TIMER9
+#define TB_KILL_POWER_GPIO 168
+
+unsigned long touchbook_revision;
+
+static struct mtd_partition omap3touchbook_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader,
+   .offset = 0,
+   .size   = 4 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 15 * NAND_BLOCK_SIZE,
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot Env,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x26 */
+   .size   = 1 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = Kernel,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x28 */
+   .size   = 32 * NAND_BLOCK_SIZE,
+   },
+   {
+   .name   = File System,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x68 */
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct omap_nand_platform_data omap3touchbook_nand_data = {
+   .options= NAND_BUSWIDTH_16,
+   .parts  = omap3touchbook_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(omap3touchbook_nand_partitions),
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .nand_setup = NULL,
+   .dev_ready  = NULL,
+};
+
+static struct resource omap3touchbook_nand_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device omap3touchbook_nand_device = {
+   .name   = omap2-nand,
+   .id = -1,
+   .dev= {
+   .platform_data  = omap3touchbook_nand_data,
+   },
+   .num_resources  = 1,
+   .resource   = omap3touchbook_nand_resource,
+};
+
+#include sdram-micron-mt46h32m32lf-6.h
+
+static struct twl4030_hsmmc_info mmc[] = {
+   {
+   .mmc= 1,
+   .wires  = 8,
+   .gpio_wp= 29,
+   },
+   {}  /* Terminator */
+};
+
+static struct platform_device omap3_touchbook_lcd_device = {
+   .name   = omap3touchbook_lcd,
+   .id = -1,
+};
+
+static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = {
+   .ctrl_name  = internal,
+};
+
+static struct regulator_consumer_supply touchbook_vmmc1_supply = {
+   .supply = vmmc,
+};
+
+static struct regulator_consumer_supply touchbook_vsim_supply = {
+   .supply = vmmc_aux,
+};
+
+static struct gpio_led gpio_leds[];
+
+static int 

[PATCH 3/8] Freescale MMA7455 accelerometer driver

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 drivers/input/misc/Kconfig|9 +
 drivers/input/misc/Makefile   |2 +-
 drivers/input/misc/mma7455l.c |  626 +
 include/linux/mma7455l.h  |   11 +
 4 files changed, 647 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/misc/mma7455l.c
 create mode 100644 include/linux/mma7455l.h

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index a9bb254..454bac7 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -317,4 +317,13 @@ config INPUT_PCAP
  To compile this driver as a module, choose M here: the
  module will be called pcap_keys.
 
+config INPUT_MMA7455L
+   tristate Freescale MMA7455L 3-axis accelerometer
+   depends on SPI_MASTER
+   help
+ SPI driver for the Freescale MMA7455L 3-axis accelerometer.
+
+ The userspace interface is a 3-axis (X/Y/Z) relative movement
+ Linux input device, reporting REL_[XYZ] events.
+
 endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index a8b8485..3db6347 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -30,4 +30,4 @@ obj-$(CONFIG_INPUT_WINBOND_CIR)   += winbond-cir.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_INPUT_WM831X_ON)  += wm831x-on.o
 obj-$(CONFIG_INPUT_YEALINK)+= yealink.o
-
+obj-$(CONFIG_INPUT_MMA7455L)   += mma7455l.o
diff --git a/drivers/input/misc/mma7455l.c b/drivers/input/misc/mma7455l.c
new file mode 100644
index 000..d415bb0
--- /dev/null
+++ b/drivers/input/misc/mma7455l.c
@@ -0,0 +1,626 @@
+/* Linux kernel driver for the Freescale MMA7455L 3-axis accelerometer
+ *
+ * Copyright (C) 2009 by Always Innovating, Inc.
+ * Author: Gregoire Gentil grego...@gentil.com
+ * Author: Tim Yamin pl...@roo.me.uk
+ * All rights reserved.
+ *
+ * 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
+ *
+ */
+
+/*
+ * What this driver doesn't yet support:
+ *
+ * - I2C
+ * - INT2 handling
+ * - Pulse detection (and the sysctls to control it)
+ * - 10-bit measurement
+ */
+
+#include linux/kernel.h
+#include linux/types.h
+#include linux/module.h
+#include linux/device.h
+#include linux/platform_device.h
+#include linux/delay.h
+#include linux/input.h
+#include linux/irq.h
+#include linux/interrupt.h
+#include linux/sysfs.h
+#include linux/gpio.h
+
+#include linux/mma7455l.h
+#include linux/spi/spi.h
+
+#define MMA7455L_WHOAMI_MAGIC  0x55
+
+enum mma7455l_reg {
+   MMA7455L_REG_XOUTL  = 0x00,
+   MMA7455L_REG_XOUTH  = 0x01,
+   MMA7455L_REG_YOUTL  = 0x02,
+   MMA7455L_REG_YOUTH  = 0x03,
+   MMA7455L_REG_ZOUTL  = 0x04,
+   MMA7455L_REG_ZOUTH  = 0x05,
+   MMA7455L_REG_XOUT8  = 0x06,
+   MMA7455L_REG_YOUT8  = 0x07,
+   MMA7455L_REG_ZOUT8  = 0x08,
+   MMA7455L_REG_STATUS = 0x09,
+   MMA7455L_REG_DETSRC = 0x0a,
+   MMA7455L_REG_TOUT   = 0x0b,
+   MMA7455L_REG_RESERVED1  = 0x0c,
+   MMA7455L_REG_I2CAD  = 0x0d,
+   MMA7455L_REG_USRINF = 0x0e,
+   MMA7455L_REG_WHOAMI = 0x0f,
+   MMA7455L_REG_XOFFL  = 0x10,
+   MMA7455L_REG_XOFFH  = 0x11,
+   MMA7455L_REG_YOFFL  = 0x12,
+   MMA7455L_REG_YOFFH  = 0x13,
+   MMA7455L_REG_ZOFFL  = 0x14,
+   MMA7455L_REG_ZOFFH  = 0x15,
+   MMA7455L_REG_MCTL   = 0x16,
+   MMA7455L_REG_INTRST = 0x17,
+   MMA7455L_REG_CTL1   = 0x18,
+   MMA7455L_REG_CTL2   = 0x19,
+   MMA7455L_REG_LDTH   = 0x1a,
+   MMA7455L_REG_PDTH   = 0x1b,
+   MMA7455L_REG_PW = 0x1c,
+   MMA7455L_REG_LT = 0x1d,
+   MMA7455L_REG_TW = 0x1e,
+   MMA7455L_REG_RESERVED2  = 0x1f,
+};
+
+enum mma7455l_reg_status {
+   MMA7455L_STATUS_XDA = 0x08,
+   MMA7455L_STATUS_YDA = 0x10,
+   MMA7455L_STATUS_ZDA = 0x20,
+};
+
+enum 

[PATCH 4/8] Driver for Always Innovating OMAP3-based Touch Book keyboard

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 drivers/hid/Kconfig|7 +++
 drivers/hid/Makefile   |1 +
 drivers/hid/hid-core.c |1 +
 drivers/hid/hid-ids.h  |3 +++
 4 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 24d90ea..b56ddc5 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -62,6 +62,13 @@ config HID_A4TECH
---help---
Support for A4 tech X5 and WOP-35 / Trust 450L mice.
 
+config HID_ALWAYSINNOVATING
+   tristate Always Innovating if EMBEDDED
+   depends on USB_HID
+   default !EMBEDDED
+   ---help---
+   Support for Always Innovating Touch Book.
+
 config HID_APPLE
tristate Apple if EMBEDDED
depends on (USB_HID || BT_HIDP)
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 0de2dff..b6a2860 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -20,6 +20,7 @@ ifdef CONFIG_LOGIRUMBLEPAD2_FF
 endif
 
 obj-$(CONFIG_HID_A4TECH)   += hid-a4tech.o
+obj-$(CONFIG_HID_ALWAYSINNOVATING) += hid-alwaysinnovating.o
 obj-$(CONFIG_HID_APPLE)+= hid-apple.o
 obj-$(CONFIG_HID_BELKIN)   += hid-belkin.o
 obj-$(CONFIG_HID_CHERRY)   += hid-cherry.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 7d05c4b..2bb62c3 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1252,6 +1252,7 @@ EXPORT_SYMBOL_GPL(hid_disconnect);
 static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
+   { HID_USB_DEVICE(USB_VENDOR_ID_ALWAYSINNOVATING, 
USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 
USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) 
},
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index adbef5d..ebf53f7 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -54,6 +54,9 @@
 #define USB_VENDOR_ID_ALPS 0x0433
 #define USB_DEVICE_ID_IBM_GAMEPAD  0x1101
 
+#define USB_VENDOR_ID_ALWAYSINNOVATING 0xa110
+#define USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK  0x0002
+
 #define USB_VENDOR_ID_APPLE0x05ac
 #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE0x0304
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI  0x020e
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/8] HID file for Always Innovating OMAP3-based Touch Book keyboard

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 drivers/hid/hid-alwaysinnovating.c |  262 
 1 files changed, 262 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hid/hid-alwaysinnovating.c

diff --git a/drivers/hid/hid-alwaysinnovating.c 
b/drivers/hid/hid-alwaysinnovating.c
new file mode 100644
index 000..a7bb0fd
--- /dev/null
+++ b/drivers/hid/hid-alwaysinnovating.c
@@ -0,0 +1,262 @@
+/*
+ *  USB HID quirks support for the Always Innovating Touch Book
+ *  Code borrowed from hid-apple.c
+ *
+ *  Copyright (c) 2009 Gregoire Gentil grego...@gentil.com
+ *  Copyright (c) 2009 Tim Yamin pl...@roo.me.uk
+ */
+
+/*
+ * 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.
+ */
+
+#include linux/device.h
+#include linux/hid.h
+#include linux/module.h
+#include linux/usb.h
+
+#include hid-ids.h
+
+struct touchbook_sc {
+   unsigned long quirks;
+   unsigned int  fn_on;
+   DECLARE_BITMAP(pressed_fn, KEY_CNT);
+};
+
+struct touchbook_key_translation {
+   u16 from;
+   u16 to;
+   u8 flags;
+};
+
+static struct touchbook_key_translation touchbook_fn_keys[] = {
+   { KEY_F6,   KEY_BRIGHTNESSDOWN },
+   { KEY_F7,   KEY_BRIGHTNESSUP },
+
+   { KEY_F8,   KEY_MUTE },
+   { KEY_F9,   KEY_VOLUMEDOWN },
+   { KEY_F10,  KEY_VOLUMEUP },
+
+   { KEY_UP,   KEY_PAGEUP },
+   { KEY_DOWN, KEY_PAGEDOWN },
+   { }
+};
+
+extern unsigned long touchbook_revision;
+unsigned long swap_key;
+
+static struct touchbook_key_translation *touchbook_find_translation(
+   struct touchbook_key_translation *table, u16 from)
+{
+   struct touchbook_key_translation *trans;
+
+   /* Look for the translation */
+   for (trans = table; trans-from; trans++)
+   if (trans-from == from)
+   return trans;
+
+   return NULL;
+}
+
+static int touchbook_event(struct hid_device *hid, struct hid_field *field,
+   struct hid_usage *usage, __s32 value)
+{
+   int do_translate;
+
+   struct input_dev *input = field-hidinput-input;
+   struct touchbook_sc *asc = hid_get_drvdata(hid);
+   struct touchbook_key_translation *trans;
+
+   if (swap_key  usage-code == KEY_RIGHTSHIFT) {
+   input_event(input, usage-type, KEY_END, value);
+   return 1;
+   }
+
+   if (swap_key  usage-code == KEY_END) {
+   input_event(input, usage-type, KEY_RIGHTSHIFT, value);
+   return 1;
+   }
+
+   if (usage-code == KEY_POWER) {
+   asc-fn_on = !!value;
+   input_event(input, usage-type, usage-code, value);
+   return 1;
+   }
+
+   trans = touchbook_find_translation(touchbook_fn_keys, usage-code);
+   if (trans) {
+   if (test_bit(usage-code, asc-pressed_fn))
+   do_translate = 1;
+   else
+   do_translate = asc-fn_on;
+
+   if (do_translate) {
+   if (value)
+   set_bit(usage-code, asc-pressed_fn);
+   else
+   clear_bit(usage-code, asc-pressed_fn);
+
+   input_event(input, usage-type, trans-to,
+   value);
+
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+static int touchbook_input_mapping(struct hid_device *hdev,
+   struct hid_input *hi,
+   struct hid_field *field, struct hid_usage *usage,
+   unsigned long **bit, int *max)
+{
+   struct touchbook_key_translation *trans;
+
+   /* Enable all other keys */
+   for (trans = touchbook_fn_keys; trans-from; trans++)
+   set_bit(trans-to, hi-input-keybit);
+
+   return 0;
+}
+
+static ssize_t show_swap_key(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %lu\n, swap_key);
+}
+
+static ssize_t store_swap_key(struct device *dev,
+   struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+strict_strtoul(buf, 10, swap_key);
+
+   if (swap_key != 0  swap_key != 1) {
+   swap_key = 0;
+   return -EINVAL;
+   }
+
+   return count;
+}
+
+static struct device_attribute touchbook_hid_attrs[] = {
+   __ATTR(swap_key, S_IRUGO | S_IWUGO, show_swap_key, store_swap_key),
+};
+
+int touchbook_create_sysfs(struct hid_device *hdev)
+{
+   int i;
+   int r;
+
+   for (i = 0; i  ARRAY_SIZE(touchbook_hid_attrs); i++) {
+   r = device_create_file(hdev-dev,
+   touchbook_hid_attrs[i]);
+
+  

[PATCH 6/8] Audio driver of Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 sound/soc/omap/Kconfig  |8 ++
 sound/soc/omap/Makefile |2 +
 sound/soc/omap/omap3touchbook.c |  211 +++
 3 files changed, 221 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/omap/omap3touchbook.c

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 653a362..c590252 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -83,6 +83,14 @@ config SND_OMAP_SOC_OMAP3_PANDORA
help
  Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
 
+config SND_OMAP_SOC_OMAP3_TOUCHBOOK
+   tristate SoC Audio support for OMAP3 Touch Book
+   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP3_TOUCHBOOK
+   select SND_OMAP_SOC_MCBSP
+   select SND_SOC_TWL4030
+   help
+ Say Y if you want to add support for SoC audio on the OMAP3 Touch 
Book.
+
 config SND_OMAP_SOC_OMAP3_BEAGLE
tristate SoC Audio support for OMAP3 Beagle
depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP3_BEAGLE
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index 02d6947..f360b82 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -15,6 +15,7 @@ snd-soc-omap3evm-objs := omap3evm.o
 snd-soc-sdp3430-objs := sdp3430.o
 snd-soc-omap3pandora-objs := omap3pandora.o
 snd-soc-omap3beagle-objs := omap3beagle.o
+snd-soc-omap3touchbook-objs := omap3touchbook.o
 snd-soc-zoom2-objs := zoom2.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
@@ -26,4 +27,5 @@ obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o
 obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK) += snd-soc-omap3touchbook.o
 obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
diff --git a/sound/soc/omap/omap3touchbook.c b/sound/soc/omap/omap3touchbook.c
new file mode 100644
index 000..584f07d
--- /dev/null
+++ b/sound/soc/omap/omap3touchbook.c
@@ -0,0 +1,211 @@
+/*
+ * omap3touchbook.c  --  SoC audio for OMAP3 Touch Book
+ *
+ * Author: Gregoire Gentil grego...@gentil.com
+ *
+ * Derived from sound/soc/omap/omap3beagle.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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 St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include linux/clk.h
+#include linux/irq.h
+#include linux/interrupt.h
+#include linux/platform_device.h
+
+#include sound/core.h
+#include sound/pcm.h
+#include sound/soc.h
+#include sound/soc-dapm.h
+
+#include asm/mach-types.h
+#include mach/hardware.h
+#include mach/gpio.h
+#include plat/mcbsp.h
+
+#include omap-mcbsp.h
+#include omap-pcm.h
+#include ../codecs/twl4030.h
+
+#define TB_HEADPHONE_GPIO 56
+#define TB_HEADPHONE_IRQ  OMAP_GPIO_IRQ(TB_HEADPHONE_GPIO)
+
+static int omap3touchbook_hw_params(struct snd_pcm_substream *substream,
+   struct snd_pcm_hw_params *params)
+{
+   struct snd_soc_pcm_runtime *rtd = substream-private_data;
+   struct snd_soc_dai *codec_dai = rtd-dai-codec_dai;
+   struct snd_soc_dai *cpu_dai = rtd-dai-cpu_dai;
+   unsigned int fmt;
+   int ret;
+
+   switch (params_channels(params)) {
+   case 2: /* Stereo I2S mode */
+   fmt =   SND_SOC_DAIFMT_I2S |
+   SND_SOC_DAIFMT_NB_NF |
+   SND_SOC_DAIFMT_CBM_CFM;
+   break;
+   case 4: /* Four channel TDM mode */
+   fmt =   SND_SOC_DAIFMT_DSP_A |
+   SND_SOC_DAIFMT_IB_NF |
+   SND_SOC_DAIFMT_CBM_CFM;
+   break;
+   default:
+   return -EINVAL;
+   }
+
+   /* Set codec DAI configuration */
+   ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+   if (ret  0) {
+   printk(KERN_ERR can't set codec DAI configuration\n);
+   return ret;
+   }
+
+   /* Set cpu DAI configuration */
+   ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+   if (ret  0) {
+   printk(KERN_ERR can't set cpu DAI configuration\n);
+   return ret;
+   }
+
+   /* Set the codec system clock for DAC and ADC */
+   ret = snd_soc_dai_set_sysclk(codec_dai, 0, 2600,
+SND_SOC_CLOCK_IN);
+   if (ret  0) {
+   printk(KERN_ERR can't set codec 

[PATCH 8/8] Additional file for Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 arch/arm/mach-omap2/Kconfig  |5 +
 arch/arm/mach-omap2/Makefile |2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 034d990..6d32d1b 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -73,6 +73,11 @@ config MACH_OMAP3_PANDORA
bool OMAP3 Pandora
depends on ARCH_OMAP3  ARCH_OMAP34XX
 
+config MACH_OMAP3_TOUCHBOOK
+   bool OMAP3 Touch Book
+   depends on ARCH_OMAP3  ARCH_OMAP34XX
+   select BACKLIGHT_CLASS_DEVICE
+
 config MACH_OMAP_3430SDP
bool OMAP 3430 SDP board
depends on ARCH_OMAP3  ARCH_OMAP34XX
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 59b0ccc..b6b5c7f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -90,6 +90,8 @@ obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \
   mmc-twl4030.o
 obj-$(CONFIG_MACH_IGEP0020)+= board-igep0020.o \
   mmc-twl4030.o
+obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
+  mmc-twl4030.o
 
 obj-$(CONFIG_MACH_OMAP_4430SDP)+= board-4430sdp.o
 
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/8] Video driver of Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Gregoire Gentil

Signed-off-by: Gregoire Gentil grego...@gentil.com
---
 drivers/video/omap/lcd_omap3touchbook.c |  130 +++
 1 files changed, 130 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap/lcd_omap3touchbook.c

diff --git a/drivers/video/omap/lcd_omap3touchbook.c 
b/drivers/video/omap/lcd_omap3touchbook.c
new file mode 100644
index 000..5b58703
--- /dev/null
+++ b/drivers/video/omap/lcd_omap3touchbook.c
@@ -0,0 +1,130 @@
+/*
+ * LCD panel support for the Touch Book
+ *
+ * Author: Gregoire Gentil grego...@gentil.com
+ *
+ * Derived from drivers/video/omap/lcd-omap3beagle.c
+ *
+ * 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/platform_device.h
+#include linux/gpio.h
+#include linux/i2c/twl4030.h
+
+#include plat/mux.h
+#include plat/omapfb.h
+#include asm/mach-types.h
+
+#define LCD_PANEL_ENABLE_GPIO   176
+
+static int omap3beagle_panel_init(struct lcd_panel *panel,
+   struct omapfb_device *fbdev)
+{
+   gpio_request(LCD_PANEL_ENABLE_GPIO, LCD enable);
+   return 0;
+}
+
+static void omap3beagle_panel_cleanup(struct lcd_panel *panel)
+{
+   gpio_free(LCD_PANEL_ENABLE_GPIO);
+}
+
+static int omap3beagle_panel_enable(struct lcd_panel *panel)
+{
+   gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
+   return 0;
+}
+
+static void omap3beagle_panel_disable(struct lcd_panel *panel)
+{
+   gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
+}
+
+static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
+{
+   return 0;
+}
+
+struct lcd_panel omap3beagle_panel = {
+   .name   = omap3beagle,
+   .config = OMAP_LCDC_PANEL_TFT,
+
+   .bpp= 16,
+   .data_lines = 24,
+   .x_res  = 1024,
+   .y_res  = 600,
+   .hsw= 3,
+   .hfp= 3,
+   .hbp= 39,
+   .vsw= 1,
+   .vfp= 2,
+   .vbp= 7,
+
+   .pixel_clock= 64000,
+
+   .init   = omap3touchbook_panel_init,
+   .cleanup= omap3touchbook_panel_cleanup,
+   .enable = omap3touchbook_panel_enable,
+   .disable= omap3touchbook_panel_disable,
+   .get_caps   = omap3touchbook_panel_get_caps,
+};
+
+static int omap3touchbook_panel_probe(struct platform_device *pdev)
+{
+   omapfb_register_panel(omap3beagle_panel);
+   return 0;
+}
+
+static int omap3touchbook_panel_remove(struct platform_device *pdev)
+{
+   return 0;
+}
+
+static int omap3touchbook_panel_suspend(struct platform_device *pdev,
+  pm_message_t mesg)
+{
+   return 0;
+}
+
+static int omap3touchbook_panel_resume(struct platform_device *pdev)
+{
+   return 0;
+}
+
+struct platform_driver omap3touchbook_panel_driver = {
+   .probe  = omap3touchbook_panel_probe,
+   .remove = omap3touchbook_panel_remove,
+   .suspend= omap3touchbook_panel_suspend,
+   .resume = omap3touchbook_panel_resume,
+   .driver = {
+   .name   = omap3touchbook_lcd,
+   .owner  = THIS_MODULE,
+   },
+};
+
+static int __init omap3touchbook_panel_drv_init(void)
+{
+   return platform_driver_register(omap3beagle_panel_driver);
+}
+
+static void __exit omap3touchbook_panel_drv_exit(void)
+{
+   platform_driver_unregister(omap3touchbook_panel_driver);
+}
+
+module_init(omap3touchbook_panel_drv_init);
+module_exit(omap3touchbook_panel_drv_exit);
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/8] HID file for Always Innovating OMAP3-based Touch Book keyboard

2009-11-19 Thread Koen Kooi

You haven't addressed Dmitry's comments in this new version

regards,

Koen

Op 19 nov 2009, om 18:18 heeft Gregoire Gentil het volgende geschreven:



Signed-off-by: Gregoire Gentil grego...@gentil.com
---
drivers/hid/hid-alwaysinnovating.c |  262 +++ 
+

1 files changed, 262 insertions(+), 0 deletions(-)
create mode 100644 drivers/hid/hid-alwaysinnovating.c

diff --git a/drivers/hid/hid-alwaysinnovating.c b/drivers/hid/hid- 
alwaysinnovating.c

new file mode 100644
index 000..a7bb0fd
--- /dev/null
+++ b/drivers/hid/hid-alwaysinnovating.c
@@ -0,0 +1,262 @@
+/*
+ *  USB HID quirks support for the Always Innovating Touch Book
+ *  Code borrowed from hid-apple.c
+ *
+ *  Copyright (c) 2009 Gregoire Gentil grego...@gentil.com
+ *  Copyright (c) 2009 Tim Yamin pl...@roo.me.uk
+ */
+
+/*
+ * 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.
+ */
+
+#include linux/device.h
+#include linux/hid.h
+#include linux/module.h
+#include linux/usb.h
+
+#include hid-ids.h
+
+struct touchbook_sc {
+   unsigned long quirks;
+   unsigned int  fn_on;
+   DECLARE_BITMAP(pressed_fn, KEY_CNT);
+};
+
+struct touchbook_key_translation {
+   u16 from;
+   u16 to;
+   u8 flags;
+};
+
+static struct touchbook_key_translation touchbook_fn_keys[] = {
+   { KEY_F6,   KEY_BRIGHTNESSDOWN },
+   { KEY_F7,   KEY_BRIGHTNESSUP },
+
+   { KEY_F8,   KEY_MUTE },
+   { KEY_F9,   KEY_VOLUMEDOWN },
+   { KEY_F10,  KEY_VOLUMEUP },
+
+   { KEY_UP,   KEY_PAGEUP },
+   { KEY_DOWN, KEY_PAGEDOWN },
+   { }
+};
+
+extern unsigned long touchbook_revision;
+unsigned long swap_key;
+
+static struct touchbook_key_translation *touchbook_find_translation(
+   struct touchbook_key_translation *table, u16 from)
+{
+   struct touchbook_key_translation *trans;
+
+   /* Look for the translation */
+   for (trans = table; trans-from; trans++)
+   if (trans-from == from)
+   return trans;
+
+   return NULL;
+}
+
+static int touchbook_event(struct hid_device *hid, struct hid_field  
*field,

+   struct hid_usage *usage, __s32 value)
+{
+   int do_translate;
+
+   struct input_dev *input = field-hidinput-input;
+   struct touchbook_sc *asc = hid_get_drvdata(hid);
+   struct touchbook_key_translation *trans;
+
+   if (swap_key  usage-code == KEY_RIGHTSHIFT) {
+   input_event(input, usage-type, KEY_END, value);
+   return 1;
+   }
+
+   if (swap_key  usage-code == KEY_END) {
+   input_event(input, usage-type, KEY_RIGHTSHIFT, value);
+   return 1;
+   }
+
+   if (usage-code == KEY_POWER) {
+   asc-fn_on = !!value;
+   input_event(input, usage-type, usage-code, value);
+   return 1;
+   }
+
+   trans = touchbook_find_translation(touchbook_fn_keys, usage-code);
+   if (trans) {
+   if (test_bit(usage-code, asc-pressed_fn))
+   do_translate = 1;
+   else
+   do_translate = asc-fn_on;
+
+   if (do_translate) {
+   if (value)
+   set_bit(usage-code, asc-pressed_fn);
+   else
+   clear_bit(usage-code, asc-pressed_fn);
+
+   input_event(input, usage-type, trans-to,
+   value);
+
+   return 1;
+   }
+   }
+
+   return 0;
+}
+
+static int touchbook_input_mapping(struct hid_device *hdev,
+   struct hid_input *hi,
+   struct hid_field *field, struct hid_usage *usage,
+   unsigned long **bit, int *max)
+{
+   struct touchbook_key_translation *trans;
+
+   /* Enable all other keys */
+   for (trans = touchbook_fn_keys; trans-from; trans++)
+   set_bit(trans-to, hi-input-keybit);
+
+   return 0;
+}
+
+static ssize_t show_swap_key(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %lu\n, swap_key);
+}
+
+static ssize_t store_swap_key(struct device *dev,
+   struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+strict_strtoul(buf, 10, swap_key);
+
+   if (swap_key != 0  swap_key != 1) {
+   swap_key = 0;
+   return -EINVAL;
+   }
+
+   return count;
+}
+
+static struct device_attribute touchbook_hid_attrs[] = {
+   __ATTR(swap_key, S_IRUGO | S_IWUGO, show_swap_key, store_swap_key),
+};
+
+int touchbook_create_sysfs(struct hid_device *hdev)
+{
+   int i;
+   int r;
+
+   

[PATCH] USB: twl4030: Enable USB regulators before enabling USB charging

2009-11-19 Thread Aguilar Pena, Leed
For TWL family of power management ICs, USB charging works only
when USB regulators are in enabled state: 3v1, 1v5, 1v8

On a USB cable attach, twl4030_phy_resume(twl) function enables
the regulators. Enable USB charging, only after all regulators
are enabled.

Its observed that enabling USB charging before regulators are
enabled, causes USB charging to fail.

Tested on: Zoom2: omap3430: ES3.1 + TWL5030
Needs T2-MADC and T2-BCI drivers which are still not upstreamed.

Signed-off-by: Moiz Sonasath m-sonas...@ti.com
Signed-off-by: Leed Aguilar leed.agui...@ti.com
Acked-by: Vikram Pandita vikram.pand...@ti.com
Acked-by: Anand Gadiyar gadi...@ti.com
Acked-by: Nishanth Menon n...@ti.com

---
 drivers/usb/otg/twl4030-usb.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c
index 9e3e7a5..bd9883f 100644
--- a/drivers/usb/otg/twl4030-usb.c
+++ b/drivers/usb/otg/twl4030-usb.c
@@ -598,12 +598,12 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
 * USB_LINK_VBUS state.  musb_hdrc won't care until it
 * starts to handle softconnect right.
 */
-   twl4030charger_usb_en(status == USB_LINK_VBUS);
-
if (status == USB_LINK_NONE)
twl4030_phy_suspend(twl, 0);
else
twl4030_phy_resume(twl);
+
+   twl4030charger_usb_en(status == USB_LINK_VBUS);
}
sysfs_notify(twl-dev-kobj, NULL, vbus);
 
-- 
1.6.0.4
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

2009-11-19 Thread Kevin Hilman
G.N, Vijayakumar vijaykumar...@ti.com writes:

 With 3 patches I am trying to 
 1. Remove hardcoded VDD1 OPP values and make threshold generic
 2. Remove hardcoded VDD2 OPP values and make threshold generic
 3. adding new api inplace of MIN/MAX_VDD1/VDD2_OPP 
  to support 3630 OPP constraning along with the existing 3430 
 constraint.

 Patches are rebased on the 2.6.32-rc7.

 Patches have been tested for 3630 for 2.6.32-rc5.

I'm going to hold off on this series.

We're in the middle of discussions and proposals on a major rework of
the OPP layer, so I don't think it's worthwhile to spend time on these
relatively minor cleanups at the moment.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] OMAP: omap_device: warn about expected latencies only if non-zero

2009-11-19 Thread Kevin Hilman
Paul Walmsley p...@pwsan.com writes:

 Hi,

 On Tue, 17 Nov 2009, Kevin Hilman wrote:

 When checking measured [de]activate latencies against expected
 latencies, only print warning if driver has provided a non-zero
 latency.
 
 This allows drivers to set their [de]activate latencies to zero when
 they are not known, or are don't care, and the omap_device core will
 not complain about unexpected latencies.

 I'm concerned that this will effectively mean that no driver maintainers 
 will bother to measure these latencies.   

 These are necessary for a reasonable implementation of
 omap_pm_set_max_dev_wakeup_lat().  They should not be difficult to
 measure: boot at the lowest-performance OPPs with the latencies
 uninitialized; then these warnings should indicate numbers that can
 be plugged back into the omap_device structure.  But perhaps I am
 misunderstanding the point you are making?

Part of the issue is being able to do a quick conversion, without
needing to measure latencies (which I'm guilty of.)  

The other part was that I was thinking (the RFC part) was that it
might be useful for performance reasons to not do do any measuring at
all.  Of course, this would preclude a useful max_dev_wakeup_lat() but
we could warn about that.

But, for now I agree. I think getting these latencies in place is more
important than having an optimization for avoiding measurement for now.

Kevin

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] Freescale MMA7455 accelerometer driver

2009-11-19 Thread Jonathan Cameron
Hi Gregoire,

Couple of minor style type comments you are welcome to ignore

Bigger ones are that I don't understand your signed 10 bit conversion
functions and the bits of the probe function that don't seem to have been
written (error handling etc).

Jonathan

Gregoire Gentil wrote:
 Signed-off-by: Gregoire Gentil grego...@gentil.com
 ---
  drivers/input/misc/Kconfig|9 +
  drivers/input/misc/Makefile   |2 +-
  drivers/input/misc/mma7455l.c |  626 
 +
  include/linux/mma7455l.h  |   11 +
  4 files changed, 647 insertions(+), 1 deletions(-)
  create mode 100644 drivers/input/misc/mma7455l.c
  create mode 100644 include/linux/mma7455l.h
 
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
 index a9bb254..454bac7 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -317,4 +317,13 @@ config INPUT_PCAP
 To compile this driver as a module, choose M here: the
 module will be called pcap_keys.
  
 +config INPUT_MMA7455L
 + tristate Freescale MMA7455L 3-axis accelerometer
 + depends on SPI_MASTER
 + help
 +   SPI driver for the Freescale MMA7455L 3-axis accelerometer.
 +
 +   The userspace interface is a 3-axis (X/Y/Z) relative movement
 +   Linux input device, reporting REL_[XYZ] events.
 +
  endif
 diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
 index a8b8485..3db6347 100644
 --- a/drivers/input/misc/Makefile
 +++ b/drivers/input/misc/Makefile
 @@ -30,4 +30,4 @@ obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
  obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
  obj-$(CONFIG_INPUT_WM831X_ON)+= wm831x-on.o
  obj-$(CONFIG_INPUT_YEALINK)  += yealink.o
 -
 +obj-$(CONFIG_INPUT_MMA7455L) += mma7455l.o
 diff --git a/drivers/input/misc/mma7455l.c b/drivers/input/misc/mma7455l.c
 new file mode 100644
 index 000..d415bb0
 --- /dev/null
 +++ b/drivers/input/misc/mma7455l.c
 @@ -0,0 +1,626 @@
 +/* Linux kernel driver for the Freescale MMA7455L 3-axis accelerometer
 + *
 + * Copyright (C) 2009 by Always Innovating, Inc.
 + * Author: Gregoire Gentil grego...@gentil.com
 + * Author: Tim Yamin pl...@roo.me.uk
 + * All rights reserved.
 + *
 + * 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
 + *
 + */
 +
 +/*
 + * What this driver doesn't yet support:
 + *
 + * - I2C
 + * - INT2 handling
 + * - Pulse detection (and the sysctls to control it)
 + * - 10-bit measurement
 + */
 +
 +#include linux/kernel.h
 +#include linux/types.h
 +#include linux/module.h
 +#include linux/device.h
 +#include linux/platform_device.h
 +#include linux/delay.h
 +#include linux/input.h
 +#include linux/irq.h
 +#include linux/interrupt.h
 +#include linux/sysfs.h
 +#include linux/gpio.h
 +
 +#include linux/mma7455l.h
 +#include linux/spi/spi.h
 +
 +#define MMA7455L_WHOAMI_MAGIC0x55
 +
 +enum mma7455l_reg {
 + MMA7455L_REG_XOUTL  = 0x00,
 + MMA7455L_REG_XOUTH  = 0x01,
 + MMA7455L_REG_YOUTL  = 0x02,
 + MMA7455L_REG_YOUTH  = 0x03,
 + MMA7455L_REG_ZOUTL  = 0x04,
 + MMA7455L_REG_ZOUTH  = 0x05,
 + MMA7455L_REG_XOUT8  = 0x06,
 + MMA7455L_REG_YOUT8  = 0x07,
 + MMA7455L_REG_ZOUT8  = 0x08,
 + MMA7455L_REG_STATUS = 0x09,
 + MMA7455L_REG_DETSRC = 0x0a,
 + MMA7455L_REG_TOUT   = 0x0b,
 + MMA7455L_REG_RESERVED1  = 0x0c,
 + MMA7455L_REG_I2CAD  = 0x0d,
 + MMA7455L_REG_USRINF = 0x0e,
 + MMA7455L_REG_WHOAMI = 0x0f,
 + MMA7455L_REG_XOFFL  = 0x10,
 + MMA7455L_REG_XOFFH  = 0x11,
 + MMA7455L_REG_YOFFL  = 0x12,
 + MMA7455L_REG_YOFFH  = 0x13,
 + MMA7455L_REG_ZOFFL  = 0x14,
 + MMA7455L_REG_ZOFFH  = 0x15,
 + MMA7455L_REG_MCTL   = 0x16,
 + MMA7455L_REG_INTRST = 0x17,
 + MMA7455L_REG_CTL1   = 0x18,
 + MMA7455L_REG_CTL2   = 0x19,
 + MMA7455L_REG_LDTH   = 0x1a,
 + MMA7455L_REG_PDTH   = 0x1b,
 + MMA7455L_REG_PW = 0x1c,
 +

Re: [alsa-devel] [PATCH 1/2] OMAP3: MCBSP: Suspend/resume failure fix

2009-11-19 Thread Anuj Aggarwal
On Thu, Nov 19, 2009 at 1:04 PM, Jarkko Nikula jhnik...@gmail.com wrote:
 On Wed, Nov 18, 2009 at 8:28 PM, Aggarwal, Anuj anuj.aggar...@ti.comwrote:

  If no API or feature would require active McBSP block before the
  omap_mcbsp_start call, then the clock management could be done inside
  the omap_mcbsp_start/-stop functions.
 [Aggarwal, Anuj] I tried doing that but it didn't work because before
 _start, we need to call set_hw_params which configures mcbsp, for which
 clocks are required.
 


 First modification to .../plat-omap/mcbsp.c could be just a patch which
 keeps the
 clocks on only when needed. I.e. keep them disabled when returning from
 request
 and activate them only when accessing the McBSP registers or when it is
 running.

 But that said, I don't know are there some use case or API which requires
 active
 clocks after request so that should be checked.


  Also context save/restore operations belongs more to PM callbacks
  of .../plat-omap/mcbsp.c. Or probably that can be done also dynamically
  inside the omap_mcbsp_start/-stop for keeping the whole McBSP shutdown
  whenever it is idle.
 [Aggarwal, Anuj] I am sorry I couldn't understand that. Did you mean that
 PM hooks can be added in the mcbsp driver which can be registered and
 called
 As and when required? Any reference driver for this, if my understanding
 is correct?
 


 Yep, the PM hooks in .../plat-omap/mcbsp.c should take care of saving the
 McBSP registers before going into suspend or restore them back when
 resuming.
 This would be second patch after the clock change patch.

 The comment about dynamic PM was an idea that if McBSP could be unpowered
 whenever it's not running and do the resume only when calling
 omap_mcbsp_start.
 But that would be some future improvements after basic suspend/resume
 functionality.

 I think it's worth to look McBSP register cache concept [1] from Janusz
  Krzysztofik would it help all of this context save/restore operations.
 [Aggarwal, Anuj] I tried these two patches on omap3 evm but they didn't
 work for me. The system doesn't go to the suspend state when I do:
 echo mem  /sys/power/state
 And the culprits were core (think sdma) and per domain. I tried
 disabling the mcbsp i/f clock as well but it didn't help. On mcbsp
 register dump, I couldn't find the sysconfig register getting
 configured. Could that be the root cause?


 Does it go into suspend if the audio is not running (i.e. McBSP not
 requested) or
 if you don't even compile the McBSP support? I haven't looked are there
 checks
 for active clocks in PM core but PM is easier to start with bare minimum and
 to
 see that system can do suspend/resume and then add more features one by one.
[Anuj] Yes, w/o audio, it goes into suspend neatly.
After going through the entire patch series [PATCHv5 00/20] OMAP
ASoC changes in DMA utilization, which I missed earlier, I found that the
sysfs entry dma_op_mode can be toggled among element/frame/threshold,
by default which is element hence not allowing the mcbsp driver to go into
idle state. I changed that at run time and after that I am able to hit
the suspend
state while playing back audio (at least the log doesn't
show that the system is not able to hit suspend).
My question is: is sysfs the only way to choose threshold or can it be made as
default? I could not see that happening in the code so thinking of the possible
reason of choosing not to do so. Because the user who wants to hit suspend
will not like to issue driver specific commands. Any specific reason of not
doing that by default?

 --
 Jarkko
 ___
 Alsa-devel mailing list
 alsa-de...@alsa-project.org
 http://mailman.alsa-project.org/mailman/listinfo/alsa-devel




-- 
Best Regards,
Anuj Aggarwal
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NULL pointer dereference with 2.6.31 on OMAP2430

2009-11-19 Thread Chris Banker
I'm having trouble with the 2.6.31 kernel running on an OMAP2430
board.  I was able to get the board to boot using 2.6.31rc1, but am
having some issue with 2.6.31.

With low-level debugging enabled, I get the output below.  It appears
to be an issue with the new hwmod system, which didn't exist in
2.6.31rc1.  It dies during the initialization of mpu_hwmod.
Specifically, it fails on the call to pwrdm_add_sleepdep() within
_add_initiator_dep().

Anyone have any suggestions as to how to fix this or what to try?

Thanks,
Chris

--

Starting kernel ...

Uncompressing 
Linux.
done, booting the kernel.
5Linux version 2.6.31-omap1 (cban...@vcaeng05) (gcc version 4.3.3
(GCC) ) #27 Wed Nov 18 17:23:18 PST 2009
CPU: ARMv6-compatible processor [4107b366] revision 6 (ARMv6TEJ), cr=00c5387f
CPU: VIPT aliasing data cache, VIPT aliasing instruction cache
Machine: BFT Digital Modem
Memory policy: ECC disabled, Data cache writeback
7On node 0 totalpages: 32768
7free_area_init_node: node 0, pgdat c0f10848, node_mem_map c0f35000
7  Normal zone: 256 pages used for memmap
7  Normal zone: 0 pages reserved
7  Normal zone: 32512 pages, LIFO batch:7
6OMAP24306
6SRAM: Mapped pa 0x4020 to va 0xe300 size: 0x10
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
5Kernel command line: root=/dev/ram0 rw console=ttys2,115200n8
PID hash table entries: 512 (order: 9, 2048 bytes)
6Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
6Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
6Memory: 128MB = 128MB total
5Memory: 114232KB available (3084K code, 327K data, 12124K init, 0K highmem)
6NR_IRQS:384
6Clocking rate (Crystal/DPLL/MPU): 19.2/660/330 MHz
1Unable to handle kernel NULL pointer dereference at virtual address 0004
1pgd = c0004000
1[0004] *pgd=
Internal error: Oops: 5 [#1]
dModules linked in:
CPU: 0Not tainted  (2.6.31-omap1 #27)
PC is at _enable+0x78/0x208
LR is at release_console_sem+0x1a8/0x204
pc : [c0be9098]lr : [c0bff998]psr: a1d3
sp : c0ee3f38  ip : c0ee3e80  fp : c0ee3f4c
r10: 80022140  r9 : 4107b366  r8 : 80022174
r7 : c0ee86b4  r6 : c0be95cc  r5 : c0ee6154  r4 : c0ee6154
r3 :   r2 :   r1 : 05b2  r0 : 001f
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 00c5387f  Table: 80004000  DAC: 0017
Process swapper (pid: 0, stack limit = 0xc0ee2260)
Stack: (0xc0ee3f38 to 0xc0ee4000)
3f20:   c0ee6634 c0ee6154
3f40: c0ee3f68 c0ee3f50 c0be9648 c0be902c  c0ee6154 c0be95cc c0ee3f88
3f60: c0ee3f6c c0be8a6c c0be95d8 c0eece48 c0eece48 c0bdbe08 c0ee5b34 c0ee3f98
3f80: c0ee3f8c c0be98f4 c0be8a44 c0ee3fb0 c0ee3f9c c000dfc4 c0be98a0 c0f11190
3fa0: c0f11184 c0ee3fc0 c0ee3fb4 c000ef0c c000df50 c0ee3fd0 c0ee3fc4 c000b878
3fc0: c000eee8 c0ee3ff4 c0ee3fd4 c0008a2c c000b84c c0008658 c0bdbe08 00c5387d
3fe0: c0f11440 c0bdc20c  c0ee3ff8 80008034 c00088fc  
Backtrace:
[c0be9020] (_enable+0x0/0x208) from [c0be9648] (_setup+0x7c/0xb0)
 r4:c0ee6154
[c0be95cc] (_setup+0x0/0xb0) from [c0be8a6c] (omap_hwmod_for_each+0x34/0x78)
 r6:c0be95cc r5:c0ee6154 r4:
[c0be8a38] (omap_hwmod_for_each+0x0/0x78) from [c0be98f4]
(omap_hwmod_late_init+0x60/0x8c)
 r7:c0ee5b34 r6:c0bdbe08 r5:c0eece48 r4:c0eece48
[c0be9894] (omap_hwmod_late_init+0x0/0x8c) from [c000dfc4]
(omap2_init_common_hw+0x80/0xbc)
[c000df44] (omap2_init_common_hw+0x0/0xbc) from [c000ef0c]
(omap2430bft_init_irq+0x30/0x1c4)
 r5:c0f11184 r4:c0f11190
[c000eedc] (omap2430bft_init_irq+0x0/0x1c4) from [c000b878]
(init_IRQ+0x38/0x44)
[c000b840] (init_IRQ+0x0/0x44) from [c0008a2c] (start_kernel+0x13c/0x2ac)
[c00088f0] (start_kernel+0x0/0x2ac) from [80008034] (0x80008034)
 r6:c0bdc20c r5:c0f11440 r4:00c5387d
Code: 0a05 e5933020 e592205c e593305c (e5920004)
4---[ end trace 1b75b31a2719ed1c ]---
0Kernel panic - not syncing: Attempted to kill the idle task!
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/9 v2] omap3: pm: introduce opp accessor functions

2009-11-19 Thread Kevin Hilman
Nishanth Menon n...@ti.com writes:

 Menon, Nishanth had written, on 11/15/2009 08:54 AM, the following:
 [...]
 b) Improvements of the omap accessor functions, I will send out few of
 the proposals I can think of later when I get some free time.. we can
 discuss that too.
 Here is my initial proposal, do feel free to comment/add/modify etc:

Thanks for this.  Some comments on your proposal, and a proposed
header from me below.

 In the accessor functions listed here, I have followed:
 a) The function will return 0 if success else appropriate error
 values, all values are passed by pointer params.
 b) Overall, the idea is to transition from exposing omap_opp to users
 currently to a system where opp handling logic will be blackboxed from
 the rest of the system - giving us options to optimize and scale
 internal logic and storage mechanism without impacting the rest of the
 system.

completely agree here.

 c) resultant code should be readable - this is one of the issues I see
 with my previous implementation.

 Files: Introduce opp.c and opp.h

 A) Data Structures:
 Interim:
 opp.h
 struct omap_opp {
   bool enabled;
   unsigned long rate; /* in hz */
   u8 opp_id; /* int */
   u16 vsel; /* T2 voltage value */
 };
 typedef struct omap_opp omap_opp_def;

 Final, once resource34xx.c and all direct accesses are cleaned up:

 opp.h:
 struct omap_opp;

 /* initial definitions of OPP, will be used by all */
 struct omap_opp_def {
   bool enabled; /* true/false */
   unsigned long rate; /* in hz */
   u16 vsel; /* in millivolts */
 };

 opp.c:
 struct omap_opp {
   bool enabled;
   unsigned long rate;
   u16 vsel;
 };

 or what ever implementation it needs. can be array, list, hash
 implementation or what ever we choose it to be.

After SRF is gone, the header can simply have a 'struct omap_opp' and
the actual definition can be in opp.c

 B) Accessor functions to be used:

 B.1) These functions should be removed once SRF is replaced/cleaned up:

 int opp_id_to_freq(unsigned long *freq, const struct omap_opp *opps,
 u8 opp_id);
 int opp_freq_to_id(u8 *opp_id, const struct omap_opp *opps, unsigned
 long freq);

agreed, could flag these as  __deprecated to be clear they are going away,
or define them local to SRF.

 B.2) initialization functions:

 /* Register the OPP list for the silicon */
 int opp_register(struct omap_opp *opp_list,
const struct omap_opp_def *opp_reg);

ok, I was thinking opp_add(), but had the same idea.

Rather than having another omap_opp_def, could also add with just a
'u32 freq' and 'u32 voltage'.


 /* Enable a specific frequency */
 int opp_enable(struct omap_opp *opp_list,
   unsigned long freq, bool enable);

I was thinking opp_enable() would take a 'struct omap_opp' pointer
rather than a frequency, but same idea.


 Users:
 opp_register will be called by pm34xx.c based on silicon type.
 opp_enable will be called by board file/ has_feature based logic
 etc.. on a need basis

 B.3) verification functions:

 /* Check if we have a  frequency in the list(enabled/disabled)
  * this is needed by users who would like to enable a disabled
  * frequency
  */
 int opp_has_freq(struct omap_opp *opp_list, unsigned long freq);

 /* Check if we have a enabled frequency - this is what most users
  * will need
  */
 int opp_is_freq_valid(struct omap_opp *opp_list, unsigned long freq);

 Users:
   files who'd want to use opp_enable,
   validation paths.

 B.4) Limit functions:

 /* To get a number of frequencies enabled */
 int opp_get_freq_count(const struct omap_opp *opp_list, u8 *num);

ok

 /* Get highest enabled frequency */
 int opp_get_highest_freq(struct omap_opp *opp_list,
   unsigned long *freq);

 /* Get lowest enabled frequency */
 int opp_get_lowest_freq(struct omap_opp *opp_list, unsigned long *freq);

 Users:
   Obvious user is the current cpufreq

I assume you mean the CPUfreq table init.  For that, I'd prefer to use
a generic iterator for walking the list to initialize CPUfreq.

 B.5) Search functions - these will check only enabled
 frequencies. This will not check if the start freq provided in *freq
 is an enabled frequency or not. Assumption I am making is: if you are
 searching for a frequency that is disabled in the opp list, you are
 not trying something generic -hence wont support.

 /* Get higher enabled frequency than the provided one */
 int opp_get_higher_freq(struct omap_opp *opp_list, unsigned long *freq);

 /* Get lower enabled frequency than the provided one */
 int opp_get_lower_freq(struct omap_opp *opp_list, unsigned long *freq);

What about finding an exact match?

My proposal is to have a single 'find by freq' function with rounding
options, but whether there is one function w/options or 3 dedicated
functions, it doesn't matter to me.  

 Users:
   current srf, future scale logic

 B.6) voltage functions - opp layer will not trigger voltage
 transition, it is upto other users of 

linux-next: omap tree misaplied patch

2009-11-19 Thread Stephen Rothwell
Hi Tony,

I think commit 8552f084d80cfc191ea5affacbeffe44e8629496 (ARM OMAP3:
RX-51 board - add initialization of gpio keys) has been misapplied.  It
has this line:

+#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */

with the leading '+'.   I noticed this when merging with the input tree
as this made for a strange looking conflict.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgp5PVhymRpil.pgp
Description: PGP signature


Re: [PATCH 2/9 v2] omap3: pm: introduce opp accessor functions

2009-11-19 Thread Nishanth Menon

Kevin Hilman had written, on 11/19/2009 07:31 PM, the following:

Nishanth Menon n...@ti.com writes:


Menon, Nishanth had written, on 11/15/2009 08:54 AM, the following:
[...]

b) Improvements of the omap accessor functions, I will send out few of
the proposals I can think of later when I get some free time.. we can
discuss that too.

Here is my initial proposal, do feel free to comment/add/modify etc:


Thanks for this.  Some comments on your proposal, and a proposed
header from me below.
Thanks for a thorough review and the new ideas. I will do a proposal 
later tomorrow to aggregate and provide a common solution I hope. some 
views follow.





In the accessor functions listed here, I have followed:
a) The function will return 0 if success else appropriate error
values, all values are passed by pointer params.
b) Overall, the idea is to transition from exposing omap_opp to users
currently to a system where opp handling logic will be blackboxed from
the rest of the system - giving us options to optimize and scale
internal logic and storage mechanism without impacting the rest of the
system.


completely agree here.


c) resultant code should be readable - this is one of the issues I see
with my previous implementation.

Files: Introduce opp.c and opp.h

A) Data Structures:
Interim:
opp.h
struct omap_opp {
bool enabled;
unsigned long rate; /* in hz */
u8 opp_id; /* int */
u16 vsel; /* T2 voltage value */
};
typedef struct omap_opp omap_opp_def;

Final, once resource34xx.c and all direct accesses are cleaned up:

opp.h:
struct omap_opp;

/* initial definitions of OPP, will be used by all */
struct omap_opp_def {
bool enabled; /* true/false */
unsigned long rate; /* in hz */
u16 vsel; /* in millivolts */
};

opp.c:
struct omap_opp {
bool enabled;
unsigned long rate;
u16 vsel;
};

or what ever implementation it needs. can be array, list, hash
implementation or what ever we choose it to be.


After SRF is gone, the header can simply have a 'struct omap_opp' and
the actual definition can be in opp.c


The the functions will need the handle for it to know which opp table is 
referenced to. so we need the prototype in header, though the definition 
has to be in .c file





B) Accessor functions to be used:

B.1) These functions should be removed once SRF is replaced/cleaned up:

int opp_id_to_freq(unsigned long *freq, const struct omap_opp *opps,
u8 opp_id);
int opp_freq_to_id(u8 *opp_id, const struct omap_opp *opps, unsigned
long freq);


agreed, could flag these as  __deprecated to be clear they are going away,
or define them local to SRF.
Ack, was actually wondering if I can add __must_check instead to make it 
noisy as hell and trouble all of us into fixing it eventually.





B.2) initialization functions:

/* Register the OPP list for the silicon */
int opp_register(struct omap_opp *opp_list,
 const struct omap_opp_def *opp_reg);


ok, I was thinking opp_add(), but had the same idea.

Rather than having another omap_opp_def, could also add with just a
'u32 freq' and 'u32 voltage'.


The idea was ability to register an initial table with certain opps 
disabled. init code will be simpler that way.





/* Enable a specific frequency */
int opp_enable(struct omap_opp *opp_list,
unsigned long freq, bool enable);


I was thinking opp_enable() would take a 'struct omap_opp' pointer
rather than a frequency, but same idea.
as I point below, yep, that might actually be a improvement in 
performance doing that. I think I can generate another rule to my 
guiding principles: initializers, validators and search basics should 
use freq, rest should use omap_opp pointers.






Users:
opp_register will be called by pm34xx.c based on silicon type.
opp_enable will be called by board file/ has_feature based logic
etc.. on a need basis

B.3) verification functions:

/* Check if we have a  frequency in the list(enabled/disabled)
 * this is needed by users who would like to enable a disabled
 * frequency
 */
int opp_has_freq(struct omap_opp *opp_list, unsigned long freq);

/* Check if we have a enabled frequency - this is what most users
 * will need
 */
int opp_is_freq_valid(struct omap_opp *opp_list, unsigned long freq);

Users:
files who'd want to use opp_enable,
validation paths.

B.4) Limit functions:

/* To get a number of frequencies enabled */
int opp_get_freq_count(const struct omap_opp *opp_list, u8 *num);


ok


/* Get highest enabled frequency */
int opp_get_highest_freq(struct omap_opp *opp_list,
unsigned long *freq);

/* Get lowest enabled frequency */
int opp_get_lowest_freq(struct omap_opp *opp_list, unsigned long *freq);

Users:
Obvious user is the current cpufreq


I assume you mean the CPUfreq table init.  For that, I'd prefer to use
a generic iterator for walking the list to initialize CPUfreq.


you will still need a start point as cpufreq does not even know 

RE: [PATCH 7/8] Video driver of Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Hiremath, Vaibhav

 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Gregoire Gentil
 Sent: Thursday, November 19, 2009 10:48 PM
 To: linux-omap@vger.kernel.org
 Cc: Gregoire Gentil; Tony Lindgren; Tim Yamin
 Subject: [PATCH 7/8] Video driver of Always Innovating OMAP3-based
 Touch Book
 
 
 Signed-off-by: Gregoire Gentil grego...@gentil.com
 ---
  drivers/video/omap/lcd_omap3touchbook.c |  130
 +++
  1 files changed, 130 insertions(+), 0 deletions(-)
  create mode 100644 drivers/video/omap/lcd_omap3touchbook.c
 
 diff --git a/drivers/video/omap/lcd_omap3touchbook.c
 b/drivers/video/omap/lcd_omap3touchbook.c
 new file mode 100644
 index 000..5b58703
 --- /dev/null
 +++ b/drivers/video/omap/lcd_omap3touchbook.c
 @@ -0,0 +1,130 @@
 +/*
 + * LCD panel support for the Touch Book
 + *
 + * Author: Gregoire Gentil grego...@gentil.com
 + *
 + * Derived from drivers/video/omap/lcd-omap3beagle.c
 + *
 + * 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/platform_device.h
 +#include linux/gpio.h
 +#include linux/i2c/twl4030.h
 +
 +#include plat/mux.h
 +#include plat/omapfb.h
 +#include asm/mach-types.h
 +
 +#define LCD_PANEL_ENABLE_GPIO   176
 +
 +static int omap3beagle_panel_init(struct lcd_panel *panel,
 + struct omapfb_device *fbdev)
 +{
 + gpio_request(LCD_PANEL_ENABLE_GPIO, LCD enable);
 + return 0;
 +}
 +
 +static void omap3beagle_panel_cleanup(struct lcd_panel *panel)
 +{
 + gpio_free(LCD_PANEL_ENABLE_GPIO);
 +}
 +
 +static int omap3beagle_panel_enable(struct lcd_panel *panel)
 +{
 + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
 + return 0;
 +}
 +
 +static void omap3beagle_panel_disable(struct lcd_panel *panel)
 +{
 + gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
 +}
 +
 +static unsigned long omap3beagle_panel_get_caps(struct lcd_panel
 *panel)
 +{
 + return 0;
 +}
 +
 +struct lcd_panel omap3beagle_panel = {
 + .name   = omap3beagle,
 + .config = OMAP_LCDC_PANEL_TFT,
 +
 + .bpp= 16,
 + .data_lines = 24,
 + .x_res  = 1024,
 + .y_res  = 600,
 + .hsw= 3,
 + .hfp= 3,
 + .hbp= 39,
 + .vsw= 1,
 + .vfp= 2,
 + .vbp= 7,
 +
 + .pixel_clock= 64000,
 +
 + .init   = omap3touchbook_panel_init,
 + .cleanup= omap3touchbook_panel_cleanup,
 + .enable = omap3touchbook_panel_enable,
 + .disable= omap3touchbook_panel_disable,
 + .get_caps   = omap3touchbook_panel_get_caps,
[Hiremath, Vaibhav] Have you compiled this file? Here all references are for 
omap3touchbook_xxx and the function definitions are defined as omap3beagle_xxx.

And again I don't see any change except GPIO pin and LCD height from beagle 
here, can we try to reuse the driver.

Thanks,
Vaibhav

 +};
 +
 +static int omap3touchbook_panel_probe(struct platform_device *pdev)
 +{
 + omapfb_register_panel(omap3beagle_panel);
 + return 0;
 +}
 +
 +static int omap3touchbook_panel_remove(struct platform_device
 *pdev)
 +{
 + return 0;
 +}
 +
 +static int omap3touchbook_panel_suspend(struct platform_device
 *pdev,
 +pm_message_t mesg)
 +{
 + return 0;
 +}
 +
 +static int omap3touchbook_panel_resume(struct platform_device
 *pdev)
 +{
 + return 0;
 +}
 +
 +struct platform_driver omap3touchbook_panel_driver = {
 + .probe  = omap3touchbook_panel_probe,
 + .remove = omap3touchbook_panel_remove,
 + .suspend= omap3touchbook_panel_suspend,
 + .resume = omap3touchbook_panel_resume,
 + .driver = {
 + .name   = omap3touchbook_lcd,
 + .owner  = THIS_MODULE,
 + },
 +};
 +
 +static int __init omap3touchbook_panel_drv_init(void)
 +{
 + return platform_driver_register(omap3beagle_panel_driver);
 +}
 +
 +static void __exit omap3touchbook_panel_drv_exit(void)
 +{
 + platform_driver_unregister(omap3touchbook_panel_driver);
 +}
 +
 +module_init(omap3touchbook_panel_drv_init);
 +module_exit(omap3touchbook_panel_drv_exit);
 --
 1.6.0.4
 
 --
 To 

RE: [PATCH 2/8] Board file of Always Innovating OMAP3-based Touch Book

2009-11-19 Thread Hiremath, Vaibhav

 -Original Message-
 From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
 ow...@vger.kernel.org] On Behalf Of Gregoire Gentil
 Sent: Thursday, November 19, 2009 10:48 PM
 To: linux-omap@vger.kernel.org
 Cc: Gregoire Gentil; Tony Lindgren; Tim Yamin
 Subject: [PATCH 2/8] Board file of Always Innovating OMAP3-based
 Touch Book


 Signed-off-by: Gregoire Gentil grego...@gentil.com
 ---
  arch/arm/mach-omap2/board-omap3touchbook.c |  683
 
  1 files changed, 683 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c

 diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c
 b/arch/arm/mach-omap2/board-omap3touchbook.c
 new file mode 100644
 index 000..ad3ef6e
 --- /dev/null
 +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
 @@ -0,0 +1,683 @@
 +/*
 + * linux/arch/arm/mach-omap2/board-omap3touchbook.c
 + *
 + * Copyright (C) 2009 Always Innovating
 + *
 + * Modified from mach-omap2/board-omap3beagleboard.c
 + *
 + * Initial code: Grégoire Gentil, Tim Yamin
 + *
 + * This program is free software; you can redistribute it and/or
 modify
 + * it under the terms of the GNU General Public License version 2
 as
 + * published by the Free Software Foundation.
 + */
 +
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/platform_device.h
 +#include linux/delay.h
 +#include linux/err.h
 +#include linux/clk.h
 +#include linux/io.h
 +#include linux/leds.h
 +#include linux/gpio.h
 +#include linux/input.h
 +#include linux/gpio_keys.h
 +
 +#include linux/mtd/mtd.h
 +#include linux/mtd/partitions.h
 +#include linux/mtd/nand.h
 +
 +#include plat/mcspi.h
 +#include linux/spi/spi.h
 +
 +#include linux/spi/ads7846.h
 +#include linux/mma7455l.h
 +
 +#include plat/dmtimer.h
 +#include linux/backlight.h
 +
 +#include linux/regulator/machine.h
 +#include linux/i2c/twl4030.h
 +
 +#include mach/hardware.h
 +#include asm/mach-types.h
 +#include asm/mach/arch.h
 +#include asm/mach/map.h
 +#include asm/mach/flash.h
 +
 +#include plat/board.h
 +#include plat/common.h
 +#include plat/gpmc.h
 +#include plat/nand.h
 +#include plat/mux.h
 +#include plat/usb.h
 +#include plat/timer-gp.h
 +
 +#include mmc-twl4030.h
 +
 +#include asm/setup.h
 +
 +#define GPMC_CS0_BASE  0x60
 +#define GPMC_CS_SIZE   0x30
 +
 +#define NAND_BLOCK_SIZE  SZ_128K
 +
 +#define OMAP3_AC_GPIO136
 +#define OMAP3_TS_GPIO162
 +#define TB_BL_PWM_TIMER  9
 +#define TB_KILL_POWER_GPIO   168
 +
 +unsigned long touchbook_revision;
 +
 +static struct mtd_partition omap3touchbook_nand_partitions[] = {
 + /* All the partition sizes are listed in terms of NAND block
 size */
 + {
 + .name   = X-Loader,
 + .offset = 0,
 + .size   = 4 * NAND_BLOCK_SIZE,
 + .mask_flags = MTD_WRITEABLE,/* force read-only */
 + },
 + {
 + .name   = U-Boot,
 + .offset = MTDPART_OFS_APPEND,   /* Offset =
 0x8 */
 + .size   = 15 * NAND_BLOCK_SIZE,
 + .mask_flags = MTD_WRITEABLE,/* force read-only */
 + },
 + {
 + .name   = U-Boot Env,
 + .offset = MTDPART_OFS_APPEND,   /* Offset =
 0x26 */
 + .size   = 1 * NAND_BLOCK_SIZE,
 + },
 + {
 + .name   = Kernel,
 + .offset = MTDPART_OFS_APPEND,   /* Offset =
 0x28 */
 + .size   = 32 * NAND_BLOCK_SIZE,
 + },
 + {
 + .name   = File System,
 + .offset = MTDPART_OFS_APPEND,   /* Offset =
 0x68 */
 + .size   = MTDPART_SIZ_FULL,
 + },
 +};
 +
 +static struct omap_nand_platform_data omap3touchbook_nand_data = {
 + .options= NAND_BUSWIDTH_16,
 + .parts  = omap3touchbook_nand_partitions,
 + .nr_parts   = ARRAY_SIZE(omap3touchbook_nand_partitions),
 + .dma_channel= -1,   /* disable DMA in OMAP NAND
 driver */
 + .nand_setup = NULL,
 + .dev_ready  = NULL,
 +};
 +
 +static struct resource omap3touchbook_nand_resource = {
 + .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct platform_device omap3touchbook_nand_device = {
 + .name   = omap2-nand,
 + .id = -1,
 + .dev= {
 + .platform_data  = omap3touchbook_nand_data,
 + },
 + .num_resources  = 1,
 + .resource   = omap3touchbook_nand_resource,
 +};
 +
 +#include sdram-micron-mt46h32m32lf-6.h
 +
 +static struct twl4030_hsmmc_info mmc[] = {
 + {
 + .mmc= 1,
 + .wires  = 8,
 + .gpio_wp= 29,
 + },
 + {}  /* Terminator */
 +};
 +
 +static struct platform_device omap3_touchbook_lcd_device = {
 + .name   = omap3touchbook_lcd,
 + .id 

Re: [alsa-devel] [PATCH 1/2] OMAP3: MCBSP: Suspend/resume failure fix

2009-11-19 Thread Peter Ujfalusi
On Thursday 19 November 2009 21:48:26 ext Anuj Aggarwal wrote:
 [Anuj] Yes, w/o audio, it goes into suspend neatly.
 After going through the entire patch series [PATCHv5 00/20] OMAP
 ASoC changes in DMA utilization, which I missed earlier, I found that the
 sysfs entry dma_op_mode can be toggled among element/frame/threshold,
 by default which is element hence not allowing the mcbsp driver to go into
 idle state. I changed that at run time and after that I am able to hit
 the suspend
 state while playing back audio (at least the log doesn't
 show that the system is not able to hit suspend).
 My question is: is sysfs the only way to choose threshold or can it be made
  as default? I could not see that happening in the code so thinking of the
  possible reason of choosing not to do so. Because the user who wants to
  hit suspend will not like to issue driver specific commands. Any specific
  reason of not doing that by default?

It is not selected as default on OMAP3, since it is a new feature, and we don't 
want to change the behavior of the audio. If the reports are positive regarding 
to the threshold mode, than we can make it as default on OMAP3, at least that 
is 
the plan AFAIK. 
In some cases the element mode is desirable over the threshold mode, and 
probably there are additional modes can be implemented for other cases, hence 
the sysfs interface is really useful feature.

Back than there were quite a bit of discussion here about the threshold mode: 
in 
the original series the threshold mode was the default, but we decided to not 
to 
do that before others have the chance to test it. We have been using the 
threshold mode without issues internally, so it should be really stable, but it 
is still a new mode, which can break other implementations.

So please test the threshold mode in your HW, and report if it is working there 
OK, if we have enough positive feedbacks, than we can make it as default.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html