[PATCH] ARM: OMAP2+: dpll: Add missing soc_is_am33xx() check

2013-02-01 Thread AnilKumar Ch
Add missing soc_is_am33xx() check in noncore DPLL set rate function.
Without this, dpll set_rate function throughs warnings for am33xx
family of devices.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/mach-omap2/dpll3xxx.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 0a02aab5..4bb3f78 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -501,7 +501,8 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned 
long rate,
return -EINVAL;
 
/* No freqsel on OMAP4 and OMAP3630 */
-   if (!cpu_is_omap44xx()  !cpu_is_omap3630()) {
+   if (!cpu_is_omap44xx()  !cpu_is_omap3630() 
+   !soc_is_am33xx()) {
freqsel = _omap3_dpll_compute_freqsel(clk,
dd-last_rounded_n);
WARN_ON(!freqsel);
-- 
1.7.9.5

--
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] ARM: OMAP2: AM33XX: id: Add support for AM335x PG2.0

2013-02-01 Thread AnilKumar Ch
Add support for chip id recognition of AM335x PG2.0 silicon. By default
omap3xxx_check_revision() recognizes PG1.0, which is extended by adding
PG2.0 support

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/mach-omap2/id.c  |   14 --
 arch/arm/mach-omap2/soc.h |1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 45cc7ed4..8a68f1e 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -399,8 +399,18 @@ void __init omap3xxx_check_revision(void)
}
break;
case 0xb944:
-   omap_revision = AM335X_REV_ES1_0;
-   cpu_rev = 1.0;
+   switch (rev) {
+   case 0:
+   omap_revision = AM335X_REV_ES1_0;
+   cpu_rev = 1.0;
+   break;
+   case 1:
+   /* FALLTHROUGH */
+   default:
+   omap_revision = AM335X_REV_ES2_0;
+   cpu_rev = 2.0;
+   break;
+   }
break;
case 0xb8f2:
switch (rev) {
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 092aedd..c62116b 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -395,6 +395,7 @@ IS_OMAP_TYPE(3430, 0x3430)
 
 #define AM335X_CLASS   0x33500033
 #define AM335X_REV_ES1_0   AM335X_CLASS
+#define AM335X_REV_ES2_0   (AM335X_CLASS | (0x1  8))
 
 #define OMAP443X_CLASS 0x44300044
 #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10  8))
-- 
1.7.9.5

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


[PATCH v4] ARM: OMAP2+: AM33XX: omap2plus_defconfig: Add support for few drivers

2013-01-03 Thread AnilKumar Ch
Adds tps65910 PMIC, lis3lv02d accelerometer, tsl2550 ambient light sensor,
tmp275 temperature sensor, matrix keypad, gbio based leds and D_CAN drivers
support. These peripherals are present on AM33XX family of devices (EVM,
BeagleBone and EVMSK). One has to manually enable these support to use the
drivers, so this patch enables all the drivers in omap2plus_defconfig

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
Changes from v3:
- Incorporated Olof Johansson's comments on v3
  * Combined all the patches into a single patch

Changes from v2:
- Incorporated Tony's comments on v2
  * Enabled as modules instead of kernel built-in drivers.
- Dropped 1st patch because it was accepted.

Changes from v1:
- Incorporated martinez javier's comments on v1
  * Enabled few more triggers in omap2plus_defconfig
- Included Igor's patch, which modifies the omap2plus
  defconfig for AM33XX devices.

 arch/arm/configs/omap2plus_defconfig |   22 ++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 19b7311..9fb2373 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -52,6 +52,11 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_C_CAN=m
+CONFIG_CAN_C_CAN_PLATFORM=m
 CONFIG_BT=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
@@ -81,6 +86,9 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_SENSORS_LIS3LV02D=m
+CONFIG_SENSORS_TSL2550=m
+CONFIG_SENSORS_LIS3_I2C=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
@@ -106,6 +114,7 @@ CONFIG_USB_KC2190=y
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=m
 CONFIG_KEYBOARD_TWL4030=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=y
@@ -129,14 +138,17 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_W1=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_SENSORS_LM75=m
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
 CONFIG_MFD_TPS65217=y
+CONFIG_MFD_TPS65910=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
 CONFIG_REGULATOR_TPS65217=y
+CONFIG_REGULATOR_TPS65910=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
@@ -193,6 +205,16 @@ CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_SDIO_UART=y
 CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_ONESHOT=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_TWL92330=y
 CONFIG_RTC_DRV_TWL4030=y
-- 
1.7.9.5

--
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 v3 4/7] ARM: OMAP2+: omap2plus_defconfig: Add matrix-keypad support

2013-01-02 Thread AnilKumar Ch
AM335X-EVM device have 3x2 matrix keypad, one has to manually enable
this support to use matrix keypad. So this patch enables matrix-keypad
driver as module in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index cd1cd51..f3e0e8c 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -111,6 +111,7 @@ CONFIG_USB_KC2190=y
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=m
 CONFIG_KEYBOARD_TWL4030=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=y
-- 
1.7.9.5

--
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 v3 1/7] ARM: OMAP2+: omap2plus_defconfig: Add tps65910 support

2013-01-02 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have tps65910 PMIC regulator, one
has to manually enable this support to use regulators. So this patch
enables tps65910 mfd and regulator drivers in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 82ce8d7..ee6e060 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -135,10 +135,12 @@ CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
 CONFIG_MFD_TPS65217=y
+CONFIG_MFD_TPS65910=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
 CONFIG_REGULATOR_TPS65217=y
+CONFIG_REGULATOR_TPS65910=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.9.5

--
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 v3 0/7] ARM: OMAP2+: AM33XX: Enable few drivers in omap2plus_defconfig

2013-01-02 Thread AnilKumar Ch
This patch series enable tps65910, lis3lv02d accelerometer, tsl2550
ambient light sensor, matrix keypad, tmp275 temperature sensor, gpio
leds and D_CAN drivers in omap2plus_defconfig.

These are the peripherals present in AM33XX family of devices.

Changes from v2:
- Incorporated Tony's comments on v2
  * Enabled as modules instead of kernel built-in drivers.
- Dropped 1st patch because it was accepted.

Changes from v1:
- Incorporated martinez javier's comments on v1
  * Enabled few more triggers in omap2plus_defconfig
- Included Igor's patch, which modifies the omap2plus
  defconfig for AM33XX devices.

AnilKumar Ch (7):
  ARM: OMAP2+: omap2plus_defconfig: Add tps65910 support
  ARM: OMAP2+: omap2plus_defconfig: Add lis3lv02d support
  ARM: OMAP2+: omap2plus_defconfig: Add tsl2550 support
  ARM: OMAP2+: omap2plus_defconfig: Add matrix-keypad support
  ARM: OMAP2+: omap2plus_defconfig: Add tmp275 sensor support
  ARM: OMAP2+: omap2plus_defconfig: Add leds-gpio support
  ARM: OMAP2+: omap2plus_defconfig: Add D_CAN support

 arch/arm/configs/omap2plus_defconfig |   22 ++
 1 file changed, 22 insertions(+)

-- 
1.7.9.5

--
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 v3 5/7] ARM: OMAP2+: omap2plus_defconfig: Add tmp275 sensor support

2013-01-02 Thread AnilKumar Ch
AM335x-evm device have temperature sensor, one has to manually
enable this support to use of temperature sensor. So this patch
enables tmp275 driver as module in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index f3e0e8c..af08c26 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -135,6 +135,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_W1=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_SENSORS_LM75=m
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
-- 
1.7.9.5

--
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 v3 3/7] ARM: OMAP2+: omap2plus_defconfig: Add tsl2550 support

2013-01-02 Thread AnilKumar Ch
AM335x-evm device have tsl2550 ambient light sensor, one has to
manually enable this support to use light sensor. So this patch
enables tsl2550 driver as module in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 8fd208a..cd1cd51 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -84,6 +84,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_SENSORS_LIS3LV02D=m
+CONFIG_SENSORS_TSL2550=m
 CONFIG_SENSORS_LIS3_I2C=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
-- 
1.7.9.5

--
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 v3 2/7] ARM: OMAP2+: omap2plus_defconfig: Add lis3lv02d support

2013-01-02 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have lis331dlh accelerometer, one
has to manually enable this support to use accelerometer. So this patch
enables lis3lv02d driver as moudle in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index ee6e060..8fd208a 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -83,6 +83,8 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_SENSORS_LIS3LV02D=m
+CONFIG_SENSORS_LIS3_I2C=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
-- 
1.7.9.5

--
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 v3 7/7] ARM: OMAP2+: omap2plus_defconfig: Add D_CAN support

2013-01-02 Thread AnilKumar Ch
AM335X-EVM has BOSCH DCAN controller, one has to manually enable
this support to use of DCAN controller. So this patch enables DCAN
driver as module in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index ea704be..10503f0 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -52,6 +52,11 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_C_CAN=m
+CONFIG_CAN_C_CAN_PLATFORM=m
 CONFIG_BT=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
-- 
1.7.9.5

--
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 v3 6/7] ARM: OMAP2+: omap2plus_defconfig: Add leds-gpio support

2013-01-02 Thread AnilKumar Ch
AM335X-EVMSK and AM335X-BONE devices have gpio controlled user leds,
one has to manually enable this support to use user leds. So this
patch enables gpio-leds driver in omap2plus_defconfig. Also enables
different TRIGGERS like TRIGGER_TIMER, TRIGGER_HEARTBEAT and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index af08c26..ea704be 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -203,6 +203,16 @@ CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_SDIO_UART=y
 CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_ONESHOT=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_TWL92330=y
 CONFIG_RTC_DRV_TWL4030=y
-- 
1.7.9.5

--
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/8] ARM: OMAP2+: omap2plus_defconfig: Enable tps65910 PMIC

2012-12-13 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have tps65910 PMIC regulator, one
has to manually enable this support to use regulators. So this patch
enables tps65910 mfd and regulator driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 19b7311..27bf465 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -133,10 +133,12 @@ CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
 CONFIG_MFD_TPS65217=y
+CONFIG_MFD_TPS65910=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
 CONFIG_REGULATOR_TPS65217=y
+CONFIG_REGULATOR_TPS65910=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.9.5

--
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 5/8] ARM: OMAP2+: omap2plus_defconfig: Enable matrix keypad driver

2012-12-13 Thread AnilKumar Ch
AM335X-EVM device have 3x2 matrix keypad, one has to manually enable
this support to use matrix keypad. So this patch enables matrix keypad
driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index f0d6afb..c004d9b 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -109,6 +109,7 @@ CONFIG_USB_KC2190=y
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
 CONFIG_KEYBOARD_TWL4030=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=y
-- 
1.7.9.5

--
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/8] ARM: OMAP2+: AM33XX: Enable few drivers in omap2plus_defconfig

2012-12-13 Thread AnilKumar Ch
This patch series enable tps65910, lis3lv02d accelerometer, tsl2550
ambient light sensor, matrix keypad, tmp275 temperature sensor, gpio
leds and D_CAN drivers in omap2plus_defconfig.

These are the peripherals present in AM33XX family of devices.

Changes from v1:
- Incorporated martinez javier's comments on v1
  * Enabled few more triggers in omap2plus_defconfig
- Included Igor's patch, which modifies the omap2plus
  defconfig for AM33XX devices.

AnilKumar Ch (7):
  ARM: OMAP2+: omap2plus_defconfig: Enable tps65910 PMIC
  ARM: OMAP2+: omap2plus_defconfig: Enable lis3lv02d accelerometer
  ARM: OMAP2+: omap2plus_defconfig: Enable tsl2550 ambient light sensor
  ARM: OMAP2+: omap2plus_defconfig: Enable matrix keypad driver
  ARM: OMAP2+: omap2plus_defconfig: Enable tmp275 sensor
  ARM: OMAP2+: omap2plus_defconfig: Enable leds-gpio driver
  ARM: OMAP2+: omap2plus_defconfig: Enable DCAN controller

Igor Mazanov (1):
  ARM: OMAP2+: omap2plus_defconfig: Enable tps65217 PMIC

 arch/arm/configs/omap2plus_defconfig |   24 
 1 file changed, 24 insertions(+)

-- 
1.7.9.5

--
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 8/8] ARM: OMAP2+: omap2plus_defconfig: Enable DCAN controller

2012-12-13 Thread AnilKumar Ch
AM335X-EVM has BOSCH DCAN controller, one has to manually enable
this support to use of DCAN controller. So this patch enables DCAN
driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index b0ad0b0..0ce6771 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -52,6 +52,11 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+CONFIG_CAN_C_CAN=y
+CONFIG_CAN_C_CAN_PLATFORM=y
 CONFIG_BT=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
-- 
1.7.9.5

--
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 6/8] ARM: OMAP2+: omap2plus_defconfig: Enable tmp275 sensor

2012-12-13 Thread AnilKumar Ch
AM335x-evm device have temperature sensor, one has to manually
enable this support to use of temperature sensor. So this patch
enables tmp275 driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index c004d9b..e1d2385 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -133,6 +133,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_W1=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_SENSORS_LM75=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
-- 
1.7.9.5

--
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 7/8] ARM: OMAP2+: omap2plus_defconfig: Enable leds-gpio driver

2012-12-13 Thread AnilKumar Ch
AM335X-EVMSK and AM335X-BONE devices have gpio controlled user leds,
one has to manually enable this support to use user leds. So this
patch enables gpio-leds driver in omap2plus_defconfig. Also enables
different TRIGGERS like TRIGGER_TIMER, TRIGGER_HEARTBEAT and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index e1d2385..b0ad0b0 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -200,6 +200,16 @@ CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_SDIO_UART=y
 CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_ONESHOT=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_TWL92330=y
 CONFIG_RTC_DRV_TWL4030=y
-- 
1.7.9.5

--
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 3/8] ARM: OMAP2+: omap2plus_defconfig: Enable lis3lv02d accelerometer

2012-12-13 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have lis331dlh accelerometer, one
has to manually enable this support to use accelerometer. So this patch
enables lis3lv02d driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 27bf465..417a320 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -81,6 +81,8 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_SENSORS_LIS3LV02D=y
+CONFIG_SENSORS_LIS3_I2C=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
-- 
1.7.9.5

--
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/8] ARM: OMAP2+: omap2plus_defconfig: Enable tps65217 PMIC

2012-12-13 Thread AnilKumar Ch
From: Igor Mazanov i.maza...@gmail.com

The BeagleBone platform uses TPS65217 PMIC to control voltages
on the board. This patch enables TPS65217 MFD and regulator
drivers in omap2plus_defconfig.

Signed-off-by: Igor Mazanov i.maza...@gmail.com
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index a1dc5c0..19b7311 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -132,9 +132,11 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
+CONFIG_MFD_TPS65217=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
+CONFIG_REGULATOR_TPS65217=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.9.5

--
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 4/8] ARM: OMAP2+: omap2plus_defconfig: Enable tsl2550 ambient light sensor

2012-12-13 Thread AnilKumar Ch
AM335x-evm device have tsl2550 ambient light sensor, one has to
manually enable this support to use light sensor. So this patch
enables tsl2550 driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 417a320..f0d6afb 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -82,6 +82,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_SENSORS_LIS3LV02D=y
+CONFIG_SENSORS_TSL2550=y
 CONFIG_SENSORS_LIS3_I2C=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
-- 
1.7.9.5

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


[PATCH v4 2/4] ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone

2012-12-13 Thread AnilKumar Ch
Set ti,pmic-shutdown-controller for BeagleBone in am335x-bone.dts
file, this flag is used by the driver to set tps65217 PMIC status
to OFF when PWR_EN toggle.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 5302f79..e7dff9d 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -88,6 +88,8 @@
 /include/ tps65217.dtsi
 
 tps {
+   ti,pmic-shutdown-controller;
+
regulators {
dcdc1_reg: regulator@0 {
regulator-always-on;
-- 
1.7.9.5

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


[PATCH v4 0/4] pm: Add power off control

2012-12-13 Thread AnilKumar Ch
Add PM power_off control to rtc driver and PMIC status is set to
STATUS_OFF to shutdown PMIC if PWR_EN is toggled by RTC module.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

These patches were tested on am335x-bone (BeagleBone). These patchs
are based on linux-next.

Changes from v3:
- TPS65217 mfd driver changes are accepted so dropped
  from this series.
- With recent changes in the kernel, reboot_mutex held BUG()
  is not seen so removed while(1); from rtc_power_off.
- Removed spinlock before while(1); which is not necessary.

Changes from v2:
- Incorporated Kevin's comment on v2
  * Enabled RTC in ompa2plus_defconfig

Changes from v1:
- Incorporated Vaibhav's comments on v1
  * Changed the time rollover logic with the help of
rtc-lib APIs

AnilKumar Ch (3):
  ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone
  ARM: dts: AM33XX: Enable system power off control in am335x-bone
  ARM: OMAP2+: omap2plus_defconfig: Enable RTC support

Colin Foe-Parker (1):
  rtc: OMAP: Add system pm_power_off to rtc driver

 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 arch/arm/boot/dts/am335x-bone.dts  |6 ++
 arch/arm/configs/omap2plus_defconfig   |1 +
 drivers/rtc/rtc-omap.c |   74 +++-
 4 files changed, 85 insertions(+), 1 deletion(-)

-- 
1.7.9.5

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


[PATCH v4 3/4] ARM: dts: AM33XX: Enable system power off control in am335x-bone

2012-12-13 Thread AnilKumar Ch
Enable system power off control for BeagleBone in am335x-bone.dts file
under rtc node. RTC is the incharge of controlling the system power.
This flag is used by the driver to hook up the pm_power_off system call.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index e7dff9d..febbe2f 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -52,6 +52,10 @@
};
 
};
+
+   rtc@44e3e000 {
+   ti,system-power-controller;
+   };
};
 
