From 00d94979c37fcba3486e9cc76a2eee750172a6a4 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 18 Jan 2012 13:51:04 +0000 Subject: FB: sa11x0: convert shannon display enable accesses to use GPIO subsystem Rather than accessing GPSR and GPCR directly, use the GPIO subsystem instead. Acked-by: Florian Tobias Schandinat Signed-off-by: Russell King --- drivers/video/sa1100fb.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index f3f55eb61ca..379b2c5000a 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -173,6 +173,7 @@ #include #include #include +#include #include #include #include @@ -796,10 +797,8 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi) DBAR2 = fbi->dbar2; LCCR0 |= LCCR0_LEN; - if (machine_is_shannon()) { - GPDR |= SHANNON_GPIO_DISP_EN; - GPSR = SHANNON_GPIO_DISP_EN; - } + if (machine_is_shannon()) + gpio_set_value(SHANNON_GPIO_DISP_EN, 1); dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1); dev_dbg(fbi->dev, "DBAR2 = 0x%08lx\n", DBAR2); @@ -815,9 +814,8 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi) dev_dbg(fbi->dev, "Disabling LCD controller\n"); - if (machine_is_shannon()) { - GPCR = SHANNON_GPIO_DISP_EN; - } + if (machine_is_shannon()) + gpio_set_value(SHANNON_GPIO_DISP_EN, 0); set_current_state(TASK_UNINTERRUPTIBLE); add_wait_queue(&fbi->ctrlr_wait, &wait); @@ -1230,6 +1228,13 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev) goto failed; } + if (machine_is_shannon()) { + ret = gpio_request_one(SHANNON_GPIO_DISP_EN, + GPIOF_OUT_INIT_LOW, "display enable"); + if (ret) + goto err_free_irq; + } + /* * This makes sure that our colour bitfield * descriptors are correctly initialised. @@ -1240,7 +1245,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev) ret = register_framebuffer(&fbi->fb); if (ret < 0) - goto err_free_irq; + goto err_reg_fb; #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = sa1100fb_freq_transition; @@ -1252,6 +1257,9 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev) /* This driver cannot be unloaded at the moment */ return 0; + err_reg_fb: + if (machine_is_shannon()) + gpio_free(SHANNON_GPIO_DISP_EN); err_free_irq: free_irq(irq, fbi); failed: -- cgit v1.2.3-70-g09d2