Commit 911f9dab authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'pcmcia' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM pcmcia updates from Russell King:
 "These updates lay the foundations for more generic soc_common PCMCIA
  support, which will result in several of the board specific drivers
  being elimated.

  As the dependencies for this are complex, the preliminary work is
  being submitted now, with the remainder scheduled for the next merge
  window"

* 'pcmcia' of git://git.armlinux.org.uk/~rmk/linux-arm:
  pcmcia: soc_common: add driver-data pointer
  pcmcia: soc_common: add support for voltage sense GPIOs
  pcmcia: soc_common: constify pcmcia_low_level ops pointer
  pcmcia: soc_common: switch to a per-socket cpufreq notifier
  pcmcia: soc_common: add support for Vcc and Vpp regulators
  pcmcia: soc_common: add CF socket state helper
  pcmcia: soc_common: restore previous socket state on error
  pcmcia: soc_common: add support for reset and bus enable GPIOs
  pcmcia: soc_common: request legacy detect GPIO with active low
  pcmcia: soc_common: ignore invalid interrupts
  pcmcia: soc_common: switch to using gpio_descs
  pcmcia: soc_common: use devm_gpio_request_one()
parents ae50a840 4a5d67d7
...@@ -31,13 +31,6 @@ static int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ...@@ -31,13 +31,6 @@ static int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
return 0; return 0;
} }
static void
assabet_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
{
state->vs_3v = 1; /* Can only apply 3.3V on Assabet. */
state->vs_Xv = 0;
}
static int static int
assabet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) assabet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
{ {
...@@ -90,7 +83,7 @@ static void assabet_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) ...@@ -90,7 +83,7 @@ static void assabet_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
static struct pcmcia_low_level assabet_pcmcia_ops = { static struct pcmcia_low_level assabet_pcmcia_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.hw_init = assabet_pcmcia_hw_init, .hw_init = assabet_pcmcia_hw_init,
.socket_state = assabet_pcmcia_socket_state, .socket_state = soc_common_cf_socket_state,
.configure_socket = assabet_pcmcia_configure_socket, .configure_socket = assabet_pcmcia_configure_socket,
.socket_suspend = assabet_pcmcia_socket_suspend, .socket_suspend = assabet_pcmcia_socket_suspend,
}; };
......
...@@ -45,13 +45,6 @@ static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) ...@@ -45,13 +45,6 @@ static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
gpio_free(CERF_GPIO_CF_RESET); gpio_free(CERF_GPIO_CF_RESET);
} }
static void
cerf_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
{
state->vs_3v = 1;
state->vs_Xv = 0;
}
static int static int
cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
const socket_state_t *state) const socket_state_t *state)
...@@ -77,7 +70,7 @@ static struct pcmcia_low_level cerf_pcmcia_ops = { ...@@ -77,7 +70,7 @@ static struct pcmcia_low_level cerf_pcmcia_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.hw_init = cerf_pcmcia_hw_init, .hw_init = cerf_pcmcia_hw_init,
.hw_shutdown = cerf_pcmcia_hw_shutdown, .hw_shutdown = cerf_pcmcia_hw_shutdown,
.socket_state = cerf_pcmcia_socket_state, .socket_state = soc_common_cf_socket_state,
.configure_socket = cerf_pcmcia_configure_socket, .configure_socket = cerf_pcmcia_configure_socket,
}; };
......
This diff is collapsed.
...@@ -17,7 +17,14 @@ ...@@ -17,7 +17,14 @@
struct device; struct device;
struct gpio_desc;
struct pcmcia_low_level; struct pcmcia_low_level;
struct regulator;
struct soc_pcmcia_regulator {
struct regulator *reg;
bool on;
};
/* /*
* This structure encapsulates per-socket state which we might need to * This structure encapsulates per-socket state which we might need to
...@@ -52,18 +59,30 @@ struct soc_pcmcia_socket { ...@@ -52,18 +59,30 @@ struct soc_pcmcia_socket {
struct { struct {
int gpio; int gpio;
struct gpio_desc *desc;
unsigned int irq; unsigned int irq;
const char *name; const char *name;
} stat[4]; } stat[6];
#define SOC_STAT_CD 0 /* Card detect */ #define SOC_STAT_CD 0 /* Card detect */
#define SOC_STAT_BVD1 1 /* BATDEAD / IOSTSCHG */ #define SOC_STAT_BVD1 1 /* BATDEAD / IOSTSCHG */
#define SOC_STAT_BVD2 2 /* BATWARN / IOSPKR */ #define SOC_STAT_BVD2 2 /* BATWARN / IOSPKR */
#define SOC_STAT_RDY 3 /* Ready / Interrupt */ #define SOC_STAT_RDY 3 /* Ready / Interrupt */
#define SOC_STAT_VS1 4 /* Voltage sense 1 */
#define SOC_STAT_VS2 5 /* Voltage sense 2 */
struct gpio_desc *gpio_reset;
struct gpio_desc *gpio_bus_enable;
struct soc_pcmcia_regulator vcc;
struct soc_pcmcia_regulator vpp;
unsigned int irq_state; unsigned int irq_state;
#ifdef CONFIG_CPU_FREQ
struct notifier_block cpufreq_nb;
#endif
struct timer_list poll_timer; struct timer_list poll_timer;
struct list_head node; struct list_head node;
void *driver_data;
}; };
struct skt_dev_info { struct skt_dev_info {
...@@ -133,10 +152,16 @@ struct soc_pcmcia_timing { ...@@ -133,10 +152,16 @@ struct soc_pcmcia_timing {
extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *); extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *);
void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt, void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt,
struct pcmcia_low_level *ops, struct device *dev); const struct pcmcia_low_level *ops, struct device *dev);
void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt); void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt);
int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt); int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt);
int soc_pcmcia_request_gpiods(struct soc_pcmcia_socket *skt);
void soc_common_cf_socket_state(struct soc_pcmcia_socket *skt,
struct pcmcia_state *state);
int soc_pcmcia_regulator_set(struct soc_pcmcia_socket *skt,
struct soc_pcmcia_regulator *r, int v);
#ifdef CONFIG_PCMCIA_DEBUG #ifdef CONFIG_PCMCIA_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment