Re: [PATCH 5/5] omap: Allow testing for omap type with omap_has_feature

2010-07-09 Thread Tony Lindgren
* Nishanth Menon n...@ti.com [100708 22:31]:
 
 I think this 'lazy reviewability'  comes at the cost of very
 abstraction  the features framework is intended to provide, not to
 mention the question of correct selection (is this a OMAP4 specific
 feature or is OMAP5 expected to have it ?). and upgradation.
 
 As mentioned before, the surrounding context of the use of
 omap_has_feature() will provide enough clues about the cpu specific
 nature of a feature, if at all needed.

 Does it really? when a new feature is added, dont we want to know if
 it is generic feature or a omap specific feature? where is the flag?

Yeah I don't know what we should do with these defines.. Kind of just
threw the patch out there.

If we already have omap specific omap_has_feature functions, we don't
need cpu_is_omap in most cases.

I suggest we only use the generic defines now, then look at it again
when we run out of the bits to define.

Regards,

Tony
--
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/5] omap: Implement common omap_has_feature

2010-07-09 Thread Tony Lindgren
* Nishanth Menon n...@ti.com [100708 17:46]:
 Tony Lindgren had written, on 07/08/2010 04:37 AM, the following:
 
 @@ -112,6 +114,12 @@ void omap_get_die_id(struct omap_die_id *odi)
  odi-id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
  }
 +u32 omap2_has_feature(u32 feat_mask)
 +{
 +/* REVISIT: Add necessary omap2 feature tests here */
 +return ((feat_mask  omap_features) == feat_mask);
 +}
 +

 I did consider this path initially,
 a) Additional functional call overhead here. some of the calls to
 has_feature() will get called through pretty active paths, we would
 like it to be minimized to compile time optimized inline function as
 much as possible.(no reason why this cant me a inline macro in
 cpu.h?) -

Well it should not matter how slow this code is, it should only be
used to initialize things during __init.

Any code doing detection after initialization is wrong.

Regards,

Tony
--
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] omap: rx51: Platform support for tsl2563 ALS

2010-07-09 Thread Tony Lindgren
* Mathias Nyman mathias.ny...@nokia.com [100708 16:59]:
 From: Mathias Nyman mathias.ny...@nokia.com
 
 This will enable usage of tsl2563 ambient light sensor on Nokia N900.
 
 Signed-off-by: Ameya Palande ameya.pala...@nokia.com

Is this your patch or Ameya's patch originally?

Looks like your Signed-off-by is missing..

Tony


 ---
  arch/arm/mach-omap2/board-rx51-peripherals.c |   14 ++
  1 files changed, 14 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
 b/arch/arm/mach-omap2/board-rx51-peripherals.c
 index 3c3f975..a3a396c 100644
 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
 +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
 @@ -35,6 +35,8 @@
  #include sound/tlv320aic3x.h
  #include sound/tpa6130a2-plat.h
  
 +#include ../drivers/staging/iio/light/tsl2563.h
 +
  #include mux.h
  #include hsmmc.h
  
 @@ -53,6 +55,12 @@ enum {
  
  static struct wl12xx_platform_data wl1251_pdata;
  
 +#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
 +static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
 + .cover_comp_gain = 16,
 +};
 +#endif
 +
  static struct omap2_mcspi_device_config wl1251_mcspi_config = {
   .turbo_mode = 0,
   .single_channel = 1,
 @@ -714,6 +722,12 @@ static struct i2c_board_info __initdata 
 rx51_peripherals_i2c_board_info_2[] = {
   I2C_BOARD_INFO(tlv320aic3x, 0x18),
   .platform_data = rx51_aic3x_data,
   },
 +#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
 + {
 + I2C_BOARD_INFO(tsl2563, 0x29),
 + .platform_data = rx51_tsl2563_platform_data,
 + },
 +#endif
   {
   I2C_BOARD_INFO(tpa6130a2, 0x60),
   .platform_data = rx51_tpa6130a2_data,
 -- 
 1.7.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
--
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 0/3] omap3 nand: cleanup exiting platform related code

2010-07-09 Thread Sukumar Ghorai
   The following set of patches applies on top of for-next branch.
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git
   Patches verified on: omap3430-SDP, omap3630-sdp, zoom3 and beagle board

   And these are the patches required to address the following input -
 1. The NAND driver needs to stop tinkering with the GPMC registers
The omap General Purpose Memory Controller (GPMC) registers are omap
specific, and not driver specific. Tinkering with these registers can
cause issues with the other devices on the GPMC.

 2. Passing hardcoded GPMC_CS0_BASE needs to go from the board files
Passing hardcoded GPMC virtual addressess is sure way to mess up things.
This should all become unnecessary once the NAND drivers stops messing
with the GPMC registers directly.
 Discussion: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg27630.html

   Changes in this series -
gpmc_hwcontrol() function in gpmc.c, break into various small function.

  Unused function removed.
  v5: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html

  Functions related to ecc and prefetch engine are optimized.
  v4: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg29458.html

  Few functionality was missing  like - There should be some locking as only
   one chipselect can use the ECC or prefetch engine at a time. If you have
   NAND in two chipselects, bad things would happen.
  v3: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28715.html

  Additionally, it was needed to implement more functions for the platform
  init code to use.
  v2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28467.html

  v1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28164.html


Sukumar Ghorai (3):
omap3 gpmc: functionality enhancement
omap3 nand: cleanup virtual address usages
omap3 nand: fix issue in board file to detect nand
 arch/arm/mach-omap2/board-cm-t35.c |   20 +--
 arch/arm/mach-omap2/board-devkit8000.c |   25 +---
 arch/arm/mach-omap2/board-omap3beagle.c|   24 +---
 arch/arm/mach-omap2/board-omap3touchbook.c |   25 +---
 arch/arm/mach-omap2/board-overo.c  |   24 +---
 arch/arm/mach-omap2/board-sdp-flash.c  |5 -
 arch/arm/mach-omap2/gpmc-nand.c|   38 +---
 arch/arm/mach-omap2/gpmc.c |  285 ++--
 arch/arm/plat-omap/include/plat/gpmc.h |   42 -
 arch/arm/plat-omap/include/plat/nand.h |6 +-
 drivers/mtd/nand/omap2.c   |  218 ++
 11 files changed, 371 insertions(+), 341 deletions(-)
--
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 3/3] omap3 nand: fix issue in board file to detect nand

2010-07-09 Thread Sukumar Ghorai
Board file modified for not to provide gpmc phys_base address to nand driver.
The gpmc_nand_init funciton is now used to detect the nand and required to
adopt _prob function as in nand/omap2.c

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/board-cm-t35.c |   20 +---
 arch/arm/mach-omap2/board-devkit8000.c |   25 +
 arch/arm/mach-omap2/board-omap3beagle.c|   24 +---
 arch/arm/mach-omap2/board-omap3touchbook.c |   25 +
 arch/arm/mach-omap2/board-overo.c  |   24 +---
 arch/arm/mach-omap2/board-sdp-flash.c  |5 -
 6 files changed, 5 insertions(+), 118 deletions(-)

diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 79d6b15..9aa2b89 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -61,8 +61,6 @@
 #define SB_T35_SMSC911X_GPIO   65
 
 #define NAND_BLOCK_SIZESZ_128K
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS0_BASE_ADDR (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE)
 
 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
 #include linux/smsc911x.h
@@ -223,28 +221,12 @@ static struct omap_nand_platform_data cm_t35_nand_data = {
.nr_parts   = ARRAY_SIZE(cm_t35_nand_partitions),
.dma_channel= -1,   /* disable DMA in OMAP NAND driver */
.cs = 0,
-   .gpmc_cs_baseaddr   = (void __iomem *)GPMC_CS0_BASE_ADDR,
-   .gpmc_baseaddr  = (void __iomem *)OMAP34XX_GPMC_VIRT,
 
 };
 
-static struct resource cm_t35_nand_resource = {
-   .flags  = IORESOURCE_MEM,
-};
-
-static struct platform_device cm_t35_nand_device = {
-   .name   = omap2-nand,
-   .id = -1,
-   .num_resources  = 1,
-   .resource   = cm_t35_nand_resource,
-   .dev= {
-   .platform_data  = cm_t35_nand_data,
-   },
-};
-
 static void __init cm_t35_init_nand(void)
 {
-   if (platform_device_register(cm_t35_nand_device)  0)
+   if (gpmc_nand_init(cm_t35_nand_data)  0)
pr_err(CM-T35: Unable to register NAND device\n);
 }
 #else
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 4b7103a..a1d8764 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -59,9 +59,6 @@
 #include mux.h
 #include hsmmc.h
 
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS_SIZE   0x30
-
 #define NAND_BLOCK_SIZESZ_128K
 
 #define OMAP_DM9000_GPIO_IRQ   25
@@ -105,20 +102,6 @@ static struct omap_nand_platform_data devkit8000_nand_data 
= {
.dma_channel= -1,   /* disable DMA in OMAP NAND driver */
 };
 
-static struct resource devkit8000_nand_resource = {
-   .flags  = IORESOURCE_MEM,
-};
-
-static struct platform_device devkit8000_nand_device = {
-   .name   = omap2-nand,
-   .id = -1,
-   .dev= {
-   .platform_data  = devkit8000_nand_data,
-   },
-   .num_resources  = 1,
-   .resource   = devkit8000_nand_resource,
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 1,
@@ -591,8 +574,6 @@ static void __init devkit8000_flash_init(void)
u8 cs = 0;
u8 nandcs = GPMC_CS_NUM + 1;
 
-   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
-
/* find out the chip-select on which NAND exists */
while (cs  GPMC_CS_NUM) {
u32 ret = 0;
@@ -614,13 +595,9 @@ static void __init devkit8000_flash_init(void)
 
if (nandcs  GPMC_CS_NUM) {
devkit8000_nand_data.cs = nandcs;
-   devkit8000_nand_data.gpmc_cs_baseaddr = (void *)
-   (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
-   devkit8000_nand_data.gpmc_baseaddr = (void *)
-   (gpmc_base_add);
 
printk(KERN_INFO Registering NAND on CS%d\n, nandcs);
-   if (platform_device_register(devkit8000_nand_device)  0)
+   if (gpmc_nand_init(devkit8000_nand_data)  0)
printk(KERN_ERR Unable to register NAND device\n);
}
 }
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 64aa557..66177cb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -48,9 +48,6 @@
 #include mux.h
 #include hsmmc.h
 
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS_SIZE   0x30
-
 #define NAND_BLOCK_SIZESZ_128K
 
 static struct mtd_partition omap3beagle_nand_partitions[] = {
@@ -93,20 +90,6 @@ static struct omap_nand_platform_data omap3beagle_nand_data 
= {
.dev_ready  = NULL,
 };
 
-static struct resource omap3beagle_nand_resource = {
-   .flags  = 

[PATCH v6 2/3] omap3 nand: cleanup virtual address usages

2010-07-09 Thread Sukumar Ghorai
This patch removes direct reference of gpmc address from generic nand platform 
code.
Nand platform code now uses wrapper functions which are implemented in gpmc 
module. 

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/gpmc-nand.c|   38 ++
 arch/arm/mach-omap2/gpmc.c |9 --
 arch/arm/plat-omap/include/plat/gpmc.h |5 -
 arch/arm/plat-omap/include/plat/nand.h |6 +-
 drivers/mtd/nand/omap2.c   |  214 
 5 files changed, 65 insertions(+), 207 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index e57fb29..53bacb5 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -19,8 +19,6 @@
 #include plat/board.h
 #include plat/gpmc.h
 
-#define WR_RD_PIN_MONITORING   0x0060
-
 static struct omap_nand_platform_data *gpmc_nand_data;
 
 static struct resource gpmc_nand_resource = {
@@ -71,10 +69,10 @@ static int omap2_nand_gpmc_retime(void)
t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-wr_cycle);
 
/* Configure GPMC */
-   gpmc_cs_write_reg(gpmc_nand_data-cs, GPMC_CS_CONFIG1,
-   GPMC_CONFIG1_DEVICESIZE(gpmc_nand_data-devsize) |
-   GPMC_CONFIG1_DEVICETYPE_NAND);
-
+   gpmc_cs_configure(gpmc_nand_data-cs,
+   GPMC_CONFIG_DEV_SIZE, gpmc_nand_data-devsize);
+   gpmc_cs_configure(gpmc_nand_data-cs,
+   GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
err = gpmc_cs_set_timings(gpmc_nand_data-cs, t);
if (err)
return err;
@@ -82,27 +80,13 @@ static int omap2_nand_gpmc_retime(void)
return 0;
 }
 
-static int gpmc_nand_setup(void)
-{
-   struct device *dev = gpmc_nand_device.dev;
-
-   /* Set timings in GPMC */
-   if (omap2_nand_gpmc_retime()  0) {
-   dev_err(dev, Unable to set gpmc timings\n);
-   return -EINVAL;
-   }
-
-   return 0;
-}
-
 int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data)
 {
-   unsigned int val;
int err = 0;
struct device *dev = gpmc_nand_device.dev;
 
gpmc_nand_data = _nand_data;
-   gpmc_nand_data-nand_setup = gpmc_nand_setup;
+   gpmc_nand_data-nand_setup = omap2_nand_gpmc_retime;
gpmc_nand_device.dev.platform_data = gpmc_nand_data;
 
err = gpmc_cs_request(gpmc_nand_data-cs, NAND_IO_SIZE,
@@ -112,19 +96,16 @@ int __init gpmc_nand_init(struct omap_nand_platform_data 
*_nand_data)
return err;
}
 
-   err = gpmc_nand_setup();
+/* Set timings in GPMC */
+   err = omap2_nand_gpmc_retime();
if (err  0) {
-   dev_err(dev, NAND platform setup failed: %d\n, err);
+   dev_err(dev, Unable to set gpmc timings: %d\n, err);
return err;
}
 
/* Enable RD PIN Monitoring Reg */
if (gpmc_nand_data-dev_ready) {
-   val  = gpmc_cs_read_reg(gpmc_nand_data-cs,
-GPMC_CS_CONFIG1);
-   val |= WR_RD_PIN_MONITORING;
-   gpmc_cs_write_reg(gpmc_nand_data-cs,
-   GPMC_CS_CONFIG1, val);
+   gpmc_cs_configure(gpmc_nand_data-cs, GPMC_CONFIG_RDY_BSY, 1);
}
 
err = platform_device_register(gpmc_nand_device);
@@ -140,3 +121,4 @@ out_free_cs:
 
return err;
 }
+
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index d50cf01..ff6709c 100755
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -641,15 +641,6 @@ int gpmc_prefetch_reset(int cs)
 }
 EXPORT_SYMBOL(gpmc_prefetch_reset);
 
-/**
- * gpmc_prefetch_status - reads prefetch status of engine
- */
-int  gpmc_prefetch_status(void)
-{
-   return gpmc_read_reg(GPMC_PREFETCH_STATUS);
-}
-EXPORT_SYMBOL(gpmc_prefetch_status);
-
 static void __init gpmc_mem_init(void)
 {
int cs;
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h 
b/arch/arm/plat-omap/include/plat/gpmc.h
index 561c64f..9fd99b9 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -25,9 +25,6 @@
 #define GPMC_CS_NAND_ADDRESS   0x20
 #define GPMC_CS_NAND_DATA  0x24
 
-#define GPMC_CONFIG0x50
-#define GPMC_STATUS0x54
-
 /* Control Commands */
 #define GPMC_CONFIG_RDY_BSY0x0001
 #define GPMC_CONFIG_DEV_SIZE   0x0002
@@ -66,7 +63,6 @@
 #define GPMC_CONFIG1_DEVICESIZE_16  GPMC_CONFIG1_DEVICESIZE(1)
 #define GPMC_CONFIG1_DEVICETYPE(val)((val  3)  10)
 #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
-#define GPMC_CONFIG1_DEVICETYPE_NANDGPMC_CONFIG1_DEVICETYPE(2)
 #define GPMC_CONFIG1_MUXADDDATA (1  9)
 #define GPMC_CONFIG1_TIME_PARA_GRAN (1  4)
 #define GPMC_CONFIG1_FCLK_DIV(val)  (val  3)
@@ -136,7 +132,6 @@ extern int 

[PATCH v6 1/3] omap3 gpmc: functionality enhancement

2010-07-09 Thread Sukumar Ghorai
few functions added in gpmc module and to be used by other drivers like NAND.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/gpmc.c |  276 ++--
 arch/arm/plat-omap/include/plat/gpmc.h |   39 -
 drivers/mtd/nand/omap2.c   |4 +-
 3 files changed, 302 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 5bc3ca0..3fef085 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -46,8 +46,9 @@
 #define GPMC_ECC_CONFIG0x1f4
 #define GPMC_ECC_CONTROL   0x1f8
 #define GPMC_ECC_SIZE_CONFIG   0x1fc
+#define GPMC_ECC1_RESULT0x200
 
-#define GPMC_CS0   0x60
+#define GPMC_CS0_OFFSET0x60
 #define GPMC_CS_SIZE   0x30
 
 #define GPMC_MEM_START 0x
@@ -92,7 +93,8 @@ struct omap3_gpmc_regs {
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
-static unsignedgpmc_cs_map;
+static unsigned int gpmc_cs_map;   /* flag for cs which are initialized */
+static int gpmc_ecc_used = -EINVAL;/* cs using ecc engine */
 
 static void __iomem *gpmc_base;
 
@@ -108,11 +110,27 @@ static u32 gpmc_read_reg(int idx)
return __raw_readl(gpmc_base + idx);
 }
 
+static void gpmc_cs_write_byte(int cs, int idx, u8 val)
+{
+   void __iomem *reg_addr;
+
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
+   __raw_writeb(val, reg_addr);
+}
+
+static u8 gpmc_cs_read_byte(int cs, int idx)
+{
+   void __iomem *reg_addr;
+
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
+   return __raw_readb(reg_addr);
+}
+
 void gpmc_cs_write_reg(int cs, int idx, u32 val)
 {
void __iomem *reg_addr;
 
-   reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
__raw_writel(val, reg_addr);
 }
 
@@ -120,7 +138,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
 {
void __iomem *reg_addr;
 
-   reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
return __raw_readl(reg_addr);
 }
 
@@ -419,8 +437,157 @@ void gpmc_cs_free(int cs)
 EXPORT_SYMBOL(gpmc_cs_free);
 
 /**
+ * gpmc_read_status - read access request to get the different gpmc status
+ * @cmd: command type
+ * @return status
+ */
+int gpmc_read_status(int cmd)
+{
+   int status = -EINVAL;
+   u32 regval = 0;
+
+   switch (cmd) {
+   case GPMC_GET_IRQ_STATUS:
+   status = gpmc_read_reg(GPMC_IRQSTATUS);
+   break;
+
+   case GPMC_PREFETCH_FIFO_CNT:
+   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
+   status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval);
+   break;
+
+   case GPMC_PREFETCH_COUNT:
+   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
+   status = GPMC_PREFETCH_STATUS_COUNT(regval);
+   break;
+
+   case GPMC_STATUS_BUFFER:
+   regval = gpmc_read_reg(GPMC_STATUS);
+   /* 1 : buffer is available to write */
+   status = regval  GPMC_STATUS_BUFF_EMPTY;
+   break;
+
+   default:
+   printk(KERN_ERR gpmc_read_status: Not supported\n);
+   }
+   return status;
+}
+EXPORT_SYMBOL(gpmc_read_status);
+
+/**
+ * gpmc_cs_configure - write request to configure gpmc
+ * @cs: chip select number
+ * @cmd: command type
+ * @wval: value to write
+ * @return status of the operation
+ */
+int gpmc_cs_configure(int cs, int cmd, int wval)
+{
+   int err = 0;
+   u32 regval = 0;
+
+   switch (cmd) {
+   case GPMC_SET_IRQ_STATUS:
+   gpmc_write_reg(GPMC_IRQSTATUS, wval);
+   break;
+
+   case GPMC_CONFIG_WP:
+   regval = gpmc_read_reg(GPMC_CONFIG);
+   if (wval)
+   regval = ~GPMC_CONFIG_WRITEPROTECT; /* WP is ON */
+   else
+   regval |= GPMC_CONFIG_WRITEPROTECT;  /* WP is OFF */
+   gpmc_write_reg(GPMC_CONFIG, regval);
+   break;
+
+   case GPMC_CONFIG_RDY_BSY:
+   regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+   if (wval)
+   regval |= WR_RD_PIN_MONITORING;
+   else
+   regval = ~WR_RD_PIN_MONITORING;
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
+   break;
+
+   case GPMC_CONFIG_DEV_SIZE:
+   regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+   regval |= GPMC_CONFIG1_DEVICESIZE(wval);
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
+   break;
+
+   case GPMC_CONFIG_DEV_TYPE:
+   regval  = gpmc_cs_read_reg(cs, 

Re: Tony mostly offline for the rest of July

2010-07-09 Thread Tony Lindgren
* Gadiyar, Anand gadi...@ti.com [100708 20:31]:
 Tony Lindgren wrote:
  Hi all,
  
  FYI, I'll be mostly offline after Friday for several weeks.
  
  I'll post few more patchsets for review, but will not be merging
  any other omap code after that for the upcoming merge window.
  
  Cheers,
  
  Tony
 
 Tony,
 
 The 3630 ES1.1 ID code patch is pending in patchworks for a while [1].
 
 I missed pinging you on this earlier. It would be nice to queue this
 up for the merge window as well.

OK, that's good to have.
 
 
 https://patchwork.kernel.org/patch/95684/
 
 
 Also, we now have ES1.2 silicon as well; should I submit an updated
 patch now, or just a delta patch later?

Please reply to this thread with your updated patch.

Also, we should not drop the default handling for unknown hawkeye
registers.

Regards,

Tony
--
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] OMAP2: powerdomain: Add break in switch statement

2010-07-09 Thread Thomas Weber
Add a missing break at end of switch statement. At the moment it is a
fall through to WARN_ON(1) and return -EEXIST.

Signed-off-by: Thomas Weber we...@corscience.de
---
 arch/arm/mach-omap2/powerdomain.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c 
b/arch/arm/mach-omap2/powerdomain.c
index a2904aa..6527ec3 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -875,6 +875,7 @@ int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
break;
case 4:
m = OMAP_MEM4_RETSTATE_MASK;
+   break;
default:
WARN_ON(1); /* should never happen */
return -EEXIST;
-- 
1.7.1

--
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] omap: rx51: Platform support for tsl2563 ALS

2010-07-09 Thread Mathias Nyman
From: Mathias Nyman mathias.ny...@nokia.com

This will enable usage of tsl2563 ambient light sensor on Nokia N900.


Signed-off-by: Ameya Palande ameya.pala...@nokia.com
Signed-off-by: Mathias Nyman mathias.ny...@nokia.com
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 3c3f975..a3a396c 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -35,6 +35,8 @@
 #include sound/tlv320aic3x.h
 #include sound/tpa6130a2-plat.h
 
+#include ../drivers/staging/iio/light/tsl2563.h
+
 #include mux.h
 #include hsmmc.h
 
@@ -53,6 +55,12 @@ enum {
 
 static struct wl12xx_platform_data wl1251_pdata;
 
+#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
+static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
+   .cover_comp_gain = 16,
+};
+#endif
+
 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
@@ -714,6 +722,12 @@ static struct i2c_board_info __initdata 
rx51_peripherals_i2c_board_info_2[] = {
I2C_BOARD_INFO(tlv320aic3x, 0x18),
.platform_data = rx51_aic3x_data,
},
+#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
+   {
+   I2C_BOARD_INFO(tsl2563, 0x29),
+   .platform_data = rx51_tsl2563_platform_data,
+   },
+#endif
{
I2C_BOARD_INFO(tpa6130a2, 0x60),
.platform_data = rx51_tpa6130a2_data,
-- 
1.7.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 11/15] wireless: wl1271: introduce platform device support

2010-07-09 Thread Roger Quadros

Hi Ohad,

On 07/08/2010 11:10 PM, ext Ohad Ben-Cohen wrote:

Hi Nicolas and Roger,

On Tue, Jul 6, 2010 at 8:42 PM, Nicolas Pitren...@fluxnic.net  wrote:

On Tue, 6 Jul 2010, Roger Quadros wrote:

If the Power enable GPIO can be treated as SDIO slot supply (i.e. vmmc), then
the SDIO/MMC core should tackle it, just like it deals with supply for slots
with removable cards.



...

Another function pair would be needed instead, which would do almost
like the suspend/resume code is already doing.  Something like:


Thanks a lot for your review and comments, and for taking the time to
present your approach.


you're welcome :)


I like it !

It'd allow us to lose the software (or fake if you want ;) card detect
mechanism, which is something that should have been added to each
platform we wanted to support.

We would only need to make it possible to deliver board-specific data
to the function driver (e.g., in the case of the wl1271, we need irq
and board_ref_clock data).  That would require some board-level
platform-data configuration, which will be specific to the controller
to which the device is hardwired to. This data should propagate
through the host controller to the SDIO core so it would eventually be


why should platform data go through the host controller? You are already 
creating a new platform device for wl1271_sdio just to pass platform_data so the 
platform data for that can be passed directly from board files to this platform 
device. It doesn't need to go via host controller.


I think this case is specific to wl1271. Ideally wl1271 should have used the 
SDIO's in-band interrupt delivery mechanism and SDIO Configuration space to 
provide this information to make it truly plug n play.


br,
-roger
--
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/2] musb: Kill board specific pinmux from driver file

2010-07-09 Thread Tony Lindgren
* Ajay Kumar Gupta ajay.gu...@ti.com [100708 13:59]:
 From: Anand Gadiyar gadi...@ti.com
 
 This pin-muxing is best done in the board files. The driver should
 not do this explicitly.
 
 Also, this code causes a warning to be thrown when OMAP2430 and OMAP3/4
 support are enabled in the same kernel.
 
 Signed-off-by: Anand Gadiyar gadi...@ti.com
 Acked-by: Felipe Balbi felipe.ba...@nokia.com
 Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com

Acked-by: Tony Lindgren t...@atomide.com

 ---
  drivers/usb/musb/omap2430.c |6 --
  1 files changed, 0 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
 index e06d65e..2111a24 100644
 --- a/drivers/usb/musb/omap2430.c
 +++ b/drivers/usb/musb/omap2430.c
 @@ -32,8 +32,6 @@
  #include linux/clk.h
  #include linux/io.h
  
 -#include plat/mux.h
 -
  #include musb_core.h
  #include omap2430.h
  
 @@ -194,10 +192,6 @@ int __init musb_platform_init(struct musb *musb, void 
 *board_data)
   u32 l;
   struct omap_musb_board_data *data = board_data;
  
 -#if defined(CONFIG_ARCH_OMAP2430)
 - omap_cfg_reg(AE5_2430_USB0HS_STP);
 -#endif
 -
   /* We require some kind of external transceiver, hooked
* up through ULPI.  TWL4030-family PMICs include one,
* which needs a driver, drivers aren't always needed.
 -- 
 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
--
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 resend 2/2] OMAP3: musb: remove unneeded include files

2010-07-09 Thread Ajay Kumar Gupta
Removed include files from usb-musb.c which were not required.

Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com
---
 arch/arm/mach-omap2/usb-musb.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 03ddf64..3befddb 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -16,17 +16,10 @@
  * published by the Free Software Foundation.
  */
 
-#include linux/types.h
-#include linux/errno.h
-#include linux/delay.h
 #include linux/platform_device.h
-#include linux/clk.h
 #include linux/dma-mapping.h
-#include linux/io.h
-
 #include linux/usb/musb.h
 
-#include mach/hardware.h
 #include mach/irqs.h
 #include plat/usb.h
 
-- 
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 resend 1/2] OMAP3: musb: remove unneeded inits in musb_plat

2010-07-09 Thread Ajay Kumar Gupta
Removed unneeded 'power' and 'mode' field from musb_config as
they are now getting updated by the values provided from board
files at usb_musb_init().

Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com
---
 arch/arm/mach-omap2/usb-musb.c |   13 -
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 33a5cde..03ddf64 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -54,21 +54,8 @@ static struct musb_hdrc_config musb_config = {
 };
 
 static struct musb_hdrc_platform_data musb_plat = {
-#ifdef CONFIG_USB_MUSB_OTG
-   .mode   = MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
-   .mode   = MUSB_HOST,
-#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
-   .mode   = MUSB_PERIPHERAL,
-#endif
/* .clock is set dynamically */
.config = musb_config,
-
-   /* REVISIT charge pump on TWL4030 can supply up to
-* 100 mA ... but this value is board-specific, like
-* mode, and should be passed to usb_musb_init().
-*/
-   .power  = 50,   /* up to 100 mA */
 };
 
 static u64 musb_dmamask = DMA_BIT_MASK(32);
-- 
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 v6 0/3] omap3 nand: cleanup exiting platform related code

