[PATCH] omap3: am3517evm : Read MAC address from E-Fuses

2011-03-22 Thread Sriramakrishnan A G
MAC address is programmed in the e-fuses accessible through
Control module space. Board init code reads the programmed value
from e-fuse and passes this information to the driver.

Signed-off-by: Sriramakrishnan A G 
---
 arch/arm/mach-omap2/board-am3517evm.c |   12 +++-
 arch/arm/mach-omap2/control.h |2 ++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 77541cf..177c65d 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -128,7 +128,17 @@ static void am3517_disable_ethernet_int(void)
 
 static void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
 {
-   unsigned int regval;
+   u32 regval, mac_lo, mac_hi;
+
+   mac_lo = omap_ctrl_readl(AM35XX_CONTROL_FUSE_EMAC_LSB);
+   mac_hi = omap_ctrl_readl(AM35XX_CONTROL_FUSE_EMAC_MSB);
+
+   pdata->mac_addr[0] = (u_int8_t)((mac_hi & 0xFF) >> 16);
+   pdata->mac_addr[1] = (u_int8_t)((mac_hi & 0xFF00) >> 8);
+   pdata->mac_addr[2] = (u_int8_t)((mac_hi & 0xFF) >> 0);
+   pdata->mac_addr[3] = (u_int8_t)((mac_lo & 0xFF) >> 16);
+   pdata->mac_addr[4] = (u_int8_t)((mac_lo & 0xFF00) >> 8);
+   pdata->mac_addr[5] = (u_int8_t)((mac_lo & 0xFF) >> 0);
 
pdata->ctrl_reg_offset  = AM35XX_EMAC_CNTRL_OFFSET;
pdata->ctrl_mod_reg_offset  = AM35XX_EMAC_CNTRL_MOD_OFFSET;
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index c2804c1..8b6cc4f 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -198,6 +198,8 @@
 
 /* AM35XX only CONTROL_GENERAL register offsets */
 #define AM35XX_CONTROL_MSUSPENDMUX_6(OMAP2_CONTROL_GENERAL + 0x0038)
+#define AM35XX_CONTROL_FUSE_EMAC_LSB   (OMAP2_CONTROL_GENERAL + 0x0110)
+#define AM35XX_CONTROL_FUSE_EMAC_MSB   (OMAP2_CONTROL_GENERAL + 0x0114)
 #define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310)
 #define AM35XX_CONTROL_DEVCONF3 (OMAP2_CONTROL_GENERAL + 0x0314)
 #define AM35XX_CONTROL_CBA_PRIORITY (OMAP2_CONTROL_GENERAL + 0x0320)
-- 
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 2/2] can:ti_hecc: board specific hookup on AM3517EVM

2010-04-30 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: Govindarajan, Sriramakrishnan
> Sent: Tuesday, February 23, 2010 12:08 PM
> To: linux-omap@vger.kernel.org
> Cc: Gole, Anant; Govindarajan, Sriramakrishnan
> Subject: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM
> 
> Add board specific hookup for TI HECC driver on
> AM3517 EVM
> 
> Signed-off-by: Sriramakrishnan 
> Acked-by: Anant Gole 
> ---
> The driver requires that CAN_STB signal be driven low to enable
> CAN PHY. Currently this is being managed from U-boot. Will submit a patch
> for handling this as part of board init sequence.
> 
>  arch/arm/mach-omap2/board-am3517evm.c |   38
> +
>  arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++
>  2 files changed, 48 insertions(+), 0 deletions(-)
> 
[Sriram] Tony, there hasn't been any review comments on this patch for long. Do 
you any comments on this patch? If not can please apply this patch

Regards
Sriram
--
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: [PATCHv3 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-04-30 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com]
> Sent: Friday, April 16, 2010 10:55 AM
> To: Govindarajan, Sriramakrishnan
> Cc: linux-omap@vger.kernel.org; linux-in...@vger.kernel.org
> Subject: Re: [PATCHv3 1/3] TCA6416 keypad : Implement keypad driver for
> keys interfaced to TCA6416
> 
> On Tue, Mar 23, 2010 at 08:40:33PM +0530, Sriramakrishnan wrote:
> > This patch implements a simple Keypad driver that functions
> > as an I2C client. It handles key press events for keys
> > connected to TCA6416 I2C based IO expander.
> >
> > Signed-off-by: Sriramakrishnan 
> > ---
> >  drivers/input/keyboard/Kconfig  |   16 ++
> >  drivers/input/keyboard/Makefile |1 +
> >  drivers/input/keyboard/tca6416-keypad.c |  354
> +++
> >  include/linux/tca6416_keypad.h  |   34 +++
> >  4 files changed, 405 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/input/keyboard/tca6416-keypad.c
> >  create mode 100644 include/linux/tca6416_keypad.h
snip
Does the driver still work if you aplly the patch below on top?
[Sriram] Dmitry, I was able to test with the patch below(again scope restricted 
to Polling mode) and it works but with following minor changes. Please review.
> 
> Thanks.
> 
> --
> Dmitry
> 
> Input: tca6416 - misc fixes
> 
> Signed-off-by: Dmitry Torokhov 
> ---
> 
>  drivers/input/keyboard/tca6416-keypad.c |  327 +++---
> -
>  1 files changed, 160 insertions(+), 167 deletions(-)
> 
> 
> diff --git a/drivers/input/keyboard/tca6416-keypad.c
> b/drivers/input/keyboard/tca6416-keypad.c
> index 17df832..0943af3 100644
> --- a/drivers/input/keyboard/tca6416-keypad.c
> +++ b/drivers/input/keyboard/tca6416-keypad.c
> @@ -10,16 +10,17 @@
>   * published by the Free Software Foundation.
>   */
---snip---

> +static int tca6416_keys_open(struct input_dev *dev)
> +{
> + struct tca6416_keypad_chip *chip = input_get_drvdata(dev);
> +
> + /* Get initial device state in case it has switches */
> + tca6416_keys_scan(chip);
> 
>   if (chip->use_polling)
>   schedule_delayed_work(&chip->dwork, msecs_to_jiffies(100));
>   else
>   enable_irq(chip->irqnum);
> 
> + return 0;
> +}
> +
> +static void tca6416_keys_close(struct input_dev *dev)
> +{
> + struct tca6416_keypad_chip *chip = input_get_drvdata(dev);
> +
> + if (chip->use_polling)
> + cancel_delayed_work_sync(&chip->dwork);
> + else
> + free_irq(chip->irqnum, chip);
[Sriram] replaced free_irq() with disable_irq() instead. This should take care 
of multiple (concurrent) opens.

>  }
> 
> +static int __devinit tca6416_setup_registers(struct tca6416_keypad_chip
> *chip)
> +{
> + int error;
> +
> + error = tca6416_read_reg(chip, TCA6416_OUTPUT, &chip->reg_output);
> + if (error)
> + return error;
> +
> + error = tca6416_read_reg(chip, TCA6416_DIRECTION, &chip-
> >reg_direction);
> + if (error)
> + return error;
> +
> + /* ensure that keypad pins are set to input */
> + error = tca6416_write_reg(chip, TCA6416_DIRECTION,
> +   chip->reg_direction | chip->pinmask);
> + if (error)
> + return error;
> +
> + error = tca6416_read_reg(chip, TCA6416_DIRECTION, &chip-
> >reg_direction);
> + if (error)
> + return error;
> +
> + error = tca6416_read_reg(chip, TCA6416_INPUT, &chip->reg_input);
> + if (error)
> + return error;

[Sriram] reg_input cached value needs to be masked with pinmask - otherwise on 
device open the driver reports continuous stream of key_down(repeat) events 
until a key is pressed.

> + return 0;
> +}
> 
[Sriram] Dmitry, once you have reviewed the changes, should I re-post the patch 
series with your patch added to the series?

Regards
Sriram
--
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 06/12] AM3517: Add nand platform data for am3517evm

2010-04-14 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:00 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com
> Subject: [PATCH 06/12] AM3517: Add nand platform data for am3517evm
> 
> Add nand flash init code for am3517evm.
> 
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |   84
> +
>  1 files changed, 84 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 879c13f..a76ff11 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -23,6 +23,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
> 
>  #include 
>  #include 
> @@ -35,6 +38,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> 
>  #include "mux.h"
> 
> @@ -42,6 +47,84 @@
>  #define LCD_PANEL_BKLIGHT_PWR182
>  #define LCD_PANEL_PWM181
> 
> +#define GPMC_CS0_BASE  0x60
> +#define GPMC_CS_SIZE   0x30
> +
> +#define NAND_BLOCK_SIZESZ_128K
> +
> +static struct mtd_partition am3517evm_nand_partitions[] = {
> + /* All the partition sizes are listed in terms of NAND block size */
> + {
> + .name   = "xloader",
> + .offset = 0,
> + .size   = 4 * (SZ_128K),
> + .mask_flags = MTD_WRITEABLE
> + },
> + {
> + .name   = "uboot",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 14 * (SZ_128K),
> + .mask_flags = MTD_WRITEABLE
> + },
> + {
> + .name   = "uboot-params",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 2 * (SZ_128K)
> + },
> + {
> + .name   = "linux-kernel",
> + .offset = MTDPART_OFS_APPEND,
> + .size   = 40 * (SZ_128K)
> + },
> + {
> + .name   = "rootfs",
> + .size   = MTDPART_SIZ_FULL,
> + .offset = MTDPART_OFS_APPEND,
> + },
> +};
--- snip ---
[Sriram] Similar patch was posted earlier - pending re-work (see Tony's 
comments)
https://patchwork.kernel.org/patch/56485/

If you deriving your work from existing implementation, attribute the original 
author in your submissions 

Regards
Sriram
--
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 02/12] AM3517: Add platform init code for EMAC driver

2010-04-14 Thread Govindarajan, Sriramakrishnan
> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Stanley.Miao
> Sent: Wednesday, April 14, 2010 2:00 PM
> To: linux-omap@vger.kernel.org
> Cc: t...@atomide.com
> Subject: [PATCH 02/12] AM3517: Add platform init code for EMAC driver
> 
> Add platform init code for EMAC driver.
> 
> Signed-off-by: Stanley.Miao 
> ---
>  arch/arm/mach-omap2/board-am3517evm.c |  114
> +
>  arch/arm/mach-omap2/include/mach/am35xx.h |9 ++
>  2 files changed, 123 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> index 6ae8805..db542b2 100644
> --- a/arch/arm/mach-omap2/board-am3517evm.c
> +++ b/arch/arm/mach-omap2/board-am3517evm.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> 
>  #include 
> @@ -30,6 +31,7 @@
> 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 

-- snip --

This patch has been posted earlier. Refer,
https://patchwork.kernel.org/patch/84921/
https://patchwork.kernel.org/patch/84919/

Tony,
Any updates on these

Regards
Sriram


--
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: [PATCHv3 0/3] Add support for TCA6416 based Keypad driver.

2010-04-01 Thread Govindarajan, Sriramakrishnan


