aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-18 08:51:04 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:21 -0500
commit00d94979c37fcba3486e9cc76a2eee750172a6a4 (patch)
tree55efc4729dcf2cb15aa065da6ca36cd71ad4e447 /drivers/video
parent9bb13eed37cc17fd176346c2866e2584772953bb (diff)
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 <FlorianSchandinat@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/sa1100fb.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index f3f55eb61ca1..379b2c5000a3 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -173,6 +173,7 @@
173#include <linux/init.h> 173#include <linux/init.h>
174#include <linux/ioport.h> 174#include <linux/ioport.h>
175#include <linux/cpufreq.h> 175#include <linux/cpufreq.h>
176#include <linux/gpio.h>
176#include <linux/platform_device.h> 177#include <linux/platform_device.h>
177#include <linux/dma-mapping.h> 178#include <linux/dma-mapping.h>
178#include <linux/mutex.h> 179#include <linux/mutex.h>
@@ -796,10 +797,8 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi)
796 DBAR2 = fbi->dbar2; 797 DBAR2 = fbi->dbar2;
797 LCCR0 |= LCCR0_LEN; 798 LCCR0 |= LCCR0_LEN;
798 799
799 if (machine_is_shannon()) { 800 if (machine_is_shannon())
800 GPDR |= SHANNON_GPIO_DISP_EN; 801 gpio_set_value(SHANNON_GPIO_DISP_EN, 1);
801 GPSR = SHANNON_GPIO_DISP_EN;
802 }
803 802
804 dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1); 803 dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1);
805 dev_dbg(fbi->dev, "DBAR2 = 0x%08lx\n", DBAR2); 804 dev_dbg(fbi->dev, "DBAR2 = 0x%08lx\n", DBAR2);
@@ -815,9 +814,8 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
815 814
816 dev_dbg(fbi->dev, "Disabling LCD controller\n"); 815 dev_dbg(fbi->dev, "Disabling LCD controller\n");
817 816
818 if (machine_is_shannon()) { 817 if (machine_is_shannon())
819 GPCR = SHANNON_GPIO_DISP_EN; 818 gpio_set_value(SHANNON_GPIO_DISP_EN, 0);
820 }
821 819
822 set_current_state(TASK_UNINTERRUPTIBLE); 820 set_current_state(TASK_UNINTERRUPTIBLE);
823 add_wait_queue(&fbi->ctrlr_wait, &wait); 821 add_wait_queue(&fbi->ctrlr_wait, &wait);
@@ -1230,6 +1228,13 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
1230 goto failed; 1228 goto failed;
1231 } 1229 }
1232 1230
1231 if (machine_is_shannon()) {
1232 ret = gpio_request_one(SHANNON_GPIO_DISP_EN,
1233 GPIOF_OUT_INIT_LOW, "display enable");
1234 if (ret)
1235 goto err_free_irq;
1236 }
1237
1233 /* 1238 /*
1234 * This makes sure that our colour bitfield 1239 * This makes sure that our colour bitfield
1235 * descriptors are correctly initialised. 1240 * descriptors are correctly initialised.
@@ -1240,7 +1245,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
1240 1245
1241 ret = register_framebuffer(&fbi->fb); 1246 ret = register_framebuffer(&fbi->fb);
1242 if (ret < 0) 1247 if (ret < 0)
1243 goto err_free_irq; 1248 goto err_reg_fb;
1244 1249
1245#ifdef CONFIG_CPU_FREQ 1250#ifdef CONFIG_CPU_FREQ
1246 fbi->freq_transition.notifier_call = sa1100fb_freq_transition; 1251 fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
@@ -1252,6 +1257,9 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
1252 /* This driver cannot be unloaded at the moment */ 1257 /* This driver cannot be unloaded at the moment */
1253 return 0; 1258 return 0;
1254 1259
1260 err_reg_fb:
1261 if (machine_is_shannon())
1262 gpio_free(SHANNON_GPIO_DISP_EN);
1255 err_free_irq: 1263 err_free_irq:
1256 free_irq(irq, fbi); 1264 free_irq(irq, fbi);
1257 failed: 1265 failed: