summaryrefslogtreecommitdiffstats
path: root/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2011-02-10 17:54:24 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-18 12:33:21 -0800
commitbbe963f1b98c90980e33086d726f0963e286d1b4 (patch)
tree19b7a735621df7cdf9714beca67b3f7c97333088 /drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
parent097cd83a4c312e1ae0d9c14526f846666cab4f3a (diff)
downloadlinux-bbe963f1b98c90980e33086d726f0963e286d1b4.tar.gz
linux-bbe963f1b98c90980e33086d726f0963e286d1b4.tar.xz
staging: olpc_dcon: move more variables into dcon_priv
This moves dcon_source and dcon_pending into the dcon_priv struct. Because these variables are used by the IRQ handler (which is registered in the model-specific callbacks), we end up needing to move dcon_priv into olpc_dcon.h. This also changes the IRQ registration to use the dcon_priv pointer as dev_id, instead of dcon_driver. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/olpc_dcon/olpc_dcon_xo_1.c')
-rw-r--r--drivers/staging/olpc_dcon/olpc_dcon_xo_1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
index be52b6c9c50e..b154be7a2fe6 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
@@ -16,7 +16,7 @@
#include "olpc_dcon.h"
-static int dcon_init_xo_1(void)
+static int dcon_init_xo_1(struct dcon_priv *dcon)
{
unsigned char lob;
@@ -54,10 +54,10 @@ static int dcon_init_xo_1(void)
* then a value is set. So, future readings of the pin can use
* READ_BACK, but the first one cannot. Awesome, huh?
*/
- dcon_source = cs5535_gpio_isset(OLPC_GPIO_DCON_LOAD, GPIO_OUTPUT_VAL)
+ dcon->curr_src = cs5535_gpio_isset(OLPC_GPIO_DCON_LOAD, GPIO_OUTPUT_VAL)
? DCON_SOURCE_CPU
: DCON_SOURCE_DCON;
- dcon_pending = dcon_source;
+ dcon->pending_src = dcon->curr_src;
/* Set the directions for the GPIO pins */
gpio_direction_input(OLPC_GPIO_DCON_STAT0);
@@ -65,7 +65,7 @@ static int dcon_init_xo_1(void)
gpio_direction_input(OLPC_GPIO_DCON_IRQ);
gpio_direction_input(OLPC_GPIO_DCON_BLANK);
gpio_direction_output(OLPC_GPIO_DCON_LOAD,
- dcon_source == DCON_SOURCE_CPU);
+ dcon->curr_src == DCON_SOURCE_CPU);
/* Set up the interrupt mappings */
@@ -81,7 +81,7 @@ static int dcon_init_xo_1(void)
outb(lob, 0x4d0);
/* Register the interupt handler */
- if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", &dcon_driver)) {
+ if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) {
printk(KERN_ERR "olpc-dcon: failed to request DCON's irq\n");
goto err_req_irq;
}