mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 18:53:52 +08:00
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>
This commit is contained in:
parent
9bb13eed37
commit
00d94979c3
@ -21,7 +21,7 @@
|
|||||||
#define SHANNON_GPIO_U3_RTS GPIO_GPIO (19) /* ?? */
|
#define SHANNON_GPIO_U3_RTS GPIO_GPIO (19) /* ?? */
|
||||||
#define SHANNON_GPIO_U3_CTS GPIO_GPIO (20) /* ?? */
|
#define SHANNON_GPIO_U3_CTS GPIO_GPIO (20) /* ?? */
|
||||||
#define SHANNON_GPIO_SENSE_12V GPIO_GPIO (21) /* Input, 12v flash unprotect detected */
|
#define SHANNON_GPIO_SENSE_12V GPIO_GPIO (21) /* Input, 12v flash unprotect detected */
|
||||||
#define SHANNON_GPIO_DISP_EN GPIO_GPIO (22) /* out */
|
#define SHANNON_GPIO_DISP_EN 22 /* out */
|
||||||
/* XXX GPIO 23 unaccounted for */
|
/* XXX GPIO 23 unaccounted for */
|
||||||
#define SHANNON_GPIO_EJECT_0 GPIO_GPIO (24) /* in */
|
#define SHANNON_GPIO_EJECT_0 GPIO_GPIO (24) /* in */
|
||||||
#define SHANNON_IRQ_GPIO_EJECT_0 IRQ_GPIO24
|
#define SHANNON_IRQ_GPIO_EJECT_0 IRQ_GPIO24
|
||||||
|
@ -173,6 +173,7 @@
|
|||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/ioport.h>
|
#include <linux/ioport.h>
|
||||||
#include <linux/cpufreq.h>
|
#include <linux/cpufreq.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
@ -796,10 +797,8 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi)
|
|||||||
DBAR2 = fbi->dbar2;
|
DBAR2 = fbi->dbar2;
|
||||||
LCCR0 |= LCCR0_LEN;
|
LCCR0 |= LCCR0_LEN;
|
||||||
|
|
||||||
if (machine_is_shannon()) {
|
if (machine_is_shannon())
|
||||||
GPDR |= SHANNON_GPIO_DISP_EN;
|
gpio_set_value(SHANNON_GPIO_DISP_EN, 1);
|
||||||
GPSR = SHANNON_GPIO_DISP_EN;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1);
|
dev_dbg(fbi->dev, "DBAR1 = 0x%08lx\n", DBAR1);
|
||||||
dev_dbg(fbi->dev, "DBAR2 = 0x%08lx\n", DBAR2);
|
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");
|
dev_dbg(fbi->dev, "Disabling LCD controller\n");
|
||||||
|
|
||||||
if (machine_is_shannon()) {
|
if (machine_is_shannon())
|
||||||
GPCR = SHANNON_GPIO_DISP_EN;
|
gpio_set_value(SHANNON_GPIO_DISP_EN, 0);
|
||||||
}
|
|
||||||
|
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||||
add_wait_queue(&fbi->ctrlr_wait, &wait);
|
add_wait_queue(&fbi->ctrlr_wait, &wait);
|
||||||
@ -1230,6 +1228,13 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
|
|||||||
goto failed;
|
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
|
* This makes sure that our colour bitfield
|
||||||
* descriptors are correctly initialised.
|
* descriptors are correctly initialised.
|
||||||
@ -1240,7 +1245,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
ret = register_framebuffer(&fbi->fb);
|
ret = register_framebuffer(&fbi->fb);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err_free_irq;
|
goto err_reg_fb;
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_FREQ
|
#ifdef CONFIG_CPU_FREQ
|
||||||
fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
|
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 */
|
/* This driver cannot be unloaded at the moment */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_reg_fb:
|
||||||
|
if (machine_is_shannon())
|
||||||
|
gpio_free(SHANNON_GPIO_DISP_EN);
|
||||||
err_free_irq:
|
err_free_irq:
|
||||||
free_irq(irq, fbi);
|
free_irq(irq, fbi);
|
||||||
failed:
|
failed:
|
||||||
|
Loading…
Reference in New Issue
Block a user