> -Original Message-
> From: Govindarajan, Sriramakrishnan
> Sent: Tuesday, March 23, 2010 8:41 PM
> To: linux-omap@vger.kernel.org; linux-in...@vger.kernel.org
> Cc: Govindarajan, Sriramakrishnan
> Subject: [PATCHv3 0/3] Add support for TCA6416 based Keypad driver.
> 
> AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander
> User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
> case with generic gpio-keypad driver individual keys do not generate an
> interrupt event. Hence we implement a simple keypad driver, that
> registers as direct I2C client.
> 
> The implementation has been tested on AM3517 EVM with the driver tested
> in polling mode.
> 
> Version3 is refreshed against the tip of linux-omap and
> file mode issues from the previous version is fixed.
> 
> Sriramakrishnan (3):
>   TCA6416 keypad : Implement keypad driver for keys interfaced to
> TCA6416
>   AM3517: Board hookup for TCA6416 keypad driver.
>   AM3517 EVM : Enable TCA6416 keypad.
> 
>  arch/arm/configs/am3517_evm_defconfig   |   16 ++-
>  arch/arm/mach-omap2/board-am3517evm.c   |   47 -
>  drivers/input/keyboard/Kconfig  |   16 ++
>  drivers/input/keyboard/Makefile |1 +
>  drivers/input/keyboard/tca6416-keypad.c |  354
> +++
>  include/linux/tca6416_keypad.h  |   34 +++
>  6 files changed, 462 insertions(+), 6 deletions(-)
>  create mode 100644 drivers/input/keyboard/tca6416-keypad.c
>  create mode 100644 include/linux/tca6416_keypad.h

[Sriram] All,
Any feedback on this updated patch series?
Thanks
Sriram

--
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 v2 0/2] Enable CAN peripheral support on AM3517

2010-04-01 Thread Govindarajan, Sriramakrishnan


> -Original Message-
> From: Govindarajan, Sriramakrishnan
> Sent: Friday, February 26, 2010 5:37 PM
> To: linux-omap@vger.kernel.org
> Cc: Gole, Anant; Govindarajan, Sriramakrishnan
> Subject: [PATCH v2 0/2] Enable CAN peripheral support on AM3517
> 
> AM3517 platform includes the ti-hecc CAN peripheral. This patch
> series enables support for the ti-hecc peripheral on AM3517 platform.
> This patch series has been validated on AM3517EVM.
> 
> This patch is generated against tip of linux-omap.
> 
> Sriramakrishnan (2):
>   can:ti_hecc: board specific hookup on AM3517EVM
>   can:ti_hecc: Enable CAN support on AM3517.
> 
>  arch/arm/configs/am3517_evm_defconfig |   22 +---
>  arch/arm/mach-omap2/board-am3517evm.c |   38
> +
>  arch/arm/mach-omap2/include/mach/am35xx.h |9 +++
>  3 files changed, 65 insertions(+), 4 deletions(-)

[Sriram]  Tony, 
Any comments on this patch
Thanks,
Sriram

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


[PATCHv3 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-03-23 Thread Sriramakrishnan
This patch implements a simple Keypad driver that functions
as an I2C client. It handles key press events for keys
connected to TCA6416 I2C based IO expander.

Signed-off-by: Sriramakrishnan 
---
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 4 files changed, 405 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/keyboard/tca6416-keypad.c
 create mode 100644 include/linux/tca6416_keypad.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 64c1023..cf7fca9 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -192,6 +192,22 @@ config KEYBOARD_GPIO
  To compile this driver as a module, choose M here: the
  module will be called gpio_keys.
 
+config KEYBOARD_TCA6416
+   tristate "TCA6416 Keypad Support"
+   depends on I2C
+   help
+ This driver implements basic keypad functionality
+ for keys connected through TCA6416 IO expander
+
+ Say Y here if your device has keys connected to
+ TCA6416 IO expander. Your board-specific setup logic
+ must also provide pin-mask details(of which TCA6416 pins
+ are used for keypad).
+
+ If enabled the complete TCA6416 device will be managed through
+ this driver.
+
+
 config KEYBOARD_MATRIX
tristate "GPIO driven matrix keypad support"
depends on GENERIC_GPIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 706c6b5..47e267c 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_KEYBOARD_CORGI)  += corgikbd.o
 obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
 obj-$(CONFIG_KEYBOARD_EP93XX)  += ep93xx_keypad.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
+obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_IMX) += imx_keypad.o
diff --git a/drivers/input/keyboard/tca6416-keypad.c 
b/drivers/input/keyboard/tca6416-keypad.c
new file mode 100644
index 000..17df832
--- /dev/null
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -0,0 +1,354 @@
+/*
+ * Driver for keys on TCA6416 I2C IO expander
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author : Sriramakrishnan.A.G. 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TCA6416_INPUT  0
+#define TCA6416_OUTPUT 1
+#define TCA6416_INVERT 2
+#define TCA6416_DIRECTION  3
+
+static const struct i2c_device_id tca6416_id[] = {
+   { "tca6416-keys", 16, },
+   { }
+};
+MODULE_DEVICE_TABLE(i2c, tca6416_id);
+
+struct tca6416_drv_data {
+   struct input_dev *input;
+   struct tca6416_button data[0];
+};
+
+struct tca6416_keypad_chip {
+   uint16_t reg_output;
+   uint16_t reg_direction;
+   uint16_t reg_input;
+
+   struct i2c_client *client;
+   struct tca6416_drv_data  *drv_data;
+   struct delayed_work dwork;
+   uint16_t pinmask;
+   int irqnum;
+   int use_polling;
+};
+
+static int tca6416_write_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t val)
+{
+   int ret;
+
+   ret = i2c_smbus_write_word_data(chip->client, reg << 1, val);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed writing register\n");
+   return ret;
+   }
+
+   return 0;
+}
+
+static int tca6416_read_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t *val)
+{
+   int ret;
+
+   ret = i2c_smbus_read_word_data(chip->client, reg << 1);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed reading register\n");
+   return ret;
+   }
+
+   *val = (uint16_t)ret;
+   return 0;
+}
+
+static irqreturn_t tca6416_keys_isr(int irq, void *dev_id)
+{
+   struct tca6416_keypad_chip *chip =
+   (struct tca6416_keypad_chip *) dev_id;
+
+   disable_irq(irq);
+   schedule_delayed_work(&chip->dwork, 0);
+   return IRQ_HANDLED;
+
+}
+
+static void tca6416_keys_work_func(struct work_struct *workstruct)
+{
+   struct delayed_work *delay_work =
+   container_of(workstruct, struct delayed_work, work);
+   struct tca6416_keypad_chip *chip =
+   container_of(de

[PATCHv3 0/3] Add support for TCA6416 based Keypad driver.

2010-03-23 Thread Sriramakrishnan
AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander
User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
case with generic gpio-keypad driver individual keys do not generate an
interrupt event. Hence we implement a simple keypad driver, that
registers as direct I2C client.

The implementation has been tested on AM3517 EVM with the driver tested
in polling mode.

Version3 is refreshed against the tip of linux-omap and 
file mode issues from the previous version is fixed.

Sriramakrishnan (3):
  TCA6416 keypad : Implement keypad driver for keys interfaced to
TCA6416
  AM3517: Board hookup for TCA6416 keypad driver.
  AM3517 EVM : Enable TCA6416 keypad.

 arch/arm/configs/am3517_evm_defconfig   |   16 ++-
 arch/arm/mach-omap2/board-am3517evm.c   |   47 -
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 6 files changed, 462 insertions(+), 6 deletions(-)
 create mode 100644 drivers/input/keyboard/tca6416-keypad.c
 create mode 100644 include/linux/tca6416_keypad.h

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


[PATCHv3 2/3] AM3517: Board hookup for TCA6416 keypad driver.

2010-03-23 Thread Sriramakrishnan
Add board specific hookup for TCA6416 keypad driver.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/board-am3517evm.c |   47 +---
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..d50e505 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,7 +20,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -88,16 +91,50 @@ static struct i2c_board_info __initdata 
am3517evm_tca6416_info_0[] = {
 };
 
 /* Mounted on UI Card */
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
+/* IO expander at address 0x20 on UI card will be managed by Keypad driver */
+
+static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 16,
 };
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 32,
+
+/*Keypad Initialization */
+#define KEYPAD_PIN_MASK0xFFC0
+
+#define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
+{  \
+   .type   = ev_type,  \
+   .code   = ev_code,  \
+   .active_low = act_low,  \
+}
+
+#define KEYPAD_BUTTON_LOW(event_code)  \
+   KEYPAD_BUTTON(EV_KEY, event_code, 1)
+
+static struct tca6416_button am3517_gpio_keys[] = {
+   KEYPAD_BUTTON_LOW(KEY_DOWN),
+   KEYPAD_BUTTON_LOW(KEY_UP),
+   KEYPAD_BUTTON_LOW(KEY_MENU),
+   KEYPAD_BUTTON_LOW(KEY_MODE),
+   KEYPAD_BUTTON_LOW(KEY_LEFTSHIFT),
+   KEYPAD_BUTTON_LOW(KEY_REWIND),
+   KEYPAD_BUTTON_LOW(KEY_FORWARD),
+   KEYPAD_BUTTON_LOW(KEY_STOP),
+   KEYPAD_BUTTON_LOW(KEY_PLAY),
+   KEYPAD_BUTTON_LOW(KEY_RECORD),
 };