2010-07-09 Thread Tony Lindgren
* Sukumar Ghorai s-gho...@ti.com [100709 10:19]:
The following set of patches applies on top of for-next branch.
   http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git
Patches verified on: omap3430-SDP, omap3630-sdp, zoom3 and beagle board
 
And these are the patches required to address the following input -
  1. The NAND driver needs to stop tinkering with the GPMC registers
   The omap General Purpose Memory Controller (GPMC) registers are omap
 specific, and not driver specific. Tinkering with these registers can
 cause issues with the other devices on the GPMC.
 
  2. Passing hardcoded GPMC_CS0_BASE needs to go from the board files
   Passing hardcoded GPMC virtual addressess is sure way to mess up things.
 This should all become unnecessary once the NAND drivers stops messing
 with the GPMC registers directly.

Looks good to me, thanks for doing this.

One more request: Please repost this series one more time with linux-arm-kernel
mailing list Cc'd. Then if no comments, I'll merge this series during the next
merge window.

Regards,

Tony
--
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 11/15] wireless: wl1271: introduce platform device support

2010-07-09 Thread Ohad Ben-Cohen
Hi Roger,

On Fri, Jul 9, 2010 at 11:12 AM, Roger Quadros roger.quad...@nokia.com wrote:
 You are already
 creating a new platform device for wl1271_sdio just to pass platform_data

With the new approach, I can remove this platform device altogether,
and completely rely on the sdio function device for driver probing (as
it was before). I just need to add this little support of delivering
small bits of platform data - the mechanism should be simple and
generic, and would considerably simplify the driver.

 I think this case is specific to wl1271.

Yes, it is.

There's an hw issue with the wl1271's in-band interrupt, so we can't
use it (the issue is fixed in the wl1281 btw).

But we also have to deliver the reference clock info to the driver,
which is board-specific data, and would be relevant to all wl12xx
devices.

Thanks,
Ohad.
--
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 09/13] tsl2563 ALS support for Nokia N900

2010-07-09 Thread Tony Lindgren
* Ameya Palande ameya.pala...@nokia.com [100708 15:55]:
 Hi Tony,
 
 On Wed, 2010-07-07 at 11:44 +0200, ext Tony Lindgren wrote:
  From: Ameya Palande ameya.pala...@nokia.com
  
  This commit will enable usage of tsl2563 ambient light sensor on Nokia N900.
  
  Signed-off-by: Ameya Palande ameya.pala...@nokia.com
  Signed-off-by: Tony Lindgren t...@atomide.com
 
 This patch is not correct, sorry for that. You can drop this one.
 Mathias Nyman will send a new one with correction.

Thanks, updated version from Mathias below.

Regards,

Tony
From 7488ecd62fbb5c440823c28f120fdf52535a3d54 Mon Sep 17 00:00:00 2001
From: Mathias Nyman mathias.ny...@nokia.com
Date: Tue, 6 Jul 2010 17:05:34 +0300
Subject: [PATCH] omap: tsl2563 ALS support for Nokia N900

This commit will enable usage of tsl2563 ambient light sensor on Nokia N900.

Signed-off-by: Ameya Palande ameya.pala...@nokia.com
Signed-off-by: Mathias Nyman mathias.ny...@nokia.com
Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 3c3f975..a3a396c 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -35,6 +35,8 @@
 #include sound/tlv320aic3x.h
 #include sound/tpa6130a2-plat.h
 
+#include ../drivers/staging/iio/light/tsl2563.h
+
 #include mux.h
 #include hsmmc.h
 
@@ -53,6 +55,12 @@ enum {
 
 static struct wl12xx_platform_data wl1251_pdata;
 
+#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
+static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
+	.cover_comp_gain = 16,
+};
+#endif
+
 static struct omap2_mcspi_device_config wl1251_mcspi_config = {
 	.turbo_mode	= 0,
 	.single_channel	= 1,
@@ -714,6 +722,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
 		I2C_BOARD_INFO(tlv320aic3x, 0x18),
 		.platform_data = rx51_aic3x_data,
 	},
+#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
+	{
+		I2C_BOARD_INFO(tsl2563, 0x29),
+		.platform_data = rx51_tsl2563_platform_data,
+	},
+#endif
 	{
 		I2C_BOARD_INFO(tpa6130a2, 0x60),
 		.platform_data = rx51_tpa6130a2_data,


[PATCH v7 0/3] omap3 nand: cleanup exiting platform related code

2010-07-09 Thread Sukumar Ghorai
   The following set of patches applies on top of for-next branch.
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git
   Patches verified on: omap3430-SDP, omap3630-sdp, zoom3 and beagle board

   And these are the patches required to address the following input -
 1. The NAND driver needs to stop tinkering with the GPMC registers
The omap General Purpose Memory Controller (GPMC) registers are omap
specific, and not driver specific. Tinkering with these registers can
cause issues with the other devices on the GPMC.

 2. Passing hardcoded GPMC_CS0_BASE needs to go from the board files
Passing hardcoded GPMC virtual addressess is sure way to mess up things.
This should all become unnecessary once the NAND drivers stops messing
with the GPMC registers directly.
 Discussion: 
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg27630.html

   No code change from previous version.
   Looping linux-arm-kernel mailing list with new version.

   Changes in this series -
gpmc_hwcontrol() function in gpmc.c, break into various small function.
   v6: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31936.html

  Unused function removed.
  v5: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html

  Functions related to ecc and prefetch engine are optimized.
  v4: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg29458.html

  Few functionality was missing  like - There should be some locking as only
   one chipselect can use the ECC or prefetch engine at a time. If you have
   NAND in two chipselects, bad things would happen.
  v3: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28715.html

  Additionally, it was needed to implement more functions for the platform
  init code to use.
  v2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28467.html

  v1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg28164.html


Sukumar Ghorai (3):
omap3 gpmc: functionality enhancement
omap3 nand: cleanup virtual address usages
omap3 nand: fix issue in board file to detect nand
 arch/arm/mach-omap2/board-cm-t35.c |   20 +--
 arch/arm/mach-omap2/board-devkit8000.c |   25 +---
 arch/arm/mach-omap2/board-omap3beagle.c|   24 +---
 arch/arm/mach-omap2/board-omap3touchbook.c |   25 +---
 arch/arm/mach-omap2/board-overo.c  |   24 +---
 arch/arm/mach-omap2/board-sdp-flash.c  |5 -
 arch/arm/mach-omap2/gpmc-nand.c|   38 +---
 arch/arm/mach-omap2/gpmc.c |  285 ++--
 arch/arm/plat-omap/include/plat/gpmc.h |   42 -
 arch/arm/plat-omap/include/plat/nand.h |6 +-
 drivers/mtd/nand/omap2.c   |  218 ++
 11 files changed, 371 insertions(+), 341 deletions(-)
--
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 v7 3/3] omap3 nand: fix issue in board file to detect nand

2010-07-09 Thread Sukumar Ghorai
Board file modified for not to provide gpmc phys_base address to nand driver.
The gpmc_nand_init funciton is now used to detect the nand and required to
adopt _prob function as in nand/omap2.c

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/board-cm-t35.c |   20 +---
 arch/arm/mach-omap2/board-devkit8000.c |   25 +
 arch/arm/mach-omap2/board-omap3beagle.c|   24 +---
 arch/arm/mach-omap2/board-omap3touchbook.c |   25 +
 arch/arm/mach-omap2/board-overo.c  |   24 +---
 arch/arm/mach-omap2/board-sdp-flash.c  |5 -
 6 files changed, 5 insertions(+), 118 deletions(-)

diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 79d6b15..9aa2b89 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -61,8 +61,6 @@
 #define SB_T35_SMSC911X_GPIO   65
 
 #define NAND_BLOCK_SIZESZ_128K
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS0_BASE_ADDR (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE)
 
 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
 #include linux/smsc911x.h
@@ -223,28 +221,12 @@ static struct omap_nand_platform_data cm_t35_nand_data = {
.nr_parts   = ARRAY_SIZE(cm_t35_nand_partitions),
.dma_channel= -1,   /* disable DMA in OMAP NAND driver */
.cs = 0,
-   .gpmc_cs_baseaddr   = (void __iomem *)GPMC_CS0_BASE_ADDR,
-   .gpmc_baseaddr  = (void __iomem *)OMAP34XX_GPMC_VIRT,
 
 };
 
-static struct resource cm_t35_nand_resource = {
-   .flags  = IORESOURCE_MEM,
-};
-
-static struct platform_device cm_t35_nand_device = {
-   .name   = omap2-nand,
-   .id = -1,
-   .num_resources  = 1,
-   .resource   = cm_t35_nand_resource,
-   .dev= {
-   .platform_data  = cm_t35_nand_data,
-   },
-};
-
 static void __init cm_t35_init_nand(void)
 {
-   if (platform_device_register(cm_t35_nand_device)  0)
+   if (gpmc_nand_init(cm_t35_nand_data)  0)
pr_err(CM-T35: Unable to register NAND device\n);
 }
 #else
diff --git a/arch/arm/mach-omap2/board-devkit8000.c 
b/arch/arm/mach-omap2/board-devkit8000.c
index 4b7103a..a1d8764 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -59,9 +59,6 @@
 #include mux.h
 #include hsmmc.h
 
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS_SIZE   0x30
-
 #define NAND_BLOCK_SIZESZ_128K
 
 #define OMAP_DM9000_GPIO_IRQ   25
@@ -105,20 +102,6 @@ static struct omap_nand_platform_data devkit8000_nand_data 
= {
.dma_channel= -1,   /* disable DMA in OMAP NAND driver */
 };
 
