1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-07-15 22:08:39 +00:00

BSP: rename beagleboard to TI

linux-omap 2.6.37rc: sync with OE
This commit is contained in:
Koen Kooi
2011-01-02 16:45:43 +01:00
commit 7d39ce1743
256 changed files with 215790 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# We have a conf and classes directory, prepend to BBPATH
BBPATH := "${LAYERDIR}:${BBPATH}"
# We have a recipes directory, add to BBFILES
BBFILES := "${BBFILES} ${LAYERDIR}/recipes*/*/*.bb \
${LAYERDIR}/recipes*/*/*.bbappend"
BBFILE_COLLECTIONS += "beagle-bsp"
BBFILE_PATTERN_beagle-bsp := "^${LAYERDIR}/"
BBFILE_PRIORITY_beagle-bsp = "10"
+44
View File
@@ -0,0 +1,44 @@
#@TYPE: Machine
#@NAME: Beagleboard machine
#@DESCRIPTION: Machine configuration for the http://beagleboard.org/ board
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
XSERVER = "xserver-xorg \
xf86-input-evdev \
xf86-input-mouse \
xf86-video-omapfb \
xf86-input-keyboard"
# Only has DVI connector for external screen
GUI_MACHINE_CLASS = "bigscreen"
require conf/machine/include/omap3.inc
PREFERRED_PROVIDER_virtual/kernel = "linux-omap-psp"
IMAGE_FSTYPES += "tar.bz2 ubi"
EXTRA_IMAGECMD_jffs2 = "-lnp "
# Guesswork
SERIAL_CONSOLE = "115200 ttyS2"
UBOOT_MACHINE = "omap3_beagle_config"
# do ubiattach /dev/ubi_ctrl -m 4
# From dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: logical eraseblock size: 129024 bytes
# from ubiattach stdout:
# UBI device number 0, total 1996 LEBs
MKUBIFS_ARGS = "-m 2048 -e 129024 -c 1996"
# do ubiattach /dev/ubi_ctrl -m 4
# from dmesg:
# UBI: smallest flash I/O unit: 2048
# UBI: physical eraseblock size: 131072 bytes (128 KiB)
# UBI: sub-page size: 512
UBINIZE_ARGS = "-m 2048 -p 128KiB -s 512"
# and sdio
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"
@@ -0,0 +1,55 @@
From 71b7d633e566195b065e09e97164bec046ca7b6d Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Thu, 7 Oct 2010 09:25:45 +0200
Subject: [PATCH 01/29] ARM: OMAP: Power on EHCI, serial, camera and DVI on beagleboard-xM
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/mach-omap2/board-omap3beagle.c | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 6c12760..6e8a1b9 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -297,13 +297,35 @@ static int beagle_twl_gpio_setup(struct device *dev,
gpio_request(gpio + 1, "EHCI_nOC");
gpio_direction_input(gpio + 1);
- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+ /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
+ * high / others active low) */
gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+ else
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+
+ /* DVI reset GPIO is different between revisions */
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+ beagle_dvi_device.reset_gpio = 129;
+ else
+ beagle_dvi_device.reset_gpio = 170;
+
+ /* Power on DVI, Serial and PWR led */
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+ gpio_request(gpio + 1, "nDVI_PWR_EN");
+ gpio_direction_output(gpio + 1, 0);
+ }
/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+ /* Power on camera interface on P7/P8 or DVI on A2 and beyond */
+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+ gpio_request(gpio + 2, "CAM_EN");
+ gpio_direction_output(gpio + 2, 1);
+ }
+
return 0;
}
--
1.6.6.1
@@ -0,0 +1,43 @@
From 60e119550f5a782c512c19d86a08313ae2ffa876 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Tue, 9 Nov 2010 08:34:55 -0600
Subject: [PATCH 02/29] omap: Beagle: detect new xM revision B
The xM B uses a DM3730 ES1.1 over the ES1.0 on xM A's, no other board changes.
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/mach-omap2/board-omap3beagle.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 6e8a1b9..be8c4ec 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -58,7 +58,8 @@
* AXBX = GPIO173, GPIO172, GPIO171: 1 1 1
* C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0
* C4 = GPIO173, GPIO172, GPIO171: 1 0 1
- * XM = GPIO173, GPIO172, GPIO171: 0 0 0
+ * XMA = GPIO173, GPIO172, GPIO171: 0 0 0
+ * XMB = GPIO173, GPIO172, GPIO171: 0 0 1
*/
enum {
OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -117,7 +118,11 @@ static void __init omap3_beagle_init_rev(void)
omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
break;
case 0:
- printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM A\n");
+ omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
+ break;
+ case 1:
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
break;
default:
--
1.6.6.1
@@ -0,0 +1,219 @@
From 72657e1ec88da91b772c7158c4c987b29d274ece Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Wed, 6 Oct 2010 10:19:34 +0200
Subject: [PATCH 03/29] ARM: OMAP: beagleboard: Add infrastructure to do fixups based on expansionboard name passed by u-boot
Add support for Tincantools Zippy and Zippy2 expansionboards as well
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/mach-omap2/board-omap3beagle.c | 142 ++++++++++++++++++++++++++++++-
1 files changed, 139 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index be8c4ec..495be15 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/leds.h>
#include <linux/gpio.h>
+#include <linux/irq.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
@@ -143,6 +144,92 @@ fail0:
return;
}
+char expansionboard_name[16];
+
+#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
+
+#include <plat/mcspi.h>
+#include <linux/spi/spi.h>
+
+#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
+
+static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = {
+ {
+ .modalias = "enc28j60",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 20000000,
+ .controller_data = &enc28j60_spi_chip_info,
+ },
+};
+
+static void __init omap3beagle_enc28j60_init(void)
+{
+ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
+ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
+ omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
+ set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
+ } else {
+ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
+ return;
+ }
+
+ spi_register_board_info(omap3beagle_zippy_spi_board_info,
+ ARRAY_SIZE(omap3beagle_zippy_spi_board_info));
+}
+
+#else
+static inline void __init omap3beagle_enc28j60_init(void) { return; }
+#endif
+
+#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
+
+#include <plat/mcspi.h>
+#include <linux/spi/spi.h>
+
+#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157
+
+static struct omap2_mcspi_device_config ks8851_spi_chip_info = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = {
+ {
+ .modalias = "ks8851",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 36000000,
+ .controller_data = &ks8851_spi_chip_info,
+ },
+};
+
+static void __init omap3beagle_ks8851_init(void)
+{
+ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) &&
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) {
+ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0);
+ omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ);
+ set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
+ } else {
+ printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n");
+ return;
+ }
+
+ spi_register_board_info(omap3beagle_zippy2_spi_board_info,
+ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info));
+}
+
+#else
+static inline void __init omap3beagle_ks8851_init(void) { return; }
+#endif
+
static struct mtd_partition omap3beagle_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
@@ -262,6 +349,12 @@ static struct omap2_hsmmc_info mmc[] = {
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
.gpio_wp = 29,
},
+ {
+ .mmc = 2,
+ .caps = MMC_CAP_4_BIT_DATA,
+ .transceiver = true,
+ .ocr_mask = 0x00100000, /* 3.3V */
+ },
{} /* Terminator */
};
@@ -431,7 +524,7 @@ static struct twl4030_platform_data beagle_twldata = {
.vpll2 = &beagle_vpll2,
};
-static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
@@ -446,10 +539,24 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
},
};
+#if defined(CONFIG_RTC_DRV_DS1307) || \
+ defined(CONFIG_RTC_DRV_DS1307_MODULE)
+
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("ds1307", 0x68),
+ },
+};
+#else
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+#endif
+
static int __init omap3_beagle_i2c_init(void)
{
- omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
- ARRAY_SIZE(beagle_i2c_boardinfo));
+ omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
+ ARRAY_SIZE(beagle_i2c1_boardinfo));
+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_i2c2_boardinfo));
/* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
@@ -583,6 +690,15 @@ static struct omap_musb_board_data musb_board_data = {
.power = 100,
};
+static int __init expansionboard_setup(char *str)
+{
+ if (!str)
+ return -EINVAL;
+ strncpy(expansionboard_name, str, 16);
+ printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name);
+ return 0;
+}
+
static void __init omap3_beagle_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -597,6 +713,24 @@ static void __init omap3_beagle_init(void)
/* REVISIT leave DVI powered down until it's needed ... */
gpio_direction_output(170, true);
+ if(!strcmp(expansionboard_name, "zippy"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n");
+ omap3beagle_enc28j60_init();
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
+ mmc[1].gpio_wp = 141;
+ mmc[1].gpio_cd = 162;
+ }
+
+ if(!strcmp(expansionboard_name, "zippy2"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n");
+ omap3beagle_ks8851_init();
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
+ mmc[1].gpio_wp = 141;
+ mmc[1].gpio_cd = 162;
+ }
+
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
@@ -608,6 +742,8 @@ static void __init omap3_beagle_init(void)
beagle_display_init();
}
+early_param("buddy", expansionboard_setup);
+
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
.boot_params = 0x80000100,
--
1.6.6.1
@@ -0,0 +1,57 @@
From 6f80e6f5205a429951244e690952f192b78d15a8 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sun, 5 Dec 2010 13:25:00 +0100
Subject: [PATCH 04/29] ARM: OMAP: beagleboard: pre-export GPIOs to userspace when using a Tincantools trainerboard
This really needs a for loop, patches welcome
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/mach-omap2/board-omap3beagle.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 495be15..34f2132 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -731,6 +731,37 @@ static void __init omap3_beagle_init(void)
mmc[1].gpio_cd = 162;
}
+ if(!strcmp(expansionboard_name, "trainer"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n");
+ gpio_request(130, "sysfs");
+ gpio_export(130, 1);
+ gpio_request(131, "sysfs");
+ gpio_export(131, 1);
+ gpio_request(132, "sysfs");
+ gpio_export(132, 1);
+ gpio_request(133, "sysfs");
+ gpio_export(133, 1);
+ gpio_request(134, "sysfs");
+ gpio_export(134, 1);
+ gpio_request(135, "sysfs");
+ gpio_export(135, 1);
+ gpio_request(136, "sysfs");
+ gpio_export(136, 1);
+ gpio_request(137, "sysfs");
+ gpio_export(137, 1);
+ gpio_request(138, "sysfs");
+ gpio_export(138, 1);
+ gpio_request(139, "sysfs");
+ gpio_export(139, 1);
+ gpio_request(140, "sysfs");
+ gpio_export(140, 1);
+ gpio_request(141, "sysfs");
+ gpio_export(141, 1);
+ gpio_request(162, "sysfs");
+ gpio_export(162, 1);
+ }
+
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
--
1.6.6.1
@@ -0,0 +1,28 @@
From ea2b3d705162f8a1622e60da27b2b5b31ad3abe7 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 8 Mar 2010 14:38:31 +0100
Subject: [PATCH 05/29] modedb.c: add proper 720p60 mode
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
drivers/video/modedb.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index de450c1..1cd8153 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -46,6 +46,10 @@ static const struct fb_videomode modedb[] = {
NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
0, FB_VMODE_NONINTERLACED
}, {
+ /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */
+ "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5,
+ 0, FB_VMODE_NONINTERLACED
+ }, {
/* 800x600 @ 56 Hz, 35.15 kHz hsync */
NULL, 56, 800, 600, 27777, 128, 24, 22, 1, 72, 2,
0, FB_VMODE_NONINTERLACED
--
1.6.6.1
@@ -0,0 +1,28 @@
From 2036f80d16c1df22b00953f4d2e2457eef00a82d Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 4 Jan 2010 19:20:25 -0800
Subject: [PATCH 06/29] mmc: don't display single block read console messages
mmc: don't display single block read console messages
---
drivers/mmc/card/block.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 217f820..b0b68cc 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -434,8 +434,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
if (brq.cmd.error || brq.data.error || brq.stop.error) {
if (brq.data.blocks > 1 && rq_data_dir(req) == READ) {
/* Redo read one sector at a time */
- printk(KERN_WARNING "%s: retrying using single "
- "block read\n", req->rq_disk->disk_name);
+ /* printk(KERN_WARNING "%s: retrying using single "
+ "block read\n", req->rq_disk->disk_name); */
disable_multi = 1;
continue;
}
--
1.6.6.1
@@ -0,0 +1,63 @@
From 793eb265af99817165bc03ae96adaaf6e4860dca Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 26 Apr 2010 11:17:26 -0700
Subject: [PATCH 07/29] MTD: silence ecc errors on mtdblock0
mtdblock0 is the x-load partition, which uses hw ecc
this confuses linux, which uses sw ecc
this patch silences ecc error messages when linux peeks into mtdblock0
* not for upstream submission *
---
block/blk-core.c | 7 ++++---
drivers/mtd/nand/nand_ecc.c | 2 +-
fs/buffer.c | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 4ce953f..1ef9a01 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2028,9 +2028,10 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
if (error && req->cmd_type == REQ_TYPE_FS &&
!(req->cmd_flags & REQ_QUIET)) {
- printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
- req->rq_disk ? req->rq_disk->disk_name : "?",
- (unsigned long long)blk_rq_pos(req));
+ if (req->rq_disk && (strcmp(req->rq_disk->disk_name, "mtdblock0") != 0))
+ printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
+ req->rq_disk ? req->rq_disk->disk_name : "?",
+ (unsigned long long)blk_rq_pos(req));
}
blk_account_io_completion(req, nr_bytes);
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index 271b8e7..5924ba7 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -507,7 +507,7 @@ int __nand_correct_data(unsigned char *buf,
if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1)
return 1; /* error in ecc data; no action needed */
- printk(KERN_ERR "uncorrectable error : ");
+// printk(KERN_ERR "uncorrectable error : ");
return -1;
}
EXPORT_SYMBOL(__nand_correct_data);
diff --git a/fs/buffer.c b/fs/buffer.c
index 5930e38..06a00d5 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -114,7 +114,8 @@ static int quiet_error(struct buffer_head *bh)
static void buffer_io_error(struct buffer_head *bh)
{
char b[BDEVNAME_SIZE];
- printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
+ if (strcmp(bdevname(bh->b_bdev, b), "mtdblock0") != 0)
+ printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
bdevname(bh->b_bdev, b),
(unsigned long long)bh->b_blocknr);
}
--
1.6.6.1
@@ -0,0 +1,504 @@
From 31949867bace7945acd3ec10c822e6988613aed7 Mon Sep 17 00:00:00 2001
From: Mike Galbraith <efault@gmx.de>
Date: Fri, 19 Nov 2010 12:52:42 +0100
Subject: [PATCH 08/29] Miracle patch
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On Sun, 2010-11-14 at 16:26 -0800, Linus Torvalds wrote:
> On Sun, Nov 14, 2010 at 4:15 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > THAT is why I think it's so silly to try to be so strict and walk over
> > all processes while holding a couple of spinlocks.
>
> Btw, let me say that I think the patch is great even with that thing
> in. It looks clean, the thing I'm complaining about is not a big deal,
> and it seems to perform very much as advertized. The difference with
> autogroup scheduling is very noticeable with a simple "make -j64"
> kernel compile.
>
> So I really don't think it's a big deal. The sysctl handler isn't even
> complicated. But boy does it hurt my eyes to see a spinlock held
> around a "do_each_thread()". And I do get the feeling that the
> simplest way to fix it would be to just remove the code entirely, and
> just say that "enabling/disabling may be delayed for old processes
> with existing autogroups".
Which is what I just did. If the oddball case isn't a big deal, the
patch shrinks, which is a good thing. I just wanted to cover all bases.
Patchlet with handler whacked:
A recurring complaint from CFS users is that parallel kbuild has a negative
impact on desktop interactivity. This patch implements an idea from Linus,
to automatically create task groups. This patch only implements Linus' per
tty task group suggestion, and only for fair class tasks, but leaves the way
open for enhancement.
Implementation: each task's signal struct contains an inherited pointer to a
refcounted autogroup struct containing a task group pointer, the default for
all tasks pointing to the init_task_group. When a task calls __proc_set_tty(),
the process wide reference to the default group is dropped, a new task group is
created, and the process is moved into the new task group. Children thereafter
inherit this task group, and increase it's refcount. On exit, a reference to the
current task group is dropped when the last reference to each signal struct is
dropped. The task group is destroyed when the last signal struct referencing
it is freed. At runqueue selection time, IFF a task has no cgroup assignment,
it's current autogroup is used.
The feature is enabled from boot by default if CONFIG_SCHED_AUTOGROUP is
selected, but can be disabled via the boot option noautogroup, and can be
also be turned on/off on the fly via..
echo [01] > /proc/sys/kernel/sched_autogroup_enabled.
..which will automatically move tasks to/from the root task group.
Some numbers.
A 100% hog overhead measurement proggy pinned to the same CPU as a make -j10
About measurement proggy:
pert/sec = perturbations/sec
min/max/avg = scheduler service latencies in usecs
sum/s = time accrued by the competition per sample period (1 sec here)
overhead = %CPU received by the competition per sample period
pert/s: 31 >40475.37us: 3 min: 0.37 max:48103.60 avg:29573.74 sum/s:916786us overhead:90.24%
pert/s: 23 >41237.70us: 12 min: 0.36 max:56010.39 avg:40187.01 sum/s:924301us overhead:91.99%
pert/s: 24 >42150.22us: 12 min: 8.86 max:61265.91 avg:39459.91 sum/s:947038us overhead:92.20%
pert/s: 26 >42344.91us: 11 min: 3.83 max:52029.60 avg:36164.70 sum/s:940282us overhead:91.12%
pert/s: 24 >44262.90us: 14 min: 5.05 max:82735.15 avg:40314.33 sum/s:967544us overhead:92.22%
Same load with this patch applied.
pert/s: 229 >5484.43us: 41 min: 0.15 max:12069.42 avg:2193.81 sum/s:502382us overhead:50.24%
pert/s: 222 >5652.28us: 43 min: 0.46 max:12077.31 avg:2248.56 sum/s:499181us overhead:49.92%
pert/s: 211 >5809.38us: 43 min: 0.16 max:12064.78 avg:2381.70 sum/s:502538us overhead:50.25%
pert/s: 223 >6147.92us: 43 min: 0.15 max:16107.46 avg:2282.17 sum/s:508925us overhead:50.49%
pert/s: 218 >6252.64us: 43 min: 0.16 max:12066.13 avg:2324.11 sum/s:506656us overhead:50.27%
Average service latency is an order of magnitude better with autogroup.
(Imagine that pert were Xorg or whatnot instead)
Using Mathieu Desnoyers' wakeup-latency testcase:
With taskset -c 3 make -j 10 running..
taskset -c 3 ./wakeup-latency& sleep 30;killall wakeup-latency
without:
maximum latency: 42963.2 µs
average latency: 9077.0 µs
missed timer events: 0
with:
maximum latency: 4160.7 µs
average latency: 149.4 µs
missed timer events: 0
Signed-off-by: Mike Galbraith <efault@gmx.de>
---
Documentation/kernel-parameters.txt | 2 +
drivers/tty/tty_io.c | 1 +
include/linux/sched.h | 19 +++++
init/Kconfig | 12 +++
kernel/fork.c | 5 +-
kernel/sched.c | 25 ++++--
kernel/sched_autogroup.c | 140 +++++++++++++++++++++++++++++++++++
kernel/sched_autogroup.h | 18 +++++
kernel/sysctl.c | 11 +++
9 files changed, 224 insertions(+), 9 deletions(-)
create mode 100644 kernel/sched_autogroup.c
create mode 100644 kernel/sched_autogroup.h
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 8b61c93..9408728 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1622,6 +1622,8 @@ and is between 256 and 4096 characters. It is defined in the file
noapic [SMP,APIC] Tells the kernel to not make use of any
IOAPICs that may be present in the system.
+ noautogroup Disable scheduler automatic task group creation.
+
nobats [PPC] Do not use BATs for mapping kernel lowmem
on "Classic" PPC cores.
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 35480dd..1849f4a 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3169,6 +3169,7 @@ static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty)
put_pid(tsk->signal->tty_old_pgrp);
tsk->signal->tty = tty_kref_get(tty);
tsk->signal->tty_old_pgrp = NULL;
+ sched_autogroup_create_attach(tsk);
}
static void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2238745..3a775e3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -509,6 +509,8 @@ struct thread_group_cputimer {
spinlock_t lock;
};
+struct autogroup;
+
/*
* NOTE! "signal_struct" does not have it's own
* locking, because a shared signal_struct always
@@ -576,6 +578,9 @@ struct signal_struct {
struct tty_struct *tty; /* NULL if no tty */
+#ifdef CONFIG_SCHED_AUTOGROUP
+ struct autogroup *autogroup;
+#endif
/*
* Cumulative resource counters for dead threads in the group,
* and for reaped dead child processes forked by this group.
@@ -1931,6 +1936,20 @@ int sched_rt_handler(struct ctl_table *table, int write,
extern unsigned int sysctl_sched_compat_yield;
+#ifdef CONFIG_SCHED_AUTOGROUP
+extern unsigned int sysctl_sched_autogroup_enabled;
+
+extern void sched_autogroup_create_attach(struct task_struct *p);
+extern void sched_autogroup_detach(struct task_struct *p);
+extern void sched_autogroup_fork(struct signal_struct *sig);
+extern void sched_autogroup_exit(struct signal_struct *sig);
+#else
+static inline void sched_autogroup_create_attach(struct task_struct *p) { }
+static inline void sched_autogroup_detach(struct task_struct *p) { }
+static inline void sched_autogroup_fork(struct signal_struct *sig) { }
+static inline void sched_autogroup_exit(struct signal_struct *sig) { }
+#endif
+
#ifdef CONFIG_RT_MUTEXES
extern int rt_mutex_getprio(struct task_struct *p);
extern void rt_mutex_setprio(struct task_struct *p, int prio);
diff --git a/init/Kconfig b/init/Kconfig
index c972899..a4985d9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -741,6 +741,18 @@ config NET_NS
endif # NAMESPACES
+config SCHED_AUTOGROUP
+ bool "Automatic process group scheduling"
+ select CGROUPS
+ select CGROUP_SCHED
+ select FAIR_GROUP_SCHED
+ help
+ This option optimizes the scheduler for common desktop workloads by
+ automatically creating and populating task groups. This separation
+ of workloads isolates aggressive CPU burners (like build jobs) from
+ desktop applications. Task group autogeneration is currently based
+ upon task tty association.
+
config MM_OWNER
bool
diff --git a/kernel/fork.c b/kernel/fork.c
index 5447dc7..70ea75f 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -174,8 +174,10 @@ static inline void free_signal_struct(struct signal_struct *sig)
static inline void put_signal_struct(struct signal_struct *sig)
{
- if (atomic_dec_and_test(&sig->sigcnt))
+ if (atomic_dec_and_test(&sig->sigcnt)) {
+ sched_autogroup_exit(sig);
free_signal_struct(sig);
+ }
}
void __put_task_struct(struct task_struct *tsk)
@@ -905,6 +907,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
posix_cpu_timers_init_group(sig);
tty_audit_fork(sig);
+ sched_autogroup_fork(sig);
sig->oom_adj = current->signal->oom_adj;
sig->oom_score_adj = current->signal->oom_score_adj;
diff --git a/kernel/sched.c b/kernel/sched.c
index 297d1a0..53ff9a1 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -78,6 +78,7 @@
#include "sched_cpupri.h"
#include "workqueue_sched.h"
+#include "sched_autogroup.h"
#define CREATE_TRACE_POINTS
#include <trace/events/sched.h>
@@ -605,11 +606,14 @@ static inline int cpu_of(struct rq *rq)
*/
static inline struct task_group *task_group(struct task_struct *p)
{
+ struct task_group *tg;
struct cgroup_subsys_state *css;
css = task_subsys_state_check(p, cpu_cgroup_subsys_id,
lockdep_is_held(&task_rq(p)->lock));
- return container_of(css, struct task_group, css);
+ tg = container_of(css, struct task_group, css);
+
+ return autogroup_task_group(p, tg);
}
/* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
@@ -2063,6 +2067,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta)
#include "sched_idletask.c"
#include "sched_fair.c"
#include "sched_rt.c"
+#include "sched_autogroup.c"
#include "sched_stoptask.c"
#ifdef CONFIG_SCHED_DEBUG
# include "sched_debug.c"
@@ -8164,7 +8169,7 @@ void __init sched_init(void)
#ifdef CONFIG_CGROUP_SCHED
list_add(&init_task_group.list, &task_groups);
INIT_LIST_HEAD(&init_task_group.children);
-
+ autogroup_init(&init_task);
#endif /* CONFIG_CGROUP_SCHED */
#if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP
@@ -8694,15 +8699,11 @@ void sched_destroy_group(struct task_group *tg)
/* change task's runqueue when it moves between groups.
* The caller of this function should have put the task in its new group
* by now. This function just updates tsk->se.cfs_rq and tsk->se.parent to
- * reflect its new group.
+ * reflect its new group. Called with the runqueue lock held.
*/
-void sched_move_task(struct task_struct *tsk)
+void __sched_move_task(struct task_struct *tsk, struct rq *rq)
{
int on_rq, running;
- unsigned long flags;
- struct rq *rq;
-
- rq = task_rq_lock(tsk, &flags);
running = task_current(rq, tsk);
on_rq = tsk->se.on_rq;
@@ -8723,7 +8724,15 @@ void sched_move_task(struct task_struct *tsk)
tsk->sched_class->set_curr_task(rq);
if (on_rq)
enqueue_task(rq, tsk, 0);
+}
+void sched_move_task(struct task_struct *tsk)
+{
+ struct rq *rq;
+ unsigned long flags;
+
+ rq = task_rq_lock(tsk, &flags);
+ __sched_move_task(tsk, rq);
task_rq_unlock(rq, &flags);
}
#endif /* CONFIG_CGROUP_SCHED */
diff --git a/kernel/sched_autogroup.c b/kernel/sched_autogroup.c
new file mode 100644
index 0000000..62f1d0e
--- /dev/null
+++ b/kernel/sched_autogroup.c
@@ -0,0 +1,140 @@
+#ifdef CONFIG_SCHED_AUTOGROUP
+
+unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
+
+struct autogroup {
+ struct kref kref;
+ struct task_group *tg;
+};
+
+static struct autogroup autogroup_default;
+
+static void autogroup_init(struct task_struct *init_task)
+{
+ autogroup_default.tg = &init_task_group;
+ kref_init(&autogroup_default.kref);
+ init_task->signal->autogroup = &autogroup_default;
+}
+
+static inline void autogroup_destroy(struct kref *kref)
+{
+ struct autogroup *ag = container_of(kref, struct autogroup, kref);
+ struct task_group *tg = ag->tg;
+
+ kfree(ag);
+ sched_destroy_group(tg);
+}
+
+static inline void autogroup_kref_put(struct autogroup *ag)
+{
+ kref_put(&ag->kref, autogroup_destroy);
+}
+
+static inline struct autogroup *autogroup_kref_get(struct autogroup *ag)
+{
+ kref_get(&ag->kref);
+ return ag;
+}
+
+static inline struct autogroup *autogroup_create(void)
+{
+ struct autogroup *ag = kmalloc(sizeof(*ag), GFP_KERNEL);
+
+ if (!ag)
+ goto out_fail;
+
+ ag->tg = sched_create_group(&init_task_group);
+ kref_init(&ag->kref);
+
+ if (!(IS_ERR(ag->tg)))
+ return ag;
+
+out_fail:
+ if (ag) {
+ kfree(ag);
+ WARN_ON(1);
+ } else
+ WARN_ON(1);
+
+ return autogroup_kref_get(&autogroup_default);
+}
+
+static inline struct task_group *
+autogroup_task_group(struct task_struct *p, struct task_group *tg)
+{
+ int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);
+
+ enabled &= (tg == &root_task_group);
+ enabled &= (p->sched_class == &fair_sched_class);
+ enabled &= (!(p->flags & PF_EXITING));
+
+ if (enabled)
+ return p->signal->autogroup->tg;
+
+ return tg;
+}
+
+static void
+autogroup_move_group(struct task_struct *p, struct autogroup *ag)
+{
+ struct autogroup *prev;
+ struct task_struct *t;
+ struct rq *rq;
+ unsigned long flags;
+
+ rq = task_rq_lock(p, &flags);
+ prev = p->signal->autogroup;
+ if (prev == ag) {
+ task_rq_unlock(rq, &flags);
+ return;
+ }
+
+ p->signal->autogroup = autogroup_kref_get(ag);
+ __sched_move_task(p, rq);
+ task_rq_unlock(rq, &flags);
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(t, &p->thread_group, thread_group) {
+ sched_move_task(t);
+ }
+ rcu_read_unlock();
+
+ autogroup_kref_put(prev);
+}
+
+void sched_autogroup_create_attach(struct task_struct *p)
+{
+ struct autogroup *ag = autogroup_create();
+
+ autogroup_move_group(p, ag);
+ /* drop extra refrence added by autogroup_create() */
+ autogroup_kref_put(ag);
+}
+EXPORT_SYMBOL(sched_autogroup_create_attach);
+
+/* currently has no users */
+void sched_autogroup_detach(struct task_struct *p)
+{
+ autogroup_move_group(p, &autogroup_default);
+}
+EXPORT_SYMBOL(sched_autogroup_detach);
+
+void sched_autogroup_fork(struct signal_struct *sig)
+{
+ sig->autogroup = autogroup_kref_get(current->signal->autogroup);
+}
+
+void sched_autogroup_exit(struct signal_struct *sig)
+{
+ autogroup_kref_put(sig->autogroup);
+}
+
+static int __init setup_autogroup(char *str)
+{
+ sysctl_sched_autogroup_enabled = 0;
+
+ return 1;
+}
+
+__setup("noautogroup", setup_autogroup);
+#endif
diff --git a/kernel/sched_autogroup.h b/kernel/sched_autogroup.h
new file mode 100644
index 0000000..6048f5d
--- /dev/null
+++ b/kernel/sched_autogroup.h
@@ -0,0 +1,18 @@
+#ifdef CONFIG_SCHED_AUTOGROUP
+
+static void __sched_move_task(struct task_struct *tsk, struct rq *rq);
+
+static inline struct task_group *
+autogroup_task_group(struct task_struct *p, struct task_group *tg);
+
+#else /* !CONFIG_SCHED_AUTOGROUP */
+
+static inline void autogroup_init(struct task_struct *init_task) { }
+
+static inline struct task_group *
+autogroup_task_group(struct task_struct *p, struct task_group *tg)
+{
+ return tg;
+}
+
+#endif /* CONFIG_SCHED_AUTOGROUP */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 5abfa15..b162f65 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -382,6 +382,17 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
+#ifdef CONFIG_SCHED_AUTOGROUP
+ {
+ .procname = "sched_autogroup_enabled",
+ .data = &sysctl_sched_autogroup_enabled,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ .extra1 = &zero,
+ .extra2 = &one,
+ },
+#endif
#ifdef CONFIG_PROVE_LOCKING
{
.procname = "prove_locking",
--
1.6.6.1
@@ -0,0 +1,81 @@
From 1beed5ee3301a9756c8cd2672d487c568c562e81 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 23 Nov 2010 11:40:20 +0100
Subject: [PATCH 09/29] ARM: OMAP: add omap_rev_* macros
This is just to make the SGX modules build that depend on omap_rev_lt_3_0
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/plat-omap/include/plat/cpu.h | 55 +++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b40..1a8c347 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -394,6 +394,61 @@ IS_OMAP_TYPE(3517, 0x3517)
#define OMAP4430_REV_ES2_0 0x44301044
/*
+ * Silicon revisions
+ */
+#define OMAP_ES_1_0 0x00
+#define OMAP_ES_2_0 0x10
+#define OMAP_ES_2_1 0x20
+#define OMAP_ES_3_0 0x30
+#define OMAP_ES_3_1 0x40
+
+#define OMAP_REV_MASK 0x0000ff00
+#define OMAP_REV_BITS ((omap_rev() & OMAP_REV_MASK) >> 8)
+
+#define OMAP_REV_IS(revid) \
+static inline u8 omap_rev_is_ ##revid (void) \
+{ \
+ return (OMAP_REV_BITS == OMAP_ES_ ##revid) ? 1 : 0; \
+}
+
+#define OMAP_REV_LT(revid) \
+static inline u8 omap_rev_lt_ ##revid (void) \
+{ \
+ return (OMAP_REV_BITS < OMAP_ES_ ##revid) ? 1 : 0; \
+}
+
+#define OMAP_REV_LE(revid) \
+static inline u8 omap_rev_le_ ##revid (void) \
+{ \
+ return (OMAP_REV_BITS <= OMAP_ES_ ##revid) ? 1 : 0; \
+}
+
+#define OMAP_REV_GT(revid) \
+static inline u8 omap_rev_gt_ ##revid (void) \
+{ \
+ return (OMAP_REV_BITS > OMAP_ES_ ##revid) ? 1 : 0; \
+}
+
+#define OMAP_REV_GE(revid) \
+static inline u8 omap_rev_ge_ ##revid (void) \
+{ \
+ return (OMAP_REV_BITS >= OMAP_ES_ ##revid) ? 1 : 0; \
+}
+
+#define OMAP_REV_FUNCTIONS(revid) \
+ OMAP_REV_IS(revid) \
+ OMAP_REV_LT(revid) \
+ OMAP_REV_LE(revid) \
+ OMAP_REV_GT(revid) \
+ OMAP_REV_GE(revid)
+
+OMAP_REV_FUNCTIONS(1_0)
+OMAP_REV_FUNCTIONS(2_0)
+OMAP_REV_FUNCTIONS(2_1)
+OMAP_REV_FUNCTIONS(3_0)
+OMAP_REV_FUNCTIONS(3_1)
+
+/*
* omap_chip bits
*
* CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is
--
1.6.6.1
@@ -0,0 +1,31 @@
From f051874f829ed2e2462c0e64c28e28bd6f942f2d Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 10 May 2010 20:44:09 -0700
Subject: [PATCH 10/29] OMAP: DSS2: enable hsclk in dsi_pll_init for OMAP36XX
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
drivers/video/omap2/dss/dpi.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 960e977..23047b6 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -177,7 +177,12 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
dss_clk_enable(DSS_CLK_FCK2);
- r = dsi_pll_init(dssdev, 0, 1);
+
+ if (cpu_is_omap3630())
+ r = dsi_pll_init(dssdev, 1, 1);
+ else
+ r = dsi_pll_init(dssdev, 0, 1);
+
if (r)
goto err3;
#endif
--
1.6.6.1
@@ -0,0 +1,102 @@
From 18333339fe5e104c2ddfb2688989a15df0e0f94c Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@beagleboard.org>
Date: Mon, 20 Dec 2010 11:57:56 +0100
Subject: [PATCH 11/29] omap3: beagleboard: add WIP support for beagleboardtoys WL12xx board
Based on a patch by Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Koen Kooi <koen@beagleboard.org>
---
arch/arm/mach-omap2/board-omap3beagle.c | 68 +++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 34f2132..073276b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -146,6 +146,67 @@ fail0:
char expansionboard_name[16];
+#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
+#include <linux/regulator/fixed.h>
+#include <linux/wl12xx.h>
+
+#define OMAP_BEAGLE_WLAN_EN_GPIO (139)
+#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137)
+
+struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
+ .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
+ .board_ref_clock = 2, /* 38.4 MHz */
+};
+
+ static struct omap2_hsmmc_info mmcbbt[] = {
+ {
+ .mmc = 1,
+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
+ .gpio_wp = 29,
+ },
+ {
+ .name = "wl1271",
+ .mmc = 2,
+ .caps = MMC_CAP_4_BIT_DATA,
+ .gpio_wp = -EINVAL,
+ .gpio_cd = -EINVAL,
+ .nonremovable = true,
+ },
+ {} /* Terminator */
+ };
+
+static struct regulator_consumer_supply beagle_vmmc2_supply = {
+ .supply = "vmmc",
+ .dev_name = "mmci-omap-hs.1",
+};
+
+static struct regulator_init_data beagle_vmmc2 = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &beagle_vmmc2_supply,
+};
+
+static struct fixed_voltage_config beagle_vwlan = {
+ .supply_name = "vwl1271",
+ .microvolts = 1800000, /* 1.8V */
+ .gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
+ .startup_delay = 70000, /* 70ms */
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &beagle_vmmc2,
+};
+
+static struct platform_device omap_vwlan_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &beagle_vwlan,
+ },
+};
+#endif
+
#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
#include <plat/mcspi.h>
@@ -382,7 +443,14 @@ static int beagle_twl_gpio_setup(struct device *dev,
}
/* gpio + 0 is "mmc0_cd" (input/IRQ) */
mmc[0].gpio_cd = gpio + 0;
+#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
+ if(!strcmp(expansionboard_name, "fixme-beagletoy"))
+ omap2_hsmmc_init(mmcbbt);
+ else
+ omap2_hsmmc_init(mmc);
+#else
omap2_hsmmc_init(mmc);
+#endif
/* link regulators to MMC adapters */
beagle_vmmc1_supply.dev = mmc[0].dev;
--
1.6.6.1
@@ -0,0 +1,29 @@
From 43b87f69e82217aff2a966559bdf28dcfedc2c8e Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 15:17:44 -0800
Subject: [PATCH 12/29] drivers: net: smsc911x: return ENODEV if device is not found
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
drivers/net/smsc911x.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 64bfdae..ba2a00e 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -2019,8 +2019,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
}
retval = smsc911x_init(dev);
- if (retval < 0)
+ if (retval < 0) {
+ retval = -ENODEV;
goto out_unmap_io_3;
+ }
/* configure irq polarity and type before connecting isr */
if (pdata->config.irq_polarity == SMSC911X_IRQ_POLARITY_ACTIVE_HIGH)
--
1.6.6.1
@@ -0,0 +1,47 @@
From 43b7984021e30a9aa9b97c2cf9a9ceb806372709 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 15:24:10 -0800
Subject: [PATCH 13/29] drivers: input: touchscreen: ads7846: return ENODEV if device is not found
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
drivers/input/touchscreen/ads7846.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 14ea54b..c775e38 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1325,11 +1325,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
* the touchscreen, in case it's not connected.
*/
if (ts->model == 7845)
- ads7845_read12_ser(&spi->dev, PWRDOWN);
+ err = ads7845_read12_ser(&spi->dev, PWRDOWN);
else
- (void) ads7846_read12_ser(&spi->dev,
+ err = ads7846_read12_ser(&spi->dev,
READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
+ /* if sample is all 0's or all 1's then there is no device on spi */
+ if ( (err == 0x000) || (err == 0xfff)) {
+ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
+ err = -ENODEV;
+ goto err_free_irq;
+ }
+
err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
if (err)
goto err_remove_hwmon;
@@ -1353,7 +1360,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
err_put_regulator:
regulator_put(ts->reg);
err_free_gpio:
- if (ts->gpio_pendown != -1)
+ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
gpio_free(ts->gpio_pendown);
err_cleanup_filter:
if (ts->filter_cleanup)
--
1.6.6.1
@@ -0,0 +1,27 @@
From ebb70888ec3601534601d7524212fbefa24d679e Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 12:45:20 -0800
Subject: [PATCH 14/29] ASoC: enable audio capture by default for twl4030
---
sound/soc/codecs/twl4030.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index cbebec6..430cd10 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -56,8 +56,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
0x00, /* REG_OPTION (0x2) */
0x00, /* REG_UNKNOWN (0x3) */
0x00, /* REG_MICBIAS_CTL (0x4) */
- 0x00, /* REG_ANAMICL (0x5) */
- 0x00, /* REG_ANAMICR (0x6) */
+ 0x34, /* REG_ANAMICL (0x5) */
+ 0x14, /* REG_ANAMICR (0x6) */
0x00, /* REG_AVADC_CTL (0x7) */
0x00, /* REG_ADCMICSEL (0x8) */
0x00, /* REG_DIGMIXING (0x9) */
--
1.6.6.1
@@ -0,0 +1,51 @@
From 0bedf8e81896a69ba77e9066ad9545412fd53cf8 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Sat, 23 Jan 2010 06:26:54 -0800
Subject: [PATCH 15/29] MFD: enable madc clock
---
drivers/mfd/twl-core.c | 8 ++++++++
include/linux/i2c/twl.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 35275ba..5aa7358 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -208,6 +208,11 @@
/* Few power values */
#define R_CFG_BOOT 0x05
+#define R_GPBR1 0x0C
+
+/* MADC clock values for R_GPBR1 */
+#define MADC_HFCLK_EN 0x80
+#define DEFAULT_MADC_CLK_EN 0x10
/* some fields in R_CFG_BOOT */
#define HFCLK_FREQ_19p2_MHZ (1 << 0)
@@ -929,6 +934,9 @@ static void clocks_init(struct device *dev,
e |= unprotect_pm_master();
/* effect->MADC+USB ck en */
+ if (twl_has_madc())
+ e |= twl_i2c_write_u8(TWL_MODULE_INTBR,
+ MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
e |= protect_pm_master();
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index c760991..cfdfdd3 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -74,6 +74,7 @@
#define TWL_MODULE_USB TWL4030_MODULE_USB
#define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE
+#define TWL_MODULE_INTBR TWL4030_MODULE_INTBR
#define TWL_MODULE_PIH TWL4030_MODULE_PIH
#define TWL_MODULE_MADC TWL4030_MODULE_MADC
#define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE
--
1.6.6.1
@@ -0,0 +1,740 @@
From ea45cc880d407e9747dafa0efe5ab17ffb5e42d5 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:19:34 -0800
Subject: [PATCH 16/29] MFD: add twl4030 madc driver
---
drivers/mfd/Kconfig | 21 ++
drivers/mfd/Makefile | 1 +
drivers/mfd/twl4030-madc.c | 537 ++++++++++++++++++++++++++++++++++++++
include/linux/i2c/twl4030-madc.h | 130 +++++++++
4 files changed, 689 insertions(+), 0 deletions(-)
create mode 100644 drivers/mfd/twl4030-madc.c
create mode 100644 include/linux/i2c/twl4030-madc.h
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3a1493b..26ca160 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -186,6 +186,27 @@ config TWL4030_CODEC
select MFD_CORE
default n
+config TWL4030_MADC
+ tristate "TWL4030 MADC Driver"
+ depends on TWL4030_CORE
+ help
+ The TWL4030 Monitoring ADC driver enables the host
+ processor to monitor analog signals using analog-to-digital
+ conversions on the input source. TWL4030 MADC provides the
+ following features:
+ - Single 10-bit ADC with successive approximation register (SAR) conversion;
+ - Analog multiplexer for 16 inputs;
+ - Seven (of the 16) inputs are freely available;
+ - Battery voltage monitoring;
+ - Concurrent conversion request management;
+ - Interrupt signal to Primary Interrupt Handler;
+ - Averaging feature;
+ - Selective enable/disable of the averaging feature.
+
+ Say 'y' here to statically link this module into the kernel or 'm'
+ to build it as a dinamically loadable module. The module will be
+ called twl4030-madc.ko
+
config TWL6030_PWM
tristate "TWL6030 PWM (Pulse Width Modulator) Support"
depends on TWL4030_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f54b365..8c4ccb2 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
obj-$(CONFIG_TWL4030_CODEC) += twl4030-codec.o
+obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_TWL6030_PWM) += twl6030-pwm.o
obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
new file mode 100644
index 0000000..4adf880
--- /dev/null
+++ b/drivers/mfd/twl4030-madc.c
@@ -0,0 +1,537 @@
+/*
+ * TWL4030 MADC module driver
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Mikko Ylinen <mikko.k.ylinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/i2c/twl.h>
+#include <linux/i2c/twl4030-madc.h>
+
+#include <asm/uaccess.h>
+
+#define TWL4030_MADC_PFX "twl4030-madc: "
+
+struct twl4030_madc_data {
+ struct device *dev;
+ struct mutex lock;
+ struct work_struct ws;
+ struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
+ int imr;
+ int isr;
+};
+
+static struct twl4030_madc_data *the_madc;
+
+static
+const struct twl4030_madc_conversion_method twl4030_conversion_methods[] = {
+ [TWL4030_MADC_RT] = {
+ .sel = TWL4030_MADC_RTSELECT_LSB,
+ .avg = TWL4030_MADC_RTAVERAGE_LSB,
+ .rbase = TWL4030_MADC_RTCH0_LSB,
+ },
+ [TWL4030_MADC_SW1] = {
+ .sel = TWL4030_MADC_SW1SELECT_LSB,
+ .avg = TWL4030_MADC_SW1AVERAGE_LSB,
+ .rbase = TWL4030_MADC_GPCH0_LSB,
+ .ctrl = TWL4030_MADC_CTRL_SW1,
+ },
+ [TWL4030_MADC_SW2] = {
+ .sel = TWL4030_MADC_SW2SELECT_LSB,
+ .avg = TWL4030_MADC_SW2AVERAGE_LSB,
+ .rbase = TWL4030_MADC_GPCH0_LSB,
+ .ctrl = TWL4030_MADC_CTRL_SW2,
+ },
+};
+
+static int twl4030_madc_read(struct twl4030_madc_data *madc, u8 reg)
+{
+ int ret;
+ u8 val;
+
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MADC, &val, reg);
+ if (ret) {
+ dev_dbg(madc->dev, "unable to read register 0x%X\n", reg);
+ return ret;
+ }
+
+ return val;
+}
+
+static void twl4030_madc_write(struct twl4030_madc_data *madc, u8 reg, u8 val)
+{
+ int ret;
+
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, val, reg);
+ if (ret)
+ dev_err(madc->dev, "unable to write register 0x%X\n", reg);
+}
+
+static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg)
+{
+ u8 msb, lsb;
+
+ /* For each ADC channel, we have MSB and LSB register pair. MSB address
+ * is always LSB address+1. reg parameter is the addr of LSB register */
+ msb = twl4030_madc_read(madc, reg + 1);
+ lsb = twl4030_madc_read(madc, reg);
+
+ return (int)(((msb << 8) | lsb) >> 6);
+}
+
+static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
+ u8 reg_base, u16 channels, int *buf)
+{
+ int count = 0;
+ u8 reg, i;
+
+ if (unlikely(!buf))
+ return 0;
+
+ for (i = 0; i < TWL4030_MADC_MAX_CHANNELS; i++) {
+ if (channels & (1<<i)) {
+ reg = reg_base + 2*i;
+ buf[i] = twl4030_madc_channel_raw_read(madc, reg);
+ count++;
+ }
+ }
+ return count;
+}
+
+static void twl4030_madc_enable_irq(struct twl4030_madc_data *madc, int id)
+{
+ u8 val;
+
+ val = twl4030_madc_read(madc, madc->imr);
+ val &= ~(1 << id);
+ twl4030_madc_write(madc, madc->imr, val);
+}
+
+static void twl4030_madc_disable_irq(struct twl4030_madc_data *madc, int id)
+{
+ u8 val;
+
+ val = twl4030_madc_read(madc, madc->imr);
+ val |= (1 << id);
+ twl4030_madc_write(madc, madc->imr, val);
+}
+
+static irqreturn_t twl4030_madc_irq_handler(int irq, void *_madc)
+{
+ struct twl4030_madc_data *madc = _madc;
+ u8 isr_val, imr_val;
+ int i;
+
+#ifdef CONFIG_LOCKDEP
+ /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
+ * we don't want and can't tolerate. Although it might be
+ * friendlier not to borrow this thread context...
+ */
+ local_irq_enable();
+#endif
+
+ /* Use COR to ack interrupts since we have no shared IRQs in ISRx */
+ isr_val = twl4030_madc_read(madc, madc->isr);
+ imr_val = twl4030_madc_read(madc, madc->imr);
+
+ isr_val &= ~imr_val;
+
+ for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) {
+
+ if (!(isr_val & (1<<i)))
+ continue;
+
+ twl4030_madc_disable_irq(madc, i);
+ madc->requests[i].result_pending = 1;
+ }
+
+ schedule_work(&madc->ws);
+
+ return IRQ_HANDLED;
+}
+
+static void twl4030_madc_work(struct work_struct *ws)
+{
+ const struct twl4030_madc_conversion_method *method;
+ struct twl4030_madc_data *madc;
+ struct twl4030_madc_request *r;
+ int len, i;
+
+ madc = container_of(ws, struct twl4030_madc_data, ws);
+ mutex_lock(&madc->lock);
+
+ for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) {
+
+ r = &madc->requests[i];
+
+ /* No pending results for this method, move to next one */
+ if (!r->result_pending)
+ continue;
+
+ method = &twl4030_conversion_methods[r->method];
+
+ /* Read results */
+ len = twl4030_madc_read_channels(madc, method->rbase,
+ r->channels, r->rbuf);
+
+ /* Return results to caller */
+ if (r->func_cb != NULL) {
+ r->func_cb(len, r->channels, r->rbuf);
+ r->func_cb = NULL;
+ }
+
+ /* Free request */
+ r->result_pending = 0;
+ r->active = 0;
+ }
+
+ mutex_unlock(&madc->lock);
+}
+
+static int twl4030_madc_set_irq(struct twl4030_madc_data *madc,
+ struct twl4030_madc_request *req)
+{
+ struct twl4030_madc_request *p;
+
+ p = &madc->requests[req->method];
+
+ memcpy(p, req, sizeof *req);
+
+ twl4030_madc_enable_irq(madc, req->method);
+
+ return 0;
+}
+
+static inline void twl4030_madc_start_conversion(struct twl4030_madc_data *madc,
+ int conv_method)
+{
+ const struct twl4030_madc_conversion_method *method;
+
+ method = &twl4030_conversion_methods[conv_method];
+
+ switch (conv_method) {
+ case TWL4030_MADC_SW1:
+ case TWL4030_MADC_SW2:
+ twl4030_madc_write(madc, method->ctrl, TWL4030_MADC_SW_START);
+ break;
+ case TWL4030_MADC_RT:
+ default:
+ break;
+ }
+}
+
+static int twl4030_madc_wait_conversion_ready(
+ struct twl4030_madc_data *madc,
+ unsigned int timeout_ms, u8 status_reg)
+{
+ unsigned long timeout;
+
+ timeout = jiffies + msecs_to_jiffies(timeout_ms);
+ do {
+ u8 reg;
+
+ reg = twl4030_madc_read(madc, status_reg);
+ if (!(reg & TWL4030_MADC_BUSY) && (reg & TWL4030_MADC_EOC_SW))
+ return 0;
+ } while (!time_after(jiffies, timeout));
+
+ return -EAGAIN;
+}
+
+int twl4030_madc_conversion(struct twl4030_madc_request *req)
+{
+ const struct twl4030_madc_conversion_method *method;
+ u8 ch_msb, ch_lsb;
+ int ret;
+
+ if (unlikely(!req))
+ return -EINVAL;
+
+ mutex_lock(&the_madc->lock);
+
+ /* Do we have a conversion request ongoing */
+ if (the_madc->requests[req->method].active) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ ch_msb = (req->channels >> 8) & 0xff;
+ ch_lsb = req->channels & 0xff;
+
+ method = &twl4030_conversion_methods[req->method];
+
+ /* Select channels to be converted */
+ twl4030_madc_write(the_madc, method->sel + 1, ch_msb);
+ twl4030_madc_write(the_madc, method->sel, ch_lsb);
+
+ /* Select averaging for all channels if do_avg is set */
+ if (req->do_avg) {
+ twl4030_madc_write(the_madc, method->avg + 1, ch_msb);
+ twl4030_madc_write(the_madc, method->avg, ch_lsb);
+ }
+
+ if ((req->type == TWL4030_MADC_IRQ_ONESHOT) && (req->func_cb != NULL)) {
+ twl4030_madc_set_irq(the_madc, req);
+ twl4030_madc_start_conversion(the_madc, req->method);
+ the_madc->requests[req->method].active = 1;
+ ret = 0;
+ goto out;
+ }
+
+ /* With RT method we should not be here anymore */
+ if (req->method == TWL4030_MADC_RT) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ twl4030_madc_start_conversion(the_madc, req->method);
+ the_madc->requests[req->method].active = 1;
+
+ /* Wait until conversion is ready (ctrl register returns EOC) */
+ ret = twl4030_madc_wait_conversion_ready(the_madc, 5, method->ctrl);
+ if (ret) {
+ dev_dbg(the_madc->dev, "conversion timeout!\n");
+ the_madc->requests[req->method].active = 0;
+ goto out;
+ }
+
+ ret = twl4030_madc_read_channels(the_madc, method->rbase, req->channels,
+ req->rbuf);
+
+ the_madc->requests[req->method].active = 0;
+
+out:
+ mutex_unlock(&the_madc->lock);
+
+ return ret;
+}
+EXPORT_SYMBOL(twl4030_madc_conversion);
+
+static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
+ int chan, int on)
+{
+ int ret;
+ u8 regval;
+
+ /* Current generator is only available for ADCIN0 and ADCIN1. NB:
+ * ADCIN1 current generator only works when AC or VBUS is present */
+ if (chan > 1)
+ return EINVAL;
+
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ &regval, TWL4030_BCI_BCICTL1);
+ if (on)
+ regval |= (chan) ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN;
+ else
+ regval &= (chan) ? ~TWL4030_BCI_ITHEN : ~TWL4030_BCI_TYPEN;
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ regval, TWL4030_BCI_BCICTL1);
+
+ return ret;
+}
+
+static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
+{
+ u8 regval;
+
+ regval = twl4030_madc_read(madc, TWL4030_MADC_CTRL1);
+ if (on)
+ regval |= TWL4030_MADC_MADCON;
+ else
+ regval &= ~TWL4030_MADC_MADCON;
+ twl4030_madc_write(madc, TWL4030_MADC_CTRL1, regval);
+
+ return 0;
+}
+
+static long twl4030_madc_ioctl(struct file *filp, unsigned int cmd,
+ unsigned long arg)
+{
+ struct twl4030_madc_user_parms par;
+ int val, ret;
+
+ ret = copy_from_user(&par, (void __user *) arg, sizeof(par));
+ if (ret) {
+ dev_dbg(the_madc->dev, "copy_from_user: %d\n", ret);
+ return -EACCES;
+ }
+
+ switch (cmd) {
+ case TWL4030_MADC_IOCX_ADC_RAW_READ: {
+ struct twl4030_madc_request req;
+ if (par.channel >= TWL4030_MADC_MAX_CHANNELS)
+ return -EINVAL;
+
+ req.channels = (1 << par.channel);
+ req.do_avg = par.average;
+ req.method = TWL4030_MADC_SW1;
+ req.func_cb = NULL;
+
+ val = twl4030_madc_conversion(&req);
+ if (val <= 0) {
+ par.status = -1;
+ } else {
+ par.status = 0;
+ par.result = (u16)req.rbuf[par.channel];
+ }
+ break;
+ }
+ default:
+ return -EINVAL;
+ }
+
+ ret = copy_to_user((void __user *) arg, &par, sizeof(par));
+ if (ret) {
+ dev_dbg(the_madc->dev, "copy_to_user: %d\n", ret);
+ return -EACCES;
+ }
+
+ return 0;
+}
+
+static struct file_operations twl4030_madc_fileops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = twl4030_madc_ioctl
+};
+
+static struct miscdevice twl4030_madc_device = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = "twl4030-madc",
+ .fops = &twl4030_madc_fileops
+};
+
+static int __init twl4030_madc_probe(struct platform_device *pdev)
+{
+ struct twl4030_madc_data *madc;
+ struct twl4030_madc_platform_data *pdata = pdev->dev.platform_data;
+ int ret;
+ u8 regval;
+
+ madc = kzalloc(sizeof *madc, GFP_KERNEL);
+ if (!madc)
+ return -ENOMEM;
+
+ if (!pdata) {
+ dev_dbg(&pdev->dev, "platform_data not available\n");
+ ret = -EINVAL;
+ goto err_pdata;
+ }
+
+ madc->imr = (pdata->irq_line == 1) ? TWL4030_MADC_IMR1 : TWL4030_MADC_IMR2;
+ madc->isr = (pdata->irq_line == 1) ? TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2;
+
+ ret = misc_register(&twl4030_madc_device);
+ if (ret) {
+ dev_dbg(&pdev->dev, "could not register misc_device\n");
+ goto err_misc;
+ }
+ twl4030_madc_set_power(madc, 1);
+ twl4030_madc_set_current_generator(madc, 0, 1);
+
+ /* Enable ADCIN3 through 6 */
+ ret = twl_i2c_read_u8(TWL4030_MODULE_USB,
+ &regval, TWL4030_USB_CARKIT_ANA_CTRL);
+
+ regval |= TWL4030_USB_SEL_MADC_MCPC;
+
+ ret = twl_i2c_write_u8(TWL4030_MODULE_USB,
+ regval, TWL4030_USB_CARKIT_ANA_CTRL);
+
+
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ &regval, TWL4030_BCI_BCICTL1);
+
+ regval |= TWL4030_BCI_MESBAT;
+
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ regval, TWL4030_BCI_BCICTL1);
+
+ ret = request_irq(platform_get_irq(pdev, 0), twl4030_madc_irq_handler,
+ 0, "twl4030_madc", madc);
+ if (ret) {
+ dev_dbg(&pdev->dev, "could not request irq\n");
+ goto err_irq;
+ }
+
+ platform_set_drvdata(pdev, madc);
+ mutex_init(&madc->lock);
+ INIT_WORK(&madc->ws, twl4030_madc_work);
+
+ the_madc = madc;
+
+ return 0;
+
+err_irq:
+ misc_deregister(&twl4030_madc_device);
+
+err_misc:
+err_pdata:
+ kfree(madc);
+
+ return ret;
+}
+
+static int __exit twl4030_madc_remove(struct platform_device *pdev)
+{
+ struct twl4030_madc_data *madc = platform_get_drvdata(pdev);
+
+ twl4030_madc_set_power(madc, 0);
+ twl4030_madc_set_current_generator(madc, 0, 0);
+ free_irq(platform_get_irq(pdev, 0), madc);
+ cancel_work_sync(&madc->ws);
+ misc_deregister(&twl4030_madc_device);
+
+ return 0;
+}
+
+static struct platform_driver twl4030_madc_driver = {
+ .probe = twl4030_madc_probe,
+ .remove = __exit_p(twl4030_madc_remove),
+ .driver = {
+ .name = "twl4030_madc",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init twl4030_madc_init(void)
+{
+ return platform_driver_register(&twl4030_madc_driver);
+}
+module_init(twl4030_madc_init);
+
+static void __exit twl4030_madc_exit(void)
+{
+ platform_driver_unregister(&twl4030_madc_driver);
+}
+module_exit(twl4030_madc_exit);
+
+MODULE_ALIAS("platform:twl4030-madc");
+MODULE_AUTHOR("Nokia Corporation");
+MODULE_DESCRIPTION("twl4030 ADC driver");
+MODULE_LICENSE("GPL");
+
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
new file mode 100644
index 0000000..341a665
--- /dev/null
+++ b/include/linux/i2c/twl4030-madc.h
@@ -0,0 +1,130 @@
+/*
+ * include/linux/i2c/twl4030-madc.h
+ *
+ * TWL4030 MADC module driver header
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Mikko Ylinen <mikko.k.ylinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef _TWL4030_MADC_H
+#define _TWL4030_MADC_H
+
+struct twl4030_madc_conversion_method {
+ u8 sel;
+ u8 avg;
+ u8 rbase;
+ u8 ctrl;
+};
+
+#define TWL4030_MADC_MAX_CHANNELS 16
+
+struct twl4030_madc_request {
+ u16 channels;
+ u16 do_avg;
+ u16 method;
+ u16 type;
+ int active;
+ int result_pending;
+ int rbuf[TWL4030_MADC_MAX_CHANNELS];
+ void (*func_cb)(int len, int channels, int *buf);
+};
+
+enum conversion_methods {
+ TWL4030_MADC_RT,
+ TWL4030_MADC_SW1,
+ TWL4030_MADC_SW2,
+ TWL4030_MADC_NUM_METHODS
+};
+
+enum sample_type {
+ TWL4030_MADC_WAIT,
+ TWL4030_MADC_IRQ_ONESHOT,
+ TWL4030_MADC_IRQ_REARM
+};
+
+#define TWL4030_MADC_CTRL1 0x00
+#define TWL4030_MADC_CTRL2 0x01
+
+#define TWL4030_MADC_RTSELECT_LSB 0x02
+#define TWL4030_MADC_SW1SELECT_LSB 0x06
+#define TWL4030_MADC_SW2SELECT_LSB 0x0A
+
+#define TWL4030_MADC_RTAVERAGE_LSB 0x04
+#define TWL4030_MADC_SW1AVERAGE_LSB 0x08
+#define TWL4030_MADC_SW2AVERAGE_LSB 0x0C
+
+#define TWL4030_MADC_CTRL_SW1 0x12
+#define TWL4030_MADC_CTRL_SW2 0x13
+
+#define TWL4030_MADC_RTCH0_LSB 0x17
+#define TWL4030_MADC_GPCH0_LSB 0x37
+
+#define TWL4030_MADC_MADCON (1<<0) /* MADC power on */
+#define TWL4030_MADC_BUSY (1<<0) /* MADC busy */
+#define TWL4030_MADC_EOC_SW (1<<1) /* MADC conversion completion */
+#define TWL4030_MADC_SW_START (1<<5) /* MADC SWx start conversion */
+
+#define TWL4030_MADC_ADCIN0 (1<<0)
+#define TWL4030_MADC_ADCIN1 (1<<1)
+#define TWL4030_MADC_ADCIN2 (1<<2)
+#define TWL4030_MADC_ADCIN3 (1<<3)
+#define TWL4030_MADC_ADCIN4 (1<<4)
+#define TWL4030_MADC_ADCIN5 (1<<5)
+#define TWL4030_MADC_ADCIN6 (1<<6)
+#define TWL4030_MADC_ADCIN7 (1<<7)
+#define TWL4030_MADC_ADCIN8 (1<<8)
+#define TWL4030_MADC_ADCIN9 (1<<9)
+#define TWL4030_MADC_ADCIN10 (1<<10)
+#define TWL4030_MADC_ADCIN11 (1<<11)
+#define TWL4030_MADC_ADCIN12 (1<<12)
+#define TWL4030_MADC_ADCIN13 (1<<13)
+#define TWL4030_MADC_ADCIN14 (1<<14)
+#define TWL4030_MADC_ADCIN15 (1<<15)
+
+/* Fixed channels */
+#define TWL4030_MADC_BTEMP TWL4030_MADC_ADCIN1
+#define TWL4030_MADC_VBUS TWL4030_MADC_ADCIN8
+#define TWL4030_MADC_VBKB TWL4030_MADC_ADCIN9
+#define TWL4030_MADC_ICHG TWL4030_MADC_ADCIN10
+#define TWL4030_MADC_VCHG TWL4030_MADC_ADCIN11
+#define TWL4030_MADC_VBAT TWL4030_MADC_ADCIN12
+
+/* BCI related - XXX To be moved elsewhere */
+#define TWL4030_BCI_BCICTL1 0x23
+#define TWL4030_BCI_MESBAT (1<<1)
+#define TWL4030_BCI_TYPEN (1<<4)
+#define TWL4030_BCI_ITHEN (1<<3)
+
+/* USB related - XXX To be moved elsewhere */
+#define TWL4030_USB_CARKIT_ANA_CTRL 0xBB
+#define TWL4030_USB_SEL_MADC_MCPC (1<<3)
+
+#define TWL4030_MADC_IOC_MAGIC '`'
+#define TWL4030_MADC_IOCX_ADC_RAW_READ _IO(TWL4030_MADC_IOC_MAGIC, 0)
+
+struct twl4030_madc_user_parms {
+ int channel;
+ int average;
+ int status;
+ u16 result;
+};
+
+int twl4030_madc_conversion(struct twl4030_madc_request *conv);
+
+#endif
--
1.6.6.1
@@ -0,0 +1,32 @@
From 3bc70a68d2cfd1d41995bb7f33f2e4005542f62b Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:27:15 -0800
Subject: [PATCH 17/29] ARM: OMAP: Add twl4030 madc support to Overo
---
arch/arm/mach-omap2/board-overo.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index cb26e5d..17f066a 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -369,10 +369,15 @@ static struct twl4030_codec_data overo_codec_data = {
/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
+static struct twl4030_madc_platform_data overo_madc_data = {
+ .irq_line = 1,
+};
+
static struct twl4030_platform_data overo_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
.gpio = &overo_gpio_data,
+ .madc = &overo_madc_data,
.usb = &overo_usb_data,
.codec = &overo_codec_data,
.vmmc1 = &overo_vmmc1,
--
1.6.6.1
@@ -0,0 +1,35 @@
From afa4132d5e29ed90154fec8cd97f891c86ce748c Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:32:36 -0800
Subject: [PATCH 18/29] ARM: OMAP: Add twl4030 madc support to Beagle
---
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 073276b..781844c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -578,6 +578,10 @@ static struct twl4030_codec_data beagle_codec_data = {
.audio = &beagle_audio_data,
};
+static struct twl4030_madc_platform_data beagle_madc_data = {
+ .irq_line = 1,
+};
+
static struct twl4030_platform_data beagle_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
@@ -586,6 +590,7 @@ static struct twl4030_platform_data beagle_twldata = {
.usb = &beagle_usb_data,
.gpio = &beagle_gpio_data,
.codec = &beagle_codec_data,
+ .madc = &beagle_madc_data,
.vmmc1 = &beagle_vmmc1,
.vsim = &beagle_vsim,
.vdac = &beagle_vdac,
--
1.6.6.1
@@ -0,0 +1,173 @@
From e6b15754a20c0306fb20d061358da67b5dd218cd Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 23 Feb 2010 14:40:27 -0800
Subject: [PATCH 19/29] OMAP: DSS2: Add support for Samsung LTE430WQ-F0C panel
---
.../omap2/displays/panel-samsung-lte430wq-f0c.c | 154 ++++++++++++++++++++
1 files changed, 154 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
new file mode 100644
index 0000000..6a29f9c
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
@@ -0,0 +1,154 @@
+/*
+ * LCD panel driver for Samsung LTE430WQ-F0C
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include <plat/display.h>
+
+static struct omap_video_timings samsung_lte_timings = {
+ .x_res = 480,
+ .y_res = 272,
+
+ .pixel_clock = 9200,
+
+ .hsw = 41,
+ .hfp = 8,
+ .hbp = 45-41,
+
+ .vsw = 10,
+ .vfp = 4,
+ .vbp = 12-10,
+};
+
+static int samsung_lte_panel_power_on(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+ r = omapdss_dpi_display_enable(dssdev);
+ if (r)
+ goto err0;
+
+ if (dssdev->platform_enable) {
+ r = dssdev->platform_enable(dssdev);
+ if (r)
+ goto err1;
+ }
+
+ return 0;
+err1:
+ omapdss_dpi_display_disable(dssdev);
+err0:
+ return r;
+}
+
+static void samsung_lte_panel_power_off(struct omap_dss_device *dssdev)
+{
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
+ omapdss_dpi_display_disable(dssdev);
+}
+
+static int samsung_lte_panel_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.timings = samsung_lte_timings;
+
+ return 0;
+}
+
+static void samsung_lte_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int samsung_lte_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ r = samsung_lte_panel_power_on(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static void samsung_lte_panel_disable(struct omap_dss_device *dssdev)
+{
+ samsung_lte_panel_power_off(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static int samsung_lte_panel_suspend(struct omap_dss_device *dssdev)
+{
+ samsung_lte_panel_disable(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+ return 0;
+}
+
+static int samsung_lte_panel_resume(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ r = samsung_lte_panel_enable(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static struct omap_dss_driver samsung_lte_driver = {
+ .probe = samsung_lte_panel_probe,
+ .remove = samsung_lte_panel_remove,
+
+ .enable = samsung_lte_panel_enable,
+ .disable = samsung_lte_panel_disable,
+ .suspend = samsung_lte_panel_suspend,
+ .resume = samsung_lte_panel_resume,
+
+ .driver = {
+ .name = "samsung_lte_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init samsung_lte_panel_drv_init(void)
+{
+ return omap_dss_register_driver(&samsung_lte_driver);
+}
+
+static void __exit samsung_lte_panel_drv_exit(void)
+{
+ omap_dss_unregister_driver(&samsung_lte_driver);
+}
+
+module_init(samsung_lte_panel_drv_init);
+module_exit(samsung_lte_panel_drv_exit);
+MODULE_LICENSE("GPL");
--
1.6.6.1
@@ -0,0 +1,299 @@
From 6861df53ce9212b348fba806f5a86404c1de8a95 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 15:05:30 -0800
Subject: [PATCH 20/29] OMAP: DSS2: Add support for LG Philips LB035Q02 panel
---
drivers/video/omap2/displays/Kconfig | 12 +
drivers/video/omap2/displays/Makefile | 2 +
.../omap2/displays/panel-lgphilips-lb035q02.c | 244 ++++++++++++++++++++
3 files changed, 258 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 12327bb..48e872f 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -7,6 +7,18 @@ config PANEL_GENERIC
Generic panel driver.
Used for DVI output for Beagle and OMAP3 SDP.
+config PANEL_LGPHILIPS_LB035Q02
+ tristate "LG.Philips LB035Q02 LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used on Overo Palo35
+
+config PANEL_SAMSUNG_LTE430WQ_F0C
+ tristate "Samsung LTE430WQ-F0C LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used on Overo Palo43
+
config PANEL_SHARP_LS037V7DW01
tristate "Sharp LS037V7DW01 LCD Panel"
depends on OMAP2_DSS
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index aa38609..2fb1a57 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,4 +1,6 @@
obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
+obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
+obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
new file mode 100644
index 0000000..4ad709d
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -0,0 +1,244 @@
+/*
+ * LCD panel driver for LG.Philips LB035Q02
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/spi/spi.h>
+
+#include <plat/display.h>
+
+static struct spi_device *spidev;
+
+static struct omap_video_timings lb035q02_timings = {
+ .x_res = 320,
+ .y_res = 240,
+
+ .pixel_clock = 6500,
+
+ .hsw = 2,
+ .hfp = 20,
+ .hbp = 68,
+
+ .vsw = 2,
+ .vfp = 4,
+ .vbp = 18,
+};
+
+static int lb035q02_write_reg(u8 reg, u16 val)
+{
+ struct spi_message msg;
+ struct spi_transfer index_xfer = {
+ .len = 3,
+ .cs_change = 1,
+ };
+ struct spi_transfer value_xfer = {
+ .len = 3,
+ };
+ u8 buffer[16];
+
+ spi_message_init(&msg);
+
+ /* register index */
+ buffer[0] = 0x70;
+ buffer[1] = 0x00;
+ buffer[2] = reg & 0x7f;
+ index_xfer.tx_buf = buffer;
+ spi_message_add_tail(&index_xfer, &msg);
+
+ /* register value */
+ buffer[4] = 0x72;
+ buffer[5] = val >> 8;
+ buffer[6] = val;
+ value_xfer.tx_buf = buffer + 4;
+ spi_message_add_tail(&value_xfer, &msg);
+
+ return spi_sync(spidev, &msg);
+}
+
+static int lb035q02_panel_power_on(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+ return 0;
+
+ r = omapdss_dpi_display_enable(dssdev);
+ if (r)
+ goto err0;
+
+ if (dssdev->platform_enable) {
+ r = dssdev->platform_enable(dssdev);
+ if (r)
+ goto err1;
+ }
+
+ /* Panel init sequence from page 28 of the spec */
+ lb035q02_write_reg(0x01, 0x6300);
+ lb035q02_write_reg(0x02, 0x0200);
+ lb035q02_write_reg(0x03, 0x0177);
+ lb035q02_write_reg(0x04, 0x04c7);
+ lb035q02_write_reg(0x05, 0xffc0);
+ lb035q02_write_reg(0x06, 0xe806);
+ lb035q02_write_reg(0x0a, 0x4008);
+ lb035q02_write_reg(0x0b, 0x0000);
+ lb035q02_write_reg(0x0d, 0x0030);
+ lb035q02_write_reg(0x0e, 0x2800);
+ lb035q02_write_reg(0x0f, 0x0000);
+ lb035q02_write_reg(0x16, 0x9f80);
+ lb035q02_write_reg(0x17, 0x0a0f);
+ lb035q02_write_reg(0x1e, 0x00c1);
+ lb035q02_write_reg(0x30, 0x0300);
+ lb035q02_write_reg(0x31, 0x0007);
+ lb035q02_write_reg(0x32, 0x0000);
+ lb035q02_write_reg(0x33, 0x0000);
+ lb035q02_write_reg(0x34, 0x0707);
+ lb035q02_write_reg(0x35, 0x0004);
+ lb035q02_write_reg(0x36, 0x0302);
+ lb035q02_write_reg(0x37, 0x0202);
+ lb035q02_write_reg(0x3a, 0x0a0d);
+ lb035q02_write_reg(0x3b, 0x0806);
+
+ return 0;
+err1:
+ omapdss_dpi_display_disable(dssdev);
+err0:
+ return r;
+}
+
+static void lb035q02_panel_power_off(struct omap_dss_device *dssdev)
+{
+ if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+ return;
+
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
+ omapdss_dpi_display_disable(dssdev);
+}
+
+static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.timings = lb035q02_timings;
+
+ return 0;
+}
+
+static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ r = lb035q02_panel_power_on(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static void lb035q02_panel_disable(struct omap_dss_device *dssdev)
+{
+ lb035q02_panel_power_off(dssdev);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+
+static int lb035q02_panel_suspend(struct omap_dss_device *dssdev)
+{
+ lb035q02_panel_disable(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
+ return 0;
+}
+
+static int lb035q02_panel_resume(struct omap_dss_device *dssdev)
+{
+ int r;
+
+ r = lb035q02_panel_power_on(dssdev);
+ if (r)
+ return r;
+
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+
+ return 0;
+}
+
+static struct omap_dss_driver lb035q02_driver = {
+ .probe = lb035q02_panel_probe,
+ .remove = lb035q02_panel_remove,
+
+ .enable = lb035q02_panel_enable,
+ .disable = lb035q02_panel_disable,
+ .suspend = lb035q02_panel_suspend,
+ .resume = lb035q02_panel_resume,
+
+ .driver = {
+ .name = "lgphilips_lb035q02_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi)
+{
+ spidev = spi;
+ return 0;
+}
+
+static int __devexit lb035q02_panel_spi_remove(struct spi_device *spi)
+{
+ return 0;
+}
+
+static struct spi_driver lb035q02_spi_driver = {
+ .driver = {
+ .name = "lgphilips_lb035q02_panel-spi",
+ .owner = THIS_MODULE,
+ },
+ .probe = lb035q02_panel_spi_probe,
+ .remove = __devexit_p (lb035q02_panel_spi_remove),
+};
+
+static int __init lb035q02_panel_drv_init(void)
+{
+ int r;
+ r = spi_register_driver(&lb035q02_spi_driver);
+ if (r != 0)
+ pr_err("lgphilips_lb035q02: Unable to register SPI driver: %d\n", r);
+
+ r = omap_dss_register_driver(&lb035q02_driver);
+ if (r != 0)
+ pr_err("lgphilips_lb035q02: Unable to register panel driver: %d\n", r);
+
+ return r;
+}
+
+static void __exit lb035q02_panel_drv_exit(void)
+{
+ spi_unregister_driver(&lb035q02_spi_driver);
+ omap_dss_unregister_driver(&lb035q02_driver);
+}
+
+module_init(lb035q02_panel_drv_init);
+module_exit(lb035q02_panel_drv_exit);
+MODULE_LICENSE("GPL");
--
1.6.6.1
@@ -0,0 +1,75 @@
From 9e206307dbd65d557a57563c086af5089e52b2c8 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 19 Jan 2010 21:19:15 -0800
Subject: [PATCH 21/29] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output
also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp
---
drivers/video/omap2/dss/venc.c | 22 ++++++++++++++++++++++
drivers/video/omap2/omapfb/omapfb-main.c | 10 +++++++++-
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index eff3505..e1f4aab 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -87,6 +87,11 @@
#define VENC_OUTPUT_TEST 0xC8
#define VENC_DAC_B__DAC_C 0xC8
+static char *tv_connection;
+
+module_param_named(tvcable, tv_connection, charp, 0);
+MODULE_PARM_DESC(tvcable, "TV connection type (svideo, composite)");
+
struct venc_config {
u32 f_control;
u32 vidout_ctrl;
@@ -459,6 +464,23 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
{
dssdev->panel.timings = omap_dss_pal_timings;
+ /* Allow the TV output to be overriden */
+ if (tv_connection) {
+ if (strcmp(tv_connection, "svideo") == 0) {
+ printk(KERN_INFO
+ "omapdss: tv output is svideo.\n");
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO;
+ } else if (strcmp(tv_connection, "composite") == 0) {
+ printk(KERN_INFO
+ "omapdss: tv output is composite.\n");
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE;
+ } else {
+ printk(KERN_INFO
+ "omapdss: unsupported output type'%s'.\n",
+ tv_connection);
+ }
+ }
+
return 0;
}
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 6a704f1..7ee833f 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2036,7 +2036,15 @@ static int omapfb_mode_to_timings(const char *mode_str,
int r;
#ifdef CONFIG_OMAP2_DSS_VENC
- if (strcmp(mode_str, "pal") == 0) {
+ if (strcmp(mode_str, "pal-16") == 0) {
+ *timings = omap_dss_pal_timings;
+ *bpp = 16;
+ return 0;
+ } else if (strcmp(mode_str, "ntsc-16") == 0) {
+ *timings = omap_dss_ntsc_timings;
+ *bpp = 16;
+ return 0;
+ } else if (strcmp(mode_str, "pal") == 0) {
*timings = omap_dss_pal_timings;
*bpp = 24;
return 0;
--
1.6.6.1
@@ -0,0 +1,39 @@
From 3924e990868742c19e5cd3e84191a01b55249079 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Sun, 24 Jan 2010 09:33:56 -0800
Subject: [PATCH 22/29] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test
otherwise it is not executed on systems that use non-twl regulators
---
arch/arm/mach-omap2/hsmmc.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 34272e4..a74631d 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -186,15 +186,13 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
if (mmc->slots[0].remux)
mmc->slots[0].remux(dev, slot, power_on);
- if (power_on) {
- /* Only MMC2 supports a CLKIN */
- if (mmc->slots[0].internal_clock) {
- u32 reg;
+ /* Only MMC2 supports a CLKIN */
+ if (mmc->slots[0].internal_clock) {
+ u32 reg;
- reg = omap_ctrl_readl(control_devconf1_offset);
- reg |= OMAP2_MMCSDIO2ADPCLKISEL;
- omap_ctrl_writel(reg, control_devconf1_offset);
- }
+ reg = omap_ctrl_readl(control_devconf1_offset);
+ reg |= OMAP2_MMCSDIO2ADPCLKISEL;
+ omap_ctrl_writel(reg, control_devconf1_offset);
}
}
--
1.6.6.1
@@ -0,0 +1,55 @@
From ade216c2689a2dae645ca95fa443ee8eacfafb67 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 4 Feb 2010 12:26:22 -0800
Subject: [PATCH 23/29] RTC: add support for backup battery recharge
---
drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index ed1b868..33a8598 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -30,6 +30,23 @@
#include <linux/i2c/twl.h>
+/*
+ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER)
+ */
+#define REG_BB_CFG 0x12
+
+/* PM_RECEIVER BB_CFG bitfields */
+#define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03
/*
* RTC block register offsets (use TWL_MODULE_RTC)
@@ -508,6 +525,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
if (ret < 0)
goto out2;
+ /* enable backup battery charging */
+ /* use a conservative 25uA @ 3.1V */
+ ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ BIT_PM_RECEIVER_BB_CFG_BBCHEN |
+ BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
+ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
+ REG_BB_CFG);
+
return ret;
out2:
--
1.6.6.1
@@ -0,0 +1,49 @@
From 6a2f14bdd390695f5d88fb8ea18df8f80bddfc9d Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Wed, 24 Feb 2010 10:37:22 -0800
Subject: [PATCH 24/29] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options
---
arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++
arch/arm/mach-omap2/board-overo.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 781844c..006dc26 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -759,7 +759,13 @@ static struct omap_board_mux board_mux[] __initdata = {
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#if defined(CONFIG_USB_MUSB_OTG)
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#else
+ .mode = MUSB_HOST,
+#endif
.power = 100,
};
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 17f066a..b28a9d5 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -447,7 +447,13 @@ static struct omap_board_mux board_mux[] __initdata = {
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#if defined(CONFIG_USB_MUSB_OTG)
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#else
+ .mode = MUSB_HOST,
+#endif
.power = 100,
};
--
1.6.6.1
@@ -0,0 +1,34 @@
From 6e383eb63993e011b6bdec84e3eb001e6b9e00a1 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 10 May 2010 13:59:14 -0700
Subject: [PATCH 25/29] OMAP: DSS2: check for both cpu type and revision, rather than just revision
---
drivers/video/omap2/dss/dispc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fa40fa5..133916a 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2101,7 +2101,7 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode)
static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
int vsw, int vfp, int vbp)
{
- if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
+ if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) {
if (hsw < 1 || hsw > 64 ||
hfp < 1 || hfp > 256 ||
hbp < 1 || hbp > 256 ||
@@ -2134,7 +2134,7 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp,
{
u32 timing_h, timing_v;
- if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
+ if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) {
timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
FLD_VAL(hbp-1, 27, 20);
--
1.6.6.1
@@ -0,0 +1,355 @@
From 66db8210263893e9ffd4478c36a3a1a89bdaff37 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Fri, 18 Dec 2009 06:39:24 -0800
Subject: [PATCH 26/29] OMAP: DSS2: Add DSS2 support for Overo
---
arch/arm/mach-omap2/board-overo.c | 238 +++++++++++++++++++++++++++++++------
1 files changed, 204 insertions(+), 34 deletions(-)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b28a9d5..8a44c17 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -28,6 +28,7 @@
#include <linux/platform_device.h>
#include <linux/i2c/twl.h>
#include <linux/regulator/machine.h>
+#include <linux/spi/spi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -41,10 +42,13 @@
#include <plat/board.h>
#include <plat/common.h>
+#include <plat/display.h>
#include <mach/gpio.h>
#include <plat/gpmc.h>
#include <mach/hardware.h>
#include <plat/nand.h>
+#include <plat/mcspi.h>
+#include <plat/mux.h>
#include <plat/usb.h>
#include "mux.h"
@@ -68,8 +72,6 @@
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-#include <plat/mcspi.h>
-#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
static struct omap2_mcspi_device_config ads7846_mcspi_config = {
@@ -94,18 +96,6 @@ static struct ads7846_platform_data ads7846_config = {
.keep_vref_on = 1,
};
-static struct spi_board_info overo_spi_board_info[] __initdata = {
- {
- .modalias = "ads7846",
- .bus_num = 1,
- .chip_select = 0,
- .max_speed_hz = 1500000,
- .controller_data = &ads7846_mcspi_config,
- .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
- .platform_data = &ads7846_config,
- }
-};
-
static void __init overo_ads7846_init(void)
{
if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
@@ -115,9 +105,6 @@ static void __init overo_ads7846_init(void)
printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
return;
}
-
- spi_register_board_info(overo_spi_board_info,
- ARRAY_SIZE(overo_spi_board_info));
}
#else
@@ -233,6 +220,139 @@ static inline void __init overo_init_smsc911x(void)
static inline void __init overo_init_smsc911x(void) { return; }
#endif
+/* DSS */
+static int lcd_enabled;
+static int dvi_enabled;
+
+#define OVERO_GPIO_LCD_EN 144
+#define OVERO_GPIO_LCD_BL 145
+
+static void __init overo_display_init(void)
+{
+ if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
+ (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
+ gpio_export(OVERO_GPIO_LCD_EN, 0);
+ else
+ printk(KERN_ERR "could not obtain gpio for "
+ "OVERO_GPIO_LCD_EN\n");
+
+ if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
+ (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
+ gpio_export(OVERO_GPIO_LCD_BL, 0);
+ else
+ printk(KERN_ERR "could not obtain gpio for "
+ "OVERO_GPIO_LCD_BL\n");
+}
+
+static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
+{
+ if (lcd_enabled) {
+ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+ return -EINVAL;
+ }
+ dvi_enabled = 1;
+
+ return 0;
+}
+
+static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
+{
+ dvi_enabled = 0;
+}
+
+static struct omap_dss_device overo_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+ .platform_enable = overo_panel_enable_dvi,
+ .platform_disable = overo_panel_disable_dvi,
+};
+
+static struct omap_dss_device overo_tv_device = {
+ .name = "tv",
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+};
+
+static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ if (dvi_enabled) {
+ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+ return -EINVAL;
+ }
+
+ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+ gpio_set_value(OVERO_GPIO_LCD_BL, 1);
+ lcd_enabled = 1;
+ return 0;
+}
+
+static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+ gpio_set_value(OVERO_GPIO_LCD_BL, 0);
+ lcd_enabled = 0;
+}
+
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+static struct omap_dss_device overo_lcd35_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "lcd35",
+ .driver_name = "lgphilips_lb035q02_panel",
+ .phy.dpi.data_lines = 24,
+ .platform_enable = overo_panel_enable_lcd,
+ .platform_disable = overo_panel_disable_lcd,
+};
+#endif
+
+#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \
+ defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE)
+static struct omap_dss_device overo_lcd43_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "lcd43",
+ .driver_name = "samsung_lte_panel",
+ .phy.dpi.data_lines = 24,
+ .platform_enable = overo_panel_enable_lcd,
+ .platform_disable = overo_panel_disable_lcd,
+};
+#endif
+
+static struct omap_dss_device *overo_dss_devices[] = {
+ &overo_dvi_device,
+ &overo_tv_device,
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+ &overo_lcd35_device,
+#endif
+#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \
+ defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE)
+ &overo_lcd43_device,
+#endif
+};
+
+static struct omap_dss_board_info overo_dss_data = {
+ .num_devices = ARRAY_SIZE(overo_dss_devices),
+ .devices = overo_dss_devices,
+ .default_device = &overo_dvi_device,
+};
+
+static struct platform_device overo_dss_device = {
+ .name = "omapdss",
+ .id = -1,
+ .dev = {
+ .platform_data = &overo_dss_data,
+ },
+};
+
+static struct regulator_consumer_supply overo_vdda_dac_supply =
+ REGULATOR_SUPPLY("vdda_dac", "omapdss");
+
+static struct regulator_consumer_supply overo_vdds_dsi_supply =
+ REGULATOR_SUPPLY("vdds_dsi", "omapdss");
+
static struct mtd_partition overo_nand_partitions[] = {
{
.name = "xloader",
@@ -358,6 +478,37 @@ static struct regulator_init_data overo_vmmc1 = {
.consumer_supplies = &overo_vmmc1_supply,
};
+/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
+static struct regulator_init_data overo_vdac = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &overo_vdda_dac_supply,
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_init_data overo_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &overo_vdds_dsi_supply,
+};
+
+/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
+
static struct twl4030_codec_audio_data overo_audio_data = {
.audio_mclk = 26000000,
};
@@ -367,8 +518,6 @@ static struct twl4030_codec_data overo_codec_data = {
.audio = &overo_audio_data,
};
-/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
-
static struct twl4030_madc_platform_data overo_madc_data = {
.irq_line = 1,
};
@@ -381,6 +530,8 @@ static struct twl4030_platform_data overo_twldata = {
.usb = &overo_usb_data,
.codec = &overo_codec_data,
.vmmc1 = &overo_vmmc1,
+ .vdac = &overo_vdac,
+ .vpll2 = &overo_vpll2,
};
static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
@@ -401,23 +552,41 @@ static int __init overo_i2c_init(void)
return 0;
}
-static struct platform_device overo_lcd_device = {
- .name = "overo_lcd",
- .id = -1,
-};
-
-static struct omap_lcd_config overo_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct spi_board_info overo_spi_board_info[] __initdata = {
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
+ defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+ {
+ .modalias = "ads7846",
+ .bus_num = 1,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &ads7846_mcspi_config,
+ .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
+ .platform_data = &ads7846_config,
+ },
+#endif
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+ {
+ .modalias = "lgphilips_lb035q02_panel-spi",
+ .bus_num = 1,
+ .chip_select = 1,
+ .max_speed_hz = 500000,
+ .mode = SPI_MODE_3,
+ },
+#endif
};
-static struct omap_board_config_kernel overo_config[] __initdata = {
- { OMAP_TAG_LCD, &overo_lcd_config },
-};
+static int __init overo_spi_init(void)
+{
+ overo_ads7846_init();
+ spi_register_board_info(overo_spi_board_info,
+ ARRAY_SIZE(overo_spi_board_info));
+ return 0;
+}
static void __init overo_init_irq(void)
{
- omap_board_config = overo_config;
- omap_board_config_size = ARRAY_SIZE(overo_config);
omap2_init_common_infrastructure();
omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
@@ -425,7 +594,7 @@ static void __init overo_init_irq(void)
}
static struct platform_device *overo_devices[] __initdata = {
- &overo_lcd_device,
+ &overo_dss_device,
};
static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -466,8 +635,9 @@ static void __init overo_init(void)
overo_flash_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
- overo_ads7846_init();
+ overo_spi_init();
overo_init_smsc911x();
+ overo_display_init();
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -510,7 +680,7 @@ static void __init overo_init(void)
"OVERO_GPIO_USBH_CPEN\n");
}
-MACHINE_START(OVERO, "Gumstix Overo")
+MACHINE_START(OVERO, "Gumstsix Overo")
.boot_params = 0x80000100,
.map_io = omap3_map_io,
.reserve = omap_reserve,
--
1.6.6.1
@@ -0,0 +1,80 @@
From 98d0c3ce9209fe34699ec99aa90efab39fe05c36 Mon Sep 17 00:00:00 2001
From: Philip Balister <balister@nomad.(none)>
Date: Wed, 17 Feb 2010 14:51:39 -0800
Subject: [PATCH 27/29] Add defines to set config options in GPMC per CS control registers.
---
arch/arm/plat-omap/include/plat/gpmc.h | 36 ++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 85ded59..1a6c748 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -46,6 +46,11 @@
#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
#define GPMC_ECC_READSYN 2 /* Reset before syndrom is read back */
+#define GPMC_CONFIG 0x50
+#define GPMC_STATUS 0x54
+#define GPMC_CS0_BASE 0x60
+#define GPMC_CS_SIZE 0x30
+
#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30)
#define GPMC_CONFIG1_READTYPE_ASYNC (0 << 29)
@@ -63,6 +68,7 @@
#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)
#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10)
#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
+#define GPMC_CONFIG1_DEVICETYPE_NAND GPMC_CONFIG1_DEVICETYPE(2)
#define GPMC_CONFIG1_MUXADDDATA (1 << 9)
#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3)
@@ -79,6 +85,35 @@
#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
+#define GPMC_CONFIG2_CSWROFFTIME(val) ((val & 31) << 16)
+#define GPMC_CONFIG2_CSRDOFFTIME(val) ((val & 31) << 8)
+#define GPMC_CONFIG2_CSEXTRADELAY (1 << 7)
+#define GPMC_CONFIG2_CSONTIME(val) (val & 15)
+
+#define GPMC_CONFIG3_ADVWROFFTIME(val) ((val & 31) << 16)
+#define GPMC_CONFIG3_ADVRDOFFTIME(val) ((val & 31) << 8)
+#define GPMC_CONFIG3_ADVEXTRADELAY (1 << 7)
+#define GPMC_CONFIG3_ADVONTIME(val) (val & 15)
+
+#define GPMC_CONFIG4_WEOFFTIME(val) ((val & 31) << 24)
+#define GPMC_CONFIG4_WEEXTRADELAY (1 << 23)
+#define GPMC_CONFIG4_WEONTIME(val) ((val & 15) << 16)
+#define GPMC_CONFIG4_OEOFFTIME(val) ((val & 31) << 8)
+#define GPMC_CONFIG4_OEEXTRADELAY (1 << 7)
+#define GPMC_CONFIG4_OEONTIME(val) (val & 15)
+
+#define GPMC_CONFIG5_PAGEBURSTACCESSTIME(val) ((val & 15) << 24)
+#define GPMC_CONFIG5_RDACCESSTIME(val) ((val & 31) << 16)
+#define GPMC_CONFIG5_WRCYCLETIME(val) ((val & 31) << 8)
+#define GPMC_CONFIG5_RDCYCLETIME(val) (val & 31)
+
+#define GPMC_CONFIG6_WRACCESSTIME(val) ((val & 31) << 24)
+#define GPMC_CONFIG6_WRDATAONADMUXBUS(val) ((val & 15) << 16)
+#define GPMC_CONFIG6_CYCLE2CYCLEDELAY(val) ((val & 15) << 8)
+#define GPMC_CONFIG6_CYCLE2CYCLESAMECSEN (1 << 7)
+#define GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN (1 << 6)
+#define GPMC_CONFIG6_BUSTURNAROUND(val) (val & 15)
+
/*
* Note that all values in this struct are in nanoseconds except sync_clk
* (which is in picoseconds), while the register values are in gpmc_fck cycles.
@@ -133,6 +168,7 @@ extern int gpmc_cs_reserved(int cs);
extern int gpmc_prefetch_enable(int cs, int dma_mode,
unsigned int u32_count, int is_write);
extern int gpmc_prefetch_reset(int cs);
+extern int gpmc_prefetch_status(void);
extern void omap3_gpmc_save_context(void);
extern void omap3_gpmc_restore_context(void);
extern void gpmc_init(void);
--
1.6.6.1
@@ -0,0 +1,83 @@
From 5469329878e4bdb38fe39fc95676d9b752b1528f Mon Sep 17 00:00:00 2001
From: Philip Balister <philip@opensdr.com>
Date: Thu, 22 Apr 2010 19:41:58 -0700
Subject: [PATCH 28/29] Add functions to dma.c to set address and length for src and dest.
---
arch/arm/plat-omap/dma.c | 30 ++++++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/dma.h | 4 ++++
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c4b2b47..f28f756 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -471,6 +471,21 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
}
EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
+void omap_set_dma_src_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+ if (cpu_class_is_omap1()) {
+ p->dma_write(addr >> 16, CSSA, lch);
+ //p->dma_write((u16)addr, CSSA_L, lch);
+ }
+
+ if (cpu_class_is_omap2())
+ p->dma_write(addr, CSSA, lch);
+
+ p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_src_addr_size);
+
/* Note that dest_port is only for OMAP1 */
void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
unsigned long dest_start,
@@ -561,6 +576,21 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
}
EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
+void omap_set_dma_dest_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+ if (cpu_class_is_omap1()) {
+ p->dma_write(addr >> 16, CDSA, lch);
+ //p->dma_write((u16)addr, CDSA_L, lch);
+ }
+
+ if (cpu_class_is_omap2())
+ p->dma_write(addr, CDSA, lch);
+
+ p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_dest_addr_size);
+
static inline void omap_enable_channel_irq(int lch)
{
u32 status;
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index d1c916f..1e7243e 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -462,6 +462,8 @@ extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
extern void omap_set_dma_src_data_pack(int lch, int enable);
extern void omap_set_dma_src_burst_mode(int lch,
enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_src_addr_size(int lch, unsigned int addr,
+ int elem_count);
extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
unsigned long dest_start,
@@ -470,6 +472,8 @@ extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
extern void omap_set_dma_dest_data_pack(int lch, int enable);
extern void omap_set_dma_dest_burst_mode(int lch,
enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_dest_addr_size(int lch, unsigned int addr,
+ int elem_count);
extern void omap_set_dma_params(int lch,
struct omap_dma_channel_params *params);
--
1.6.6.1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
../beagleboard/defconfig
@@ -0,0 +1 @@
../beagleboard/defconfig
@@ -0,0 +1 @@
../beagleboard/defconfig
@@ -0,0 +1 @@
../beagleboard/defconfig
@@ -0,0 +1,28 @@
From 6fc2495bb9f1fa166f7f4190ecd0b988034f54ea Mon Sep 17 00:00:00 2001
From: Jason Kridner <jkridner@beagleboard.org>
Date: Sat, 17 Jul 2010 14:28:22 -0500
Subject: [PATCH] BeagleBoard: Adjust USER button pin for xM
---
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 7c9e40a..f93616b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -829,6 +829,11 @@ static void __init omap3_beagle_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap3_beagle_i2c_init();
+
+ if (cpu_is_omap3630()) {
+ gpio_buttons[0].gpio = 4;
+ }
+
platform_add_devices(omap3_beagle_devices,
ARRAY_SIZE(omap3_beagle_devices));
omap_serial_init();
--
1.6.6.1
@@ -0,0 +1,67 @@
From aab782ab0942d6fd654311b937596b24a0ace3c6 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Fri, 30 Apr 2010 11:12:24 +0200
Subject: [PATCH 01/45] Revert "omap3: beagle: Fix compile-time errors"
This commit clashes with the other beagle patches we apply on top
This reverts commit da5b291cba631d303cb137fa6a620c494d828197.
---
arch/arm/mach-omap2/board-omap3beagle.c | 34 ++----------------------------
1 files changed, 3 insertions(+), 31 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 865a8d7..15e48f2 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -56,22 +56,6 @@
#define NAND_BLOCK_SIZE SZ_128K
-#ifdef CONFIG_PM
-static struct omap_opp * _omap35x_mpu_rate_table = omap35x_mpu_rate_table;
-static struct omap_opp * _omap37x_mpu_rate_table = omap37x_mpu_rate_table;
-static struct omap_opp * _omap35x_dsp_rate_table = omap35x_dsp_rate_table;
-static struct omap_opp * _omap37x_dsp_rate_table = omap37x_dsp_rate_table;
-static struct omap_opp * _omap35x_l3_rate_table = omap35x_l3_rate_table;
-static struct omap_opp * _omap37x_l3_rate_table = omap37x_l3_rate_table;
-#else /* CONFIG_PM */
-static struct omap_opp * _omap35x_mpu_rate_table = NULL;
-static struct omap_opp * _omap37x_mpu_rate_table = NULL;
-static struct omap_opp * _omap35x_dsp_rate_table = NULL;
-static struct omap_opp * _omap37x_dsp_rate_table = NULL;
-static struct omap_opp * _omap35x_l3_rate_table = NULL;
-static struct omap_opp * _omap37x_l3_rate_table = NULL;
-#endif /* CONFIG_PM */
-
static struct mtd_partition omap3beagle_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
@@ -377,21 +361,9 @@ static void __init omap3_beagle_init_irq(void)
{
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
-
- if (cpu_is_omap3630()) {
- omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params,
- _omap37x_mpu_rate_table,
- _omap37x_dsp_rate_table,
- _omap37x_l3_rate_table);
- } else {
- omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params,
- _omap35x_mpu_rate_table,
- _omap35x_dsp_rate_table,
- _omap35x_l3_rate_table);
- }
-
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
+ omap3_dsp_rate_table, omap3_l3_rate_table);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
--
1.6.6.1
@@ -0,0 +1,61 @@
From 06352060e3862e2c11719a6ef4ac0ae1b5f5fdf6 Mon Sep 17 00:00:00 2001
From: Koen Kooi <k-kooi@ti.com>
Date: Sat, 30 Jan 2010 15:49:15 +0100
Subject: [PATCH 02/45] board-omap3touchbook: make it build against TI linux-omap 2.6.32-PSP
---
arch/arm/mach-omap2/board-omap3touchbook.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index fe3d22c..fc3e03c 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/leds.h>
#include <linux/gpio.h>
+#include <linux/irq.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
@@ -48,12 +49,18 @@
#include <plat/nand.h>
#include <plat/usb.h>
#include <plat/timer-gp.h>
+#include <plat/clock.h>
+#include <plat/omap-pm.h>
#include "mux.h"
#include "mmc-twl4030.h"
+#include "pm.h"
+#include "omap3-opp.h"
+
#include <asm/setup.h>
+
#define GPMC_CS0_BASE 0x60
#define GPMC_CS_SIZE 0x30
@@ -78,7 +85,6 @@ static struct mtd_partition omap3touchbook_nand_partitions[] = {
.name = "U-Boot",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
.size = 15 * NAND_BLOCK_SIZE,
- .mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot Env",
@@ -440,7 +446,8 @@ static void __init omap3_touchbook_init_irq(void)
omap_board_config = omap3_touchbook_config;
omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params);
+ mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table,
+ omap35x_dsp_rate_table, omap35x_l3_rate_table);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
--
1.6.6.1
@@ -0,0 +1,135 @@
From 4afa80923880088a3d6780257ccce72a88884e19 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 15:34:29 -0800
Subject: [PATCH 03/45] ARM: OMAP: add support for TCT Zippy to Beagle board file
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
arch/arm/mach-omap2/board-omap3beagle.c | 74 +++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 15e48f2..a4a793f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -21,6 +21,7 @@
#include <linux/io.h>
#include <linux/leds.h>
#include <linux/gpio.h>
+#include <linux/irq.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
@@ -56,6 +57,49 @@
#define NAND_BLOCK_SIZE SZ_128K
+#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
+
+#include <plat/mcspi.h>
+#include <linux/spi/spi.h>
+
+#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
+
+static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3beagle_spi_board_info[] __initdata = {
+ {
+ .modalias = "enc28j60",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 20000000,
+ .controller_data = &enc28j60_spi_chip_info,
+ },
+};
+
+static void __init omap3beagle_enc28j60_init(void)
+{
+ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
+ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
+ omap3beagle_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
+ set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
+ } else {
+ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
+ return;
+ }
+
+ spi_register_board_info(omap3beagle_spi_board_info,
+ ARRAY_SIZE(omap3beagle_spi_board_info));
+}
+
+#else
+static inline void __init omap3beagle_enc28j60_init(void) { return; }
+#endif
+
+
static struct mtd_partition omap3beagle_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
@@ -118,6 +162,14 @@ static struct twl4030_hsmmc_info mmc[] = {
.wires = 8,
.gpio_wp = 29,
},
+ {
+ .mmc = 2,
+ .wires = 4,
+ .gpio_wp = 141,
+ .gpio_cd = 162,
+ .transceiver = true,
+ .ocr_mask = 0x00100000, /* 3.3V */
+ },
{} /* Terminator */
};
@@ -281,7 +333,7 @@ static struct twl4030_platform_data beagle_twldata = {
.vpll2 = &beagle_vpll2,
};
-static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
+static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
{
I2C_BOARD_INFO("twl4030", 0x48),
.flags = I2C_CLIENT_WAKE,
@@ -290,10 +342,24 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
},
};
+#if defined(CONFIG_RTC_DRV_DS1307) || \
+ defined(CONFIG_RTC_DRV_DS1307_MODULE)
+
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("ds1307", 0x68),
+ },
+};
+#else
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+#endif
+
static int __init omap3_beagle_i2c_init(void)
{
- omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
- ARRAY_SIZE(beagle_i2c_boardinfo));
+ omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
+ ARRAY_SIZE(beagle_i2c1_boardinfo));
+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_i2c2_boardinfo));
/* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 100, NULL, 0);
@@ -453,6 +519,8 @@ static void __init omap3_beagle_init(void)
/* REVISIT leave DVI powered down until it's needed ... */
gpio_direction_output(170, true);
+ omap3beagle_enc28j60_init();
+
usb_musb_init();
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
--
1.6.6.1
@@ -0,0 +1,24 @@
From ef987a45a496dad17bafb2dead78513a7f820dc8 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 12:40:24 -0800
Subject: [PATCH 04/45] ARM: OMAP: Make beagle u-boot partition writable
---
arch/arm/mach-omap2/board-omap3beagle.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a4a793f..4b2dd65 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -112,7 +112,6 @@ static struct mtd_partition omap3beagle_nand_partitions[] = {
.name = "U-Boot",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
.size = 15 * NAND_BLOCK_SIZE,
- .mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot Env",
--
1.6.6.1
@@ -0,0 +1,200 @@
From 3915909dbac222212ee97bd6c8057df442a85bd3 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Wed, 10 Feb 2010 15:07:36 +0100
Subject: [PATCH 05/45] board-omap3-beagle: add DSS2 support
---
arch/arm/mach-omap2/board-omap3beagle.c | 130 ++++++++++++++++++++++++-------
1 files changed, 103 insertions(+), 27 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 4b2dd65..79d43d0 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -40,6 +40,7 @@
#include <plat/board.h>
#include <plat/common.h>
+#include <plat/display.h>
#include <plat/gpmc.h>
#include <plat/nand.h>
#include <plat/usb.h>
@@ -153,6 +154,105 @@ static struct platform_device omap3beagle_nand_device = {
.resource = &omap3beagle_nand_resource,
};
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 1);
+
+ return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+ .reset_gpio = 170,
+ .platform_enable = beagle_enable_dvi,
+ .platform_disable = beagle_disable_dvi,
+};
+
+static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+#define ENABLE_VDAC_DEDICATED 0x03
+#define ENABLE_VDAC_DEV_GRP 0x20
+
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEDICATED,
+ TWL4030_VDAC_DEDICATED);
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+
+ return 0;
+}
+
+static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEDICATED);
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEV_GRP);
+}
+
+static struct omap_dss_device beagle_tv_device = {
+ .name = "tv",
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ .platform_enable = beagle_panel_enable_tv,
+ .platform_disable = beagle_panel_disable_tv,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+ &beagle_dvi_device,
+ &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+ .num_devices = ARRAY_SIZE(beagle_dss_devices),
+ .devices = beagle_dss_devices,
+ .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+ .name = "omapdss",
+ .id = -1,
+ .dev = {
+ .platform_data = &beagle_dss_data,
+ },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply = {
+ .supply = "vdda_dac",
+ .dev = &beagle_dss_device.dev,
+};
+
+static struct regulator_consumer_supply beagle_vdvi_supply = {
+ .supply = "vdds_dsi",
+ .dev = &beagle_dss_device.dev,
+};
+
+static void __init beagle_display_init(void)
+{
+ int r;
+
+ r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+ if (r < 0) {
+ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
#include "sdram-micron-mt46h32m32lf-6.h"
static struct twl4030_hsmmc_info mmc[] = {
@@ -172,15 +272,6 @@ static struct twl4030_hsmmc_info mmc[] = {
{} /* Terminator */
};
-static struct platform_device omap3_beagle_lcd_device = {
- .name = "omap3beagle_lcd",
- .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
- .ctrl_name = "internal",
-};
-
static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
};
@@ -236,16 +327,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
.setup = beagle_twl_gpio_setup,
};
-static struct regulator_consumer_supply beagle_vdac_supply = {
- .supply = "vdac",
- .dev = &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
- .supply = "vdvi",
- .dev = &omap3_beagle_lcd_device.dev,
-};
-
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -418,14 +499,8 @@ static struct platform_device keys_gpio = {
},
};
-static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
- { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
-};
-
static void __init omap3_beagle_init_irq(void)
{
- omap_board_config = omap3_beagle_config;
- omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
omap3_dsp_rate_table, omap3_l3_rate_table);
@@ -437,9 +512,9 @@ static void __init omap3_beagle_init_irq(void)
}
static struct platform_device *omap3_beagle_devices[] __initdata = {
- &omap3_beagle_lcd_device,
&leds_gpio,
&keys_gpio,
+ &beagle_dss_device,
};
static void __init omap3beagle_flash_init(void)
@@ -527,8 +602,9 @@ static void __init omap3_beagle_init(void)
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
-}
+ beagle_display_init();
+}
static void __init omap3_beagle_map_io(void)
{
omap2_set_globals_343x();
--
1.6.6.1
@@ -0,0 +1,103 @@
From f8b1eeb8f3dc580f24b5d2a2b140c74cfa88c5eb Mon Sep 17 00:00:00 2001
From: Koen Kooi <k-kooi@ti.com>
Date: Wed, 27 Jan 2010 21:57:13 +0100
Subject: [PATCH 06/45] board-omap3beagle: prepare for DM3730 based BeagleboardXM
* OPP changes copy/pasted from board-omap3evm.c
* EHCI changes copy/pasted from Steve Kipisz' 2.6.33rcX work
* turn on power to camera on boot and add some comments
---
arch/arm/mach-omap2/board-omap3beagle.c | 62 +++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 79d43d0..b1e4d73 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -53,6 +53,23 @@
#include "pm.h"
#include "omap3-opp.h"
+#ifdef CONFIG_PM
+static struct omap_opp * _omap35x_mpu_rate_table = omap35x_mpu_rate_table;
+static struct omap_opp * _omap37x_mpu_rate_table = omap37x_mpu_rate_table;
+static struct omap_opp * _omap35x_dsp_rate_table = omap35x_dsp_rate_table;
+static struct omap_opp * _omap37x_dsp_rate_table = omap37x_dsp_rate_table;
+static struct omap_opp * _omap35x_l3_rate_table = omap35x_l3_rate_table;
+static struct omap_opp * _omap37x_l3_rate_table = omap37x_l3_rate_table;
+#else /* CONFIG_PM */
+static struct omap_opp * _omap35x_mpu_rate_table = NULL;
+static struct omap_opp * _omap37x_mpu_rate_table = NULL;
+static struct omap_opp * _omap35x_dsp_rate_table = NULL;
+static struct omap_opp * _omap37x_dsp_rate_table = NULL;
+static struct omap_opp * _omap35x_l3_rate_table = NULL;
+static struct omap_opp * _omap37x_l3_rate_table = NULL;
+#endif /* CONFIG_PM */
+
+
#define GPMC_CS0_BASE 0x60
#define GPMC_CS_SIZE 0x30
@@ -303,12 +320,28 @@ static int beagle_twl_gpio_setup(struct device *dev,
* power switch and overcurrent detect
*/
- gpio_request(gpio + 1, "EHCI_nOC");
- gpio_direction_input(gpio + 1);
+ if (cpu_is_omap3630()) {
+ /* Power on DVI, Serial and PWR led */
+ gpio_request(gpio + 1, "nDVI_PWR_EN");
+ gpio_direction_output(gpio + 1, 0);
+
+ /* Power on camera interface */
+ gpio_request(gpio + 2, "CAM_EN");
+ gpio_direction_output(gpio + 2, 1);
+
+ /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+ }
+ else {
+ gpio_request(gpio + 1, "EHCI_nOC");
+ gpio_direction_input(gpio + 1);
+
+ /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
+ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+ }
- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -501,9 +534,22 @@ static struct platform_device keys_gpio = {
static void __init omap3_beagle_init_irq(void)
{
- omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ if (cpu_is_omap3630())
+ {
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ NULL,
+ _omap37x_mpu_rate_table,
+ _omap37x_dsp_rate_table,
+ _omap37x_l3_rate_table);
+ }
+ else
+ {
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ NULL,
+ _omap35x_mpu_rate_table,
+ _omap35x_dsp_rate_table,
+ _omap35x_l3_rate_table);
+ }
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
--
1.6.6.1
@@ -0,0 +1,172 @@
From 902bf175d5050e9f9892b594bd6093b65c1be8cc Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 3 May 2010 14:41:29 +0200
Subject: [PATCH 07/45] ARM: OMAP: beagleboard: Add infrastructure to do fixups based on expansionboard name passed by u-boot
And add support for zippy2
---
arch/arm/mach-omap2/board-omap3beagle.c | 88 +++++++++++++++++++++++++++----
1 files changed, 78 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index b1e4d73..8223763 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -75,6 +75,8 @@ static struct omap_opp * _omap37x_l3_rate_table = NULL;
#define NAND_BLOCK_SIZE SZ_128K
+char expansionboard_name[16];
+
#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
#include <plat/mcspi.h>
@@ -87,7 +89,7 @@ static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
.single_channel = 1, /* 0: slave, 1: master */
};
-static struct spi_board_info omap3beagle_spi_board_info[] __initdata = {
+static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = {
{
.modalias = "enc28j60",
.bus_num = 4,
@@ -102,21 +104,62 @@ static void __init omap3beagle_enc28j60_init(void)
if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
(gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
- omap3beagle_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
- set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
+ omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
+ set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
} else {
printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
return;
}
- spi_register_board_info(omap3beagle_spi_board_info,
- ARRAY_SIZE(omap3beagle_spi_board_info));
+ spi_register_board_info(omap3beagle_zippy_spi_board_info,
+ ARRAY_SIZE(omap3beagle_zippy_spi_board_info));
}
#else
static inline void __init omap3beagle_enc28j60_init(void) { return; }
#endif
+#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
+
+#include <plat/mcspi.h>
+#include <linux/spi/spi.h>
+
+#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157
+
+static struct omap2_mcspi_device_config ks8851_spi_chip_info = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = {
+ {
+ .modalias = "ks8851",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 36000000,
+ .controller_data = &ks8851_spi_chip_info,
+ },
+};
+
+static void __init omap3beagle_ks8851_init(void)
+{
+ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) &&
+ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) {
+ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0);
+ omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ);
+ set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
+ } else {
+ printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n");
+ return;
+ }
+
+ spi_register_board_info(omap3beagle_zippy2_spi_board_info,
+ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info));
+}
+
+#else
+static inline void __init omap3beagle_ks8851_init(void) { return; }
+#endif
static struct mtd_partition omap3beagle_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
@@ -281,8 +324,6 @@ static struct twl4030_hsmmc_info mmc[] = {
{
.mmc = 2,
.wires = 4,
- .gpio_wp = 141,
- .gpio_cd = 162,
.transceiver = true,
.ocr_mask = 0x00100000, /* 3.3V */
},
@@ -601,7 +642,7 @@ static void __init omap3beagle_flash_init(void)
}
}
-static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
@@ -621,6 +662,15 @@ static struct omap_board_mux board_mux[] __initdata = {
#define board_mux NULL
#endif
+static int __init expansionboard_setup(char *str)
+{
+ if (!str)
+ return -EINVAL;
+ strncpy(expansionboard_name, str, 16);
+ printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name);
+ return 0;
+}
+
static void __init omap3_beagle_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -639,8 +689,24 @@ static void __init omap3_beagle_init(void)
/* REVISIT leave DVI powered down until it's needed ... */
gpio_direction_output(170, true);
- omap3beagle_enc28j60_init();
-
+ if(!strcmp(expansionboard_name, "zippy"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n");
+ omap3beagle_enc28j60_init();
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
+ mmc[1].gpio_wp = 141;
+ mmc[1].gpio_cd = 162;
+ }
+
+ if(!strcmp(expansionboard_name, "zippy2"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n");
+ omap3beagle_ks8851_init();
+ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
+ mmc[1].gpio_wp = 141;
+ mmc[1].gpio_cd = 162;
+ }
+
usb_musb_init();
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
@@ -657,6 +723,8 @@ static void __init omap3_beagle_map_io(void)
omap2_map_common_io();
}
+early_param("buddy", expansionboard_setup);
+
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
.phys_io = 0x48000000,
--
1.6.6.1
@@ -0,0 +1,57 @@
From 35b951339ea47b542c548e102768817d4123a24b Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 3 May 2010 21:38:34 +0200
Subject: [PATCH 08/45] ARM: OMAP: beagleboard: pre-export GPIOs to userspace when using a Tincantools trainerboard
This really needs a for loop, patches welcome
---
arch/arm/mach-omap2/board-omap3beagle.c | 33 ++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 8223763..abbc1b2 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -706,7 +706,38 @@ static void __init omap3_beagle_init(void)
mmc[1].gpio_wp = 141;
mmc[1].gpio_cd = 162;
}
-
+
+ if(!strcmp(expansionboard_name, "trainer"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n");
+ gpio_request(130, "sysfs");
+ gpio_export(130, 1);
+ gpio_request(131, "sysfs");
+ gpio_export(131, 1);
+ gpio_request(132, "sysfs");
+ gpio_export(132, 1);
+ gpio_request(133, "sysfs");
+ gpio_export(133, 1);
+ gpio_request(134, "sysfs");
+ gpio_export(134, 1);
+ gpio_request(135, "sysfs");
+ gpio_export(135, 1);
+ gpio_request(136, "sysfs");
+ gpio_export(136, 1);
+ gpio_request(137, "sysfs");
+ gpio_export(137, 1);
+ gpio_request(138, "sysfs");
+ gpio_export(138, 1);
+ gpio_request(139, "sysfs");
+ gpio_export(139, 1);
+ gpio_request(140, "sysfs");
+ gpio_export(140, 1);
+ gpio_request(141, "sysfs");
+ gpio_export(141, 1);
+ gpio_request(162, "sysfs");
+ gpio_export(162, 1);
+ }
+
usb_musb_init();
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
--
1.6.6.1
@@ -0,0 +1,76 @@
From 9b98719bf7787f1ec8eef6b09cb5b94100de7d12 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 3 May 2010 22:31:34 +0200
Subject: [PATCH 09/45] ARM: OMAP: beagleboard: initialize ds1307 and eeprom only for zippy and zippy2
---
arch/arm/mach-omap2/board-omap3beagle.c | 39 +++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index abbc1b2..cb11b07 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -496,24 +496,55 @@ static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
},
};
+
+#if defined(CONFIG_EEPROM_AT24) || defined(CONFIG_EEPROM_AT24_MODULE)
+#include <linux/i2c/at24.h>
+
+static struct at24_platform_data m24c01 = {
+ .byte_len = SZ_1K / 8,
+ .page_size = 16,
+};
+
#if defined(CONFIG_RTC_DRV_DS1307) || \
defined(CONFIG_RTC_DRV_DS1307_MODULE)
-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {
{
I2C_BOARD_INFO("ds1307", 0x68),
},
+ {
+ I2C_BOARD_INFO("24c01", 0x50),
+ .platform_data = &m24c01,
+ },
};
#else
-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("24c01", 0x50),
+ .platform_data = &m24c01,
+ },
+};
+#endif
+#else
+static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {};
#endif
+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
+
static int __init omap3_beagle_i2c_init(void)
{
omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
ARRAY_SIZE(beagle_i2c1_boardinfo));
- omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
- ARRAY_SIZE(beagle_i2c2_boardinfo));
+ if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: registering i2c2 bus for zippy/zippy2\n");
+ omap_register_i2c_bus(2, 400, beagle_zippy_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_zippy_i2c2_boardinfo));
+ } else
+ {
+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
+ ARRAY_SIZE(beagle_i2c2_boardinfo));
+ }
/* Bus 3 is attached to the DVI port where devices like the pico DLP
* projector don't work reliably with 400kHz */
omap_register_i2c_bus(3, 100, NULL, 0);
--
1.6.6.1
@@ -0,0 +1,27 @@
From d9b1154227bf4fde9b08d3d5d427ef6e56e9cae1 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 12:45:20 -0800
Subject: [PATCH 11/45] ASoC: enable audio capture by default for twl4030
---
sound/soc/codecs/twl4030.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 74f0d65..53da465 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -46,8 +46,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
0xc3, /* REG_OPTION (0x2) */
0x00, /* REG_UNKNOWN (0x3) */
0x00, /* REG_MICBIAS_CTL (0x4) */
- 0x20, /* REG_ANAMICL (0x5) */
- 0x00, /* REG_ANAMICR (0x6) */
+ 0x34, /* REG_ANAMICL (0x5) */
+ 0x14, /* REG_ANAMICR (0x6) */
0x00, /* REG_AVADC_CTL (0x7) */
0x00, /* REG_ADCMICSEL (0x8) */
0x00, /* REG_DIGMIXING (0x9) */
--
1.6.6.1
@@ -0,0 +1,35 @@
From 20276b3c5eb8dabc7169aee30ad38f9308a0572f Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 31 Dec 2009 07:05:02 -0800
Subject: [PATCH 12/45] MTD: NAND: omap2: proper fix for subpage read ECC errors
---
drivers/mtd/nand/omap2.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 08c193c..9b185b0 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
u32 *p = (u32 *)buf;
/* take care of subpage reads */
- for (; len % 4 != 0; ) {
- *buf++ = __raw_readb(info->nand.IO_ADDR_R);
- len--;
+ if (len % 4) {
+ if (info->nand.options & NAND_BUSWIDTH_16)
+ omap_read_buf16(mtd, buf, len % 4);
+ else
+ omap_read_buf8(mtd, buf, len % 4);
+ p = (u32 *) (buf + len % 4);
+ len -= len % 4;
}
- p = (u32 *) buf;
/* configure and start prefetch transfer */
ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
--
1.6.6.1
@@ -0,0 +1,44 @@
From 37bcddac7dbfe61576489e4c55b32d8b45eb1c5a Mon Sep 17 00:00:00 2001
From: Sudeep Basavaraj <sudeep.basavaraj@ti.com>
Date: Tue, 5 Jan 2010 18:58:18 +0530
Subject: [PATCH 13/45] OMAP3630:DSS2:Enable Pre-Multiplied Alpha Support
Enables dss to process color formats with pre-mulitplied alpha values.
With this we can have alpha values defined for each pixel
and hence can have different blending values for each pixel.
Signed-off-by: Sudeep Basavaraj <sudeep.basavaraj@ti.com>
Signed-off-by: Kishore Y <kishore.y@ti.com>
---
drivers/video/omap2/dss/dispc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f7acf87..c6d5fc5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -913,6 +913,11 @@ static void _dispc_set_vid_color_conv(enum omap_plane plane, bool enable)
dispc_write_reg(dispc_reg_att[plane], val);
}
+static void _dispc_set_alpha_blend_attrs(enum omap_plane plane, bool enable)
+{
+ REG_FLD_MOD(dispc_reg_att[plane], enable ? 1 : 0, 28, 28);
+}
+
void dispc_enable_replication(enum omap_plane plane, bool enable)
{
int bit;
@@ -1689,6 +1694,9 @@ static int _dispc_setup_plane(enum omap_plane plane,
_dispc_set_rotation_attrs(plane, rotation, mirror, color_mode);
+ if (cpu_is_omap3630() && (plane != OMAP_DSS_VIDEO1))
+ _dispc_set_alpha_blend_attrs(plane, 1);
+
if (plane != OMAP_DSS_VIDEO1)
_dispc_setup_global_alpha(plane, global_alpha);
--
1.6.6.1
@@ -0,0 +1,75 @@
From d03b9f3dc00274820bed99cc22d8425d6bf0e7b4 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 19 Jan 2010 21:19:15 -0800
Subject: [PATCH 14/45] DSS2: add bootarg for selecting svideo or composite for tv output
also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp
---
drivers/video/omap2/dss/venc.c | 22 ++++++++++++++++++++++
drivers/video/omap2/omapfb/omapfb-main.c | 10 +++++++++-
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 1127e85..53fa54e 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -87,6 +87,11 @@
#define VENC_OUTPUT_TEST 0xC8
#define VENC_DAC_B__DAC_C 0xC8
+static char *tv_connection;
+
+module_param_named(tvcable, tv_connection, charp, 0);
+MODULE_PARM_DESC(tvcable, "TV connection type (svideo, composite)");
+
struct venc_config {
u32 f_control;
u32 vidout_ctrl;
@@ -430,6 +435,23 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
{
dssdev->panel.timings = omap_dss_pal_timings;
+ /* Allow the TV output to be overriden */
+ if (tv_connection) {
+ if (strcmp(tv_connection, "svideo") == 0) {
+ printk(KERN_INFO
+ "omapdss: tv output is svideo.\n");
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO;
+ } else if (strcmp(tv_connection, "composite") == 0) {
+ printk(KERN_INFO
+ "omapdss: tv output is composite.\n");
+ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE;
+ } else {
+ printk(KERN_INFO
+ "omapdss: unsupported output type'%s'.\n",
+ tv_connection);
+ }
+ }
+
return 0;
}
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 7f47a34..0fe87e0 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1988,7 +1988,15 @@ static int omapfb_mode_to_timings(const char *mode_str,
int r;
#ifdef CONFIG_OMAP2_DSS_VENC
- if (strcmp(mode_str, "pal") == 0) {
+ if (strcmp(mode_str, "pal-16") == 0) {
+ *timings = omap_dss_pal_timings;
+ *bpp = 16;
+ return 0;
+ } else if (strcmp(mode_str, "ntsc-16") == 0) {
+ *timings = omap_dss_ntsc_timings;
+ *bpp = 16;
+ return 0;
+ } else if (strcmp(mode_str, "pal") == 0) {
*timings = omap_dss_pal_timings;
*bpp = 0;
return 0;
--
1.6.6.1
@@ -0,0 +1,133 @@
From a30000387ff4ec1ab0ca46c2429bfd184210bb24 Mon Sep 17 00:00:00 2001
From: Koen Kooi <k-kooi@ti.com>
Date: Thu, 11 Feb 2010 21:34:00 +0100
Subject: [PATCH 15/45] ISP: add some more from Leopard imaging patch
---
drivers/media/video/isp/isppreview.c | 16 ++++++++-
include/media/v4l2-int-device.h | 58 ++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/isp/isppreview.c b/drivers/media/video/isp/isppreview.c
index 5494efc..85ee25d 100644
--- a/drivers/media/video/isp/isppreview.c
+++ b/drivers/media/video/isp/isppreview.c
@@ -79,13 +79,26 @@ static struct ispprev_rgbtorgb flr_rgb2rgb = {
{0x0000, 0x0000, 0x0000}
};
+static struct ispprev_rgbtorgb unity_rgb2rgb = {
+ { /* RGB-RGB Matrix */
+ {0x0100, 0x0000, 0x0000},
+ {0x0000, 0x0100, 0x0000},
+ {0x0000, 0x0000, 0x0100}
+ }, /* RGB Offset */
+ {0x0000, 0x0000, 0x0000}
+};
+
/* Default values in Office Flourescent Light for RGB to YUV Conversion*/
static struct ispprev_csc flr_prev_csc[] = {
{
{ /* CSC Coef Matrix */
- {66, 129, 25},
+/* {66, 129, 25},
{-38, -75, 112},
{112, -94 , -18}
+*/
+ {0x04C, 0x098, 0x01C},
+ {0x3D4, 0x3AC, 0x080},
+ {0x080, 0x39E, 0x3EC}
}, /* CSC Offset */
{0x0, 0x0, 0x0}
},
@@ -107,7 +120,6 @@ static struct ispprev_csc flr_prev_csc[] = {
}
};
-
/* Default values in Office Flourescent Light for CFA Gradient*/
#define FLR_CFA_GRADTHRS_HORZ 0x28
#define FLR_CFA_GRADTHRS_VERT 0x28
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index ed32d3f..ce415ec 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -113,6 +113,8 @@ enum v4l2_if_type {
* on certain image sensors.
*/
V4L2_IF_TYPE_BT656,
+ V4L2_IF_TYPE_YCbCr,
+ V4L2_IF_TYPE_RAW,
};
enum v4l2_if_type_bt656_mode {
@@ -159,10 +161,66 @@ struct v4l2_if_type_bt656 {
u32 clock_curr;
};
+struct v4l2_if_type_ycbcr {
+ /*
+ * 0: Frame begins when vsync is high.
+ * 1: Frame begins when vsync changes from low to high.
+ */
+ unsigned frame_start_on_rising_vs:1;
+ /* Use Bt synchronisation codes for sync correction. */
+ unsigned bt_sync_correct:1;
+ /* Swap every two adjacent image data elements. */
+ unsigned swap:1;
+ /* Inverted latch clock polarity from slave. */
+ unsigned latch_clk_inv:1;
+ /* Hs polarity. 0 is active high, 1 active low. */
+ unsigned nobt_hs_inv:1;
+ /* Vs polarity. 0 is active high, 1 active low. */
+ unsigned nobt_vs_inv:1;
+ /* Minimum accepted bus clock for slave (in Hz). */
+ u32 clock_min;
+ /* Maximum accepted bus clock for slave. */
+ u32 clock_max;
+ /*
+ * Current wish of the slave. May only change in response to
+ * ioctls that affect image capture.
+ */
+ u32 clock_curr;
+};
+
+struct v4l2_if_type_raw {
+ /*
+ * 0: Frame begins when vsync is high.
+ * 1: Frame begins when vsync changes from low to high.
+ */
+ unsigned frame_start_on_rising_vs:1;
+ /* Use Bt synchronisation codes for sync correction. */
+ unsigned bt_sync_correct:1;
+ /* Swap every two adjacent image data elements. */
+ unsigned swap:1;
+ /* Inverted latch clock polarity from slave. */
+ unsigned latch_clk_inv:1;
+ /* Hs polarity. 0 is active high, 1 active low. */
+ unsigned nobt_hs_inv:1;
+ /* Vs polarity. 0 is active high, 1 active low. */
+ unsigned nobt_vs_inv:1;
+ /* Minimum accepted bus clock for slave (in Hz). */
+ u32 clock_min;
+ /* Maximum accepted bus clock for slave. */
+ u32 clock_max;
+ /*
+ * Current wish of the slave. May only change in response to
+ * ioctls that affect image capture.
+ */
+ u32 clock_curr;
+};
+
struct v4l2_ifparm {
enum v4l2_if_type if_type;
union {
struct v4l2_if_type_bt656 bt656;
+ struct v4l2_if_type_ycbcr ycbcr;
+ struct v4l2_if_type_raw raw;
} u;
};
--
1.6.6.1
@@ -0,0 +1,110 @@
From 0edbb992b0bc4e6a1b39d760695a4857b9b7ffa7 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 14:59:42 -0800
Subject: [PATCH 16/45] ARM: OMAP: Overo: Add support for second ethernet port
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
arch/arm/mach-omap2/board-overo.c | 56 +++++++++++++++++++++++++++++++++++--
1 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index e0aebc3..6204b8c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -63,6 +63,8 @@
#define OVERO_SMSC911X_CS 5
#define OVERO_SMSC911X_GPIO 176
+#define OVERO_SMSC911X2_CS 4
+#define OVERO_SMSC911X2_GPIO 65
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
@@ -137,6 +139,16 @@ static struct resource overo_smsc911x_resources[] = {
},
};
+static struct resource overo_smsc911x2_resources[] = {
+ {
+ .name = "smsc911x2-memory",
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+ },
+};
+
static struct smsc911x_platform_config overo_smsc911x_config = {
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
@@ -146,7 +158,7 @@ static struct smsc911x_platform_config overo_smsc911x_config = {
static struct platform_device overo_smsc911x_device = {
.name = "smsc911x",
- .id = -1,
+ .id = 0,
.num_resources = ARRAY_SIZE(overo_smsc911x_resources),
.resource = overo_smsc911x_resources,
.dev = {
@@ -154,9 +166,26 @@ static struct platform_device overo_smsc911x_device = {
},
};
+static struct platform_device overo_smsc911x2_device = {
+ .name = "smsc911x",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(overo_smsc911x2_resources),
+ .resource = overo_smsc911x2_resources,
+ .dev = {
+ .platform_data = &overo_smsc911x_config,
+ },
+};
+
+static struct platform_device *smsc911x_devices[] = {
+ &overo_smsc911x_device,
+ &overo_smsc911x2_device,
+};
+
static inline void __init overo_init_smsc911x(void)
{
- unsigned long cs_mem_base;
+ unsigned long cs_mem_base, cs_mem_base2;
+
+ /* set up first smsc911x chip */
if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
@@ -177,7 +206,28 @@ static inline void __init overo_init_smsc911x(void)
overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
overo_smsc911x_resources[1].end = 0;
- platform_device_register(&overo_smsc911x_device);
+ /* set up second smsc911x chip */
+
+ if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
+ printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
+ return;
+ }
+
+ overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
+ overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff;
+
+ if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
+ (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
+ gpio_export(OVERO_SMSC911X2_GPIO, 0);
+ } else {
+ printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
+ return;
+ }
+
+ overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
+ overo_smsc911x2_resources[1].end = 0;
+
+ platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
}
#else
--
1.6.6.1
@@ -0,0 +1,29 @@
From 5c527b02d8511b5210bdddc6fcfd009bfcaff3d7 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 15:17:44 -0800
Subject: [PATCH 17/45] drivers: net: smsc911x: return ENODEV if device is not found
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
drivers/net/smsc911x.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 494cd91..2472cb0 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -2021,8 +2021,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
}
retval = smsc911x_init(dev);
- if (retval < 0)
+ if (retval < 0) {
+ retval = -ENODEV;
goto out_unmap_io_3;
+ }
/* configure irq polarity and type before connecting isr */
if (pdata->config.irq_polarity == SMSC911X_IRQ_POLARITY_ACTIVE_HIGH)
--
1.6.6.1
@@ -0,0 +1,53 @@
From 88b6ac2d3b90cc8eb8d130673c96645bb439e47c Mon Sep 17 00:00:00 2001
From: Steve Sakoman <sakoman@gmail.com>
Date: Tue, 15 Dec 2009 15:24:10 -0800
Subject: [PATCH 18/45] drivers: input: touchscreen: ads7846: return ENODEV if device is not found
Signed-off-by: Steve Sakoman <sakoman@gmail.com>
---
drivers/input/touchscreen/ads7846.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index e53ac1f..45287ab 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1165,9 +1165,16 @@ static int __devinit ads7846_probe(struct spi_device *spi)
/* take a first sample, leaving nPENIRQ active and vREF off; avoid
* the touchscreen, in case it's not connected.
*/
- (void) ads7846_read12_ser(&spi->dev,
+ err = ads7846_read12_ser(&spi->dev,
READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
+ /* if sample is all 0's or all 1's then there is no device on spi */
+ if ( (err == 0x000) || (err == 0xfff)) {
+ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
+ err = -ENODEV;
+ goto err_free_irq;
+ }
+
err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
if (err)
goto err_remove_hwmon;
@@ -1188,7 +1195,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
err_free_irq:
free_irq(spi->irq, ts);
err_free_gpio:
- if (ts->gpio_pendown != -1)
+ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
gpio_free(ts->gpio_pendown);
err_cleanup_filter:
if (ts->filter_cleanup)
@@ -1216,7 +1223,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
/* suspend left the IRQ disabled */
enable_irq(ts->spi->irq);
- if (ts->gpio_pendown != -1)
+ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
gpio_free(ts->gpio_pendown);
if (ts->filter_cleanup)
--
1.6.6.1
@@ -0,0 +1,601 @@
From 0aee5eef478b55bf987c45ced3365099e28698cb Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:19:34 -0800
Subject: [PATCH 19/45] drivers: mfd: add twl4030 madc driver
---
drivers/mfd/Kconfig | 21 ++
drivers/mfd/Makefile | 1 +
drivers/mfd/twl4030-madc.c | 536 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 558 insertions(+), 0 deletions(-)
create mode 100644 drivers/mfd/twl4030-madc.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 8782978..aefdd66 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -135,6 +135,27 @@ config TWL4030_CODEC
select MFD_CORE
default n
+config TWL4030_MADC
+ tristate "TWL4030 MADC Driver"
+ depends on TWL4030_CORE
+ help
+ The TWL4030 Monitoring ADC driver enables the host
+ processor to monitor analog signals using analog-to-digital
+ conversions on the input source. TWL4030 MADC provides the
+ following features:
+ - Single 10-bit ADC with successive approximation register (SAR) conversion;
+ - Analog multiplexer for 16 inputs;
+ - Seven (of the 16) inputs are freely available;
+ - Battery voltage monitoring;
+ - Concurrent conversion request management;
+ - Interrupt signal to Primary Interrupt Handler;
+ - Averaging feature;
+ - Selective enable/disable of the averaging feature.
+
+ Say 'y' here to statically link this module into the kernel or 'm'
+ to build it as a dinamically loadable module. The module will be
+ called twl4030-madc.ko
+
config MFD_TMIO
bool
default n
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index ca2f2c4..ec9c4f2 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
obj-$(CONFIG_TWL4030_CODEC) += twl4030-codec.o
+obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_MFD_MC13783) += mc13783-core.o
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
new file mode 100644
index 0000000..7d83ab8
--- /dev/null
+++ b/drivers/mfd/twl4030-madc.c
@@ -0,0 +1,536 @@
+/*
+ * TWL4030 MADC module driver
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Mikko Ylinen <mikko.k.ylinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/platform_device.h>
+#include <linux/miscdevice.h>
+#include <linux/i2c/twl4030.h>
+#include <linux/i2c/twl4030-madc.h>
+
+#include <asm/uaccess.h>
+
+#define TWL4030_MADC_PFX "twl4030-madc: "
+
+struct twl4030_madc_data {
+ struct device *dev;
+ struct mutex lock;
+ struct work_struct ws;
+ struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
+ int imr;
+ int isr;
+};
+
+static struct twl4030_madc_data *the_madc;
+
+static
+const struct twl4030_madc_conversion_method twl4030_conversion_methods[] = {
+ [TWL4030_MADC_RT] = {
+ .sel = TWL4030_MADC_RTSELECT_LSB,
+ .avg = TWL4030_MADC_RTAVERAGE_LSB,
+ .rbase = TWL4030_MADC_RTCH0_LSB,
+ },
+ [TWL4030_MADC_SW1] = {
+ .sel = TWL4030_MADC_SW1SELECT_LSB,
+ .avg = TWL4030_MADC_SW1AVERAGE_LSB,
+ .rbase = TWL4030_MADC_GPCH0_LSB,
+ .ctrl = TWL4030_MADC_CTRL_SW1,
+ },
+ [TWL4030_MADC_SW2] = {
+ .sel = TWL4030_MADC_SW2SELECT_LSB,
+ .avg = TWL4030_MADC_SW2AVERAGE_LSB,
+ .rbase = TWL4030_MADC_GPCH0_LSB,
+ .ctrl = TWL4030_MADC_CTRL_SW2,
+ },
+};
+
+static int twl4030_madc_read(struct twl4030_madc_data *madc, u8 reg)
+{
+ int ret;
+ u8 val;
+
+ ret = twl4030_i2c_read_u8(TWL4030_MODULE_MADC, &val, reg);
+ if (ret) {
+ dev_dbg(madc->dev, "unable to read register 0x%X\n", reg);
+ return ret;
+ }
+
+ return val;
+}
+
+static void twl4030_madc_write(struct twl4030_madc_data *madc, u8 reg, u8 val)
+{
+ int ret;
+
+ ret = twl4030_i2c_write_u8(TWL4030_MODULE_MADC, val, reg);
+ if (ret)
+ dev_err(madc->dev, "unable to write register 0x%X\n", reg);
+}
+
+static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg)
+{
+ u8 msb, lsb;
+
+ /* For each ADC channel, we have MSB and LSB register pair. MSB address
+ * is always LSB address+1. reg parameter is the addr of LSB register */
+ msb = twl4030_madc_read(madc, reg + 1);
+ lsb = twl4030_madc_read(madc, reg);
+
+ return (int)(((msb << 8) | lsb) >> 6);
+}
+
+static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
+ u8 reg_base, u16 channels, int *buf)
+{
+ int count = 0;
+ u8 reg, i;
+
+ if (unlikely(!buf))
+ return 0;
+
+ for (i = 0; i < TWL4030_MADC_MAX_CHANNELS; i++) {
+ if (channels & (1<<i)) {
+ reg = reg_base + 2*i;
+ buf[i] = twl4030_madc_channel_raw_read(madc, reg);
+ count++;
+ }
+ }
+ return count;
+}
+
+static void twl4030_madc_enable_irq(struct twl4030_madc_data *madc, int id)
+{
+ u8 val;
+
+ val = twl4030_madc_read(madc, madc->imr);
+ val &= ~(1 << id);
+ twl4030_madc_write(madc, madc->imr, val);
+}
+
+static void twl4030_madc_disable_irq(struct twl4030_madc_data *madc, int id)
+{
+ u8 val;
+
+ val = twl4030_madc_read(madc, madc->imr);
+ val |= (1 << id);
+ twl4030_madc_write(madc, madc->imr, val);
+}
+
+static irqreturn_t twl4030_madc_irq_handler(int irq, void *_madc)
+{
+ struct twl4030_madc_data *madc = _madc;
+ u8 isr_val, imr_val;
+ int i;
+
+#ifdef CONFIG_LOCKDEP
+ /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
+ * we don't want and can't tolerate. Although it might be
+ * friendlier not to borrow this thread context...
+ */
+ local_irq_enable();
+#endif
+
+ /* Use COR to ack interrupts since we have no shared IRQs in ISRx */
+ isr_val = twl4030_madc_read(madc, madc->isr);
+ imr_val = twl4030_madc_read(madc, madc->imr);
+
+ isr_val &= ~imr_val;
+
+ for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) {
+
+ if (!(isr_val & (1<<i)))
+ continue;
+
+ twl4030_madc_disable_irq(madc, i);
+ madc->requests[i].result_pending = 1;
+ }
+
+ schedule_work(&madc->ws);
+
+ return IRQ_HANDLED;
+}
+
+static void twl4030_madc_work(struct work_struct *ws)
+{
+ const struct twl4030_madc_conversion_method *method;
+ struct twl4030_madc_data *madc;
+ struct twl4030_madc_request *r;
+ int len, i;
+
+ madc = container_of(ws, struct twl4030_madc_data, ws);
+ mutex_lock(&madc->lock);
+
+ for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) {
+
+ r = &madc->requests[i];
+
+ /* No pending results for this method, move to next one */
+ if (!r->result_pending)
+ continue;
+
+ method = &twl4030_conversion_methods[r->method];
+
+ /* Read results */
+ len = twl4030_madc_read_channels(madc, method->rbase,
+ r->channels, r->rbuf);
+
+ /* Return results to caller */
+ if (r->func_cb != NULL) {
+ r->func_cb(len, r->channels, r->rbuf);
+ r->func_cb = NULL;
+ }
+
+ /* Free request */
+ r->result_pending = 0;
+ r->active = 0;
+ }
+
+ mutex_unlock(&madc->lock);
+}
+
+static int twl4030_madc_set_irq(struct twl4030_madc_data *madc,
+ struct twl4030_madc_request *req)
+{
+ struct twl4030_madc_request *p;
+
+ p = &madc->requests[req->method];
+
+ memcpy(p, req, sizeof *req);
+
+ twl4030_madc_enable_irq(madc, req->method);
+
+ return 0;
+}
+
+static inline void twl4030_madc_start_conversion(struct twl4030_madc_data *madc,
+ int conv_method)
+{
+ const struct twl4030_madc_conversion_method *method;
+
+ method = &twl4030_conversion_methods[conv_method];
+
+ switch (conv_method) {
+ case TWL4030_MADC_SW1:
+ case TWL4030_MADC_SW2:
+ twl4030_madc_write(madc, method->ctrl, TWL4030_MADC_SW_START);
+ break;
+ case TWL4030_MADC_RT:
+ default:
+ break;
+ }
+}
+
+static int twl4030_madc_wait_conversion_ready(
+ struct twl4030_madc_data *madc,
+ unsigned int timeout_ms, u8 status_reg)
+{
+ unsigned long timeout;
+
+ timeout = jiffies + msecs_to_jiffies(timeout_ms);
+ do {
+ u8 reg;
+
+ reg = twl4030_madc_read(madc, status_reg);
+ if (!(reg & TWL4030_MADC_BUSY) && (reg & TWL4030_MADC_EOC_SW))
+ return 0;
+ } while (!time_after(jiffies, timeout));
+
+ return -EAGAIN;
+}
+
+int twl4030_madc_conversion(struct twl4030_madc_request *req)
+{
+ const struct twl4030_madc_conversion_method *method;
+ u8 ch_msb, ch_lsb;
+ int ret;
+
+ if (unlikely(!req))
+ return -EINVAL;
+
+ mutex_lock(&the_madc->lock);
+
+ /* Do we have a conversion request ongoing */
+ if (the_madc->requests[req->method].active) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ ch_msb = (req->channels >> 8) & 0xff;
+ ch_lsb = req->channels & 0xff;
+
+ method = &twl4030_conversion_methods[req->method];
+
+ /* Select channels to be converted */
+ twl4030_madc_write(the_madc, method->sel + 1, ch_msb);
+ twl4030_madc_write(the_madc, method->sel, ch_lsb);
+
+ /* Select averaging for all channels if do_avg is set */
+ if (req->do_avg) {
+ twl4030_madc_write(the_madc, method->avg + 1, ch_msb);
+ twl4030_madc_write(the_madc, method->avg, ch_lsb);
+ }
+
+ if ((req->type == TWL4030_MADC_IRQ_ONESHOT) && (req->func_cb != NULL)) {
+ twl4030_madc_set_irq(the_madc, req);
+ twl4030_madc_start_conversion(the_madc, req->method);
+ the_madc->requests[req->method].active = 1;
+ ret = 0;
+ goto out;
+ }
+
+ /* With RT method we should not be here anymore */
+ if (req->method == TWL4030_MADC_RT) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ twl4030_madc_start_conversion(the_madc, req->method);
+ the_madc->requests[req->method].active = 1;
+
+ /* Wait until conversion is ready (ctrl register returns EOC) */
+ ret = twl4030_madc_wait_conversion_ready(the_madc, 5, method->ctrl);
+ if (ret) {
+ dev_dbg(the_madc->dev, "conversion timeout!\n");
+ the_madc->requests[req->method].active = 0;
+ goto out;
+ }
+
+ ret = twl4030_madc_read_channels(the_madc, method->rbase, req->channels,
+ req->rbuf);
+
+ the_madc->requests[req->method].active = 0;
+
+out:
+ mutex_unlock(&the_madc->lock);
+
+ return ret;
+}
+EXPORT_SYMBOL(twl4030_madc_conversion);
+
+static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
+ int chan, int on)
+{
+ int ret;
+ u8 regval;
+
+ /* Current generator is only available for ADCIN0 and ADCIN1. NB:
+ * ADCIN1 current generator only works when AC or VBUS is present */
+ if (chan > 1)
+ return EINVAL;
+
+ ret = twl4030_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ &regval, TWL4030_BCI_BCICTL1);
+ if (on)
+ regval |= (chan) ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN;
+ else
+ regval &= (chan) ? ~TWL4030_BCI_ITHEN : ~TWL4030_BCI_TYPEN;
+ ret = twl4030_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ regval, TWL4030_BCI_BCICTL1);
+
+ return ret;
+}
+
+static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
+{
+ u8 regval;
+
+ regval = twl4030_madc_read(madc, TWL4030_MADC_CTRL1);
+ if (on)
+ regval |= TWL4030_MADC_MADCON;
+ else
+ regval &= ~TWL4030_MADC_MADCON;
+ twl4030_madc_write(madc, TWL4030_MADC_CTRL1, regval);
+
+ return 0;
+}
+
+static long twl4030_madc_ioctl(struct file *filp, unsigned int cmd,
+ unsigned long arg)
+{
+ struct twl4030_madc_user_parms par;
+ int val, ret;
+
+ ret = copy_from_user(&par, (void __user *) arg, sizeof(par));
+ if (ret) {
+ dev_dbg(the_madc->dev, "copy_from_user: %d\n", ret);
+ return -EACCES;
+ }
+
+ switch (cmd) {
+ case TWL4030_MADC_IOCX_ADC_RAW_READ: {
+ struct twl4030_madc_request req;
+ if (par.channel >= TWL4030_MADC_MAX_CHANNELS)
+ return -EINVAL;
+
+ req.channels = (1 << par.channel);
+ req.do_avg = par.average;
+ req.method = TWL4030_MADC_SW1;
+ req.func_cb = NULL;
+
+ val = twl4030_madc_conversion(&req);
+ if (val <= 0) {
+ par.status = -1;
+ } else {
+ par.status = 0;
+ par.result = (u16)req.rbuf[par.channel];
+ }
+ break;
+ }
+ default:
+ return -EINVAL;
+ }
+
+ ret = copy_to_user((void __user *) arg, &par, sizeof(par));
+ if (ret) {
+ dev_dbg(the_madc->dev, "copy_to_user: %d\n", ret);
+ return -EACCES;
+ }
+
+ return 0;
+}
+
+static struct file_operations twl4030_madc_fileops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = twl4030_madc_ioctl
+};
+
+static struct miscdevice twl4030_madc_device = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = "twl4030-madc",
+ .fops = &twl4030_madc_fileops
+};
+
+static int __init twl4030_madc_probe(struct platform_device *pdev)
+{
+ struct twl4030_madc_data *madc;
+ struct twl4030_madc_platform_data *pdata = pdev->dev.platform_data;
+ int ret;
+ u8 regval;
+
+ madc = kzalloc(sizeof *madc, GFP_KERNEL);
+ if (!madc)
+ return -ENOMEM;
+
+ if (!pdata) {
+ dev_dbg(&pdev->dev, "platform_data not available\n");
+ ret = -EINVAL;
+ goto err_pdata;
+ }
+
+ madc->imr = (pdata->irq_line == 1) ? TWL4030_MADC_IMR1 : TWL4030_MADC_IMR2;
+ madc->isr = (pdata->irq_line == 1) ? TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2;
+
+ ret = misc_register(&twl4030_madc_device);
+ if (ret) {
+ dev_dbg(&pdev->dev, "could not register misc_device\n");
+ goto err_misc;
+ }
+ twl4030_madc_set_power(madc, 1);
+ twl4030_madc_set_current_generator(madc, 0, 1);
+
+ /* Enable ADCIN3 through 6 */
+ ret = twl4030_i2c_read_u8(TWL4030_MODULE_USB,
+ &regval, TWL4030_USB_CARKIT_ANA_CTRL);
+
+ regval |= TWL4030_USB_SEL_MADC_MCPC;
+
+ ret = twl4030_i2c_write_u8(TWL4030_MODULE_USB,
+ regval, TWL4030_USB_CARKIT_ANA_CTRL);
+
+
+ ret = twl4030_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ &regval, TWL4030_BCI_BCICTL1);
+
+ regval |= TWL4030_BCI_MESBAT;
+
+ ret = twl4030_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ regval, TWL4030_BCI_BCICTL1);
+
+ ret = request_irq(platform_get_irq(pdev, 0), twl4030_madc_irq_handler,
+ 0, "twl4030_madc", madc);
+ if (ret) {
+ dev_dbg(&pdev->dev, "could not request irq\n");
+ goto err_irq;
+ }
+
+ platform_set_drvdata(pdev, madc);
+ mutex_init(&madc->lock);
+ INIT_WORK(&madc->ws, twl4030_madc_work);
+
+ the_madc = madc;
+
+ return 0;
+
+err_irq:
+ misc_deregister(&twl4030_madc_device);
+
+err_misc:
+err_pdata:
+ kfree(madc);
+
+ return ret;
+}
+
+static int __exit twl4030_madc_remove(struct platform_device *pdev)
+{
+ struct twl4030_madc_data *madc = platform_get_drvdata(pdev);
+
+ twl4030_madc_set_power(madc, 0);
+ twl4030_madc_set_current_generator(madc, 0, 0);
+ free_irq(platform_get_irq(pdev, 0), madc);
+ cancel_work_sync(&madc->ws);
+ misc_deregister(&twl4030_madc_device);
+
+ return 0;
+}
+
+static struct platform_driver twl4030_madc_driver = {
+ .probe = twl4030_madc_probe,
+ .remove = __exit_p(twl4030_madc_remove),
+ .driver = {
+ .name = "twl4030_madc",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init twl4030_madc_init(void)
+{
+ return platform_driver_register(&twl4030_madc_driver);
+}
+module_init(twl4030_madc_init);
+
+static void __exit twl4030_madc_exit(void)
+{
+ platform_driver_unregister(&twl4030_madc_driver);
+}
+module_exit(twl4030_madc_exit);
+
+MODULE_ALIAS("platform:twl4030-madc");
+MODULE_AUTHOR("Nokia Corporation");
+MODULE_DESCRIPTION("twl4030 ADC driver");
+MODULE_LICENSE("GPL");
+
--
1.6.6.1
@@ -0,0 +1,149 @@
From d93f9d5e636931519fb440cf8ad493c95bfaf5ca Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 15:54:58 -0800
Subject: [PATCH 20/45] ARM: OMAP: Add missing twl4030 madc header file
---
include/linux/i2c/twl4030-madc.h | 130 ++++++++++++++++++++++++++++++++++++++
1 files changed, 130 insertions(+), 0 deletions(-)
create mode 100644 include/linux/i2c/twl4030-madc.h
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
new file mode 100644
index 0000000..341a665
--- /dev/null
+++ b/include/linux/i2c/twl4030-madc.h
@@ -0,0 +1,130 @@
+/*
+ * include/linux/i2c/twl4030-madc.h
+ *
+ * TWL4030 MADC module driver header
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Mikko Ylinen <mikko.k.ylinen@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef _TWL4030_MADC_H
+#define _TWL4030_MADC_H
+
+struct twl4030_madc_conversion_method {
+ u8 sel;
+ u8 avg;
+ u8 rbase;
+ u8 ctrl;
+};
+
+#define TWL4030_MADC_MAX_CHANNELS 16
+
+struct twl4030_madc_request {
+ u16 channels;
+ u16 do_avg;
+ u16 method;
+ u16 type;
+ int active;
+ int result_pending;
+ int rbuf[TWL4030_MADC_MAX_CHANNELS];
+ void (*func_cb)(int len, int channels, int *buf);
+};
+
+enum conversion_methods {
+ TWL4030_MADC_RT,
+ TWL4030_MADC_SW1,
+ TWL4030_MADC_SW2,
+ TWL4030_MADC_NUM_METHODS
+};
+
+enum sample_type {
+ TWL4030_MADC_WAIT,
+ TWL4030_MADC_IRQ_ONESHOT,
+ TWL4030_MADC_IRQ_REARM
+};
+
+#define TWL4030_MADC_CTRL1 0x00
+#define TWL4030_MADC_CTRL2 0x01
+
+#define TWL4030_MADC_RTSELECT_LSB 0x02
+#define TWL4030_MADC_SW1SELECT_LSB 0x06
+#define TWL4030_MADC_SW2SELECT_LSB 0x0A
+
+#define TWL4030_MADC_RTAVERAGE_LSB 0x04
+#define TWL4030_MADC_SW1AVERAGE_LSB 0x08
+#define TWL4030_MADC_SW2AVERAGE_LSB 0x0C
+
+#define TWL4030_MADC_CTRL_SW1 0x12
+#define TWL4030_MADC_CTRL_SW2 0x13
+
+#define TWL4030_MADC_RTCH0_LSB 0x17
+#define TWL4030_MADC_GPCH0_LSB 0x37
+
+#define TWL4030_MADC_MADCON (1<<0) /* MADC power on */
+#define TWL4030_MADC_BUSY (1<<0) /* MADC busy */
+#define TWL4030_MADC_EOC_SW (1<<1) /* MADC conversion completion */
+#define TWL4030_MADC_SW_START (1<<5) /* MADC SWx start conversion */
+
+#define TWL4030_MADC_ADCIN0 (1<<0)
+#define TWL4030_MADC_ADCIN1 (1<<1)
+#define TWL4030_MADC_ADCIN2 (1<<2)
+#define TWL4030_MADC_ADCIN3 (1<<3)
+#define TWL4030_MADC_ADCIN4 (1<<4)
+#define TWL4030_MADC_ADCIN5 (1<<5)
+#define TWL4030_MADC_ADCIN6 (1<<6)
+#define TWL4030_MADC_ADCIN7 (1<<7)
+#define TWL4030_MADC_ADCIN8 (1<<8)
+#define TWL4030_MADC_ADCIN9 (1<<9)
+#define TWL4030_MADC_ADCIN10 (1<<10)
+#define TWL4030_MADC_ADCIN11 (1<<11)
+#define TWL4030_MADC_ADCIN12 (1<<12)
+#define TWL4030_MADC_ADCIN13 (1<<13)
+#define TWL4030_MADC_ADCIN14 (1<<14)
+#define TWL4030_MADC_ADCIN15 (1<<15)
+
+/* Fixed channels */
+#define TWL4030_MADC_BTEMP TWL4030_MADC_ADCIN1
+#define TWL4030_MADC_VBUS TWL4030_MADC_ADCIN8
+#define TWL4030_MADC_VBKB TWL4030_MADC_ADCIN9
+#define TWL4030_MADC_ICHG TWL4030_MADC_ADCIN10
+#define TWL4030_MADC_VCHG TWL4030_MADC_ADCIN11
+#define TWL4030_MADC_VBAT TWL4030_MADC_ADCIN12
+
+/* BCI related - XXX To be moved elsewhere */
+#define TWL4030_BCI_BCICTL1 0x23
+#define TWL4030_BCI_MESBAT (1<<1)
+#define TWL4030_BCI_TYPEN (1<<4)
+#define TWL4030_BCI_ITHEN (1<<3)
+
+/* USB related - XXX To be moved elsewhere */
+#define TWL4030_USB_CARKIT_ANA_CTRL 0xBB
+#define TWL4030_USB_SEL_MADC_MCPC (1<<3)
+
+#define TWL4030_MADC_IOC_MAGIC '`'
+#define TWL4030_MADC_IOCX_ADC_RAW_READ _IO(TWL4030_MADC_IOC_MAGIC, 0)
+
+struct twl4030_madc_user_parms {
+ int channel;
+ int average;
+ int status;
+ u16 result;
+};
+
+int twl4030_madc_conversion(struct twl4030_madc_request *conv);
+
+#endif
--
1.6.6.1
@@ -0,0 +1,32 @@
From bdde1d2b9726ebf0dd74f6dad0dfc858333ca784 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:27:15 -0800
Subject: [PATCH 21/45] ARM: OMAP: Add twl4030 madc support to Overo
---
arch/arm/mach-omap2/board-overo.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 6204b8c..9c76588 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -390,10 +390,15 @@ static struct twl4030_codec_data overo_codec_data = {
/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
+static struct twl4030_madc_platform_data overo_madc_data = {
+ .irq_line = 1,
+};
+
static struct twl4030_platform_data overo_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
.gpio = &overo_gpio_data,
+ .madc = &overo_madc_data,
.usb = &overo_usb_data,
.codec = &overo_codec_data,
.vmmc1 = &overo_vmmc1,
--
1.6.6.1
@@ -0,0 +1,35 @@
From 7775140814ed11c0332a57ed30f69c6da0ab466d Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 14:32:36 -0800
Subject: [PATCH 22/45] ARM: OMAP: Add twl4030 madc support to Beagle
---
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index cb11b07..c4ebaab 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -473,6 +473,10 @@ static struct twl4030_codec_data beagle_codec_data = {
.audio = &beagle_audio_data,
};
+static struct twl4030_madc_platform_data beagle_madc_data = {
+ .irq_line = 1,
+};
+
static struct twl4030_platform_data beagle_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
@@ -481,6 +485,7 @@ static struct twl4030_platform_data beagle_twldata = {
.usb = &beagle_usb_data,
.gpio = &beagle_gpio_data,
.codec = &beagle_codec_data,
+ .madc = &beagle_madc_data,
.vmmc1 = &beagle_vmmc1,
.vsim = &beagle_vsim,
.vdac = &beagle_vdac,
--
1.6.6.1
@@ -0,0 +1,25 @@
From c59df25a1d1ad6c7fbb11fac6e7404d05639f4bd Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Tue, 19 Jan 2010 20:00:46 -0800
Subject: [PATCH 23/45] netdev: rt73usb - add vendor/device ID for Ceiva Wireless PartNo 81726-00702
---
drivers/net/wireless/rt2x00/rt73usb.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index ced3b6a..719ac0a 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2357,6 +2357,8 @@ static struct usb_device_id rt73usb_device_table[] = {
{ USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) },
{ USB_DEVICE(0x0411, 0x0116), USB_DEVICE_DATA(&rt73usb_ops) },
{ USB_DEVICE(0x0411, 0x0119), USB_DEVICE_DATA(&rt73usb_ops) },
+ /* Ceiva Wireless PartNo 81726-00702 */
+ { USB_DEVICE(0x178d, 0x02be), USB_DEVICE_DATA(&rt73usb_ops) },
/* CNet */
{ USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) },
{ USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) },
--
1.6.6.1
@@ -0,0 +1,28 @@
From 1af64d89d41aae6ab26b61c23060a02af72b6fb2 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 4 Jan 2010 19:20:25 -0800
Subject: [PATCH 24/45] mmc: don't display single block read console messages
mmc: don't display single block read console messages
---
drivers/mmc/card/block.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 85f0e8c..05492e9 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -338,8 +338,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
if (brq.cmd.error || brq.data.error || brq.stop.error) {
if (brq.data.blocks > 1 && rq_data_dir(req) == READ) {
/* Redo read one sector at a time */
- printk(KERN_WARNING "%s: retrying using single "
- "block read\n", req->rq_disk->disk_name);
+ /* printk(KERN_WARNING "%s: retrying using single "
+ "block read\n", req->rq_disk->disk_name); */
disable_multi = 1;
continue;
}
--
1.6.6.1
@@ -0,0 +1,47 @@
From 664b6e1a8f1bcd0bed227b367f7ed029a5be0fa7 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Sun, 24 Jan 2010 09:33:56 -0800
Subject: [PATCH 25/45] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test
otherwise it is not executed on systems that use non-twl regulators
---
arch/arm/mach-omap2/mmc-twl4030.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 0c3c72d..dbdafb9 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -302,6 +302,14 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v
if (c == NULL)
return -ENODEV;
+ if (mmc->slots[0].internal_clock) {
+ u32 reg;
+
+ reg = omap_ctrl_readl(control_devconf1_offset);
+ reg |= OMAP2_MMCSDIO2ADPCLKISEL;
+ omap_ctrl_writel(reg, control_devconf1_offset);
+ }
+
/* If we don't see a Vcc regulator, assume it's a fixed
* voltage always-on regulator.
*/
@@ -322,14 +330,6 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v
* chips/cards need an interface voltage rail too.
*/
if (power_on) {
- /* only MMC2 supports a CLKIN */
- if (mmc->slots[0].internal_clock) {
- u32 reg;
-
- reg = omap_ctrl_readl(control_devconf1_offset);
- reg |= OMAP2_MMCSDIO2ADPCLKISEL;
- omap_ctrl_writel(reg, control_devconf1_offset);
- }
ret = mmc_regulator_set_ocr(c->vcc, vdd);
/* enable interface voltage rail, if needed */
if (ret == 0 && c->vcc_aux) {
--
1.6.6.1
@@ -0,0 +1,373 @@
From 2b3cfbcd286a0c1b0df90b7af7982c772031abd8 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sun, 14 Feb 2010 12:52:02 +0100
Subject: [PATCH 26/45] board-overo: add PM code and sync with http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=shortlog;h=refs/heads/omap3-2.6.32
---
arch/arm/mach-omap2/board-overo.c | 274 ++++++++++++++++++++++++++++++++-----
1 files changed, 242 insertions(+), 32 deletions(-)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 9c76588..2595f81 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -28,6 +28,7 @@
#include <linux/platform_device.h>
#include <linux/i2c/twl.h>
#include <linux/regulator/machine.h>
+#include <linux/spi/spi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -40,16 +41,24 @@
#include <plat/board.h>
#include <plat/common.h>
+#include <plat/display.h>
#include <mach/gpio.h>
#include <plat/gpmc.h>
#include <mach/hardware.h>
#include <plat/nand.h>
+#include <plat/mcspi.h>
#include <plat/usb.h>
-
-#include "mux.h"
+#include <plat/clock.h>
+#include <plat/omap-pm.h>
+
#include "sdram-micron-mt46h32m32lf-6.h"
#include "mmc-twl4030.h"
+#include "mux.h"
+
+#include "pm.h"
+#include "omap3-opp.h"
+
#define OVERO_GPIO_BT_XGATE 15
#define OVERO_GPIO_W2W_NRESET 16
#define OVERO_GPIO_PENDOWN 114
@@ -95,18 +104,6 @@ static struct ads7846_platform_data ads7846_config = {
.keep_vref_on = 1,
};
-static struct spi_board_info overo_spi_board_info[] __initdata = {
- {
- .modalias = "ads7846",
- .bus_num = 1,
- .chip_select = 0,
- .max_speed_hz = 1500000,
- .controller_data = &ads7846_mcspi_config,
- .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
- .platform_data = &ads7846_config,
- }
-};
-
static void __init overo_ads7846_init(void)
{
if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
@@ -116,9 +113,6 @@ static void __init overo_ads7846_init(void)
printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
return;
}
-
- spi_register_board_info(overo_spi_board_info,
- ARRAY_SIZE(overo_spi_board_info));
}
#else
@@ -234,6 +228,169 @@ static inline void __init overo_init_smsc911x(void)
static inline void __init overo_init_smsc911x(void) { return; }
#endif
+/* DSS */
+static int lcd_enabled;
+static int dvi_enabled;
+
+#define OVERO_GPIO_LCD_EN 144
+#define OVERO_GPIO_LCD_BL 145
+
+static void __init overo_display_init(void)
+{
+ if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
+ (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
+ gpio_export(OVERO_GPIO_LCD_EN, 0);
+ else
+ printk(KERN_ERR "could not obtain gpio for "
+ "OVERO_GPIO_LCD_EN\n");
+
+ if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
+ (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
+ gpio_export(OVERO_GPIO_LCD_BL, 0);
+ else
+ printk(KERN_ERR "could not obtain gpio for "
+ "OVERO_GPIO_LCD_BL\n");
+}
+
+static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
+{
+ if (lcd_enabled) {
+ printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+ return -EINVAL;
+ }
+ dvi_enabled = 1;
+
+ return 0;
+}
+
+static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
+{
+ dvi_enabled = 0;
+}
+
+static struct omap_dss_device overo_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+ .platform_enable = overo_panel_enable_dvi,
+ .platform_disable = overo_panel_disable_dvi,
+};
+
+static int overo_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+#define ENABLE_VDAC_DEDICATED 0x03
+#define ENABLE_VDAC_DEV_GRP 0x20
+
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEDICATED,
+ TWL4030_VDAC_DEDICATED);
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+
+ return 0;
+}
+
+static void overo_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEDICATED);
+ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEV_GRP);
+}
+
+static struct omap_dss_device overo_tv_device = {
+ .name = "tv",
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ .platform_enable = overo_panel_enable_tv,
+ .platform_disable = overo_panel_disable_tv,
+};
+
+static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+ if (dvi_enabled) {
+ printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+ return -EINVAL;
+ }
+
+ gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+ gpio_set_value(OVERO_GPIO_LCD_BL, 1);
+ lcd_enabled = 1;
+ return 0;
+}
+
+static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+ gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+ gpio_set_value(OVERO_GPIO_LCD_BL, 0);
+ lcd_enabled = 0;
+}
+
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+static struct omap_dss_device overo_lcd35_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "lcd35",
+ .driver_name = "lgphilips_lb035q02_panel",
+ .phy.dpi.data_lines = 24,
+ .panel.recommended_bpp = 16,
+ .platform_enable = overo_panel_enable_lcd,
+ .platform_disable = overo_panel_disable_lcd,
+};
+#endif
+
+#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \
+ defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE)
+static struct omap_dss_device overo_lcd43_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "lcd43",
+ .driver_name = "samsung_lte_panel",
+ .phy.dpi.data_lines = 24,
+ .panel.recommended_bpp = 16,
+ .platform_enable = overo_panel_enable_lcd,
+ .platform_disable = overo_panel_disable_lcd,
+};
+#endif
+
+static struct omap_dss_device *overo_dss_devices[] = {
+ &overo_dvi_device,
+ &overo_tv_device,
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+ &overo_lcd35_device,
+#endif
+#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \
+ defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE)
+ &overo_lcd43_device,
+#endif
+};
+
+static struct omap_dss_board_info overo_dss_data = {
+ .num_devices = ARRAY_SIZE(overo_dss_devices),
+ .devices = overo_dss_devices,
+ .default_device = &overo_dvi_device,
+};
+
+static struct platform_device overo_dss_device = {
+ .name = "omapdss",
+ .id = -1,
+ .dev = {
+ .platform_data = &overo_dss_data,
+ },
+};
+
+static struct regulator_consumer_supply overo_vdda_dac_supply = {
+ .supply = "vdda_dac",
+ .dev = &overo_dss_device.dev,
+};
+
+static struct regulator_consumer_supply overo_vdds_dsi_supply = {
+ .supply = "vdds_dsi",
+ .dev = &overo_dss_device.dev,
+};
+
static struct mtd_partition overo_nand_partitions[] = {
{
.name = "xloader",
@@ -379,6 +536,37 @@ static struct regulator_init_data overo_vmmc1 = {
.consumer_supplies = &overo_vmmc1_supply,
};
+/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
+static struct regulator_init_data overo_vdac = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &overo_vdda_dac_supply,
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_init_data overo_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &overo_vdds_dsi_supply,
+};
+
+/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
+
static struct twl4030_codec_audio_data overo_audio_data = {
.audio_mclk = 26000000,
};
@@ -402,6 +590,8 @@ static struct twl4030_platform_data overo_twldata = {
.usb = &overo_usb_data,
.codec = &overo_codec_data,
.vmmc1 = &overo_vmmc1,
+ .vdac = &overo_vdac,
+ .vpll2 = &overo_vpll2,
};
static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
@@ -422,31 +612,50 @@ static int __init overo_i2c_init(void)
return 0;
}
-static struct platform_device overo_lcd_device = {
- .name = "overo_lcd",
- .id = -1,
-};
-
-static struct omap_lcd_config overo_lcd_config __initdata = {
- .ctrl_name = "internal",
+static struct spi_board_info overo_spi_board_info[] __initdata = {
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
+ defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+ {
+ .modalias = "ads7846",
+ .bus_num = 1,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &ads7846_mcspi_config,
+ .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
+ .platform_data = &ads7846_config,
+ },
+#endif
+#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+ {
+ .modalias = "lgphilips_lb035q02_panel-spi",
+ .bus_num = 1,
+ .chip_select = 1,
+ .max_speed_hz = 500000,
+ .mode = SPI_MODE_3,
+ },
+#endif
};
-static struct omap_board_config_kernel overo_config[] __initdata = {
- { OMAP_TAG_LCD, &overo_lcd_config },
-};
+static int __init overo_spi_init(void)
+{
+ overo_ads7846_init();
+ spi_register_board_info(overo_spi_board_info,
+ ARRAY_SIZE(overo_spi_board_info));
+ return 0;
+}
static void __init overo_init_irq(void)
{
- omap_board_config = overo_config;
- omap_board_config_size = ARRAY_SIZE(overo_config);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params, NULL, NULL, NULL);
+ NULL, omap35x_mpu_rate_table,
+ omap35x_dsp_rate_table, omap35x_l3_rate_table);
omap_init_irq();
omap_gpio_init();
}
static struct platform_device *overo_devices[] __initdata = {
- &overo_lcd_device,
+ &overo_dss_device,
};
static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -477,8 +686,9 @@ static void __init overo_init(void)
overo_flash_init();
usb_musb_init();
usb_ehci_init(&ehci_pdata);
- overo_ads7846_init();
+ overo_spi_init();
overo_init_smsc911x();
+ overo_display_init();
/* Ensure SDRC pins are mux'd for self-refresh */
omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
--
1.6.6.1
@@ -0,0 +1,85 @@
From ea14002af533b155db59e15b5bccc6374aa8a5d1 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 15 Feb 2010 14:20:51 +0100
Subject: [PATCH 27/45] twl4030-madc: adjust for twl4030 -> twl api changes
---
drivers/mfd/twl4030-madc.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 7d83ab8..de6bdcd 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -29,7 +29,7 @@
#include <linux/fs.h>
#include <linux/platform_device.h>
#include <linux/miscdevice.h>
-#include <linux/i2c/twl4030.h>
+#include <linux/i2c/twl.h>
#include <linux/i2c/twl4030-madc.h>
#include <asm/uaccess.h>
@@ -73,7 +73,7 @@ static int twl4030_madc_read(struct twl4030_madc_data *madc, u8 reg)
int ret;
u8 val;
- ret = twl4030_i2c_read_u8(TWL4030_MODULE_MADC, &val, reg);
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MADC, &val, reg);
if (ret) {
dev_dbg(madc->dev, "unable to read register 0x%X\n", reg);
return ret;
@@ -86,7 +86,7 @@ static void twl4030_madc_write(struct twl4030_madc_data *madc, u8 reg, u8 val)
{
int ret;
- ret = twl4030_i2c_write_u8(TWL4030_MODULE_MADC, val, reg);
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, val, reg);
if (ret)
dev_err(madc->dev, "unable to write register 0x%X\n", reg);
}
@@ -342,13 +342,13 @@ static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
if (chan > 1)
return EINVAL;
- ret = twl4030_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
&regval, TWL4030_BCI_BCICTL1);
if (on)
regval |= (chan) ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN;
else
regval &= (chan) ? ~TWL4030_BCI_ITHEN : ~TWL4030_BCI_TYPEN;
- ret = twl4030_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
regval, TWL4030_BCI_BCICTL1);
return ret;
@@ -453,21 +453,21 @@ static int __init twl4030_madc_probe(struct platform_device *pdev)
twl4030_madc_set_current_generator(madc, 0, 1);
/* Enable ADCIN3 through 6 */
- ret = twl4030_i2c_read_u8(TWL4030_MODULE_USB,
+ ret = twl_i2c_read_u8(TWL4030_MODULE_USB,
&regval, TWL4030_USB_CARKIT_ANA_CTRL);
regval |= TWL4030_USB_SEL_MADC_MCPC;
- ret = twl4030_i2c_write_u8(TWL4030_MODULE_USB,
+ ret = twl_i2c_write_u8(TWL4030_MODULE_USB,
regval, TWL4030_USB_CARKIT_ANA_CTRL);
- ret = twl4030_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
+ ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE,
&regval, TWL4030_BCI_BCICTL1);
regval |= TWL4030_BCI_MESBAT;
- ret = twl4030_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
regval, TWL4030_BCI_BCICTL1);
ret = request_irq(platform_get_irq(pdev, 0), twl4030_madc_irq_handler,
--
1.6.6.1
@@ -0,0 +1,161 @@
From fea02525d71cc64fb84f011768a5f5d0bb248dc7 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 15 Feb 2010 14:38:00 +0100
Subject: [PATCH 28/45] OMAP: DSS2: (Re)add support for Samsung lte430wq-f0c panel
---
drivers/video/omap2/displays/Kconfig | 6 +
drivers/video/omap2/displays/Makefile | 1 +
.../omap2/displays/panel-samsung-lte430wq-f0c.c | 113 ++++++++++++++++++++
3 files changed, 120 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 4ce47dd..4229a28 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -7,6 +7,12 @@ config PANEL_GENERIC
Generic panel driver.
Used for DVI output for Beagle and OMAP3 SDP.
+config PANEL_SAMSUNG_LTE430WQ_F0C
+ tristate "Samsung LTE430WQ-F0C LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used on Overo Palo43
+
config PANEL_SHARP_LS037V7DW01
tristate "Sharp LS037V7DW01 LCD Panel"
depends on OMAP2_DSS
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 8f3d0ad..9317445 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,4 +1,5 @@
obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
+obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
new file mode 100644
index 0000000..3f0477e
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c
@@ -0,0 +1,113 @@
+/*
+ * LCD panel driver for Samsung LTE430WQ-F0C
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+
+#include <plat/display.h>
+
+static struct omap_video_timings samsung_lte_timings = {
+ .x_res = 480,
+ .y_res = 272,
+
+ .pixel_clock = 9200,
+
+ .hsw = 41,
+ .hfp = 8,
+ .hbp = 45-41,
+
+ .vsw = 10,
+ .vfp = 4,
+ .vbp = 12-10,
+};
+
+static int samsung_lte_panel_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.timings = samsung_lte_timings;
+
+ return 0;
+}
+
+static void samsung_lte_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int samsung_lte_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+ if (dssdev->platform_enable)
+ r = dssdev->platform_enable(dssdev);
+
+ return r;
+}
+
+static void samsung_lte_panel_disable(struct omap_dss_device *dssdev)
+{
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
+
+ msleep(100);
+}
+
+static int samsung_lte_panel_suspend(struct omap_dss_device *dssdev)
+{
+ samsung_lte_panel_disable(dssdev);
+ return 0;
+}
+
+static int samsung_lte_panel_resume(struct omap_dss_device *dssdev)
+{
+ return samsung_lte_panel_enable(dssdev);
+}
+
+static struct omap_dss_driver samsung_lte_driver = {
+ .probe = samsung_lte_panel_probe,
+ .remove = samsung_lte_panel_remove,
+
+ .enable = samsung_lte_panel_enable,
+ .disable = samsung_lte_panel_disable,
+ .suspend = samsung_lte_panel_suspend,
+ .resume = samsung_lte_panel_resume,
+
+ .driver = {
+ .name = "samsung_lte_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init samsung_lte_panel_drv_init(void)
+{
+ return omap_dss_register_driver(&samsung_lte_driver);
+}
+
+static void __exit samsung_lte_panel_drv_exit(void)
+{
+ omap_dss_unregister_driver(&samsung_lte_driver);
+}
+
+module_init(samsung_lte_panel_drv_init);
+module_exit(samsung_lte_panel_drv_exit);
+MODULE_LICENSE("GPL");
--
1.6.6.1
@@ -0,0 +1,254 @@
From 528f8c676d21e4eea4599226168f25e684f99eae Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 17 Dec 2009 15:05:30 -0800
Subject: [PATCH 29/45] OMAP: DSS2: Add support for LG Philips LB035Q02 panel
---
drivers/video/omap2/displays/Kconfig | 6 +
drivers/video/omap2/displays/Makefile | 1 +
.../omap2/displays/panel-lgphilips-lb035q02.c | 206 ++++++++++++++++++++
3 files changed, 213 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
index 4229a28..875250a 100644
--- a/drivers/video/omap2/displays/Kconfig
+++ b/drivers/video/omap2/displays/Kconfig
@@ -7,6 +7,12 @@ config PANEL_GENERIC
Generic panel driver.
Used for DVI output for Beagle and OMAP3 SDP.
+config PANEL_LGPHILIPS_LB035Q02
+ tristate "LG.Philips LB035Q02 LCD Panel"
+ depends on OMAP2_DSS
+ help
+ LCD Panel used on Overo Palo35
+
config PANEL_SAMSUNG_LTE430WQ_F0C
tristate "Samsung LTE430WQ-F0C LCD Panel"
depends on OMAP2_DSS
diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
index 9317445..f8e6c52 100644
--- a/drivers/video/omap2/displays/Makefile
+++ b/drivers/video/omap2/displays/Makefile
@@ -1,4 +1,5 @@
obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o
+obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
new file mode 100644
index 0000000..22dc865
--- /dev/null
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -0,0 +1,206 @@
+/*
+ * LCD panel driver for LG.Philips LB035Q02
+ *
+ * Author: Steve Sakoman <steve@sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/spi/spi.h>
+
+#include <plat/display.h>
+
+static struct spi_device *spidev;
+
+static struct omap_video_timings lb035q02_timings = {
+ .x_res = 320,
+ .y_res = 240,
+
+ .pixel_clock = 6500,
+
+ .hsw = 2,
+ .hfp = 20,
+ .hbp = 68,
+
+ .vsw = 2,
+ .vfp = 4,
+ .vbp = 18,
+};
+
+static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
+{
+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
+ OMAP_DSS_LCD_IHS;
+ dssdev->panel.timings = lb035q02_timings;
+
+ return 0;
+}
+
+static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
+{
+}
+
+static int lb035q02_write_reg(u8 reg, u16 val)
+{
+ struct spi_message msg;
+ struct spi_transfer index_xfer = {
+ .len = 3,
+ .cs_change = 1,
+ };
+ struct spi_transfer value_xfer = {
+ .len = 3,
+ };
+ u8 buffer[16];
+
+ spi_message_init(&msg);
+
+ /* register index */
+ buffer[0] = 0x70;
+ buffer[1] = 0x00;
+ buffer[2] = reg & 0x7f;
+ index_xfer.tx_buf = buffer;
+ spi_message_add_tail(&index_xfer, &msg);
+
+ /* register value */
+ buffer[4] = 0x72;
+ buffer[5] = val >> 8;
+ buffer[6] = val;
+ value_xfer.tx_buf = buffer + 4;
+ spi_message_add_tail(&value_xfer, &msg);
+
+ return spi_sync(spidev, &msg);
+}
+
+static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ pr_info("lgphilips_lb035q02: panel_enable: 0x%08x\n", spidev);
+ /* wait couple of vsyncs until enabling the LCD */
+ msleep(50);
+
+ if (dssdev->platform_enable)
+ r = dssdev->platform_enable(dssdev);
+
+ /* Panel init sequence from page 28 of the spec */
+ lb035q02_write_reg(0x01, 0x6300);
+ lb035q02_write_reg(0x02, 0x0200);
+ lb035q02_write_reg(0x03, 0x0177);
+ lb035q02_write_reg(0x04, 0x04c7);
+ lb035q02_write_reg(0x05, 0xffc0);
+ lb035q02_write_reg(0x06, 0xe806);
+ lb035q02_write_reg(0x0a, 0x4008);
+ lb035q02_write_reg(0x0b, 0x0000);
+ lb035q02_write_reg(0x0d, 0x0030);
+ lb035q02_write_reg(0x0e, 0x2800);
+ lb035q02_write_reg(0x0f, 0x0000);
+ lb035q02_write_reg(0x16, 0x9f80);
+ lb035q02_write_reg(0x17, 0x0a0f);
+ lb035q02_write_reg(0x1e, 0x00c1);
+ lb035q02_write_reg(0x30, 0x0300);
+ lb035q02_write_reg(0x31, 0x0007);
+ lb035q02_write_reg(0x32, 0x0000);
+ lb035q02_write_reg(0x33, 0x0000);
+ lb035q02_write_reg(0x34, 0x0707);
+ lb035q02_write_reg(0x35, 0x0004);
+ lb035q02_write_reg(0x36, 0x0302);
+ lb035q02_write_reg(0x37, 0x0202);
+ lb035q02_write_reg(0x3a, 0x0a0d);
+ lb035q02_write_reg(0x3b, 0x0806);
+
+ return r;
+}
+
+static void lb035q02_panel_disable(struct omap_dss_device *dssdev)
+{
+ if (dssdev->platform_disable)
+ dssdev->platform_disable(dssdev);
+
+ /* wait at least 5 vsyncs after disabling the LCD */
+
+ msleep(100);
+}
+
+static int lb035q02_panel_suspend(struct omap_dss_device *dssdev)
+{
+ pr_info("lgphilips_lb035q02: panel_suspend\n");
+ lb035q02_panel_disable(dssdev);
+ return 0;
+}
+
+static int lb035q02_panel_resume(struct omap_dss_device *dssdev)
+{
+ pr_info("lgphilips_lb035q02: panel_resume\n");
+ return lb035q02_panel_enable(dssdev);
+}
+
+static struct omap_dss_driver lb035q02_driver = {
+ .probe = lb035q02_panel_probe,
+ .remove = lb035q02_panel_remove,
+
+ .enable = lb035q02_panel_enable,
+ .disable = lb035q02_panel_disable,
+ .suspend = lb035q02_panel_suspend,
+ .resume = lb035q02_panel_resume,
+
+ .driver = {
+ .name = "lgphilips_lb035q02_panel",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi)
+{
+ spidev = spi;
+ return 0;
+}
+
+static int __devexit lb035q02_panel_spi_remove(struct spi_device *spi)
+{
+ return 0;
+}
+
+static struct spi_driver lb035q02_spi_driver = {
+ .driver = {
+ .name = "lgphilips_lb035q02_panel-spi",
+ .owner = THIS_MODULE,
+ },
+ .probe = lb035q02_panel_spi_probe,
+ .remove = __devexit_p (lb035q02_panel_spi_remove),
+};
+
+static int __init lb035q02_panel_drv_init(void)
+{
+ int ret;
+ ret = spi_register_driver(&lb035q02_spi_driver);
+ if (ret != 0)
+ pr_err("lgphilips_lb035q02: Unable to register SPI driver: %d\n", ret);
+
+ ret = omap_dss_register_driver(&lb035q02_driver);
+ if (ret != 0)
+ pr_err("lgphilips_lb035q02: Unable to register panel driver: %d\n", ret);
+
+ return ret;
+}
+
+static void __exit lb035q02_panel_drv_exit(void)
+{
+ spi_unregister_driver(&lb035q02_spi_driver);
+ omap_dss_unregister_driver(&lb035q02_driver);
+}
+
+module_init(lb035q02_panel_drv_init);
+module_exit(lb035q02_panel_drv_exit);
+MODULE_LICENSE("GPL");
--
1.6.6.1
@@ -0,0 +1,32 @@
From 5615ccd89eb521c2365992bdb7c08879fe039daa Mon Sep 17 00:00:00 2001
From: Kishore Kadiyala <kishore.kadiyala@ti.com>
Date: Wed, 17 Feb 2010 19:34:47 +0530
Subject: [PATCH 30/45] Fix for bus width which improves SD card's peformance.
This patch fixes bus width which improves peformance for SD cards.
OMAP-MMC controller's can support maximum bus width of '8'.
when bus width is mentioned as "8" in controller data,the SD
stack will check whether bus width is "4" and if not it will
set bus width to "1" and there by degrading peformance.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
---
drivers/mmc/host/omap_hsmmc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index fa94580..9646a75 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1776,7 +1776,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
MMC_CAP_WAIT_WHILE_BUSY;
if (mmc_slot(host).wires >= 8)
- mmc->caps |= MMC_CAP_8_BIT_DATA;
+ mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA);
else if (mmc_slot(host).wires >= 4)
mmc->caps |= MMC_CAP_4_BIT_DATA;
--
1.6.6.1
@@ -0,0 +1,109 @@
From 14b44ddc3119dc497b4d17901884af4f068c5ada Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Thu, 4 Feb 2010 21:38:02 +0200
Subject: [PATCH 31/45] ARM: VFP: add support to sync the VFP state of the current thread
ARM: VFP: add support to sync the VFP state of the current thread
So far vfp_sync_state worked only for threads other than the current
one. This worked for tracing other threads, but not for PTRACE_TRACEME.
Syncing for the current thread will also be needed by an upcoming patch
adding support for VFP context save / restore around signal handlers.
For SMP we need get_cpu now, since we have to protect the FPEXC
register, other than this things remained the same for threads other
than the current.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
arch/arm/vfp/vfpmodule.c | 46 +++++++++++++++++++++++++++++++---------------
1 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index aed05bc..f28f45b 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -423,12 +423,19 @@ static inline void vfp_pm_init(void) { }
#endif /* CONFIG_PM */
/*
- * Synchronise the hardware VFP state of a thread other than current with the
- * saved one. This function is used by the ptrace mechanism.
+ * Synchronise the hardware VFP state of a thread with the saved one.
+ * This function is used by the ptrace mechanism and the signal handler path.
*/
-#ifdef CONFIG_SMP
void vfp_sync_state(struct thread_info *thread)
{
+ unsigned int cpu = get_cpu();
+ u32 fpexc = fmrx(FPEXC);
+ int vfp_enabled;
+ int self;
+
+ vfp_enabled = fpexc & FPEXC_EN;
+ self = thread == current_thread_info();
+#ifdef CONFIG_SMP
/*
* On SMP systems, the VFP state is automatically saved at every
* context switch. We mark the thread VFP state as belonging to a
@@ -436,18 +443,22 @@ void vfp_sync_state(struct thread_info *thread)
* needed.
*/
thread->vfpstate.hard.cpu = NR_CPUS;
-}
-#else
-void vfp_sync_state(struct thread_info *thread)
-{
- unsigned int cpu = get_cpu();
- u32 fpexc = fmrx(FPEXC);
-
/*
- * If VFP is enabled, the previous state was already saved and
- * last_VFP_context updated.
+ * Only the current thread's saved VFP context can be out-of-date.
+ * For others there is nothing else to do, since we already ensured
+ * force loading above.
*/
- if (fpexc & FPEXC_EN)
+ if (!self)
+ goto out;
+#endif
+ /*
+ * If the VFP is enabled only the current thread's saved VFP
+ * context can get out-of-date. For other threads the context
+ * was updated when the current thread started to use the VFP.
+ * This also means that the context will be reloaded next time
+ * the thread uses the VFP, so no need to enforce it.
+ */
+ if (vfp_enabled && !self)
goto out;
if (!last_VFP_context[cpu])
@@ -456,8 +467,14 @@ void vfp_sync_state(struct thread_info *thread)
/*
* Save the last VFP state on this CPU.
*/
- fmxr(FPEXC, fpexc | FPEXC_EN);
+ if (!vfp_enabled)
+ fmxr(FPEXC, fpexc | FPEXC_EN);
vfp_save_state(last_VFP_context[cpu], fpexc);
+ /*
+ * Disable VFP in case it was enabled so that the force reload
+ * can happen.
+ */
+ fpexc &= ~FPEXC_EN;
fmxr(FPEXC, fpexc);
/*
@@ -469,7 +486,6 @@ void vfp_sync_state(struct thread_info *thread)
out:
put_cpu();
}
-#endif
#include <linux/smp.h>
--
1.6.6.1
@@ -0,0 +1,211 @@
From 7cdc806843b28f0f35dd41fb79aac815773a3550 Mon Sep 17 00:00:00 2001
From: Imre Deak <imre.deak@nokia.com>
Date: Thu, 4 Feb 2010 21:38:30 +0200
Subject: [PATCH 32/45] ARM: VFP: preserve the HW context when calling signal handlers
ARM: VFP: preserve the HW context when calling signal handlers
Signal handlers can use floating point, so prevent them to corrupt
the main thread's VFP context. So far there were two signal stack
frame formats defined based on the VFP implementation, but the user
struct used for ptrace covers all posibilities, so use it for the
signal stack too. This patch extends the user struct and leaves
its magic number the same, in the hope that user space code does
not depend on its size and can parse the original regs w/o
problems.
Support to save / restore the exception registers was added by
Will Deacon.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
arch/arm/include/asm/ucontext.h | 19 +++-----
arch/arm/include/asm/user.h | 3 +
arch/arm/kernel/signal.c | 91 +++++++++++++++++++++++++++++++++++++--
3 files changed, 97 insertions(+), 16 deletions(-)
diff --git a/arch/arm/include/asm/ucontext.h b/arch/arm/include/asm/ucontext.h
index bf65e9f..1c3236b 100644
--- a/arch/arm/include/asm/ucontext.h
+++ b/arch/arm/include/asm/ucontext.h
@@ -59,23 +59,18 @@ struct iwmmxt_sigframe {
#endif /* CONFIG_IWMMXT */
#ifdef CONFIG_VFP
-#if __LINUX_ARM_ARCH__ < 6
-/* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
- * word after the registers, and a word of padding at the end for
- * alignment. */
#define VFP_MAGIC 0x56465001
-#define VFP_STORAGE_SIZE 152
-#else
-#define VFP_MAGIC 0x56465002
-#define VFP_STORAGE_SIZE 144
-#endif
struct vfp_sigframe
{
unsigned long magic;
unsigned long size;
- union vfp_state storage;
-};
+ struct user_vfp ufp;
+} __attribute__((__aligned__(8)));
+
+/* 8 byte for magic and size, 272 byte for ufp */
+#define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
+
#endif /* CONFIG_VFP */
/*
@@ -91,7 +86,7 @@ struct aux_sigframe {
#ifdef CONFIG_IWMMXT
struct iwmmxt_sigframe iwmmxt;
#endif
-#if 0 && defined CONFIG_VFP /* Not yet saved. */
+#ifdef CONFIG_VFP
struct vfp_sigframe vfp;
#endif
/* Something that isn't a valid magic number for any coprocessor. */
diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
index df95e05..ea7e44d 100644
--- a/arch/arm/include/asm/user.h
+++ b/arch/arm/include/asm/user.h
@@ -88,6 +88,9 @@ struct user{
struct user_vfp {
unsigned long long fpregs[32];
unsigned long fpscr;
+ unsigned long fpexc;
+ unsigned long fpinst;
+ unsigned long fpinst2;
};
#endif /* _ARM_USER_H */
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index e7714f3..6a36851 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -18,6 +18,7 @@
#include <asm/cacheflush.h>
#include <asm/ucontext.h>
#include <asm/unistd.h>
+#include <asm/vfp.h>
#include "ptrace.h"
#include "signal.h"
@@ -175,6 +176,88 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
#endif
+#ifdef CONFIG_VFP
+
+static int preserve_vfp_context(struct vfp_sigframe __user *frame)
+{
+ struct thread_info *thread = current_thread_info();
+ struct vfp_hard_struct *h = &thread->vfpstate.hard;
+ const unsigned long magic = VFP_MAGIC;
+ const unsigned long size = VFP_STORAGE_SIZE;
+ int err = 0;
+
+ vfp_sync_state(thread);
+ __put_user_error(magic, &frame->magic, err);
+ __put_user_error(size, &frame->size, err);
+
+ /*
+ * Copy the floating point registers. There can be unused
+ * registers see asm/hwcap.h for details.
+ */
+ err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs,
+ sizeof(h->fpregs));
+ /*
+ * Copy the status and control register.
+ */
+ __put_user_error(h->fpscr, &frame->ufp.fpscr, err);
+
+ /*
+ * Copy the exception registers.
+ */
+ __put_user_error(h->fpexc, &frame->ufp.fpexc, err);
+ __put_user_error(h->fpinst, &frame->ufp.fpinst, err);
+ __put_user_error(h->fpinst2, &frame->ufp.fpinst2, err);
+
+ return err ? -EFAULT : 0;
+}
+
+static int restore_vfp_context(struct vfp_sigframe __user *frame)
+{
+ struct thread_info *thread = current_thread_info();
+ struct vfp_hard_struct *h = &thread->vfpstate.hard;
+ unsigned long magic;
+ unsigned long size;
+ unsigned long fpexc;
+ int err = 0;
+
+ vfp_sync_state(thread);
+ __get_user_error(magic, &frame->magic, err);
+ __get_user_error(size, &frame->size, err);
+
+ if (err)
+ return -EFAULT;
+ if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
+ return -EINVAL;
+
+ /*
+ * Copy the floating point registers. There can be unused
+ * registers see asm/hwcap.h for details.
+ */
+ err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs,
+ sizeof(h->fpregs));
+ /*
+ * Copy the status and control register.
+ */
+ __get_user_error(h->fpscr, &frame->ufp.fpscr, err);
+
+ /*
+ * Sanitise and restore the exception registers.
+ */
+ __get_user_error(fpexc, &frame->ufp.fpexc, err);
+ /* Ensure the VFP is enabled. */
+ fpexc |= FPEXC_EN;
+ /* Ensure FPINST2 is invalid and the exception flag is cleared. */
+ fpexc &= ~(FPEXC_EX | FPEXC_FP2V);
+ h->fpexc = fpexc;
+
+ __get_user_error(h->fpinst, &frame->ufp.fpinst, err);
+ __get_user_error(h->fpinst2, &frame->ufp.fpinst2, err);
+
+ return err ? -EFAULT : 0;
+}
+
+#endif
+
/*
* Do a signal return; undo the signal stack. These are aligned to 64-bit.
*/
@@ -233,8 +316,8 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
err |= restore_iwmmxt_context(&aux->iwmmxt);
#endif
#ifdef CONFIG_VFP
-// if (err == 0)
-// err |= vfp_restore_state(&sf->aux.vfp);
+ if (err == 0)
+ err |= restore_vfp_context(&aux->vfp);
#endif
return err;
@@ -348,8 +431,8 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
err |= preserve_iwmmxt_context(&aux->iwmmxt);
#endif
#ifdef CONFIG_VFP
-// if (err == 0)
-// err |= vfp_save_state(&sf->aux.vfp);
+ if (err == 0)
+ err |= preserve_vfp_context(&aux->vfp);
#endif
__put_user_error(0, &aux->end_magic, err);
--
1.6.6.1
@@ -0,0 +1,27 @@
From 19f0835c3c8fa52280ae74bbc23dce747708f4af Mon Sep 17 00:00:00 2001
From: Prabindh Sundareson <prabu@ti.com>
Date: Wed, 3 Mar 2010 15:45:35 +0100
Subject: [PATCH 33/45] Switch SGX clocks to 200MHz on DM37xx/OMAP36xx
---
arch/arm/mach-omap2/clock34xx_data.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock34xx_data.c
index e3c752f..89e2f61 100644
--- a/arch/arm/mach-omap2/clock34xx_data.c
+++ b/arch/arm/mach-omap2/clock34xx_data.c
@@ -3325,8 +3325,8 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1),
CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1),
CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1),
- CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2 | CK_3517),
- CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2 | CK_3517),
+ CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2 | CK_3517 | CK_36XX),
+ CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2 | CK_3517 | CK_36XX),
CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1),
CLK(NULL, "modem_fck", &modem_fck, CK_343X),
CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X),
--
1.6.6.1
@@ -0,0 +1,27 @@
From 2f4193b92096394cfd56e3757c8d6ca8e13d5c4d Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Mon, 8 Mar 2010 14:38:31 +0100
Subject: [PATCH 34/45] modedb.c: add proper 720p60 mode
---
drivers/video/modedb.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index b32fa2a..f017d57 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -44,6 +44,10 @@ static const struct fb_videomode modedb[] = {
NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2,
0, FB_VMODE_NONINTERLACED
}, {
+ /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */
+ "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5,
+ 0, FB_VMODE_NONINTERLACED
+ }, {
/* 800x600 @ 56 Hz, 35.15 kHz hsync */
NULL, 56, 800, 600, 27777, 128, 24, 22, 1, 72, 2,
0, FB_VMODE_NONINTERLACED
--
1.6.6.1
@@ -0,0 +1,55 @@
From 237492efd365a0f69d41d818fc368f5621aa8f3b Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Thu, 4 Feb 2010 12:26:22 -0800
Subject: [PATCH 35/45] RTC: add support for backup battery recharge
---
drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index c6a83a2..2329b5b 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -30,6 +30,23 @@
#include <linux/i2c/twl.h>
+/*
+ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER)
+ */
+#define REG_BB_CFG 0x12
+
+/* PM_RECEIVER BB_CFG bitfields */
+#define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08
+#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02
+#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03
/*
* RTC block register offsets (use TWL_MODULE_RTC)
@@ -508,6 +525,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
if (ret < 0)
goto out2;
+ /* enable backup battery charging */
+ /* use a conservative 25uA @ 3.1V */
+ ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ BIT_PM_RECEIVER_BB_CFG_BBCHEN |
+ BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
+ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
+ REG_BB_CFG);
+
return ret;
out2:
--
1.6.6.1
@@ -0,0 +1,29 @@
From aa2753fcce815b4a86be5c95238cf029a948e5ff Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Mon, 13 Oct 2008 20:32:16 +0100
Subject: [PATCH 36/45] ARM: Add prompt for CONFIG_ALIGNMENT_TRAP
This adds a prompt text for CONFIG_ALIGNMENT_TRAP, thus making it
visible in make *config.
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
arch/arm/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 88f628b..f5ded3c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1224,7 +1224,7 @@ config LEDS_CPU
will overrule the CPU usage LED.
config ALIGNMENT_TRAP
- bool
+ bool "Enable alignment trap"
depends on CPU_CP15_MMU
default y if !ARCH_EBSA110
help
--
1.6.6.1
@@ -0,0 +1,31 @@
From a265396d38d93b371dbba020fb64aee42b4d4905 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Sat, 28 Mar 2009 13:21:55 +0000
Subject: [PATCH 37/45] ARM: Print warning on alignment trap in kernel mode
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
arch/arm/mm/alignment.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index b270d62..5e9014b 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -756,6 +756,13 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
ai_sys += 1;
+ printk("Alignment trap in kernel: %s (%d) PC=0x%08lx Instr=0x%0*lx "
+ "Address=0x%08lx FSR 0x%03x\n", current->comm,
+ task_pid_nr(current), instrptr,
+ thumb_mode(regs) ? 4 : 8,
+ thumb_mode(regs) ? tinstr : instr,
+ addr, fsr);
+
fixup:
regs->ARM_pc += isize;
--
1.6.6.1
@@ -0,0 +1,202 @@
From b2792916bb10bdd3093bf88ca62064a3b10ad877 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Tue, 10 Nov 2009 00:39:21 +0000
Subject: [PATCH 38/45] ARM: Expose some CPU control registers via sysfs
This creates sysfs files under /sys/devices/system/cpu/cpuN
exposing the values of the control register, auxiliary control
register, and L2 cache auxiliary control register. Writing to
the files allows setting the value of bits which are safe to
change at any time.
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
arch/arm/Kconfig | 5 ++
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/sysfs_v7.c | 146 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 152 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/kernel/sysfs_v7.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f5ded3c..2d370da 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1252,6 +1252,11 @@ config UACCESS_WITH_MEMCPY
However, if the CPU data cache is using a write-allocate mode,
this option is unlikely to provide any performance gain.
+config CPU_V7_SYSFS
+ bool
+ depends on CPU_V7 && SYSFS
+ default y
+
endmenu
menu "Boot options"
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index dd00f74..ee20134 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_ARM_UNWIND) += unwind.o
obj-$(CONFIG_HAVE_TCM) += tcm.o
+obj-$(CONFIG_CPU_V7_SYSFS) += sysfs_v7.o
obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/sysfs_v7.c b/arch/arm/kernel/sysfs_v7.c
new file mode 100644
index 0000000..c05bf5f
--- /dev/null
+++ b/arch/arm/kernel/sysfs_v7.c
@@ -0,0 +1,146 @@
+/*
+ * linux/arch/arm/kernel/sysfs.c
+ *
+ * Copyright (C) 2008 Mans Rullgard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/cpu.h>
+#include <linux/sysdev.h>
+#include <linux/fs.h>
+
+#define SETBITS(val, bits, new) \
+ do { \
+ val &= ~bits; \
+ val |= new & bits; \
+ } while (0)
+
+#define SHOW_REG(name, opc1, crn, crm, opc2) \
+static ssize_t name##_show(struct sys_device *dev, \
+ struct sysdev_attribute *attr, \
+ char *buf) \
+{ \
+ unsigned val; \
+ asm ("mrc p15,"#opc1", %0,"#crn","#crm","#opc2 : "=r"(val)); \
+ return snprintf(buf, PAGE_SIZE, "%08x\n", val); \
+}
+
+#define STORE_REG(name, opc1, crn, crm, opc2, bits) \
+static ssize_t name##_store(struct sys_device *dev, \
+ struct sysdev_attribute *attr, \
+ const char *buf, size_t size) \
+{ \
+ char *end; \
+ unsigned new = simple_strtoul(buf, &end, 0); \
+ unsigned val; \
+ \
+ if (end == buf) \
+ return -EINVAL; \
+ \
+ asm ("mrc p15,"#opc1", %0,"#crn","#crm","#opc2 : "=r"(val)); \
+ SETBITS(val, bits, new); \
+ asm ("mcr p15,"#opc1", %0,"#crn","#crm","#opc2 :: "r"(val)); \
+ \
+ return end - buf; \
+}
+
+#define RD_REG(name, opc1, crn, crm, opc2) \
+ SHOW_REG(name, opc1, crn, crm, opc2) \
+ static SYSDEV_ATTR(name, S_IRUGO|S_IWUSR, name##_show, NULL)
+
+#define RDWR_REG(name, opc1, crn, crm, opc2, bits) \
+ SHOW_REG(name, opc1, crn, crm, opc2) \
+ STORE_REG(name, opc1, crn, crm, opc2, bits) \
+ static SYSDEV_ATTR(name, S_IRUGO|S_IWUSR, name##_show, name##_store)
+
+RDWR_REG(control, 0, c1, c0, 0, 0x802);
+
+SHOW_REG(aux_ctl, 0, c1, c0, 1)
+
+#ifdef CONFIG_ARCH_OMAP34XX
+static ssize_t aux_ctl_store(struct sys_device *dev,
+ struct sysdev_attribute *attr,
+ const char *buf, size_t size)
+{
+ char *end;
+ unsigned new = simple_strtoul(buf, &end, 0);
+ unsigned val;
+
+ if (end == buf)
+ return -EINVAL;
+
+ asm ("mrc p15, 0, %0, c1, c0, 1" : "=r"(val));
+ SETBITS(val, 0xff8, new);
+ val &= ~2;
+ asm ("mov r0, %0 \n\t"
+ "mov r12, #3 \n\t"
+ "smc #0 \n\t"
+ :: "r"(val) : "r0", "r12");
+
+ return end - buf;
+}
+#define AUX_WR S_IWUSR
+#else
+#define aux_ctl_store NULL
+#define AUX_WR 0
+#endif
+
+static SYSDEV_ATTR(aux_control, S_IRUGO|AUX_WR, aux_ctl_show, aux_ctl_store);
+
+SHOW_REG(l2_aux_ctl, 1, c9, c0, 2)
+
+#ifdef CONFIG_ARCH_OMAP34XX
+static ssize_t l2_aux_ctl_store(struct sys_device *dev,
+ struct sysdev_attribute *attr,
+ const char *buf, size_t size)
+{
+ char *end;
+ unsigned new = simple_strtoul(buf, &end, 0);
+ unsigned val;
+
+ if (end == buf)
+ return -EINVAL;
+
+ asm ("mrc p15, 1, %0, c9, c0, 2" : "=r"(val));
+ SETBITS(val, 0xbc00000, new);
+ asm ("mov r0, %0 \n\t"
+ "mov r12, #2 \n\t"
+ "smc #0 \n\t"
+ :: "r"(val) : "r0", "r12");
+
+ return end - buf;
+}
+#define L2AUX_WR S_IWUSR
+#else
+#define l2_aux_ctl_store NULL
+#define L2AUX_WR 0
+#endif
+
+static SYSDEV_ATTR(l2_aux_control, S_IRUGO|L2AUX_WR,
+ l2_aux_ctl_show, l2_aux_ctl_store);
+
+#define REG_ATTR(sysdev, name) \
+ do { \
+ int err = sysfs_create_file(&sysdev->kobj, &name.attr); \
+ WARN_ON(err != 0); \
+ } while (0)
+
+static int __init cpu_sysfs_init(void)
+{
+ struct sys_device *sysdev;
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ sysdev = get_cpu_sysdev(cpu);
+ REG_ATTR(sysdev, attr_control);
+ REG_ATTR(sysdev, attr_aux_control);
+ REG_ATTR(sysdev, attr_l2_aux_control);
+ }
+
+ return 0;
+}
+device_initcall(cpu_sysfs_init);
--
1.6.6.1
@@ -0,0 +1,48 @@
From f9ab0732a5302bd52026f92430c91b253aa4111b Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Tue, 10 Nov 2009 00:41:54 +0000
Subject: [PATCH 39/45] ARM: Add option to allow userspace PLE access
This adds a Kconfig option to allow userspace to access the L2 preload
engine (PLE) found in Cortex-A8.
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
arch/arm/kernel/head.S | 4 ++++
arch/arm/mm/Kconfig | 8 ++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index eb62bf9..659ec9e 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -172,6 +172,10 @@ __enable_mmu:
#ifdef CONFIG_CPU_ICACHE_DISABLE
bic r0, r0, #CR_I
#endif
+#ifdef CONFIG_USER_L2_PLE
+ mov r5, #3
+ mcr p15, 0, r5, c11, c1, 0
+#endif
mov r5, #(domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
domain_val(DOMAIN_TABLE, DOMAIN_MANAGER) | \
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index dd4698c..564ff7d 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -785,3 +785,11 @@ config ARM_L1_CACHE_SHIFT
int
default 6 if ARCH_OMAP3 || ARCH_S5PC1XX
default 5
+
+config USER_L2_PLE
+ bool "Enable userspace access to the L2 PLE"
+ depends on CPU_V7
+ default n
+ help
+ Enable userspace access to the L2 preload engine (PLE) available
+ in Cortex-A series ARM processors.
--
1.6.6.1
@@ -0,0 +1,49 @@
From 6efdc547be5f685b4f29b05eba73cb56441fd898 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Tue, 10 Nov 2009 00:52:56 +0000
Subject: [PATCH 40/45] ARM: Add option to allow userspace access to performance counters
This adds an option to allow userspace access to the performance monitor
registers of the Cortex-A8.
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
arch/arm/mm/Kconfig | 7 +++++++
arch/arm/mm/proc-v7.S | 6 ++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 564ff7d..fda2e68 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -793,3 +793,10 @@ config USER_L2_PLE
help
Enable userspace access to the L2 preload engine (PLE) available
in Cortex-A series ARM processors.
+
+config USER_PMON
+ bool "Enable userspace access to performance counters"
+ depends on CPU_V7
+ default n
+ help
+ Enable userpsace access to the performance monitor registers.
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 3a28521..fec926a 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -270,6 +270,12 @@ __v7_setup:
mcr p15, 0, r5, c10, c2, 0 @ write PRRR
mcr p15, 0, r6, c10, c2, 1 @ write NMRR
#endif
+
+#ifdef CONFIG_USER_PMON
+ mov r0, #1
+ mcr p15, 0, r0, c9, c14, 0
+#endif
+
adr r5, v7_crval
ldmia r5, {r5, r6}
#ifdef CONFIG_CPU_ENDIAN_BE8
--
1.6.6.1
@@ -0,0 +1,41 @@
From 51643be36a5b45636cd7208a81a09638d7913604 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Sat, 28 Mar 2009 13:05:02 +0000
Subject: [PATCH 41/45] ARM: Expose some PMON registers through sysfs
---
arch/arm/kernel/sysfs_v7.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/sysfs_v7.c b/arch/arm/kernel/sysfs_v7.c
index c05bf5f..5ed32fb 100644
--- a/arch/arm/kernel/sysfs_v7.c
+++ b/arch/arm/kernel/sysfs_v7.c
@@ -123,6 +123,12 @@ static ssize_t l2_aux_ctl_store(struct sys_device *dev,
static SYSDEV_ATTR(l2_aux_control, S_IRUGO|L2AUX_WR,
l2_aux_ctl_show, l2_aux_ctl_store);
+RDWR_REG(pmon_pmnc, 0, c9, c12, 0, 0x3f)
+RDWR_REG(pmon_cntens, 0, c9, c12, 1, 0x8000000f)
+RDWR_REG(pmon_cntenc, 0, c9, c12, 2, 0x8000000f)
+RDWR_REG(pmon_ccnt, 0, c9, c13, 0, 0xffffffff)
+RDWR_REG(pmon_useren, 0, c9, c14, 0, 1)
+
#define REG_ATTR(sysdev, name) \
do { \
int err = sysfs_create_file(&sysdev->kobj, &name.attr); \
@@ -139,6 +145,11 @@ static int __init cpu_sysfs_init(void)
REG_ATTR(sysdev, attr_control);
REG_ATTR(sysdev, attr_aux_control);
REG_ATTR(sysdev, attr_l2_aux_control);
+ REG_ATTR(sysdev, attr_pmon_pmnc);
+ REG_ATTR(sysdev, attr_pmon_cntens);
+ REG_ATTR(sysdev, attr_pmon_cntenc);
+ REG_ATTR(sysdev, attr_pmon_ccnt);
+ REG_ATTR(sysdev, attr_pmon_useren);
}
return 0;
--
1.6.6.1
@@ -0,0 +1,90 @@
From 38d07e3ffe848680df123f7422ec4b150bbc8f68 Mon Sep 17 00:00:00 2001
From: Ajay Kumar Gupta <ajay.gupta@ti.com>
Date: Wed, 14 Apr 2010 16:08:37 +0530
Subject: [PATCH 42/45] musb: allow host io without gadget module
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
drivers/usb/musb/musb_core.c | 14 +++++++++-----
drivers/usb/musb/musb_gadget.c | 26 --------------------------
2 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 98874c5..a448fa6 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2101,10 +2101,12 @@ bad_config:
* (We expect the ID pin to be forcibly grounded!!)
* Otherwise, wait till the gadget driver hooks up.
*/
- if (!is_otg_enabled(musb) && is_host_enabled(musb)) {
- MUSB_HST_MODE(musb);
- musb->xceiv->default_a = 1;
- musb->xceiv->state = OTG_STATE_A_IDLE;
+ if (is_host_enabled(musb)) {
+ if (!is_otg_enabled(musb)) {
+ MUSB_HST_MODE(musb);
+ musb->xceiv->default_a = 1;
+ musb->xceiv->state = OTG_STATE_A_IDLE;
+ }
status = usb_add_hcd(musb_to_hcd(musb), -1, 0);
@@ -2115,7 +2117,9 @@ bad_config:
& MUSB_DEVCTL_BDEVICE
? 'B' : 'A'));
- } else /* peripheral is enabled */ {
+ }
+ /* peripheral is enabled */
+ if (is_peripheral_enabled(musb)) {
MUSB_DEV_MODE(musb);
musb->xceiv->default_a = 0;
musb->xceiv->state = OTG_STATE_B_IDLE;
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index fd842af..b9ef9f3 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1768,24 +1768,6 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
otg_set_peripheral(musb->xceiv, &musb->g);
spin_unlock_irqrestore(&musb->lock, flags);
-
- if (is_otg_enabled(musb)) {
- DBG(3, "OTG startup...\n");
-
- /* REVISIT: funcall to other code, which also
- * handles power budgeting ... this way also
- * ensures HdrcStart is indirectly called.
- */
- retval = usb_add_hcd(musb_to_hcd(musb), -1, 0);
- if (retval < 0) {
- DBG(1, "add_hcd failed, %d\n", retval);
- spin_lock_irqsave(&musb->lock, flags);
- otg_set_peripheral(musb->xceiv, NULL);
- musb->gadget_driver = NULL;
- musb->g.dev.driver = NULL;
- spin_unlock_irqrestore(&musb->lock, flags);
- }
- }
}
return retval;
@@ -1881,14 +1863,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
retval = -EINVAL;
spin_unlock_irqrestore(&musb->lock, flags);
- if (is_otg_enabled(musb) && retval == 0) {
- usb_remove_hcd(musb_to_hcd(musb));
- /* FIXME we need to be able to register another
- * gadget driver here and have everything work;
- * that currently misbehaves.
- */
- }
-
return retval;
}
EXPORT_SYMBOL(usb_gadget_unregister_driver);
--
1.6.6.1
@@ -0,0 +1,59 @@
From 089d3a51f0467d68c42b2df88a6f9a0488aada47 Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 26 Apr 2010 11:17:26 -0700
Subject: [PATCH 43/45] MTD: silence ecc errors on mtdblock0
mtdblock0 is the x-load partition, which uses hw ecc
this confuses linux, which uses sw ecc
this patch silences ecc error messages when linux peeks into mtdblock0
* not for upstream submission *
---
block/blk-core.c | 3 ++-
drivers/mtd/nand/nand_ecc.c | 2 +-
fs/buffer.c | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 718897e..c526fde 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1970,7 +1970,8 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
req->errors = 0;
if (error && (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))) {
- printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
+ if (req->rq_disk && (strcmp(req->rq_disk->disk_name, "mtdblock0") != 0))
+ printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
req->rq_disk ? req->rq_disk->disk_name : "?",
(unsigned long long)blk_rq_pos(req));
}
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index 92320a6..2b86b6d 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -492,7 +492,7 @@ int __nand_correct_data(unsigned char *buf,
if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1)
return 1; /* error in ecc data; no action needed */
- printk(KERN_ERR "uncorrectable error : ");
+// printk(KERN_ERR "uncorrectable error : ");
return -1;
}
EXPORT_SYMBOL(__nand_correct_data);
diff --git a/fs/buffer.c b/fs/buffer.c
index 6fa5302..27b3103 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -114,7 +114,8 @@ static int quiet_error(struct buffer_head *bh)
static void buffer_io_error(struct buffer_head *bh)
{
char b[BDEVNAME_SIZE];
- printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
+ if (strcmp(bdevname(bh->b_bdev, b), "mtdblock0") != 0)
+ printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
bdevname(bh->b_bdev, b),
(unsigned long long)bh->b_blocknr);
}
--
1.6.6.1
@@ -0,0 +1,34 @@
From 2db9c35d01af6f4b3e44fac3466b5d6b62e52232 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Thu, 13 May 2010 21:43:08 +0200
Subject: [PATCH 44/45] ARM: OMAP: beagle: every known beagle (except revB) uses 2 chipselects so don't use NULL for the second chipselect timings
---
arch/arm/mach-omap2/board-omap3beagle.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index c4ebaab..4aa91cb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -614,7 +614,7 @@ static void __init omap3_beagle_init_irq(void)
if (cpu_is_omap3630())
{
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- NULL,
+ mt46h32m32lf6_sdrc_params,
_omap37x_mpu_rate_table,
_omap37x_dsp_rate_table,
_omap37x_l3_rate_table);
@@ -622,7 +622,7 @@ static void __init omap3_beagle_init_irq(void)
else
{
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- NULL,
+ mt46h32m32lf6_sdrc_params,
_omap35x_mpu_rate_table,
_omap35x_dsp_rate_table,
_omap35x_l3_rate_table);
--
1.6.6.1
@@ -0,0 +1,70 @@
From 46df6bfeaff6f64bfae3fd9ac930bd6c768a352f Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sat, 15 May 2010 21:47:32 +0200
Subject: [PATCH 45/45] ARM: OMAP: beagle: add support for beagleFPGA expansionboard: http://members.cox.net/ebrombaugh1/embedded/beagle/beagle_fpga.html
---
arch/arm/mach-omap2/board-omap3beagle.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 4aa91cb..93b9e5f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -24,6 +24,7 @@
#include <linux/irq.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
+#include <linux/spi/spi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
@@ -47,6 +48,7 @@
#include <plat/timer-gp.h>
#include <plat/clock.h>
#include <plat/omap-pm.h>
+#include <plat/mcspi.h>
#include "mux.h"
#include "mmc-twl4030.h"
@@ -609,6 +611,24 @@ static struct platform_device keys_gpio = {
},
};
+static struct spi_board_info beaglefpga_mcspi_board_info[] = {
+ // spi 4.0
+ {
+ .modalias = "spidev",
+ .max_speed_hz = 48000000, //48 Mbps
+ .bus_num = 4,
+ .chip_select = 0,
+ .mode = SPI_MODE_1,
+ },
+};
+
+static void __init beaglefpga_init_spi(void)
+{
+ /* hook the spi ports to the spidev driver */
+ spi_register_board_info(beaglefpga_mcspi_board_info,
+ ARRAY_SIZE(beaglefpga_mcspi_board_info));
+}
+
static void __init omap3_beagle_init_irq(void)
{
if (cpu_is_omap3630())
@@ -774,6 +794,12 @@ static void __init omap3_beagle_init(void)
gpio_export(162, 1);
}
+ if(!strcmp(expansionboard_name, "beaglefpga"))
+ {
+ printk(KERN_INFO "Beagle expansionboard: Using McSPI for SPI\n");
+ beaglefpga_init_spi();
+ }
+
usb_musb_init();
usb_ehci_init(&ehci_pdata);
omap3beagle_flash_init();
--
1.6.6.1
@@ -0,0 +1,57 @@
From b0c673e40d40428a9bd05101d15d773cd4f4720c Mon Sep 17 00:00:00 2001
From: Ranjith Lohithakshan <unknown@ti.com>
Date: Sat, 22 May 2010 18:32:24 +0200
Subject: [PATCH 46/48] attemp to fix serial console corruption during cpuidle
---
arch/arm/mach-omap2/cpuidle34xx.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f8aea56..35d1c3e 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -60,7 +60,7 @@ struct omap3_processor_cx {
struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
struct omap3_processor_cx current_cx_state;
-struct powerdomain *mpu_pd, *core_pd;
+struct powerdomain *mpu_pd, *per_pd, *core_pd;
/*
* The latencies/thresholds for various C states have
@@ -131,6 +131,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
local_fiq_disable();
pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+ pwrdm_set_next_pwrst(per_pd, mpu_state);
pwrdm_set_next_pwrst(core_pd, core_state);
if (omap_irq_pending() || need_resched())
@@ -138,6 +139,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
if (cx->type == OMAP3_STATE_C1) {
pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
+ pwrdm_for_each_clkdm(per_pd, _cpuidle_deny_idle);
pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
}
@@ -146,6 +148,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
if (cx->type == OMAP3_STATE_C1) {
pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
+ pwrdm_for_each_clkdm(per_pd, _cpuidle_allow_idle);
pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
}
@@ -425,6 +428,7 @@ int __init omap3_idle_init(void)
struct cpuidle_device *dev;
mpu_pd = pwrdm_lookup("mpu_pwrdm");
+ per_pd = pwrdm_lookup("per_pwrdm");
core_pd = pwrdm_lookup("core_pwrdm");
omap_init_power_states();
--
1.6.6.1
@@ -0,0 +1,37 @@
From 4d5f88fca430ca38a35e60683dc301e80046b05d Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Sun, 23 May 2010 14:47:32 +0200
Subject: [PATCH 47/48] clock34xx: only try to idle IVA subsys when CONFIG_PM is set
---
arch/arm/mach-omap2/clock34xx.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 2bb7182..a323f9f 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -407,7 +407,9 @@ void omap3_clk_lock_dpll5(void)
return;
}
+#ifdef CONFIG_PM
extern void __init omap3_iva_idle(void);
+#endif
/*
* Initialize IVA to a idle state. This is typically done by the
@@ -425,8 +427,9 @@ static void __init omap2_clk_iva_init_to_idle(void)
prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
+#ifdef CONFIG_PM
omap3_iva_idle();
-
+#endif
}
/* REVISIT: Move this init stuff out into clock.c */
--
1.6.6.1
@@ -0,0 +1,60 @@
From 258a962bea2da43df6f70fd264a0e23b65669176 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 4 May 2010 17:04:27 +0200
Subject: [PATCH 48/48] HACK: try to poweron stuff on xM rev A
---
arch/arm/mach-omap2/board-omap3beagle.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index b313350..7f0e241 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -237,7 +237,6 @@ static struct omap_dss_device beagle_dvi_device = {
.name = "dvi",
.driver_name = "generic_panel",
.phy.dpi.data_lines = 24,
- .reset_gpio = 170,
.platform_enable = beagle_enable_dvi,
.platform_disable = beagle_disable_dvi,
};
@@ -364,6 +363,9 @@ static int beagle_twl_gpio_setup(struct device *dev,
*/
if (cpu_is_omap3630()) {
+ /* DVI reset GPIO is different between revisions */
+ beagle_dvi_device.reset_gpio = 129;
+
/* Power on DVI, Serial and PWR led */
gpio_request(gpio + 1, "nDVI_PWR_EN");
gpio_direction_output(gpio + 1, 0);
@@ -374,9 +376,12 @@ static int beagle_twl_gpio_setup(struct device *dev,
/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
}
else {
+ /* DVI reset GPIO is different between revisions */
+ beagle_dvi_device.reset_gpio = 170;
+
gpio_request(gpio + 1, "EHCI_nOC");
gpio_direction_input(gpio + 1);
@@ -735,11 +740,6 @@ static void __init omap3_beagle_init(void)
ARRAY_SIZE(omap3_beagle_devices));
omap_serial_init();
- omap_mux_init_gpio(170, OMAP_PIN_INPUT);
- gpio_request(170, "DVI_nPD");
- /* REVISIT leave DVI powered down until it's needed ... */
- gpio_direction_output(170, true);
-
if(!strcmp(expansionboard_name, "zippy"))
{
printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n");
--
1.6.6.1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,398 @@
From 29157ffef7f3813c1ec23f9d11eb485242d53454 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Fri, 11 Jun 2010 13:51:49 -0500
Subject: [PATCH 02/75] mt9t111: Fix all checkpatch errors
The code was plagued with checkpatch errors. Fix them!
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
drivers/media/video/mt9t111.c | 153 ++++++++++++++++++++-----------------
drivers/media/video/mt9t111_reg.h | 6 +-
include/media/mt9t111.h | 2 +-
3 files changed, 87 insertions(+), 74 deletions(-)
diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c
index ecc5115..95e1508 100644
--- a/drivers/media/video/mt9t111.c
+++ b/drivers/media/video/mt9t111.c
@@ -17,20 +17,21 @@
#include <media/mt9t111.h>
#include "mt9t111_reg.h"
-#define USE_RAW // YCbCr mode does not work yet
-//#define COLOR_BAR // Create a Color bar test pattern, Blue, Green, Red, Grey
+/* YCbCr mode does not work yet */
+#define USE_RAW
+/* Create a Color bar test pattern, Blue, Green, Red, Grey */
+/* #define COLOR_BAR */
#define SENSOR_DETECTED 1
#define SENSOR_NOT_DETECTED 0
static void mt9t111_loaddefault(struct i2c_client *client);
-/*
-* as a place holder for further development
-*/
+/*
+ * as a place holder for further development
+ */
static void debug_dummy(char *in_msg)
{
-
}
/* list of image formats supported by mt9t111 sensor */
@@ -55,8 +56,8 @@ const static struct v4l2_fmtdesc mt9t111_formats[] = {
* smallest image size to largest.
*/
const static struct capture_size mt9t111_sizes[] = {
- { 640, 480 },
-// { 2048, 1536}
+ { 640, 480 },
+ /* { 2048, 1536} */
};
#define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes)
@@ -120,17 +121,17 @@ mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val)
msg->addr = client->addr;
msg->flags = 0;
msg->len = 2;
- msg->buf = data;
+ msg->buf = data;
data[0] = (reg & 0xff00) >> 8;
data[1] = (reg & 0x00ff);
err = i2c_transfer(client->adapter, msg, 1);
- if (err >= 0) {
- msg->flags = I2C_M_RD;
- msg->len = 2; /* 2 byte read */
- err = i2c_transfer(client->adapter, msg, 1);
- if (err >= 0) {
- *val = ((data[0] & 0x00ff) << 8)
- | (data[1] & 0x00ff);
+ if (err >= 0) {
+ msg->flags = I2C_M_RD;
+ msg->len = 2; /* 2 byte read */
+ err = i2c_transfer(client->adapter, msg, 1);
+ if (err >= 0) {
+ *val = ((data[0] & 0x00ff) << 8)
+ | (data[1] & 0x00ff);
return 0;
}
}
@@ -159,7 +160,7 @@ mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val)
msg->len = 4;
msg->buf = data;
data[0] = (u8)((reg & 0xff00) >> 8);
- data[1] = (u8)(reg & 0x00ff);
+ data[1] = (u8)(reg & 0x00ff);
data[2] = (u8)((val & 0xff00) >> 8);
data[3] = (u8)(val & 0x00ff);
err = i2c_transfer(client->adapter, msg, 1);
@@ -171,7 +172,7 @@ mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val)
* mt9t111_write_regs - Write registers to an mt9t111 sensor device
* @client: i2c driver client structure
* @reg_in: pointer to registers to write
- * @cnt: the number of registers
+ * @cnt: the number of registers
*
* Write registers .
* Returns zero if successful, or non-zero otherwise.
@@ -182,19 +183,21 @@ mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt)
int err = 0;
int i;
mt9t111_regs *reg = reg_in;
-
- for (i=0;i<cnt;i++) {
+
+ for (i = 0; i < cnt; i++) {
if (reg->delay_time == 0) {
err |= mt9t111_write_reg(client, reg->addr, reg->data);
} else if (reg->addr != 0 || reg->data != 0) {
err |= mt9t111_write_reg(client, reg->addr, reg->data);
mdelay(reg->delay_time);
- } else
+ } else {
mdelay(reg->delay_time);
-
+ }
+
if (err < 0) {
- dev_warn(&client->dev, "write reg error, addr = 0x%x, data = 0x%x \n", \
- reg->addr, reg->data);
+ dev_warn(&client->dev, "write reg error, addr = 0x%x,"
+ " data = 0x%x \n",
+ reg->addr, reg->data);
return err;
}
reg++;
@@ -219,10 +222,11 @@ mt9t111_detect(struct i2c_client *client)
if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0)
return -ENODEV;
dev_info(&client->dev, "model id detected 0x%x\n", val);
-
+
if (val != MT9T111_CHIP_ID_VALUE) {
- dev_warn(&client->dev, "model id mismatch received 0x%x expecting 0x%x\n",
- val, MT9T111_CHIP_ID_VALUE);
+ dev_warn(&client->dev, "model id mismatch received 0x%x"
+ " expecting 0x%x\n",
+ val, MT9T111_CHIP_ID_VALUE);
return -ENODEV;
}
@@ -285,14 +289,17 @@ static int ioctl_enum_frameintervals(struct v4l2_int_device *s,
{
int ifmt;
-printk(KERN_INFO "entering ioctl_enum_frameintervals\n");
-printk(KERN_INFO "index = %d, pixel_format = 0x%x, width = %d, height = %d\n",
- frmi->index, frmi->pixel_format, frmi->width, frmi->height);
-printk(KERN_INFO "mt9t111 format = 0x%x\n", mt9t111_formats[0].pixelformat);
+ printk(KERN_INFO "entering ioctl_enum_frameintervals\n");
+ printk(KERN_INFO "index = %d, pixel_format = 0x%x,"
+ " width = %d, height = %d\n",
+ frmi->index, frmi->pixel_format,
+ frmi->width, frmi->height);
+ printk(KERN_INFO "mt9t111 format = 0x%x\n",
+ mt9t111_formats[0].pixelformat);
if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS)
return -EINVAL;
-
+
for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) {
if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat)
break;
@@ -368,7 +375,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on)
if (rval < 0) {
dev_err(&c->dev, "Unable to set the power state: " "mt9t111"
" sensor\n");
- //sensor->pdata->set_xclk(0);
+ /* sensor->pdata->set_xclk(0); */
return rval;
}
@@ -418,7 +425,7 @@ static int ioctl_g_priv(struct v4l2_int_device *s, void *p)
static int ioctl_s_parm(struct v4l2_int_device *s,
struct v4l2_streamparm *a)
{
- //TODO: set paramters
+ /* TODO: set paramters */
debug_dummy("debug_dummy -- VIDIOC_S_PARM ");
return 0;
}
@@ -483,13 +490,13 @@ static int ioctl_try_fmt_cap(struct v4l2_int_device *s,
pix->width = 640;
pix->height = 480;
-#ifdef USE_RAW
+#ifdef USE_RAW
pix->pixelformat = V4L2_PIX_FMT_SGRBG10;
- pix->bytesperline = pix->width;
+ pix->bytesperline = pix->width;
pix->colorspace = V4L2_COLORSPACE_SRGB;
#else
pix->pixelformat = V4L2_PIX_FMT_YUYV;
- pix->bytesperline = pix->width * 2;
+ pix->bytesperline = pix->width * 2;
pix->colorspace = V4L2_COLORSPACE_JPEG;
#endif
pix->field = V4L2_FIELD_NONE;
@@ -585,7 +592,7 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s,
static int ioctl_g_ctrl(struct v4l2_int_device *s,
struct v4l2_control *vc)
{
- debug_dummy("debug_dummy -- g ctrl\n");
+ debug_dummy("debug_dummy -- g ctrl\n");
return 0;
}
@@ -601,8 +608,8 @@ static int ioctl_g_ctrl(struct v4l2_int_device *s,
static int ioctl_queryctrl(struct v4l2_int_device *s,
struct v4l2_queryctrl *qc)
{
- debug_dummy("debug_dummy -- query ctrl\n");
- return-EINVAL;
+ debug_dummy("debug_dummy -- query ctrl\n");
+ return -EINVAL;
}
/**
@@ -647,12 +654,11 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p)
return rval;
}
- p->u.ycbcr.clock_curr = 40*1000000; // temporal value
+ p->u.ycbcr.clock_curr = 40 * 1000000; /* temporal value */
return 0;
}
-
static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = {
{ .num = vidioc_int_enum_framesizes_num,
.func = (v4l2_int_ioctl_func *)ioctl_enum_framesizes },
@@ -666,8 +672,8 @@ static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = {
.func = (v4l2_int_ioctl_func *)ioctl_s_power },
{ .num = vidioc_int_g_priv_num,
.func = (v4l2_int_ioctl_func *)ioctl_g_priv },
- {vidioc_int_g_ifparm_num,
- .func = (v4l2_int_ioctl_func*) ioctl_g_ifparm},
+ { .num = vidioc_int_g_ifparm_num,
+ .func = (v4l2_int_ioctl_func *)ioctl_g_ifparm },
{ .num = vidioc_int_init_num,
.func = (v4l2_int_ioctl_func *)ioctl_init },
{ .num = vidioc_int_enum_fmt_cap_num,
@@ -688,29 +694,30 @@ static struct v4l2_int_ioctl_desc mt9t111_ioctl_desc[] = {
.func = (v4l2_int_ioctl_func *)ioctl_g_ctrl },
{ .num = vidioc_int_s_ctrl_num,
.func = (v4l2_int_ioctl_func *)ioctl_s_ctrl },
- {.num = vidioc_int_s_video_routing_num,
- .func = (v4l2_int_ioctl_func *) ioctl_s_routing},
+ { .num = vidioc_int_s_video_routing_num,
+ .func = (v4l2_int_ioctl_func *)ioctl_s_routing },
};
-static void mt9t111_refresh(struct i2c_client *client){
- int i;
- unsigned short value;
- // MCU_ADDRESS [SEQ_CMD] -- refresh
- mt9t111_write_reg(client, 0x098E, 0x8400);
- mt9t111_write_reg(client, 0x0990, 0x0006);
- for (i=0;i<100;i++){
- mt9t111_write_reg(client, 0x098E, 0x8400);
- mt9t111_read_reg(client,0x0990,&value);
- if ( value == 0)
- break;
- mdelay(5);
+static void mt9t111_refresh(struct i2c_client *client)
+{
+ int i;
+ unsigned short value;
+ /* MCU_ADDRESS [SEQ_CMD] -- refresh */
+ mt9t111_write_reg(client, 0x098E, 0x8400);
+ mt9t111_write_reg(client, 0x0990, 0x0006);
+ for (i = 0; i < 100; i++) {
+ mt9t111_write_reg(client, 0x098E, 0x8400);
+ mt9t111_read_reg(client, 0x0990, &value);
+ if (value == 0)
+ break;
+ mdelay(5);
}
}
#ifdef COLOR_BAR
static void mt9t111_color_bar(struct i2c_client *client)
{
- mt9t111_write_reg(client, 0x3210, 0x01B0); // disable lens correction
+ mt9t111_write_reg(client, 0x3210, 0x01B0); /* disable lens correction */
mt9t111_write_reg(client, 0x098E, 0x6003);
mt9t111_write_reg(client, 0x0990, 0x0100);
@@ -721,22 +728,25 @@ static void mt9t111_color_bar(struct i2c_client *client)
static void mt9t111_bayer_format(struct i2c_client *client)
{
- mt9t111_write_regs(client, bayer_pattern_regs, sizeof(bayer_pattern_regs)/sizeof(mt9t111_regs));
+ mt9t111_write_regs(client, bayer_pattern_regs,
+ sizeof(bayer_pattern_regs) / sizeof(mt9t111_regs));
}
static void mt9t111_enable_pll(struct i2c_client *client)
{
int i;
- unsigned short value;
+ unsigned short value;
- mt9t111_write_regs(client, pll_regs1, sizeof(pll_regs1)/sizeof(mt9t111_regs));
- for (i=0;i<100;i++){
- mt9t111_read_reg(client,0x0014,&value);
- if (( value & 0x8000) != 0)
+ mt9t111_write_regs(client, pll_regs1,
+ sizeof(pll_regs1) / sizeof(mt9t111_regs));
+ for (i = 0; i < 100; i++) {
+ mt9t111_read_reg(client, 0x0014, &value);
+ if ((value & 0x8000) != 0)
break;
mdelay(2);
}
- mt9t111_write_regs(client, pll_regs2, sizeof(pll_regs2)/sizeof(mt9t111_regs));
+ mt9t111_write_regs(client, pll_regs2,
+ sizeof(pll_regs2) / sizeof(mt9t111_regs));
}
@@ -746,9 +756,12 @@ static void mt9t111_loaddefault(struct i2c_client *client)
mt9t111_write_reg(client, 0x001A, 0x0218);
mt9t111_enable_pll(client);
- mt9t111_write_regs(client, def_regs1, sizeof(def_regs1)/sizeof(mt9t111_regs));
- mt9t111_write_regs(client, patch_rev6, sizeof(patch_rev6)/sizeof(mt9t111_regs));
- mt9t111_write_regs(client, def_regs2, sizeof(def_regs2)/sizeof(mt9t111_regs));
+ mt9t111_write_regs(client, def_regs1,
+ sizeof(def_regs1) / sizeof(mt9t111_regs));
+ mt9t111_write_regs(client, patch_rev6,
+ sizeof(patch_rev6) / sizeof(mt9t111_regs));
+ mt9t111_write_regs(client, def_regs2,
+ sizeof(def_regs2) / sizeof(mt9t111_regs));
#ifdef USE_RAW
mt9t111_bayer_format(client);
@@ -806,7 +819,7 @@ mt9t111_probe(struct i2c_client *client, const struct i2c_device_id *id)
sensor->pix.width = 640;
sensor->pix.height = 480;
-#ifdef USE_RAW
+#ifdef USE_RAW
sensor->pix.pixelformat = V4L2_PIX_FMT_SGRBG10;
#else
sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV;
diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
index e012eeb..e226c37 100644
--- a/drivers/media/video/mt9t111_reg.h
+++ b/drivers/media/video/mt9t111_reg.h
@@ -25,7 +25,7 @@ typedef struct {
u16 data;
} mt9t111_regs;
-mt9t111_regs patch_rev6[] ={
+mt9t111_regs patch_rev6[] = {
{0, 0x0982, 0x0},
{0, 0x098A, 0xCE7},
{0, 0x0990, 0x3C3C},
@@ -658,7 +658,7 @@ mt9t111_regs patch_rev6[] ={
{100, 0x0990, 0x0004}
};
-mt9t111_regs def_regs1[] ={
+mt9t111_regs def_regs1[] = {
{0, 0x001A, 0x0218},
{0, 0x001E, 0x0777},
{0, 0x3084, 0x2409},
@@ -1343,7 +1343,7 @@ mt9t111_regs pll_regs2[] = {
{0, 0x0014, 0x3046},
{0, 0x0022, 0x01E0},
{0, 0x001E, 0x0707},
- {0, 0x3B84, 0x011D}
+ {0, 0x3B84, 0x011D}
};
mt9t111_regs bayer_pattern_regs[] = {
diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
index 7acbeed..0a5161a 100644
--- a/include/media/mt9t111.h
+++ b/include/media/mt9t111.h
@@ -40,7 +40,7 @@
#define MT9T111_I2C_UNREGISTERED (0)
/*i2c adress for MT9T111*/
-#define MT9T111_I2C_ADDR (0x78 >>1)
+#define MT9T111_I2C_ADDR (0x78 >> 1)
#define MT9T111_CLK_MAX (75000000) /* 75MHz */
#define MT9T111_CLK_MIN (6000000) /* 6Mhz */
--
1.6.6.1
@@ -0,0 +1,40 @@
From e6af1e25ce53f1011fe6a1920cc9877ae51d2e95 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Fri, 11 Jun 2010 16:17:56 -0500
Subject: [PATCH 03/75] mt9t111: Pass v4l2_int_device data
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
drivers/media/video/mt9t111.c | 2 +-
include/media/mt9t111.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c
index 95e1508..6a7b2c0 100644
--- a/drivers/media/video/mt9t111.c
+++ b/drivers/media/video/mt9t111.c
@@ -371,7 +371,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on)
else
debug_dummy("debug_dummy -- enable clock\n");;
- rval = sensor->pdata->power_set(on);
+ rval = sensor->pdata->power_set(s, on);
if (rval < 0) {
dev_err(&c->dev, "Unable to set the power state: " "mt9t111"
" sensor\n");
diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
index 0a5161a..aae3f99 100644
--- a/include/media/mt9t111.h
+++ b/include/media/mt9t111.h
@@ -56,7 +56,7 @@
struct mt9t111_platform_data {
char *master;
- int (*power_set) (enum v4l2_power on);
+ int (*power_set) (struct v4l2_int_device *s, enum v4l2_power on);
int (*ifparm) (struct v4l2_ifparm *p);
int (*priv_data_set) (void *);
/* Interface control params */
--
1.6.6.1
@@ -0,0 +1,352 @@
From e91589e4c2736495be6f1252599d5115b33ac8c8 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Fri, 11 Jun 2010 16:15:58 -0500
Subject: [PATCH 04/75] omap3beagle: Add camera support
This is tested with the xM + Leopard imaging module camera, which
has a MT9T111.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/Makefile | 3 +-
arch/arm/mach-omap2/board-omap3beagle-camera.c | 228 ++++++++++++++++++++++++
arch/arm/mach-omap2/board-omap3beagle-camera.h | 41 +++++
arch/arm/mach-omap2/board-omap3beagle.c | 25 +++
4 files changed, 296 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.c
create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.h
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fa01859..4d9dcdd 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -87,7 +87,8 @@ obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \
mmc-twl4030.o
obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \
- mmc-twl4030.o
+ mmc-twl4030.o \
+ board-omap3beagle-camera.o
obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \
mmc-twl4030.o \
board-ldp-camera.o
diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c
new file mode 100644
index 0000000..e93437f
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
@@ -0,0 +1,228 @@
+/*
+ * Driver for Leopard Module Board used in Beagleboard (xM)
+ *
+ * Copyright (C) 2010 Texas Instruments Inc
+ * Author: Sergio Aguirre <saaguirre@ti.com>
+ *
+ * Based on work done by:
+ * Vaibhav Hiremath <hvaibhav@ti.com>
+ * Anuj Aggarwal <anuj.aggarwal@ti.com>
+ * Sivaraj R <sivaraj@ti.com>
+ *
+ * This package is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/i2c.h>
+#include <linux/gpio.h>
+#include <linux/mm.h>
+#include <linux/videodev2.h>
+#include <linux/i2c/twl.h>
+#include <linux/delay.h>
+
+#include <plat/mux.h>
+#include <plat/board.h>
+
+#include <media/v4l2-int-device.h>
+#include <media/mt9t111.h>
+
+/* Include V4L2 ISP-Camera driver related header file */
+#include <../drivers/media/video/omap34xxcam.h>
+#include <../drivers/media/video/isp/ispreg.h>
+
+#include "mux.h"
+#include "board-omap3beagle-camera.h"
+
+#define MODULE_NAME "omap3beaglelmb"
+
+#define MT9T111_I2C_BUSNUM (2)
+
+#define CAM_USE_XCLKA 1
+
+#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE)
+static struct isp_interface_config mt9t111_if_config = {
+ .ccdc_par_ser = ISP_PARLL,
+ .dataline_shift = 0x0,
+ .hsvs_syncdetect = ISPCTRL_SYNC_DETECT_VSRISE,
+ .strobe = 0x0,
+ .prestrobe = 0x0,
+ .shutter = 0x0,
+ .u.par.par_bridge = 0x1,
+ .u.par.par_clk_pol = 0x0,
+};
+
+static struct v4l2_ifparm mt9t111_ifparm_s = {
+#if 1
+ .if_type = V4L2_IF_TYPE_RAW,
+ .u = {
+ .raw = {
+ .frame_start_on_rising_vs = 1,
+ .bt_sync_correct = 0,
+ .swap = 0,
+ .latch_clk_inv = 0,
+ .nobt_hs_inv = 0, /* active high */
+ .nobt_vs_inv = 0, /* active high */
+ .clock_min = MT9T111_CLK_MIN,
+ .clock_max = MT9T111_CLK_MAX,
+ },
+ },
+#else
+ .if_type = V4L2_IF_TYPE_YCbCr,
+ .u = {
+ .ycbcr = {
+ .frame_start_on_rising_vs = 1,
+ .bt_sync_correct = 0,
+ .swap = 0,
+ .latch_clk_inv = 0,
+ .nobt_hs_inv = 0, /* active high */
+ .nobt_vs_inv = 0, /* active high */
+ .clock_min = MT9T111_CLK_MIN,
+ .clock_max = MT9T111_CLK_MAX,
+ },
+ },
+#endif
+};
+
+/**
+ * @brief mt9t111_ifparm - Returns the mt9t111 interface parameters
+ *
+ * @param p - pointer to v4l2_ifparm structure
+ *
+ * @return result of operation - 0 is success
+ */
+static int mt9t111_ifparm(struct v4l2_ifparm *p)
+{
+ if (p == NULL)
+ return -EINVAL;
+
+ *p = mt9t111_ifparm_s;
+ return 0;
+}
+
+#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+static struct omap34xxcam_hw_config mt9t111_hwc = {
+ .dev_index = 0,
+ .dev_minor = 0,
+ .dev_type = OMAP34XXCAM_SLAVE_SENSOR,
+ .u.sensor.sensor_isp = 1,
+};
+#endif
+
+/**
+ * @brief mt9t111_set_prv_data - Returns mt9t111 omap34xx driver private data
+ *
+ * @param priv - pointer to omap34xxcam_hw_config structure
+ *
+ * @return result of operation - 0 is success
+ */
+static int mt9t111_set_prv_data(void *priv)
+{
+#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+ struct omap34xxcam_hw_config *hwc = priv;
+
+ if (priv == NULL)
+ return -EINVAL;
+
+ hwc->u.sensor = mt9t111_hwc.u.sensor;
+ hwc->dev_index = mt9t111_hwc.dev_index;
+ hwc->dev_minor = mt9t111_hwc.dev_minor;
+ hwc->dev_type = mt9t111_hwc.dev_type;
+ return 0;
+#else
+ return -EINVAL;
+#endif
+}
+
+/**
+ * @brief mt9t111_power_set - Power-on or power-off TVP5146 device
+ *
+ * @param power - enum, Power on/off, resume/standby
+ *
+ * @return result of operation - 0 is success
+ */
+static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power)
+{
+ struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
+
+ switch (power) {
+ case V4L2_POWER_OFF:
+ isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA);
+ break;
+
+ case V4L2_POWER_STANDBY:
+ break;
+
+ case V4L2_POWER_ON:
+ isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA);
+
+#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
+ isp_configure_interface(vdev->cam->isp, &mt9t111_if_config);
+#endif
+ break;
+
+ default:
+ return -ENODEV;
+ break;
+ }
+ return 0;
+}
+
+static struct mt9t111_platform_data mt9t111_pdata = {
+ .master = "omap34xxcam",
+ .power_set = mt9t111_power_set,
+ .priv_data_set = mt9t111_set_prv_data,
+ .ifparm = mt9t111_ifparm,
+ /* Some interface dependent params */
+ .clk_polarity = 0, /* data clocked out on falling edge */
+ .hs_polarity = 1, /* 0 - Active low, 1- Active high */
+ .vs_polarity = 1, /* 0 - Active low, 1- Active high */
+};
+
+static struct i2c_board_info __initdata mt9t111_i2c_board_info = {
+ I2C_BOARD_INFO("mt9t111", MT9T111_I2C_ADDR),
+ .platform_data = &mt9t111_pdata,
+};
+
+#endif /* #ifdef CONFIG_VIDEO_MT9T111 */
+
+/**
+ * @brief omap3beaglelmb_init - module init function. Should be called before any
+ * client driver init call
+ *
+ * @return result of operation - 0 is success
+ */
+int __init omap3beaglelmb_init(void)
+{
+ int err;
+
+ /*
+ * Register the I2C devices present in the board to the I2C
+ * framework.
+ * If more I2C devices are added, then each device information should
+ * be registered with I2C using i2c_register_board_info().
+ */
+#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE)
+ err = i2c_register_board_info(MT9T111_I2C_BUSNUM,
+ &mt9t111_i2c_board_info, 1);
+ if (err) {
+ printk(KERN_ERR MODULE_NAME \
+ ": MT9T111 I2C Board Registration failed \n");
+ return err;
+ }
+#endif
+ printk(KERN_INFO MODULE_NAME ": Driver registration complete \n");
+
+ return 0;
+}
+arch_initcall(omap3beaglelmb_init);
diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.h b/arch/arm/mach-omap2/board-omap3beagle-camera.h
new file mode 100644
index 0000000..1026aeb
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Texas Instruments Inc
+ * Author: Sergio Aguirre <saaguirre@ti.com>
+ *
+ * Based on work done by:
+ * Vaibhav Hiremath <hvaibhav@ti.com>
+ * Anuj Aggarwal <anuj.aggarwal@ti.com>
+ * Sivaraj R <sivaraj@ti.com>
+ *
+ * This package is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __BOARD_OMAP3BEAGLE_LMB_H_
+#define __BOARD_OMAP3BEAGLE_LMB_H_
+
+/* mux id to enable/disable signal routing to different peripherals */
+enum omap3beaglelmb_mux {
+ MUX_TVP5146 = 0,
+ MUX_CAMERA_SENSOR,
+ MUX_EXP_CAMERA_SENSOR,
+ NUM_MUX
+};
+
+/* enum to enable or disable mux */
+enum config_mux {
+ DISABLE_MUX,
+ ENABLE_MUX
+};
+
+#endif /* __BOARD_OMAP3BEAGLE_LMB_H_ */
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 93b9e5f..31de2f9 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -712,6 +712,31 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
+ /* Camera - Parallel Data */
+ OMAP3_MUX(CAM_D0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D8, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D9, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D10, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_D11, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+
+ /* Camera - HS/VS signals */
+ OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+ OMAP3_MUX(CAM_VS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
+
+ /* Camera - Reset GPIO 98 */
+ OMAP3_MUX(CAM_FLD, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
+
+ /* Camera - XCLK */
+ OMAP3_MUX(CAM_XCLKA, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
+
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#else
--
1.6.6.1
@@ -0,0 +1,238 @@
From 0f967d630fb4b3e55f202b91cbabbd631107923d Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Fri, 11 Jun 2010 16:50:39 -0500
Subject: [PATCH 06/75] omap3beagle: camera: Add support for regulators
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-omap3beagle-camera.c | 92 +++++++++++++++++++++---
arch/arm/mach-omap2/board-omap3beagle.c | 53 ++++++++++++++
2 files changed, 135 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c
index e93437f..af8581a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle-camera.c
+++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
@@ -28,8 +28,9 @@
#include <linux/gpio.h>
#include <linux/mm.h>
#include <linux/videodev2.h>
-#include <linux/i2c/twl.h>
+#include <linux/regulator/consumer.h>
#include <linux/delay.h>
+#include <linux/platform_device.h>
#include <plat/mux.h>
#include <plat/board.h>
@@ -50,6 +51,11 @@
#define CAM_USE_XCLKA 1
+static struct regulator *beagle_mt9t111_reg1;
+static struct regulator *beagle_mt9t111_reg2;
+
+static struct device *beaglecam_dev;
+
#if defined(CONFIG_VIDEO_MT9T111) || defined(CONFIG_VIDEO_MT9T111_MODULE)
static struct isp_interface_config mt9t111_if_config = {
.ccdc_par_ser = ISP_PARLL,
@@ -157,10 +163,13 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power)
switch (power) {
case V4L2_POWER_OFF:
+ case V4L2_POWER_STANDBY:
isp_set_xclk(vdev->cam->isp, 0, CAM_USE_XCLKA);
- break;
- case V4L2_POWER_STANDBY:
+ if (regulator_is_enabled(beagle_mt9t111_reg1))
+ regulator_disable(beagle_mt9t111_reg1);
+ if (regulator_is_enabled(beagle_mt9t111_reg2))
+ regulator_disable(beagle_mt9t111_reg2);
break;
case V4L2_POWER_ON:
@@ -169,6 +178,12 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power)
#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
isp_configure_interface(vdev->cam->isp, &mt9t111_if_config);
#endif
+
+ /* turn on analog power */
+ regulator_enable(beagle_mt9t111_reg1);
+ regulator_enable(beagle_mt9t111_reg2);
+ udelay(100);
+
break;
default:
@@ -196,16 +211,22 @@ static struct i2c_board_info __initdata mt9t111_i2c_board_info = {
#endif /* #ifdef CONFIG_VIDEO_MT9T111 */
-/**
- * @brief omap3beaglelmb_init - module init function. Should be called before any
- * client driver init call
- *
- * @return result of operation - 0 is success
- */
-int __init omap3beaglelmb_init(void)
+
+static int beagle_cam_probe(struct platform_device *pdev)
{
int err;
+ beagle_mt9t111_reg1 = regulator_get(beaglecam_dev, "vaux3_1");
+ if (IS_ERR(beagle_mt9t111_reg1)) {
+ dev_err(beaglecam_dev, "vaux3_1 regulator missing\n");
+ return PTR_ERR(beagle_mt9t111_reg1);
+ }
+ beagle_mt9t111_reg2 = regulator_get(beaglecam_dev, "vaux4_1");
+ if (IS_ERR(beagle_mt9t111_reg2)) {
+ dev_err(beaglecam_dev, "vaux4_1 regulator missing\n");
+ regulator_put(beagle_mt9t111_reg1);
+ return PTR_ERR(beagle_mt9t111_reg2);
+ }
/*
* Register the I2C devices present in the board to the I2C
* framework.
@@ -221,8 +242,59 @@ int __init omap3beaglelmb_init(void)
return err;
}
#endif
+
+ beaglecam_dev = &pdev->dev;
+
printk(KERN_INFO MODULE_NAME ": Driver registration complete \n");
return 0;
}
+
+static int beagle_cam_remove(struct platform_device *pdev)
+{
+ if (regulator_is_enabled(beagle_mt9t111_reg1))
+ regulator_disable(beagle_mt9t111_reg1);
+ regulator_put(beagle_mt9t111_reg1);
+ if (regulator_is_enabled(beagle_mt9t111_reg2))
+ regulator_disable(beagle_mt9t111_reg2);
+ regulator_put(beagle_mt9t111_reg2);
+
+ return 0;
+}
+
+static int beagle_cam_suspend(struct device *dev)
+{
+ return 0;
+}
+
+static int beagle_cam_resume(struct device *dev)
+{
+ return 0;
+}
+
+static struct dev_pm_ops beagle_cam_pm_ops = {
+ .suspend = beagle_cam_suspend,
+ .resume = beagle_cam_resume,
+};
+
+static struct platform_driver beagle_cam_driver = {
+ .probe = beagle_cam_probe,
+ .remove = beagle_cam_remove,
+ .driver = {
+ .name = "beagle_cam",
+ .pm = &beagle_cam_pm_ops,
+ },
+};
+
+/**
+ * @brief omap3beaglelmb_init - module init function. Should be called before any
+ * client driver init call
+ *
+ * @return result of operation - 0 is success
+ */
+int __init omap3beaglelmb_init(void)
+{
+ platform_driver_register(&beagle_cam_driver);
+ return 0;
+}
arch_initcall(omap3beaglelmb_init);
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 31de2f9..448ab23 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -403,6 +403,56 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
.setup = beagle_twl_gpio_setup,
};
+
+static struct platform_device beagle_cam_device = {
+ .name = "beagle_cam",
+ .id = -1,
+};
+
+static struct regulator_consumer_supply beagle_vaux3_supplies[] = {
+ {
+ .supply = "vaux3_1",
+ .dev = &beagle_cam_device.dev,
+ },
+};
+
+static struct regulator_consumer_supply beagle_vaux4_supplies[] = {
+ {
+ .supply = "vaux4_1",
+ .dev = &beagle_cam_device.dev,
+ },
+};
+
+/* VAUX3 for CAM_1V8 */
+static struct regulator_init_data beagle_vaux3 = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(beagle_vaux3_supplies),
+ .consumer_supplies = beagle_vaux3_supplies,
+};
+
+/* VAUX4 for CAM_2V8 */
+static struct regulator_init_data beagle_vaux4 = {
+ .constraints = {
+ .min_uV = 2800000,
+ .max_uV = 2800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(beagle_vaux4_supplies),
+ .consumer_supplies = beagle_vaux4_supplies,
+};
+
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -492,6 +542,8 @@ static struct twl4030_platform_data beagle_twldata = {
.vsim = &beagle_vsim,
.vdac = &beagle_vdac,
.vpll2 = &beagle_vpll2,
+ .vaux3 = &beagle_vaux3,
+ .vaux4 = &beagle_vaux4,
};
static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
@@ -658,6 +710,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
&leds_gpio,
&keys_gpio,
&beagle_dss_device,
+ &beagle_cam_device,
};
static void __init omap3beagle_flash_init(void)
--
1.6.6.1
@@ -0,0 +1,37 @@
From 4b111d4e4f4050db9fcca746f9b8a893d3d60f98 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Fri, 11 Jun 2010 16:52:25 -0500
Subject: [PATCH 07/75] TEMP: omap3beagle: cam: Enable OMAP_MUX
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/configs/omap3_beagle_cam_defconfig | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/configs/omap3_beagle_cam_defconfig b/arch/arm/configs/omap3_beagle_cam_defconfig
index 0ea8300..bcd9418 100644
--- a/arch/arm/configs/omap3_beagle_cam_defconfig
+++ b/arch/arm/configs/omap3_beagle_cam_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32
-# Fri Jun 11 14:25:23 2010
+# Fri Jun 11 16:51:42 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -240,7 +240,9 @@ CONFIG_ARCH_OMAP3=y
CONFIG_OMAP_SMARTREFLEX=y
# CONFIG_OMAP_SMARTREFLEX_TESTING is not set
CONFIG_OMAP_RESET_CLOCKS=y
-# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MUX=y
+# CONFIG_OMAP_MUX_DEBUG is not set
+CONFIG_OMAP_MUX_WARNINGS=y
CONFIG_OMAP_MCBSP=y
CONFIG_OMAP_MBOX_FWK=m
CONFIG_OMAP_IOMMU=y
--
1.6.6.1

Some files were not shown because too many files have changed in this diff Show More