+
+static struct tca6416_keys_platform_data am3517evm_tca6416_keys_info = {
+   .buttons= am3517_gpio_keys,
+   .nbuttons   = ARRAY_SIZE(am3517_gpio_keys),
+   .rep= 1,
+   .use_polling= 1,
+   .pinmask= KEYPAD_PIN_MASK,
+};
+
 static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
{
-   I2C_BOARD_INFO("tca6416", 0x20),
-   .platform_data = &am3517evm_ui_gpio_expander_info_1,
+   I2C_BOARD_INFO("tca6416-keys", 0x20),
+   .platform_data = &am3517evm_tca6416_keys_info,
},
{
I2C_BOARD_INFO("tca6416", 0x21),
-- 
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


[PATCHv3 3/3] AM3517 EVM : Enable TCA6416 keypad.

2010-03-23 Thread Sriramakrishnan
Update kernel configuration for AM3517EVM to include
support for TCA6416 keypad.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..93d5fdf 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -527,6 +527,7 @@ CONFIG_SCSI_LOWLEVEL=y
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
 # CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
 
 #
 # Userland interfaces
@@ -539,7 +540,20 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_TCA6416=y
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
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: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Govindarajan, Sriramakrishnan


> -Original Message-
> From: Grazvydas Ignotas [mailto:nota...@gmail.com]
> Sent: Friday, March 12, 2010 4:54 PM
> To: Govindarajan, Sriramakrishnan
> Cc: linux-omap@vger.kernel.org; linux-in...@vger.kernel.org
> Subject: Re: [PATCHv2 0/3] Add support for TCA6416 based Keypad driver.
> 
> On Fri, Mar 12, 2010 at 11:18 AM, Sriramakrishnan  wrote:
> > AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO
> expander
> > User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
> > case with generic gpio-keypad driver individual keys do not generate an
> > interrupt event. Hence we implement a simple keypad driver, that
> > registers as direct I2C client.
> >
> > The implementation has been tested on AM3517 EVM with the driver tested
> > in polling mode.
> >
> > Version2 of the patch series addresses review comments from the earlier
> > posting - specifically redesigned to eliminate overhead of using
> gpio_keys
> > data structures.
> >
> > Sriramakrishnan (3):
> >  TCA6416 keypad : Implement keypad driver for keys interfaced to
> >    TCA6416
> >  AM3517: Board hookup for TCA6416 keypad driver.
> >  AM3517 EVM : Enable TCA6416 keypad.
> >
> >  arch/arm/configs/am3517_evm_defconfig   |   16 ++-
> >  arch/arm/mach-omap2/board-am3517evm.c   |   47 -
> >  drivers/input/keyboard/Kconfig          |   16 ++
> >  drivers/input/keyboard/Makefile         |    1 +
> >  drivers/input/keyboard/tca6416-keypad.c |  354
> +++
> >  include/linux/tca6416_keypad.h          |   34 +++
> >  6 files changed, 462 insertions(+), 6 deletions(-)
> >  mode change 100644 => 100755 arch/arm/mach-omap2/board-am3517evm.c
> >  create mode 100755 drivers/input/keyboard/tca6416-keypad.c
> >  create mode 100755 include/linux/tca6416_keypad.h
> 
> Please fix mode - remove +x flags.
[Sriram] Thanks for pointing out. I will await further review comments
And post the updated version thereafter
--
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


[PATCHv2 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-03-12 Thread Sriramakrishnan
This patch implements a simple Keypad driver that functions
as an I2C client. It handles key press events for keys
connected to TCA6416 I2C based IO expander.

Signed-off-by: Sriramakrishnan 
---
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 4 files changed, 405 insertions(+), 0 deletions(-)
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 64c1023..cf7fca9 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -192,6 +192,22 @@ config KEYBOARD_GPIO
  To compile this driver as a module, choose M here: the
  module will be called gpio_keys.
 
+config KEYBOARD_TCA6416
+   tristate "TCA6416 Keypad Support"
+   depends on I2C
+   help
+ This driver implements basic keypad functionality
+ for keys connected through TCA6416 IO expander
+
+ Say Y here if your device has keys connected to
+ TCA6416 IO expander. Your board-specific setup logic
+ must also provide pin-mask details(of which TCA6416 pins
+ are used for keypad).
+
+ If enabled the complete TCA6416 device will be managed through
+ this driver.
+
+
 config KEYBOARD_MATRIX
tristate "GPIO driven matrix keypad support"
depends on GENERIC_GPIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 706c6b5..47e267c 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_KEYBOARD_CORGI)  += corgikbd.o
 obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
 obj-$(CONFIG_KEYBOARD_EP93XX)  += ep93xx_keypad.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
+obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_IMX) += imx_keypad.o
diff --git a/drivers/input/keyboard/tca6416-keypad.c 
b/drivers/input/keyboard/tca6416-keypad.c
new file mode 100755
index 000..17df832
--- /dev/null
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -0,0 +1,354 @@
+/*
+ * Driver for keys on TCA6416 I2C IO expander
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author : Sriramakrishnan.A.G. 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TCA6416_INPUT  0
+#define TCA6416_OUTPUT 1
+#define TCA6416_INVERT 2
+#define TCA6416_DIRECTION  3
+
+static const struct i2c_device_id tca6416_id[] = {
+   { "tca6416-keys", 16, },
+   { }
+};
+MODULE_DEVICE_TABLE(i2c, tca6416_id);
+
+struct tca6416_drv_data {
+   struct input_dev *input;
+   struct tca6416_button data[0];
+};
+
+struct tca6416_keypad_chip {
+   uint16_t reg_output;
+   uint16_t reg_direction;
+   uint16_t reg_input;
+
+   struct i2c_client *client;
+   struct tca6416_drv_data  *drv_data;
+   struct delayed_work dwork;
+   uint16_t pinmask;
+   int irqnum;
+   int use_polling;
+};
+
+static int tca6416_write_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t val)
+{
+   int ret;
+
+   ret = i2c_smbus_write_word_data(chip->client, reg << 1, val);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed writing register\n");
+   return ret;
+   }
+
+   return 0;
+}
+
+static int tca6416_read_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t *val)
+{
+   int ret;
+
+   ret = i2c_smbus_read_word_data(chip->client, reg << 1);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed reading register\n");
+   return ret;
+   }
+
+   *val = (uint16_t)ret;
+   return 0;
+}
+
+static irqreturn_t tca6416_keys_isr(int irq, void *dev_id)
+{
+   struct tca6416_keypad_chip *chip =
+   (struct tca6416_keypad_chip *) dev_id;
+
+   disable_irq(irq);
+   schedule_delayed_work(&chip->dwork, 0);
+   return IRQ_HANDLED;
+
+}
+
+static void tca6416_keys_work_func(struct work_struct *workstruct)
+{
+   struct delayed_work *delay_work =
+   container_of(workstruct, struct delayed_work, work);
+   struct tca6416_keypad_chip *chip =
+   container_of(de

[PATCHv2 3/3] AM3517 EVM : Enable TCA6416 keypad.

2010-03-12 Thread Sriramakrishnan
Update kernel configuration for AM3517EVM to include
support for TCA6416 keypad.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..93d5fdf 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -527,6 +527,7 @@ CONFIG_SCSI_LOWLEVEL=y
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
 # CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
 
 #
 # Userland interfaces
@@ -539,7 +540,20 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_TCA6416=y
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
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


[PATCHv2 2/3] AM3517: Board hookup for TCA6416 keypad driver.

2010-03-12 Thread Sriramakrishnan
Add board specific hookup for TCA6416 keypad driver.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/board-am3517evm.c |   47 +---
 1 files changed, 42 insertions(+), 5 deletions(-)
 mode change 100644 => 100755 arch/arm/mach-omap2/board-am3517evm.c

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
old mode 100644
new mode 100755
index 6ae8805..d50e505
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,7 +20,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -88,16 +91,50 @@ static struct i2c_board_info __initdata 
am3517evm_tca6416_info_0[] = {
 };
 
 /* Mounted on UI Card */
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
+/* IO expander at address 0x20 on UI card will be managed by Keypad driver */
+
+static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 16,
 };
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 32,
+
+/*Keypad Initialization */
+#define KEYPAD_PIN_MASK0xFFC0
+
+#define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
+{  \
+   .type   = ev_type,  \
+   .code   = ev_code,  \
+   .active_low = act_low,  \
+}
+
+#define KEYPAD_BUTTON_LOW(event_code)  \
+   KEYPAD_BUTTON(EV_KEY, event_code, 1)
+
+static struct tca6416_button am3517_gpio_keys[] = {
+   KEYPAD_BUTTON_LOW(KEY_DOWN),
+   KEYPAD_BUTTON_LOW(KEY_UP),
+   KEYPAD_BUTTON_LOW(KEY_MENU),
+   KEYPAD_BUTTON_LOW(KEY_MODE),
+   KEYPAD_BUTTON_LOW(KEY_LEFTSHIFT),
+   KEYPAD_BUTTON_LOW(KEY_REWIND),
+   KEYPAD_BUTTON_LOW(KEY_FORWARD),
+   KEYPAD_BUTTON_LOW(KEY_STOP),
+   KEYPAD_BUTTON_LOW(KEY_PLAY),
+   KEYPAD_BUTTON_LOW(KEY_RECORD),
 };
+
+static struct tca6416_keys_platform_data am3517evm_tca6416_keys_info = {
+   .buttons= am3517_gpio_keys,
+   .nbuttons   = ARRAY_SIZE(am3517_gpio_keys),
+   .rep= 1,
+   .use_polling= 1,
+   .pinmask= KEYPAD_PIN_MASK,
+};
+
 static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
{
-   I2C_BOARD_INFO("tca6416", 0x20),
-   .platform_data = &am3517evm_ui_gpio_expander_info_1,
+   I2C_BOARD_INFO("tca6416-keys", 0x20),
+   .platform_data = &am3517evm_tca6416_keys_info,
},
{
I2C_BOARD_INFO("tca6416", 0x21),
-- 
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


[PATCHv2 0/3] Add support for TCA6416 based Keypad driver.

2010-03-12 Thread Sriramakrishnan
AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander
User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
case with generic gpio-keypad driver individual keys do not generate an
interrupt event. Hence we implement a simple keypad driver, that
registers as direct I2C client.

The implementation has been tested on AM3517 EVM with the driver tested
in polling mode.

Version2 of the patch series addresses review comments from the earlier
posting - specifically redesigned to eliminate overhead of using gpio_keys
data structures.

Sriramakrishnan (3):
  TCA6416 keypad : Implement keypad driver for keys interfaced to
TCA6416
  AM3517: Board hookup for TCA6416 keypad driver.
  AM3517 EVM : Enable TCA6416 keypad.

 arch/arm/configs/am3517_evm_defconfig   |   16 ++-
 arch/arm/mach-omap2/board-am3517evm.c   |   47 -
 drivers/input/keyboard/Kconfig  |   16 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  354 +++
 include/linux/tca6416_keypad.h  |   34 +++
 6 files changed, 462 insertions(+), 6 deletions(-)
 mode change 100644 => 100755 arch/arm/mach-omap2/board-am3517evm.c
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

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


[PATCH 1/4] AM35xx EMAC : define submodule offsets.

2010-03-11 Thread Sriramakrishnan
Define offsets for EMAC sub modules.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/include/mach/am35xx.h |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h 
b/arch/arm/mach-omap2/include/mach/am35xx.h
index a705f94..472867e 100644
--- a/arch/arm/mach-omap2/include/mach/am35xx.h
+++ b/arch/arm/mach-omap2/include/mach/am35xx.h
@@ -23,4 +23,13 @@
 #define AM35XX_IPSS_HECC_BASE  0x5C05
 #define AM35XX_IPSS_VPFE_BASE  0x5C06
 
-#endif /*  __ASM_ARCH_AM35XX_H */
+#define AM35XX_EMAC_CNTRL_OFFSET   (0x1)
+#define AM35XX_EMAC_CNTRL_MOD_OFFSET   (0x0)
+#define AM35XX_EMAC_CNTRL_RAM_OFFSET   (0x2)
+#define AM35XX_EMAC_MDIO_OFFSET(0x3)
+#define AM35XX_EMAC_CNTRL_RAM_SIZE (0x2000)
+#define AM35XX_EMAC_RAM_ADDR   (AM3517_EMAC_BASE + \
+   AM3517_EMAC_CNTRL_RAM_OFFSET)
+#define AM35XX_EMAC_HW_RAM_ADDR(0x01E2)
+
+#endif  /*  __ASM_ARCH_AM35XX_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 2/4] AM35xx : Platform specific hookup for EMAC module

2010-03-11 Thread Sriramakrishnan
Modified AM35xx EVM init sequence to handle EMAC
initialization.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/board-am3517evm.c |   98 +
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index 6ae8805..a454995 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -30,11 +31,106 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include "mux.h"
 