leds {
-- 
1.7.9.5

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


[PATCH v4 4/4] ARM: OMAP2+: omap2plus_defconfig: Enable RTC support

2012-12-13 Thread AnilKumar Ch
AM33XX family of devices use RTC module, one has to manually enable
this support to use RTC features. So this patch enable RTC driver in
omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 0ce6771..e58afc5 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -216,6 +216,7 @@ CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_LEDS_TRIGGER_GPIO=y
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_OMAP=y
 CONFIG_RTC_DRV_TWL92330=y
 CONFIG_RTC_DRV_TWL4030=y
 CONFIG_DMADEVICES=y
-- 
1.7.9.5

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


[PATCH v4 1/4] rtc: OMAP: Add system pm_power_off to rtc driver

2012-12-13 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Add system power off control to rtc driver which is the in-charge
of controlling the BeagleBone system power. The power_off routine
can be hooked up to pm_power_off system call.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move poweroff additions to rtc driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 drivers/rtc/rtc-omap.c |   74 +++-
 2 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt 
b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index b47aa41..8d9f4f9 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -6,6 +6,10 @@ Required properties:
 - interrupts: rtc timer, alarm interrupts in order
 - interrupt-parent: phandle for the interrupt controller
 
+Optional properties:
+- ti,system-power-controller: Telling whether or not rtc is controlling
+  the system power.
+
 Example:
 
 rtc@1c23000 {
@@ -14,4 +18,5 @@ rtc@1c23000 {
interrupts = 19
  19;
interrupt-parent = intc;
+   ti,system-power-controller;
 };
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 6009714..e6d4878 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -72,6 +72,14 @@
 #define OMAP_RTC_KICK0_REG 0x6c
 #define OMAP_RTC_KICK1_REG 0x70
 
+#define OMAP_RTC_ALARM2_SECONDS_REG0x80
+#define OMAP_RTC_ALARM2_MINUTES_REG0x84
+#define OMAP_RTC_ALARM2_HOURS_REG  0x88
+#define OMAP_RTC_ALARM2_DAYS_REG   0x8c
+#define OMAP_RTC_ALARM2_MONTHS_REG 0x90
+#define OMAP_RTC_ALARM2_YEARS_REG  0x94
+#define OMAP_RTC_PMIC_REG  0x98
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT(17)
 #define OMAP_RTC_CTRL_DISABLE  (16)
@@ -93,15 +101,21 @@
 #define OMAP_RTC_STATUS_BUSY(10)
 
 /* OMAP_RTC_INTERRUPTS_REG bit fields: */
+#define OMAP_RTC_INTERRUPTS_IT_ALARM2   (14)
 #define OMAP_RTC_INTERRUPTS_IT_ALARM(13)
 #define OMAP_RTC_INTERRUPTS_IT_TIMER(12)
 
+/* OMAP_RTC_PMIC_REG bit fields: */
+#define OMAP_RTC_PMIC_POWER_EN_EN   (116)
+
 /* OMAP_RTC_KICKER values */
 #defineKICK0_VALUE 0x83e70b13
 #defineKICK1_VALUE 0x95a4f1e0
 
 #defineOMAP_RTC_HAS_KICKER 0x1
 
+#define SHUTDOWN_TIME_SEC  2
+
 static void __iomem*rtc_base;
 
 #define rtc_read(addr) readb(rtc_base + (addr))
@@ -290,6 +304,56 @@ static int omap_rtc_set_alarm(struct device *dev, struct 
rtc_wkalrm *alm)
return 0;
 }
 
+/*
+ * rtc_power_off: Set the pmic power off sequence. The RTC generates
+ * pmic_pwr_enable control, which can be used to control an external
+ * PMIC.
+ */
+static void rtc_power_off(void)
+{
+   u32 val;
+   struct rtc_time tm;
+   unsigned long time;
+
+   /* Set PMIC power enable */
+   val = readl(rtc_base + OMAP_RTC_PMIC_REG);
+   writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
+
+   /* Read rtc time */
+   omap_rtc_read_time(NULL, tm);
+
+   /* Convert Gregorian date to seconds since 01-01-1970 00:00:00 */
+   rtc_tm_to_time(tm, time);
+
+   /* Add shutdown time to the current value */
+   time += SHUTDOWN_TIME_SEC;
+
+   /* Convert seconds since 01-01-1970 00:00:00 to Gregorian date */
+   rtc_time_to_tm(time, tm);
+
+   if (tm2bcd(tm)  0)
+   return;
+
+   pr_info(System will go to power_off state in approx. %d secs\n,
+   SHUTDOWN_TIME_SEC);
+
+   /*
+* pmic_pwr_enable is controlled by means of ALARM2 event. So here
+* programming alarm2 expiry time and enabling alarm2 interrupt
+*/
+   rtc_write(tm.tm_sec, OMAP_RTC_ALARM2_SECONDS_REG);
+   rtc_write(tm.tm_min, OMAP_RTC_ALARM2_MINUTES_REG);
+   rtc_write(tm.tm_hour, OMAP_RTC_ALARM2_HOURS_REG);
+   rtc_write(tm.tm_mday, OMAP_RTC_ALARM2_DAYS_REG);
+   rtc_write(tm.tm_mon, OMAP_RTC_ALARM2_MONTHS_REG);
+   rtc_write(tm.tm_year, OMAP_RTC_ALARM2_YEARS_REG);
+
+   /* Enable alarm2 interrupt */
+   val = readl(rtc_base + OMAP_RTC_INTERRUPTS_REG);
+   writel(val | OMAP_RTC_INTERRUPTS_IT_ALARM2,
+   rtc_base + OMAP_RTC_INTERRUPTS_REG);
+}
+
 static struct rtc_class_ops omap_rtc_ops = {
.read_time  = omap_rtc_read_time,
.set_time   = omap_rtc_set_time,
@@ -327,12 +391,16 @@ static int __init omap_rtc_probe(struct platform_device 
*pdev)
struct resource *res, *mem;
struct rtc_device

[PATCH RESEND] ARM: dts: AM33XX: Rename I2C and GPIO nodes

2012-11-21 Thread AnilKumar Ch
Rename I2C and GPIO nodes according to AM33XX TRM. According to
AM33XX TRM device instances are starting from 0 like i2c0, i2c1
and i2c3.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
[pa...@antoniou-consulting.com: initial patch by pantelis's]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
Changes from first version:
- Updated pantelis's patch
  * Modified based on linux-omap/master
  * Added GPIO nodes renaming as well

 arch/arm/boot/dts/am335x-bone.dts  |   10 +-
 arch/arm/boot/dts/am335x-evm.dts   |   18 +-
 arch/arm/boot/dts/am335x-evmsk.dts |   18 +-
 arch/arm/boot/dts/am33xx.dtsi  |   14 +++---
 4 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 2c33888..77b4352 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -43,7 +43,7 @@
status = okay;
};
 
-   i2c1: i2c@44e0b000 {
+   i2c0: i2c@44e0b000 {
status = okay;
clock-frequency = 40;
 
@@ -59,27 +59,27 @@
 
led@2 {
label = beaglebone:green:heartbeat;
-   gpios = gpio2 21 0;
+   gpios = gpio1 21 0;
linux,default-trigger = heartbeat;
default-state = off;
};
 
led@3 {
label = beaglebone:green:mmc0;
-   gpios = gpio2 22 0;
+   gpios = gpio1 22 0;
linux,default-trigger = mmc0;
default-state = off;
};
 
led@4 {
label = beaglebone:green:usr2;
-   gpios = gpio2 23 0;
+   gpios = gpio1 23 0;
default-state = off;
};
 
led@5 {
label = beaglebone:green:usr3;
-   gpios = gpio2 24 0;
+   gpios = gpio1 24 0;
default-state = off;
};
};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9f65f17..705a9c5 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -51,7 +51,7 @@
status = okay;
};
 
-   i2c1: i2c@44e0b000 {
+   i2c0: i2c@44e0b000 {
status = okay;
clock-frequency = 40;
 
@@ -60,7 +60,7 @@
};
};
 
-   i2c2: i2c@4802a000 {
+   i2c1: i2c@4802a000 {
status = okay;
clock-frequency = 10;
 
@@ -123,12 +123,12 @@
debounce-delay-ms = 5;
col-scan-delay-us = 2;
 
-   row-gpios = gpio2 25 0/* Bank1, pin25 */
-gpio2 26 0/* Bank1, pin26 */
-gpio2 27 0;  /* Bank1, pin27 */
+   row-gpios = gpio1 25 0/* Bank1, pin25 */
+gpio1 26 0/* Bank1, pin26 */
+gpio1 27 0;  /* Bank1, pin27 */
 
-   col-gpios = gpio2 21 0/* Bank1, pin21 */
-gpio2 22 0;  /* Bank1, pin22 */
+   col-gpios = gpio1 21 0/* Bank1, pin21 */
+gpio1 22 0;  /* Bank1, pin22 */
 
linux,keymap = 0x008b  /* MENU */
0x019e  /* BACK */
@@ -147,14 +147,14 @@
switch@9 {
label = volume-up;
linux,code = 115;
-   gpios = gpio1 2 1;
+   gpios = gpio0 2 1;
gpio-key,wakeup;
};
 
switch@10 {
label = volume-down;
linux,code = 114;
-   gpios = gpio1 3 1;
+   gpios = gpio0 3 1;
gpio-key,wakeup;
};
};
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index f5a6162..f67c360 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -58,7 +58,7 @@
status = okay;
};
 
-   i2c1: i2c@44e0b000 {
+   i2c0: i2c@44e0b000 {
status = okay;
clock-frequency = 40;
 
@@ -115,26 +115,26 @@
 
led@1 {
label = evmsk:green:usr0;
-   gpios = gpio2 4 0;
+   gpios = gpio1 4 0

[PATCH v3 3/5] ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone

2012-11-20 Thread AnilKumar Ch
Set ti,pmic-shutdown-controller for BeagleBone in am335x-bone.dts
file, this flag is used by the driver to set tps65217 PMIC status
to OFF when PWR_EN toggle.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 2c33888..1d55190 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -88,6 +88,8 @@
 /include/ tps65217.dtsi
 
 tps {
+   ti,pmic-shutdown-controller;
+
regulators {
dcdc1_reg: regulator@0 {
regulator-always-on;
-- 
1.7.9.5

--
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 v3 1/5] rtc: OMAP: Add system pm_power_off to rtc driver

2012-11-20 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Add system power off control to rtc driver which is the in-charge
of controlling the BeagleBone system power. The power_off routine
can be hooked up to pm_power_off system call.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

Added while (1); after the above steps to make sure that no other
process acquire cpu. Otherwise we might see an unexpected behaviour
because we are shutting down all the power rails of SoC except RTC.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move poweroff additions to rtc driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 drivers/rtc/rtc-omap.c |   81 +++-
 2 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt 
b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index b47aa41..8d9f4f9 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -6,6 +6,10 @@ Required properties:
 - interrupts: rtc timer, alarm interrupts in order
 - interrupt-parent: phandle for the interrupt controller
 
+Optional properties:
+- ti,system-power-controller: Telling whether or not rtc is controlling
+  the system power.
+
 Example:
 
 rtc@1c23000 {
@@ -14,4 +18,5 @@ rtc@1c23000 {
interrupts = 19
  19;
interrupt-parent = intc;
+   ti,system-power-controller;
 };
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 6009714..c31f93a 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -72,6 +72,14 @@
 #define OMAP_RTC_KICK0_REG 0x6c
 #define OMAP_RTC_KICK1_REG 0x70
 
+#define OMAP_RTC_ALARM2_SECONDS_REG0x80
+#define OMAP_RTC_ALARM2_MINUTES_REG0x84
+#define OMAP_RTC_ALARM2_HOURS_REG  0x88
+#define OMAP_RTC_ALARM2_DAYS_REG   0x8c
+#define OMAP_RTC_ALARM2_MONTHS_REG 0x90
+#define OMAP_RTC_ALARM2_YEARS_REG  0x94
+#define OMAP_RTC_PMIC_REG  0x98
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT(17)
 #define OMAP_RTC_CTRL_DISABLE  (16)
@@ -93,15 +101,21 @@
 #define OMAP_RTC_STATUS_BUSY(10)
 
 /* OMAP_RTC_INTERRUPTS_REG bit fields: */
+#define OMAP_RTC_INTERRUPTS_IT_ALARM2   (14)
 #define OMAP_RTC_INTERRUPTS_IT_ALARM(13)
 #define OMAP_RTC_INTERRUPTS_IT_TIMER(12)
 
+/* OMAP_RTC_PMIC_REG bit fields: */
+#define OMAP_RTC_PMIC_POWER_EN_EN   (116)
+
 /* OMAP_RTC_KICKER values */
 #defineKICK0_VALUE 0x83e70b13
 #defineKICK1_VALUE 0x95a4f1e0
 
 #defineOMAP_RTC_HAS_KICKER 0x1
 
+#define SHUTDOWN_TIME_SEC  2
+
 static void __iomem*rtc_base;
 
 #define rtc_read(addr) readb(rtc_base + (addr))
@@ -290,6 +304,63 @@ static int omap_rtc_set_alarm(struct device *dev, struct 
rtc_wkalrm *alm)
return 0;
 }
 
+/*
+ * rtc_power_off: Set the pmic power off sequence. The RTC generates
+ * pmic_pwr_enable control, which can be used to control an external
+ * PMIC.
+ */
+static void rtc_power_off(void)
+{
+   u32 val;
+   struct rtc_time tm;
+   spinlock_t lock;
+   unsigned long flags, time;
+
+   spin_lock_init(lock);
+
+   /* Set PMIC power enable */
+   val = readl(rtc_base + OMAP_RTC_PMIC_REG);
+   writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
+
+   /* Read rtc time */
+   omap_rtc_read_time(NULL, tm);
+
+   /* Convert Gregorian date to seconds since 01-01-1970 00:00:00 */
+   rtc_tm_to_time(tm, time);
+
+   /* Add shutdown time to the current value */
+   time += SHUTDOWN_TIME_SEC;
+
+   /* Convert seconds since 01-01-1970 00:00:00 to Gregorian date */
+   rtc_time_to_tm(time, tm);
+
+   if (tm2bcd(tm)  0)
+   return;
+
+   pr_info(System will go to power_off state in approx. %d secs\n,
+   SHUTDOWN_TIME_SEC);
+
+   /*
+* pmic_pwr_enable is controlled by means of ALARM2 event. So here
+* programming alarm2 expiry time and enabling alarm2 interrupt
+*/
+   rtc_write(tm.tm_sec, OMAP_RTC_ALARM2_SECONDS_REG);
+   rtc_write(tm.tm_min, OMAP_RTC_ALARM2_MINUTES_REG);
+   rtc_write(tm.tm_hour, OMAP_RTC_ALARM2_HOURS_REG);
+   rtc_write(tm.tm_mday, OMAP_RTC_ALARM2_DAYS_REG);
+   rtc_write(tm.tm_mon, OMAP_RTC_ALARM2_MONTHS_REG);
+   rtc_write(tm.tm_year, OMAP_RTC_ALARM2_YEARS_REG);
+
+   /* Enable alarm2 interrupt */
+   val = readl(rtc_base + OMAP_RTC_INTERRUPTS_REG);
+   writel(val | OMAP_RTC_INTERRUPTS_IT_ALARM2,
+   rtc_base + OMAP_RTC_INTERRUPTS_REG);
+
+   /* Do not allow

[PATCH v3 2/5] mfd: tps65217: Set PMIC to shutdown on PWR_EN toggle

2012-11-20 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Set tps65217 PMIC status to OFF if power enable toggle is supported.
By setting this bit to 1 to enter PMIC to OFF state when PWR_EN pin
is pulled low. Also adds a DT flag to specify that device pmic
supports shutdown control or not.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move the additions to tps65217 MFD driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 .../devicetree/bindings/regulator/tps65217.txt |4 
 drivers/mfd/tps65217.c |   12 
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt 
b/Documentation/devicetree/bindings/regulator/tps65217.txt
index d316fb8..4f05d20 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -11,6 +11,9 @@ Required properties:
   using the standard binding for regulators found at
   Documentation/devicetree/bindings/regulator/regulator.txt.
 
+Optional properties:
+- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
+
   The valid names for regulators are:
   tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
 
@@ -20,6 +23,7 @@ Example:
 
tps: tps@24 {
compatible = ti,tps65217;
+   ti,pmic-shutdown-controller;
 
regulators {
dcdc1_reg: dcdc1 {
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 3fb32e6..c7f17d8 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -160,6 +160,7 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
unsigned int version;
unsigned int chip_id = ids-driver_data;
const struct of_device_id *match;
+   bool status_off = false;
int ret;
 
if (client-dev.of_node) {
@@ -170,6 +171,8 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return -EINVAL;
}
chip_id = (unsigned int)match-data;
+   status_off = of_property_read_bool(client-dev.of_node,
+   ti,pmic-shutdown-controller);
}
 
if (!chip_id) {
@@ -207,6 +210,15 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return ret;
}
 
+   /* Set the PMIC to shutdown on PWR_EN toggle */
+   if (status_off) {
+   ret = tps65217_set_bits(tps, TPS65217_REG_STATUS,
+   TPS65217_STATUS_OFF, TPS65217_STATUS_OFF,
+   TPS65217_PROTECT_NONE);
+   if (ret)
+   dev_warn(tps-dev, unable to set the status OFF\n);
+   }
+
dev_info(tps-dev, TPS65217 ID %#x version 1.%d\n,
(version  TPS65217_CHIPID_CHIP_MASK)  4,
version  TPS65217_CHIPID_REV_MASK);
-- 
1.7.9.5

--
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] can: c_can: Add d_can raminit support

2012-11-20 Thread AnilKumar Ch
Add D_CAN raminit support to C_CAN driver to enable D_CAN RAM,
which holds all the message objects during transmission or
receiving of data. This initialization/de-initialization should
be done in synchronous with D_CAN clock.

In case of AM335X-EVM (current user of D_CAN driver) message RAM is
controlled through control module register for both instances. So
control module register details is required to initialization or
de-initialization of message RAM according to instance number.

Control module memory resource is obtained from D_CAN dt node and
instance number obtained from device tree aliases node.

This patch was tested on AM335x-EVM along with pinctrl data addition
patch, d_can dt aliases addition and control module data addition.
pinctrl data addition is not added to am335x-evm.dts (only supports
CPLD profile#0) because d_can1 is supported under CPLD profile#1.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
Changes from v1:
- Incorporated Marc's comments on v1
  * sanity check moved to c_can_probe() from c_can_hw_raminit()
  * device instance is assigned using conditional operator
  * Changed warning to info to tell control module is not
used for raminit if there is no second IORESOURCE_MEM
- Dropped dt patches
  * No changes from v1
  * Those will go to linux-omap/master

 drivers/net/can/c_can/c_can.c  |   12 
 drivers/net/can/c_can/c_can.h  |3 +++
 drivers/net/can/c_can/c_can_platform.c |   33 +++-
 3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index e5180df..c15830c 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -233,6 +233,12 @@ static inline void c_can_pm_runtime_put_sync(const struct 
c_can_priv *priv)
pm_runtime_put_sync(priv-device);
 }
 
+static inline void c_can_reset_ram(const struct c_can_priv *priv, bool enable)
+{
+   if (priv-ram_init)
+   priv-ram_init(priv, enable);
+}
+
 static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
 {
return (priv-tx_next  C_CAN_NEXT_MSG_OBJ_MASK) +
@@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev)
struct c_can_priv *priv = netdev_priv(dev);
 
c_can_pm_runtime_get_sync(priv);
+   c_can_reset_ram(priv, true);
 
/* open the can device */
err = open_candev(dev);
@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev)
 exit_irq_fail:
close_candev(dev);
 exit_open_fail:
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
return err;
 }
@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev)
c_can_stop(dev);
free_irq(dev-irq, dev);
close_candev(dev);
+
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
 
return 0;
@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev)
 
c_can_stop(dev);
 
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
 
return 0;
@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev)
WARN_ON(priv-type != BOSCH_D_CAN);
 
c_can_pm_runtime_get_sync(priv);
+   c_can_reset_ram(priv, true);
 
/* Clear PDR and INIT bits */
val = priv-read_reg(priv, C_CAN_CTRL_EX_REG);
diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h
index e5ed41d..419de5c 100644
--- a/drivers/net/can/c_can/c_can.h
+++ b/drivers/net/can/c_can/c_can.h
@@ -169,6 +169,9 @@ struct c_can_priv {
void *priv; /* for board-specific data */
u16 irqstatus;
enum c_can_dev_id type;
+   u32 __iomem *raminit_ctrlreg;
+   unsigned int instance;
+   void (*ram_init) (const struct c_can_priv *priv, bool enable);
 };
 
 struct net_device *alloc_c_can_dev(void);
diff --git a/drivers/net/can/c_can/c_can_platform.c 
b/drivers/net/can/c_can/c_can_platform.c
index ee141613..d1c31c8 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -38,6 +38,8 @@
 
 #include c_can.h
 
+#define CAN_RAMINIT_START_MASK(i)  (1  (i))
+
 /*
  * 16-bit c_can registers can be arranged differently in the memory
  * architecture of different implementations. For example: 16-bit
@@ -68,6 +70,21 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct 
c_can_priv *priv,
writew(val, priv-base + 2 * priv-regs[index]);
 }
 
+static void c_can_hw_raminit(const struct c_can_priv *priv, bool enable)
+{
+   u32 val;
+
+   val = readl(priv-raminit_ctrlreg);
+   if (enable) {
+   val = ~CAN_RAMINIT_START_MASK(priv-instance);
+   val |= CAN_RAMINIT_START_MASK(priv-instance);
+   writel(val, priv-raminit_ctrlreg);
+   } else {
+   val = ~CAN_RAMINIT_START_MASK(priv

[PATCH 1/7] ARM: OMAP2+: omap2plus_defconfig: Enable tps65910 PMIC

2012-11-20 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have tps65910 PMIC regulator, one
has to manually enable this support to use regulators. So this patch
enables tps65910 mfd and regulator driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index b0563dc..2cf6d0e 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -135,10 +135,12 @@ CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
 CONFIG_MFD_TPS65217=y
+CONFIG_MFD_TPS65910=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
 CONFIG_REGULATOR_TPS65217=y
+CONFIG_REGULATOR_TPS65910=y
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.9.5

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


[PATCH 7/7] ARM: OMAP2+: omap2plus_defconfig: Enable DCAN controller

2012-11-20 Thread AnilKumar Ch
AM335X-EVM has BOSCH DCAN controller, one has to manually enable
this support to use of DCAN controller. So this patch enables DCAN
driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 5e1a763..d79f9c3 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -54,6 +54,11 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+CONFIG_CAN_C_CAN=y
+CONFIG_CAN_C_CAN_PLATFORM=y
 CONFIG_BT=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
-- 
1.7.9.5

--
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 6/7] ARM: OMAP2+: omap2plus_defconfig: Enable leds-gpio driver

2012-11-20 Thread AnilKumar Ch
AM335X-EVMSK and AM335X-BONE devices have gpio controlled user leds,
one has to manually enable this support to use user leds. So this
patch enables gpio-leds driver in omap2plus_defconfig. Also enables
TRIGGER_TIMER and TRIGGER_HEARTBEAT.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 133f04a..5e1a763 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -202,6 +202,11 @@ CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_SDIO_UART=y
 CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_OMAP=y
 CONFIG_RTC_DRV_TWL92330=y
-- 
1.7.9.5

--
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/7] ARM: OMAP2+: omap2plus_defconfig: Enable matrix keypad driver

2012-11-20 Thread AnilKumar Ch
AM335X-EVM device have 3x2 matrix keypad, one has to manually enable
this support to use matrix keypad. So this patch enables matrix keypad
driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index cf08365..9f9a637 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -111,6 +111,7 @@ CONFIG_USB_KC2190=y
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
 CONFIG_KEYBOARD_TWL4030=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=y
-- 
1.7.9.5

--
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/7] ARM: OMAP2+: omap2plus_defconfig: Enable lis3lv02d accelerometer

2012-11-20 Thread AnilKumar Ch
AM335X-EVM and AM335X-EVMSK devices have lis331dlh accelerometer, one
has to manually enable this support to use accelerometer. So this patch
enables lis3lv02d driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 2cf6d0e..c69c08d 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -83,6 +83,8 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_SENSORS_LIS3LV02D=y
+CONFIG_SENSORS_LIS3_I2C=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
-- 
1.7.9.5

--
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/7] ARM: OMAP2+: AM33XX: Enable few drivers in omap2plus_defconfig

2012-11-20 Thread AnilKumar Ch
This patch series enable tps65910, lis3lv02d accelerometer, tsl2550
ambient light sensor, matrix keypad, tmp275 temperature sensor, gpio
leds and D_CAN drivers in omap2plus_defconfig.

These are the peripherals present in AM33XX family of devices.

AnilKumar Ch (7):
  ARM: OMAP2+: omap2plus_defconfig: Enable tps65910 PMIC
  ARM: OMAP2+: omap2plus_defconfig: Enable lis3lv02d accelerometer
  ARM: OMAP2+: omap2plus_defconfig: Enable tsl2550 ambient light sensor
  ARM: OMAP2+: omap2plus_defconfig: Enable matrix keypad driver
  ARM: OMAP2+: omap2plus_defconfig: Enable tmp275 sensor
  ARM: OMAP2+: omap2plus_defconfig: Enable leds-gpio driver
  ARM: OMAP2+: omap2plus_defconfig: Enable DCAN controller

 arch/arm/configs/omap2plus_defconfig |   17 +
 1 file changed, 17 insertions(+)

-- 
1.7.9.5

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


[PATCH 5/7] ARM: OMAP2+: omap2plus_defconfig: Enable tmp275 sensor

2012-11-20 Thread AnilKumar Ch
AM335x-evm device have temperature sensor, one has to manually
enable this support to use of temperature sensor. So this patch
enables tmp275 driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index 9f9a637..133f04a 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -135,6 +135,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_W1=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_SENSORS_LM75=y
 CONFIG_WATCHDOG=y
 CONFIG_OMAP_WATCHDOG=y
 CONFIG_TWL4030_WATCHDOG=y
-- 
1.7.9.5

--
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/7] ARM: OMAP2+: omap2plus_defconfig: Enable tsl2550 ambient light sensor

2012-11-20 Thread AnilKumar Ch
AM335x-evm device have tsl2550 ambient light sensor, one has to
manually enable this support to use light sensor. So this patch
enables tsl2550 driver in omap2plus_defconfig.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/configs/omap2plus_defconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index c69c08d..cf08365 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -84,6 +84,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_SENSORS_LIS3LV02D=y
+CONFIG_SENSORS_TSL2550=y
 CONFIG_SENSORS_LIS3_I2C=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
-- 
1.7.9.5

--
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 3/4] ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone

2012-11-16 Thread AnilKumar Ch
Set ti,pmic-shutdown-controller for BeagleBone in am335x-bone.dts
file, this flag is used by the driver to set tps65217 PMIC status
to OFF when PWR_EN toggle.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 2c33888..1d55190 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -88,6 +88,8 @@
 /include/ tps65217.dtsi
 
 tps {
+   ti,pmic-shutdown-controller;
+
regulators {
dcdc1_reg: regulator@0 {
regulator-always-on;
-- 
1.7.9.5

--
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 4/4] ARM: dts: AM33XX: Enable system power off control in am335x-bone

2012-11-16 Thread AnilKumar Ch
Enable system power off control for BeagleBone in am335x-bone.dts file
under rtc node. RTC is the incharge of controlling the system power.
This flag is used by the driver to hook up the pm_power_off system call.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 1d55190..206c3eb 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -52,6 +52,10 @@
};
 
};
+
+   rtc@44e3e000 {
+   ti,system-power-controller;
+   };
};
 
leds {
-- 
1.7.9.5

--
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/4] pm: Add power off control

2012-11-16 Thread AnilKumar Ch
Add PM power_off control to rtc driver, along with this PMIC status
is set to STATUS_OFF to shutdown PMIC if PWR_EN is toggled by RTC
module.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

These patches were tested on AM335x-Bone.

Changes from v1:
- Incorporated Vaibhav's comments on v1
  * Changed the time rollover logic with the help of
rtc-lib APIs

AnilKumar Ch (2):
  ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone
  ARM: dts: AM33XX: Enable system power off control in am335x-bone

Colin Foe-Parker (2):
  mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
  rtc: OMAP: Add system pm_power_off to rtc driver

 .../devicetree/bindings/regulator/tps65217.txt |4 +
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 arch/arm/boot/dts/am335x-bone.dts  |6 ++
 drivers/mfd/tps65217.c |   12 +++
 drivers/rtc/rtc-omap.c |   81 +++-
 5 files changed, 107 insertions(+), 1 deletion(-)

-- 
1.7.9.5

--
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/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle

2012-11-16 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Set tps65217 PMIC status to OFF if power enable toggle is
supported. Also adds platform data flag, which should be
passed from board init data.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move the additions to tps65217 MFD driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 .../devicetree/bindings/regulator/tps65217.txt |4 
 drivers/mfd/tps65217.c |   12 
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt 
b/Documentation/devicetree/bindings/regulator/tps65217.txt
index d316fb8..4f05d20 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -11,6 +11,9 @@ Required properties:
   using the standard binding for regulators found at
   Documentation/devicetree/bindings/regulator/regulator.txt.
 
+Optional properties:
+- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
+
   The valid names for regulators are:
   tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
 
@@ -20,6 +23,7 @@ Example:
 
tps: tps@24 {
compatible = ti,tps65217;
+   ti,pmic-shutdown-controller;
 
regulators {
dcdc1_reg: dcdc1 {
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 3fb32e6..c7f17d8 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -160,6 +160,7 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
unsigned int version;
unsigned int chip_id = ids-driver_data;
const struct of_device_id *match;
+   bool status_off = false;
int ret;
 
if (client-dev.of_node) {
@@ -170,6 +171,8 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return -EINVAL;
}
chip_id = (unsigned int)match-data;
+   status_off = of_property_read_bool(client-dev.of_node,
+   ti,pmic-shutdown-controller);
}
 
if (!chip_id) {
@@ -207,6 +210,15 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return ret;
}
 
+   /* Set the PMIC to shutdown on PWR_EN toggle */
+   if (status_off) {
+   ret = tps65217_set_bits(tps, TPS65217_REG_STATUS,
+   TPS65217_STATUS_OFF, TPS65217_STATUS_OFF,
+   TPS65217_PROTECT_NONE);
+   if (ret)
+   dev_warn(tps-dev, unable to set the status OFF\n);
+   }
+
dev_info(tps-dev, TPS65217 ID %#x version 1.%d\n,
(version  TPS65217_CHIPID_CHIP_MASK)  4,
version  TPS65217_CHIPID_REV_MASK);
-- 
1.7.9.5

--
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/4] rtc: OMAP: Add system pm_power_off to rtc driver

2012-11-16 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Add system power off control to rtc driver which is the in-charge
of controlling the BeagleBone system power. The power_off routine
can be hooked up to pm_power_off system call.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

Added while (1); after the above steps to make sure that no other
process acquire cpu. Otherwise we might see an unexpected behaviour
because we are shutting down all the power rails of SoC except RTC.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move poweroff additions to rtc driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 drivers/rtc/rtc-omap.c |   81 +++-
 2 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt 
b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index b47aa41..8d9f4f9 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -6,6 +6,10 @@ Required properties:
 - interrupts: rtc timer, alarm interrupts in order
 - interrupt-parent: phandle for the interrupt controller
 
+Optional properties:
+- ti,system-power-controller: Telling whether or not rtc is controlling
+  the system power.
+
 Example:
 
 rtc@1c23000 {
@@ -14,4 +18,5 @@ rtc@1c23000 {
interrupts = 19
  19;
interrupt-parent = intc;
+   ti,system-power-controller;
 };
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 6009714..c31f93a 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -72,6 +72,14 @@
 #define OMAP_RTC_KICK0_REG 0x6c
 #define OMAP_RTC_KICK1_REG 0x70
 
+#define OMAP_RTC_ALARM2_SECONDS_REG0x80
+#define OMAP_RTC_ALARM2_MINUTES_REG0x84
+#define OMAP_RTC_ALARM2_HOURS_REG  0x88
+#define OMAP_RTC_ALARM2_DAYS_REG   0x8c
+#define OMAP_RTC_ALARM2_MONTHS_REG 0x90
+#define OMAP_RTC_ALARM2_YEARS_REG  0x94
+#define OMAP_RTC_PMIC_REG  0x98
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT(17)
 #define OMAP_RTC_CTRL_DISABLE  (16)
@@ -93,15 +101,21 @@
 #define OMAP_RTC_STATUS_BUSY(10)
 
 /* OMAP_RTC_INTERRUPTS_REG bit fields: */
+#define OMAP_RTC_INTERRUPTS_IT_ALARM2   (14)
 #define OMAP_RTC_INTERRUPTS_IT_ALARM(13)
 #define OMAP_RTC_INTERRUPTS_IT_TIMER(12)
 
+/* OMAP_RTC_PMIC_REG bit fields: */
+#define OMAP_RTC_PMIC_POWER_EN_EN   (116)
+
 /* OMAP_RTC_KICKER values */
 #defineKICK0_VALUE 0x83e70b13
 #defineKICK1_VALUE 0x95a4f1e0
 
 #defineOMAP_RTC_HAS_KICKER 0x1
 
+#define SHUTDOWN_TIME_SEC  2
+
 static void __iomem*rtc_base;
 
 #define rtc_read(addr) readb(rtc_base + (addr))
@@ -290,6 +304,63 @@ static int omap_rtc_set_alarm(struct device *dev, struct 
rtc_wkalrm *alm)
return 0;
 }
 
+/*
+ * rtc_power_off: Set the pmic power off sequence. The RTC generates
+ * pmic_pwr_enable control, which can be used to control an external
+ * PMIC.
+ */
+static void rtc_power_off(void)
+{
+   u32 val;
+   struct rtc_time tm;
+   spinlock_t lock;
+   unsigned long flags, time;
+
+   spin_lock_init(lock);
+
+   /* Set PMIC power enable */
+   val = readl(rtc_base + OMAP_RTC_PMIC_REG);
+   writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
+
+   /* Read rtc time */
+   omap_rtc_read_time(NULL, tm);
+
+   /* Convert Gregorian date to seconds since 01-01-1970 00:00:00 */
+   rtc_tm_to_time(tm, time);
+
+   /* Add shutdown time to the current value */
+   time += SHUTDOWN_TIME_SEC;
+
+   /* Convert seconds since 01-01-1970 00:00:00 to Gregorian date */
+   rtc_time_to_tm(time, tm);
+
+   if (tm2bcd(tm)  0)
+   return;
+
+   pr_info(System will go to power_off state in approx. %d secs\n,
+   SHUTDOWN_TIME_SEC);
+
+   /*
+* pmic_pwr_enable is controlled by means of ALARM2 event. So here
+* programming alarm2 expiry time and enabling alarm2 interrupt
+*/
+   rtc_write(tm.tm_sec, OMAP_RTC_ALARM2_SECONDS_REG);
+   rtc_write(tm.tm_min, OMAP_RTC_ALARM2_MINUTES_REG);
+   rtc_write(tm.tm_hour, OMAP_RTC_ALARM2_HOURS_REG);
+   rtc_write(tm.tm_mday, OMAP_RTC_ALARM2_DAYS_REG);
+   rtc_write(tm.tm_mon, OMAP_RTC_ALARM2_MONTHS_REG);
+   rtc_write(tm.tm_year, OMAP_RTC_ALARM2_YEARS_REG);
+
+   /* Enable alarm2 interrupt */
+   val = readl(rtc_base + OMAP_RTC_INTERRUPTS_REG);
+   writel(val | OMAP_RTC_INTERRUPTS_IT_ALARM2,
+   rtc_base + OMAP_RTC_INTERRUPTS_REG);
+
+   /* Do not allow

[PATCH 3/3] ARM: dts: AM33XX: Add memory resource to d_can node

2012-11-14 Thread AnilKumar Ch
Add a new address space/memory resource to d_can device tree node. D_CAN
RAM initialization is achieved through RAMINIT register which is part of
AM33XX control module address space. D_CAN RAM init or de-init should be
done by writing instance corresponding value to control module register.

Till we have a separate control module driver to write to control module,
d_can driver will handle the register writes to control module by itself.
So a new address space to represent this control module register is added
to d_can driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index c92c35f..ea011d6 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -227,7 +227,8 @@
dcan0: d_can@481cc000 {
compatible = bosch,d_can;
ti,hwmods = d_can0;
-   reg = 0x481cc000 0x2000;
+   reg = 0x481cc000 0x2000
+   0x44e10644 0x4;
interrupts = 52;
status = disabled;
};
@@ -235,7 +236,8 @@
dcan1: d_can@481d {
compatible = bosch,d_can;
ti,hwmods = d_can1;
-   reg = 0x481d 0x2000;
+   reg = 0x481d 0x2000
+   0x44e10644 0x4;
interrupts = 55;
status = disabled;
};
-- 
1.7.9.5

--
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] can: c_can: Add d_can raminit support

2012-11-14 Thread AnilKumar Ch
Add D_CAN raminit support to C_CAN driver to enable D_CAN RAM,
which holds all the message objects during transmission or
receiving of data. This initialization/de-initialization should
be done in synchronous with D_CAN clock.

In case of AM335X-EVM (active user of D_CAN driver) message RAM is
controlled through control module register for both instances. So
control module register details is required to initialization or
de-initialization of message RAM according to instance number.

Control module memory resource is obtained from D_CAN dt node and
instance number obtained from device tree aliases node.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/net/can/c_can/c_can.c  |   12 +++
 drivers/net/can/c_can/c_can.h  |3 +++
 drivers/net/can/c_can/c_can_platform.c |   34 +++-
 3 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index e5180df..c15830c 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -233,6 +233,12 @@ static inline void c_can_pm_runtime_put_sync(const struct 
c_can_priv *priv)
pm_runtime_put_sync(priv-device);
 }
 
+static inline void c_can_reset_ram(const struct c_can_priv *priv, bool enable)
+{
+   if (priv-ram_init)
+   priv-ram_init(priv, enable);
+}
+
 static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
 {
return (priv-tx_next  C_CAN_NEXT_MSG_OBJ_MASK) +
@@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev)
struct c_can_priv *priv = netdev_priv(dev);
 
c_can_pm_runtime_get_sync(priv);
+   c_can_reset_ram(priv, true);
 
/* open the can device */
err = open_candev(dev);
@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev)
 exit_irq_fail:
close_candev(dev);
 exit_open_fail:
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
return err;
 }
