summaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-11-27 04:36:58 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-11-30 12:02:48 +0900
commit98779ad8226c6f6e301fa186c07247e78c6f7253 (patch)
tree5c85cb597c5706ad55d32782469924176f34d0d2 /arch/sh/boards
parentbe9cd7b6f84fd0cc59c8770771073b5c66f958ac (diff)
downloadop-kernel-dev-98779ad8226c6f6e301fa186c07247e78c6f7253.zip
op-kernel-dev-98779ad8226c6f6e301fa186c07247e78c6f7253.tar.gz
sh: Add SDHI power control support to Ecovec
This patch adds support for SDHI power control to the Ecovec board. Platform data and power control callbacks for SDHI0 and SDHI1 are added. Power is by default off. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 2274985..5932f04 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -20,6 +20,7 @@
#include <linux/i2c.h>
#include <linux/i2c/tsc2007.h>
#include <linux/input.h>
+#include <linux/mfd/sh_mobile_sdhi.h>
#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
#include <asm/heartbeat.h>
@@ -421,6 +422,15 @@ static struct i2c_board_info ts_i2c_clients = {
};
/* SHDI0 */
+static void sdhi0_set_pwr(struct platform_device *pdev, int state)
+{
+ gpio_set_value(GPIO_PTB6, state);
+}
+
+static struct sh_mobile_sdhi_info sdhi0_info = {
+ .set_pwr = sdhi0_set_pwr,
+};
+
static struct resource sdhi0_resources[] = {
[0] = {
.name = "SDHI0",
@@ -439,12 +449,24 @@ static struct platform_device sdhi0_device = {
.num_resources = ARRAY_SIZE(sdhi0_resources),
.resource = sdhi0_resources,
.id = 0,
+ .dev = {
+ .platform_data = &sdhi0_info,
+ },
.archdata = {
.hwblk_id = HWBLK_SDHI0,
},
};
/* SHDI1 */
+static void sdhi1_set_pwr(struct platform_device *pdev, int state)
+{
+ gpio_set_value(GPIO_PTB7, state);
+}
+
+static struct sh_mobile_sdhi_info sdhi1_info = {
+ .set_pwr = sdhi1_set_pwr,
+};
+
static struct resource sdhi1_resources[] = {
[0] = {
.name = "SDHI1",
@@ -463,6 +485,9 @@ static struct platform_device sdhi1_device = {
.num_resources = ARRAY_SIZE(sdhi1_resources),
.resource = sdhi1_resources,
.id = 1,
+ .dev = {
+ .platform_data = &sdhi1_info,
+ },
.archdata = {
.hwblk_id = HWBLK_SDHI1,
},
@@ -748,7 +773,7 @@ static int __init arch_setup(void)
gpio_direction_input(GPIO_PTR5);
gpio_direction_input(GPIO_PTR6);
- /* enable SDHI0 */
+ /* enable SDHI0 (needs DS2.4 set to ON) */
gpio_request(GPIO_FN_SDHI0CD, NULL);
gpio_request(GPIO_FN_SDHI0WP, NULL);
gpio_request(GPIO_FN_SDHI0CMD, NULL);
@@ -757,8 +782,10 @@ static int __init arch_setup(void)
gpio_request(GPIO_FN_SDHI0D2, NULL);
gpio_request(GPIO_FN_SDHI0D1, NULL);
gpio_request(GPIO_FN_SDHI0D0, NULL);
+ gpio_request(GPIO_PTB6, NULL);
+ gpio_direction_output(GPIO_PTB6, 0);
- /* enable SDHI1 */
+ /* enable SDHI1 (needs DS2.6,7 set to ON,OFF) */
gpio_request(GPIO_FN_SDHI1CD, NULL);
gpio_request(GPIO_FN_SDHI1WP, NULL);
gpio_request(GPIO_FN_SDHI1CMD, NULL);
@@ -767,11 +794,8 @@ static int __init arch_setup(void)
gpio_request(GPIO_FN_SDHI1D2, NULL);
gpio_request(GPIO_FN_SDHI1D1, NULL);
gpio_request(GPIO_FN_SDHI1D0, NULL);
-
- gpio_request(GPIO_PTB6, NULL);
gpio_request(GPIO_PTB7, NULL);
- gpio_direction_output(GPIO_PTB6, 1);
- gpio_direction_output(GPIO_PTB7, 1);
+ gpio_direction_output(GPIO_PTB7, 0);
/* I/O buffer drive ability is high for SDHI1 */
ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
OpenPOWER on IntegriCloud