+#define AM35XX_EVM_PHY_MASK(0xF)
+#define AM35XX_EVM_MDIO_FREQUENCY  (100)
+
+static struct emac_platform_data am3517_evm_emac_pdata = {
+   .phy_mask   = AM35XX_EVM_PHY_MASK,
+   .mdio_max_freq  = AM35XX_EVM_MDIO_FREQUENCY,
+   .rmii_en= 1,
+};
+
+static struct resource am3517_emac_resources[] = {
+   {
+   .start  = AM35XX_IPSS_EMAC_BASE,
+   .end= AM35XX_IPSS_EMAC_BASE + 0x3,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .end= INT_35XX_EMAC_C0_RXTHRESH_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_RX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_TX_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+   {
+   .start  = INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .end= INT_35XX_EMAC_C0_MISC_PULSE_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_emac_device = {
+   .name   = "davinci_emac",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_emac_resources),
+   .resource   = am3517_emac_resources,
+};
+
+static void am3517_enable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_MISC_PULSE_CLR |
+   AM35XX_CPGMAC_C0_RX_THRESH_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am3517_disable_ethernet_int(void)
+{
+   u32 regval;
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR |
+   AM35XX_CPGMAC_C0_TX_PULSE_CLR);
+   omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+void am3517_evm_ethernet_init(struct emac_platform_data *pdata)
+{
+   unsigned int regval;
+
+   pdata->ctrl_reg_offset  = AM35XX_EMAC_CNTRL_OFFSET;
+   pdata->ctrl_mod_reg_offset  = AM35XX_EMAC_CNTRL_MOD_OFFSET;
+   pdata->ctrl_ram_offset  = AM35XX_EMAC_CNTRL_RAM_OFFSET;
+   pdata->mdio_reg_offset  = AM35XX_EMAC_MDIO_OFFSET;
+   pdata->ctrl_ram_size= AM35XX_EMAC_CNTRL_RAM_SIZE;
+   pdata->version  = EMAC_VERSION_2;
+   pdata->hw_ram_addr  = AM35XX_EMAC_HW_RAM_ADDR;
+   pdata->interrupt_enable = am3517_enable_ethernet_int;
+   pdata->interrupt_disable= am3517_disable_ethernet_int;
+   am3517_emac_device.dev.platform_data= pdata;
+   platform_device_register(&am3517_emac_device);
+
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+   regval = regval & (~(AM35XX_CPGMACSS_SW_RST));
+   omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+   regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+   return ;
+}
+
+
+
 #define LCD_PANEL_PWR  176
 #define LCD_PANEL_BKLIGHT_PWR  182
 #define LCD_PANEL_PWM  181
@@ -313,6 +409,8 @@ static void __init am3517_evm_init(void)
 
i2c_register_board_info(1, am3517evm_i2c_boardinfo,
ARRAY_SIZE(am3517evm_i2c_boardinfo));
+   /*Ethernet*/
+   am3517_evm_ethernet_init(&am3517_evm_emac_pdata);
 }
 
 static void __init am3517_evm_map_io(void)
-- 
1.6.2.4

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


[PATCH 4/4] AM3517 defconfig update : enable EMAC support

2010-03-11 Thread Sriramakrishnan
Update the default configuration for AM3517EVM to enable
support for EMAC peripheral.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   70 -
 1 files changed, 69 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 66a10b5..8d79b20 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -517,7 +517,75 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_OSD_INITIATOR is not set
 # CONFIG_ATA is not set
 # CONFIG_MD is not set
-# CONFIG_NETDEVICES is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+CONFIG_TI_DAVINCI_EMAC=y
+# CONFIG_DM9000 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8842 is not set
+# CONFIG_KS8851_MLL is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_1 is not set
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
 # CONFIG_ISDN is not set
 # CONFIG_PHONE is not set
 
-- 
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 0/4] AM35xx : Add support for EMAC Peripheral

2010-03-11 Thread Sriramakrishnan
This patch series adds support for EMAC peripheral on AM35xx
platform. The EMAC peripheral is borrowed from the DaVinci
platform and hence the same driver(davinci_emac) is used.

This patch series has been generated against tip of linux-omap and
depends on the following patches submitted to netdev/linux-davinci
list.

[1].http://patchwork.ozlabs.org/patch/47331/
[2].http://patchwork.ozlabs.org/patch/47332/

Sriramakrishnan (4):
  AM35xx EMAC : define submodule offsets.
  AM35xx : Platform specific hookup for EMAC module
  OMAP3 : clock data: Update name string for EMAC clocks.
  AM3517 defconfig update : enable EMAC support

 arch/arm/configs/am3517_evm_defconfig |   70 -
 arch/arm/mach-omap2/board-am3517evm.c |   98 +
 arch/arm/mach-omap2/clock3xxx_data.c  |4 +-
 arch/arm/mach-omap2/include/mach/am35xx.h |   11 +++-
 4 files changed, 179 insertions(+), 4 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 3/4] OMAP3 : clock data: Update name string for EMAC clocks.

2010-03-11 Thread Sriramakrishnan
The emac driver uses generic name for the module and phy
clocks. Updated the omap3xxx_clks table to match the names
used by the Davinci emac driver.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/clock3xxx_data.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index d5153b6..989da2e 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3472,8 +3472,8 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   "ipss_ick", &ipss_ick,  CK_AM35XX),
CLK(NULL,   "rmii_ck",  &rmii_ck,   CK_AM35XX),
CLK(NULL,   "pclk_ck",  &pclk_ck,   CK_AM35XX),
-   CLK("davinci_emac", "ick",  &emac_ick,  CK_AM35XX),
-   CLK("davinci_emac", "fck",  &emac_fck,  CK_AM35XX),
+   CLK("davinci_emac", "emac_clk", &emac_ick,  CK_AM35XX),
+   CLK("davinci_emac", "phy_clk",  &emac_fck,  CK_AM35XX),
CLK("vpfe-capture", "master",   &vpfe_ick,  CK_AM35XX),
CLK("vpfe-capture", "slave",&vpfe_fck,  CK_AM35XX),
CLK("musb_hdrc","ick",  &hsotgusb_ick_am35xx,   
CK_AM35XX),
-- 
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 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-03-05 Thread Govindarajan, Sriramakrishnan


> -Original Message-
> From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com]
> Sent: Saturday, February 27, 2010 2:30 PM
> To: Govindarajan, Sriramakrishnan
> Cc: Felipe Balbi; linux-omap@vger.kernel.org; linux-in...@vger.kernel.org
> Subject: Re: [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys
> interfaced to TCA6416

---snip---
> > > > I see,
> > > >
> > > > shouldn't you instead provide a gpiolib driver for tca6416 and use
> the
> > > > generic gpio_keys driver ??
> > > >
> > >
> > > Right. The fact that the driver precludes all otehr gpios from being
> > > used is a major drawback.
> 
> > [Sriram] gpio_keys implementation assumes that every key can generate
> > an interrupt to the processor and also the state machine to process
> > events will handle each line individually. Imagine if 16 keys are
> > connected to the TCA controller and you have to query(assume it is
> > polling, interrupt mode not possible - as you have single interrupt
> > line to the processor for event on any of the 16 input lines) 16 lines
> > individually over i2c bus - the associated overhead is too high.
> > Instead this implementation handles the necessary book-keeping in one
> > simple function (get status of all 16 lines in one read transaction).
> > Building on a GPIO implementation and using gpio-keys above will be
> > both clumsy and incur runtime overhead as against a direct keypad
> > driver.
> >
> > More often(as on AM3517EVM) the keypad keys are not mixed with other
> > GPIO keys. The initial implementation includes key_mask to identify
> > the keys to be used for keypad and the others are logically not
> > modified. Hence the implementation can be extended if need arises to
> > overcome this restriction.
> 
> In this case you should not build on gpio_keys at all but select some
> other keyboard as an example that smply uses keytable with set of
> keycodes, single interrupt, etc. The overhead of all gpio_keys data
> structures is not needed here.
> 
[Sriram] I am working on cleaning up the driver to use a simpler book keeping 
structure(move away from gpio_keys). Will post the reworked patch shortly.

---snip ---
> 
> > [Sriram] All the core logic (including I2C transactions) is
> > implemented through a work queue implementation. The ISR is slim and
> > only schedules the work queue. This also enables the implementation to
> > be easily adaptable for both interrupt/polled mode.
> >
> 
> Fair enough but you need to ensure that you do not leave irq unbalances
> (in regards to enable/disable) when you using workqueue and disabling
> interrupt in the ISR.

[Sriram] Will ensure that this is addressed appropriately (including cleanup on 
error conditions).

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


RE: [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-02-26 Thread Govindarajan, Sriramakrishnan

> -Original Message-
> From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com]
> Sent: Friday, February 26, 2010 1:58 PM
> To: Felipe Balbi
> Cc: Govindarajan, Sriramakrishnan; linux-omap@vger.kernel.org; linux-
> in...@vger.kernel.org
> Subject: Re: [PATCH 1/3] TCA6416 keypad : Implement keypad driver for keys
> interfaced to TCA6416
> 
> On Thu, Feb 25, 2010 at 08:47:03PM +0200, Felipe Balbi wrote:
> > Hi,
> >
> > On Thu, Feb 25, 2010 at 06:44:59PM +0530, Sriramakrishnan wrote:
> > > This patch implements a simple Keypad driver that functions
> > > as an I2C client. It handles key press events for keys
> > > connected to TCA6416 I2C based IO expander.
> >
> > what's wrong with gpio-keys ??
> >
> > > + * Implementation based on drivers/input/keyboard/gpio_keys.c
> >
> > I see,
> >
> > shouldn't you instead provide a gpiolib driver for tca6416 and use the
> > generic gpio_keys driver ??
> >
> 
> Right. The fact that the driver precludes all otehr gpios from being
> used is a major drawback.
[Sriram] gpio_keys implementation assumes that every key can generate an 
interrupt to the processor and also the state machine to process events will 
handle each line individually. Imagine if 16 keys are connected to the TCA 
controller and you have to query(assume it is polling, interrupt mode not 
possible - as you have single interrupt line to the processor for event on any 
of the 16 input lines) 16 lines individually over i2c bus - the associated 
overhead is too high. Instead this implementation handles the necessary 
book-keeping in one simple function (get status of all 16 lines in one read 
transaction). Building on a GPIO implementation and using gpio-keys above will 
be both clumsy and incur runtime overhead as against a direct keypad driver.

More often(as on AM3517EVM) the keypad keys are not mixed with other GPIO keys. 
The initial implementation includes key_mask to identify the keys to be used 
for keypad and the others are logically not modified. Hence the implementation 
can be extended if need arises to overcome this restriction.
> 
> 
> > > + if (!chip->use_polling) {
> >
> > IMO, you should only use polling if the irq line isn't connected.
> >
> > > + if (pdata->irq_is_gpio)
> > > + chip->irqnum = gpio_to_irq(pdata->irqnum);
> >
> > you can pass the irq number via i2c_board_info. Use it.
> >
> > > + else
> > > + chip->irqnum = pdata->irqnum;
> > > +
> > > + ret = request_irq(chip->irqnum, tca6416_keys_isr,
> >
> > it's an i2c driver!!! this should be request_threaded_irq()
> >
> 
> Threaded IRQ probably does not fit well when you want to support both
> interrupt and polling in the same driver...
[Sriram] All the core logic (including I2C transactions) is implemented through 
a work queue implementation. The ISR is slim and only schedules the work queue. 
This also enables the implementation to be easily adaptable for both 
interrupt/polled mode.

--
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 v2 2/2] can:ti_hecc: Enable CAN support on AM3517.

2010-02-26 Thread Sriramakrishnan
Modify the default kernel configuration on AM3517 to enable CAN.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   22 ++
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index abe9966..d5e15ba 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -422,15 +422,29 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=y
+CONFIG_CAN_DEV=y
+CONFIG_CAN_CALC_BITTIMING=y
+CONFIG_CAN_TI_HECC=y
+# CONFIG_CAN_SJA1000 is not set
+
+#
+# CAN USB interfaces
+#
+# CONFIG_CAN_EMS_USB is not set
+CONFIG_CAN_DEBUG_DEVICES=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
 CONFIG_WIRELESS=y
 # CONFIG_CFG80211 is not set
-CONFIG_CFG80211_DEFAULT_PS_VALUE=0
-# CONFIG_WIRELESS_OLD_REGULATORY is not set
-# CONFIG_WIRELESS_EXT is not set
 # CONFIG_LIB80211 is not set
 
 #
-- 
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 v2 1/2] can:ti_hecc: board specific hookup on AM3517EVM

2010-02-26 Thread Sriramakrishnan
Add board specific hookup for TI HECC driver on
AM3517 EVM

Signed-off-by: Sriramakrishnan 
---
Addressed review comments about formatting and patch ordering.

 arch/arm/mach-omap2/board-am3517evm.c |   38 +
 arch/arm/mach-omap2/include/mach/am35xx.h |9 +++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index e6b8967..ddcfa07 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -292,6 +293,42 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+
+static struct resource am3517_hecc_resources[] = {
+   {
+   .start  = AM35XX_IPSS_HECC_BASE,
+   .end= AM35XX_IPSS_HECC_BASE + 0x3FFF,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_HECC0_IRQ,
+   .end= INT_35XX_HECC0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_hecc_device = {
+   .name   = "ti_hecc",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_hecc_resources),
+   .resource   = am3517_hecc_resources,
+};
+
+static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
+   .scc_hecc_offset= AM35XX_HECC_SCC_HECC_OFFSET,
+   .scc_ram_offset = AM35XX_HECC_SCC_RAM_OFFSET,
+   .hecc_ram_offset= AM35XX_HECC_RAM_OFFSET,
+   .mbx_offset = AM35XX_HECC_MBOX_OFFSET,
+   .int_line   = AM35XX_HECC_INT_LINE,
+   .version= AM35XX_HECC_VERSION,
+};
+
+static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
+{
+   am3517_hecc_device.dev.platform_data = pdata;
+   platform_device_register(&am3517_hecc_device);
+}
+
 static void __init am3517_evm_init(void)
 {
am3517_evm_i2c_init();
@@ -302,6 +339,7 @@ static void __init am3517_evm_init(void)
 
omap_serial_init();
usb_ehci_init(&ehci_pdata);
+   am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
/* DSS */
am3517_evm_display_init();
 
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h 
b/arch/arm/mach-omap2/include/mach/am35xx.h
index a705f94..0636263 100644
--- a/arch/arm/mach-omap2/include/mach/am35xx.h
+++ b/arch/arm/mach-omap2/include/mach/am35xx.h
@@ -23,4 +23,13 @@
 #define AM35XX_IPSS_HECC_BASE  0x5C05
 #define AM35XX_IPSS_VPFE_BASE  0x5C06
 
+
+/* HECC module specifc offset definitions */
+#define AM35XX_HECC_SCC_HECC_OFFSET(0x0)
+#define AM35XX_HECC_SCC_RAM_OFFSET (0x3000)
+#define AM35XX_HECC_RAM_OFFSET (0x3000)
+#define AM35XX_HECC_MBOX_OFFSET(0x2000)
+#define AM35XX_HECC_INT_LINE   (0x0)
+#define AM35XX_HECC_VERSION(0x1)
+
 #endif /*  __ASM_ARCH_AM35XX_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 v2 0/2] Enable CAN peripheral support on AM3517

2010-02-26 Thread Sriramakrishnan
AM3517 platform includes the ti-hecc CAN peripheral. This patch
series enables support for the ti-hecc peripheral on AM3517 platform.
This patch series has been validated on AM3517EVM.

This patch is generated against tip of linux-omap.

Sriramakrishnan (2):
  can:ti_hecc: board specific hookup on AM3517EVM
  can:ti_hecc: Enable CAN support on AM3517.

 arch/arm/configs/am3517_evm_defconfig |   22 +---
 arch/arm/mach-omap2/board-am3517evm.c |   38 +
 arch/arm/mach-omap2/include/mach/am35xx.h |9 +++
 3 files changed, 65 insertions(+), 4 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


RE: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM

2010-02-26 Thread Govindarajan, Sriramakrishnan

> -Original Message-
> From: Tony Lindgren [mailto:t...@atomide.com]
> Sent: Friday, February 26, 2010 3:34 AM
> To: Govindarajan, Sriramakrishnan
> Cc: linux-omap@vger.kernel.org; Gole, Anant
> Subject: Re: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM
> 
> * Sriramakrishnan  [100222 22:35]:
> > Add board specific hookup for TI HECC driver on
> > AM3517 EVM
> >
> > Signed-off-by: Sriramakrishnan 
> > Acked-by: Anant Gole 
> > ---
> > The driver requires that CAN_STB signal be driven low to enable
> > CAN PHY. Currently this is being managed from U-boot. Will submit a
> patch
> > for handling this as part of board init sequence.
> >
> >  arch/arm/mach-omap2/board-am3517evm.c |   38
> +
> >  arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++
> >  2 files changed, 48 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-
> omap2/board-am3517evm.c
> > index af99faf..42013b5 100644
> > --- a/arch/arm/mach-omap2/board-am3517evm.c
> > +++ b/arch/arm/mach-omap2/board-am3517evm.c
> > @@ -20,6 +20,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
--- snip 
> > +
> > +static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
> > +   .scc_hecc_offset= AM35XX_HECC_SCC_HECC_OFFSET,
> > +   .scc_ram_offset = AM35XX_HECC_SCC_RAM_OFFSET,
> > +   .hecc_ram_offset= AM35XX_HECC_RAM_OFFSET,
> > +   .mbx_offset= AM35XX_HECC_MBOX_OFFSET,
> > +   .int_line   = AM35XX_HECC_INT_LINE,
> > +   .version= AM35XX_HECC_VERSION,
> > +};
> 
> The formatting above should use tabs instead of spaces. Please
> check and run checkpatch.pl --strict on this.
> 
> Also, sounds like the Kconfig changes should be 2/2, not 1/2
> to enable this.
> 
> Tony
> 
[Sriram] Tony, I did verify the patch with checkpatch(log below) but 
Somehow, it didn't flag any formatting errors. I realize that there are spaces 
that need to be converted to tabs. I will re-generate the patch and also 
re-order the patches as pointed out.

$scripts/checkpatch.pl --strict 
2-2-can-ti_hecc-board-specific-hookup-on-AM3517EVM.patch
total: 0 errors, 0 warnings, 0 checks, 70 lines checked

2-2-can-ti_hecc-board-specific-hookup-on-AM3517EVM.patch has no obvious style 
problems and is ready for submission.
--
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] PCA953x : Fix compilation warning.