@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev)
c_can_stop(dev);
free_irq(dev-irq, dev);
close_candev(dev);
+
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
 
return 0;
@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev)
 
c_can_stop(dev);
 
+   c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
 
return 0;
@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev)
WARN_ON(priv-type != BOSCH_D_CAN);
 
c_can_pm_runtime_get_sync(priv);
+   c_can_reset_ram(priv, true);
 
/* Clear PDR and INIT bits */
val = priv-read_reg(priv, C_CAN_CTRL_EX_REG);
diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h
index e5ed41d..419de5c 100644
--- a/drivers/net/can/c_can/c_can.h
+++ b/drivers/net/can/c_can/c_can.h
@@ -169,6 +169,9 @@ struct c_can_priv {
void *priv; /* for board-specific data */
u16 irqstatus;
enum c_can_dev_id type;
+   u32 __iomem *raminit_ctrlreg;
+   unsigned int instance;
+   void (*ram_init) (const struct c_can_priv *priv, bool enable);
 };
 
 struct net_device *alloc_c_can_dev(void);
diff --git a/drivers/net/can/c_can/c_can_platform.c 
b/drivers/net/can/c_can/c_can_platform.c
index ee141613..2e61d69 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -38,6 +38,8 @@
 
 #include c_can.h
 
+#define CAN_RAMINIT_START_MASK(i)  (1  (i))
+
 /*
  * 16-bit c_can registers can be arranged differently in the memory
  * architecture of different implementations. For example: 16-bit
@@ -68,6 +70,24 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct 
c_can_priv *priv,
writew(val, priv-base + 2 * priv-regs[index]);
 }
 
+static void c_can_hw_raminit(const struct c_can_priv *priv, bool enable)
+{
+   u32 val;
+
+   if (!priv-raminit_ctrlreg || (priv-instance  0))
+   return;
+
+   val = readl(priv-raminit_ctrlreg);
+   if (enable) {
+   val = ~CAN_RAMINIT_START_MASK(priv-instance);
+   val |= CAN_RAMINIT_START_MASK(priv-instance);
+   writel(val, priv-raminit_ctrlreg);
+   } else {
+   val = ~CAN_RAMINIT_START_MASK(priv-instance);
+   writel(val, priv-raminit_ctrlreg);
+   }
+}
+
 static struct platform_device_id c_can_id_table[] = {
[BOSCH_C_CAN_PLATFORM] = {
.name = KBUILD_MODNAME,
@@ -99,7 +119,7 @@ static int __devinit c_can_plat_probe(struct platform_device 
*pdev)
const struct of_device_id *match;
const struct platform_device_id *id;
struct pinctrl *pinctrl;
-   struct resource *mem;
+   struct resource *mem, *res;
int irq;
struct clk *clk;
 
@@ -178,6 +198,18 @@ static int __devinit c_can_plat_probe(struct 
platform_device *pdev)
priv

[PATCH 0/3] can: Add D_CAN raminit support to am335x-evm

2012-11-14 Thread AnilKumar Ch
This patch series adds d_can raminit support to c_can/d_can driver,
which is required to init/de-init D_CAN message RAM (holds message
objects). Added corresponding DT changes to get resource of RAMINIT
register and device instance.

These patches were tested on AM335x-EVM along with pinctrl data addition
patch, which is not added to am335x-evm.dts (only supports CPLD profile#0)
because d_can1 is supported under CPLD profile#1.

AnilKumar Ch (3):
  can: c_can: Add d_can raminit support
  ARM: dts: AM33XX: Add d_can instances to aliases
  ARM: dts: AM33XX: Add memory resource to d_can node

 arch/arm/boot/dts/am33xx.dtsi  |8 ++--
 drivers/net/can/c_can/c_can.c  |   12 +++
 drivers/net/can/c_can/c_can.h  |3 +++
 drivers/net/can/c_can/c_can_platform.c |   34 +++-
 4 files changed, 54 insertions(+), 3 deletions(-)

-- 
1.7.9.5

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


[PATCH 2/3] ARM: dts: AM33XX: Add d_can instances to aliases

2012-11-14 Thread AnilKumar Ch
Add d_can instances to aliases node to get the D_CAN instance number
from the driver. To initialize D_CAN message RAM, corresponding instance
number is required.

To initialize instance 0 message RAM then 0x1 should be written and for
instance 1 message RAM, 0x2 should be written to control module register.

With device-tree framework ip instance number is -1 by default for all
instances. To get device id/instance number then modules should be added
to DT aliases node. of_alias_get_id() gives the device id number based
on number of alias nodes present in aliases node.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 5dfd682..c92c35f 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -21,6 +21,8 @@
serial3 = uart4;
serial4 = uart5;
serial5 = uart6;
+   d_can0 = dcan0;
+   d_can1 = dcan1;
};
 
cpus {
-- 
1.7.9.5

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


[PATCH RESEND 02/10] ARM: dts: AM33XX: Add matrix keypad device tree data to am335x-evm

2012-11-06 Thread AnilKumar Ch
Add matrix keypad device tree data to am335x-evm by adding all
the necessary parameters like keymap, row  column gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   20 
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9199456..8076e66 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -110,6 +110,26 @@
regulator-name = lis3_reg;
regulator-boot-on;
};
+
+   matrix_keypad: matrix_keypad@0 {
+   compatible = gpio-matrix-keypad;
+   debounce-delay-ms = 5;
+   col-scan-delay-us = 2;
+
+   row-gpios = gpio2 25 0/* Bank1, pin25 */
+gpio2 26 0/* Bank1, pin26 */
+gpio2 27 0;  /* Bank1, pin27 */
+
+   col-gpios = gpio2 21 0/* Bank1, pin21 */
+gpio2 22 0;  /* Bank1, pin22 */
+
+   linux,keymap = 0x008b  /* MENU */
+   0x019e  /* BACK */
+   0x0269  /* LEFT */
+   0x0001006a  /* RIGHT */
+   0x0101001c  /* ENTER */
+   0x0201006c;/* DOWN */
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

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


[PATCH RESEND 06/10] ARM: dts: AM33XX: Add user-leds device tree data to am335x-bone

2012-11-06 Thread AnilKumar Ch
Add gpio-leds device tree data to am335x-bone device to enable gpio
based user-leds (USR0, USR1, USR2 and USR3) present on BeagleBone.

[k...@dominion.thruhere.net: led0, led1 suggested by koen]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 1aac58b..2c33888 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -53,6 +53,36 @@
 
};
};
+
+   leds {
+   compatible = gpio-leds;
+
+   led@2 {
+   label = beaglebone:green:heartbeat;
+   gpios = gpio2 21 0;
+   linux,default-trigger = heartbeat;
+   default-state = off;
+   };
+
+   led@3 {
+   label = beaglebone:green:mmc0;
+   gpios = gpio2 22 0;
+   linux,default-trigger = mmc0;
+   default-state = off;
+   };
+
+   led@4 {
+   label = beaglebone:green:usr2;
+   gpios = gpio2 23 0;
+   default-state = off;
+   };
+
+   led@5 {
+   label = beaglebone:green:usr3;
+   gpios = gpio2 24 0;
+   default-state = off;
+   };
+   };
 };
 
 /include/ tps65217.dtsi
-- 
1.7.9.5

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


[PATCH RESEND 09/10] ARM: dts: AM33XX: Add pinmux configuration for gpio-keys to EVMSK

2012-11-06 Thread AnilKumar Ch
Add pinmux configurations for gpio based keys to am335x-evmsk. In
this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 7262fa8..0f825dd 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -32,7 +32,7 @@
 
am33xx_pinmux: pinmux@44e10800 {
pinctrl-names = default;
-   pinctrl-0 = user_leds_s0;
+   pinctrl-0 = user_leds_s0 gpio_keys_s0;
 
user_leds_s0: user_leds_s0 {
pinctrl-single,pins = 
@@ -42,6 +42,15 @@
0x1c 0x7/* gpmc_ad7.gpio1_7, OUTPUT | 
MODE7 */
;
};
+
+   gpio_keys_s0: gpio_keys_s0 {
+   pinctrl-single,pins = 
+   0x94 0x27   /* gpmc_oen_ren.gpio2_3, INPUT 
| MODE7 */
+   0x90 0x27   /* gpmc_advn_ale.gpio2_2, INPUT 
| MODE7 */
+   0x70 0x27   /* gpmc_wait0.gpio0_30, INPUT | 
MODE7 */
+   0x9c 0x27   /* gpmc_ben0_cle.gpio2_5, INPUT 
| MODE7 */
+   ;
+   };
};
 
