From 4e18d702479ac6f835f3493d8aa81b8d323e1827 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 1 May 2012 21:06:48 +0200 Subject: linux-mainline 3.2: kernel recipe based on mainline 3.2.16 with additional patches for e.g. beagleboard on top This patchset is managed in https://github.com/beagleboard/kernel/tree/beagleboard-3.2 by Robert Nelson and myself. Tested on beagleboard-xM/Angstrom Signed-off-by: Koen Kooi Signed-off-by: Denys Dmytriyenko --- ...-add-buddy-param-for-expansionboard-names.patch | 59 +++++ ...xpansion-add-mmc-regulator-and-ds1307-rtc.patch | 57 +++++ .../beagle/0003-expansion-add-zippy.patch | 82 +++++++ .../beagle/0004-expansion-add-zippy2.patch | 82 +++++++ .../beagle/0005-expansion-add-trainer.patch | 55 +++++ .../beagle/0006-expansion-add-ulcd.patch | 262 +++++++++++++++++++++ ...d-reinstate-usage-of-hi-speed-PLL-divider.patch | 29 +++ ...the-USB-regulator-on-Beagle-xM-explicitly.patch | 55 +++++ ...b-add-Toshiba-LTA070B220F-800x480-support.patch | 30 +++ .../0010-beagleboard-fix-uLCD7-support.patch | 66 ++++++ ...fault-to-fifo-mode-5-for-old-musb-beagles.patch | 29 +++ ...ght-Add-TLC59108-backlight-control-driver.patch | 215 +++++++++++++++++ ...013-tlc59108-adjust-for-beagleboard-uLCD7.patch | 124 ++++++++++ 13 files changed, 1145 insertions(+) create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0001-expansion-add-buddy-param-for-expansionboard-names.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0002-expansion-add-mmc-regulator-and-ds1307-rtc.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0003-expansion-add-zippy.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0004-expansion-add-zippy2.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0005-expansion-add-trainer.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0006-expansion-add-ulcd.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0007-beagleboard-reinstate-usage-of-hi-speed-PLL-divider.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0008-Turn-on-the-USB-regulator-on-Beagle-xM-explicitly.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0009-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0010-beagleboard-fix-uLCD7-support.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0011-default-to-fifo-mode-5-for-old-musb-beagles.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0012-backlight-Add-TLC59108-backlight-control-driver.patch create mode 100644 recipes-kernel/linux/linux-mainline-3.2/beagle/0013-tlc59108-adjust-for-beagleboard-uLCD7.patch (limited to 'recipes-kernel/linux/linux-mainline-3.2/beagle') diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0001-expansion-add-buddy-param-for-expansionboard-names.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0001-expansion-add-buddy-param-for-expansionboard-names.patch new file mode 100644 index 00000000..31f079be --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0001-expansion-add-buddy-param-for-expansionboard-names.patch @@ -0,0 +1,59 @@ +From 0e4ed624d99a4bcc57d6243867a00472b141b3f8 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 10 Oct 2011 11:12:40 -0500 +Subject: [PATCH 01/13] expansion: add buddy param for expansionboard names + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 4a71cb7..6f8cf47 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -156,6 +157,8 @@ static void __init omap3_beagle_init_rev(void) + } + } + ++char expansionboard_name[16]; ++ + static struct mtd_partition omap3beagle_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -474,6 +477,15 @@ static struct omap_board_mux board_mux[] __initdata = { + }; + #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 beagle_opp_init(void) + { + int r = 0; +@@ -552,6 +564,8 @@ static void __init omap3_beagle_init(void) + beagle_opp_init(); + } + ++early_param("buddy", expansionboard_setup); ++ + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ + .atag_offset = 0x100, +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0002-expansion-add-mmc-regulator-and-ds1307-rtc.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0002-expansion-add-mmc-regulator-and-ds1307-rtc.patch new file mode 100644 index 00000000..27cc46c8 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0002-expansion-add-mmc-regulator-and-ds1307-rtc.patch @@ -0,0 +1,57 @@ +From 97ce508ccf66c32b24087f8e0243222b51bc0c09 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 10 Oct 2011 11:13:49 -0500 +Subject: [PATCH 02/13] expansion: add mmc regulator and ds1307 rtc + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 6f8cf47..9f5706b 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -257,6 +257,12 @@ static struct omap2_hsmmc_info mmc[] = { + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, + .gpio_wp = -EINVAL, + }, ++ { ++ .mmc = 2, ++ .caps = MMC_CAP_4_BIT_DATA, ++ .transceiver = true, ++ .ocr_mask = 0x00100000, /* 3.3V */ ++ }, + {} /* Terminator */ + }; + +@@ -378,6 +384,18 @@ 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) + { + omap3_pmic_get_config(&beagle_twldata, +@@ -388,6 +406,7 @@ static int __init omap3_beagle_i2c_init(void) + beagle_twldata.vpll2->constraints.name = "VDVI"; + + omap3_pmic_init("twl4030", &beagle_twldata); ++ 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)); +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0003-expansion-add-zippy.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0003-expansion-add-zippy.patch new file mode 100644 index 00000000..8da7c556 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0003-expansion-add-zippy.patch @@ -0,0 +1,82 @@ +From 7548790462d7cea9d92688b488026569187b1044 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 10 Oct 2011 11:16:12 -0500 +Subject: [PATCH 03/13] expansion: add zippy + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++ + 1 files changed, 51 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 9f5706b..6ffafd6 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -159,6 +159,48 @@ static void __init omap3_beagle_init_rev(void) + + char expansionboard_name[16]; + ++#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) ++ ++#include ++#include ++ ++#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); ++ 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 ++ + static struct mtd_partition omap3beagle_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -567,6 +609,15 @@ static void __init omap3_beagle_init(void) + /* REVISIT leave DVI powered down until it's needed ... */ + gpio_request_one(170, GPIOF_OUT_INIT_HIGH, "DVI_nPD"); + ++ 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; ++ } ++ + usb_musb_init(NULL); + usbhs_init(&usbhs_bdata); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0004-expansion-add-zippy2.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0004-expansion-add-zippy2.patch new file mode 100644 index 00000000..c2d0dde9 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0004-expansion-add-zippy2.patch @@ -0,0 +1,82 @@ +From 27a4c659c1c665b877c032d3409b0c593cd0463b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 10 Oct 2011 11:18:08 -0500 +Subject: [PATCH 04/13] expansion: add zippy2 + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++ + 1 files changed, 51 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 6ffafd6..259e6e7 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -201,6 +201,48 @@ static void __init omap3beagle_enc28j60_init(void) + static inline void __init omap3beagle_enc28j60_init(void) { return; } + #endif + ++#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) ++ ++#include ++#include ++ ++#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); ++ 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 */ + { +@@ -618,6 +660,15 @@ static void __init omap3_beagle_init(void) + 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(NULL); + usbhs_init(&usbhs_bdata); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0005-expansion-add-trainer.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0005-expansion-add-trainer.patch new file mode 100644 index 00000000..b57bf743 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0005-expansion-add-trainer.patch @@ -0,0 +1,55 @@ +From 0dc814729657ab525ed8ac2e1a96e4f3dc706bb3 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 10 Oct 2011 11:18:49 -0500 +Subject: [PATCH 05/13] expansion: add trainer + +Signed-off-by: Robert Nelson +--- + 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 259e6e7..b0b16b4 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -669,6 +669,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(NULL); + usbhs_init(&usbhs_bdata); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0006-expansion-add-ulcd.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0006-expansion-add-ulcd.patch new file mode 100644 index 00000000..cf56d9cb --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0006-expansion-add-ulcd.patch @@ -0,0 +1,262 @@ +From 3c92dddf8709162e8ee3a6bdacb83a3e85f70fb1 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Fri, 16 Mar 2012 09:47:57 -0500 +Subject: [PATCH 06/13] expansion: add ulcd + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 122 ++++++++++++++++++++++ + drivers/video/omap2/displays/panel-generic-dpi.c | 25 +++++ + 2 files changed, 147 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index b0b16b4..a546c2b 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -33,6 +33,7 @@ + + #include + #include ++#include + + #include + #include +@@ -84,11 +85,15 @@ static struct { + int usb_pwr_level; + int reset_gpio; + int usr_button_gpio; ++ char *lcd_driver_name; ++ int lcd_pwren; + } beagle_config = { + .mmc1_gpio_wp = -EINVAL, + .usb_pwr_level = GPIOF_OUT_INIT_LOW, + .reset_gpio = 129, + .usr_button_gpio = 4, ++ .lcd_driver_name = "", ++ .lcd_pwren = 156 + }; + + static struct gpio omap3_beagle_rev_gpios[] __initdata = { +@@ -158,6 +163,7 @@ static void __init omap3_beagle_init_rev(void) + } + + char expansionboard_name[16]; ++char expansionboard2_name[16]; + + #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) + +@@ -312,9 +318,46 @@ static struct omap_dss_device beagle_tv_device = { + .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, + }; + ++static int beagle_enable_lcd(struct omap_dss_device *dssdev) ++{ ++ if (gpio_is_valid(beagle_config.lcd_pwren)) { ++ printk(KERN_INFO "%s: Enabling LCD\n", __FUNCTION__); ++ gpio_set_value(beagle_config.lcd_pwren, 0); ++ } else { ++ printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", ++ __FUNCTION__, beagle_config.lcd_pwren); ++ } ++ ++ return 0; ++} ++ ++static void beagle_disable_lcd(struct omap_dss_device *dssdev) ++{ ++ if (gpio_is_valid(beagle_config.lcd_pwren)) { ++ printk(KERN_INFO "%s: Disabling LCD\n", __FUNCTION__); ++ gpio_set_value(beagle_config.lcd_pwren, 1); ++ } else { ++ printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", ++ __FUNCTION__, beagle_config.lcd_pwren); ++ } ++ ++ return; ++} ++ ++static struct omap_dss_device beagle_lcd_device = { ++ .type = OMAP_DISPLAY_TYPE_DPI, ++ .name = "lcd", ++ .driver_name = "tfc_s9700rtwv35tr-01b", ++ .phy.dpi.data_lines = 24, ++ .platform_enable = beagle_enable_lcd, ++ .platform_disable = beagle_disable_lcd, ++ .reset_gpio = -EINVAL, ++}; ++ + static struct omap_dss_device *beagle_dss_devices[] = { + &beagle_dvi_device, + &beagle_tv_device, ++ &beagle_lcd_device, + }; + + static struct omap_dss_board_info beagle_dss_data = { +@@ -331,6 +374,11 @@ static void __init beagle_display_init(void) + "DVI reset"); + if (r < 0) + printk(KERN_ERR "Unable to get DVI reset GPIO\n"); ++ ++ r = gpio_request_one(beagle_config.lcd_pwren, GPIOF_OUT_INIT_LOW, ++ "LCD power"); ++ if (r < 0) ++ printk(KERN_ERR "Unable to get LCD power enable GPIO\n"); + } + + #include "sdram-micron-mt46h32m32lf-6.h" +@@ -480,6 +528,50 @@ static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { + static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; + #endif + ++#if defined(CONFIG_INPUT_TOUCHSCREEN) && \ ++ ( defined(CONFIG_TOUCHSCREEN_TSC2007) || defined(CONFIG_TOUCHSCREEN_TSC2007_MODULE)) ++/* Touchscreen */ ++#define OMAP3BEAGLE_TSC2007_GPIO 157 ++static int omap3beagle_tsc2007_get_pendown_state(void) ++{ ++ return !gpio_get_value(OMAP3BEAGLE_TSC2007_GPIO); ++} ++ ++static void __init omap3beagle_tsc2007_init(void) ++{ ++ int r; ++ ++ omap_mux_init_gpio(OMAP3BEAGLE_TSC2007_GPIO, OMAP_PIN_INPUT_PULLUP); ++ ++ r = gpio_request_one(OMAP3BEAGLE_TSC2007_GPIO, GPIOF_IN, "tsc2007_pen_down"); ++ if (r < 0) { ++ printk(KERN_ERR "failed to request GPIO#%d for " ++ "tsc2007 pen down IRQ\n", OMAP3BEAGLE_TSC2007_GPIO); ++ return; ++ } ++ ++ irq_set_irq_type(gpio_to_irq(OMAP3BEAGLE_TSC2007_GPIO), IRQ_TYPE_EDGE_FALLING); ++} ++ ++static struct tsc2007_platform_data tsc2007_info = { ++ .model = 2007, ++ .x_plate_ohms = 180, ++ .get_pendown_state = omap3beagle_tsc2007_get_pendown_state, ++}; ++ ++static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = { ++ { ++ I2C_BOARD_INFO("tlc59108", 0x40), ++ I2C_BOARD_INFO("tsc2007", 0x48), ++ .irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO), ++ .platform_data = &tsc2007_info, ++ }, ++}; ++#else ++static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {}; ++static void __init omap3beagle_tsc2007_init(void) { return; } ++#endif ++ + static int __init omap3_beagle_i2c_init(void) + { + omap3_pmic_get_config(&beagle_twldata, +@@ -490,7 +582,17 @@ static int __init omap3_beagle_i2c_init(void) + beagle_twldata.vpll2->constraints.name = "VDVI"; + + omap3_pmic_init("twl4030", &beagle_twldata); ++ if(!strcmp(expansionboard2_name, "bbtoys-ulcd")) ++ { ++ printk(KERN_INFO "Beagle second expansionboard: registering bbtoys-ulcd i2c bus\n"); ++ omap_register_i2c_bus(2, 400, beagle_i2c2_bbtoys_ulcd, ++ ARRAY_SIZE(beagle_i2c2_bbtoys_ulcd)); ++ } ++ 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, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); +@@ -589,6 +691,15 @@ static int __init expansionboard_setup(char *str) + return 0; + } + ++static int __init expansionboard2_setup(char *str) ++{ ++ if (!str) ++ return -EINVAL; ++ strncpy(expansionboard2_name, str, 16); ++ printk(KERN_INFO "Beagle second expansionboard: %s\n", expansionboard2_name); ++ return 0; ++} ++ + static void __init beagle_opp_init(void) + { + int r = 0; +@@ -640,6 +751,10 @@ static void __init omap3_beagle_init(void) + + gpio_buttons[0].gpio = beagle_config.usr_button_gpio; + ++ /* TODO: set lcd_driver_name by command line or device tree */ ++ beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b", ++ //lcd_panel.name = beagle_config.lcd_driver_name; ++ + platform_add_devices(omap3_beagle_devices, + ARRAY_SIZE(omap3_beagle_devices)); + omap_display_init(&beagle_dss_data); +@@ -700,6 +815,12 @@ static void __init omap3_beagle_init(void) + gpio_export(162, 1); + } + ++ if(!strcmp(expansionboard2_name, "bbtoys-ulcd")) ++ { ++ printk(KERN_INFO "Beagle second expansionboard: initializing touchscreen: tsc2007\n"); ++ omap3beagle_tsc2007_init(); ++ } ++ + usb_musb_init(NULL); + usbhs_init(&usbhs_bdata); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, +@@ -717,6 +838,7 @@ static void __init omap3_beagle_init(void) + } + + early_param("buddy", expansionboard_setup); ++early_param("buddy2", expansionboard2_setup); + + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ +diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c +index 519c47d..495d693 100644 +--- a/drivers/video/omap2/displays/panel-generic-dpi.c ++++ b/drivers/video/omap2/displays/panel-generic-dpi.c +@@ -297,6 +297,31 @@ static struct panel_config generic_dpi_panels[] = { + + .name = "apollon", + }, ++ ++ /* ThreeFiveCorp S9700RTWV35TR-01B */ ++ { ++ { ++ .x_res = 800, ++ .y_res = 480, ++ ++ .pixel_clock = 30000, ++ ++ .hsw = 49, ++ .hfp = 41, ++ .hbp = 40, ++ ++ .vsw = 4, ++ .vfp = 14, ++ .vbp = 29, ++ }, ++ .acbi = 0x0, ++ .acb = 0x0, ++ .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | ++ OMAP_DSS_LCD_IHS, // | OMAP_DSS_LCD_IEO; - TODO check this - doesn't work with this enabled ++ .power_on_delay = 50, ++ .power_off_delay = 100, ++ .name = "tfc_s9700rtwv35tr-01b", ++ }, + }; + + struct panel_drv_data { +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0007-beagleboard-reinstate-usage-of-hi-speed-PLL-divider.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0007-beagleboard-reinstate-usage-of-hi-speed-PLL-divider.patch new file mode 100644 index 00000000..b8b75892 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0007-beagleboard-reinstate-usage-of-hi-speed-PLL-divider.patch @@ -0,0 +1,29 @@ +From 460ac29a1ee0577d6b9044caa53761cc0d02b495 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Wed, 25 Jan 2012 15:48:36 +0100 +Subject: [PATCH 07/13] beagleboard: reinstate usage of hi-speed PLL divider + +Signed-off-by: Koen Kooi +--- + 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 a546c2b..e28ae72 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -308,6 +308,11 @@ static struct omap_dss_device beagle_dvi_device = { + .driver_name = "dvi", + .data = &dvi_panel, + .phy.dpi.data_lines = 24, ++ .clocks = { ++ .dispc = { ++ .dispc_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, ++ }, ++ }, + .reset_gpio = -EINVAL, + }; + +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0008-Turn-on-the-USB-regulator-on-Beagle-xM-explicitly.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0008-Turn-on-the-USB-regulator-on-Beagle-xM-explicitly.patch new file mode 100644 index 00000000..1aec9520 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0008-Turn-on-the-USB-regulator-on-Beagle-xM-explicitly.patch @@ -0,0 +1,55 @@ +From 3d9465ffd5becb88c1ba36b98f8375898605f529 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Thu, 23 Feb 2012 09:23:10 -0600 +Subject: [PATCH 08/13] Turn on the USB regulator on Beagle xM explicitly + + Turn on the USB regulator on Beagle xM explicitly when the USB + subsystem asks for it, rather than relying on u-boot to do it. + + http://www.spinics.net/lists/linux-omap/msg65102.html + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++ + 1 files changed, 19 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index e28ae72..30cb2f0 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -411,6 +411,24 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = { + REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + ++static struct regulator_consumer_supply beagle_usb_supply[] = { ++ REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"), ++ REGULATOR_SUPPLY("hsusb1", "ehci-omap.0") ++}; ++ ++static struct regulator_init_data usb_power = { ++ .constraints = { ++ .min_uV = 1800000, ++ .max_uV = 1800000, ++ .valid_modes_mask = REGULATOR_MODE_NORMAL, ++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE ++ | REGULATOR_CHANGE_MODE ++ | REGULATOR_CHANGE_STATUS, ++ }, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_usb_supply), ++ .consumer_supplies = beagle_usb_supply ++}; ++ + static struct gpio_led gpio_leds[]; + + static int beagle_twl_gpio_setup(struct device *dev, +@@ -513,6 +531,7 @@ static struct twl4030_platform_data beagle_twldata = { + .gpio = &beagle_gpio_data, + .vmmc1 = &beagle_vmmc1, + .vsim = &beagle_vsim, ++ .vaux2 = &usb_power, + }; + + static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0009-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0009-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch new file mode 100644 index 00000000..79a25abb --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0009-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch @@ -0,0 +1,30 @@ +From 1a553663864b5b69dcdfd7779640a1c0ce136a93 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 23 Mar 2011 08:37:54 -0500 +Subject: [PATCH 09/13] meego: modedb add Toshiba LTA070B220F 800x480 support + + from http://wiki.meego.com/ARM/Meego_on_Beagleboard_from_scratch + +Signed-off-by: Robert Nelson +--- + 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 5b686de..69ad1ec 100644 +--- a/drivers/video/modedb.c ++++ b/drivers/video/modedb.c +@@ -293,6 +293,10 @@ static const struct fb_videomode modedb[] = { + /* 864x480 @ 60 Hz, 35.15 kHz hsync */ + { NULL, 60, 864, 480, 27777, 1, 1, 1, 1, 0, 0, + 0, FB_VMODE_NONINTERLACED }, ++ ++ /* 800x480 @ 60 Hz, Toshiba LTA070B220F 7 inch LCD */ ++ { NULL, 60, 800, 480, 32787, 48, 80, 33, 31, 32, 2, ++ FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED }, + }; + + #ifdef CONFIG_FB_MODE_HELPERS +-- +1.7.7.4 + diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0010-beagleboard-fix-uLCD7-support.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0010-beagleboard-fix-uLCD7-support.patch new file mode 100644 index 00000000..9837ee99 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0010-beagleboard-fix-uLCD7-support.patch @@ -0,0 +1,66 @@ +From 6a386a61fc5cd9c71f8c5dc577e70b4c0f892130 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Fri, 27 Apr 2012 16:57:27 +0200 +Subject: [PATCH 10/13] beagleboard: fix uLCD7 support + +Signed-off-by: Koen Kooi +--- + arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++-- + 1 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 30cb2f0..0299d47 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -44,6 +44,7 @@ + #include + #include + #include