2010-02-25 Thread Sriramakrishnan
The platform data structure defined in pca953x header file
includes references to i2c data structures. Unless the i2c.h
file is included ahead of pca953x.h, compiler warning would
be generated wherever pca953x header file is included. Added
i2c.h to the pca953x.h itself to remove this dependency.

Also included conditional compile macros to guard against
multiple inclusion.

Signed-off-by: Sriramakrishnan 
---
 include/linux/i2c/pca953x.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index 81736d6..1284a2d 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -1,3 +1,8 @@
+#ifndef __LINUX_PCA953X_H
+#define __LINUX_PCA953X_H
+
+#include 
+
 /* platform data for the PCA9539 16-bit I/O expander driver */
 
 struct pca953x_platform_data {
@@ -17,3 +22,4 @@ struct pca953x_platform_data {
void *context);
char**names;
 };
+#endif
-- 
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 1/3] TCA6416 keypad : Implement keypad driver for keys interfaced to TCA6416

2010-02-25 Thread Sriramakrishnan
This patch implements a simple Keypad driver that functions
as an I2C client. It handles key press events for keys
connected to TCA6416 I2C based IO expander.

Signed-off-by: Sriramakrishnan 
---
 drivers/input/keyboard/Kconfig  |   17 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  355 +++
 include/linux/tca6416_keypad.h  |   30 +++
 4 files changed, 403 insertions(+), 0 deletions(-)
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 02c836e..c2cd31b 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -190,6 +190,23 @@ config KEYBOARD_GPIO
  To compile this driver as a module, choose M here: the
  module will be called gpio_keys.
 
+config KEYBOARD_TCA6416
+   tristate "TCA6416 Keypad Support"
+   depends on I2C
+   help
+ This driver implements basic keypad functionality
+ for keys connected through TCA6416 IO expander
+
+ Say Y here if your device has keys connected to
+ TCA6416 IO expander. Your board-specific setup logic
+ must also provide pin-mask details(of which TCA6416 pins
+ are used for keypad).
+
+ If enabled the complete TCA6416 device will be managed through
+ this driver(precludes gpio interface for remaining pins on
+ TCA6416)
+
+
 config KEYBOARD_MATRIX
tristate "GPIO driven matrix keypad support"
depends on GENERIC_GPIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 78654ef..0f1ad54 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_KEYBOARD_CORGI)  += corgikbd.o
 obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
 obj-$(CONFIG_KEYBOARD_EP93XX)  += ep93xx_keypad.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
+obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_HP6XX)   += jornada680_kbd.o
diff --git a/drivers/input/keyboard/tca6416-keypad.c 
b/drivers/input/keyboard/tca6416-keypad.c
new file mode 100755
index 000..4c1ba1e
--- /dev/null
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -0,0 +1,355 @@
+/*
+ * Driver for keys on TCA6416 I2C IO expander
+ *
+ * Implementation based on drivers/input/keyboard/gpio_keys.c
+ *
+ * Copyright (C) 2010 Texas Instruments
+ *
+ * Author : Sriramakrishnan.A.G. 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TCA6416_INPUT  0
+#define TCA6416_OUTPUT 1
+#define TCA6416_INVERT 2
+#define TCA6416_DIRECTION  3
+
+static const struct i2c_device_id tca6416_id[] = {
+   { "tca6416-keys", 16, },
+   { }
+};
+MODULE_DEVICE_TABLE(i2c, tca6416_id);
+
+struct tca6416_button_data {
+   struct gpio_keys_button *button;
+   struct input_dev *input;
+};
+
+struct tca6416_drv_data {
+   struct input_dev *input;
+   struct tca6416_button_data data[0];
+};
+
+struct tca6416_keypad_chip {
+   uint16_t reg_output;
+   uint16_t reg_direction;
+   uint16_t reg_input;
+
+   struct i2c_client *client;
+   struct tca6416_drv_data  *drv_data;
+   struct delayed_work dwork;
+   uint16_t pinmask;
+   int irqnum;
+   int use_polling;
+};
+
+static int tca6416_write_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t val)
+{
+   int ret;
+
+   ret = i2c_smbus_write_word_data(chip->client, reg << 1, val);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed writing register\n");
+   return ret;
+   }
+
+   return 0;
+}
+
+static int tca6416_read_reg(struct tca6416_keypad_chip *chip, int reg,
+   uint16_t *val)
+{
+   int ret;
+
+   ret = i2c_smbus_read_word_data(chip->client, reg << 1);
+
+   if (ret < 0) {
+   dev_err(&chip->client->dev, "failed reading register\n");
+   return ret;
+   }
+
+   *val = (uint16_t)ret;
+   return 0;
+}
+
+static irqreturn_t tca6416_keys_isr(int irq, void *dev_id)
+{
+   struct tca6416_keypad_chip *chip =
+   (struct tca6416_keypad_chip *) dev_id;
+
+   disable_irq(irq);
+   schedule_delayed_work(&chip->dwork, 0);
+   return IRQ_HANDLED;
+
+}
+
+static v

[PATCH 2/3] AM3517 EVM : Enable TCA6416 keypad

2010-02-25 Thread Sriramakrishnan
Update kernel configuration for AM3517EVM to include
support for TCA6416 keypad.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 04a804b..439ba7f 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -539,7 +539,20 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_KEYBOARD_TCA6416=y
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
-- 
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 3/3] AM3517: Board hookup for TCA6416 keypad driver.

2010-02-25 Thread Sriramakrishnan
Add board specific hookup for TCA6416 keypad driver.

Signed-off-by: Sriramakrishnan 
---
This patch depends on "AM3517EVM : correct typo - tca6416 mispelt as tca6516"
patch submitted earlier.
[1] http://marc.info/?l=linux-omap&m=126709475619102&w=2


 arch/arm/mach-omap2/board-am3517evm.c |   48 +---
 1 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index b336adc..a8228b7 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,7 +20,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -88,16 +91,51 @@ static struct i2c_board_info __initdata 
am3517evm_tca6416_info_0[] = {
 };
 
 /* Mounted on UI Card */
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
+/* IO expander at address 0x20 on UI card will be managed by Keypad driver */
+
+static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 16,
 };
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 32,
+
+/*Keypad Initialization */
+#define KEYPAD_PIN_MASK0xFFC0
+
+#define KEYPAD_BUTTON(ev_type, ev_code, act_low, descr) \
+{   \
+   .type   = ev_type,  \
+   .code   = ev_code,  \
+   .active_low = act_low,  \
+   .desc   = "btn " descr, \
+}
+
+#define KEYPAD_BUTTON_LOW(event_code, description)  \
+   KEYPAD_BUTTON(EV_KEY, event_code, 1, description)
+
+static struct gpio_keys_button am3517_gpio_keys[] = {
+   KEYPAD_BUTTON_LOW(KEY_DOWN, "down"),
+   KEYPAD_BUTTON_LOW(KEY_UP, "up"),
+   KEYPAD_BUTTON_LOW(KEY_MENU, "menu"),
+   KEYPAD_BUTTON_LOW(KEY_MODE, "mode"),
+   KEYPAD_BUTTON_LOW(KEY_LEFTSHIFT, "shift"),
+   KEYPAD_BUTTON_LOW(KEY_REWIND, "rewind"),
+   KEYPAD_BUTTON_LOW(KEY_FORWARD, "forward"),
+   KEYPAD_BUTTON_LOW(KEY_STOP, "stop"),
+   KEYPAD_BUTTON_LOW(KEY_PLAY, "play"),
+   KEYPAD_BUTTON_LOW(KEY_RECORD, "rec"),
 };