ocp {
-- 
1.7.9.5

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


[PATCH RESEND 00/10] ARM: dts: AM33XX: Add device tree data

2012-11-06 Thread AnilKumar Ch
Add device tree date for GPIO based various drivers matrix keypad,
volume keys, push buttons and use leds accross three AM33XX devices
viz EVM, BeagleBone and Starter Kit.

To make it functional this series also adds pinctrl data for all
the GPIOs used by various drivers. In this series only default state
pinmux/conf settings are added because of sleep/idle state pinctrl
values are not available.

These patches are based on linux-omap-dt:for_3.8/dts_part2 tree and
these were tested on am33xx devices according to added functionality.

Change log:
- Rebased on for_3.8/dts_part2

AnilKumar Ch (10):
  ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM
  ARM: dts: AM33XX: Add matrix keypad device tree data to am335x-evm
  ARM: dts: AM33XX: Add pinmux configuration for volume-keys to EVM
  ARM: dts: AM33XX: Add volume-keys device tree data to am335x-evm
  ARM: dts: AM33XX: Add pinmux configuration for user-leds to BONE
  ARM: dts: AM33XX: Add user-leds device tree data to am335x-bone
  ARM: dts: AM33XX: Add pinmux configuration for gpio-leds to EVMSK
  ARM: dts: AM33XX: Add user-leds device tree data to am335x-evmsk
  ARM: dts: AM33XX: Add pinmux configuration for gpio-keys to EVMSK
  ARM: dts: AM33XX: Add push-buttons device tree data to am335x-evmsk

 arch/arm/boot/dts/am335x-bone.dts  |   44 +++
 arch/arm/boot/dts/am335x-evm.dts   |   63 +++
 arch/arm/boot/dts/am335x-evmsk.dts |   84 
 3 files changed, 191 insertions(+)

-- 
1.7.9.5

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


[PATCH RESEND 04/10] ARM: dts: AM33XX: Add volume-keys device tree data to am335x-evm

2012-11-06 Thread AnilKumar Ch
Add gpio based volume keys device tree data to am335x-evm by adding
all the required parameters like keycode, gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   21 +
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index e087b87..9f65f17 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -137,6 +137,27 @@
0x0101001c  /* ENTER */
0x0201006c;/* DOWN */
};
+
+   gpio_keys: volume_keys@0 {
+   compatible = gpio-keys;
+   #address-cells = 1;
+   #size-cells = 0;
+   autorepeat;
+
+   switch@9 {
+   label = volume-up;
+   linux,code = 115;
+   gpios = gpio1 2 1;
+   gpio-key,wakeup;
+   };
+
+   switch@10 {
+   label = volume-down;
+   linux,code = 114;
+   gpios = gpio1 3 1;
+   gpio-key,wakeup;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

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


[PATCH RESEND 01/10] ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM

2012-11-06 Thread AnilKumar Ch
Add pinmux configurations for gpio matrix keypad. In this patch, only
single named mode/state is added and these pins are configured during
pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 513284f..9199456 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -24,6 +24,21 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = matrix_keypad_s0;
+
+   matrix_keypad_s0: matrix_keypad_s0 {
+   pinctrl-single,pins = 
+   0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | 
MODE7 */
+   0x58 0x7/* gpmc_a6.gpio1_22, OUTPUT | 
MODE7 */
+   0x64 0x27   /* gpmc_a9.gpio1_25, INPUT | 
MODE7 */
+   0x68 0x27   /* gpmc_a10.gpio1_26, INPUT | 
MODE7 */
+   0x6c 0x27   /* gpmc_a11.gpio1_27, INPUT | 
MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

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


[PATCH RESEND 03/10] ARM: dts: AM33XX: Add pinmux configuration for volume-keys to EVM

2012-11-06 Thread AnilKumar Ch
Add pinmux configurations for gpio volume keys. In this patch, only
single named mode/state is added and these pins are configured during
pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 8076e66..e087b87 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -26,7 +26,7 @@
 
am33xx_pinmux: pinmux@44e10800 {
pinctrl-names = default;
-   pinctrl-0 = matrix_keypad_s0;
+   pinctrl-0 = matrix_keypad_s0 volume_keys_s0;
 
matrix_keypad_s0: matrix_keypad_s0 {
pinctrl-single,pins = 
@@ -37,6 +37,13 @@
0x6c 0x27   /* gpmc_a11.gpio1_27, INPUT | 
MODE7 */
;
};
+
+   volume_keys_s0: volume_keys_s0 {
+   pinctrl-single,pins = 
+   0x150 0x27  /* spi0_sclk.gpio0_2, INPUT | 
MODE7 */
+   0x154 0x27  /* spi0_d0.gpio0_3, INPUT | 
MODE7 */
+   ;
+   };
};
 
ocp {
-- 
1.7.9.5

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


[PATCH RESEND 10/10] ARM: dts: AM33XX: Add push-buttons device tree data to am335x-evmsk

2012-11-06 Thread AnilKumar Ch
Add gpio based push buttons device tree data to am335x-evmsk device
by adding all the necessary parameters like key-code, gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   31 +++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 0f825dd..f5a6162 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -139,6 +139,37 @@
default-state = off;
};
};
+
+   gpio_buttons: gpio_buttons@0 {
+   compatible = gpio-keys;
+   #address-cells = 1;
+   #size-cells = 0;
+
+   switch@1 {
+   label = button0;
+   linux,code = 0x100;
+   gpios = gpio3 3 0;
+   };
+
+   switch@2 {
+   label = button1;
+   linux,code = 0x101;
+   gpios = gpio3 2 0;
+   };
+
+   switch@3 {
+   label = button2;
+   linux,code = 0x102;
+   gpios = gpio1 30 0;
+   gpio-key,wakeup;
+   };
+
+   switch@4 {
+   label = button3;
+   linux,code = 0x103;
+   gpios = gpio3 5 0;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

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


[PATCH RESEND 07/10] ARM: dts: AM33XX: Add pinmux configuration for gpio-leds to EVMSK

2012-11-06 Thread AnilKumar Ch
Add pinmux configurations for gpio based volume keys to am335x-evmsk.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 6f53879..659ec5b 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -30,6 +30,20 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = user_leds_s0;
+
+   user_leds_s0: user_leds_s0 {
+   pinctrl-single,pins = 
+   0x10 0x7/* gpmc_ad4.gpio1_4, OUTPUT | 
MODE7 */
+   0x14 0x7/* gpmc_ad5.gpio1_5, OUTPUT | 
MODE7 */
+   0x18 0x7/* gpmc_ad6.gpio1_6, OUTPUT | 
MODE7 */
+   0x1c 0x7/* gpmc_ad7.gpio1_7, OUTPUT | 
MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

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


[PATCH RESEND 05/10] ARM: dts: AM33XX: Add pinmux configuration for user-leds to BONE

2012-11-06 Thread AnilKumar Ch
Add pinmux configurations for gpio based user-keys to am335x-bone.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 91eee97..1aac58b 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -24,6 +24,20 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = user_leds_s0;
+
+   user_leds_s0: user_leds_s0 {
+   pinctrl-single,pins = 
+   0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | 
MODE7 */
+   0x58 0x17   /* gpmc_a6.gpio1_22, 
OUTPUT_PULLUP | MODE7 */
+   0x5c 0x7/* gpmc_a7.gpio1_23, OUTPUT | 
MODE7 */
+   0x60 0x17   /* gpmc_a8.gpio1_24, 
OUTPUT_PULLUP | MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

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


[PATCH RESEND 08/10] ARM: dts: AM33XX: Add user-leds device tree data to am335x-evmsk

2012-11-06 Thread AnilKumar Ch
Add gpio-leds device tree data to am335x-evmsk device to enable gpio
based user-leds (USR0, USR1, USR2 and USR3) present on am335x starter
kit.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 659ec5b..7262fa8 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -100,6 +100,36 @@
regulator-name = lis3_reg;
regulator-boot-on;
};
+
+   leds {
+   compatible = gpio-leds;
+
+   led@1 {
+   label = evmsk:green:usr0;
+   gpios = gpio2 4 0;
+   default-state = off;
+   };
+
+   led@2 {
+   label = evmsk:green:usr1;
+   gpios = gpio2 5 0;
+   default-state = off;
+   };
+
+   led@3 {
+   label = evmsk:green:mmc0;
+   gpios = gpio2 6 0;
+   linux,default-trigger = mmc0;
+   default-state = off;
+   };
+
+   led@4 {
+   label = evmsk:green:heartbeat;
+   gpios = gpio2 7 0;
+   linux,default-trigger = heartbeat;
+   default-state = off;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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] ARM: dts: AM33XX: Enable system power off control in am335x-bone

2012-11-05 Thread AnilKumar Ch
Enable system power off control for BeagleBone in am335x-bone.dts file
under rtc node. RTC is the incharge of controlling the system power.
This flag is used by the driver to hook up the pm_power_off system call.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 40ea3c7..6f9c48e 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -38,6 +38,10 @@
};
 
};
+
+   rtc@44e3e000 {
+   ti,system-power-controller;
+   };
};
 };
 
-- 
1.7.9.5

--
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] pm: Add power off control

2012-11-05 Thread AnilKumar Ch
Add PM power_off control to rtc driver, along with this PMIC status
is set to STATUS_OFF to shutdown PMIC if PWR_EN is toggled by RTC
module.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

These patches were tested on AM335x-Bone.

AnilKumar Ch (2):
  ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone
  ARM: dts: AM33XX: Enable system power off control in am335x-bone

Colin Foe-Parker (2):
  mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
  rtc: OMAP: Add system pm_power_off to rtc driver

 .../devicetree/bindings/regulator/tps65217.txt |4 +
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 arch/arm/boot/dts/am335x-bone.dts  |6 ++
 drivers/mfd/tps65217.c |   12 +++
 drivers/rtc/rtc-omap.c |   79 +++-
 5 files changed, 105 insertions(+), 1 deletion(-)

-- 
1.7.9.5

--
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] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle

2012-11-05 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Set tps65217 PMIC status to OFF if power enable toggle is
supported. Also adds platform data flag, which should be
passed from board init data.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move the additions to tps65217 MFD driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 .../devicetree/bindings/regulator/tps65217.txt |4 
 drivers/mfd/tps65217.c |   12 
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt 
b/Documentation/devicetree/bindings/regulator/tps65217.txt
index d316fb8..4f05d20 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -11,6 +11,9 @@ Required properties:
   using the standard binding for regulators found at
   Documentation/devicetree/bindings/regulator/regulator.txt.
 
+Optional properties:
+- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
+
   The valid names for regulators are:
   tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
 
@@ -20,6 +23,7 @@ Example:
 
tps: tps@24 {
compatible = ti,tps65217;
+   ti,pmic-shutdown-controller;
 
regulators {
dcdc1_reg: dcdc1 {
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 3fb32e6..c7f17d8 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -160,6 +160,7 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
unsigned int version;
unsigned int chip_id = ids-driver_data;
const struct of_device_id *match;
+   bool status_off = false;
int ret;
 
if (client-dev.of_node) {
@@ -170,6 +171,8 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return -EINVAL;
}
chip_id = (unsigned int)match-data;
+   status_off = of_property_read_bool(client-dev.of_node,
+   ti,pmic-shutdown-controller);
}
 
if (!chip_id) {
@@ -207,6 +210,15 @@ static int __devinit tps65217_probe(struct i2c_client 
*client,
return ret;
}
 
+   /* Set the PMIC to shutdown on PWR_EN toggle */
+   if (status_off) {
+   ret = tps65217_set_bits(tps, TPS65217_REG_STATUS,
+   TPS65217_STATUS_OFF, TPS65217_STATUS_OFF,
+   TPS65217_PROTECT_NONE);
+   if (ret)
+   dev_warn(tps-dev, unable to set the status OFF\n);
+   }
+
dev_info(tps-dev, TPS65217 ID %#x version 1.%d\n,
(version  TPS65217_CHIPID_CHIP_MASK)  4,
version  TPS65217_CHIPID_REV_MASK);
-- 
1.7.9.5

--
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] ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone

2012-11-05 Thread AnilKumar Ch
Set ti,pmic-shutdown-controller for BeagleBone in am335x-bone.dts
file, this flag is used by the driver to set tps65217 PMIC status
to OFF when PWR_EN toggle.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 91eee97..40ea3c7 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -44,6 +44,8 @@
 /include/ tps65217.dtsi
 
 tps {
+   ti,pmic-shutdown-controller;
+
regulators {
dcdc1_reg: regulator@0 {
regulator-always-on;
-- 
1.7.9.5

--
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] rtc: OMAP: Add system pm_power_off to rtc driver

2012-11-05 Thread AnilKumar Ch
From: Colin Foe-Parker colin.foepar...@logicpd.com

Add system power off control to rtc driver which is the in-charge
of controlling the BeagleBone system power. The power_off routine
can be hooked up to pm_power_off system call.

System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt

Added while (1); after the above steps to make sure that no other
process acquire cpu. Otherwise we might see an unexpected behaviour
because we are shutting down all the power rails of SoC except RTC.

Signed-off-by: Colin Foe-Parker colin.foepar...@logicpd.com
[anilku...@ti.com: move poweroff additions to rtc driver]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 Documentation/devicetree/bindings/rtc/rtc-omap.txt |5 ++
 drivers/rtc/rtc-omap.c |   79 +++-
 2 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt 
b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index b47aa41..8d9f4f9 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -6,6 +6,10 @@ Required properties:
 - interrupts: rtc timer, alarm interrupts in order
 - interrupt-parent: phandle for the interrupt controller
 
+Optional properties:
+- ti,system-power-controller: Telling whether or not rtc is controlling
+  the system power.
+
 Example:
 
 rtc@1c23000 {
@@ -14,4 +18,5 @@ rtc@1c23000 {
interrupts = 19
  19;
interrupt-parent = intc;
+   ti,system-power-controller;
 };
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 6009714..2d90170 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -72,6 +72,14 @@
 #define OMAP_RTC_KICK0_REG 0x6c
 #define OMAP_RTC_KICK1_REG 0x70
 
+#define OMAP_RTC_ALARM2_SECONDS_REG0x80
+#define OMAP_RTC_ALARM2_MINUTES_REG0x84
+#define OMAP_RTC_ALARM2_HOURS_REG  0x88
+#define OMAP_RTC_ALARM2_DAYS_REG   0x8c
+#define OMAP_RTC_ALARM2_MONTHS_REG 0x90
+#define OMAP_RTC_ALARM2_YEARS_REG  0x94
+#define OMAP_RTC_PMIC_REG  0x98
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT(17)
 #define OMAP_RTC_CTRL_DISABLE  (16)
@@ -93,15 +101,24 @@
 #define OMAP_RTC_STATUS_BUSY(10)
 
 /* OMAP_RTC_INTERRUPTS_REG bit fields: */
+#define OMAP_RTC_INTERRUPTS_IT_ALARM2   (14)
 #define OMAP_RTC_INTERRUPTS_IT_ALARM(13)
 #define OMAP_RTC_INTERRUPTS_IT_TIMER(12)
 
+/* OMAP_RTC_PMIC_REG bit fields: */
+#define OMAP_RTC_PMIC_POWER_EN_EN   (116)
+
 /* OMAP_RTC_KICKER values */
 #defineKICK0_VALUE 0x83e70b13
 #defineKICK1_VALUE 0x95a4f1e0
 
 #defineOMAP_RTC_HAS_KICKER 0x1
 
+#define SHUTDOWN_TIME_SEC  2
+#define SECS_IN_MIN60
+#define WAIT_AFTER (SECS_IN_MIN - SHUTDOWN_TIME_SEC)
+#define WAIT_TIME_MS   (SHUTDOWN_TIME_SEC * 1000)
+
 static void __iomem*rtc_base;
 
 #define rtc_read(addr) readb(rtc_base + (addr))
@@ -290,6 +307,58 @@ static int omap_rtc_set_alarm(struct device *dev, struct 
rtc_wkalrm *alm)
return 0;
 }
 
+/*
+ * rtc_power_off: Set the pmic power off sequence. The RTC generates
+ * pmic_pwr_enable control, which can be used to control an external
+ * PMIC.
+ */
+static void rtc_power_off(void)
+{
+   u32 val;
+   struct rtc_time tm;
+   spinlock_t lock;
+   unsigned long flags;
+
+   spin_lock_init(lock);
+
+   /* Set PMIC power enable */
+   val = readl(rtc_base + OMAP_RTC_PMIC_REG);
+   writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
+
+   /* Wait few seconds instead of rollover */
+   do {
+   omap_rtc_read_time(NULL, tm);
+   if (WAIT_AFTER = tm.tm_sec)
+   mdelay(WAIT_TIME_MS);
+   } while (WAIT_AFTER = tm.tm_sec);
+
+   /* Add shutdown time to the current value */
+   tm.tm_sec += SHUTDOWN_TIME_SEC;
+
+   if (tm2bcd(tm)  0)
+   return;
+
+   pr_info(System will go to power_off state in approx. %d secs\n,
+   SHUTDOWN_TIME_SEC);
+
+   /* Set the ALARM2 time */
+   rtc_write(tm.tm_sec, OMAP_RTC_ALARM2_SECONDS_REG);
+   rtc_write(tm.tm_min, OMAP_RTC_ALARM2_MINUTES_REG);
+   rtc_write(tm.tm_hour, OMAP_RTC_ALARM2_HOURS_REG);
+   rtc_write(tm.tm_mday, OMAP_RTC_ALARM2_DAYS_REG);
+   rtc_write(tm.tm_mon, OMAP_RTC_ALARM2_MONTHS_REG);
+   rtc_write(tm.tm_year, OMAP_RTC_ALARM2_YEARS_REG);
+
+   /* Enable alarm2 interrupt */
+   val = readl(rtc_base + OMAP_RTC_INTERRUPTS_REG);
+   writel(val | OMAP_RTC_INTERRUPTS_IT_ALARM2,
+   rtc_base + OMAP_RTC_INTERRUPTS_REG);
+
+   /* Do not allow

[PATCH 03/10] ARM: dts: AM33XX: Add pinmux configuration for volume-keys to EVM

2012-11-05 Thread AnilKumar Ch
Add pinmux configurations for gpio volume keys. In this patch, only
single named mode/state is added and these pins are configured during
pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 8076e66..e087b87 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -26,7 +26,7 @@
 
am33xx_pinmux: pinmux@44e10800 {
pinctrl-names = default;
-   pinctrl-0 = matrix_keypad_s0;
+   pinctrl-0 = matrix_keypad_s0 volume_keys_s0;
 
matrix_keypad_s0: matrix_keypad_s0 {
pinctrl-single,pins = 
@@ -37,6 +37,13 @@
0x6c 0x27   /* gpmc_a11.gpio1_27, INPUT | 
MODE7 */
;
};
+
+   volume_keys_s0: volume_keys_s0 {
+   pinctrl-single,pins = 
+   0x150 0x27  /* spi0_sclk.gpio0_2, INPUT | 
MODE7 */
+   0x154 0x27  /* spi0_d0.gpio0_3, INPUT | 
MODE7 */
+   ;
+   };
};
 
ocp {
-- 
1.7.9.5

--
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 10/10] ARM: dts: AM33XX: Add push-buttons device tree data to am335x-evmsk

2012-11-05 Thread AnilKumar Ch
Add gpio based push buttons device tree data to am335x-evmsk device
by adding all the necessary parameters like key-code, gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   31 +++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 0f825dd..f5a6162 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -139,6 +139,37 @@
default-state = off;
};
};
+
+   gpio_buttons: gpio_buttons@0 {
+   compatible = gpio-keys;
+   #address-cells = 1;
+   #size-cells = 0;
+
+   switch@1 {
+   label = button0;
+   linux,code = 0x100;
+   gpios = gpio3 3 0;
+   };
+
+   switch@2 {
+   label = button1;
+   linux,code = 0x101;
+   gpios = gpio3 2 0;
+   };
+
+   switch@3 {
+   label = button2;
+   linux,code = 0x102;
+   gpios = gpio1 30 0;
+   gpio-key,wakeup;
+   };
+
+   switch@4 {
+   label = button3;
+   linux,code = 0x103;
+   gpios = gpio3 5 0;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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 09/10] ARM: dts: AM33XX: Add pinmux configuration for gpio-keys to EVMSK

2012-11-05 Thread AnilKumar Ch
Add pinmux configurations for gpio based keys to am335x-evmsk. In
this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 7262fa8..0f825dd 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -32,7 +32,7 @@
 
am33xx_pinmux: pinmux@44e10800 {
pinctrl-names = default;
-   pinctrl-0 = user_leds_s0;
+   pinctrl-0 = user_leds_s0 gpio_keys_s0;
 
user_leds_s0: user_leds_s0 {
pinctrl-single,pins = 
@@ -42,6 +42,15 @@
0x1c 0x7/* gpmc_ad7.gpio1_7, OUTPUT | 
MODE7 */
;
};
+
+   gpio_keys_s0: gpio_keys_s0 {
+   pinctrl-single,pins = 
+   0x94 0x27   /* gpmc_oen_ren.gpio2_3, INPUT 
| MODE7 */
+   0x90 0x27   /* gpmc_advn_ale.gpio2_2, INPUT 
| MODE7 */
+   0x70 0x27   /* gpmc_wait0.gpio0_30, INPUT | 
MODE7 */
+   0x9c 0x27   /* gpmc_ben0_cle.gpio2_5, INPUT 
| MODE7 */
+   ;
+   };
};
 
ocp {
-- 
1.7.9.5

--
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 08/10] ARM: dts: AM33XX: Add user-leds device tree data to am335x-evmsk

2012-11-05 Thread AnilKumar Ch
Add gpio-leds device tree data to am335x-evmsk device to enable gpio
based user-leds (USR0, USR1, USR2 and USR3) present on am335x starter
kit.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 659ec5b..7262fa8 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -100,6 +100,36 @@
regulator-name = lis3_reg;
regulator-boot-on;
};
+
+   leds {
+   compatible = gpio-leds;
+
+   led@1 {
+   label = evmsk:green:usr0;
+   gpios = gpio2 4 0;
+   default-state = off;
+   };
+
+   led@2 {
+   label = evmsk:green:usr1;
+   gpios = gpio2 5 0;
+   default-state = off;
+   };
+
+   led@3 {
+   label = evmsk:green:mmc0;
+   gpios = gpio2 6 0;
+   linux,default-trigger = mmc0;
+   default-state = off;
+   };
+
+   led@4 {
+   label = evmsk:green:heartbeat;
+   gpios = gpio2 7 0;
+   linux,default-trigger = heartbeat;
+   default-state = off;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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 05/10] ARM: dts: AM33XX: Add pinmux configuration for user-leds to BONE

2012-11-05 Thread AnilKumar Ch
Add pinmux configurations for gpio based user-keys to am335x-bone.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 6f9c48e..0bd0355 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -24,6 +24,20 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = user_leds_s0;
+
+   user_leds_s0: user_leds_s0 {
+   pinctrl-single,pins = 
+   0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | 
MODE7 */
+   0x58 0x17   /* gpmc_a6.gpio1_22, 
OUTPUT_PULLUP | MODE7 */
+   0x5c 0x7/* gpmc_a7.gpio1_23, OUTPUT | 
MODE7 */
+   0x60 0x17   /* gpmc_a8.gpio1_24, 
OUTPUT_PULLUP | MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

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


[PATCH 01/10] ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM

2012-11-05 Thread AnilKumar Ch
Add pinmux configurations for gpio matrix keypad. In this patch, only
single named mode/state is added and these pins are configured during
pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 513284f..9199456 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -24,6 +24,21 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = matrix_keypad_s0;
+
+   matrix_keypad_s0: matrix_keypad_s0 {
+   pinctrl-single,pins = 
+   0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | 
MODE7 */
+   0x58 0x7/* gpmc_a6.gpio1_22, OUTPUT | 
MODE7 */
+   0x64 0x27   /* gpmc_a9.gpio1_25, INPUT | 
MODE7 */
+   0x68 0x27   /* gpmc_a10.gpio1_26, INPUT | 
MODE7 */
+   0x6c 0x27   /* gpmc_a11.gpio1_27, INPUT | 
MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

--
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 04/10] ARM: dts: AM33XX: Add volume-keys device tree data to am335x-evm

2012-11-05 Thread AnilKumar Ch
Add gpio based volume keys device tree data to am335x-evm by adding
all the required parameters like keycode, gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   21 +
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index e087b87..9f65f17 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -137,6 +137,27 @@
0x0101001c  /* ENTER */
0x0201006c;/* DOWN */
};
+
+   gpio_keys: volume_keys@0 {
+   compatible = gpio-keys;
+   #address-cells = 1;
+   #size-cells = 0;
+   autorepeat;
+
+   switch@9 {
+   label = volume-up;
+   linux,code = 115;
+   gpios = gpio1 2 1;
+   gpio-key,wakeup;
+   };
+
+   switch@10 {
+   label = volume-down;
+   linux,code = 114;
+   gpios = gpio1 3 1;
+   gpio-key,wakeup;
+   };
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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 07/10] ARM: dts: AM33XX: Add pinmux configuration for gpio-leds to EVMSK

2012-11-05 Thread AnilKumar Ch
Add pinmux configurations for gpio based volume keys to am335x-evmsk.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.

Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index 6f53879..659ec5b 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -30,6 +30,20 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   pinctrl-names = default;
+   pinctrl-0 = user_leds_s0;
+
+   user_leds_s0: user_leds_s0 {
+   pinctrl-single,pins = 
+   0x10 0x7/* gpmc_ad4.gpio1_4, OUTPUT | 
MODE7 */
+   0x14 0x7/* gpmc_ad5.gpio1_5, OUTPUT | 
MODE7 */
+   0x18 0x7/* gpmc_ad6.gpio1_6, OUTPUT | 
MODE7 */
+   0x1c 0x7/* gpmc_ad7.gpio1_7, OUTPUT | 
MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
-- 
1.7.9.5

--
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 06/10] ARM: dts: AM33XX: Add user-leds device tree data to am335x-bone

2012-11-05 Thread AnilKumar Ch
Add gpio-leds device tree data to am335x-bone device to enable gpio
based user-leds (USR0, USR1, USR2 and USR3) present on BeagleBone.

[k...@dominion.thruhere.net: led0, led1 suggested by koen]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 0bd0355..206c3eb 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -57,6 +57,36 @@
ti,system-power-controller;
};
};
+
+   leds {
+   compatible = gpio-leds;
+
+   led@2 {
+   label = beaglebone:green:heartbeat;
+   gpios = gpio2 21 0;
+   linux,default-trigger = heartbeat;
+   default-state = off;
+   };
+
+   led@3 {
+   label = beaglebone:green:mmc0;
+   gpios = gpio2 22 0;
+   linux,default-trigger = mmc0;
+   default-state = off;
+   };
+
+   led@4 {
+   label = beaglebone:green:usr2;
+   gpios = gpio2 23 0;
+   default-state = off;
+   };
+
+   led@5 {
+   label = beaglebone:green:usr3;
+   gpios = gpio2 24 0;
+   default-state = off;
+   };
+   };
 };
 
 /include/ tps65217.dtsi
-- 
1.7.9.5

--
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 02/10] ARM: dts: AM33XX: Add matrix keypad device tree data to am335x-evm

2012-11-05 Thread AnilKumar Ch
Add matrix keypad device tree data to am335x-evm by adding all
the necessary parameters like keymap, row  column gpios and etc.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   20 
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9199456..8076e66 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -110,6 +110,26 @@
regulator-name = lis3_reg;
regulator-boot-on;
};
+
+   matrix_keypad: matrix_keypad@0 {
+   compatible = gpio-matrix-keypad;
+   debounce-delay-ms = 5;
+   col-scan-delay-us = 2;
+
+   row-gpios = gpio2 25 0/* Bank1, pin25 */
+gpio2 26 0/* Bank1, pin26 */
+gpio2 27 0;  /* Bank1, pin27 */
+
+   col-gpios = gpio2 21 0/* Bank1, pin21 */
+gpio2 22 0;  /* Bank1, pin22 */
+
+   linux,keymap = 0x008b  /* MENU */
+   0x019e  /* BACK */
+   0x0269  /* LEFT */
+   0x0001006a  /* RIGHT */
+   0x0101001c  /* ENTER */
+   0x0201006c;/* DOWN */
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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 00/10] ARM: dts: AM33XX: Add device tree data

2012-11-05 Thread AnilKumar Ch
Add device tree date for GPIO based various drivers matrix keypad,
volume keys, push buttons and use leds accross three AM33XX devices
viz EVM, BeagleBone and Starter Kit.

To make it functional this series also adds pinctrl data for all
the GPIOs used by various drivers. In this series only default state
pinmux/conf settings are added because of sleep/idle state pinctrl
values are not available.

These patches are based on linux-omap-dt:for_3.8/dts tree and these
were tested on am33xx devices according to added functionality.

AnilKumar Ch (10):
  ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM
  ARM: dts: AM33XX: Add matrix keypad device tree data to am335x-evm
  ARM: dts: AM33XX: Add pinmux configuration for volume-keys to EVM
  ARM: dts: AM33XX: Add volume-keys device tree data to am335x-evm
  ARM: dts: AM33XX: Add pinmux configuration for user-leds to BONE
  ARM: dts: AM33XX: Add user-leds device tree data to am335x-bone
  ARM: dts: AM33XX: Add pinmux configuration for gpio-leds to EVMSK
  ARM: dts: AM33XX: Add user-leds device tree data to am335x-evmsk
  ARM: dts: AM33XX: Add pinmux configuration for gpio-keys to EVMSK
  ARM: dts: AM33XX: Add push-buttons device tree data to am335x-evmsk

 arch/arm/boot/dts/am335x-bone.dts  |   44 +++
 arch/arm/boot/dts/am335x-evm.dts   |   63 +++
 arch/arm/boot/dts/am335x-evmsk.dts |   84 
 3 files changed, 191 insertions(+)

-- 
1.7.9.5

--
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] Documentation: dt: i2c: Update trivial-devices list

2012-10-19 Thread AnilKumar Ch
Update i2c trivial-devices list by adding the description for
ti,tmp275 temperature sensor and taos,tsl2550 ambient light
sensor.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 .../devicetree/bindings/i2c/trivial-devices.txt|2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt 
b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 2f5322b..446859f 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -55,5 +55,7 @@ st-micro,24c256   i2c serial eeprom  (24cxx)
 stm,m41t00 Serial Access TIMEKEEPER
 stm,m41t62 Serial real-time clock (RTC) with alarm
 stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS
+taos,tsl2550   Ambient Light Sensor with SMBUS/Two Wire Serial 
Interface
 ti,tsc2003 I2C Touch-Screen Controller
 ti,tmp102  Low Power Digital Temperature Sensor with SMBUS/Two 
Wire Serial Interface
+ti,tmp275  Digital Temperature Sensor
-- 
1.7.9.5

--
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] ARM: dts: Add am335x-evmsk.dts

