mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel-stable
Conflicts: arch/arm/mach-pxa/tosa.c
This commit is contained in:
commit
938c0ace3f
51 changed files with 514 additions and 582 deletions
|
|
@ -34,14 +34,24 @@
|
|||
#define COLIBRI320_DETECT_GPIO 81
|
||||
#define COLIBRI320_READY_GPIO 29
|
||||
|
||||
static struct {
|
||||
int reset_gpio;
|
||||
int ppen_gpio;
|
||||
int bvd1_gpio;
|
||||
int bvd2_gpio;
|
||||
int detect_gpio;
|
||||
int ready_gpio;
|
||||
} colibri_pcmcia_gpio;
|
||||
enum {
|
||||
DETECT = 0,
|
||||
READY = 1,
|
||||
BVD1 = 2,
|
||||
BVD2 = 3,
|
||||
PPEN = 4,
|
||||
RESET = 5,
|
||||
};
|
||||
|
||||
/* Contents of this array are configured on-the-fly in init function */
|
||||
static struct gpio colibri_pcmcia_gpios[] = {
|
||||
{ 0, GPIOF_IN, "PCMCIA Detect" },
|
||||
{ 0, GPIOF_IN, "PCMCIA Ready" },
|
||||
{ 0, GPIOF_IN, "PCMCIA BVD1" },
|
||||
{ 0, GPIOF_IN, "PCMCIA BVD2" },
|
||||
{ 0, GPIOF_INIT_LOW, "PCMCIA PPEN" },
|
||||
{ 0, GPIOF_INIT_HIGH,"PCMCIA Reset" },
|
||||
};
|
||||
|
||||
static struct pcmcia_irqs colibri_irqs[] = {
|
||||
{
|
||||
|
|
@ -54,88 +64,42 @@ static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT");
|
||||
ret = gpio_request_array(colibri_pcmcia_gpios,
|
||||
ARRAY_SIZE(colibri_pcmcia_gpios));
|
||||
if (ret)
|
||||
goto err1;
|
||||
ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY");
|
||||
if (ret)
|
||||
goto err2;
|
||||
ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio);
|
||||
if (ret)
|
||||
goto err3;
|
||||
colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpios[DETECT].gpio);
|
||||
skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpios[READY].gpio);
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1");
|
||||
if (ret)
|
||||
goto err3;
|
||||
ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio);
|
||||
if (ret)
|
||||
goto err4;
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2");
|
||||
if (ret)
|
||||
goto err4;
|
||||
ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio);
|
||||
if (ret)
|
||||
goto err5;
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN");
|
||||
if (ret)
|
||||
goto err5;
|
||||
ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0);
|
||||
if (ret)
|
||||
goto err6;
|
||||
|
||||
ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET");
|
||||
if (ret)
|
||||
goto err6;
|
||||
ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1);
|
||||
if (ret)
|
||||
goto err7;
|
||||
|
||||
colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio);
|
||||
skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio);
|
||||
|
||||
return soc_pcmcia_request_irqs(skt, colibri_irqs,
|
||||
ret = soc_pcmcia_request_irqs(skt, colibri_irqs,
|
||||
ARRAY_SIZE(colibri_irqs));
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
return ret;
|
||||
|
||||
err7:
|
||||
gpio_free(colibri_pcmcia_gpio.detect_gpio);
|
||||
err6:
|
||||
gpio_free(colibri_pcmcia_gpio.ready_gpio);
|
||||
err5:
|
||||
gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
|
||||
err4:
|
||||
gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
|
||||
err3:
|
||||
gpio_free(colibri_pcmcia_gpio.reset_gpio);
|
||||
err2:
|
||||
gpio_free(colibri_pcmcia_gpio.ppen_gpio);
|
||||
gpio_free_array(colibri_pcmcia_gpios,
|
||||
ARRAY_SIZE(colibri_pcmcia_gpios));
|
||||
err1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
gpio_free(colibri_pcmcia_gpio.detect_gpio);
|
||||
gpio_free(colibri_pcmcia_gpio.ready_gpio);
|
||||
gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
|
||||
gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
|
||||
gpio_free(colibri_pcmcia_gpio.reset_gpio);
|
||||
gpio_free(colibri_pcmcia_gpio.ppen_gpio);
|
||||
gpio_free_array(colibri_pcmcia_gpios,
|
||||
ARRAY_SIZE(colibri_pcmcia_gpios));
|
||||
}
|
||||
|
||||
static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
|
||||
struct pcmcia_state *state)
|
||||
{
|
||||
|
||||
state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio);
|
||||
state->ready = !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio);
|
||||
state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio);
|
||||
state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio);
|
||||
state->detect = !!gpio_get_value(colibri_pcmcia_gpios[DETECT].gpio);
|
||||
state->ready = !!gpio_get_value(colibri_pcmcia_gpios[READY].gpio);
|
||||
state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpios[BVD1].gpio);
|
||||
state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpios[BVD2].gpio);
|
||||
state->wrprot = 0;
|
||||
state->vs_3v = 1;
|
||||
state->vs_Xv = 0;
|
||||
|
|
@ -145,9 +109,10 @@ static int
|
|||
colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
|
||||
const socket_state_t *state)
|
||||
{
|
||||
gpio_set_value(colibri_pcmcia_gpio.ppen_gpio,
|
||||
gpio_set_value(colibri_pcmcia_gpios[PPEN].gpio,
|
||||
!(state->Vcc == 33 && state->Vpp < 50));
|
||||
gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET);
|
||||
gpio_set_value(colibri_pcmcia_gpios[RESET].gpio,
|
||||
state->flags & SS_RESET);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -190,20 +155,20 @@ static int __init colibri_pcmcia_init(void)
|
|||
|
||||
/* Colibri PXA270 */
|
||||
if (machine_is_colibri()) {
|
||||
colibri_pcmcia_gpio.reset_gpio = COLIBRI270_RESET_GPIO;
|
||||
colibri_pcmcia_gpio.ppen_gpio = COLIBRI270_PPEN_GPIO;
|
||||
colibri_pcmcia_gpio.bvd1_gpio = COLIBRI270_BVD1_GPIO;
|
||||
colibri_pcmcia_gpio.bvd2_gpio = COLIBRI270_BVD2_GPIO;
|
||||
colibri_pcmcia_gpio.detect_gpio = COLIBRI270_DETECT_GPIO;
|
||||
colibri_pcmcia_gpio.ready_gpio = COLIBRI270_READY_GPIO;
|
||||
colibri_pcmcia_gpios[RESET].gpio = COLIBRI270_RESET_GPIO;
|
||||
colibri_pcmcia_gpios[PPEN].gpio = COLIBRI270_PPEN_GPIO;
|
||||
colibri_pcmcia_gpios[BVD1].gpio = COLIBRI270_BVD1_GPIO;
|
||||
colibri_pcmcia_gpios[BVD2].gpio = COLIBRI270_BVD2_GPIO;
|
||||
colibri_pcmcia_gpios[DETECT].gpio = COLIBRI270_DETECT_GPIO;
|
||||
colibri_pcmcia_gpios[READY].gpio = COLIBRI270_READY_GPIO;
|
||||
/* Colibri PXA320 */
|
||||
} else if (machine_is_colibri320()) {
|
||||
colibri_pcmcia_gpio.reset_gpio = COLIBRI320_RESET_GPIO;
|
||||
colibri_pcmcia_gpio.ppen_gpio = COLIBRI320_PPEN_GPIO;
|
||||
colibri_pcmcia_gpio.bvd1_gpio = COLIBRI320_BVD1_GPIO;
|
||||
colibri_pcmcia_gpio.bvd2_gpio = COLIBRI320_BVD2_GPIO;
|
||||
colibri_pcmcia_gpio.detect_gpio = COLIBRI320_DETECT_GPIO;
|
||||
colibri_pcmcia_gpio.ready_gpio = COLIBRI320_READY_GPIO;
|
||||
colibri_pcmcia_gpios[RESET].gpio = COLIBRI320_RESET_GPIO;
|
||||
colibri_pcmcia_gpios[PPEN].gpio = COLIBRI320_PPEN_GPIO;
|
||||
colibri_pcmcia_gpios[BVD1].gpio = COLIBRI320_BVD1_GPIO;
|
||||
colibri_pcmcia_gpios[BVD2].gpio = COLIBRI320_BVD2_GPIO;
|
||||
colibri_pcmcia_gpios[DETECT].gpio = COLIBRI320_DETECT_GPIO;
|
||||
colibri_pcmcia_gpios[READY].gpio = COLIBRI320_READY_GPIO;
|
||||
}
|
||||
|
||||
ret = platform_device_add_data(colibri_pcmcia_device,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Driver for Palm LifeDrive PCMCIA
|
||||
*
|
||||
* Copyright (C) 2006 Alex Osborne <ato@meshy.org>
|
||||
* Copyright (C) 2007-2008 Marek Vasut <marek.vasut@gmail.com>
|
||||
* Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.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
|
||||
|
|
@ -20,49 +20,27 @@
|
|||
#include <mach/palmld.h>
|
||||
#include "soc_common.h"
|
||||
|
||||
static struct gpio palmld_pcmcia_gpios[] = {
|
||||
{ GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" },
|
||||
{ GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },
|
||||
{ GPIO_NR_PALMLD_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" },
|
||||
};
|
||||
|
||||
static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_POWER, "PCMCIA PWR");
|
||||
if (ret)
|
||||
goto err1;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_POWER, 0);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_RESET, "PCMCIA RST");
|
||||
if (ret)
|
||||
goto err2;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_RESET, 1);
|
||||
if (ret)
|
||||
goto err3;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_READY, "PCMCIA RDY");
|
||||
if (ret)
|
||||
goto err3;
|
||||
ret = gpio_direction_input(GPIO_NR_PALMLD_PCMCIA_READY);
|
||||
if (ret)
|
||||
goto err4;
|
||||
ret = gpio_request_array(palmld_pcmcia_gpios,
|
||||
ARRAY_SIZE(palmld_pcmcia_gpios));
|
||||
|
||||
skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
|
||||
return 0;
|
||||
|
||||
err4:
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_READY);
|
||||
err3:
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
|
||||
err2:
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
|
||||
err1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_READY);
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
|
||||
gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
|
||||
gpio_free_array(palmld_pcmcia_gpios, ARRAY_SIZE(palmld_pcmcia_gpios));
|
||||
}
|
||||
|
||||
static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Driver for Palm Tungsten|C PCMCIA
|
||||
*
|
||||
* Copyright (C) 2008 Alex Osborne <ato@meshy.org>
|
||||
* Copyright (C) 2009 Marek Vasut <marek.vasut@gmail.com>
|
||||
* Copyright (C) 2009-2011 Marek Vasut <marek.vasut@gmail.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
|
||||
|
|
@ -21,79 +21,30 @@
|
|||
#include <mach/palmtc.h>
|
||||
#include "soc_common.h"
|
||||
|
||||
static struct gpio palmtc_pcmcia_gpios[] = {
|
||||
{ GPIO_NR_PALMTC_PCMCIA_POWER1, GPIOF_INIT_LOW, "PCMCIA Power 1" },
|
||||
{ GPIO_NR_PALMTC_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" },
|
||||
{ GPIO_NR_PALMTC_PCMCIA_POWER3, GPIOF_INIT_LOW, "PCMCIA Power 3" },
|
||||
{ GPIO_NR_PALMTC_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },
|
||||
{ GPIO_NR_PALMTC_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" },
|
||||
{ GPIO_NR_PALMTC_PCMCIA_PWRREADY, GPIOF_IN, "PCMCIA Power Ready" },
|
||||
};
|
||||
|
||||
static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER1, "PCMCIA PWR1");
|
||||
if (ret)
|
||||
goto err1;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER1, 0);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER2, "PCMCIA PWR2");
|
||||
if (ret)
|
||||
goto err2;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER2, 0);
|
||||
if (ret)
|
||||
goto err3;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_POWER3, "PCMCIA PWR3");
|
||||
if (ret)
|
||||
goto err3;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_POWER3, 0);
|
||||
if (ret)
|
||||
goto err4;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_RESET, "PCMCIA RST");
|
||||
if (ret)
|
||||
goto err4;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTC_PCMCIA_RESET, 1);
|
||||
if (ret)
|
||||
goto err5;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_READY, "PCMCIA RDY");
|
||||
if (ret)
|
||||
goto err5;
|
||||
ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_READY);
|
||||
if (ret)
|
||||
goto err6;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTC_PCMCIA_PWRREADY, "PCMCIA PWRRDY");
|
||||
if (ret)
|
||||
goto err6;
|
||||
ret = gpio_direction_input(GPIO_NR_PALMTC_PCMCIA_PWRREADY);
|
||||
if (ret)
|
||||
goto err7;
|
||||
ret = gpio_request_array(palmtc_pcmcia_gpios,
|
||||
ARRAY_SIZE(palmtc_pcmcia_gpios));
|
||||
|
||||
skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMTC_PCMCIA_READY);
|
||||
return 0;
|
||||
|
||||
err7:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_PWRREADY);
|
||||
err6:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_READY);
|
||||
err5:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_RESET);
|
||||
err4:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER3);
|
||||
err3:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER2);
|
||||
err2:
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER1);
|
||||
err1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void palmtc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_PWRREADY);
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_READY);
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_RESET);
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER3);
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER2);
|
||||
gpio_free(GPIO_NR_PALMTC_PCMCIA_POWER1);
|
||||
gpio_free_array(palmtc_pcmcia_gpios, ARRAY_SIZE(palmtc_pcmcia_gpios));
|
||||
}
|
||||
|
||||
static void palmtc_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Driver for Palm T|X PCMCIA
|
||||
*
|
||||
* Copyright (C) 2007-2008 Marek Vasut <marek.vasut@gmail.com>
|
||||
* Copyright (C) 2007-2011 Marek Vasut <marek.vasut@gmail.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
|
||||
|
|
@ -13,67 +13,34 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/palmtx.h>
|
||||
|
||||
#include "soc_common.h"
|
||||
|
||||
static struct gpio palmtx_pcmcia_gpios[] = {
|
||||
{ GPIO_NR_PALMTX_PCMCIA_POWER1, GPIOF_INIT_LOW, "PCMCIA Power 1" },
|
||||
{ GPIO_NR_PALMTX_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" },
|
||||
{ GPIO_NR_PALMTX_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" },
|
||||
{ GPIO_NR_PALMTX_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" },
|
||||
};
|
||||
|
||||
static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1");
|
||||
if (ret)
|
||||
goto err1;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2");
|
||||
if (ret)
|
||||
goto err2;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0);
|
||||
if (ret)
|
||||
goto err3;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST");
|
||||
if (ret)
|
||||
goto err3;
|
||||
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1);
|
||||
if (ret)
|
||||
goto err4;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY");
|
||||
if (ret)
|
||||
goto err4;
|
||||
ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY);
|
||||
if (ret)
|
||||
goto err5;
|
||||
ret = gpio_request_array(palmtx_pcmcia_gpios,
|
||||
ARRAY_SIZE(palmtx_pcmcia_gpios));
|
||||
|
||||
skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
|
||||
return 0;
|
||||
|
||||
err5:
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
|
||||
err4:
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
|
||||
err3:
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
|
||||
err2:
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
|
||||
err1:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
|
||||
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
|
||||
gpio_free_array(palmtx_pcmcia_gpios, ARRAY_SIZE(palmtx_pcmcia_gpios));
|
||||
}
|
||||
|
||||
static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
*
|
||||
* Driver for Voipac PXA270 PCMCIA and CF sockets
|
||||
*
|
||||
* Copyright (C) 2010
|
||||
* Marek Vasut <marek.vasut@gmail.com>
|
||||
* Copyright (C) 2010-2011 Marek Vasut <marek.vasut@gmail.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
|
||||
|
|
@ -22,6 +21,19 @@
|
|||
|
||||
#include "soc_common.h"
|
||||
|
||||
static struct gpio vpac270_pcmcia_gpios[] = {
|
||||
{ GPIO84_VPAC270_PCMCIA_CD, GPIOF_IN, "PCMCIA Card Detect" },
|
||||
{ GPIO35_VPAC270_PCMCIA_RDY, GPIOF_IN, "PCMCIA Ready" },
|
||||
{ GPIO107_VPAC270_PCMCIA_PPEN, GPIOF_INIT_LOW, "PCMCIA PPEN" },
|
||||
{ GPIO11_VPAC270_PCMCIA_RESET, GPIOF_INIT_LOW, "PCMCIA Reset" },
|
||||
};
|
||||
|
||||
static struct gpio vpac270_cf_gpios[] = {
|
||||
{ GPIO17_VPAC270_CF_CD, GPIOF_IN, "CF Card Detect" },
|
||||
{ GPIO12_VPAC270_CF_RDY, GPIOF_IN, "CF Ready" },
|
||||
{ GPIO16_VPAC270_CF_RESET, GPIOF_INIT_LOW, "CF Reset" },
|
||||
};
|
||||
|
||||
static struct pcmcia_irqs cd_irqs[] = {
|
||||
{
|
||||
.sock = 0,
|
||||
|
|
@ -40,96 +52,34 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
|
|||
int ret;
|
||||
|
||||
if (skt->nr == 0) {
|
||||
ret = gpio_request(GPIO84_VPAC270_PCMCIA_CD, "PCMCIA CD");
|
||||
if (ret)
|
||||
goto err1;
|
||||
ret = gpio_direction_input(GPIO84_VPAC270_PCMCIA_CD);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = gpio_request(GPIO35_VPAC270_PCMCIA_RDY, "PCMCIA RDY");
|
||||
if (ret)
|
||||
goto err2;
|
||||
ret = gpio_direction_input(GPIO35_VPAC270_PCMCIA_RDY);
|
||||
if (ret)
|
||||
goto err3;
|
||||
|
||||
ret = gpio_request(GPIO107_VPAC270_PCMCIA_PPEN, "PCMCIA PPEN");
|
||||
if (ret)
|
||||
goto err3;
|
||||
ret = gpio_direction_output(GPIO107_VPAC270_PCMCIA_PPEN, 0);
|
||||
if (ret)
|
||||
goto err4;
|
||||
|
||||
ret = gpio_request(GPIO11_VPAC270_PCMCIA_RESET, "PCMCIA RESET");
|
||||
if (ret)
|
||||
goto err4;
|
||||
ret = gpio_direction_output(GPIO11_VPAC270_PCMCIA_RESET, 0);
|
||||
if (ret)
|
||||
goto err5;
|
||||
ret = gpio_request_array(vpac270_pcmcia_gpios,
|
||||
ARRAY_SIZE(vpac270_pcmcia_gpios));
|
||||
|
||||
skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY);
|
||||
|
||||
return soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1);
|
||||
|
||||
err5:
|
||||
gpio_free(GPIO11_VPAC270_PCMCIA_RESET);
|
||||
err4:
|
||||
gpio_free(GPIO107_VPAC270_PCMCIA_PPEN);
|
||||
err3:
|
||||
gpio_free(GPIO35_VPAC270_PCMCIA_RDY);
|
||||
err2:
|
||||
gpio_free(GPIO84_VPAC270_PCMCIA_CD);
|
||||
err1:
|
||||
return ret;
|
||||
|
||||
if (!ret)
|
||||
ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1);
|
||||
} else {
|
||||
ret = gpio_request(GPIO17_VPAC270_CF_CD, "CF CD");
|
||||
if (ret)
|
||||
goto err6;
|
||||
ret = gpio_direction_input(GPIO17_VPAC270_CF_CD);
|
||||
if (ret)
|
||||
goto err7;
|
||||
|
||||
ret = gpio_request(GPIO12_VPAC270_CF_RDY, "CF RDY");
|
||||
if (ret)
|
||||
goto err7;
|
||||
ret = gpio_direction_input(GPIO12_VPAC270_CF_RDY);
|
||||
if (ret)
|
||||
goto err8;
|
||||
|
||||
ret = gpio_request(GPIO16_VPAC270_CF_RESET, "CF RESET");
|
||||
if (ret)
|
||||
goto err8;
|
||||
ret = gpio_direction_output(GPIO16_VPAC270_CF_RESET, 0);
|
||||
if (ret)
|
||||
goto err9;
|
||||
ret = gpio_request_array(vpac270_cf_gpios,
|
||||
ARRAY_SIZE(vpac270_cf_gpios));
|
||||
|
||||
skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY);
|
||||
|
||||
return soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1);
|
||||
|
||||
err9:
|
||||
gpio_free(GPIO16_VPAC270_CF_RESET);
|
||||
err8:
|
||||
gpio_free(GPIO12_VPAC270_CF_RDY);
|
||||
err7:
|
||||
gpio_free(GPIO17_VPAC270_CF_CD);
|
||||
err6:
|
||||
return ret;
|
||||
|
||||
if (!ret)
|
||||
ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
|
||||
{
|
||||
gpio_free(GPIO11_VPAC270_PCMCIA_RESET);
|
||||
gpio_free(GPIO107_VPAC270_PCMCIA_PPEN);
|
||||
gpio_free(GPIO35_VPAC270_PCMCIA_RDY);
|
||||
gpio_free(GPIO84_VPAC270_PCMCIA_CD);
|
||||
gpio_free(GPIO16_VPAC270_CF_RESET);
|
||||
gpio_free(GPIO12_VPAC270_CF_RDY);
|
||||
gpio_free(GPIO17_VPAC270_CF_CD);
|
||||
if (skt->nr == 0)
|
||||
gpio_request_array(vpac270_pcmcia_gpios,
|
||||
ARRAY_SIZE(vpac270_pcmcia_gpios));
|
||||
else
|
||||
gpio_request_array(vpac270_cf_gpios,
|
||||
ARRAY_SIZE(vpac270_cf_gpios));
|
||||
}
|
||||
|
||||
static void vpac270_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
|
||||
|
|
|
|||
Loading…
Reference in a new issue