+
+static struct tca6416_keys_platform_data am3517evm_tca6416_keys_info = {
+   .buttons= am3517_gpio_keys,
+   .nbuttons   = ARRAY_SIZE(am3517_gpio_keys),
+   .rep= 0,
+   .use_polling= 1,
+   .pinmask= KEYPAD_PIN_MASK,
+};
+
 static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
{
-   I2C_BOARD_INFO("tca6416", 0x20),
-   .platform_data = &am3517evm_ui_gpio_expander_info_1,
+   I2C_BOARD_INFO("tca6416-keys", 0x20),
+   .platform_data = &am3517evm_tca6416_keys_info,
},
{
I2C_BOARD_INFO("tca6416", 0x21),
-- 
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 0/3] Add support for TCA6416 based Keypad driver.

2010-02-25 Thread Sriramakrishnan
AM3517 EVM with APPS board includes keys interfaced to TCA6416 IO expander.
User keys are connected as GPIO lines to TCA6416 IO expander. Unlike the
case with generic gpio-keypad driver individual keys do not generate an
interrupt event. Hence we implement a simple keypad driver(based on gpio-keys)
that registers as direct I2C client.

The implementation has been tested on AM3517 EVM with the driver tested
in polling mode.

Sriramakrishnan (3):
  TCA6416 keypad : Implement keypad driver for keys interfaced to
TCA6416
  AM3517 EVM : Enable TCA6416 keypad
  AM3517: Board hookup for TCA6416 keypad driver.

 arch/arm/configs/am3517_evm_defconfig   |   15 ++-
 arch/arm/mach-omap2/board-am3517evm.c   |   48 -
 drivers/input/keyboard/Kconfig  |   17 ++
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/tca6416-keypad.c |  355 +++
 include/linux/tca6416_keypad.h  |   30 +++
 6 files changed, 460 insertions(+), 6 deletions(-)
 create mode 100755 drivers/input/keyboard/tca6416-keypad.c
 create mode 100755 include/linux/tca6416_keypad.h

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


[PATCH 1/2] AM3517 EVM: Enable I2C support.

2010-02-25 Thread Sriramakrishnan
There are multiple devices connected to I2C bus on AM3517EVM
(for instance audio codec, IO expander etc). Enable I2C support
in the default kernel configuration for AM3517 EVM.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/am3517_evm_defconfig |   41 -
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index abe9966..04a804b 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -590,7 +590,46 @@ CONFIG_HW_RANDOM=y
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
-# CONFIG_I2C is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_OMAP=y
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 # CONFIG_SPI is not set
 
 #
-- 
1.6.2.4

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


[PATCH 2/2] AM3517EVM : correct typo - tca6416 mispelt as tca6516.

2010-02-25 Thread Sriramakrishnan
Correct instances where tca6416 is misspelt as tca6516 in
the board-am3517evm file.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/mach-omap2/board-am3517evm.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index e6b8967..b336adc 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -80,7 +80,7 @@ static void __init am3517_evm_rtc_init(void)
 static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
.gpio_base  = OMAP_MAX_GPIO_LINES,
 };
-static struct i2c_board_info __initdata am3517evm_tca6516_info_0[] = {
+static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = {
{
I2C_BOARD_INFO("tca6416", 0x21),
.platform_data = &am3517evm_gpio_expander_info_0,
@@ -94,7 +94,7 @@ static struct pca953x_platform_data 
am3517evm_ui_gpio_expander_info_1 = {
 static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
.gpio_base  = OMAP_MAX_GPIO_LINES + 32,
 };
-static struct i2c_board_info __initdata am3517evm_ui_tca6516_info[] = {
+static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = {
{
I2C_BOARD_INFO("tca6416", 0x20),
.platform_data = &am3517evm_ui_gpio_expander_info_1,
@@ -108,10 +108,10 @@ static struct i2c_board_info __initdata 
am3517evm_ui_tca6516_info[] = {
 static int __init am3517_evm_i2c_init(void)
 {
omap_register_i2c_bus(1, 400, NULL, 0);
-   omap_register_i2c_bus(2, 400, am3517evm_tca6516_info_0,
-   ARRAY_SIZE(am3517evm_tca6516_info_0));
-   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6516_info,
-   ARRAY_SIZE(am3517evm_ui_tca6516_info));
+   omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0,
+   ARRAY_SIZE(am3517evm_tca6416_info_0));
+   omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info,
+   ARRAY_SIZE(am3517evm_ui_tca6416_info));
 
return 0;
 }
-- 
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 1/2] can:ti_hecc: Enable CAN support on AM3517.

2010-02-22 Thread Sriramakrishnan
Modify the default kernel configuration on AM3517 to enable CAN.

Signed-off-by: Sriramakrishnan 
Acked-by: Anant Gole 
---
 arch/arm/configs/am3517_evm_defconfig |   22 ++
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index abe9966..d5e15ba 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -422,15 +422,29 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=y
+CONFIG_CAN_DEV=y
+CONFIG_CAN_CALC_BITTIMING=y
+CONFIG_CAN_TI_HECC=y
+# CONFIG_CAN_SJA1000 is not set
+
+#
+# CAN USB interfaces
+#
+# CONFIG_CAN_EMS_USB is not set
+CONFIG_CAN_DEBUG_DEVICES=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
 CONFIG_WIRELESS=y
 # CONFIG_CFG80211 is not set
-CONFIG_CFG80211_DEFAULT_PS_VALUE=0
-# CONFIG_WIRELESS_OLD_REGULATORY is not set
-# CONFIG_WIRELESS_EXT is not set
 # CONFIG_LIB80211 is not set
 
 #
-- 
1.6.2.4

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


[PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM

2010-02-22 Thread Sriramakrishnan
Add board specific hookup for TI HECC driver on
AM3517 EVM

Signed-off-by: Sriramakrishnan 
Acked-by: Anant Gole 
---
The driver requires that CAN_STB signal be driven low to enable
CAN PHY. Currently this is being managed from U-boot. Will submit a patch
for handling this as part of board init sequence.

 arch/arm/mach-omap2/board-am3517evm.c |   38 +
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
index af99faf..42013b5 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -223,6 +224,42 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux  NULL
 #endif
 
+
+static struct resource am3517_hecc_resources[] = {
+   {
+   .start  = AM35XX_IPSS_HECC_BASE,
+   .end= AM35XX_IPSS_HECC_BASE + 0x3FFF,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = INT_35XX_HECC0_IRQ,
+   .end= INT_35XX_HECC0_IRQ,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device am3517_hecc_device = {
+   .name   = "ti_hecc",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(am3517_hecc_resources),
+   .resource   = am3517_hecc_resources,
+};
+
+static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
+   .scc_hecc_offset= AM35XX_HECC_SCC_HECC_OFFSET,
+   .scc_ram_offset = AM35XX_HECC_SCC_RAM_OFFSET,
+   .hecc_ram_offset= AM35XX_HECC_RAM_OFFSET,
+   .mbx_offset= AM35XX_HECC_MBOX_OFFSET,
+   .int_line   = AM35XX_HECC_INT_LINE,
+   .version= AM35XX_HECC_VERSION,
+};
+
+static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
+{
+   am3517_hecc_device.dev.platform_data = pdata;
+   platform_device_register(&am3517_hecc_device);
+}
+
 static void __init am3517_evm_init(void)
 {
am3517_evm_i2c_init();
@@ -233,6 +270,7 @@ static void __init am3517_evm_init(void)
 
omap_serial_init();
usb_ehci_init(&ehci_pdata);
+   am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
/* DSS */
am3517_evm_display_init();
 }
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h 
b/arch/arm/mach-omap2/include/mach/am35xx.h
index a705f94..6d5429b 100644
--- a/arch/arm/mach-omap2/include/mach/am35xx.h
+++ b/arch/arm/mach-omap2/include/mach/am35xx.h
@@ -23,4 +23,14 @@
 #define AM35XX_IPSS_HECC_BASE  0x5C05
 #define AM35XX_IPSS_VPFE_BASE  0x5C06
 
+
+/* HECC module specifc offset definitions */
+#define AM35XX_HECC_SCC_HECC_OFFSET(0x0)
+#define AM35XX_HECC_SCC_RAM_OFFSET (0x3000)
+#define AM35XX_HECC_RAM_OFFSET (0x3000)
+#define AM35XX_HECC_MBOX_OFFSET(0x2000)
+#define AM35XX_HECC_INT_LINE   (0x0)
+#define AM35XX_HECC_VERSION(0x1)
+
+
 #endif /*  __ASM_ARCH_AM35XX_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 0/2] Enable CAN peripheral support on AM3517

2010-02-22 Thread Sriramakrishnan
AM3517 platform includes the ti-hecc CAN peripheral. This patch
series enables support for the ti-hecc peripheral on AM3517 platform.
This patch series has been validated on AM3517EVM.

The patch series is dependent on AM35x clock support patches submitted
earlier.
[1].http://marc.info/?l=linux-omap&m=126628362713703&w=2
[2].http://marc.info/?l=linux-omap&m=126628364013734&w=2

Sriramakrishnan (2):
  can:ti_hecc: Enable CAN support on AM3517.
  can:ti_hecc: board specific hookup on AM3517EVM

 arch/arm/configs/am3517_evm_defconfig |   22 +---
 arch/arm/mach-omap2/board-am3517evm.c |   38 +
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++
 3 files changed, 66 insertions(+), 4 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


RE: [PATCH] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP

2010-01-11 Thread Govindarajan, Sriramakrishnan
From: Menon, Nishanth
> Sent: Friday, January 08, 2010 8:33 PM
> To: Govindarajan, Sriramakrishnan
> Cc: linux-omap@vger.kernel.org; Syed Mohammed, Khasim; Nori, Sekhar
> Subject: Re: [PATCH] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for
> OMAP
> 
> Govindarajan, Sriramakrishnan had written, on 01/08/2010 02:15 AM, the
> following:
> >
> >> From: Menon, Nishanth
> >> Govindarajan, Sriramakrishnan had written, on 01/07/2010 06:30 AM, the
> >> following:
> >>> From: Sriram 
> >>>
> >>> OMAP platforms(like OMAP3530) include DSP or other co-processors
> >>> for media acceleration. when carving out memory for the
> >>> accelerators we can end up creating a hole in the memory map
> >>> of sort:
> >>> 
> >>>
> >>> To handle such a memory configuration ARCH_HAS_HOLES_MEMORYMODEL
> >>> has to be enabled. For further information refer discussion at:
> >>> http://www.mail-archive.com/linux-o...@vger.kernl.org/msg15262.html.
> >> pls check the link: I see "The document you were looking for was not
> >> found."
> >
> > The URL is spelt incorrectly. Here is the correct URL:
> > http://www.mail-archive.com/linux-omap@vger.kernel.org/msg15262.html
> >
> >>>   select GENERIC_TIME
> >>>   select GENERIC_CLOCKEVENTS
> >>> + select ARCH_HAS_HOLES_MEMORYMODEL
> >> why enable this for all OMAPs?
> >
> > I have tested this on several OMAP3 platforms and this feature is
> required
> > Wherever some memory needs to be reserved for media accelerators - hence
> it
> > Would be handy for earlier OMAP platforms as well
> I understand that you have tested with OMAP3. my question is you have
> handled this as per the diff
> @@ -699,6 +699,7 @@ config ARCH_OMAP
> to ARCH_OMAP
> 
> is this good for OMAP1510, 1610, 1710, 2420,2430, 770 etc..?

I do not have other OMAP platforms for me to validate this patch on.
I believe the nature of change is generic and benefit other OMAP
Platforms as well.

Regards
Sriram

--
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] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP

2010-01-08 Thread Govindarajan, Sriramakrishnan


> From: Menon, Nishanth
> Govindarajan, Sriramakrishnan had written, on 01/07/2010 06:30 AM, the
> following:
> > From: Sriram 
> >
> > OMAP platforms(like OMAP3530) include DSP or other co-processors
> > for media acceleration. when carving out memory for the
> > accelerators we can end up creating a hole in the memory map
> > of sort:
> > 
> >
> > To handle such a memory configuration ARCH_HAS_HOLES_MEMORYMODEL
> > has to be enabled. For further information refer discussion at:
> > http://www.mail-archive.com/linux-o...@vger.kernl.org/msg15262.html.
> 
> pls check the link: I see "The document you were looking for was not
> found."

The URL is spelt incorrectly. Here is the correct URL:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg15262.html

> > select GENERIC_TIME
> > select GENERIC_CLOCKEVENTS
> > +   select ARCH_HAS_HOLES_MEMORYMODEL
> why enable this for all OMAPs?

I have tested this on several OMAP3 platforms and this feature is required
Wherever some memory needs to be reserved for media accelerators - hence it
Would be handy for earlier OMAP platforms as well

Regards
Sriram
--
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] ARCH OMAP : enable ARCH_HAS_HOLES_MEMORYMODEL for OMAP

2010-01-07 Thread Sriramakrishnan
From: Sriram 

OMAP platforms(like OMAP3530) include DSP or other co-processors
for media acceleration. when carving out memory for the
accelerators we can end up creating a hole in the memory map
of sort:


To handle such a memory configuration ARCH_HAS_HOLES_MEMORYMODEL
has to be enabled. For further information refer discussion at:
http://www.mail-archive.com/linux-o...@vger.kernl.org/msg15262.html.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5e0bcc5..88f628b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -699,6 +699,7 @@ config ARCH_OMAP
select ARCH_HAS_CPUFREQ
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
+   select ARCH_HAS_HOLES_MEMORYMODEL
help
  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
-- 
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] omap3evm: MIgrate to smsc911x ethernet driver.

2009-11-13 Thread Sriramakrishnan
Migrate to smsc911x ethernet driver instead of smc911x driver.
The smsc911x ethernet driver supports NAPI and performs better
under heavy traffic. With the smc911x driver we were witnessing
very high iowait time for high IO load over NFS.

Signed-off-by: Sriramakrishnan 
---
This patch has been refreshed against the tip of for-next branch.
Tested by reverting commit 20dec08ce892df224 as it was breaking
compilation otherwise.

 arch/arm/configs/omap3_evm_defconfig |4 +-
 arch/arm/mach-omap2/board-omap3evm.c |   43 +++--
 2 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/arch/arm/configs/omap3_evm_defconfig 
b/arch/arm/configs/omap3_evm_defconfig
index da69732..e190fc8 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -617,8 +617,8 @@ CONFIG_MII=y
 # CONFIG_DM9000 is not set
 # CONFIG_ENC28J60 is not set
 # CONFIG_ETHOC is not set
-CONFIG_SMC911X=y
-# CONFIG_SMSC911X is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_DNET is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index be93142..e8a7617 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -22,11 +22,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -52,7 +54,7 @@
 #define OMAP3EVM_ETHR_SIZE 1024
 #define OMAP3EVM_ETHR_ID_REV   0x50
 #define OMAP3EVM_ETHR_GPIO_IRQ 176
-#define OMAP3EVM_SMC911X_CS5
+#define OMAP3EVM_SMSC911X_CS   5
 
 static u8 omap3_evm_version;
 
@@ -84,7 +86,8 @@ static void __init omap3_evm_get_revision(void)
}
 }
 