2012-10-15 Thread AnilKumar Ch
Add AM335X EVM-SK device tree source (am335x-sk.dts) file to use
the am33xx.dtsi SoC file, along with the memory node information.

Also adds support for tps65910 regulator and lis331dlh accelerometer.
Following drivers/functionality were tested on AM335x-EVM-SK.
* I2C
* TPS65910 regulators
* lis331dlh accelerometer

AM335x EVM Starter Kit details can be accessed from:
http://www.ti.com/tool/tmdssk3358

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evmsk.dts |  166 
 1 file changed, 166 insertions(+)
 create mode 100644 arch/arm/boot/dts/am335x-evmsk.dts

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
new file mode 100644
index 000..6f53879
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * AM335x Starter Kit
+ * http://www.ti.com/tool/tmdssk3358
+ */
+
+/dts-v1/;
+
+/include/ am33xx.dtsi
+
+/ {
+   model = TI AM335x EVM-SK;
+   compatible = ti,am335x-evmsk, ti,am33xx;
+
+   cpus {
+   cpu@0 {
+   cpu0-supply = vdd1_reg;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x8000 0x1000; /* 256 MB */
+   };
+
+   ocp {
+   uart1: serial@44e09000 {
+   status = okay;
+   };
+
+   i2c1: i2c@44e0b000 {
+   status = okay;
+   clock-frequency = 40;
+
+   tps: tps@2d {
+   reg = 0x2d;
+   };
+
+   lis331dlh: lis331dlh@18 {
+   compatible = st,lis331dlh, st,lis3lv02d;
+   reg = 0x18;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
+   };
+   };
+   };
+
+   vbat: fixedregulator@0 {
+   compatible = regulator-fixed;
+   regulator-name = vbat;
+   regulator-min-microvolt = 500;
+   regulator-max-microvolt = 500;
+   regulator-boot-on;
+   };
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
+};
+
+/include/ tps65910.dtsi
+
+tps {
+   vcc1-supply = vbat;
+   vcc2-supply = vbat;
+   vcc3-supply = vbat;
+   vcc4-supply = vbat;
+   vcc5-supply = vbat;
+   vcc6-supply = vbat;
+   vcc7-supply = vbat;
+   vccio-supply = vbat;
+
+   regulators {
+   vrtc_reg: regulator@0 {
+   regulator-always-on;
+   };
+
+   vio_reg: regulator@1 {
+   regulator-always-on;
+   };
+
+   vdd1_reg: regulator@2 {
+   /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% 
tolerance */
+   regulator-name = vdd_mpu;
+   regulator-min-microvolt = 912500;
+   regulator-max-microvolt = 1312500;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   vdd2_reg: regulator@3 {
+   /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% 
tolerance */
+   regulator-name = vdd_core;
+   regulator-min-microvolt = 912500;
+   regulator-max-microvolt = 115;
+   regulator-boot-on;
+   regulator

[PATCH] ARM: dts: AM33XX: Add tsl2550 ambient light sensor DT data

2012-09-21 Thread AnilKumar Ch
Add tsl2550 ambient light sensor DT data to am335x-evm.dts. In AM335x
EVM tsl2550 ambient light sensor is connected to I2C2 bus. So this patch
adds child node inside i2c2 node with i2c slave address.

TAOS tsl2550 sensor with two-wire SMBus serial interface. This patch
also reduces I2C2 clock frequency to 100KHz from 400KHz because the
maximum clock frequency of SMBus is 100KHz.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 3b1f313..d99aa0f 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -49,7 +49,7 @@
 
i2c2: i2c@4802a000 {
status = okay;
-   clock-frequency = 40;
+   clock-frequency = 10;
 
lis331dlh: lis331dlh@18 {
compatible = st,lis331dlh, st,lis3lv02d;
@@ -79,6 +79,11 @@
st,max-limit-z = 750;
};
 
+   tsl2550: tsl2550@39 {
+   compatible = taos,tsl2550;
+   reg = 0x39;
+   };
+
tmp275: tmp275@48 {
compatible = ti,tmp275;
reg = 0x48;
-- 
1.7.9.5

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


[PATCH RESEND 0/5] ARM: dts: AM33XX: Add device tree data

2012-09-19 Thread AnilKumar Ch
Add device tree data of pinctrl, d_can, lis331dlh and tmp275 drivers
for AM33XX family of devices. These patches were submitted earlier
and reviewed. Re-sending to apply cleanly on linux-omap/devel-dt
tree. These patches were tested on am33xx-evm and am335x-bone.

AnilKumar Ch (5):
  ARM: dts: AM33XX: Add basic pinctrl device tree data
  ARM: dts: AM33XX: Add D_CAN device tree data
  ARM: OMAP2+: AM33XX: Add clock entries to omap_clk data
  ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm
  ARM: dts: AM33XX: Add temperature sensor device tree data to
am335x-evm

 arch/arm/boot/dts/am335x-evm.dts |   44 ++
 arch/arm/boot/dts/am33xx.dtsi|   27 +
 arch/arm/mach-omap2/clock33xx_data.c |1 +
 3 files changed, 72 insertions(+)

-- 
1.7.9.5

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


[PATCH RESEND v7 2/5] ARM: dts: AM33XX: Add D_CAN device tree data

2012-09-19 Thread AnilKumar Ch
Add Bosch D_CAN controller device tree data to AM33XX dtsi
file by adding d_can device nodes with all the necessary
parameters.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 894fec6..64c2efe 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -234,5 +234,23 @@
interrupt-parent = intc;
interrupts = 91;
};
+
+   dcan0: d_can@481cc000 {
+   compatible = bosch,d_can;
+   ti,hwmods = d_can0;
+   reg = 0x481cc000 0x2000;
+   interrupts = 52;
+   interrupt-parent = intc;
+   status = disabled;
+   };
+
+   dcan1: d_can@481d {
+   compatible = bosch,d_can;
+   ti,hwmods = d_can1;
+   reg = 0x481d 0x2000;
+   interrupts = 55;
+   interrupt-parent = intc;
+   status = disabled;
+   };
};
 };
-- 
1.7.9.5

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


[PATCH RESEND v3 4/5] ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

2012-09-19 Thread AnilKumar Ch
Add lis331dlh device tree data to am335x-evm.dts. In AM335x EVM
lis331dlh accelerometer is connected to I2C2 bus. So this patch
change the status of I2C2 node to okay to use I2C2 bus. Also
added all the required platform data to am335x-evm.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   39 ++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 4707cda..d25d1b3 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -37,6 +37,39 @@
reg = 0x2d;
};
};
+
+   i2c2: i2c@4802a000 {
+   status = okay;
+   clock-frequency = 40;
+
+   lis331dlh: lis331dlh@18 {
+   compatible = st,lis331dlh, st,lis3lv02d;
+   reg = 0x18;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
+   };
+   };
};
 
vbat: fixedregulator@0 {
@@ -46,6 +79,12 @@
regulator-max-microvolt = 500;
regulator-boot-on;
};
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

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


[PATCH RESEND v7 1/5] ARM: dts: AM33XX: Add basic pinctrl device tree data

2012-09-19 Thread AnilKumar Ch
Adds basic pinctrl device tree data for AM33XX family of devices.
This patch is based on the pinctrl-single driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi |9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index b4e3e47..894fec6 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -55,6 +55,15 @@
};
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   compatible = pinctrl-single;
+   reg = 0x44e10800 0x0238;
+   #address-cells = 1;
+   #size-cells = 0;
+   pinctrl-single,register-width = 32;
+   pinctrl-single,function-mask = 0x7f;
+   };
+
/*
 * XXX: Use a flat representation of the AM33XX interconnect.
 * The real AM33XX interconnect network is quite complex.Since
-- 
1.7.9.5

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


[PATCH RESEND 3/5] ARM: OMAP2+: AM33XX: Add clock entries to omap_clk data

2012-09-19 Thread AnilKumar Ch
Add AM335x cpu0 clock entry to the corresponding clock data
file. This is useful in getting the correct mpu clock pointer
to change the cpu frequency in cpufreq driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/mach-omap2/clock33xx_data.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/clock33xx_data.c 
b/arch/arm/mach-omap2/clock33xx_data.c
index a4006b2..4933993 100644
--- a/arch/arm/mach-omap2/clock33xx_data.c
+++ b/arch/arm/mach-omap2/clock33xx_data.c
@@ -1013,6 +1013,7 @@ static struct omap_clk am33xx_clks[] = {
CLK(NULL,   dpll_core_m5_ck,  dpll_core_m5_ck,   
CK_AM33XX),
CLK(NULL,   dpll_core_m6_ck,  dpll_core_m6_ck,   
CK_AM33XX),
CLK(NULL,   dpll_mpu_ck,  dpll_mpu_ck,   CK_AM33XX),
+   CLK(cpu0, NULL,   dpll_mpu_ck,   
CK_AM33XX),
CLK(NULL,   dpll_mpu_m2_ck,   dpll_mpu_m2_ck,
CK_AM33XX),
CLK(NULL,   dpll_ddr_ck,  dpll_ddr_ck,   CK_AM33XX),
CLK(NULL,   dpll_ddr_m2_ck,   dpll_ddr_m2_ck,
CK_AM33XX),
-- 
1.7.9.5

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


[PATCH RESEND 5/5] ARM: dts: AM33XX: Add temperature sensor device tree data to am335x-evm

2012-09-19 Thread AnilKumar Ch
Add temperature sensor DT data to am335x-evm.dts. In AM335x EVM
tmp275 temperature sensor is connected to I2C2 bus. So this patch
adds child node inside i2c2 node with i2c slave address. This patch
is tested on AM335x EVM.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index d25d1b3..a5c4c62 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -69,6 +69,11 @@
st,max-limit-y = 550;
st,max-limit-z = 750;
};
+
+   tmp275: tmp275@48 {
+   compatible = ti,tmp275;
+   reg = 0x48;
+   };
};
};
 
-- 
1.7.9.5

--
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] ARM: dts: AM33XX: Add temperature sensor device tree data to am335x-evm

2012-09-18 Thread AnilKumar Ch
Add temperature sensor DT data to am335x-evm.dts. In AM335x EVM
tmp275 temperature sensor is connected to I2C2 bus. So this patch
adds child node inside i2c2 node with i2c slave address. This patch
is tested on AM335x EVM.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index be309df..3b1f313 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -78,6 +78,11 @@
st,max-limit-y = 550;
st,max-limit-z = 750;
};
+
+   tmp275: tmp275@48 {
+   compatible = ti,tmp275;
+   reg = 0x48;
+   };
};
 
dcan1: d_can@481d {
-- 
1.7.9.5

--
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 v3 4/4] ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

2012-09-17 Thread AnilKumar Ch
Add lis331dlh device tree data to am335x-evm.dts. In AM335x EVM
lis331dlh accelerometer is connected to I2C2 bus. So this patch
change the status of I2C2 node to okay to use I2C2 bus. Also
added all the required platform data to am335x-evm.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   39 ++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9fb59c5..be309df 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -47,6 +47,39 @@
};
};
 
+   i2c2: i2c@4802a000 {
+   status = okay;
+   clock-frequency = 40;
+
+   lis331dlh: lis331dlh@18 {
+   compatible = st,lis331dlh, st,lis3lv02d;
+   reg = 0x18;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
+   };
+   };
+
dcan1: d_can@481d {
status = okay;
pinctrl-names = default;
@@ -61,6 +94,12 @@
regulator-max-microvolt = 500;
regulator-boot-on;
};
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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 v3 0/4] lis3: lis3lv02d_i2c: Add device tree support

2012-09-17 Thread AnilKumar Ch
Adds device tree support to lis3lv02d_i2c driver. Along with this
DT init is moved from core driver to individual drivers, with the
current implementation some pdata is missing in lis3lv02d_i2c driver.

Also adds platform data for lis331dlh driver to am335x-EVM. These
patches were tested on AM335x-EVM.

Changes from v2:
- Added documentation details specific to lis3lv02d_i2c
  driver with example node
- Modified DTS node representation in .dts file
- Removed -i2c string from compatible name

Changes from v1:
- Moved lis3lv02d_init_dt to individual drivers with
  some code clean-up.
- Added lis331dlh compatible entry for lis331dlh parts

AnilKumar Ch (4):
  lis3: lis3lv02d: remove lis3lv02d driver DT init
  lis3: lis3lv02d_spi: Add lis3lv02d device tree init
  lis3: lis3lv02d_i2c: Add lis3lv02d device tree init
  ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

 Documentation/devicetree/bindings/misc/lis302.txt |   36 +++
 arch/arm/boot/dts/am335x-evm.dts  |   39 +
 drivers/misc/lis3lv02d/lis3lv02d.c|8 ++---
 drivers/misc/lis3lv02d/lis3lv02d.h|1 +
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c|   18 ++
 drivers/misc/lis3lv02d/lis3lv02d_spi.c|8 +++--
 6 files changed, 101 insertions(+), 9 deletions(-)

-- 
1.7.9.5

--
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 v3 2/4] lis3: lis3lv02d_spi: Add lis3lv02d device tree init

2012-09-17 Thread AnilKumar Ch
Add lis3lv02d device tree initialization code/API to take pdata
from device node. Also remove CONFIG_OF ifdef from the driver,
if CONFIG_OF is not defined then OF APIs returns 0.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/misc/lis3lv02d/lis3lv02d_spi.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c 
b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
index 23f3986..e1db6f4 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
@@ -84,10 +84,12 @@ static int __devinit lis302dl_spi_probe(struct spi_device 
*spi)
lis3_dev.ac = lis3lv02d_axis_normal;
lis3_dev.pdata  = spi-dev.platform_data;
 
-#ifdef CONFIG_OF
-   if (of_match_device(lis302dl_spi_dt_ids, spi-dev))
+   if (of_match_device(lis302dl_spi_dt_ids, spi-dev)) {
lis3_dev.of_node = spi-dev.of_node;
-#endif
+   ret = lis3lv02d_init_dt(lis3_dev);
+   if (ret)
+   return ret;
+   }
 
spi_set_drvdata(spi, lis3_dev);
 
-- 
1.7.9.5

--
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 v3 3/4] lis3: lis3lv02d_i2c: Add lis3lv02d device tree init

2012-09-17 Thread AnilKumar Ch
Add lis3lv02d device tree initialization code/API to take pdata
from device node. Also adds device tree init matching table
support to lis3lv02d_i2c driver. If the driver data is passed
from device tree, then this driver picks up platform data
from device node through common/generic lis3lv02d.c driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 Documentation/devicetree/bindings/misc/lis302.txt |   36 +
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c|   18 +++
 2 files changed, 54 insertions(+)

diff --git a/Documentation/devicetree/bindings/misc/lis302.txt 
b/Documentation/devicetree/bindings/misc/lis302.txt
index e18af9d..6def86f 100644
--- a/Documentation/devicetree/bindings/misc/lis302.txt
+++ b/Documentation/devicetree/bindings/misc/lis302.txt
@@ -11,6 +11,12 @@ Required properties for the SPI bindings:
constrained by external circuitry
  - interrupts: the interrupt generated by the device
 
+Required properties for the I2C bindings:
+ - compatible: should be set to st,lis3lv02d
+ - reg:i2c slave address
+ - Vdd-supply: The input supply for Vdd
+ - Vdd_IO-supply:  The input supply for Vdd_IO
+
 
 Optional properties for all bus drivers:
 
@@ -74,3 +80,33 @@ Example for a SPI device node:
st,wakeup-z-hi;
};
 
+Example for a I2C device node:
+
+   lis331dlh: lis331dlh@18 {
+   compatible = st,lis331dlh, st,lis3lv02d;
+   reg = 0x18;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
+   };
+
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c 
b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index 15255eb..43e3f29 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -31,6 +31,9 @@
 #include linux/i2c.h
 #include linux/pm_runtime.h
 #include linux/delay.h
+#include linux/of.h
+#include linux/of_platform.h
+
 #include lis3lv02d.h
 
 #define DRV_NAME   lis3lv02d_i2c
@@ -102,12 +105,26 @@ static int lis3_i2c_init(struct lis3lv02d *lis3)
 static union axis_conversion lis3lv02d_axis_map =
{ .as_array = { LIS3_DEV_X, LIS3_DEV_Y, LIS3_DEV_Z } };
 
+static struct of_device_id lis3lv02d_i2c_dt_ids[] = {
+   { .compatible = st,lis3lv02d },
+   {}
+};
+MODULE_DEVICE_TABLE(of, lis3lv02d_i2c_dt_ids);
+
 static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
 {
int ret = 0;
struct lis3lv02d_platform_data *pdata = client-dev.platform_data;
 
+   if (of_match_device(lis3lv02d_i2c_dt_ids, client-dev)) {
+   lis3_dev.of_node = client-dev.of_node;
+   ret = lis3lv02d_init_dt(lis3_dev);
+   if (ret)
+   return ret;
+   pdata = lis3_dev.pdata;
+   }
+
if (pdata) {
if ((pdata-driver_features  LIS3_USE_BLOCK_READ) 
(i2c_check_functionality(client-adapter,
@@ -255,6 +272,7 @@ static struct i2c_driver lis3lv02d_i2c_driver = {
.name   = DRV_NAME,
.owner  = THIS_MODULE,
.pm = lis3_pm_ops,
+   .of_match_table = of_match_ptr(lis3lv02d_i2c_dt_ids),
},
.probe  = lis3lv02d_i2c_probe,
.remove = __devexit_p(lis3lv02d_i2c_remove),
-- 
1.7.9.5

--
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 v3 1/4] lis3: lis3lv02d: remove lis3lv02d driver DT init

2012-09-17 Thread AnilKumar Ch
Remove lis3lv02d driver device tree initialization from core driver
and move it to individual drivers. With the current implementation
some pdata parameters are missing if we use lis3lv02d_init_device()
in lis3lv02d_i2c driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/misc/lis3lv02d/lis3lv02d.c |8 ++--
 drivers/misc/lis3lv02d/lis3lv02d.h |1 +
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
b/drivers/misc/lis3lv02d/lis3lv02d.c
index 79349ec..026021e 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -944,7 +944,7 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *lis3,
 }
 
 #ifdef CONFIG_OF
-static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
+int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 {
struct lis3lv02d_platform_data *pdata;
struct device_node *np = lis3-of_node;
@@ -1084,7 +1084,7 @@ static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 }
 
 #else
-static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
+int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 {
return 0;
 }
@@ -1100,10 +1100,6 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
irq_handler_t thread_fn;
int irq_flags = 0;
 
-   err = lis3lv02d_init_dt(lis3);
-   if (err  0)
-   return err;
-
lis3-whoami = lis3lv02d_read_8(lis3, WHO_AM_I);
 
switch (lis3-whoami) {
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h 
b/drivers/misc/lis3lv02d/lis3lv02d.h
index 4cf0779..b5505fa 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.h
+++ b/drivers/misc/lis3lv02d/lis3lv02d.h
@@ -326,5 +326,6 @@ void lis3lv02d_joystick_disable(struct lis3lv02d *lis3);
 void lis3lv02d_poweroff(struct lis3lv02d *lis3);
 int lis3lv02d_poweron(struct lis3lv02d *lis3);
 int lis3lv02d_remove_fs(struct lis3lv02d *lis3);
+int lis3lv02d_init_dt(struct lis3lv02d *lis3);
 
 extern struct lis3lv02d lis3_dev;
-- 
1.7.9.5

--
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 4/4] ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

2012-09-14 Thread AnilKumar Ch
Add lis331dlh device tree data to am335x-evm.dts. In AM335x EVM
lis331dlh accelerometer is connected to I2C2 bus. So this patch
change the status of I2C2 node to okay to use I2C2 bus. Also
added all the required platform data to am335x-evm.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   42 ++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9fb59c5..890f955 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -47,6 +47,15 @@
};
};
 
+   i2c2: i2c@4802a000 {
+   status = okay;
+   clock-frequency = 40;
+
+   lis331dlh: lis331dlh@18 {
+   reg = 0x18;
+   };
+   };
+
dcan1: d_can@481d {
status = okay;
pinctrl-names = default;
@@ -61,6 +70,39 @@
regulator-max-microvolt = 500;
regulator-boot-on;
};
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
+};
+
+lis331dlh {
+   compatible = st,lis331dlh-i2c;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

--
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/4] lis3: lis3lv02d: remove lis3lv02d driver DT init

2012-09-14 Thread AnilKumar Ch
Remove lis3lv02d driver device tree initialization from core driver
and move it to individual drivers. With the current implementation
some pdata parameters are missing if we use lis3lv02d_init_device()
in lis3lv02d_i2c driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/misc/lis3lv02d/lis3lv02d.c |8 ++--
 drivers/misc/lis3lv02d/lis3lv02d.h |1 +
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
b/drivers/misc/lis3lv02d/lis3lv02d.c
index 79349ec..026021e 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -944,7 +944,7 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *lis3,
 }
 
 #ifdef CONFIG_OF
-static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
+int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 {
struct lis3lv02d_platform_data *pdata;
struct device_node *np = lis3-of_node;
@@ -1084,7 +1084,7 @@ static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 }
 
 #else
-static int lis3lv02d_init_dt(struct lis3lv02d *lis3)
+int lis3lv02d_init_dt(struct lis3lv02d *lis3)
 {
return 0;
 }
@@ -1100,10 +1100,6 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
irq_handler_t thread_fn;
int irq_flags = 0;
 
-   err = lis3lv02d_init_dt(lis3);
-   if (err  0)
-   return err;
-
lis3-whoami = lis3lv02d_read_8(lis3, WHO_AM_I);
 
switch (lis3-whoami) {
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h 
b/drivers/misc/lis3lv02d/lis3lv02d.h
index 4cf0779..b5505fa 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.h
+++ b/drivers/misc/lis3lv02d/lis3lv02d.h
@@ -326,5 +326,6 @@ void lis3lv02d_joystick_disable(struct lis3lv02d *lis3);
 void lis3lv02d_poweroff(struct lis3lv02d *lis3);
 int lis3lv02d_poweron(struct lis3lv02d *lis3);
 int lis3lv02d_remove_fs(struct lis3lv02d *lis3);
+int lis3lv02d_init_dt(struct lis3lv02d *lis3);
 
 extern struct lis3lv02d lis3_dev;
-- 
1.7.9.5

--
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/4] lis3: lis3lv02d_spi: Add lis3lv02d device tree init

2012-09-14 Thread AnilKumar Ch
Add lis3lv02d device tree initialization code/API to take pdata
from device node. Also remove CONFIG_OF ifdef from the driver,
if CONFIG_OF is not defined then OF APIs returns 0.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/misc/lis3lv02d/lis3lv02d_spi.c |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c 
b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
index 23f3986..e1db6f4 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
@@ -84,10 +84,12 @@ static int __devinit lis302dl_spi_probe(struct spi_device 
*spi)
lis3_dev.ac = lis3lv02d_axis_normal;
lis3_dev.pdata  = spi-dev.platform_data;
 
-#ifdef CONFIG_OF
-   if (of_match_device(lis302dl_spi_dt_ids, spi-dev))
+   if (of_match_device(lis302dl_spi_dt_ids, spi-dev)) {
lis3_dev.of_node = spi-dev.of_node;
-#endif
+   ret = lis3lv02d_init_dt(lis3_dev);
+   if (ret)
+   return ret;
+   }
 
spi_set_drvdata(spi, lis3_dev);
 
-- 
1.7.9.5

--
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/4] lis3: lis3lv02d_i2c: Add device tree support

2012-09-14 Thread AnilKumar Ch
Adds device tree support to lis3lv02d_i2c driver. Along with this
DT init is moved from core driver to individual drivers, with the
current implementation some pdata is missing in lis3lv02d_i2c driver.

Also adds platform data for lis331dlh driver to am335x-EVM. These
patches were tested on AM335x-EVM.

Changes from v1:
- Moved lis3lv02d_init_dt to individual drivers with
  some code clean-up.
- Added lis331dlh compatible entry for lis331dlh parts

AnilKumar Ch (4):
  lis3: lis3lv02d: remove lis3lv02d driver DT init
  lis3: lis3lv02d_spi: Add lis3lv02d device tree init
  lis3: lis3lv02d_i2c: Add lis3lv02d device tree init
  ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

 arch/arm/boot/dts/am335x-evm.dts   |   42 
 drivers/misc/lis3lv02d/lis3lv02d.c |8 ++
 drivers/misc/lis3lv02d/lis3lv02d.h |1 +
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |   19 +++
 drivers/misc/lis3lv02d/lis3lv02d_spi.c |8 +++---
 5 files changed, 69 insertions(+), 9 deletions(-)

-- 
1.7.9.5

--
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] can: c_can: Move pm_runtime_enable/disable calls to common code

2012-09-13 Thread AnilKumar Ch
Move pm_runtime_enable/disable calls to c_can.c driver. Current
implementation is such that platform driver is doing pm_runtime
enable/disable and core driver is doing put_sync/get_sync.

PM runtime calls should be invoked if there is a valid device
pointer from platform driver so moving enable/disable calls
to core driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
Incorporated Kevin's comments on can: c_can: Add runtime PM
support to Bosch C_CAN/D_CAN controller patch.

This patch is tested on AM335x-EVM and cleanly applies on
linux-can master

 drivers/net/can/c_can/c_can.c  |   18 +-
 drivers/net/can/c_can/c_can_platform.c |5 -
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index aa6c5eb..e472975 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1155,10 +1155,23 @@ static const struct net_device_ops c_can_netdev_ops = {
 
 int register_c_can_dev(struct net_device *dev)
 {
+   int ret;
+   struct c_can_priv *priv = netdev_priv(dev);
+
+   if (priv-device)
+   pm_runtime_enable(priv-device);
+
dev-flags |= IFF_ECHO; /* we support local echo */
dev-netdev_ops = c_can_netdev_ops;
 