-static struct resource devkit8000_nand_resource = {
-   .flags  = IORESOURCE_MEM,
-};
-
-static struct platform_device devkit8000_nand_device = {
-   .name   = omap2-nand,
-   .id = -1,
-   .dev= {
-   .platform_data  = devkit8000_nand_data,
-   },
-   .num_resources  = 1,
-   .resource   = devkit8000_nand_resource,
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 1,
@@ -591,8 +574,6 @@ static void __init devkit8000_flash_init(void)
u8 cs = 0;
u8 nandcs = GPMC_CS_NUM + 1;
 
-   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
-
/* find out the chip-select on which NAND exists */
while (cs  GPMC_CS_NUM) {
u32 ret = 0;
@@ -614,13 +595,9 @@ static void __init devkit8000_flash_init(void)
 
if (nandcs  GPMC_CS_NUM) {
devkit8000_nand_data.cs = nandcs;
-   devkit8000_nand_data.gpmc_cs_baseaddr = (void *)
-   (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
-   devkit8000_nand_data.gpmc_baseaddr = (void *)
-   (gpmc_base_add);
 
printk(KERN_INFO Registering NAND on CS%d\n, nandcs);
-   if (platform_device_register(devkit8000_nand_device)  0)
+   if (gpmc_nand_init(devkit8000_nand_data)  0)
printk(KERN_ERR Unable to register NAND device\n);
}
 }
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c 
b/arch/arm/mach-omap2/board-omap3beagle.c
index 64aa557..66177cb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -48,9 +48,6 @@
 #include mux.h
 #include hsmmc.h
 
-#define GPMC_CS0_BASE  0x60
-#define GPMC_CS_SIZE   0x30
-
 #define NAND_BLOCK_SIZESZ_128K
 
 static struct mtd_partition omap3beagle_nand_partitions[] = {
@@ -93,20 +90,6 @@ static struct omap_nand_platform_data omap3beagle_nand_data 
= {
.dev_ready  = NULL,
 };
 
-static struct resource omap3beagle_nand_resource = {
-   .flags  = 

[PATCH v7 1/3] omap3 gpmc: functionality enhancement

2010-07-09 Thread Sukumar Ghorai
few functions added in gpmc module and to be used by other drivers like NAND.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/gpmc.c |  276 ++--
 arch/arm/plat-omap/include/plat/gpmc.h |   39 -
 drivers/mtd/nand/omap2.c   |4 +-
 3 files changed, 302 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 5bc3ca0..3fef085 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -46,8 +46,9 @@
 #define GPMC_ECC_CONFIG0x1f4
 #define GPMC_ECC_CONTROL   0x1f8
 #define GPMC_ECC_SIZE_CONFIG   0x1fc
+#define GPMC_ECC1_RESULT0x200
 
-#define GPMC_CS0   0x60
+#define GPMC_CS0_OFFSET0x60
 #define GPMC_CS_SIZE   0x30
 
 #define GPMC_MEM_START 0x
@@ -92,7 +93,8 @@ struct omap3_gpmc_regs {
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
 static DEFINE_SPINLOCK(gpmc_mem_lock);
-static unsignedgpmc_cs_map;
+static unsigned int gpmc_cs_map;   /* flag for cs which are initialized */
+static int gpmc_ecc_used = -EINVAL;/* cs using ecc engine */
 
 static void __iomem *gpmc_base;
 
@@ -108,11 +110,27 @@ static u32 gpmc_read_reg(int idx)
return __raw_readl(gpmc_base + idx);
 }
 
+static void gpmc_cs_write_byte(int cs, int idx, u8 val)
+{
+   void __iomem *reg_addr;
+
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
+   __raw_writeb(val, reg_addr);
+}
+
+static u8 gpmc_cs_read_byte(int cs, int idx)
+{
+   void __iomem *reg_addr;
+
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
+   return __raw_readb(reg_addr);
+}
+
 void gpmc_cs_write_reg(int cs, int idx, u32 val)
 {
void __iomem *reg_addr;
 
-   reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
__raw_writel(val, reg_addr);
 }
 
@@ -120,7 +138,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
 {
void __iomem *reg_addr;
 
-   reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
+   reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
return __raw_readl(reg_addr);
 }
 
@@ -419,8 +437,157 @@ void gpmc_cs_free(int cs)
 EXPORT_SYMBOL(gpmc_cs_free);
 
 /**
+ * gpmc_read_status - read access request to get the different gpmc status
+ * @cmd: command type
+ * @return status
+ */
+int gpmc_read_status(int cmd)
+{
+   int status = -EINVAL;
+   u32 regval = 0;
+
+   switch (cmd) {
+   case GPMC_GET_IRQ_STATUS:
+   status = gpmc_read_reg(GPMC_IRQSTATUS);
+   break;
+
+   case GPMC_PREFETCH_FIFO_CNT:
+   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
+   status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval);
+   break;
+
+   case GPMC_PREFETCH_COUNT:
+   regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
+   status = GPMC_PREFETCH_STATUS_COUNT(regval);
+   break;
+
+   case GPMC_STATUS_BUFFER:
+   regval = gpmc_read_reg(GPMC_STATUS);
+   /* 1 : buffer is available to write */
+   status = regval  GPMC_STATUS_BUFF_EMPTY;
+   break;
+
+   default:
+   printk(KERN_ERR gpmc_read_status: Not supported\n);
+   }
+   return status;
+}
+EXPORT_SYMBOL(gpmc_read_status);
+
+/**
+ * gpmc_cs_configure - write request to configure gpmc
+ * @cs: chip select number
+ * @cmd: command type
+ * @wval: value to write
+ * @return status of the operation
+ */
+int gpmc_cs_configure(int cs, int cmd, int wval)
+{
+   int err = 0;
+   u32 regval = 0;
+
+   switch (cmd) {
+   case GPMC_SET_IRQ_STATUS:
+   gpmc_write_reg(GPMC_IRQSTATUS, wval);
+   break;
+
+   case GPMC_CONFIG_WP:
+   regval = gpmc_read_reg(GPMC_CONFIG);
+   if (wval)
+   regval = ~GPMC_CONFIG_WRITEPROTECT; /* WP is ON */
+   else
+   regval |= GPMC_CONFIG_WRITEPROTECT;  /* WP is OFF */
+   gpmc_write_reg(GPMC_CONFIG, regval);
+   break;
+
+   case GPMC_CONFIG_RDY_BSY:
+   regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+   if (wval)
+   regval |= WR_RD_PIN_MONITORING;
+   else
+   regval = ~WR_RD_PIN_MONITORING;
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
+   break;
+
+   case GPMC_CONFIG_DEV_SIZE:
+   regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+   regval |= GPMC_CONFIG1_DEVICESIZE(wval);
+   gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
+   break;
+
+   case GPMC_CONFIG_DEV_TYPE:
+   regval  = gpmc_cs_read_reg(cs, 

[PATCH v7 2/3] omap3 nand: cleanup virtual address usages

2010-07-09 Thread Sukumar Ghorai
This patch removes direct reference of gpmc address from generic nand platform 
code.
Nand platform code now uses wrapper functions which are implemented in gpmc 
module. 

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/gpmc-nand.c|   38 ++
 arch/arm/mach-omap2/gpmc.c |9 --
 arch/arm/plat-omap/include/plat/gpmc.h |5 -
 arch/arm/plat-omap/include/plat/nand.h |6 +-
 drivers/mtd/nand/omap2.c   |  214 
 5 files changed, 65 insertions(+), 207 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index e57fb29..53bacb5 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -19,8 +19,6 @@
 #include plat/board.h
 #include plat/gpmc.h
 
-#define WR_RD_PIN_MONITORING   0x0060
-
 static struct omap_nand_platform_data *gpmc_nand_data;
 
 static struct resource gpmc_nand_resource = {
@@ -71,10 +69,10 @@ static int omap2_nand_gpmc_retime(void)
t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data-gpmc_t-wr_cycle);
 
/* Configure GPMC */
-   gpmc_cs_write_reg(gpmc_nand_data-cs, GPMC_CS_CONFIG1,
-   GPMC_CONFIG1_DEVICESIZE(gpmc_nand_data-devsize) |
-   GPMC_CONFIG1_DEVICETYPE_NAND);
-
+   gpmc_cs_configure(gpmc_nand_data-cs,
+   GPMC_CONFIG_DEV_SIZE, gpmc_nand_data-devsize);
+   gpmc_cs_configure(gpmc_nand_data-cs,
+   GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
err = gpmc_cs_set_timings(gpmc_nand_data-cs, t);
if (err)
return err;
@@ -82,27 +80,13 @@ static int omap2_nand_gpmc_retime(void)
return 0;
 }
 
-static int gpmc_nand_setup(void)
-{
-   struct device *dev = gpmc_nand_device.dev;
-
-   /* Set timings in GPMC */
-   if (omap2_nand_gpmc_retime()  0) {
-   dev_err(dev, Unable to set gpmc timings\n);
-   return -EINVAL;
-   }
-
-   return 0;
-}
-
 int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data)
 {
-   unsigned int val;
int err = 0;
struct device *dev = gpmc_nand_device.dev;
 
gpmc_nand_data = _nand_data;
-   gpmc_nand_data-nand_setup = gpmc_nand_setup;
+   gpmc_nand_data-nand_setup = omap2_nand_gpmc_retime;
gpmc_nand_device.dev.platform_data = gpmc_nand_data;
 
err = gpmc_cs_request(gpmc_nand_data-cs, NAND_IO_SIZE,
@@ -112,19 +96,16 @@ int __init gpmc_nand_init(struct omap_nand_platform_data 
*_nand_data)
return err;
}
 
-   err = gpmc_nand_setup();
+/* Set timings in GPMC */
+   err = omap2_nand_gpmc_retime();
if (err  0) {
-   dev_err(dev, NAND platform setup failed: %d\n, err);
+   dev_err(dev, Unable to set gpmc timings: %d\n, err);
return err;
}
 
/* Enable RD PIN Monitoring Reg */
if (gpmc_nand_data-dev_ready) {
-   val  = gpmc_cs_read_reg(gpmc_nand_data-cs,
-GPMC_CS_CONFIG1);
-   val |= WR_RD_PIN_MONITORING;
-   gpmc_cs_write_reg(gpmc_nand_data-cs,
-   GPMC_CS_CONFIG1, val);
+   gpmc_cs_configure(gpmc_nand_data-cs, GPMC_CONFIG_RDY_BSY, 1);
}
 
err = platform_device_register(gpmc_nand_device);
@@ -140,3 +121,4 @@ out_free_cs:
 
return err;
 }
+
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index d50cf01..ff6709c 100755
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -641,15 +641,6 @@ int gpmc_prefetch_reset(int cs)
 }
 EXPORT_SYMBOL(gpmc_prefetch_reset);
 
-/**
- * gpmc_prefetch_status - reads prefetch status of engine
- */
-int  gpmc_prefetch_status(void)
-{
-   return gpmc_read_reg(GPMC_PREFETCH_STATUS);
-}
-EXPORT_SYMBOL(gpmc_prefetch_status);
-
 static void __init gpmc_mem_init(void)
 {
int cs;
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h 
b/arch/arm/plat-omap/include/plat/gpmc.h
index 561c64f..9fd99b9 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -25,9 +25,6 @@
 #define GPMC_CS_NAND_ADDRESS   0x20
 #define GPMC_CS_NAND_DATA  0x24
 
-#define GPMC_CONFIG0x50
-#define GPMC_STATUS0x54
-
 /* Control Commands */
 #define GPMC_CONFIG_RDY_BSY0x0001
 #define GPMC_CONFIG_DEV_SIZE   0x0002
@@ -66,7 +63,6 @@
 #define GPMC_CONFIG1_DEVICESIZE_16  GPMC_CONFIG1_DEVICESIZE(1)
 #define GPMC_CONFIG1_DEVICETYPE(val)((val  3)  10)
 #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
-#define GPMC_CONFIG1_DEVICETYPE_NANDGPMC_CONFIG1_DEVICETYPE(2)
 #define GPMC_CONFIG1_MUXADDDATA (1  9)
 #define GPMC_CONFIG1_TIME_PARA_GRAN (1  4)
 #define GPMC_CONFIG1_FCLK_DIV(val)  (val  3)
@@ -136,7 +132,6 @@ extern int 

Re: [PATCH 11/15] wireless: wl1271: introduce platform device support

2010-07-09 Thread Grazvydas Ignotas
On Fri, Jul 9, 2010 at 11:32 AM, Ohad Ben-Cohen o...@wizery.com wrote:
 Hi Roger,

 On Fri, Jul 9, 2010 at 11:12 AM, Roger Quadros roger.quad...@nokia.com 
 wrote:
 You are already
 creating a new platform device for wl1271_sdio just to pass platform_data

 With the new approach, I can remove this platform device altogether,
 and completely rely on the sdio function device for driver probing (as
 it was before). I just need to add this little support of delivering
 small bits of platform data - the mechanism should be simple and
 generic, and would considerably simplify the driver.

 I think this case is specific to wl1271.

 Yes, it is.

wl1251 also has this issue. In fact it's even worse there as it's
missing all SDIO registers and cannot be probed at all.. Those devices
are not plug n play at all.
--
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/3] omap3 nand: cleanup exiting platform related code

2010-07-09 Thread Ghorai, Sukumar
Tony,

 -Original Message-
 From: Tony Lindgren [mailto:t...@atomide.com]
 Sent: Friday, July 09, 2010 2:03 PM
 To: Ghorai, Sukumar
 Cc: linux-omap@vger.kernel.org; linux-...@lists.infradead.org
 Subject: Re: [PATCH v6 0/3] omap3 nand: cleanup exiting platform related
 code
 
 * Sukumar Ghorai s-gho...@ti.com [100709 10:19]:
 The following set of patches applies on top of for-next branch.
  http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git
 Patches verified on: omap3430-SDP, omap3630-sdp, zoom3 and beagle
 board
 
 And these are the patches required to address the following input -
   1. The NAND driver needs to stop tinkering with the GPMC registers
  The omap General Purpose Memory Controller (GPMC) registers are omap
  specific, and not driver specific. Tinkering with these
 registers can
  cause issues with the other devices on the GPMC.
 
   2. Passing hardcoded GPMC_CS0_BASE needs to go from the board files
  Passing hardcoded GPMC virtual addressess is sure way to mess up
 things.
  This should all become unnecessary once the NAND drivers stops
 messing
  with the GPMC registers directly.
 
 Looks good to me, thanks for doing this.
 
 One more request: Please repost this series one more time with linux-arm-
 kernel
 mailing list Cc'd. Then if no comments, I'll merge this series during the
 next
 merge window.

[Ghorai] Thanks. 
And would you please check if you have any input on following patch series? 
Otherwise I will rework on this and send again. We need those patches in this 
time.
1. http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30735.html
2. http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31471.html

Regards,
Ghorai
--
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: [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-06-25 at 16:46 -0500, Nishanth Menon wrote:
 Add unlikely checks to better optimize the rare occurrance of
 erroneous conditions.
 
 Cc: Kevin Hilman khil...@deeprootsystems.com
 Cc: Thara Gopinath th...@ti.com
 
 Signed-off-by: Nishanth Menon n...@ti.com

unlikely and friends make sens only in realy hot path places. In other
places like you touch, they are pointless - better let gcc make a choice
of how to arrange code. And they only make the code less readable by
adding extra braces and making ifs longer.

Thus, NACK for this from my side.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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] omap3: sr: fix memory leak and simplify the code

2010-07-09 Thread Artem Bityutskiy
From: Artem Bityutskiy artem.bityuts...@nokia.com

This patch fixes the following problem indicated by kmemleak:

kmemleak: unreferenced object 0xdf93c280 (size 64):
kmemleak:   backtrace:
kmemleak: [c00df6d4] create_object+0x104/0x200
kmemleak: [c00d7638] kmem_cache_alloc+0xe4/0xf4
kmemleak: [c000fc38] omap_devinit_smartreflex+0x44/0x244
kmemleak: [c003a33c] do_one_initcall+0x5c/0x1b8
kmemleak: [c00083fc] kernel_init+0x94/0x110
kmemleak: [c003ba04] kernel_thread_exit+0x0/0x8

The reason is that 'omap_devinit_smartreflex()' allocates 'sr_data',
then passes it to 'omap_device_build()', which 'kmemdup()'s it and
uses the copy. But 'omap_devinit_smartreflex()' never frees 'sr_data'.

This patch make 'sr_data' to be a stack variable, which eliminates
the memory leak and simplifies the code a bit.

Signed-off-by: Artem Bityutskiy artem.bityuts...@nokia.com
---
 arch/arm/mach-omap2/sr_device.c |   27 +--
 1 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 24630ef..d1bb495 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -129,7 +129,7 @@ static int __init omap_devinit_smartreflex(void)
char *name = smartreflex;
 
do {
-   struct omap_smartreflex_data *sr_data;
+   struct omap_smartreflex_data sr_data;
struct omap_smartreflex_dev_data *sr_dev_data;
struct omap_device *od;
struct omap_hwmod *oh;
@@ -140,15 +140,7 @@ static int __init omap_devinit_smartreflex(void)
if (!oh)
break;
 
-   sr_data = kzalloc(sizeof(struct omap_smartreflex_data),
-   GFP_KERNEL);
sr_dev_data = (struct omap_smartreflex_dev_data *)oh-dev_attr;
-   if (!sr_data) {
-   pr_warning(%s: could not find hwmod data for %d\n,
-   __func__, i + 1);
-   kfree(sr_data);
-   return -ENOMEM;
-   }
 
/*
 * OMAP3430 ES3.1 chips by default come with Efuse burnt
@@ -159,26 +151,25 @@ static int __init omap_devinit_smartreflex(void)
 */
if (cpu_is_omap343x()) {
if (omap_rev() == OMAP3430_REV_ES3_1)
-   sr_data-enable_on_init = true;
+   sr_data.enable_on_init = true;
else
-   sr_data-enable_on_init = false;
+   sr_data.enable_on_init = false;
} else {
-   sr_data-enable_on_init = false;
+   sr_data.enable_on_init = false;
}
-   sr_data-device_enable = omap_device_enable;
-   sr_data-device_shutdown = omap_device_shutdown;
-   sr_data-device_idle = omap_device_idle;
+   sr_data.device_enable = omap_device_enable;
+   sr_data.device_shutdown = omap_device_shutdown;
+   sr_data.device_idle = omap_device_idle;
omap_get_voltage_table(i, sr_dev_data-volt_data,
sr_dev_data-volts_supported);
-   sr_set_nvalues(sr_dev_data, sr_data);
+   sr_set_nvalues(sr_dev_data, sr_data);
 
-   od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
+   od = omap_device_build(name, i, oh, sr_data, sizeof(sr_data),
   omap_sr_latency,
   ARRAY_SIZE(omap_sr_latency), 0);
if (IS_ERR(od)) {
pr_warning(%s: Could not build omap_device %s:%s\n,
__func__, name, oh-name);
-   kfree(sr_data);
}
i++;
} while (1);
-- 
1.7.1.1

--
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: sr: improve errors handling

2010-07-09 Thread Artem Bityutskiy
From: Artem Bityutskiy artem.bityuts...@nokia.com

Do not forget to check the 'platform_device_add_data()' error code
in 'omap_device_build_ss()'.

Signed-off-by: Artem Bityutskiy artem.bityuts...@nokia.com
---
 arch/arm/plat-omap/omap_device.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f2bd2e2..e8da192 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -414,7 +414,9 @@ struct omap_device *omap_device_build_ss(const char 
*pdev_name, int pdev_id,
od-pdev.num_resources = res_count;
od-pdev.resource = res;
 
-   platform_device_add_data(od-pdev, pdata, pdata_len);
+   ret = platform_device_add_data(od-pdev, pdata, pdata_len);
+   if (ret)
+   goto odbs_exit4;
 
od-pm_lats = pm_lats;
od-pm_lats_cnt = pm_lats_cnt;
-- 
1.7.1.1

--
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/2] omap3: sr: fix memory leak and simplify the code

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-07-09 at 16:20 +0300, Artem Bityutskiy wrote:
 From: Artem Bityutskiy artem.bityuts...@nokia.com
 
 This patch fixes the following problem indicated by kmemleak:
 
 kmemleak: unreferenced object 0xdf93c280 (size 64):
 kmemleak:   backtrace:
 kmemleak: [c00df6d4] create_object+0x104/0x200
 kmemleak: [c00d7638] kmem_cache_alloc+0xe4/0xf4
 kmemleak: [c000fc38] omap_devinit_smartreflex+0x44/0x244
 kmemleak: [c003a33c] do_one_initcall+0x5c/0x1b8
 kmemleak: [c00083fc] kernel_init+0x94/0x110
 kmemleak: [c003ba04] kernel_thread_exit+0x0/0x8
 
 The reason is that 'omap_devinit_smartreflex()' allocates 'sr_data',
 then passes it to 'omap_device_build()', which 'kmemdup()'s it and
 uses the copy. But 'omap_devinit_smartreflex()' never frees 'sr_data'.
 
 This patch make 'sr_data' to be a stack variable, which eliminates
 the memory leak and simplifies the code a bit.
 
 Signed-off-by: Artem Bityutskiy artem.bityuts...@nokia.com
 ---
  arch/arm/mach-omap2/sr_device.c |   27 +--
  1 files changed, 9 insertions(+), 18 deletions(-)

Note, I only compile-tested both of the patches, so be careful.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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: [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks

2010-07-09 Thread Nishanth Menon

Artem Bityutskiy had written, on 07/09/2010 08:12 AM, the following:

On Fri, 2010-06-25 at 16:46 -0500, Nishanth Menon wrote:

Add unlikely checks to better optimize the rare occurrance of
erroneous conditions.

Cc: Kevin Hilman khil...@deeprootsystems.com
Cc: Thara Gopinath th...@ti.com

Signed-off-by: Nishanth Menon n...@ti.com


unlikely and friends make sens only in realy hot path places. In other
places like you touch, they are pointless - better let gcc make a choice



@@ -43,8 +43,9 @@ static void __init sr_read_efuse(struct omap_sr_dev_data 
*dev_data,
 {
int i;
 
-	if (!dev_data || !dev_data-volts_supported || !dev_data-volt_data ||

-   !dev_data-efuse_nvalues_offs) {
+   if (unlikely(!dev_data || !dev_data-volts_supported ||
+   !dev_data-volt_data ||
+   !dev_data-efuse_nvalues_offs)) {



@@ -87,8 +88,8 @@ static void __init sr_set_testing_nvalues(struct 
omap_sr_dev_data *dev_data,
 {
int i;
 
-	if (!dev_data || !dev_data-volts_supported ||

-   !dev_data-volt_data || !dev_data-test_nvalues) {
+   if (unlikely(!dev_data || !dev_data-volts_supported ||
+   !dev_data-volt_data || !dev_data-test_nvalues)) {


and other places, why do you think that these are checks that should be 
expected? - would be great if you can explain inline to the patch which 
unlikely checks dont make sense.


static functions such as these are helpers for the maincode, unless 
something horribly wrong occurs within the codepath calling these 
helpers, they are not expected to be invalid parameters. hence the 
rationale for adding unlikely.





of how to arrange code. And they only make the code less readable by
adding extra braces and making ifs longer.

Thus, NACK for this from my side.




--
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: [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-07-09 at 08:40 -0500, Nishanth Menon wrote:
 Artem Bityutskiy had written, on 07/09/2010 08:12 AM, the following:
  On Fri, 2010-06-25 at 16:46 -0500, Nishanth Menon wrote:
  Add unlikely checks to better optimize the rare occurrance of
  erroneous conditions.
 
  Cc: Kevin Hilman khil...@deeprootsystems.com
  Cc: Thara Gopinath th...@ti.com
 
  Signed-off-by: Nishanth Menon n...@ti.com
  
  unlikely and friends make sens only in realy hot path places. In other
  places like you touch, they are pointless - better let gcc make a choice
 
  @@ -43,8 +43,9 @@ static void __init sr_read_efuse(struct omap_sr_dev_data 
  *dev_data,
   {
  int i;
   
  -   if (!dev_data || !dev_data-volts_supported || !dev_data-volt_data ||
  -   !dev_data-efuse_nvalues_offs) {
  +   if (unlikely(!dev_data || !dev_data-volts_supported ||
  +   !dev_data-volt_data ||
  +   !dev_data-efuse_nvalues_offs)) {
 
  @@ -87,8 +88,8 @@ static void __init sr_set_testing_nvalues(struct 
  omap_sr_dev_data *dev_data,
   {
  int i;
   
  -   if (!dev_data || !dev_data-volts_supported ||
  -   !dev_data-volt_data || !dev_data-test_nvalues) {
  +   if (unlikely(!dev_data || !dev_data-volts_supported ||
  +   !dev_data-volt_data || !dev_data-test_nvalues)) {
 
 and other places, why do you think that these are checks that should be 
 expected? - would be great if you can explain inline to the patch which 
 unlikely checks dont make sense.
 
 static functions such as these are helpers for the maincode, unless 
 something horribly wrong occurs within the codepath calling these 
 helpers, they are not expected to be invalid parameters. hence the 
 rationale for adding unlikely.

Sorry, I do not really understand you. All I said is that
unlikely()/likely() are usually used in hot-paths / tight loops.

unlikely()/likely() are micro optimization. They make no difference when
you use them in initialization paths.

So what I said, that in your patch they will make no difference
performance wise. So no benefits.

But they make if () statements a bit more difficult to read, this is a
drawback.

So your patch introduces no benefits, just a drawback. Thus, it is not
good.

There were many flamewars about unlikely and likely in lkml in the past.
And the outcome was always - do not use them anywhere except of
performance-critical tight loops / hot paths.


-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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: [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks

2010-07-09 Thread Nishanth Menon

Artem Bityutskiy had written, on 07/09/2010 09:15 AM, the following:

On Fri, 2010-07-09 at 08:40 -0500, Nishanth Menon wrote:

Artem Bityutskiy had written, on 07/09/2010 08:12 AM, the following:

On Fri, 2010-06-25 at 16:46 -0500, Nishanth Menon wrote:

Add unlikely checks to better optimize the rare occurrance of
erroneous conditions.

Cc: Kevin Hilman khil...@deeprootsystems.com
Cc: Thara Gopinath th...@ti.com

Signed-off-by: Nishanth Menon n...@ti.com

unlikely and friends make sens only in realy hot path places. In other
places like you touch, they are pointless - better let gcc make a choice
@@ -43,8 +43,9 @@ static void __init sr_read_efuse(struct omap_sr_dev_data 
*dev_data,
 {
int i;
 
-	if (!dev_data || !dev_data-volts_supported || !dev_data-volt_data ||

-   !dev_data-efuse_nvalues_offs) {
+   if (unlikely(!dev_data || !dev_data-volts_supported ||
+   !dev_data-volt_data ||
+   !dev_data-efuse_nvalues_offs)) {
@@ -87,8 +88,8 @@ static void __init sr_set_testing_nvalues(struct 
omap_sr_dev_data *dev_data,
 {
int i;
 
-	if (!dev_data || !dev_data-volts_supported ||

-   !dev_data-volt_data || !dev_data-test_nvalues) {
+   if (unlikely(!dev_data || !dev_data-volts_supported ||
+   !dev_data-volt_data || !dev_data-test_nvalues)) {
and other places, why do you think that these are checks that should be 
expected? - would be great if you can explain inline to the patch which 
unlikely checks dont make sense.


static functions such as these are helpers for the maincode, unless 
something horribly wrong occurs within the codepath calling these 
helpers, they are not expected to be invalid parameters. hence the 
rationale for adding unlikely.


Sorry, I do not really understand you. All I said is that
unlikely()/likely() are usually used in hot-paths / tight loops.

unlikely()/likely() are micro optimization. They make no difference when
you use them in initialization paths.

So what I said, that in your patch they will make no difference
performance wise. So no benefits.

But they make if () statements a bit more difficult to read, this is a
drawback.

So your patch introduces no benefits, just a drawback. Thus, it is not
good.

There were many flamewars about unlikely and likely in lkml in the past.
And the outcome was always - do not use them anywhere except of
performance-critical tight loops / hot paths.



alright.. thanks for the review. will drop this patch.

--
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 v4 0/8] nand support on omap3 boards

2010-07-09 Thread Sukumar Ghorai
   The following set of patches applies on top of for-next branch.
   And these are the patches required to enable nand (nor and onenand for sdp
   only) for different platform.
   
   v4: patch rebase on latest code base; depend on
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31950.html
   
   v3:  http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30735.html
patch rebase on latest nand patch and depend on -
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html
   
   v2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26479.html
rework to use full nand in partition table of ZOOM2/3;
ZOOM1(LDP)support added.

   v1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg22205.html

Sukumar Ghorai (5):
omap3 flash: rename board-sdp-flash.c to be use by other boards
omap3: add support for NAND on zoom2 board
omap3: add support for NAND on zoom3 board
omap-3630-sdp : Add support for Flash
omap3: add support for NAND on LDP board

 arch/arm/mach-omap2/Makefile  |6 +-
 arch/arm/mach-omap2/board-3430sdp.c   |   16 +++-
 arch/arm/mach-omap2/board-3630sdp.c   |  120 +
 arch/arm/mach-omap2/board-ldp.c   |   35 +++
 arch/arm/mach-omap2/board-sdp-flash.c |   88 ---
 arch/arm/mach-omap2/board-zoom2.c |   43 +
 arch/arm/mach-omap2/board-zoom3.c |   43 +
 arch/arm/mach-omap2/include/mach/board-sdp.h  |9 ++-
 arch/arm/mach-omap2/include/mach/board-zoom.h |6 ++
 9 files changed, 311 insertions(+), 55 deletions(-)

--
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 v4 2/5] omap3: add support for NAND on zoom2 board

2010-07-09 Thread Sukumar Ghorai
This patch adds NAND support to ZOOM2 board.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
Signed-off-by: Vimal Singh vimalsi...@ti.com
---
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-zoom2.c |   43 +
 arch/arm/mach-omap2/include/mach/board-zoom.h |6 +++
 3 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 7820b6e..81c3b08 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -128,6 +128,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
\
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
   board-zoom-peripherals.o \
+  board-flash.o \
   hsmmc.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
diff --git a/arch/arm/mach-omap2/board-zoom2.c 
b/arch/arm/mach-omap2/board-zoom2.c
index bbc7826..a0d88bd 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -92,10 +92,53 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+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 */
+   },
+   {
+   .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 */
+   },
+   {
+   .name   = system,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x200 */
+   .size   = 3328 * (64 * 2048),   /* 416M, 0x1A00 */
+   },
+   {
+   .name   = userdata,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1C00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+   {
+   .name   = cache,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1E00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+};
+
 static void __init omap_zoom2_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
zoom_peripherals_init();
+   board_nand_init(zoom_nand_partitions,
+   ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
zoom_debugboard_init();
 }
 
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h 
b/arch/arm/mach-omap2/include/mach/board-zoom.h
index c93b29e..3af69d2 100644
--- a/arch/arm/mach-omap2/include/mach/board-zoom.h
+++ b/arch/arm/mach-omap2/include/mach/board-zoom.h
@@ -1,5 +1,11 @@
 /*
  * Defines for zoom boards
  */
+#include linux/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#define ZOOM_NAND_CS0
+
+extern void __init board_nand_init(struct mtd_partition *, u8 nr_parts, u8 cs);
 extern int __init zoom_debugboard_init(void);
 extern void __init zoom_peripherals_init(void);
--
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 v4 3/5] omap3: add support for NAND on zoom3 board

2010-07-09 Thread Sukumar Ghorai
patch adds NAND support to zoom3 board.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
Signed-off-by: Vimal Singh vimalsi...@ti.com
---
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-zoom3.c |   43 +
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 81c3b08..cbd3458 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -133,6 +133,7 @@ obj-$(CONFIG_MACH_OMAP_ZOOM2)   += 
board-zoom2.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)  += board-zoom3.o \
   board-zoom-peripherals.o \
+  board-flash.o \
   hsmmc.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_3630SDP)+= board-3630sdp.o \
diff --git a/arch/arm/mach-omap2/board-zoom3.c 
b/arch/arm/mach-omap2/board-zoom3.c
index 0c6858b..84f49da 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -28,6 +28,47 @@
 static struct omap_board_config_kernel zoom_config[] __initdata = {
 };
 
+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 */
+   },
+   {
+   .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 */
+   },
+   {
+   .name   = system,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x200 */
+   .size   = 3328 * (64 * 2048),   /* 416M, 0x1A00 */
+   },
+   {
+   .name   = userdata,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1C00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+   {
+   .name   = cache,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1E00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+};
+
 static void __init omap_zoom_init_irq(void)
 {
omap_board_config = zoom_config;
@@ -75,6 +116,8 @@ static void __init omap_zoom_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
zoom_peripherals_init();
+   board_nand_init(zoom_nand_partitions,
+ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
zoom_debugboard_init();
 
omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);
--
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 v4 5/5] omap3: add support for NAND on LDP board

2010-07-09 Thread Sukumar Ghorai
patch adds NAND support to LDP board.

Signed-off-by: Vimal Singh vimalsi...@ti.com
Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/Makefile|1 +
 arch/arm/mach-omap2/board-ldp.c |   35 +++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b55a5d7..fc9133f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -110,6 +110,7 @@ obj-$(CONFIG_MACH_OMAP3_BEAGLE) += 
board-omap3beagle.o \
 obj-$(CONFIG_MACH_DEVKIT8000)  += board-devkit8000.o \
hsmmc.o
 obj-$(CONFIG_MACH_OMAP_LDP)+= board-ldp.o \
+  board-flash.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OVERO)   += board-overo.o \
   hsmmc.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6e3930e..9845995 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -38,6 +38,7 @@
 #include plat/board.h
 #include plat/common.h
 #include plat/gpmc.h
+#include mach/board-zoom.h
 
 #include asm/delay.h
 #include plat/control.h
@@ -388,6 +389,38 @@ static struct omap_musb_board_data musb_board_data = {
.power  = 100,
 };
 
+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 */
+   },
+   {
+   .name   = File System - NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x200 */
+   .size   = MTDPART_SIZ_FULL, /* 96MB, 0x600 */
+   },
+
+};
+
 static void __init omap_ldp_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -400,6 +433,8 @@ static void __init omap_ldp_init(void)
ads7846_dev_init();
omap_serial_init();
usb_musb_init(musb_board_data);
+   board_nand_init(ldp_nand_partitions,
+   ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS);
 
omap2_hsmmc_init(mmc);
/* link regulators to MMC adapters */
--
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 v4 4/5] omap-3630-sdp : Add support for Flash

2010-07-09 Thread Sukumar Ghorai
add support for NAND, OneNAND, NOR on omap 3630-sdp board.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/Makefile|1 +
 arch/arm/mach-omap2/board-3630sdp.c |  120 +++
 2 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index cbd3458..b55a5d7 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -138,6 +138,7 @@ obj-$(CONFIG_MACH_OMAP_ZOOM3)   += 
board-zoom3.o \
   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_3630SDP)+= board-3630sdp.o \
   board-zoom-peripherals.o \
+  board-flash.o \
   hsmmc.o
 obj-$(CONFIG_MACH_CM_T35)  += board-cm-t35.o \
   hsmmc.o
diff --git a/arch/arm/mach-omap2/board-3630sdp.c 
b/arch/arm/mach-omap2/board-3630sdp.c
index 8b7c2f9..69cb52b 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -21,6 +21,7 @@
 #include plat/usb.h
 
 #include mach/board-zoom.h
+#include mach/board-flash.h
 
 #include mux.h
 #include sdram-hynix-h8mbx00u0mer-0em.h
@@ -86,12 +87,131 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+/*
+ * SDP3630 CS organization
+ * See also the Switch S8 settings in the comments.
+ */
+static char chip_sel_sdp[][GPMC_CS_NUM] = {
+   {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8: */
+   {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
+   {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
+};
+
+static struct mtd_partition sdp_nor_partitions[] = {
+   /* bootloader (U-Boot, etc) in first sector */
+   {
+   .name   = Bootloader-NOR,
+   .offset = 0,
+   .size   = SZ_256K,
+   .mask_flags = MTD_WRITEABLE, /* force read-only */
+   },
+   /* bootloader params in the next sector */
+   {
+   .name   = Params-NOR,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = SZ_256K,
+   .mask_flags = 0,
+   },
+   /* kernel */
+   {
+   .name   = Kernel-NOR,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = SZ_2M,
+   .mask_flags = 0
+   },
+   /* file system */
+   {
+   .name   = Filesystem-NOR,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   .mask_flags = 0
+   }
+};
+
+static struct mtd_partition sdp_onenand_partitions[] = {
+   {
+   .name   = X-Loader-OneNAND,
+   .offset = 0,
+   .size   = 4 * (64 * 2048),
+   .mask_flags = MTD_WRITEABLE  /* force read-only */
+   },
+   {
+   .name   = U-Boot-OneNAND,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 2 * (64 * 2048),
+   .mask_flags = MTD_WRITEABLE  /* force read-only */
+   },
+   {
+   .name   = U-Boot Environment-OneNAND,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 1 * (64 * 2048),
+   },
+   {
+   .name   = Kernel-OneNAND,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 16 * (64 * 2048),
+   },
+   {
+   .name   = File System-OneNAND,
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct mtd_partition sdp_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = X-Loader-NAND,
+   .offset = 0,
+   .size   = 4 * (64 * 2048),
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048),
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = Boot Env-NAND,
+
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1c */
+   .size   = 6 * (64 * 2048),
+   },
+   {
+   .name   = Kernel-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x28 */
+   .size   = 40 * (64 * 2048),
+  

[PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards

2010-07-09 Thread Sukumar Ghorai
rename board-sdp-flash.c(board-flash.c) and board-sdp.h(board-flash.h) to
used by other board e.g. zoom

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
---
 arch/arm/mach-omap2/Makefile   |2 +-
 arch/arm/mach-omap2/board-3430sdp.c|   16 +++-
 .../{board-sdp-flash.c = board-flash.c}   |   88 ---
 .../include/mach/{board-sdp.h = board-flash.h}|9 ++-
 4 files changed, 60 insertions(+), 55 deletions(-)
 rename arch/arm/mach-omap2/{board-sdp-flash.c = board-flash.c} (68%)
 rename arch/arm/mach-omap2/include/mach/{board-sdp.h = board-flash.h} (71%)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f5b4ff4..7820b6e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -119,7 +119,7 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA)+= board-omap3pandora.o 
\
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)+= board-3430sdp.o \
   hsmmc.o \
-  board-sdp-flash.o
+  board-flash.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)  += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51.o \
   board-rx51-sdram.o \
diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index e51f8e3..61b5632 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,7 +41,7 @@
 #include plat/control.h
 #include plat/gpmc-smc91x.h
 
-#include mach/board-sdp.h
+#include mach/board-flash.h
 
 #include mux.h
 #include sdram-qimonda-hyb18m512160af-6.h
@@ -667,6 +667,18 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+/*
+ * SDP3430 V2 Board CS organization
+ * Different from SDP3430 V1. Now 4 switches used to specify CS
+ *
+ * See also the Switch S8 settings in the comments.
+ */
+static char chip_sel_3430[][GPMC_CS_NUM] = {
+   {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8: */
+   {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
+   {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
+};
+
 static struct mtd_partition sdp_nor_partitions[] = {
/* bootloader (U-Boot, etc) in first sector */
{
@@ -797,7 +809,7 @@ static void __init omap_3430sdp_init(void)
omap_serial_init();
usb_musb_init(musb_board_data);
board_smc91x_init();
-   sdp_flash_init(sdp_flash_partitions);
+   board_flash_init(sdp_flash_partitions, chip_sel_3430);
sdp3430_display_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-flash.c
similarity index 68%
rename from arch/arm/mach-omap2/board-sdp-flash.c
rename to arch/arm/mach-omap2/board-flash.c
index 2638c83..ac834aa 100644
--- a/arch/arm/mach-omap2/board-sdp-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -21,7 +21,7 @@
 #include plat/nand.h
 #include plat/onenand.h
 #include plat/tc.h
-#include mach/board-sdp.h
+#include mach/board-flash.h
 
 #define REG_FPGA_REV   0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2 0x60
@@ -29,72 +29,53 @@
 
 #define DEBUG_BASE 0x0800 /* debug board */
 
-#define PDC_NOR1
-#define PDC_NAND   2
-#define PDC_ONENAND3
-#define DBG_MPDB   4
-
 /* various memory sizes */
 #define FLASH_SIZE_SDPV1   SZ_64M  /* NOR flash (64 Meg aligned) */
 #define FLASH_SIZE_SDPV2   SZ_128M /* NOR flash (256 Meg aligned) */
 
-/*
- * SDP3430 V2 Board CS organization
- * Different from SDP3430 V1. Now 4 switches used to specify CS
- *
- * See also the Switch S8 settings in the comments.
- *
- * REVISIT: Add support for 2430 SDP
- */
-static const unsigned char chip_sel_sdp[][GPMC_CS_NUM] = {
-   {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8: */
-   {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
-   {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
-};
-
-static struct physmap_flash_data sdp_nor_data = {
+static struct physmap_flash_data board_nor_data = {
.width  = 2,
 };
 
-static struct resource sdp_nor_resource = {
+static struct resource board_nor_resource = {
.flags  = IORESOURCE_MEM,
 };
 
-static struct platform_device sdp_nor_device = {
+static struct platform_device board_nor_device = {
.name   = physmap-flash,
.id = 0,
.dev= {
-   .platform_data = sdp_nor_data,
+   .platform_data = board_nor_data,
},
.num_resources  = 1,
-   .resource   = sdp_nor_resource,
+   .resource   = board_nor_resource,
 };
 
 static void
-__init 

Re: OK to base some patches on lmb branch?

2010-07-09 Thread Russell King - ARM Linux
On Wed, Jul 07, 2010 at 01:52:14PM +0300, Tony Lindgren wrote:
 Hi Russell,
 
 Is your lmb branch going to stay static?

Not at the moment, I'm still tweaking things in there, and the main
lmb conversion commit needs a better description...  I think there's
also a few bits missing from the discontigmem removal patch.
--
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/2] omap3: sr: improve errors handling

2010-07-09 Thread Nishanth Menon

Artem Bityutskiy had written, on 07/09/2010 08:20 AM, the following:

From: Artem Bityutskiy artem.bityuts...@nokia.com

Do not forget to check the 'platform_device_add_data()' error code
in 'omap_device_build_ss()'.

Signed-off-by: Artem Bityutskiy artem.bityuts...@nokia.com

Acked-by: Nishanth Menon n...@ti.com


---
 arch/arm/plat-omap/omap_device.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f2bd2e2..e8da192 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -414,7 +414,9 @@ struct omap_device *omap_device_build_ss(const char 
*pdev_name, int pdev_id,
od-pdev.num_resources = res_count;
od-pdev.resource = res;
 
-	platform_device_add_data(od-pdev, pdata, pdata_len);

+   ret = platform_device_add_data(od-pdev, pdata, pdata_len);
+   if (ret)
+   goto odbs_exit4;
 
 	od-pm_lats = pm_lats;

od-pm_lats_cnt = pm_lats_cnt;



--
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


[PM-SR][PATCH 1/2 v2] omap3: sr: fix memory leak and simplify the code

2010-07-09 Thread Nishanth Menon
From: Artem Bityutskiy artem.bityuts...@nokia.com

This patch fixes the following problem indicated by kmemleak:

kmemleak: unreferenced object 0xdf93c280 (size 64):
kmemleak:   backtrace:
kmemleak: [c00df6d4] create_object+0x104/0x200
kmemleak: [c00d7638] kmem_cache_alloc+0xe4/0xf4
kmemleak: [c000fc38] omap_devinit_smartreflex+0x44/0x244
kmemleak: [c003a33c] do_one_initcall+0x5c/0x1b8
kmemleak: [c00083fc] kernel_init+0x94/0x110
kmemleak: [c003ba04] kernel_thread_exit+0x0/0x8

The reason is that 'omap_devinit_smartreflex()' allocates 'sr_data',
then passes it to 'omap_device_build()', which 'kmemdup()'s it and
uses the copy. But 'omap_devinit_smartreflex()' never frees 'sr_data'.

This patch make 'sr_data' to be a stack variable, which eliminates
the memory leak and simplifies the code a bit.

Cc: Kevin Hilman khil...@deeprootsystems.com
Cc: Thara Gopinath th...@ti.com,
Cc: Peter p2 De Schrijver peter.de-schrij...@nokia.com
Cc: Nishanth Menon n...@ti.com

Signed-off-by: Artem Bityutskiy artem.bityuts...@nokia.com
Acked-by: Nishanth Menon n...@ti.com
---
Changes from V1:
rebased to latest pm-sr branch
default of sr_data set to 0 to make it equivalent to kzalloc

NOTE: this probably should be squashed when being send upstream along with
rest of SR series

 arch/arm/mach-omap2/sr_device.c |   27 +--
 1 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index dbf7603..ecc9910 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -116,19 +116,12 @@ static void __init sr_set_nvalues(struct omap_sr_dev_data 
*dev_data,
 
 static int sr_dev_init(struct omap_hwmod *oh, void *user)
 {
-   struct omap_sr_data *sr_data;
+   struct omap_sr_data sr_data = {0};
struct omap_sr_dev_data *sr_dev_data;
struct omap_device *od;
char *name = smartreflex;
static int i;
 
-   sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL);
-   if (!sr_data) {
-   pr_err(%s: Unable to allocate memory for %s sr_data.Error!\n,
-   __func__, oh-name);
-   return -ENOMEM;
-   }
-
sr_dev_data = (struct omap_sr_dev_data *)oh-dev_attr;
/*
 * OMAP3430 ES3.1 chips by default come with Efuse burnt
@@ -139,32 +132,30 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 */
if (cpu_is_omap343x()) {
if (omap_rev() == OMAP3430_REV_ES3_1)
-   sr_data-enable_on_init = true;
+   sr_data.enable_on_init = true;
else
-   sr_data-enable_on_init = false;
+   sr_data.enable_on_init = false;
} else {
-   sr_data-enable_on_init = false;
+   sr_data.enable_on_init = false;
}
-   sr_data-device_enable = omap_device_enable;
-   sr_data-device_shutdown = omap_device_shutdown;
-   sr_data-device_idle = omap_device_idle;
+   sr_data.device_enable = omap_device_enable;
+   sr_data.device_shutdown = omap_device_shutdown;
+   sr_data.device_idle = omap_device_idle;
sr_dev_data-volts_supported = omap_get_voltage_table(i,
sr_dev_data-volt_data);
if (!sr_dev_data-volts_supported) {
pr_warning(%s: No Voltage table registerd fo VDD%d.Something \
really wrong\n\n, __func__, i + 1);
i++;
-   kfree(sr_data);
return 0;
}
-   sr_set_nvalues(sr_dev_data, sr_data);
-   od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
+   sr_set_nvalues(sr_dev_data, sr_data);
+   od = omap_device_build(name, i, oh, sr_data, sizeof(sr_data),
   omap_sr_latency,
   ARRAY_SIZE(omap_sr_latency), 0);
if (IS_ERR(od)) {
pr_warning(%s: Could not build omap_device for %s: %s.\n\n,
__func__, name, oh-name);
-   kfree(sr_data);
}
i++;
return 0;
-- 
1.6.3.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


RE: [PATCH 2/2] omap3: sr: improve errors handling

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-07-09 at 20:35 +0530, Gopinath, Thara wrote:
 
 -Original Message-
 From: Artem Bityutskiy [mailto:dedeki...@gmail.com]
 Sent: Friday, July 09, 2010 6:50 PM
 To: linux-omap@vger.kernel.org
 Cc: Menon, Nishanth; Kevin Hilman; Gopinath, Thara; Peter p2 De Schrijver
 Subject: [PATCH 2/2] omap3: sr: improve errors handling
 
 From: Artem Bityutskiy artem.bityuts...@nokia.com
 
 Do not forget to check the 'platform_device_add_data()' error code
 in 'omap_device_build_ss()'.
 
 Hello Artem,
 
 Can we have a better subject and description. The subject esp has got
 nothing to do with the fix.

Hmm, I do not see why you think so. I think the subject is fine - the
patch improves error handling in the SR code. Then description says how
exactly it improves it - it makes the code to not forget to check the
return code, and it tells in which function and which return code.

So the logic is:

1. The subject line is a short description which gives the idea what the
commit is about. So, my subject line says:
  1.1. It is about omap3 (which is true)
  1.2. It is about sr (which is true)
  1.3. It improves error handling (which is also true)

So the subject line is descriptive enough. It does not have to provide
all glory details.

Then the description provides the details.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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/2] omap3: sr: improve errors handling

2010-07-09 Thread Nishanth Menon

Artem Bityutskiy had written, on 07/09/2010 10:44 AM, the following:

On Fri, 2010-07-09 at 20:35 +0530, Gopinath, Thara wrote:

-Original Message-
From: Artem Bityutskiy [mailto:dedeki...@gmail.com]
Sent: Friday, July 09, 2010 6:50 PM
To: linux-omap@vger.kernel.org
Cc: Menon, Nishanth; Kevin Hilman; Gopinath, Thara; Peter p2 De Schrijver
Subject: [PATCH 2/2] omap3: sr: improve errors handling

From: Artem Bityutskiy artem.bityuts...@nokia.com

Do not forget to check the 'platform_device_add_data()' error code
in 'omap_device_build_ss()'.

Hello Artem,

Can we have a better subject and description. The subject esp has got
nothing to do with the fix.


Hmm, I do not see why you think so. I think the subject is fine - the
patch improves error handling in the SR code. Then description says how
exactly it improves it - it makes the code to not forget to check the
return code, and it tells in which function and which return code.

So the logic is:

1. The subject line is a short description which gives the idea what the
commit is about. So, my subject line says:
  1.1. It is about omap3 (which is true)
  1.2. It is about sr (which is true)
I think Thara's contention is that this is omap_device related- yeah SR 
is one of the users of omap_device, but there are much more folks using 
omap_device in l-o today.



  1.3. It improves error handling (which is also true)

So the subject line is descriptive enough. It does not have to provide
all glory details.

Then the description provides the details.




--
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 2/2] omap3: sr: improve errors handling

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-07-09 at 10:51 -0500, Nishanth Menon wrote:
  So the logic is:
  
  1. The subject line is a short description which gives the idea what the
  commit is about. So, my subject line says:
1.1. It is about omap3 (which is true)
1.2. It is about sr (which is true)
 I think Thara's contention is that this is omap_device related- yeah SR 
 is one of the users of omap_device, but there are much more folks using 
 omap_device in l-o today.

I see. I'll try to come up with a better prefix, but if you suggest me a
good subject line, I'll be grateful :-)

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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/2] omap3: sr: improve errors handling

2010-07-09 Thread Menon, Nishanth
 -Original Message-
 From: Artem Bityutskiy [mailto:dedeki...@gmail.com]
 Sent: Friday, July 09, 2010 10:51 AM
 
 On Fri, 2010-07-09 at 10:51 -0500, Nishanth Menon wrote:
   So the logic is:
  
   1. The subject line is a short description which gives the idea what
 the
   commit is about. So, my subject line says:
 1.1. It is about omap3 (which is true)
 1.2. It is about sr (which is true)
  I think Thara's contention is that this is omap_device related- yeah SR
  is one of the users of omap_device, but there are much more folks using
  omap_device in l-o today.
 
 I see. I'll try to come up with a better prefix, but if you suggest me a
 good subject line, I'll be grateful :-)

Subject: omap: device: improve errors handling

Do not forget to check the 'platform_device_add_data()' error code
in 'omap_device_build_ss()'.

How does that sound?

N�r��yb�X��ǧv�^�)޺{.n�+{��f��{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

RE: [PATCH 2/2] omap3: sr: improve errors handling

2010-07-09 Thread Artem Bityutskiy
On Fri, 2010-07-09 at 11:00 -0500, Menon, Nishanth wrote:
  -Original Message-
  From: Artem Bityutskiy [mailto:dedeki...@gmail.com]
  Sent: Friday, July 09, 2010 10:51 AM
  
  On Fri, 2010-07-09 at 10:51 -0500, Nishanth Menon wrote:
So the logic is:
   
1. The subject line is a short description which gives the idea what
  the
commit is about. So, my subject line says:
  1.1. It is about omap3 (which is true)
  1.2. It is about sr (which is true)
   I think Thara's contention is that this is omap_device related- yeah SR
   is one of the users of omap_device, but there are much more folks using
   omap_device in l-o today.
  
  I see. I'll try to come up with a better prefix, but if you suggest me a
  good subject line, I'll be grateful :-)
 
 Subject: omap: device: improve errors handling
 
 Do not forget to check the 'platform_device_add_data()' error code
 in 'omap_device_build_ss()'.
 
 How does that sound?

Good, thank you! I'll re-send the patch tomorrow unless you change the
subject yourself :-)

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
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/5] omap: Implement common omap_has_feature

2010-07-09 Thread Nishanth Menon

Tony Lindgren had written, on 07/09/2010 02:08 AM, the following:

* Nishanth Menon n...@ti.com [100708 17:46]:

Tony Lindgren had written, on 07/08/2010 04:37 AM, the following:

@@ -112,6 +114,12 @@ void omap_get_die_id(struct omap_die_id *odi)
odi-id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
}
+u32 omap2_has_feature(u32 feat_mask)
+{
+   /* REVISIT: Add necessary omap2 feature tests here */
+   return ((feat_mask  omap_features) == feat_mask);
+}
+

I did consider this path initially,
a) Additional functional call overhead here. some of the calls to
has_feature() will get called through pretty active paths, we would
like it to be minimized to compile time optimized inline function as
much as possible.(no reason why this cant me a inline macro in
cpu.h?) -


Well it should not matter how slow this code is, it should only be
used to initialize things during __init.

Any code doing detection after initialization is wrong.

couple of reasons why this may not make sense:
a) drivers can be modules -e.g. lets say dss driver would like to know 
if vrfb OR tiler is used - __init wont make sense
b) has_feature could be used as part of data flow to make decision what 
is to be done.


e.g.

lets say dma chaining as a feature OR dma list as a feature, we should 
allow for usage such as the following:

int chain_dma(...)
{
if (!omap_has_feature(OMAP_HAS_DMA_CHAINING)) {
return -EINVAL;
}
}

this means that we would prefer these kind of path to be high 
performance paths (data paths) - aka inline functions make more sense 
than incurring a function call overhead.


--
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 5/5] omap: Allow testing for omap type with omap_has_feature

2010-07-09 Thread Nishanth Menon

Tony Lindgren had written, on 07/09/2010 02:04 AM, the following:

* Nishanth Menon n...@ti.com [100708 22:31]:

   I think this 'lazy reviewability'  comes at the cost of very
abstraction  the features framework is intended to provide, not to
mention the question of correct selection (is this a OMAP4 specific
feature or is OMAP5 expected to have it ?). and upgradation.

   As mentioned before, the surrounding context of the use of
omap_has_feature() will provide enough clues about the cpu specific
nature of a feature, if at all needed.

Does it really? when a new feature is added, dont we want to know if
it is generic feature or a omap specific feature? where is the flag?


Yeah I don't know what we should do with these defines.. Kind of just
threw the patch out there.

If we already have omap specific omap_has_feature functions, we don't
need cpu_is_omap in most cases.

I suggest we only use the generic defines now, then look at it again
when we run out of the bits to define.

ack.

--
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 1/2] musb: Kill board specific pinmux from driver file

2010-07-09 Thread Greg KH
On Fri, Jul 09, 2010 at 11:15:33AM +0300, Tony Lindgren wrote:
 * Ajay Kumar Gupta ajay.gu...@ti.com [100708 13:59]:
  From: Anand Gadiyar gadi...@ti.com
  
  This pin-muxing is best done in the board files. The driver should
  not do this explicitly.
  
  Also, this code causes a warning to be thrown when OMAP2430 and OMAP3/4
  support are enabled in the same kernel.
  
  Signed-off-by: Anand Gadiyar gadi...@ti.com
  Acked-by: Felipe Balbi felipe.ba...@nokia.com
  Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com
 
 Acked-by: Tony Lindgren t...@atomide.com

Thanks, I've added this to the patch.

greg k-h

 
  ---
   drivers/usb/musb/omap2430.c |6 --
   1 files changed, 0 insertions(+), 6 deletions(-)
  
  diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
  index e06d65e..2111a24 100644
  --- a/drivers/usb/musb/omap2430.c
  +++ b/drivers/usb/musb/omap2430.c
  @@ -32,8 +32,6 @@
   #include linux/clk.h
   #include linux/io.h
   
  -#include plat/mux.h
  -
   #include musb_core.h
   #include omap2430.h
   
  @@ -194,10 +192,6 @@ int __init musb_platform_init(struct musb *musb, void 
  *board_data)
  u32 l;
  struct omap_musb_board_data *data = board_data;
   
  -#if defined(CONFIG_ARCH_OMAP2430)
  -   omap_cfg_reg(AE5_2430_USB0HS_STP);
  -#endif
  -
  /* We require some kind of external transceiver, hooked
   * up through ULPI.  TWL4030-family PMICs include one,
   * which needs a driver, drivers aren't always needed.
  -- 
  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
--
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


HTC Dream drivers was Re: [linux-pm] suspend blockers Android integration

2010-07-09 Thread Pavel Machek
Hi!


  So for people who really care about running a mainline kernel on their
  android device doing that part first on a generic ARM board in qemu
  might be much better first step work.
 
  On the other hand I've heard
  that various hardware vendors or parties closed to them are rather
  annoyed by their drivers beeing stuck in the android tree - but that
  can be easily solved by getting removing the suspend blockers (at least
  temporarily), cleaning up a few bits here and there and getting them in.
 
 This continues to baffle me.  If we (Google) are such a headache, why
 not just route around us.  The drivers we've written are GPLv2, the

Well, we did route around you, and that's why the HTC Dream drivers
are in
staging.

Unfortunately...

 source is out there for anyone who wants it, etc.  The drivers other
 people have written we have no control over at all. From my point of
 view it'd be an annoyance if somebody took the code we wrote, modified
 it heavily, and pushed it upstream, but fundamentally I can't stop
 that from happening other than by pushing it upstream myself, first.

...you were calling bloody murder when we tried to name them right way
-- thats board_dream, not board_trout -- and AFAIK you still did not
switch to actually using those drivers so that diffs would grow
smaller...

And no, it is not 'just arm architecture #1536'; due to strange
baseband/cpu split in msm drivers end up quite bigcomplex...

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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


Re: [Regression] ads7846.c touchscreen controller driver reports wrong X,Y values

2010-07-09 Thread Steve Sakoman
On Tue, May 25, 2010 at 8:54 AM, Mickael Chazaux
mickael.chaz...@gmail.com wrote:
 Hi,

 I am working on adding the support of an omap3 based board in the
 kernel. This board uses an ADS7843 touchscreen controller, on the SPI
 bus. The in-kernel driver (drivers/input/touchscreen/ads7646.c) works
 fine with the 2.6.33 kernel. When updating to the 2.6.34 kernel the
 values reported by the driver were garbage. I had to revert this
 commit [1] to make it work again. Can someone confirm that this driver
 still works with other OMAP boards?

 [1] a330ce2001b290c59fe98c37e981683ef0a75fdf

I can confirm that the above patch also breaks the ADS7846 driver on
Overo.  Reverting it results in correct operation.

Steve





 Regards,

 Mickael

 Adeneo Embedded - Adetel Group
 2, chemin du Ruisseau
 69134 ECULLY - FRANCE
 Tél. : +33 (0)4 72 18 08 40 - Fax : +33 (0)4 72 18 08 41
 --
 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] staging: ti dspbridge: fix compilation error

2010-07-09 Thread Rene Sapiens
This patch fix a compilation error in uuid_hex_to_bin
due to the patch simplify and clean up

Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/gen/uuidutil.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/gen/uuidutil.c

diff --git a/drivers/staging/tidspbridge/gen/uuidutil.c 
b/drivers/staging/tidspbridge/gen/uuidutil.c
index eb09bc3..070761b
--- a/drivers/staging/tidspbridge/gen/uuidutil.c
+++ b/drivers/staging/tidspbridge/gen/uuidutil.c
@@ -58,6 +58,7 @@ static s32 uuid_hex_to_bin(char *buf, s32 len)
 {
s32 i;
s32 result = 0;
+   int value;
 
for (i = 0; i  len; i++) {
value = hex_to_bin(*buf++);
-- 
1.6.3.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] OMAP3630: Add ES1.1 and ES1.2 detection

2010-07-09 Thread Anand Gadiyar
Add revision detection for ES1.1 and ES1.2. Set default
revision as ES1.2.

Add CHIP_GE_OMAP3630ES1_1 to detect revisions 1.1 and later.
This is needed for at least one feature that is broken in
3630ES1.0 but exists on older (3430 ES3.1) and newer revisions.

Additionally, update some of the CHIP_GE_* macros to use other
macros for ease of maintenance.

Signed-off-by: Anand Gadiyar gadi...@ti.com
Cc: Nishanth Menon n...@ti.com
Cc: Manjunatha GK manj...@ti.com
Cc: Tony Lindgren t...@atomide.com
---
This is based on Manju's original patch at [1] and my update [2].
The original patch failed to properly update the CHIP_GE_OMAP3630ES1 macro.

Would be nice to get this queued for the next merge window

[1] https://patchwork.kernel.org/patch/95684/
[2] https://patchwork.kernel.org/patch/99590/

 arch/arm/mach-omap2/id.c  |   27 +++
 arch/arm/plat-omap/include/plat/cpu.h |   15 +++
 2 files changed, 34 insertions(+), 8 deletions(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/id.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/id.c
+++ linux-omap-2.6/arch/arm/mach-omap2/id.c
@@ -269,11 +269,24 @@ void __init omap3_check_revision(void)
omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
break;
case 0xb891:
-   /* FALLTHROUGH */
-   default:
-   /* Unknown default to latest silicon rev as default*/
-   omap_revision = OMAP3630_REV_ES1_0;
+   /* Handle 36xx devices */
omap_chip.oc |= CHIP_IS_OMAP3630ES1;
+
+   switch(rev) {
+   case 0: /* Take care of early samples */
+   omap_revision = OMAP3630_REV_ES1_0;
+   break;
+   case 1:
+   omap_revision = OMAP3630_REV_ES1_1;
+   omap_chip.oc |= CHIP_IS_OMAP3630ES1_1;
+   break;
+   case 2:
+   /* Fall through */
+   default:
+   /* Use the latest known revision as default */
+   omap_revision =  OMAP3630_REV_ES1_2;
+   omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
+   }
}
 }
 
@@ -349,6 +362,12 @@ void __init omap3_cpuinfo(void)
case OMAP_REVBITS_00:
strcpy(cpu_rev, 1.0);
break;
+   case OMAP_REVBITS_01:
+   strcpy(cpu_rev, 1.1);
+   break;
+   case OMAP_REVBITS_02:
+   strcpy(cpu_rev, 1.2);
+   break;
case OMAP_REVBITS_10:
strcpy(cpu_rev, 2.0);
break;
Index: linux-omap-2.6/arch/arm/plat-omap/include/plat/cpu.h
===
--- linux-omap-2.6.orig/arch/arm/plat-omap/include/plat/cpu.h
+++ linux-omap-2.6/arch/arm/plat-omap/include/plat/cpu.h
@@ -66,6 +66,8 @@ unsigned int omap_rev(void);
  * family. This difference can be handled separately.
  */
 #define OMAP_REVBITS_000x00
+#define OMAP_REVBITS_010x01
+#define OMAP_REVBITS_020x02
 #define OMAP_REVBITS_100x10
 #define OMAP_REVBITS_200x20
 #define OMAP_REVBITS_300x30
@@ -376,6 +378,8 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3430_REV_ES3_1_2   0x34305034
 
 #define OMAP3630_REV_ES1_0 0x36300034
+#define OMAP3630_REV_ES1_1 0x36300134
+#define OMAP3630_REV_ES1_2 0x36300234
 
 #define OMAP35XX_CLASS 0x3534
 #define OMAP3503_REV(v)(OMAP35XX_CLASS | (0x3503  16) | (v 
 8))
@@ -411,6 +415,8 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define CHIP_IS_OMAP3430ES3_1  (1  6)
 #define CHIP_IS_OMAP3630ES1(1  7)
 #define CHIP_IS_OMAP4430ES1(1  8)
+#define CHIP_IS_OMAP3630ES1_1   (1  9)
+#define CHIP_IS_OMAP3630ES1_2   (1  10)
 
 #define CHIP_IS_OMAP24XX   (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
 
@@ -424,11 +430,12 @@ IS_OMAP_TYPE(3517, 0x3517)
  */
 #define CHIP_GE_OMAP3430ES2(CHIP_IS_OMAP3430ES2 | \
 CHIP_IS_OMAP3430ES3_0 | \
-CHIP_IS_OMAP3430ES3_1 | \
-CHIP_IS_OMAP3630ES1)
+CHIP_GE_OMAP3430ES3_1)
 #define CHIP_GE_OMAP3430ES3_1  (CHIP_IS_OMAP3430ES3_1 | \
-CHIP_IS_OMAP3630ES1)
-
+CHIP_IS_OMAP3630ES1 | \
+CHIP_GE_OMAP3630ES1_1)
+#define CHIP_GE_OMAP3630ES1_1  (CHIP_IS_OMAP3630ES1_1 | \
+CHIP_IS_OMAP3630ES1_2)
 
 int omap_chip_is(struct omap_chip_id oci);
 void omap2_check_revision(void);
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to 

[PATCH resend] omap: 3630: disable TLL SAR on 3630 ES1

2010-07-09 Thread Anand Gadiyar
USBTLL Save-and-Restore is broken in 3630 ES1.0. Having it
enabled could result in incorrect register restores as
the OMAP exits off-mode. This could potentially result in
unexpected wakeup events.

This is fixed in ES1.1. So disable it for ES1.0s.

Signed-off-by: Anand Gadiyar gadi...@ti.com
Cc: Paul Walmsley p...@pwsan.com
---
This is a fix for buggy hardware, and it would be nice
to see this in the next merge window too.

Depends on the patch I just posted which adds the
CHIP_GE_OMAP3630ES1_1 macro
https://patchwork.kernel.org/patch/47/

 arch/arm/mach-omap2/powerdomains34xx.h |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/powerdomains34xx.h
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/powerdomains34xx.h
+++ linux-omap-2.6/arch/arm/mach-omap2/powerdomains34xx.h
@@ -80,7 +80,8 @@ static struct powerdomain core_3xxx_pre_
.prcm_offs= CORE_MOD,
.omap_chip= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
   CHIP_IS_OMAP3430ES2 |
-  CHIP_IS_OMAP3430ES3_0),
+  CHIP_IS_OMAP3430ES3_0 |
+  CHIP_IS_OMAP3630ES1),
.pwrsts   = PWRSTS_OFF_RET_ON,
.pwrsts_logic_ret = PWRSTS_OFF_RET,
.banks= 2,
@@ -97,7 +98,8 @@ static struct powerdomain core_3xxx_pre_
 static struct powerdomain core_3xxx_es3_1_pwrdm = {
.name = core_pwrdm,
.prcm_offs= CORE_MOD,
-   .omap_chip= OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES3_1),
+   .omap_chip= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 |
+ CHIP_GE_OMAP3630ES1_1),
.pwrsts   = PWRSTS_OFF_RET_ON,
.pwrsts_logic_ret = PWRSTS_OFF_RET,
.flags= PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
--
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] staging: ti dspbridge: fix compilation error

2010-07-09 Thread Andy Shevchenko
On Sat, Jul 10, 2010 at 1:48 AM, Rene Sapiens rene.sapi...@ti.com wrote:
 This patch fix a compilation error in uuid_hex_to_bin
 due to the patch simplify and clean up

 Signed-off-by: Rene Sapiens rene.sapi...@ti.com
Oh, previous version of patch was sent. Thanks for fix.

ACK.

 ---
  drivers/staging/tidspbridge/gen/uuidutil.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
  mode change 100644 = 100755 drivers/staging/tidspbridge/gen/uuidutil.c

 diff --git a/drivers/staging/tidspbridge/gen/uuidutil.c 
 b/drivers/staging/tidspbridge/gen/uuidutil.c
 index eb09bc3..070761b
 --- a/drivers/staging/tidspbridge/gen/uuidutil.c
 +++ b/drivers/staging/tidspbridge/gen/uuidutil.c
 @@ -58,6 +58,7 @@ static s32 uuid_hex_to_bin(char *buf, s32 len)
  {
        s32 i;
        s32 result = 0;
 +       int value;

        for (i = 0; i  len; i++) {
                value = hex_to_bin(*buf++);
 --
 1.6.3.3





-- 
With Best Regards,
Andy Shevchenko
--
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 01/15] staging:ti dspbridge: Rename words with camel case.

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

dspAddr to dsp_address
dspAdr to dsp_adr
dspBaseVirt to dsp_base_virt
dwDeviceContext to device_context
dwDSPAddrOffset to dsp_addr_offset
dwDSPAddr to dsp_addr
dwErrInfo to error_info
dwGPPBaseBA to gpp_base_ba
dwMask to mask
dwTimeout to timeout
dwTimeOut to timeout
dwValue to value
entryNum to entry_num
execFile to exec_file
fFlush to flush_data
FlushMemType to flush_mem_type


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |   28 ++--
 drivers/staging/tidspbridge/core/io_sm.c   |8 ++--
 drivers/staging/tidspbridge/core/tiomap3430.c  |   44 ++--
 drivers/staging/tidspbridge/core/tiomap_io.c   |   24 +-
 drivers/staging/tidspbridge/core/tiomap_io.h   |   14 +++---
 drivers/staging/tidspbridge/hw/hw_mmu.c|4 +-
 drivers/staging/tidspbridge/hw/hw_mmu.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cfg.h|8 ++--
 .../staging/tidspbridge/include/dspbridge/cmm.h|6 +-
 .../tidspbridge/include/dspbridge/dbldefs.h|9 ++--
 .../tidspbridge/include/dspbridge/dblldefs.h   |8 ++--
 .../staging/tidspbridge/include/dspbridge/dev.h|2 +-
 .../tidspbridge/include/dspbridge/dspchnl.h|6 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|   44 ++--
 .../staging/tidspbridge/include/dspbridge/dspdrv.h |6 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |   12 +++---
 .../staging/tidspbridge/include/dspbridge/rmm.h|   14 +++---
 .../staging/tidspbridge/include/dspbridge/strm.h   |8 ++--
 drivers/staging/tidspbridge/pmgr/cmm.c |8 ++--
 drivers/staging/tidspbridge/rmgr/disp.c|8 ++--
 drivers/staging/tidspbridge/rmgr/nldr.c|   27 ++--
 drivers/staging/tidspbridge/rmgr/proc.c|6 +-
 drivers/staging/tidspbridge/rmgr/rmm.c |   14 +++---
 drivers/staging/tidspbridge/rmgr/strm.c|9 ++--
 drivers/staging/tidspbridge/services/cfg.c |   10 ++--
 25 files changed, 166 insertions(+), 163 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 714b6f7..362e01e 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -479,7 +479,7 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr)
  *  purpose:
  *  Flushes all the outstanding data requests on a channel.
  */
-int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 dwTimeOut)
+int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout)
 {
int status = 0;
struct chnl_object *pchnl = (struct chnl_object *)chnl_obj;
@@ -488,7 +488,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 
dwTimeOut)
struct chnl_ioc chnl_ioc_obj;
/* Check args: */
if (pchnl) {
-   if ((dwTimeOut == CHNL_IOCNOWAIT)
+   if ((timeout == CHNL_IOCNOWAIT)
 CHNL_IS_OUTPUT(pchnl-chnl_mode)) {
status = -EINVAL;
} else {
@@ -509,7 +509,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 
dwTimeOut)
while (!LST_IS_EMPTY(pchnl-pio_requests) 
   DSP_SUCCEEDED(status)) {
status = bridge_chnl_get_ioc(chnl_obj,
-   dwTimeOut, chnl_ioc_obj);
+   timeout, chnl_ioc_obj);
if (DSP_FAILED(status))
continue;
 
@@ -566,7 +566,7 @@ int bridge_chnl_get_info(struct chnl_object *chnl_obj,
  *  I/O request.
  *  Note: Ensures Channel Invariant (see notes above).
  */
-int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 dwTimeOut,
+int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
OUT struct chnl_ioc *pIOC)
 {
int status = 0;
@@ -582,7 +582,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 
dwTimeOut,
/* Check args: */
if (!pIOC || !pchnl) {
status = -EFAULT;
-   } else if (dwTimeOut == CHNL_IOCNOWAIT) {
+   } else if (timeout == CHNL_IOCNOWAIT) {
if (LST_IS_EMPTY(pchnl-pio_completions))
status = -EREMOTEIO;
 
@@ -597,12 +597,12 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 
dwTimeOut,
goto func_end;
 
ioc.status = CHNL_IOCSTATCOMPLETE;
-   if (dwTimeOut !=
+   if (timeout !=
CHNL_IOCNOWAIT  

[PATCH 06/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

phDevContext to device_ctx
phDevNode to dev_nde
phDevObject to device_obj
phDispObject to dispatch_obj
phDmmMgr to dmm_manager
phDrvObject to drv_obj
phDRVObject to drv_obj
phIOMgr to io_man
phLoader to loader
phManager to manager
phMgrObject to mgr_obj
phMgr to mgr
phMsgMgr to msg_man
phMsgQueue to msgq
phNldrNode to nldr_nodeobj


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/io_sm.c   |   10 +-
 drivers/staging/tidspbridge/core/msg_sm.c  |   16 ++--
 .../staging/tidspbridge/include/dspbridge/cfg.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|   10 +-
 .../staging/tidspbridge/include/dspbridge/dev.h|   82 ++--
 .../staging/tidspbridge/include/dspbridge/disp.h   |   10 +-
 .../staging/tidspbridge/include/dspbridge/dmm.h|4 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|   18 ++--
 .../tidspbridge/include/dspbridge/dspdefs.h|   26 +++---
 .../staging/tidspbridge/include/dspbridge/dspio.h  |2 +-
 .../staging/tidspbridge/include/dspbridge/dspmsg.h |4 +-
 drivers/staging/tidspbridge/include/dspbridge/io.h |4 +-
 .../staging/tidspbridge/include/dspbridge/mgr.h|6 +-
 .../staging/tidspbridge/include/dspbridge/msg.h|6 +-
 .../staging/tidspbridge/include/dspbridge/nldr.h   |2 +-
 .../tidspbridge/include/dspbridge/nldrdefs.h   |   10 +-
 .../staging/tidspbridge/include/dspbridge/proc.h   |   14 ++--
 drivers/staging/tidspbridge/pmgr/cod.c |   14 ++--
 drivers/staging/tidspbridge/pmgr/dev.c |   74 +-
 drivers/staging/tidspbridge/pmgr/dmm.c |   14 ++--
 drivers/staging/tidspbridge/pmgr/io.c  |8 +-
 drivers/staging/tidspbridge/pmgr/msg.c |8 +-
 drivers/staging/tidspbridge/rmgr/disp.c|   12 ++--
 drivers/staging/tidspbridge/rmgr/drv.c |   14 ++--
 drivers/staging/tidspbridge/rmgr/mgr.c |6 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   12 ++--
 drivers/staging/tidspbridge/rmgr/proc.c|   12 ++--
 27 files changed, 200 insertions(+), 200 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/rmgr/drv.c

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 81b81e1..7f34510 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -161,7 +161,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr,
  *   bridge_io_create 
  *  Create an IO manager object.
  */
-int bridge_io_create(OUT struct io_mgr **phIOMgr,
+int bridge_io_create(OUT struct io_mgr **io_man,
struct dev_object *hdev_obj,
IN CONST struct io_attrs *pMgrAttrs)
 {
@@ -174,7 +174,7 @@ int bridge_io_create(OUT struct io_mgr **phIOMgr,
u8 dev_type;
 
/* Check requirements */
-   if (!phIOMgr || !pMgrAttrs || pMgrAttrs-word_size == 0) {
+   if (!io_man || !pMgrAttrs || pMgrAttrs-word_size == 0) {
status = -EFAULT;
goto func_end;
}
@@ -243,12 +243,12 @@ func_end:
if (DSP_FAILED(status)) {
/* Cleanup */
bridge_io_destroy(pio_mgr);
-   if (phIOMgr)
-   *phIOMgr = NULL;
+   if (io_man)
+   *io_man = NULL;
} else {
/* Return IO manager object to caller... */
hchnl_mgr-hio_mgr = pio_mgr;
-   *phIOMgr = pio_mgr;
+   *io_man = pio_mgr;
}
return status;
 }
diff --git a/drivers/staging/tidspbridge/core/msg_sm.c 
b/drivers/staging/tidspbridge/core/msg_sm.c
index 0a68df9..22e1898 100644
--- a/drivers/staging/tidspbridge/core/msg_sm.c
+++ b/drivers/staging/tidspbridge/core/msg_sm.c
@@ -48,7 +48,7 @@ static void free_msg_list(struct lst_list *msg_list);
  *  Create an object to manage message queues. Only one of these objects
  *  can exist per device object.
  */
-int bridge_msg_create(OUT struct msg_mgr **phMsgMgr,
+int bridge_msg_create(OUT struct msg_mgr **msg_man,
 struct dev_object *hdev_obj,
 msg_onexit msg_callback)
 {
@@ -56,7 +56,7 @@ int bridge_msg_create(OUT struct msg_mgr **phMsgMgr,
struct io_mgr *hio_mgr;
int status = 0;
 
-   if (!phMsgMgr || !msg_callback || !hdev_obj) {
+   if (!msg_man || !msg_callback || !hdev_obj) {
status = -EFAULT;
goto func_end;
}
@@ -65,7 +65,7 @@ int bridge_msg_create(OUT struct msg_mgr **phMsgMgr,
  

[PATCH 13/15] staging:ti dspbridge: Rename words with camel case.

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

ulBrdState to brd_state
ulChnl to chnl
ulDspAddr to dsp_add
ulDspDestAddr to dsp_dest_addr
ulDspLoadAddr to dsp_load_addr
ulDspRunAddr to dsp_run_addr
ulDspSrcAddr to dsp_src_addr
ulMapAttrs to map_attr
ulMemType to mem_type
ulRMSFxn to rms_fxn
ulStatus to ret
ulVirtAddr to virt_addr
uNumDesc to num_desc
uNumToDSP to num_to_dsp
uPaSize to pa_size
uPhase to phase
uSegId to segm_id
uStream1 to stream1
uStream2 to stream2
uZId to zid


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/io_sm.c   |4 +-
 drivers/staging/tidspbridge/core/msg_sm.c  |8 +-
 drivers/staging/tidspbridge/core/tiomap3430.c  |   74 +-
 drivers/staging/tidspbridge/core/tiomap_io.c   |6 +-
 drivers/staging/tidspbridge/core/tiomap_io.h   |6 +-
 .../staging/tidspbridge/include/dspbridge/cmm.h|   12 ++--
 .../staging/tidspbridge/include/dspbridge/cod.h|2 +-
 .../staging/tidspbridge/include/dspbridge/dev.h|8 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|   48 ++--
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |   14 ++--
 .../tidspbridge/include/dspbridge/nldrdefs.h   |   12 ++--
 .../staging/tidspbridge/include/dspbridge/node.h   |   14 ++--
 drivers/staging/tidspbridge/pmgr/cmm.c |   10 +-
 drivers/staging/tidspbridge/pmgr/dev.c |8 +-
 drivers/staging/tidspbridge/rmgr/disp.c|   16 ++--
 drivers/staging/tidspbridge/rmgr/node.c|   80 ++--
 16 files changed, 161 insertions(+), 161 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index a8ff5f9..0292881 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -816,7 +816,7 @@ u32 io_buf_size(struct io_mgr *hio_mgr)
  *   io_cancel_chnl 
  *  Cancel IO on a given PCPY channel.
  */
-void io_cancel_chnl(struct io_mgr *hio_mgr, u32 ulChnl)
+void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl)
 {
struct io_mgr *pio_mgr = (struct io_mgr *)hio_mgr;
struct shm *sm;
@@ -827,7 +827,7 @@ void io_cancel_chnl(struct io_mgr *hio_mgr, u32 ulChnl)
 
/* Inform DSP that we have no more buffers on this channel */
IO_AND_VALUE(pio_mgr-hbridge_context, struct shm, sm, host_free_mask,
-(~(1  ulChnl)));
+(~(1  chnl)));
 
sm_interrupt_dsp(pio_mgr-hbridge_context, MBX_PCPY_CLASS);
 func_end:
diff --git a/drivers/staging/tidspbridge/core/msg_sm.c 
b/drivers/staging/tidspbridge/core/msg_sm.c
index 22e1898..888d32d 100644
--- a/drivers/staging/tidspbridge/core/msg_sm.c
+++ b/drivers/staging/tidspbridge/core/msg_sm.c
@@ -40,7 +40,7 @@
 /*  --- Function Prototypes */
 static int add_new_msg(struct lst_list *msg_list);
 static void delete_msg_mgr(struct msg_mgr *hmsg_mgr);
-static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 uNumToDSP);
+static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp);
 static void free_msg_list(struct lst_list *msg_list);
 
 /*
@@ -602,7 +602,7 @@ func_end:
 /*
  *   delete_msg_queue 
  */
-static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 uNumToDSP)
+static void delete_msg_queue(struct msg_queue *msg_queue_obj, u32 num_to_dsp)
 {
struct msg_mgr *hmsg_mgr;
struct msg_frame *pmsg;
@@ -614,8 +614,8 @@ static void delete_msg_queue(struct msg_queue 
*msg_queue_obj, u32 uNumToDSP)
 
hmsg_mgr = msg_queue_obj-hmsg_mgr;
 
-   /* Pull off uNumToDSP message frames from Msg manager and free */
-   for (i = 0; i  uNumToDSP; i++) {
+   /* Pull off num_to_dsp message frames from Msg manager and free */
+   for (i = 0; i  num_to_dsp; i++) {
 
if (!LST_IS_EMPTY(hmsg_mgr-msg_free_list)) {
pmsg = (struct msg_frame *)
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index 0fdec37..8e3d92a 100755
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -78,7 +78,7 @@ static int bridge_brd_monitor(struct bridge_dev_context 
*dev_context);
 static int bridge_brd_read(struct bridge_dev_context *dev_context,
  OUT u8 *host_buff,
  u32 dsp_addr, u32 ul_num_bytes,
- u32 ulMemType);
+ u32 mem_type);
 static int bridge_brd_start(struct bridge_dev_context *dev_context,
   u32 dsp_addr);
 static int 

[PATCH 09/15] staging:ti dspbridge: Rename words with camel case.

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

pPhysAddr to phys_addr
pPhysicalAddress to physical_address
ppIntfFxns to if_fxns
pProcLoadStat to proc_load_stat
pProcStat to proc_lstat
ppSym to sym_val
pRefData to ref_data
pRef to ref
preservedBit to preserved_bit
pResult to result
procID to proc_id
pSectInfo to sect_inf
pSrc to src
pstrContent to str_content
pstrDummyFile to str_dummy_file
pstrExecFile to str_exec_file


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/io_sm.c   |   33 ++-
 drivers/staging/tidspbridge/hw/hw_mmu.c|   12 +++---
 drivers/staging/tidspbridge/hw/hw_mmu.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cfg.h|   10 +++---
 .../staging/tidspbridge/include/dspbridge/cod.h|8 ++--
 .../staging/tidspbridge/include/dspbridge/dbll.h   |4 +-
 .../tidspbridge/include/dspbridge/dblldefs.h   |   12 +++---
 .../staging/tidspbridge/include/dspbridge/dev.h|   10 +++---
 .../staging/tidspbridge/include/dspbridge/drv.h|   10 +++---
 .../staging/tidspbridge/include/dspbridge/dspapi.h |4 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|4 +-
 .../staging/tidspbridge/include/dspbridge/dspio.h  |2 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |6 ++--
 .../staging/tidspbridge/include/dspbridge/proc.h   |4 +-
 drivers/staging/tidspbridge/pmgr/cod.c |8 ++--
 drivers/staging/tidspbridge/pmgr/dbll.c|   14 
 drivers/staging/tidspbridge/pmgr/dev.c |   14 
 drivers/staging/tidspbridge/rmgr/drv.c |   18 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   22 ++--
 drivers/staging/tidspbridge/rmgr/proc.c|4 +-
 drivers/staging/tidspbridge/services/cfg.c |8 ++--
 21 files changed, 105 insertions(+), 104 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 5090ff1..6a8bdd2 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -148,9 +148,9 @@ static void output_msg(struct io_mgr *pio_mgr, struct 
msg_mgr *hmsg_mgr);
 static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj,
 struct chnl_object *pchnl, u32 mask);
 static u32 read_data(struct bridge_dev_context *dev_ctxt, void *dest,
-void *pSrc, u32 usize);
+void *src, u32 usize);
 static u32 write_data(struct bridge_dev_context *dev_ctxt, void *dest,
- void *pSrc, u32 usize);
+ void *src, u32 usize);
 
 /* Bus Addr (cached kernel) */
 static int register_shm_segs(struct io_mgr *hio_mgr,
@@ -919,9 +919,9 @@ static void io_dispatch_pm(struct io_mgr *pio_mgr)
  *  out the dispatch of I/O as a non-preemptible event.It can only be
  *  pre-empted  by an ISR.
  */
-void io_dpc(IN OUT unsigned long pRefData)
+void io_dpc(IN OUT unsigned long ref_data)
 {
-   struct io_mgr *pio_mgr = (struct io_mgr *)pRefData;
+   struct io_mgr *pio_mgr = (struct io_mgr *)ref_data;
struct chnl_mgr *chnl_mgr_obj;
struct msg_mgr *msg_mgr_obj;
struct deh_mgr *hdeh_mgr;
@@ -1702,9 +1702,9 @@ func_end:
  *  Copies buffers from the shared memory to the host buffer.
  */
 static u32 read_data(struct bridge_dev_context *dev_ctxt, void *dest,
-void *pSrc, u32 usize)
+void *src, u32 usize)
 {
-   memcpy(dest, pSrc, usize);
+   memcpy(dest, src, usize);
return usize;
 }
 
@@ -1713,9 +1713,9 @@ static u32 read_data(struct bridge_dev_context *dev_ctxt, 
void *dest,
  *  Copies buffers from the host side buffer to the shared memory.
  */
 static u32 write_data(struct bridge_dev_context *dev_ctxt, void *dest,
- void *pSrc, u32 usize)
+ void *src, u32 usize)
 {
-   memcpy(dest, pSrc, usize);
+   memcpy(dest, src, usize);
return usize;
 }
 
@@ -1793,20 +1793,21 @@ int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, 
void *pargs)
  *  Gets the Processor's Load information
  */
 int bridge_io_get_proc_load(IN struct io_mgr *hio_mgr,
-   OUT struct dsp_procloadstat *pProcStat)
+   OUT struct dsp_procloadstat *proc_lstat)
 {
-   pProcStat-curr_load = hio_mgr-shared_mem-load_mon_info.curr_dsp_load;
-   pProcStat-predicted_load =
+   proc_lstat-curr_load =
+   hio_mgr-shared_mem-load_mon_info.curr_dsp_load;
+   proc_lstat-predicted_load =
hio_mgr-shared_mem-load_mon_info.pred_dsp_load;
-   pProcStat-curr_dsp_freq =
+   

[PATCH 11/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

puLen to len
pulEntry to entry_pt
pulFxnAddr to fxn_addr
pulId to chan_id
pulSegId to sgmt_id
pVaBuf to va_buf
pVirtualAddress to virtual_address
pwMbVal to mbx_val
pWord to word
pXlatorAttrs to xlator_attrs
registerFxn to register_fxn
rootPersistent to root_prstnt
sectionData to section_data
sectionInfo to section_info
sectionName to section_name
sectName to sec_name


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/io_sm.c   |6 ++--
 drivers/staging/tidspbridge/dynload/getsection.c   |   24 ++--
 .../staging/tidspbridge/include/dspbridge/cmm.h|   20 
 .../staging/tidspbridge/include/dspbridge/cod.h|   16 ++--
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |4 +-
 .../staging/tidspbridge/include/dspbridge/dbll.h   |4 +-
 .../tidspbridge/include/dspbridge/dblldefs.h   |   10 
 .../staging/tidspbridge/include/dspbridge/drv.h|8 +++---
 .../tidspbridge/include/dspbridge/getsection.h |   16 ++--
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |6 ++--
 .../tidspbridge/include/dspbridge/nodepriv.h   |6 ++--
 drivers/staging/tidspbridge/pmgr/cmm.c |   22 +-
 drivers/staging/tidspbridge/pmgr/cod.c |   16 ++--
 drivers/staging/tidspbridge/pmgr/dbll.c|6 ++--
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |   12 +-
 drivers/staging/tidspbridge/rmgr/drv.c |6 ++--
 drivers/staging/tidspbridge/rmgr/nldr.c|   12 +-
 drivers/staging/tidspbridge/rmgr/node.c|   14 +-
 18 files changed, 104 insertions(+), 104 deletions(-)
 mode change 100644 = 100755 
drivers/staging/tidspbridge/include/dspbridge/dbll.h

diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 6a8bdd2..a8ff5f9 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -1014,12 +1014,12 @@ void io_mbox_msg(u32 msg)
  *  interrupts the DSP.
  */
 void io_request_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
-   u8 io_mode, OUT u16 *pwMbVal)
+   u8 io_mode, OUT u16 *mbx_val)
 {
struct chnl_mgr *chnl_mgr_obj;
struct shm *sm;
 
-   if (!pchnl || !pwMbVal)
+   if (!pchnl || !mbx_val)
goto func_end;
chnl_mgr_obj = pio_mgr-hchnl_mgr;
sm = pio_mgr-shared_mem;
@@ -1033,7 +1033,7 @@ void io_request_chnl(struct io_mgr *pio_mgr, struct 
chnl_object *pchnl,
/* Indicate to the DSP we have a buffer available for input */
IO_OR_VALUE(pio_mgr-hbridge_context, struct shm, sm,
host_free_mask, (1  pchnl-chnl_id));
-   *pwMbVal = MBX_PCPY_CLASS;
+   *mbx_val = MBX_PCPY_CLASS;
} else if (io_mode == IO_OUTPUT) {
/*
 * This assertion fails if CHNL_AddIOReq() was called on a
diff --git a/drivers/staging/tidspbridge/dynload/getsection.c 
b/drivers/staging/tidspbridge/dynload/getsection.c
index 029898f..3086118 100644
--- a/drivers/staging/tidspbridge/dynload/getsection.c
+++ b/drivers/staging/tidspbridge/dynload/getsection.c
@@ -226,8 +226,8 @@ void *dload_module_open(struct dynamic_loader_stream 
*module,
  *
  * Parameters:
  *  minfo  Handle from dload_module_open for this module
- * sectionName Pointer to the string name of the section desired
- * sectionInfo Address of a section info structure pointer to be
+ * section_namePointer to the string name of the section desired
+ * section_infoAddress of a section info structure pointer to be
  * initialized
  *
  * Effect:
@@ -237,8 +237,8 @@ void *dload_module_open(struct dynamic_loader_stream 
*module,
  * Returns:
  * true for success, false for section not found
  * */
-int dload_get_section_info(void *minfo, const char *sectionName,
-  const struct ldr_section_info **const sectionInfo)
+int dload_get_section_info(void *minfo, const char *section_name,
+  const struct ldr_section_info **const section_info)
 {
struct dload_state *dlthis;
struct ldr_section_info *shp;
@@ -250,8 +250,8 @@ int dload_get_section_info(void *minfo, const char 
*sectionName,
 
for (sec = 0; sec  dlthis-dfile_hdr.df_no_scns; sec++) {
shp = DOFFSEC_IS_LDRSEC(dlthis-sect_hdrs[sec]);
-   if (strcmp(sectionName, shp-name) == 0) {
-  

[PATCH 12/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

segmentId to segmnt_id
SetPageDirty to set_page_dirty
sizeInBytes to size_in_bytes
sleepCode to sleep_code
Status to status
symName to sym_name
szVar to sz_var
Trapped_Args to trapped_args
TTBPhysAddr to ttb_phys_addr
uChirps to chirps
uChnlId to ch_id
uChnlID to ch_id
uContentSize to cont_size
uDDMAChnlId to ddma_chnl_id
uEvents to events
ulAlign to align_mask


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |   30 +++---
 drivers/staging/tidspbridge/core/tiomap3430.c  |4 +-
 drivers/staging/tidspbridge/hw/hw_mmu.c|4 +-
 drivers/staging/tidspbridge/hw/hw_mmu.h|2 +-
 .../staging/tidspbridge/include/dspbridge/dbdefs.h |4 +-
 .../tidspbridge/include/dspbridge/dblldefs.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|4 +-
 .../tidspbridge/include/dspbridge/dspapi-ioctl.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/dspapi.h |  112 ++--
 .../tidspbridge/include/dspbridge/dspchnl.h|4 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|8 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |   20 ++--
 .../staging/tidspbridge/include/dspbridge/proc.h   |   12 +-
 .../staging/tidspbridge/include/dspbridge/pwr.h|6 +-
 drivers/staging/tidspbridge/pmgr/dspapi.c  |  116 ++--
 drivers/staging/tidspbridge/rmgr/drv.c |5 +-
 drivers/staging/tidspbridge/rmgr/drv_interface.c   |6 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   12 +-
 drivers/staging/tidspbridge/rmgr/proc.c|   18 ++--
 drivers/staging/tidspbridge/rmgr/pwr.c |6 +-
 20 files changed, 189 insertions(+), 188 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/rmgr/drv_interface.c

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 97eeda9..ac393b8 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -73,7 +73,7 @@
 #define MAILBOX_IRQ INT_MAIL_MPU_IRQ
 
 /*  --- Function Prototypes */
-static struct lst_list *create_chirp_list(u32 uChirps);
+static struct lst_list *create_chirp_list(u32 chirps);
 
 static void free_chirp_list(struct lst_list *lst);
 
@@ -709,18 +709,18 @@ func_end:
  *   bridge_chnl_get_mgr_info 
  *  Retrieve information related to the channel manager.
  */
-int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 uChnlID,
+int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 ch_id,
 OUT struct chnl_mgrinfo *mgr_info)
 {
int status = 0;
struct chnl_mgr *chnl_mgr_obj = (struct chnl_mgr *)hchnl_mgr;
 
if (mgr_info != NULL) {
-   if (uChnlID = CHNL_MAXCHANNELS) {
+   if (ch_id = CHNL_MAXCHANNELS) {
if (hchnl_mgr) {
/* Return the requested information: */
mgr_info-chnl_obj =
-   chnl_mgr_obj-ap_channel[uChnlID];
+   chnl_mgr_obj-ap_channel[ch_id];
mgr_info-open_channels =
chnl_mgr_obj-open_channels;
mgr_info-dw_type = chnl_mgr_obj-dw_type;
@@ -776,7 +776,7 @@ int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 
timeout,
  */
 int bridge_chnl_open(OUT struct chnl_object **chnl,
struct chnl_mgr *hchnl_mgr, s8 chnl_mode,
-   u32 uChnlId, CONST IN struct chnl_attr *pattrs)
+   u32 ch_id, CONST IN struct chnl_attr *pattrs)
 {
int status = 0;
struct chnl_mgr *chnl_mgr_obj = hchnl_mgr;
@@ -794,23 +794,23 @@ int bridge_chnl_open(OUT struct chnl_object **chnl,
if (!hchnl_mgr) {
status = -EFAULT;
} else {
-   if (uChnlId != CHNL_PICKFREE) {
-   if (uChnlId = chnl_mgr_obj-max_channels)
+   if (ch_id != CHNL_PICKFREE) {
+   if (ch_id = chnl_mgr_obj-max_channels)
status = -ECHRNG;
-   else if (chnl_mgr_obj-ap_channel[uChnlId] !=
+   else if (chnl_mgr_obj-ap_channel[ch_id] !=
 NULL)
status = -EALREADY;
} else {
/* Check for free channel */

[PATCH 15/15] staging:ti dspbridge: make variables in prototypes match within functions definitions

2010-07-09 Thread Rene Sapiens
This patch renames the variables in the parameter lists and in the function
definitions to make them match.

Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |2 +-
 drivers/staging/tidspbridge/core/io_sm.c   |   20 +++---
 drivers/staging/tidspbridge/core/tiomap3430.c  |   18 +++---
 drivers/staging/tidspbridge/core/tiomap_io.c   |8 +-
 drivers/staging/tidspbridge/core/tiomap_io.h   |2 +-
 drivers/staging/tidspbridge/dynload/reloc.c|4 +-
 drivers/staging/tidspbridge/hw/hw_mmu.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cmm.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|2 +-
 .../staging/tidspbridge/include/dspbridge/dbll.h   |   10 ++--
 .../staging/tidspbridge/include/dspbridge/disp.h   |8 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|   12 ++--
 .../staging/tidspbridge/include/dspbridge/dspmsg.h |2 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |4 +-
 .../staging/tidspbridge/include/dspbridge/mgr.h|2 +-
 .../staging/tidspbridge/include/dspbridge/proc.h   |4 +-
 .../include/dspbridge/resourcecleanup.h|   29 +
 .../staging/tidspbridge/include/dspbridge/rmm.h|4 +-
 drivers/staging/tidspbridge/pmgr/cmm.c |   12 ++--
 drivers/staging/tidspbridge/pmgr/cod.c |   63 ++-
 drivers/staging/tidspbridge/pmgr/dbll.c|   33 +-
 drivers/staging/tidspbridge/pmgr/dmm.c |4 +-
 drivers/staging/tidspbridge/rmgr/drv.c |   20 +++---
 drivers/staging/tidspbridge/rmgr/drv_interface.h   |7 +-
 drivers/staging/tidspbridge/rmgr/dspdrv.c  |6 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   44 --
 drivers/staging/tidspbridge/rmgr/node.c|   18 +++---
 drivers/staging/tidspbridge/rmgr/proc.c|   20 +++---
 drivers/staging/tidspbridge/rmgr/rmm.c |   11 ++--
 drivers/staging/tidspbridge/services/cfg.c |6 +-
 30 files changed, 195 insertions(+), 184 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/hw/hw_mmu.h

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index ac393b8..813ea35 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -75,7 +75,7 @@
 /*  --- Function Prototypes */
 static struct lst_list *create_chirp_list(u32 chirps);
 
-static void free_chirp_list(struct lst_list *lst);
+static void free_chirp_list(struct lst_list *chirp_list);
 
 static struct chnl_irp *make_new_chirp(void);
 
diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 0292881..74835c5 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -1013,7 +1013,7 @@ void io_mbox_msg(u32 msg)
  *  Request chanenel I/O from the DSP. Sets flags in shared memory, then
  *  interrupts the DSP.
  */
-void io_request_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
+void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl,
u8 io_mode, OUT u16 *mbx_val)
 {
struct chnl_mgr *chnl_mgr_obj;
@@ -1021,8 +1021,8 @@ void io_request_chnl(struct io_mgr *pio_mgr, struct 
chnl_object *pchnl,
 
if (!pchnl || !mbx_val)
goto func_end;
-   chnl_mgr_obj = pio_mgr-hchnl_mgr;
-   sm = pio_mgr-shared_mem;
+   chnl_mgr_obj = io_manager-hchnl_mgr;
+   sm = io_manager-shared_mem;
if (io_mode == IO_INPUT) {
/*
 * Assertion fires if CHNL_AddIOReq() called on a stream
@@ -1031,7 +1031,7 @@ void io_request_chnl(struct io_mgr *pio_mgr, struct 
chnl_object *pchnl,
DBC_ASSERT((pchnl-dw_state == CHNL_STATEREADY) ||
   (pchnl-dw_state == CHNL_STATEEOS));
/* Indicate to the DSP we have a buffer available for input */
-   IO_OR_VALUE(pio_mgr-hbridge_context, struct shm, sm,
+   IO_OR_VALUE(io_manager-hbridge_context, struct shm, sm,
host_free_mask, (1  pchnl-chnl_id));
*mbx_val = MBX_PCPY_CLASS;
} else if (io_mode == IO_OUTPUT) {
@@ -1057,20 +1057,20 @@ func_end:
  *   iosm_schedule 
  *  Schedule DPC for IO.
  */
-void iosm_schedule(struct io_mgr *pio_mgr)
+void iosm_schedule(struct io_mgr *io_manager)
 {
unsigned long flags;
 
-   if (!pio_mgr)
+   if (!io_manager)
return;
 
/* Increment count of DPC's pending. */
-   spin_lock_irqsave(pio_mgr-dpc_lock, flags);
-   pio_mgr-dpc_req++;
-   spin_unlock_irqrestore(pio_mgr-dpc_lock, flags);
+   spin_lock_irqsave(io_manager-dpc_lock, flags);
+   io_manager-dpc_req++;
+   

[PATCH 08/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

pMemStatBuf to mem_stat_buf
pMgrAttrs to mgr_attrts
pMgrInfo to mgr_info
pNodeEnv to node_env
pNodeId to node_uuid
pNodeInfo to node_info
pNumLibs to num_libs
pNumPersLibs to num_pers_libs
pObjDef to obj_def
pObjUuid to obj_uuid
poolPhysBase to pool_phys_base
poolSize to pool_size
pPctxt to pctxt
ppDevContext to dev_cntxt
ppDrvInterface to drv_intf
pPersistentDepLibs to prstnt_dep_libs
pPhyAddr to phy_addr


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |   28 +-
 drivers/staging/tidspbridge/core/io_sm.c   |8 ++--
 drivers/staging/tidspbridge/core/tiomap3430.c  |   10 ++--
 .../staging/tidspbridge/include/dspbridge/chnl.h   |   14 +++---
 .../staging/tidspbridge/include/dspbridge/cmm.h|6 +-
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |   24 +-
 .../staging/tidspbridge/include/dspbridge/disp.h   |6 +-
 .../staging/tidspbridge/include/dspbridge/dmm.h|2 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|8 ++--
 .../tidspbridge/include/dspbridge/dspchnl.h|4 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|   40 
 .../staging/tidspbridge/include/dspbridge/dspio.h  |2 +-
 drivers/staging/tidspbridge/include/dspbridge/io.h |   12 ++--
 .../staging/tidspbridge/include/dspbridge/node.h   |8 ++--
 .../tidspbridge/include/dspbridge/nodepriv.h   |2 +-
 .../include/dspbridge/resourcecleanup.h|6 +-
 .../staging/tidspbridge/include/dspbridge/rmm.h|4 +-
 drivers/staging/tidspbridge/pmgr/chnl.c|   14 +++---
 drivers/staging/tidspbridge/pmgr/cmm.c |   10 ++--
 drivers/staging/tidspbridge/pmgr/dmm.c |2 +-
 drivers/staging/tidspbridge/pmgr/io.c  |   10 ++--
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |   52 ++--
 drivers/staging/tidspbridge/rmgr/disp.c|6 +-
 drivers/staging/tidspbridge/rmgr/drv.c |   10 ++--
 drivers/staging/tidspbridge/rmgr/node.c|   50 +-
 drivers/staging/tidspbridge/rmgr/rmm.c |   14 +++---
 26 files changed, 176 insertions(+), 176 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 4c61a31..97eeda9 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -382,7 +382,7 @@ func_cont:
  */
 int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
  struct dev_object *hdev_obj,
- IN CONST struct chnl_mgrattrs *pMgrAttrs)
+ IN CONST struct chnl_mgrattrs *mgr_attrts)
 {
int status = 0;
struct chnl_mgr *chnl_mgr_obj = NULL;
@@ -390,10 +390,10 @@ int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
 
/* Check DBC requirements: */
DBC_REQUIRE(channel_mgr != NULL);
-   DBC_REQUIRE(pMgrAttrs != NULL);
-   DBC_REQUIRE(pMgrAttrs-max_channels  0);
-   DBC_REQUIRE(pMgrAttrs-max_channels = CHNL_MAXCHANNELS);
-   DBC_REQUIRE(pMgrAttrs-word_size != 0);
+   DBC_REQUIRE(mgr_attrts != NULL);
+   DBC_REQUIRE(mgr_attrts-max_channels  0);
+   DBC_REQUIRE(mgr_attrts-max_channels = CHNL_MAXCHANNELS);
+   DBC_REQUIRE(mgr_attrts-word_size != 0);
 
/* Allocate channel manager object */
chnl_mgr_obj = kzalloc(sizeof(struct chnl_mgr), GFP_KERNEL);
@@ -401,10 +401,10 @@ int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
/*
 * The max_channels attr must equal the # of supported chnls for
 * each transport(# chnls for PCPY = DDMA = ZCPY): i.e.
-*  pMgrAttrs-max_channels = CHNL_MAXCHANNELS =
+*  mgr_attrts-max_channels = CHNL_MAXCHANNELS =
 *   DDMA_MAXDDMACHNLS = DDMA_MAXZCPYCHNLS.
 */
-   DBC_ASSERT(pMgrAttrs-max_channels == CHNL_MAXCHANNELS);
+   DBC_ASSERT(mgr_attrts-max_channels == CHNL_MAXCHANNELS);
max_channels = CHNL_MAXCHANNELS + CHNL_MAXCHANNELS * CHNL_PCPY;
/* Create array of channels */
chnl_mgr_obj-ap_channel = kzalloc(sizeof(struct chnl_object *)
@@ -412,7 +412,7 @@ int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
if (chnl_mgr_obj-ap_channel) {
/* Initialize chnl_mgr object */
chnl_mgr_obj-dw_type = CHNL_TYPESM;
-   chnl_mgr_obj-word_size = pMgrAttrs-word_size;
+   chnl_mgr_obj-word_size = 

[PATCH 05/15] staging:ti dspbridge: Rename words with camel case.

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

pdwSize to buff_size
pdwState to board_state
pdwValue to value
pdwVersion to version
pElemExisting to elem_existing
pEntry to entry
pExists to exists
pfEnablePerf to enable_perf
pGenObj to gen_obj
phChnlMgr to channel_mgr
phChnl to chnl
phCodMgr to cod_mgr
phDCDHandle to dcd_handle
phDcdMgr to dcd_mgr
phDehMgr to deh_manager


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |   18 ++--
 drivers/staging/tidspbridge/core/tiomap3430.c  |6 +-
 .../staging/tidspbridge/include/dspbridge/cfg.h|   30 +++---
 .../staging/tidspbridge/include/dspbridge/chnl.h   |6 +-
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |   12 +-
 .../staging/tidspbridge/include/dspbridge/dbll.h   |2 +-
 .../tidspbridge/include/dspbridge/dblldefs.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/dev.h|   20 ++--
 .../tidspbridge/include/dspbridge/dspchnl.h|4 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|   25 ++--
 drivers/staging/tidspbridge/include/dspbridge/io.h |2 +-
 .../staging/tidspbridge/include/dspbridge/list.h   |   10 +-
 .../staging/tidspbridge/include/dspbridge/mgr.h|   10 +-
 drivers/staging/tidspbridge/pmgr/chnl.c|8 +-
 drivers/staging/tidspbridge/pmgr/dbll.c|   10 +-
 drivers/staging/tidspbridge/pmgr/dev.c |   20 ++--
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |  134 ++--
 drivers/staging/tidspbridge/rmgr/mgr.c |   12 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|8 +-
 drivers/staging/tidspbridge/services/cfg.c |   22 ++--
 20 files changed, 182 insertions(+), 179 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 834172d..cec3bb5 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -380,7 +380,7 @@ func_cont:
  *  Create a channel manager object, responsible for opening new channels
  *  and closing old ones for a given board.
  */
-int bridge_chnl_create(OUT struct chnl_mgr **phChnlMgr,
+int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
  struct dev_object *hdev_obj,
  IN CONST struct chnl_mgrattrs *pMgrAttrs)
 {
@@ -389,7 +389,7 @@ int bridge_chnl_create(OUT struct chnl_mgr **phChnlMgr,
u8 max_channels;
 
/* Check DBC requirements: */
-   DBC_REQUIRE(phChnlMgr != NULL);
+   DBC_REQUIRE(channel_mgr != NULL);
DBC_REQUIRE(pMgrAttrs != NULL);
DBC_REQUIRE(pMgrAttrs-max_channels  0);
DBC_REQUIRE(pMgrAttrs-max_channels = CHNL_MAXCHANNELS);
@@ -430,10 +430,10 @@ int bridge_chnl_create(OUT struct chnl_mgr **phChnlMgr,
 
if (DSP_FAILED(status)) {
bridge_chnl_destroy(chnl_mgr_obj);
-   *phChnlMgr = NULL;
+   *channel_mgr = NULL;
} else {
/* Return channel manager object to caller... */
-   *phChnlMgr = chnl_mgr_obj;
+   *channel_mgr = chnl_mgr_obj;
}
return status;
 }
@@ -774,7 +774,7 @@ int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 
timeout,
  *   bridge_chnl_open 
  *  Open a new half-duplex channel to the DSP board.
  */
-int bridge_chnl_open(OUT struct chnl_object **phChnl,
+int bridge_chnl_open(OUT struct chnl_object **chnl,
struct chnl_mgr *hchnl_mgr, s8 chnl_mode,
u32 uChnlId, CONST IN struct chnl_attr *pattrs)
 {
@@ -783,10 +783,10 @@ int bridge_chnl_open(OUT struct chnl_object **phChnl,
struct chnl_object *pchnl = NULL;
struct sync_object *sync_event = NULL;
/* Ensure DBC requirements: */
-   DBC_REQUIRE(phChnl != NULL);
+   DBC_REQUIRE(chnl != NULL);
DBC_REQUIRE(pattrs != NULL);
DBC_REQUIRE(hchnl_mgr != NULL);
-   *phChnl = NULL;
+   *chnl = NULL;
/* Validate Args: */
if (pattrs-uio_reqs == 0) {
status = -EINVAL;
@@ -893,10 +893,10 @@ int bridge_chnl_open(OUT struct chnl_object **phChnl,
spin_unlock_bh(chnl_mgr_obj-chnl_mgr_lock);
/* Return result... */
pchnl-dw_state = CHNL_STATEREADY;
-   *phChnl = pchnl;
+   *chnl = pchnl;
}
 func_end:
-   DBC_ENSURE((DSP_SUCCEEDED(status)  pchnl) || (*phChnl == NULL));
+   DBC_ENSURE((DSP_SUCCEEDED(status)  pchnl) || (*chnl == NULL));
return status;
 }
 
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index 

[PATCH 10/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

pstrFxn to str_fxn
pstrLibName to str_lib_name
pstrSect to str_sect
pstrSym to str_sym
pstrZLFileName to str_zl_file_name
pstrZLFile to str_zl_file
pszCoffPath to sz_coff_path
pszMode to sz_mode
pszName to sz_name
pszSectName to sz_sect_name
pszUuid to sz_uuid
pszZlDllName to sz_zl_dll_name
puAddr to addr
pulAddr to addr
pulBufSize to buff_size
pulBytes to nbytes


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/gen/uuidutil.c |   40 ++--
 .../staging/tidspbridge/include/dspbridge/cfg.h|8 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|   50 
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |   24 
 .../tidspbridge/include/dspbridge/dblldefs.h   |4 +-
 .../staging/tidspbridge/include/dspbridge/dev.h|6 +-
 .../staging/tidspbridge/include/dspbridge/nldr.h   |2 +-
 .../tidspbridge/include/dspbridge/nldrdefs.h   |   10 ++--
 .../staging/tidspbridge/include/dspbridge/strm.h   |   10 ++--
 .../tidspbridge/include/dspbridge/uuidutil.h   |   16 +++---
 drivers/staging/tidspbridge/pmgr/cod.c |   64 ++--
 drivers/staging/tidspbridge/pmgr/dev.c |6 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |   32 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   20 +++---
 drivers/staging/tidspbridge/rmgr/strm.c|   14 ++--
 15 files changed, 153 insertions(+), 153 deletions(-)

diff --git a/drivers/staging/tidspbridge/gen/uuidutil.c 
b/drivers/staging/tidspbridge/gen/uuidutil.c
index 070761b..840da42 100755
--- a/drivers/staging/tidspbridge/gen/uuidutil.c
+++ b/drivers/staging/tidspbridge/gen/uuidutil.c
@@ -36,14 +36,14 @@
  *  Note: snprintf format specifier is:
  *  %[flags] [width] [.precision] [{h | l | I64 | L}]type
  */
-void uuid_uuid_to_string(IN struct dsp_uuid *uuid_obj, OUT char *pszUuid,
+void uuid_uuid_to_string(IN struct dsp_uuid *uuid_obj, OUT char *sz_uuid,
 IN s32 size)
 {
s32 i;  /* return result from snprintf. */
 
-   DBC_REQUIRE(uuid_obj  pszUuid);
+   DBC_REQUIRE(uuid_obj  sz_uuid);
 
-   i = snprintf(pszUuid, size,
+   i = snprintf(sz_uuid, size,
 %.8X_%.4X_%.4X_%.2X%.2X_%.2X%.2X%.2X%.2X%.2X%.2X,
 uuid_obj-ul_data1, uuid_obj-us_data2, uuid_obj-us_data3,
 uuid_obj-uc_data4, uuid_obj-uc_data5,
@@ -75,39 +75,39 @@ static s32 uuid_hex_to_bin(char *buf, s32 len)
  *  Purpose:
  *  Converts a string to a struct dsp_uuid.
  */
-void uuid_uuid_from_string(IN char *pszUuid, OUT struct dsp_uuid *uuid_obj)
+void uuid_uuid_from_string(IN char *sz_uuid, OUT struct dsp_uuid *uuid_obj)
 {
s32 j;
 
-   uuid_obj-ul_data1 = uuid_hex_to_bin(pszUuid, 8);
-   pszUuid += 8;
+   uuid_obj-ul_data1 = uuid_hex_to_bin(sz_uuid, 8);
+   sz_uuid += 8;
 
/* Step over underscore */
-   pszUuid++;
+   sz_uuid++;
 
-   uuid_obj-us_data2 = (u16) uuid_hex_to_bin(pszUuid, 4);
-   pszUuid += 4;
+   uuid_obj-us_data2 = (u16) uuid_hex_to_bin(sz_uuid, 4);
+   sz_uuid += 4;
 
/* Step over underscore */
-   pszUuid++;
+   sz_uuid++;
 
-   uuid_obj-us_data3 = (u16) uuid_hex_to_bin(pszUuid, 4);
-   pszUuid += 4;
+   uuid_obj-us_data3 = (u16) uuid_hex_to_bin(sz_uuid, 4);
+   sz_uuid += 4;
 
/* Step over underscore */
-   pszUuid++;
+   sz_uuid++;
 
-   uuid_obj-uc_data4 = (u8) uuid_hex_to_bin(pszUuid, 2);
-   pszUuid += 2;
+   uuid_obj-uc_data4 = (u8) uuid_hex_to_bin(sz_uuid, 2);
+   sz_uuid += 2;
 
-   uuid_obj-uc_data5 = (u8) uuid_hex_to_bin(pszUuid, 2);
-   pszUuid += 2;
+   uuid_obj-uc_data5 = (u8) uuid_hex_to_bin(sz_uuid, 2);
+   sz_uuid += 2;
 
/* Step over underscore */
-   pszUuid++;
+   sz_uuid++;
 
for (j = 0; j  6; j++) {
-   uuid_obj-uc_data6[j] = (u8) uuid_hex_to_bin(pszUuid, 2);
-   pszUuid += 2;
+   uuid_obj-uc_data6[j] = (u8) uuid_hex_to_bin(sz_uuid, 2);
+   sz_uuid += 2;
}
 }
diff --git a/drivers/staging/tidspbridge/include/dspbridge/cfg.h 
b/drivers/staging/tidspbridge/include/dspbridge/cfg.h
index 98cadb1..1422ed0 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/cfg.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/cfg.h
@@ -155,20 +155,20 @@ extern void cfg_get_perf_value(OUT bool *enable_perf);
  *  Parameters:
  *  dev_node_obj: Handle to the dev_node who's driver we are querying.
  *  buf_size:   Size of buffer.
- *  pstrZLFileName: Ptr to character buf to hold ZLFileName.
+ *  

[PATCH 14/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

validBit to valid_bit
victimEntryNum to victim_entry_num
virtualAddr to virtual_addr
xType to xtype
actualValue to actual_value
EASIL1_MMUMMU_IRQSTATUSReadRegister32 to easil1_mmummu_irqstatus_read_register32
EASIL1_MMUMMU_LOCKBaseValueWrite32 to easil1_mmummu_lock_base_value_write32
easiNum to easi_num
expectedValue to expected_value
invalidValue to invalid_value
L1_base to l1_base
L2_base to l2_base
lower16Bits to lower16_bits
lower8Bits to lower8_bits
lowerMiddle8Bits to lower_middle8_bits
lowerUpper8Bits to lower_upper8_bits
maxValidValue to max_valid_value
minValidValue to min_valid_value
newValue to new_value
returnCodeIfMismatch to return_code_if_mismatch
spyCodeIfMisMatch to spy_code_if_mis_match
upper16Bits to upper16_bits
upper8Bits to upper8_bits


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/hw/EasiGlobal.h|2 +-
 drivers/staging/tidspbridge/hw/GlobalTypes.h   |   72 ---
 drivers/staging/tidspbridge/hw/MMURegAcM.h |   96 ++--
 drivers/staging/tidspbridge/hw/hw_mmu.c|   46 +-
 drivers/staging/tidspbridge/hw/hw_mmu.h|   20 ++--
 .../staging/tidspbridge/include/dspbridge/cmm.h|6 +-
 drivers/staging/tidspbridge/pmgr/cmm.c |   14 ++--
 7 files changed, 129 insertions(+), 127 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/hw/GlobalTypes.h

diff --git a/drivers/staging/tidspbridge/hw/EasiGlobal.h 
b/drivers/staging/tidspbridge/hw/EasiGlobal.h
index 9b45aa7..e48d7f6 100644
--- a/drivers/staging/tidspbridge/hw/EasiGlobal.h
+++ b/drivers/staging/tidspbridge/hw/EasiGlobal.h
@@ -36,6 +36,6 @@
  *
  * NOTE: We currently dont use this functionality.
  */
-#define _DEBUG_LEVEL1_EASI(easiNum) ((void)0)
+#define _DEBUG_LEVEL1_EASI(easi_num) ((void)0)
 
 #endif /* _EASIGLOBAL_H */
diff --git a/drivers/staging/tidspbridge/hw/GlobalTypes.h 
b/drivers/staging/tidspbridge/hw/GlobalTypes.h
index 9b55150..95fc8ca
--- a/drivers/staging/tidspbridge/hw/GlobalTypes.h
+++ b/drivers/staging/tidspbridge/hw/GlobalTypes.h
@@ -94,39 +94,39 @@
 #define LOWER8BIT_MASK0x00FF
 
 /*
- * Definition: RETURN32BITS_FROM16LOWER_AND16UPPER(lower16Bits, upper16Bits)
+ * Definition: RETURN32BITS_FROM16LOWER_AND16UPPER(lower16_bits, upper16_bits)
  *
  * DESCRIPTION: Returns a 32 bit value given a 16 bit lower value and a 16
  * bit upper value
  */
-#define RETURN32BITS_FROM16LOWER_AND16UPPER(lower16Bits, upper16Bits)\
-(u32)lower16Bits)   LOWER16BIT_MASK)) | \
- (u32)upper16Bits)  LOWER16BIT_MASK)  UPPER16BIT_SHIFT)))
+#define RETURN32BITS_FROM16LOWER_AND16UPPER(lower16_bits, upper16_bits)\
+(u32)lower16_bits)   LOWER16BIT_MASK)) | \
+ (u32)upper16_bits)  LOWER16BIT_MASK)  UPPER16BIT_SHIFT)))
 
 /*
- * Definition: RETURN16BITS_FROM8LOWER_AND8UPPER(lower16Bits, upper16Bits)
+ * Definition: RETURN16BITS_FROM8LOWER_AND8UPPER(lower16_bits, upper16_bits)
  *
  * DESCRIPTION:  Returns a 16 bit value given a 8 bit lower value and a 8
  *bit upper value
  */
-#define RETURN16BITS_FROM8LOWER_AND8UPPER(lower8Bits, upper8Bits)\
-(u32)lower8Bits)   LOWER8BIT_MASK)) | \
- (u32)upper8Bits)  LOWER8BIT_MASK)  UPPER8BIT_OF16_SHIFT)))
+#define RETURN16BITS_FROM8LOWER_AND8UPPER(lower8_bits, upper8_bits)\
+(u32)lower8_bits)   LOWER8BIT_MASK)) | \
+ (u32)upper8_bits)  LOWER8BIT_MASK)  UPPER8BIT_OF16_SHIFT)))
 
 /*
- * Definition: RETURN32BITS_FROM48BIT_VALUES(lower8Bits, lowerMiddle8Bits,
- * lowerUpper8Bits, upper8Bits)
+ * Definition: RETURN32BITS_FROM48BIT_VALUES(lower8_bits, lower_middle8_bits,
+ * lower_upper8_bits, upper8_bits)
  *
  * DESCRIPTION:  Returns a 32 bit value given four 8 bit values
  */
-#define RETURN32BITS_FROM48BIT_VALUES(lower8Bits, lowerMiddle8Bits,\
-   lowerUpper8Bits, upper8Bits)\
-   (u32)lower8Bits)  LOWER8BIT_MASK)) | \
-   (u32)lowerMiddle8Bits)  LOWER8BIT_MASK) \
+#define RETURN32BITS_FROM48BIT_VALUES(lower8_bits, lower_middle8_bits,\
+   lower_upper8_bits, upper8_bits)\
+   (u32)lower8_bits)  LOWER8BIT_MASK)) | \
+   (u32)lower_middle8_bits)  LOWER8BIT_MASK) \
LOWER_MIDDLE8BIT_SHIFT)) | \
-   (u32)lowerUpper8Bits)  LOWER8BIT_MASK) \
+   (u32)lower_upper8_bits)  LOWER8BIT_MASK) \
UPPER_MIDDLE8BIT_SHIFT)) | \
-   (u32)upper8Bits)  LOWER8BIT_MASK) \
+   (u32)upper8_bits)  LOWER8BIT_MASK) \
UPPER8BIT_SHIFT)))
 
 /*
@@ -285,24 +285,26 @@ enum return_code_label {
 
 /* Not sure if this all belongs here 

[PATCH 00/15] ti dspbridge: Remove CamelCase, reagroup variables

2010-07-09 Thread Rene Sapiens
The intention of this serie of patches is to rename the remaining variables 
with camel case. Words will be renamed avoiding CamelCase and Hungarian 
notation. Also the variables in the prototypes  will be renamed to make them 
match with the ones in the function definitions.

The variables to be renamed are:

= BEGIN =
dspAddr to dsp_address
dspAdr to dsp_adr
dspBaseVirt to dsp_base_virt
dwDeviceContext to device_context
dwDSPAddrOffset to dsp_addr_offset
dwDSPAddr to dsp_addr
dwErrInfo to error_info
dwGPPBaseBA to gpp_base_ba
dwMask to mask
dwTimeout to timeout
dwTimeOut to timeout
dwValue to value
entryNum to entry_num
execFile to exec_file
fFlush to flush_data
FlushMemType to flush_mem_type
FlushType to flush_type
hDevContext to dev_ctxt
hDevExtension to dev_extension
hdevObject to device_obj
hDispObject to disp_obj
hDrVObject to driver_obj
hDRVObject to driver_obj
hMGRHandle to mgr_handle
hNldrObject to nldr
hNode1 to node1
hNode2 to node2
hNodeRes to node_resource
hPCtxt to process_ctxt
hProc to proc
hStreamHandle to stream_handle
hStrm to stream_obj
iMode to io_mode
irqMask to irq_mask
lOffset to offset
memPtr to mem_ptr
moduleId to module_id
msgCallback to msg_callback
msgList to msg_list
nArgc to num_argc
nEntryStart to entry_start
nMemSpace to mem_space
nStatus to node_status
nStrms to strms
numLibs to num_libs
numLockedEntries to num_locked_entries
pageSize to page_sz
pArb to arb
pbAlreadyAttached to already_attached
pBaseAddr to base_addr
pbHostBuf to host_buff
pBufVa to buf_va
pChnlInfo to channel_info
pConfig to config_param
pContent to content
pContext to context
pdcdProps to dcd_prop
pDepLibUuids to dep_lib_uuids
pDevNodeString to dev_node_strg
pDispAttrs to disp_attrs
pDsp to dsp
pdwAutoStart to auto_start
pdwChnl to chnl
pdwSize to buff_size
pdwState to board_state
pdwValue to value
pdwVersion to version
pElemExisting to elem_existing
pEntry to entry
pErrInfo to err_inf
pExists to exists
pfEnablePerf to enable_perf
pGenObj to gen_obj
phChnlMgr to channel_mgr
phChnl to chnl
phCodMgr to cod_mgr
phDCDHandle to dcd_handle
phDcdMgr to dcd_mgr
phDehMgr to deh_manager
phDevContext to device_ctx
phDevNode to dev_nde
phDevObject to device_obj
phDispObject to dispatch_obj
phDmmMgr to dmm_manager
phDrvObject to drv_obj
phDRVObject to drv_obj
phIOMgr to io_man
phLoader to loader
phManager to manager
phMgrObject to mgr_obj
phMgr to mgr
phMsgMgr to msg_man
phMsgQueue to msgq
phNldrNode to nldr_nodeobj
phNldrObj to nldr_ovlyobj
phNldr to nldr
phNodeMgr to node_man
pHostBuf to host_buf
pHostConfig to host_config
phRmmMgr to rmm_mgr
phStrmMgr to strm_man
phStrm to strm_objct
phXlator to xlator
physicalAddr to physical_addr
pInfo to channel_info
pIOC to chan_ioc
pLib to lib_obj
pList to lst
pMemBuf to mem_buf
pMemStatBuf to mem_stat_buf
pMgrAttrs to mgr_attrts
pMgrInfo to mgr_info
pNodeEnv to node_env
pNodeId to node_uuid
pNodeInfo to node_info
pNumLibs to num_libs
pNumPersLibs to num_pers_libs
pObjDef to obj_def
pObjUuid to obj_uuid
poolPhysBase to pool_phys_base
poolSize to pool_size
pPctxt to pctxt
ppDevContext to dev_cntxt
ppDrvInterface to drv_intf
pPersistentDepLibs to prstnt_dep_libs
pPhyAddr to phy_addr
pPhysAddr to phys_addr
pPhysicalAddress to physical_address
ppIntfFxns to if_fxns
pProcLoadStat to proc_load_stat
pProcStat to proc_lstat
ppSym to sym_val
pRefData to ref_data
pRef to ref
preservedBit to preserved_bit
pResult to result
procID to proc_id
pSectInfo to sect_inf
pSrc to src
pstrContent to str_content
pstrDummyFile to str_dummy_file
pstrExecFile to str_exec_file
pstrFxn to str_fxn
pstrLibName to str_lib_name
pstrSect to str_sect
pstrSym to str_sym
pstrZLFileName to str_zl_file_name
pstrZLFile to str_zl_file
pszCoffPath to sz_coff_path
pszMode to sz_mode
pszName to sz_name
pszSectName to sz_sect_name
pszUuid to sz_uuid
pszZlDllName to sz_zl_dll_name
puAddr to addr
pulAddr to addr
pulBufSize to buff_size
pulBytes to nbytes
puLen to len
pulEntry to entry_pt
pulFxnAddr to fxn_addr
pulId to chan_id
pulSegId to sgmt_id
pVaBuf to va_buf
pVirtualAddress to virtual_address
pwMbVal to mbx_val
pWord to word
pXlatorAttrs to xlator_attrs
registerFxn to register_fxn
rootPersistent to root_prstnt
sectionData to section_data
sectionInfo to section_info
sectionName to section_name
sectName to sec_name
segmentId to segmnt_id
SetPageDirty to set_page_dirty
sizeInBytes to size_in_bytes
sleepCode to sleep_code
Status to status
symName to sym_name
szVar to sz_var
Trapped_Args to trapped_args
TTBPhysAddr to ttb_phys_addr
uChirps to chirps
uChnlId to ch_id
uChnlID to ch_id
uContentSize to cont_size
uDDMAChnlId to ddma_chnl_id
uEvents to events
ulAlign to align_mask
ulBrdState to brd_state
ulChnl to chnl
ulDspAddr to dsp_add
ulDspDestAddr to dsp_dest_addr
ulDspLoadAddr to dsp_load_addr
ulDspRunAddr to dsp_run_addr
ulDspSrcAddr to dsp_src_addr
ulEventMask to evnt_mask
ulMapAttrs to map_attr
ulMemType to mem_type
ulRMSFxn to rms_fxn
ulStatus to ret
ulVirtAddr to virt_addr
uNumDesc 

[PATCH 04/15] staging:ti dspbridge: Rename words with camel case

2010-07-09 Thread Rene Sapiens
The intention of this patch is to rename the remaining variables with camel
case. Variables will be renamed avoiding camel case and Hungarian notation.
The words to be renamed in this patch are:

pArb to arb
pbAlreadyAttached to already_attached
pBaseAddr to base_addr
pbHostBuf to host_buff
pBufVa to buf_va
pChnlInfo to channel_info
pConfig to config_param
pContent to content
pContext to context
pdcdProps to dcd_prop
pDepLibUuids to dep_lib_uuids
pDevNodeString to dev_node_strg
pDispAttrs to disp_attrs
pDsp to dsp
pdwAutoStart to auto_start
pdwChnl to chnl


Signed-off-by: Rene Sapiens rene.sapi...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |6 ++--
 drivers/staging/tidspbridge/core/tiomap3430.c  |   36 ++--
 drivers/staging/tidspbridge/core/tiomap_io.c   |   16 
 drivers/staging/tidspbridge/core/tiomap_io.h   |6 ++--
 .../staging/tidspbridge/include/dspbridge/cfg.h|6 ++--
 .../staging/tidspbridge/include/dspbridge/cmm.h|4 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|4 +-
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |6 ++--
 .../staging/tidspbridge/include/dspbridge/dev.h|   14 
 .../staging/tidspbridge/include/dspbridge/disp.h   |6 ++--
 .../staging/tidspbridge/include/dspbridge/drv.h|   12 +++---
 .../tidspbridge/include/dspbridge/dspdefs.h|   10 +++---
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |   16 
 drivers/staging/tidspbridge/pmgr/cmm.c |6 ++--
 drivers/staging/tidspbridge/pmgr/cod.c |4 +-
 drivers/staging/tidspbridge/pmgr/dbll.c|   10 +++---
 drivers/staging/tidspbridge/pmgr/dev.c |   14 
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |   14 
 drivers/staging/tidspbridge/rmgr/disp.c|   10 +++---
 drivers/staging/tidspbridge/rmgr/drv.c |   14 
 drivers/staging/tidspbridge/rmgr/node.c|   12 +++---
 drivers/staging/tidspbridge/services/cfg.c |   10 +++---
 22 files changed, 118 insertions(+), 118 deletions(-)
 mode change 100644 = 100755 drivers/staging/tidspbridge/core/tiomap3430.c
 mode change 100644 = 100755 
drivers/staging/tidspbridge/include/dspbridge/io_sm.h

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index 362e01e..834172d 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -80,7 +80,7 @@ static void free_chirp_list(struct lst_list *pList);
 static struct chnl_irp *make_new_chirp(void);
 
 static int search_free_channel(struct chnl_mgr *chnl_mgr_obj,
- OUT u32 *pdwChnl);
+ OUT u32 *chnl);
 
 /*
  *   bridge_chnl_add_io_req 
@@ -996,7 +996,7 @@ static struct chnl_irp *make_new_chirp(void)
  *  Search for a free channel slot in the array of channel pointers.
  */
 static int search_free_channel(struct chnl_mgr *chnl_mgr_obj,
- OUT u32 *pdwChnl)
+ OUT u32 *chnl)
 {
int status = -ENOSR;
u32 i;
@@ -1006,7 +1006,7 @@ static int search_free_channel(struct chnl_mgr 
*chnl_mgr_obj,
for (i = 0; i  chnl_mgr_obj-max_channels; i++) {
if (chnl_mgr_obj-ap_channel[i] == NULL) {
status = 0;
-   *pdwChnl = i;
+   *chnl = i;
break;
}
}
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index 7ed0382..dd7436d
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -76,7 +76,7 @@
 /* Forward Declarations: */
 static int bridge_brd_monitor(struct bridge_dev_context *dev_context);
 static int bridge_brd_read(struct bridge_dev_context *dev_context,
- OUT u8 *pbHostBuf,
+ OUT u8 *host_buff,
  u32 dsp_addr, u32 ul_num_bytes,
  u32 ulMemType);
 static int bridge_brd_start(struct bridge_dev_context *dev_context,
@@ -85,7 +85,7 @@ static int bridge_brd_status(struct bridge_dev_context 
*dev_context,
int *pdwState);
 static int bridge_brd_stop(struct bridge_dev_context *dev_context);
 static int bridge_brd_write(struct bridge_dev_context *dev_context,
-  IN u8 *pbHostBuf,
+  IN u8 *host_buff,
   u32 dsp_addr, u32 ul_num_bytes,
   u32 ulMemType);
 static int bridge_brd_set_state(struct bridge_dev_context *dev_ctxt,
@@ -94,7 +94,7 @@ static int