-static struct resource omap3evm_smc911x_resources[] = {
+#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+static struct resource omap3evm_smsc911x_resources[] = {
[0] =   {
.start  = OMAP3EVM_ETHR_START,
.end= (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
@@ -93,24 +96,34 @@ static struct resource omap3evm_smc911x_resources[] = {
[1] =   {
.start  = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
.end= OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
-   .flags  = IORESOURCE_IRQ,
+   .flags  = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
},
 };
 
-static struct platform_device omap3evm_smc911x_device = {
-   .name   = "smc911x",
+static struct smsc911x_platform_config smsc911x_config = {
+   .phy_interface  = PHY_INTERFACE_MODE_MII,
+   .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+   .irq_type   = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+   .flags  = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
+};
+
+static struct platform_device omap3evm_smsc911x_device = {
+   .name   = "smsc911x",
.id = -1,
-   .num_resources  = ARRAY_SIZE(omap3evm_smc911x_resources),
-   .resource   = &omap3evm_smc911x_resources[0],
+   .num_resources  = ARRAY_SIZE(omap3evm_smsc911x_resources),
+   .resource   = &omap3evm_smsc911x_resources[0],
+   .dev= {
+   .platform_data = &smsc911x_config,
+   },
 };
 
-static inline void __init omap3evm_init_smc911x(void)
+static inline void __init omap3evm_init_smsc911x(void)
 {
int eth_cs;
struct clk *l3ck;
unsigned int rate;
 
-   eth_cs = OMAP3EVM_SMC911X_CS;
+   eth_cs = OMAP3EVM_SMSC911X_CS;
 
l3ck = clk_get(NULL, "l3_ck");
if (IS_ERR(l3ck))
@@ -118,15 +131,20 @@ static inline void __init omap3evm_init_smc911x(void)
else
rate = clk_get_rate(l3ck);
 
-   if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) {
-   printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+   if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
+   printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
OMAP3EVM_ETHR_GPIO_IRQ);
return;
}
 
gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
+   platform_device_register(&omap3evm_smsc911x_device);
 }
 
+#else
+static inline void __init omap3evm_init_smsc911x(void) { return; }
+#endif
+
 static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -368,12 +386,10 @@ static void __init omap3_evm_init_irq(void)
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
-   omap3evm_init_smc911x();
 }
 
 static struct platform_device *omap3_evm_devices[] __initdata = {
&omap3_evm_lcd_device,
-   &omap3evm_smc911x_device,
 };
 
 static struct ehc

RE: [PATCH] omap3evm: Migrate to smsc911x ethernet driver.

2009-11-11 Thread Govindarajan, Sriramakrishnan
Tony,
Are there comments with respect to this patch. Will this be merged in the next 
window?
Regards
Sriram

> -Original Message-
> From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> ow...@vger.kernel.org] On Behalf Of Govindarajan, Sriramakrishnan
> Sent: Wednesday, October 28, 2009 7:19 PM
> To: linux-omap@vger.kernel.org
> Cc: Govindarajan, Sriramakrishnan
> Subject: [PATCH] omap3evm: Migrate to smsc911x ethernet driver.
> 
> Migrate to smsc911x ethernet driver instead of smc911x driver.
> The smsc911x ethernet driver supports NAPI and performs better
> under heavy traffic. With the smc911x driver we were witnessing
> very high iowait time for high IO load over NFS.
> 
> Signed-off-by: Sriramakrishnan 
> ---
> This patch is generated against tip of for-next branch.
> 
>  arch/arm/configs/omap3_evm_defconfig |4 +-
>  arch/arm/mach-omap2/board-omap3evm.c |   36
> +
>  2 files changed, 29 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/configs/omap3_evm_defconfig
> b/arch/arm/configs/omap3_evm_defconfig
> index d5ff477..50afc67 100644
> --- a/arch/arm/configs/omap3_evm_defconfig
> +++ b/arch/arm/configs/omap3_evm_defconfig
> @@ -617,8 +617,8 @@ CONFIG_MII=y
>  # CONFIG_DM9000 is not set
>  # CONFIG_ENC28J60 is not set
>  # CONFIG_ETHOC is not set
> -CONFIG_SMC911X=y
> -# CONFIG_SMSC911X is not set
> +# CONFIG_SMC911X is not set
> +CONFIG_SMSC911X=y
>  # CONFIG_DNET is not set
>  # CONFIG_IBM_NEW_EMAC_ZMII is not set
>  # CONFIG_IBM_NEW_EMAC_RGMII is not set
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-
> omap2/board-omap3evm.c
> index 5d2310e..9bcdaf7 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -21,11 +21,13 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
> 
> @@ -51,7 +53,8 @@
>  #define OMAP3EVM_ETHR_GPIO_IRQ   176
>  #define OMAP3EVM_SMC911X_CS  5
> 
> -static struct resource omap3evm_smc911x_resources[] = {
> +#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
> +static struct resource omap3evm_smsc911x_resources[] = {
>   [0] =   {
>   .start  = OMAP3EVM_ETHR_START,
>   .end= (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
> @@ -60,18 +63,28 @@ static struct resource
> omap3evm_smc911x_resources[] = {
>   [1] =   {
>   .start  = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
>   .end= OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
> - .flags  = IORESOURCE_IRQ,
> + .flags  = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
>   },
>  };
> 
> -static struct platform_device omap3evm_smc911x_device = {
> - .name   = "smc911x",
> +static struct smsc911x_platform_config smsc911x_config = {
> + .phy_interface  = PHY_INTERFACE_MODE_MII,
> + .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
> + .irq_type   = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
> + .flags  = (SMSC911X_USE_32BIT |
> SMSC911X_SAVE_MAC_ADDRESS),
> +};
> +
> +static struct platform_device omap3evm_smsc911x_device = {
> + .name   = "smsc911x",
>   .id = -1,
> - .num_resources  = ARRAY_SIZE(omap3evm_smc911x_resources),
> - .resource   = &omap3evm_smc911x_resources[0],
> + .num_resources  = ARRAY_SIZE(omap3evm_smsc911x_resources),
> + .resource   = &omap3evm_smsc911x_resources[0],
> + .dev= {
> + .platform_data = &smsc911x_config,
> + },
>  };
> 
> -static inline void __init omap3evm_init_smc911x(void)
> +static inline void __init omap3evm_init_smsc911x(void)
>  {
>   int eth_cs;
>   struct clk *l3ck;
> @@ -92,8 +105,14 @@ static inline void __init
> omap3evm_init_smc911x(void)
>   }
> 
>   gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
> +
> + platform_device_register(&omap3evm_smsc911x_device);
>  }
> 
> +#else
> +static inline void __init omap3evm_init_smsc911x(void) { return; }
> +#endif
> +
>  static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
>   .supply = "vmmc",
>  };
> @@ -335,12 +354,10 @@ static void __init omap3_evm_init_irq(void)
>   omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
>   omap_init_irq();
>   omap_gpio_init();
> - omap3evm_init_smc911x();
>  }
> 
>  static struct platform_device *omap3_evm_devices[] __initdata = {
>   &omap3_evm_lcd_device,
> - &omap3evm_smc911x_device,
>

[PATCH] omap3evm: make HSMMC driver built-in.

2009-10-29 Thread Sriramakrishnan
For ease of use it is preferrable to build in HSMMC driver
rather than build it as kernel module. This patches updates
default configuration for omap3evm to reflect this change.

Signed-off-by: Sriramakrishnan 
---
 arch/arm/configs/omap3_evm_defconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/configs/omap3_evm_defconfig 
b/arch/arm/configs/omap3_evm_defconfig
index d5ff477..36c99e0 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -1126,7 +1126,7 @@ CONFIG_MMC_BLOCK_BOUNCE=y
 #
 # CONFIG_MMC_SDHCI is not set
 # CONFIG_MMC_OMAP is not set
-CONFIG_MMC_OMAP_HS=m
+CONFIG_MMC_OMAP_HS=y
 # CONFIG_MMC_SPI is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_ACCESSIBILITY is not set
-- 
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] am3517evm : add nand support

2009-10-29 Thread Sriramakrishnan
Enable Nand support on am3517evm

Signed-off-by: Sriramakrishnan 
---
This patch builds on the am3517evm board support patch submitted earlier.
http://marc.info/?l=linux-omap&m=125673923227266&w=2

 arch/arm/configs/am3517_evm_defconfig |  103 -
 arch/arm/mach-omap2/board-am3517evm.c |  104 -
 2 files changed, 204 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 arch/arm/mach-omap2/board-am3517evm.c

diff --git a/arch/arm/configs/am3517_evm_defconfig 
b/arch/arm/configs/am3517_evm_defconfig
index 787f295..aa9ea34 100644
--- a/arch/arm/configs/am3517_evm_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.32-rc5
-# Wed Oct 28 15:47:47 2009
+# Thu Oct 29 20:50:11 2009
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -457,7 +457,90 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+# CONFIG_MTD_NAND_OMAP_PREFETCH is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
@@ -759,6 +842,21 @@ CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
@@ -1051,6 +1149,7 @@ CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=y
 CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_DECOMPRESS_GZIP=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
old mode 100644
new mode 100755
index 23cf949..c326f12
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -21,16 +21,117 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
 #include 
+#include 
+#include 
 #include 
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
+static struct mtd_partition am3517evm_nand_partitions[] = {
+/* All the partition sizes are listed in terms of NAND block size */
+{
+   .name   = "xloader-nand",
+   .offset = 0,
+   .size   = 4*(SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+},
+{
+   .name   = "uboot-nand",
+   

[PATCH] omap3evm : enable nand support

2009-10-29 Thread Sriramakrishnan
Enable Nand suport on the OMAP3EVM.

Signed-off-by: Sriramakrishnan 
---
This patch has been generated against the tip of for-next branch.

 arch/arm/configs/omap3_evm_defconfig |2 +
 arch/arm/mach-omap2/board-omap3evm.c |  102 ++
 2 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap3_evm_defconfig 
b/arch/arm/configs/omap3_evm_defconfig
index d5ff477..5675281 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -516,6 +516,8 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_ECC_SMC is not set
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 # CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+# CONFIG_MTD_NAND_OMAP_PREFETCH is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 5d2310e..91772f2 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -27,6 +27,11 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
+
 #include 
 
 #include 
@@ -36,6 +41,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +51,11 @@
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "mmc-twl4030.h"
 
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+
+#define NAND_BLOCK_SIZESZ_128K
+
 #define OMAP3_EVM_TS_GPIO  175
 
 #define OMAP3EVM_ETHR_START0x2c00
@@ -51,6 +63,95 @@
 #define OMAP3EVM_ETHR_GPIO_IRQ 176
 #define OMAP3EVM_SMC911X_CS5
 
+
+static struct mtd_partition omap3evm_nand_partitions[] = {
+   /* All the partition sizes are listed in terms of NAND block size */
+   {
+   .name   = "xloader-nand",
+   .offset = 0,
+   .size   = 4*(SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = "uboot-nand",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 14*(SZ_128K),
+   .mask_flags = MTD_WRITEABLE
+   },
+   {
+   .name   = "params-nand",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 2*(SZ_128K)
+   },
+   {
+   .name   = "linux-nand",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 40*(SZ_128K)
+   },
+   {
+   .name   = "jffs2-nand",
+   .size   = MTDPART_SIZ_FULL,
+   .offset = MTDPART_OFS_APPEND,
+   },
+};
+
+static struct omap_nand_platform_data omap3evm_nand_data = {
+   .parts  = omap3evm_nand_partitions,
+   .nr_parts   = ARRAY_SIZE(omap3evm_nand_partitions),
+   .nand_setup = NULL,
+   .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
+   .dev_ready  = NULL,
+};
+
+static struct resource omap3evm_nand_resource = {
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device omap3evm_nand_device = {
+   .name   = "omap2-nand",
+   .id = 0,
+   .dev= {
+   .platform_data  = &omap3evm_nand_data,
+   },
+   .num_resources  = 1,
+   .resource   = &omap3evm_nand_resource,
+};
+
+void __init omap3evm_flash_init(void)
+{
+   u8 cs = 0;
+   u8 nandcs = GPMC_CS_NUM + 1;
+   u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+   while (cs < GPMC_CS_NUM) {
+   u32 ret = 0;
+   ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+   if ((ret & 0xC00) == 0x800) {
+   /* Found it!! */
+   if (nandcs > GPMC_CS_NUM)
+   nandcs = cs;
+   }
+   cs++;
+   }
+   if (nandcs > GPMC_CS_NUM) {
+   printk(KERN_INFO "NAND: Unable to find configuration "
+   " in GPMC\n ");
+   return;
+   }
+
+   if (nandcs < GPMC_CS_NUM) {
+   omap3evm_nand_data.cs   = nandcs;
+   omap3evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+   GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+   omap3evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+
+   if (platform_device_register(&omap3evm_nand_device) < 0) {
+   printk(KERN_ERR "Unable to register NAND device\n");
+   }
+   }
+}
+
 static struct resource omap3evm_smc911x_resources[] = {
[0] =   {
.start  = OMAP3EVM_ETHR_START,
@@ -358,6 +459,7 @@ static void __init omap3_evm_init(void)
usb_nop_xceiv_register();
 

[PATCH] omap3evm: Migrate to smsc911x ethernet driver.

2009-10-28 Thread Sriramakrishnan
Migrate to smsc911x ethernet driver instead of smc911x driver.
The smsc911x ethernet driver supports NAPI and performs better
under heavy traffic. With the smc911x driver we were witnessing
very high iowait time for high IO load over NFS.

Signed-off-by: Sriramakrishnan 
---
This patch is generated against tip of for-next branch.

 arch/arm/configs/omap3_evm_defconfig |4 +-
 arch/arm/mach-omap2/board-omap3evm.c |   36 +
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/arch/arm/configs/omap3_evm_defconfig 
b/arch/arm/configs/omap3_evm_defconfig
index d5ff477..50afc67 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -617,8 +617,8 @@ CONFIG_MII=y
 # CONFIG_DM9000 is not set
 # CONFIG_ENC28J60 is not set
 # CONFIG_ETHOC is not set
-CONFIG_SMC911X=y
-# CONFIG_SMSC911X is not set
+# CONFIG_SMC911X is not set
+CONFIG_SMSC911X=y
 # CONFIG_DNET is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
 # CONFIG_IBM_NEW_EMAC_RGMII is not set
diff --git a/arch/arm/mach-omap2/board-omap3evm.c 
b/arch/arm/mach-omap2/board-omap3evm.c
index 5d2310e..9bcdaf7 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -21,11 +21,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -51,7 +53,8 @@
 #define OMAP3EVM_ETHR_GPIO_IRQ 176
 #define OMAP3EVM_SMC911X_CS5
 
-static struct resource omap3evm_smc911x_resources[] = {
+#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+static struct resource omap3evm_smsc911x_resources[] = {
[0] =   {
.start  = OMAP3EVM_ETHR_START,
.end= (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
@@ -60,18 +63,28 @@ static struct resource omap3evm_smc911x_resources[] = {
[1] =   {
.start  = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
.end= OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
-   .flags  = IORESOURCE_IRQ,
+   .flags  = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
},
 };
 
-static struct platform_device omap3evm_smc911x_device = {
-   .name   = "smc911x",
+static struct smsc911x_platform_config smsc911x_config = {
+   .phy_interface  = PHY_INTERFACE_MODE_MII,
+   .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+   .irq_type   = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+   .flags  = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
+};
+
+static struct platform_device omap3evm_smsc911x_device = {
+   .name   = "smsc911x",
.id = -1,
-   .num_resources  = ARRAY_SIZE(omap3evm_smc911x_resources),
-   .resource   = &omap3evm_smc911x_resources[0],
+   .num_resources  = ARRAY_SIZE(omap3evm_smsc911x_resources),
+   .resource   = &omap3evm_smsc911x_resources[0],
+   .dev= {
+   .platform_data = &smsc911x_config,
+   },
 };
 
-static inline void __init omap3evm_init_smc911x(void)
+static inline void __init omap3evm_init_smsc911x(void)
 {
int eth_cs;
struct clk *l3ck;
@@ -92,8 +105,14 @@ static inline void __init omap3evm_init_smc911x(void)
}
 
gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
+
+   platform_device_register(&omap3evm_smsc911x_device);
 }
 
+#else
+static inline void __init omap3evm_init_smsc911x(void) { return; }
+#endif
+
 static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
.supply = "vmmc",
 };
@@ -335,12 +354,10 @@ static void __init omap3_evm_init_irq(void)
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
-   omap3evm_init_smc911x();
 }
 
 static struct platform_device *omap3_evm_devices[] __initdata = {
&omap3_evm_lcd_device,
-   &omap3evm_smc911x_device,
 };
 
 static void __init omap3_evm_init(void)
@@ -359,6 +376,7 @@ static void __init omap3_evm_init(void)
 #endif
usb_musb_init();
ads7846_dev_init();
+   omap3evm_init_smsc911x();
 }
 
 static void __init omap3_evm_map_io(void)
-- 
1.6.2.4

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


High iowait time with NFS on OMAP3EVM

2009-05-14 Thread Govindarajan, Sriramakrishnan
Hi,
When I copy a large file to/from NFS mounted filesystem, the system becomes
unresponsive and top command shows very high iowait(80%+) time. Though the IO 
operation goes through, typical throughput is < 8Mbps/sec.

On the same system, testing for Ethernet driver throughput using iperf yields 
close to 50Mb/sec throughput. (I am using the tip of linux-omap and running on 
OMAP3EVM using smc911x driver)

Any pointers on what could result in degradation of throughput when using NFS 
and the resulting high iowait time?

Regards
Sriram

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