-   return register_candev(dev);
+   ret = register_candev(dev);
+   if (ret) {
+   if (priv-device)
+   pm_runtime_disable(priv-device);
+   return ret;
+   }
+
+   return 0;
 }
 EXPORT_SYMBOL_GPL(register_c_can_dev);
 
@@ -1170,6 +1183,9 @@ void unregister_c_can_dev(struct net_device *dev)
c_can_enable_all_interrupts(priv, DISABLE_ALL_INTERRUPTS);
 
unregister_candev(dev);
+
+   if (priv-device)
+   pm_runtime_disable(priv-device);
 }
 EXPORT_SYMBOL_GPL(unregister_c_can_dev);
 
diff --git a/drivers/net/can/c_can/c_can_platform.c 
b/drivers/net/can/c_can/c_can_platform.c
index c351975..491101a 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -32,7 +32,6 @@
 #include linux/clk.h
 #include linux/of.h
 #include linux/of_device.h
-#include linux/pm_runtime.h
 #include linux/pinctrl/consumer.h
 
 #include linux/can/dev.h
@@ -185,8 +184,6 @@ static int __devinit c_can_plat_probe(struct 
platform_device *pdev)
goto exit_free_device;
}
 
-   pm_runtime_enable(pdev-dev);
-
dev-irq = irq;
priv-base = addr;
priv-device = pdev-dev;
@@ -209,7 +206,6 @@ static int __devinit c_can_plat_probe(struct 
platform_device *pdev)
 
 exit_clear_drvdata:
