aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-06-23 15:40:59 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-06-23 15:40:59 +0200
commitb8fd949e585e9b991b36f9edc40ebec1a7dd885b (patch)
tree64f0f3c789309835cf4a6a8ff3b8f998037e009e
parent7d86b44375243ab26a58e598fe13bf72d9a5ab48 (diff)
parent3951d7043e3002d34780618cfa2ccf378bd14edd (diff)
Merge branch 'glamo-2.6.34' into om-gta02-2.6.34
Conflicts: drivers/gpio/Makefile
-rw-r--r--drivers/gpio/Kconfig6
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/glamo-gpio.c (renamed from drivers/mfd/glamo/glamo-gpio.c)13
-rw-r--r--drivers/mfd/Kconfig9
-rw-r--r--drivers/mfd/Makefile2
-rw-r--r--drivers/mfd/glamo-core.c (renamed from drivers/mfd/glamo/glamo-core.c)13
-rw-r--r--drivers/mfd/glamo/Kconfig42
-rw-r--r--drivers/mfd/glamo/Makefile11
-rw-r--r--drivers/mmc/host/Kconfig11
-rw-r--r--drivers/mmc/host/Makefile1
-rw-r--r--drivers/mmc/host/glamo-mci.c (renamed from drivers/mfd/glamo/glamo-mci.c)5
-rw-r--r--drivers/video/Kconfig17
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/glamo-fb.c (renamed from drivers/mfd/glamo/glamo-fb.c)12
-rw-r--r--include/linux/mfd/glamo-core.h (renamed from drivers/mfd/glamo/glamo-core.h)11
-rw-r--r--include/linux/mfd/glamo-regs.h (renamed from drivers/mfd/glamo/glamo-regs.h)0
16 files changed, 72 insertions, 83 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index c6b9a40bffa..f1761c2e9d0 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -70,6 +70,12 @@ config GPIO_MAX730X
comment "Memory mapped GPIO expanders:"
+config GPIO_GLAMO
+ tristate "Glamo GPIO support"
+ depends on MFD_GLAMO
+ help
+ Say yes here to support GPIO functionality of the Smedia Glamo.
+
config GPIO_IT8761E
tristate "IT8761E GPIO support"
depends on GPIOLIB
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 4fc4675a67b..5be66759c42 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o
obj-$(CONFIG_GPIO_ADP5520) += adp5520-gpio.o
obj-$(CONFIG_GPIO_ADP5588) += adp5588-gpio.o
+obj-$(CONFIG_GPIO_GLAMO) += glamo-gpio.o
obj-$(CONFIG_GPIO_LANGWELL) += langwell_gpio.o
obj-$(CONFIG_GPIO_MAX730X) += max730x.o
obj-$(CONFIG_GPIO_MAX7300) += max7300.o
diff --git a/drivers/mfd/glamo/glamo-gpio.c b/drivers/gpio/glamo-gpio.c
index 30ee6ed1d9a..185b86b64e4 100644
--- a/drivers/mfd/glamo/glamo-gpio.c
+++ b/drivers/gpio/glamo-gpio.c
@@ -28,9 +28,8 @@
#include <linux/gpio.h>
#include <linux/mfd/glamo.h>
-
-#include "glamo-core.h"
-#include "glamo-regs.h"
+#include <linux/mfd/glamo-core.h>
+#include <linux/mfd/glamo-regs.h>
#define GLAMO_NR_GPIO 21
#define GLAMO_NR_GPIO_REGS DIV_ROUND_UP(GLAMO_NR_GPIO, 4)
@@ -43,7 +42,7 @@ struct glamo_gpio {
uint16_t saved_regs[GLAMO_NR_GPIO_REGS];
};
-#define REG_OF_GPIO(gpio) (GLAMO_REG_GPIO(gpio >> 2))
+#define REG_OF_GPIO(gpio) (GLAMO_REG_GPIO(gpio >> 2))
#define NUM_OF_GPIO(gpio) (gpio & 0x3)
#define DIRECTION_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 0))
#define OUTPUT_BIT(gpio) (1 << (NUM_OF_GPIO(gpio) + 4))
@@ -111,7 +110,7 @@ static void glamo_gpio_free(struct gpio_chip *chip, unsigned offset)
}
static int glamo_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
- int value)
+ int value)
{
struct glamo_core *glamo = chip_to_glamo(chip);
unsigned int reg = REG_OF_GPIO(offset);
@@ -119,7 +118,7 @@ static int glamo_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
spin_lock(&glamo->lock);
tmp = readw(glamo->base + reg);
- tmp &= ~DIRECTION_BIT(offset);
+ tmp &= ~DIRECTION_BIT(offset);
if (value)
tmp |= OUTPUT_BIT(offset);
@@ -160,7 +159,7 @@ static const struct __devinit gpio_chip glamo_gpio_chip = {
.base = -1,
.ngpio = GLAMO_NR_GPIO,
.can_sleep = 0,
- .owner = THIS_MODULE,
+ .owner = THIS_MODULE,
};
static int __devinit glamo_gpio_probe(struct platform_device *pdev)
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 8e615af44b5..e0d1b7c761a 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -391,7 +391,14 @@ config LPC_SCH
help
LPC bridge function of the Intel SCH provides support for
System Management Bus and General Purpose I/O.
-source "drivers/mfd/glamo/Kconfig"
+
+config MFD_GLAMO
+ bool "Smedia Glamo 336x/337x support"
+ select MFD_CORE
+ help
+ This enables the core driver for the Smedia Glamo 336x/337x
+ multi-function device. It includes irq_chip demultiplex as
+ well as clock / power management and GPIO support.
endmenu
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 86481d20c20..da7a930bbd7 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -7,7 +7,7 @@ obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
obj-$(CONFIG_MFD_SM501) += sm501.o
obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o
-obj-$(CONFIG_MFD_GLAMO) += glamo/
+obj-$(CONFIG_MFD_GLAMO) += glamo-core.o
obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o
obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo-core.c
index 3cb48b28570..135856af1ee 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo-core.c
@@ -36,14 +36,13 @@
#include <linux/spinlock.h>
#include <linux/mfd/core.h>
#include <linux/mfd/glamo.h>
+#include <linux/mfd/glamo-regs.h>
+#include <linux/mfd/glamo-core.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/pm.h>
-#include "glamo-regs.h"
-#include "glamo-core.h"
-
#define GLAMO_MEM_REFRESH_COUNT 0x100
#define GLAMO_NR_IRQS 9
@@ -91,14 +90,14 @@ static const struct reg_range reg_range[] = {
/* { 0x0500, 0x300, "ISP", 0 }, */
/* { 0x0800, 0x400, "JPEG", 0 }, */
/* { 0x0c00, 0xcc, "MPEG", 0 }, */
- { 0x1100, 0xb2, "LCD 1", 1 },
- { 0x1200, 0x64, "LCD 2", 1 },
- { 0x1400, 0x42, "MMC", 1 },
+ { 0x1100, 0xb2, "LCD 1", 0 },
+ { 0x1200, 0x64, "LCD 2", 0 },
+ { 0x1400, 0x42, "MMC", 0 },
/* { 0x1500, 0x080, "MPU 0", 0 },
{ 0x1580, 0x080, "MPU 1", 0 },
{ 0x1600, 0x080, "Cmd Queue", 0 },
{ 0x1680, 0x080, "RISC CPU", 0 },*/
- { 0x1700, 0x400, "2D Unit", 1 },
+ { 0x1700, 0x400, "2D Unit", 0 },
/* { 0x1b00, 0x900, "3D Unit", 0 }, */
};
diff --git a/drivers/mfd/glamo/Kconfig b/drivers/mfd/glamo/Kconfig
deleted file mode 100644
index 3aa4831a4ff..00000000000
--- a/drivers/mfd/glamo/Kconfig
+++ /dev/null
@@ -1,42 +0,0 @@
-config MFD_GLAMO
- bool "Smedia Glamo 336x/337x support"
- select MFD_CORE
- help
- This enables the core driver for the Smedia Glamo 336x/337x
- multi-function device. It includes irq_chip demultiplex as
- well as clock / power management and GPIO support.
-
-config MFD_GLAMO_FB
- tristate "Smedia Glamo 336x/337x framebuffer support"
- depends on FB && MFD_GLAMO
- select FB_CFB_FILLRECT
- select FB_CFB_COPYAREA
- select FB_CFB_IMAGEBLIT
- help
- Frame buffer driver for the LCD controller in the Smedia Glamo
- 336x/337x.
-
- This driver is also available as a module ( = code which can be
- inserted and removed from the running kernel whenever you want). The
- module will be called glamofb. If you want to compile it as a module,
- say M here and read <file:Documentation/modules.txt>.
-
- If unsure, say N.
-
-config MFD_GLAMO_GPIO
- tristate "Glamo GPIO support"
- depends on MFD_GLAMO
-
- help
- Enable a bitbanging SPI adapter driver for the Smedia Glamo.
-
-config MFD_GLAMO_MCI
- tristate "Glamo S3C SD/MMC Card Interface support"
- depends on MFD_GLAMO && MMC && REGULATOR
- select CRC7
- help
- This selects a driver for the MCI interface found in
- the S-Media GLAMO chip, as used in Openmoko
- neo1973 GTA-02.
-
- If unsure, say N.
diff --git a/drivers/mfd/glamo/Makefile b/drivers/mfd/glamo/Makefile
deleted file mode 100644
index ebf26f7e473..00000000000
--- a/drivers/mfd/glamo/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the Smedia Glamo framebuffer driver
-#
-
-obj-$(CONFIG_MFD_GLAMO) += glamo-core.o
-obj-$(CONFIG_MFD_GLAMO_GPIO) += glamo-gpio.o
-obj-$(CONFIG_MFD_GLAMO_SPI) += glamo-spi.o
-
-obj-$(CONFIG_MFD_GLAMO_FB) += glamo-fb.o
-obj-$(CONFIG_MFD_GLAMO_MCI) += glamo-mci.o
-
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 2e13b94769f..2b46c1ffb4b 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -353,6 +353,17 @@ config MMC_S3C_PIODMA
endchoice
+config MMC_GLAMO
+ tristate "Glamo S3C SD/MMC Card Interface support"
+ depends on MFD_GLAMO && MMC && REGULATOR
+ select CRC7
+ help
+ This selects a driver for the MCI interface found in
+ the S-Media GLAMO chip, as used in Openmoko
+ neo1973 GTA-02.
+
+ If unsure, say N.
+
config MMC_SDRICOH_CS
tristate "MMC/SD driver for Ricoh Bay1Controllers (EXPERIMENTAL)"
depends on EXPERIMENTAL && PCI && PCMCIA
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index f4803977dfc..e82e21d4e5b 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -29,6 +29,7 @@ ifeq ($(CONFIG_OF),y)
obj-$(CONFIG_MMC_SPI) += of_mmc_spi.o
endif
obj-$(CONFIG_MMC_S3C) += s3cmci.o
+obj-$(CONFIG_MMC_GLAMO) += glamo-mci.o
obj-$(CONFIG_MMC_SDRICOH_CS) += sdricoh_cs.o
obj-$(CONFIG_MMC_TMIO) += tmio_mmc.o
obj-$(CONFIG_MMC_CB710) += cb710-mmc.o
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mmc/host/glamo-mci.c
index 4c372e0f459..b2442c22b1a 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mmc/host/glamo-mci.c
@@ -26,9 +26,8 @@
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/mfd/glamo.h>
-
-#include "glamo-core.h"
-#include "glamo-regs.h"
+#include <linux/mfd/glamo-core.h>
+#include <linux/mfd/glamo-regs.h>
struct glamo_mci_host {
struct glamo_mmc_platform_data *pdata;
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6e16244f3ed..421ab624a51 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2214,6 +2214,23 @@ config FB_BROADSHEET
and could also have been called by other names when coupled with
a bridge adapter.
+config FB_GLAMO
+ tristate "Smedia Glamo 336x/337x framebuffer support"
+ depends on FB && MFD_GLAMO
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+ help
+ Frame buffer driver for the LCD controller in the Smedia Glamo
+ 336x/337x.
+
+ This driver is also available as a module ( = code which can be
+ inserted and removed from the running kernel whenever you want). The
+ module will be called glamofb. If you want to compile it as a module,
+ say M here and read <file:Documentation/modules.txt>.
+
+ If unsure, say N.
+
source "drivers/video/omap/Kconfig"
source "drivers/video/omap2/Kconfig"
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index ddc2af2ba45..90d949ba7de 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -131,6 +131,7 @@ obj-$(CONFIG_FB_CARMINE) += carminefb.o
obj-$(CONFIG_FB_MB862XX) += mb862xx/
obj-$(CONFIG_FB_MSM) += msm/
obj-$(CONFIG_FB_NUC900) += nuc900fb.o
+obj-$(CONFIG_FB_GLAMO) += glamo-fb.o
# Platform or fallback drivers go here
obj-$(CONFIG_FB_UVESA) += uvesafb.o
diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/video/glamo-fb.c
index 29c16f019aa..c74ea733a8c 100644
--- a/drivers/mfd/glamo/glamo-fb.c
+++ b/drivers/video/glamo-fb.c
@@ -32,6 +32,8 @@
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/mfd/glamo.h>
+#include <linux/mfd/glamo-core.h>
+#include <linux/mfd/glamo-regs.h>
#include <asm/div64.h>
@@ -41,9 +43,6 @@
#include <linux/glamofb.h>
-#include "glamo-regs.h"
-#include "glamo-core.h"
-
static void glamofb_program_mode(struct glamofb_handle *glamo);
struct glamofb_handle {
@@ -135,7 +134,7 @@ static struct glamo_script glamo_regs[] = {
* 01 00 0 100 0 000 01 0 0 */
/* The following values assume 640*480@16bpp */
{ GLAMO_REG_LCD_A_BASE1, 0x0000 }, /* display A base address 15:0 */
- { GLAMO_REG_LCD_A_BASE2, 0x0000 }, /* display A base address 22:16 */
+ { GLAMO_REG_LCD_A_BASE2, 0x4000 }, /* display A base address 22:16 */
{ GLAMO_REG_LCD_CURSOR_BASE1, 0xC000 }, /* cursor base address 15:0 */
{ GLAMO_REG_LCD_CURSOR_BASE2, 0x0012 }, /* cursor base address 22:16 */
{ GLAMO_REG_LCD_COMMAND2, 0x0000 }, /* display page A */
@@ -241,7 +240,7 @@ static void reg_set_bit_mask(struct glamofb_handle *glamo,
#define GLAMO_LCD_HV_RETR_DISP_START_MASK 0x03FF
#define GLAMO_LCD_HV_RETR_DISP_END_MASK 0x03FF
-/* the caller has to enxure lock_cmd is held and we are in cmd mode */
+/* the caller has to ensure lock_cmd is held and we are in cmd mode */
static void __rotate_lcd(struct glamofb_handle *glamo, __u32 rotation)
{
int glamo_rot;
@@ -895,7 +894,10 @@ static int glamofb_remove(struct platform_device *pdev)
struct glamofb_handle *glamofb = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
+ iounmap(glamofb->fb->screen_base);
iounmap(glamofb->base);
+ release_mem_region(glamofb->fb_res->start,
+ resource_size(glamofb->fb_res));
release_mem_region(glamofb->reg->start, resource_size(glamofb->reg));
framebuffer_release(glamofb->fb);
diff --git a/drivers/mfd/glamo/glamo-core.h b/include/linux/mfd/glamo-core.h
index 17017b03fb5..34ec7c4cdf4 100644
--- a/drivers/mfd/glamo/glamo-core.h
+++ b/include/linux/mfd/glamo-core.h
@@ -17,20 +17,19 @@
#define GLAMO_FB_SIZE (GLAMO_INTERNAL_RAM_SIZE - GLAMO_MMC_BUFFER_SIZE)
enum glamo_pll {
- GLAMO_PLL1,
- GLAMO_PLL2,
+ GLAMO_PLL1,
+ GLAMO_PLL2,
};
enum glamo_engine_state {
- GLAMO_ENGINE_DISABLED,
- GLAMO_ENGINE_SUSPENDED,
- GLAMO_ENGINE_ENABLED,
+ GLAMO_ENGINE_DISABLED,
+ GLAMO_ENGINE_SUSPENDED,
+ GLAMO_ENGINE_ENABLED,
};
struct glamo_core {
int irq;
int irq_base;
- int irq_works; /* 0 means PCB does not support Glamo IRQ */
struct resource *mem;
void __iomem *base;
struct platform_device *pdev;
diff --git a/drivers/mfd/glamo/glamo-regs.h b/include/linux/mfd/glamo-regs.h
index 59848e1122e..59848e1122e 100644
--- a/drivers/mfd/glamo/glamo-regs.h
+++ b/include/linux/mfd/glamo-regs.h