platform_set_drvdata(pdev, NULL);
-   pm_runtime_disable(pdev-dev);
 exit_free_device:
free_c_can_dev(dev);
 exit_iounmap:
@@ -239,7 +235,6 @@ static int __devexit c_can_plat_remove(struct 
platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem-start, resource_size(mem));
 
-   pm_runtime_disable(pdev-dev);
clk_put(priv-priv);
 
return 0;
-- 
1.7.0.4

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


[PATCH 1/2] lis3: lis3lv02d_i2c: Add device tree support

2012-09-13 Thread AnilKumar Ch
Add device tree matching table support to lis3lv02d_i2c driver. If
the driver data is passed from device tree, then this driver picks
up platform data from device node through common/generic lis3lv02d.c
driver.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c 
b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index 15255eb..e851ee8 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -31,6 +31,9 @@
 #include linux/i2c.h
 #include linux/pm_runtime.h
 #include linux/delay.h
+#include linux/of.h
+#include linux/of_platform.h
+
 #include lis3lv02d.h
 
 #define DRV_NAME   lis3lv02d_i2c
@@ -102,12 +105,21 @@ static int lis3_i2c_init(struct lis3lv02d *lis3)
 static union axis_conversion lis3lv02d_axis_map =
{ .as_array = { LIS3_DEV_X, LIS3_DEV_Y, LIS3_DEV_Z } };
 
+static struct of_device_id lis3lv02d_i2c_dt_ids[] = {
+   { .compatible = st,lis3lv02d-i2c },
+   {}
+};
+MODULE_DEVICE_TABLE(of, lis3lv02d_i2c_dt_ids);
+
 static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
 {
int ret = 0;
struct lis3lv02d_platform_data *pdata = client-dev.platform_data;
 
+   if (of_match_device(lis3lv02d_i2c_dt_ids, client-dev))
+   lis3_dev.of_node = client-dev.of_node;
+
if (pdata) {
if ((pdata-driver_features  LIS3_USE_BLOCK_READ) 
(i2c_check_functionality(client-adapter,
@@ -255,6 +267,7 @@ static struct i2c_driver lis3lv02d_i2c_driver = {
.name   = DRV_NAME,
.owner  = THIS_MODULE,
.pm = lis3_pm_ops,
+   .of_match_table = of_match_ptr(lis3lv02d_i2c_dt_ids),
},
.probe  = lis3lv02d_i2c_probe,
.remove = __devexit_p(lis3lv02d_i2c_remove),
-- 
1.7.9.5

--
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] lis3: lis3lv02d_i2c: Add device tree support

2012-09-13 Thread AnilKumar Ch
First patch adds device tree support to lis3lv02d_i2c driver and
second patch adds platform data for lis331dlh driver to am335x
EVM. These patches were tested on AM335x-EVM.

AnilKumar Ch (2):
  lis3: lis3lv02d_i2c: Add device tree support
  ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

 arch/arm/boot/dts/am335x-evm.dts   |   42 
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |   13 ++
 2 files changed, 55 insertions(+)

-- 
1.7.9.5

--
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] ARM: dts: AM33XX: Add lis331dlh device tree data to am335x-evm

2012-09-13 Thread AnilKumar Ch
Add lis331dlh device tree data to am335x-evm.dts. In AM335x EVM
lis331dlh accelerometer is connected to I2C2 bus. So this patch
change the status to okay to use I2C2 bus. Also added all the
required platform data to am335x-evm.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-evm.dts |   42 ++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 9fb59c5..9e5a878 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -47,6 +47,15 @@
};
};
 
+   i2c2: i2c@4802a000 {
+   status = okay;
+   clock-frequency = 40;
+
+   lis331dlh: lis331dlh@18 {
+   reg = 0x18;
+   };
+   };
+
dcan1: d_can@481d {
status = okay;
pinctrl-names = default;
@@ -61,6 +70,39 @@
regulator-max-microvolt = 500;
regulator-boot-on;
};
+
+   lis3_reg: fixedregulator@1 {
+   compatible = regulator-fixed;
+   regulator-name = lis3_reg;
+   regulator-boot-on;
+   };
+};
+
+lis331dlh {
+   compatible = st,lis3lv02d-i2c;
+   Vdd-supply = lis3_reg;
+   Vdd_IO-supply = lis3_reg;
+
+   st,click-single-x;
+   st,click-single-y;
+   st,click-single-z;
+   st,click-thresh-x = 10;
+   st,click-thresh-y = 10;
+   st,click-thresh-z = 10;
+   st,irq1-click;
+   st,irq2-click;
+   st,wakeup-x-lo;
+   st,wakeup-x-hi;
+   st,wakeup-y-lo;
+   st,wakeup-y-hi;
+   st,wakeup-z-lo;
+   st,wakeup-z-hi;
+   st,min-limit-x = 120;
+   st,min-limit-y = 120;
+   st,min-limit-z = 140;
+   st,max-limit-x = 550;
+   st,max-limit-y = 550;
+   st,max-limit-z = 750;
 };
 
 /include/ tps65910.dtsi
-- 
1.7.9.5

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


[PATCH v7 0/3] arm/dts: Add device tree data for AM33XX devices

2012-09-06 Thread AnilKumar Ch
Add pinctrl and d_can device tree data to AM33XX family of devices.
First two patches add support for pinctrl DT data and third one
adds dcan DT data.

Reason behind combining these patches is to apply cleanly on
linux-omap tree, because these are sequential patches.

These patches were tested on AM335x-Bone, AM335x-EVM and based
on linux-omap:master with this patch
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg74393.html

Changes from v6:
- Incorporated Tony's comments on v5
  * Moved am3358_pinmux to am33xx_pinmux

Changes from v5:
- Incorporated Koen's comments on v5 series, user leds
  trigger modifications.
- Dropped 4th and 5th patches, submitted v2 versions of
  those in their corresponding mailing lists.

d_can:
  Changes from v4:
- Incorporated Tony's comments on v4
  * Converted all hex numbers to lower-case.
- Updated C_CAN bindings documentation according to recent
  changes.

  Changes from v3:
- Removed d_can1 node from am335x-evm.dts file. Instance
  one of CAN (d_can1) is available on AM335x-EVM only under
  a specific CPLD mode selection. am335x-evm.dts does not
  support this mode so remove the d_can1 node.
- Dropped d_can pinmux settings patch, above comment
  applies here as well.

  Changes from v2:
- Incorporated Vaibhav H's comments on v2
  * Added dcan0 instances to am33xx.dtsi file

  Changes from v1:
- These two patches separated from c_can DT support
  patch series.

pinctrl:
  Changes from v4:
- Incorporated Tony's comments on v4
  * Converted all hex numbers to lower-case.
- Added pinctrl api to leds-gpio driver to configure led
  pins to GPIO mode.

  Changes from v3:
- Updated the reg length based on latest AM335x TRM.

  Changes from v2:
- user led pinmux comments updated according to Tony's
  comment.

  Changes from v1:
- Rebased the patches based on latest pinctrl-single driver

AnilKumar Ch (3):
  arm/dts: AM33XX: Add basic pinctrl device tree data
  arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone
  arm/dts: AM33XX: Add D_CAN device tree data

 arch/arm/boot/dts/am335x-bone.dts |   43 +
 arch/arm/boot/dts/am33xx.dtsi |   27 +++
 2 files changed, 70 insertions(+)

-- 
1.7.9.5

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


[PATCH v7 2/3] arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone

2012-09-06 Thread AnilKumar Ch
Adds GPIO pinctrl nodes to am3358_pinmux master node to control
user leds (USR0, USR1, USR2 and USR3) present on BeagleBone.

[k...@dominion.thruhere.net: led0, led1 suggested by koen]
Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am335x-bone.dts |   43 +
 1 file changed, 43 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index c634f87..b0a7409 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -18,11 +18,54 @@
reg = 0x8000 0x1000; /* 256 MB */
};
 
+   am33xx_pinmux: pinmux@44e10800 {
+   userled_pins: pinmux_userled_pins {
+   pinctrl-single,pins = 
+   0x54 0x7/* gpmc_a5.gpio1_21, OUTPUT | 
MODE7 */
+   0x58 0x17   /* gpmc_a6.gpio1_22, 
OUTPUT_PULLUP | MODE7 */
+   0x5c 0x7/* gpmc_a7.gpio1_23, OUTPUT | 
MODE7 */
+   0x60 0x17   /* gpmc_a8.gpio1_24, 
OUTPUT_PULLUP | MODE7 */
+   ;
+   };
+   };
+
ocp {
uart1: serial@44e09000 {
status = okay;
};
 
+   leds {
+   compatible = gpio-leds;
+   pinctrl-names = default;
+   pinctrl-0 = userled_pins;
+
+   heartbeat {
+   label = beaglebone:green:usr0;
+   gpios = gpio2 21 0;
+   linux,default-trigger = heartbeat;
+   default-state = off;
+   };
+
+   mmc {
+   label = beaglebone:green:usr1;
+   gpios = gpio2 22 0;
+   linux,default-trigger = mmc0;
+   default-state = off;
+   };
+
+   led2 {
+   label = beaglebone:green:usr2;
+   gpios = gpio2 23 0;
+   default-state = off;
+   };
+
+   led3 {
+   label = beaglebone:green:usr3;
+   gpios = gpio2 24 0;
+   default-state = off;
+   };
+   };
+
i2c1: i2c@44e0b000 {
status = okay;
clock-frequency = 40;
-- 
1.7.9.5

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


[PATCH v7 3/3] arm/dts: AM33XX: Add D_CAN device tree data

2012-09-06 Thread AnilKumar Ch
Add Bosch D_CAN controller device tree data to AM33XX dtsi
file by adding d_can device nodes with all the necessary
parameters.

Signed-off-by: AnilKumar Ch anilku...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 58cffb7..600c3053 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -177,5 +177,23 @@
compatible = ti,omap3-wdt;
ti,hwmods = wd_timer2;
};
+
+   dcan0: d_can@481cc000 {
+   compatible = bosch,d_can;
+   ti,hwmods = d_can0;
+   reg = 0x481cc000 0x2000;
+   interrupts = 52;
+   interrupt-parent = intc;
+   status = disabled;
+   };
+
+   dcan1: d_can@481d {
+   compatible = bosch,d_can;
+   ti,hwmods = d_can1;
+   reg = 0x481d 0x2000;
+   interrupts = 55;
+   interrupt-parent = intc;
+   status = disabled;
+   };
};
 };
-- 
1.7.9.5

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


  1   2   >