diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-05-01 21:06:48 +0200 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-05-03 19:09:07 -0400 |
commit | 4e18d702479ac6f835f3493d8aa81b8d323e1827 (patch) | |
tree | 11ba92d9c5a5bb84c74ee3f10b8eecaaa0510fb9 /recipes-kernel/linux/linux-mainline-3.2/beagle | |
parent | aff1018e66b477544af17501757405283c21bef1 (diff) | |
download | meta-ti-4e18d702479ac6f835f3493d8aa81b8d323e1827.tar.gz |
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 <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-mainline-3.2/beagle')
13 files changed, 1145 insertions, 0 deletions
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 @@ | |||
1 | From 0e4ed624d99a4bcc57d6243867a00472b141b3f8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Mon, 10 Oct 2011 11:12:40 -0500 | ||
4 | Subject: [PATCH 01/13] expansion: add buddy param for expansionboard names | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++++ | ||
9 | 1 files changed, 14 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 4a71cb7..6f8cf47 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -21,6 +21,7 @@ | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/leds.h> | ||
18 | #include <linux/gpio.h> | ||
19 | +#include <linux/irq.h> | ||
20 | #include <linux/input.h> | ||
21 | #include <linux/gpio_keys.h> | ||
22 | #include <linux/opp.h> | ||
23 | @@ -156,6 +157,8 @@ static void __init omap3_beagle_init_rev(void) | ||
24 | } | ||
25 | } | ||
26 | |||
27 | +char expansionboard_name[16]; | ||
28 | + | ||
29 | static struct mtd_partition omap3beagle_nand_partitions[] = { | ||
30 | /* All the partition sizes are listed in terms of NAND block size */ | ||
31 | { | ||
32 | @@ -474,6 +477,15 @@ static struct omap_board_mux board_mux[] __initdata = { | ||
33 | }; | ||
34 | #endif | ||
35 | |||
36 | +static int __init expansionboard_setup(char *str) | ||
37 | +{ | ||
38 | + if (!str) | ||
39 | + return -EINVAL; | ||
40 | + strncpy(expansionboard_name, str, 16); | ||
41 | + printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name); | ||
42 | + return 0; | ||
43 | +} | ||
44 | + | ||
45 | static void __init beagle_opp_init(void) | ||
46 | { | ||
47 | int r = 0; | ||
48 | @@ -552,6 +564,8 @@ static void __init omap3_beagle_init(void) | ||
49 | beagle_opp_init(); | ||
50 | } | ||
51 | |||
52 | +early_param("buddy", expansionboard_setup); | ||
53 | + | ||
54 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | ||
55 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ | ||
56 | .atag_offset = 0x100, | ||
57 | -- | ||
58 | 1.7.7.4 | ||
59 | |||
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 @@ | |||
1 | From 97ce508ccf66c32b24087f8e0243222b51bc0c09 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Mon, 10 Oct 2011 11:13:49 -0500 | ||
4 | Subject: [PATCH 02/13] expansion: add mmc regulator and ds1307 rtc | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++ | ||
9 | 1 files changed, 19 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 6f8cf47..9f5706b 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -257,6 +257,12 @@ static struct omap2_hsmmc_info mmc[] = { | ||
16 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
17 | .gpio_wp = -EINVAL, | ||
18 | }, | ||
19 | + { | ||
20 | + .mmc = 2, | ||
21 | + .caps = MMC_CAP_4_BIT_DATA, | ||
22 | + .transceiver = true, | ||
23 | + .ocr_mask = 0x00100000, /* 3.3V */ | ||
24 | + }, | ||
25 | {} /* Terminator */ | ||
26 | }; | ||
27 | |||
28 | @@ -378,6 +384,18 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { | ||
29 | }, | ||
30 | }; | ||
31 | |||
32 | +#if defined(CONFIG_RTC_DRV_DS1307) || \ | ||
33 | + defined(CONFIG_RTC_DRV_DS1307_MODULE) | ||
34 | + | ||
35 | +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { | ||
36 | + { | ||
37 | + I2C_BOARD_INFO("ds1307", 0x68), | ||
38 | + }, | ||
39 | +}; | ||
40 | +#else | ||
41 | +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; | ||
42 | +#endif | ||
43 | + | ||
44 | static int __init omap3_beagle_i2c_init(void) | ||
45 | { | ||
46 | omap3_pmic_get_config(&beagle_twldata, | ||
47 | @@ -388,6 +406,7 @@ static int __init omap3_beagle_i2c_init(void) | ||
48 | beagle_twldata.vpll2->constraints.name = "VDVI"; | ||
49 | |||
50 | omap3_pmic_init("twl4030", &beagle_twldata); | ||
51 | + omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ARRAY_SIZE(beagle_i2c2_boardinfo)); | ||
52 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | ||
53 | * projector don't work reliably with 400kHz */ | ||
54 | omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); | ||
55 | -- | ||
56 | 1.7.7.4 | ||
57 | |||
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 @@ | |||
1 | From 7548790462d7cea9d92688b488026569187b1044 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Mon, 10 Oct 2011 11:16:12 -0500 | ||
4 | Subject: [PATCH 03/13] expansion: add zippy | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++ | ||
9 | 1 files changed, 51 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 9f5706b..6ffafd6 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -159,6 +159,48 @@ static void __init omap3_beagle_init_rev(void) | ||
16 | |||
17 | char expansionboard_name[16]; | ||
18 | |||
19 | +#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) | ||
20 | + | ||
21 | +#include <plat/mcspi.h> | ||
22 | +#include <linux/spi/spi.h> | ||
23 | + | ||
24 | +#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 | ||
25 | + | ||
26 | +static struct omap2_mcspi_device_config enc28j60_spi_chip_info = { | ||
27 | + .turbo_mode = 0, | ||
28 | + .single_channel = 1, /* 0: slave, 1: master */ | ||
29 | +}; | ||
30 | + | ||
31 | +static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = { | ||
32 | + { | ||
33 | + .modalias = "enc28j60", | ||
34 | + .bus_num = 4, | ||
35 | + .chip_select = 0, | ||
36 | + .max_speed_hz = 20000000, | ||
37 | + .controller_data = &enc28j60_spi_chip_info, | ||
38 | + }, | ||
39 | +}; | ||
40 | + | ||
41 | +static void __init omap3beagle_enc28j60_init(void) | ||
42 | +{ | ||
43 | + if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) && | ||
44 | + (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) { | ||
45 | + gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); | ||
46 | + omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ); | ||
47 | + irq_set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); | ||
48 | + } else { | ||
49 | + printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n"); | ||
50 | + return; | ||
51 | + } | ||
52 | + | ||
53 | + spi_register_board_info(omap3beagle_zippy_spi_board_info, | ||
54 | + ARRAY_SIZE(omap3beagle_zippy_spi_board_info)); | ||
55 | +} | ||
56 | + | ||
57 | +#else | ||
58 | +static inline void __init omap3beagle_enc28j60_init(void) { return; } | ||
59 | +#endif | ||
60 | + | ||
61 | static struct mtd_partition omap3beagle_nand_partitions[] = { | ||
62 | /* All the partition sizes are listed in terms of NAND block size */ | ||
63 | { | ||
64 | @@ -567,6 +609,15 @@ static void __init omap3_beagle_init(void) | ||
65 | /* REVISIT leave DVI powered down until it's needed ... */ | ||
66 | gpio_request_one(170, GPIOF_OUT_INIT_HIGH, "DVI_nPD"); | ||
67 | |||
68 | + if(!strcmp(expansionboard_name, "zippy")) | ||
69 | + { | ||
70 | + printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n"); | ||
71 | + omap3beagle_enc28j60_init(); | ||
72 | + printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); | ||
73 | + mmc[1].gpio_wp = 141; | ||
74 | + mmc[1].gpio_cd = 162; | ||
75 | + } | ||
76 | + | ||
77 | usb_musb_init(NULL); | ||
78 | usbhs_init(&usbhs_bdata); | ||
79 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, | ||
80 | -- | ||
81 | 1.7.7.4 | ||
82 | |||
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 @@ | |||
1 | From 27a4c659c1c665b877c032d3409b0c593cd0463b Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Mon, 10 Oct 2011 11:18:08 -0500 | ||
4 | Subject: [PATCH 04/13] expansion: add zippy2 | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 51 +++++++++++++++++++++++++++++++ | ||
9 | 1 files changed, 51 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 6ffafd6..259e6e7 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -201,6 +201,48 @@ static void __init omap3beagle_enc28j60_init(void) | ||
16 | static inline void __init omap3beagle_enc28j60_init(void) { return; } | ||
17 | #endif | ||
18 | |||
19 | +#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) | ||
20 | + | ||
21 | +#include <plat/mcspi.h> | ||
22 | +#include <linux/spi/spi.h> | ||
23 | + | ||
24 | +#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157 | ||
25 | + | ||
26 | +static struct omap2_mcspi_device_config ks8851_spi_chip_info = { | ||
27 | + .turbo_mode = 0, | ||
28 | + .single_channel = 1, /* 0: slave, 1: master */ | ||
29 | +}; | ||
30 | + | ||
31 | +static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = { | ||
32 | + { | ||
33 | + .modalias = "ks8851", | ||
34 | + .bus_num = 4, | ||
35 | + .chip_select = 0, | ||
36 | + .max_speed_hz = 36000000, | ||
37 | + .controller_data = &ks8851_spi_chip_info, | ||
38 | + }, | ||
39 | +}; | ||
40 | + | ||
41 | +static void __init omap3beagle_ks8851_init(void) | ||
42 | +{ | ||
43 | + if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) && | ||
44 | + (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) { | ||
45 | + gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0); | ||
46 | + omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ); | ||
47 | + irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); | ||
48 | + } else { | ||
49 | + printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n"); | ||
50 | + return; | ||
51 | + } | ||
52 | + | ||
53 | + spi_register_board_info(omap3beagle_zippy2_spi_board_info, | ||
54 | + ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); | ||
55 | +} | ||
56 | + | ||
57 | +#else | ||
58 | +static inline void __init omap3beagle_ks8851_init(void) { return; } | ||
59 | +#endif | ||
60 | + | ||
61 | static struct mtd_partition omap3beagle_nand_partitions[] = { | ||
62 | /* All the partition sizes are listed in terms of NAND block size */ | ||
63 | { | ||
64 | @@ -618,6 +660,15 @@ static void __init omap3_beagle_init(void) | ||
65 | mmc[1].gpio_cd = 162; | ||
66 | } | ||
67 | |||
68 | + if(!strcmp(expansionboard_name, "zippy2")) | ||
69 | + { | ||
70 | + printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n"); | ||
71 | + omap3beagle_ks8851_init(); | ||
72 | + printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); | ||
73 | + mmc[1].gpio_wp = 141; | ||
74 | + mmc[1].gpio_cd = 162; | ||
75 | + } | ||
76 | + | ||
77 | usb_musb_init(NULL); | ||
78 | usbhs_init(&usbhs_bdata); | ||
79 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, | ||
80 | -- | ||
81 | 1.7.7.4 | ||
82 | |||
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 @@ | |||
1 | From 0dc814729657ab525ed8ac2e1a96e4f3dc706bb3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Mon, 10 Oct 2011 11:18:49 -0500 | ||
4 | Subject: [PATCH 05/13] expansion: add trainer | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 31 +++++++++++++++++++++++++++++++ | ||
9 | 1 files changed, 31 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 259e6e7..b0b16b4 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -669,6 +669,37 @@ static void __init omap3_beagle_init(void) | ||
16 | mmc[1].gpio_cd = 162; | ||
17 | } | ||
18 | |||
19 | + if(!strcmp(expansionboard_name, "trainer")) | ||
20 | + { | ||
21 | + printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n"); | ||
22 | + gpio_request(130, "sysfs"); | ||
23 | + gpio_export(130, 1); | ||
24 | + gpio_request(131, "sysfs"); | ||
25 | + gpio_export(131, 1); | ||
26 | + gpio_request(132, "sysfs"); | ||
27 | + gpio_export(132, 1); | ||
28 | + gpio_request(133, "sysfs"); | ||
29 | + gpio_export(133, 1); | ||
30 | + gpio_request(134, "sysfs"); | ||
31 | + gpio_export(134, 1); | ||
32 | + gpio_request(135, "sysfs"); | ||
33 | + gpio_export(135, 1); | ||
34 | + gpio_request(136, "sysfs"); | ||
35 | + gpio_export(136, 1); | ||
36 | + gpio_request(137, "sysfs"); | ||
37 | + gpio_export(137, 1); | ||
38 | + gpio_request(138, "sysfs"); | ||
39 | + gpio_export(138, 1); | ||
40 | + gpio_request(139, "sysfs"); | ||
41 | + gpio_export(139, 1); | ||
42 | + gpio_request(140, "sysfs"); | ||
43 | + gpio_export(140, 1); | ||
44 | + gpio_request(141, "sysfs"); | ||
45 | + gpio_export(141, 1); | ||
46 | + gpio_request(162, "sysfs"); | ||
47 | + gpio_export(162, 1); | ||
48 | + } | ||
49 | + | ||
50 | usb_musb_init(NULL); | ||
51 | usbhs_init(&usbhs_bdata); | ||
52 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, | ||
53 | -- | ||
54 | 1.7.7.4 | ||
55 | |||
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 @@ | |||
1 | From 3c92dddf8709162e8ee3a6bdacb83a3e85f70fb1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Fri, 16 Mar 2012 09:47:57 -0500 | ||
4 | Subject: [PATCH 06/13] expansion: add ulcd | ||
5 | |||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 122 ++++++++++++++++++++++ | ||
9 | drivers/video/omap2/displays/panel-generic-dpi.c | 25 +++++ | ||
10 | 2 files changed, 147 insertions(+), 0 deletions(-) | ||
11 | |||
12 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
13 | index b0b16b4..a546c2b 100644 | ||
14 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
16 | @@ -33,6 +33,7 @@ | ||
17 | |||
18 | #include <linux/regulator/machine.h> | ||
19 | #include <linux/i2c/twl.h> | ||
20 | +#include <linux/i2c/tsc2007.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | @@ -84,11 +85,15 @@ static struct { | ||
25 | int usb_pwr_level; | ||
26 | int reset_gpio; | ||
27 | int usr_button_gpio; | ||
28 | + char *lcd_driver_name; | ||
29 | + int lcd_pwren; | ||
30 | } beagle_config = { | ||
31 | .mmc1_gpio_wp = -EINVAL, | ||
32 | .usb_pwr_level = GPIOF_OUT_INIT_LOW, | ||
33 | .reset_gpio = 129, | ||
34 | .usr_button_gpio = 4, | ||
35 | + .lcd_driver_name = "", | ||
36 | + .lcd_pwren = 156 | ||
37 | }; | ||
38 | |||
39 | static struct gpio omap3_beagle_rev_gpios[] __initdata = { | ||
40 | @@ -158,6 +163,7 @@ static void __init omap3_beagle_init_rev(void) | ||
41 | } | ||
42 | |||
43 | char expansionboard_name[16]; | ||
44 | +char expansionboard2_name[16]; | ||
45 | |||
46 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) | ||
47 | |||
48 | @@ -312,9 +318,46 @@ static struct omap_dss_device beagle_tv_device = { | ||
49 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
50 | }; | ||
51 | |||
52 | +static int beagle_enable_lcd(struct omap_dss_device *dssdev) | ||
53 | +{ | ||
54 | + if (gpio_is_valid(beagle_config.lcd_pwren)) { | ||
55 | + printk(KERN_INFO "%s: Enabling LCD\n", __FUNCTION__); | ||
56 | + gpio_set_value(beagle_config.lcd_pwren, 0); | ||
57 | + } else { | ||
58 | + printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", | ||
59 | + __FUNCTION__, beagle_config.lcd_pwren); | ||
60 | + } | ||
61 | + | ||
62 | + return 0; | ||
63 | +} | ||
64 | + | ||
65 | +static void beagle_disable_lcd(struct omap_dss_device *dssdev) | ||
66 | +{ | ||
67 | + if (gpio_is_valid(beagle_config.lcd_pwren)) { | ||
68 | + printk(KERN_INFO "%s: Disabling LCD\n", __FUNCTION__); | ||
69 | + gpio_set_value(beagle_config.lcd_pwren, 1); | ||
70 | + } else { | ||
71 | + printk(KERN_INFO "%s: Invalid LCD enable GPIO: %d\n", | ||
72 | + __FUNCTION__, beagle_config.lcd_pwren); | ||
73 | + } | ||
74 | + | ||
75 | + return; | ||
76 | +} | ||
77 | + | ||
78 | +static struct omap_dss_device beagle_lcd_device = { | ||
79 | + .type = OMAP_DISPLAY_TYPE_DPI, | ||
80 | + .name = "lcd", | ||
81 | + .driver_name = "tfc_s9700rtwv35tr-01b", | ||
82 | + .phy.dpi.data_lines = 24, | ||
83 | + .platform_enable = beagle_enable_lcd, | ||
84 | + .platform_disable = beagle_disable_lcd, | ||
85 | + .reset_gpio = -EINVAL, | ||
86 | +}; | ||
87 | + | ||
88 | static struct omap_dss_device *beagle_dss_devices[] = { | ||
89 | &beagle_dvi_device, | ||
90 | &beagle_tv_device, | ||
91 | + &beagle_lcd_device, | ||
92 | }; | ||
93 | |||
94 | static struct omap_dss_board_info beagle_dss_data = { | ||
95 | @@ -331,6 +374,11 @@ static void __init beagle_display_init(void) | ||
96 | "DVI reset"); | ||
97 | if (r < 0) | ||
98 | printk(KERN_ERR "Unable to get DVI reset GPIO\n"); | ||
99 | + | ||
100 | + r = gpio_request_one(beagle_config.lcd_pwren, GPIOF_OUT_INIT_LOW, | ||
101 | + "LCD power"); | ||
102 | + if (r < 0) | ||
103 | + printk(KERN_ERR "Unable to get LCD power enable GPIO\n"); | ||
104 | } | ||
105 | |||
106 | #include "sdram-micron-mt46h32m32lf-6.h" | ||
107 | @@ -480,6 +528,50 @@ static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { | ||
108 | static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; | ||
109 | #endif | ||
110 | |||
111 | +#if defined(CONFIG_INPUT_TOUCHSCREEN) && \ | ||
112 | + ( defined(CONFIG_TOUCHSCREEN_TSC2007) || defined(CONFIG_TOUCHSCREEN_TSC2007_MODULE)) | ||
113 | +/* Touchscreen */ | ||
114 | +#define OMAP3BEAGLE_TSC2007_GPIO 157 | ||
115 | +static int omap3beagle_tsc2007_get_pendown_state(void) | ||
116 | +{ | ||
117 | + return !gpio_get_value(OMAP3BEAGLE_TSC2007_GPIO); | ||
118 | +} | ||
119 | + | ||
120 | +static void __init omap3beagle_tsc2007_init(void) | ||
121 | +{ | ||
122 | + int r; | ||
123 | + | ||
124 | + omap_mux_init_gpio(OMAP3BEAGLE_TSC2007_GPIO, OMAP_PIN_INPUT_PULLUP); | ||
125 | + | ||
126 | + r = gpio_request_one(OMAP3BEAGLE_TSC2007_GPIO, GPIOF_IN, "tsc2007_pen_down"); | ||
127 | + if (r < 0) { | ||
128 | + printk(KERN_ERR "failed to request GPIO#%d for " | ||
129 | + "tsc2007 pen down IRQ\n", OMAP3BEAGLE_TSC2007_GPIO); | ||
130 | + return; | ||
131 | + } | ||
132 | + | ||
133 | + irq_set_irq_type(gpio_to_irq(OMAP3BEAGLE_TSC2007_GPIO), IRQ_TYPE_EDGE_FALLING); | ||
134 | +} | ||
135 | + | ||
136 | +static struct tsc2007_platform_data tsc2007_info = { | ||
137 | + .model = 2007, | ||
138 | + .x_plate_ohms = 180, | ||
139 | + .get_pendown_state = omap3beagle_tsc2007_get_pendown_state, | ||
140 | +}; | ||
141 | + | ||
142 | +static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = { | ||
143 | + { | ||
144 | + I2C_BOARD_INFO("tlc59108", 0x40), | ||
145 | + I2C_BOARD_INFO("tsc2007", 0x48), | ||
146 | + .irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO), | ||
147 | + .platform_data = &tsc2007_info, | ||
148 | + }, | ||
149 | +}; | ||
150 | +#else | ||
151 | +static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = {}; | ||
152 | +static void __init omap3beagle_tsc2007_init(void) { return; } | ||
153 | +#endif | ||
154 | + | ||
155 | static int __init omap3_beagle_i2c_init(void) | ||
156 | { | ||
157 | omap3_pmic_get_config(&beagle_twldata, | ||
158 | @@ -490,7 +582,17 @@ static int __init omap3_beagle_i2c_init(void) | ||
159 | beagle_twldata.vpll2->constraints.name = "VDVI"; | ||
160 | |||
161 | omap3_pmic_init("twl4030", &beagle_twldata); | ||
162 | + if(!strcmp(expansionboard2_name, "bbtoys-ulcd")) | ||
163 | + { | ||
164 | + printk(KERN_INFO "Beagle second expansionboard: registering bbtoys-ulcd i2c bus\n"); | ||
165 | + omap_register_i2c_bus(2, 400, beagle_i2c2_bbtoys_ulcd, | ||
166 | + ARRAY_SIZE(beagle_i2c2_bbtoys_ulcd)); | ||
167 | + } | ||
168 | + else | ||
169 | + { | ||
170 | omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ARRAY_SIZE(beagle_i2c2_boardinfo)); | ||
171 | + } | ||
172 | + | ||
173 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | ||
174 | * projector don't work reliably with 400kHz */ | ||
175 | omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); | ||
176 | @@ -589,6 +691,15 @@ static int __init expansionboard_setup(char *str) | ||
177 | return 0; | ||
178 | } | ||
179 | |||
180 | +static int __init expansionboard2_setup(char *str) | ||
181 | +{ | ||
182 | + if (!str) | ||
183 | + return -EINVAL; | ||
184 | + strncpy(expansionboard2_name, str, 16); | ||
185 | + printk(KERN_INFO "Beagle second expansionboard: %s\n", expansionboard2_name); | ||
186 | + return 0; | ||
187 | +} | ||
188 | + | ||
189 | static void __init beagle_opp_init(void) | ||
190 | { | ||
191 | int r = 0; | ||
192 | @@ -640,6 +751,10 @@ static void __init omap3_beagle_init(void) | ||
193 | |||
194 | gpio_buttons[0].gpio = beagle_config.usr_button_gpio; | ||
195 | |||
196 | + /* TODO: set lcd_driver_name by command line or device tree */ | ||
197 | + beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b", | ||
198 | + //lcd_panel.name = beagle_config.lcd_driver_name; | ||
199 | + | ||
200 | platform_add_devices(omap3_beagle_devices, | ||
201 | ARRAY_SIZE(omap3_beagle_devices)); | ||
202 | omap_display_init(&beagle_dss_data); | ||
203 | @@ -700,6 +815,12 @@ static void __init omap3_beagle_init(void) | ||
204 | gpio_export(162, 1); | ||
205 | } | ||
206 | |||
207 | + if(!strcmp(expansionboard2_name, "bbtoys-ulcd")) | ||
208 | + { | ||
209 | + printk(KERN_INFO "Beagle second expansionboard: initializing touchscreen: tsc2007\n"); | ||
210 | + omap3beagle_tsc2007_init(); | ||
211 | + } | ||
212 | + | ||
213 | usb_musb_init(NULL); | ||
214 | usbhs_init(&usbhs_bdata); | ||
215 | omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, | ||
216 | @@ -717,6 +838,7 @@ static void __init omap3_beagle_init(void) | ||
217 | } | ||
218 | |||
219 | early_param("buddy", expansionboard_setup); | ||
220 | +early_param("buddy2", expansionboard2_setup); | ||
221 | |||
222 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | ||
223 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ | ||
224 | diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c | ||
225 | index 519c47d..495d693 100644 | ||
226 | --- a/drivers/video/omap2/displays/panel-generic-dpi.c | ||
227 | +++ b/drivers/video/omap2/displays/panel-generic-dpi.c | ||
228 | @@ -297,6 +297,31 @@ static struct panel_config generic_dpi_panels[] = { | ||
229 | |||
230 | .name = "apollon", | ||
231 | }, | ||
232 | + | ||
233 | + /* ThreeFiveCorp S9700RTWV35TR-01B */ | ||
234 | + { | ||
235 | + { | ||
236 | + .x_res = 800, | ||
237 | + .y_res = 480, | ||
238 | + | ||
239 | + .pixel_clock = 30000, | ||
240 | + | ||
241 | + .hsw = 49, | ||
242 | + .hfp = 41, | ||
243 | + .hbp = 40, | ||
244 | + | ||
245 | + .vsw = 4, | ||
246 | + .vfp = 14, | ||
247 | + .vbp = 29, | ||
248 | + }, | ||
249 | + .acbi = 0x0, | ||
250 | + .acb = 0x0, | ||
251 | + .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | | ||
252 | + OMAP_DSS_LCD_IHS, // | OMAP_DSS_LCD_IEO; - TODO check this - doesn't work with this enabled | ||
253 | + .power_on_delay = 50, | ||
254 | + .power_off_delay = 100, | ||
255 | + .name = "tfc_s9700rtwv35tr-01b", | ||
256 | + }, | ||
257 | }; | ||
258 | |||
259 | struct panel_drv_data { | ||
260 | -- | ||
261 | 1.7.7.4 | ||
262 | |||
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 @@ | |||
1 | From 460ac29a1ee0577d6b9044caa53761cc0d02b495 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Wed, 25 Jan 2012 15:48:36 +0100 | ||
4 | Subject: [PATCH 07/13] beagleboard: reinstate usage of hi-speed PLL divider | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++ | ||
9 | 1 files changed, 5 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index a546c2b..e28ae72 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -308,6 +308,11 @@ static struct omap_dss_device beagle_dvi_device = { | ||
16 | .driver_name = "dvi", | ||
17 | .data = &dvi_panel, | ||
18 | .phy.dpi.data_lines = 24, | ||
19 | + .clocks = { | ||
20 | + .dispc = { | ||
21 | + .dispc_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, | ||
22 | + }, | ||
23 | + }, | ||
24 | .reset_gpio = -EINVAL, | ||
25 | }; | ||
26 | |||
27 | -- | ||
28 | 1.7.7.4 | ||
29 | |||
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 @@ | |||
1 | From 3d9465ffd5becb88c1ba36b98f8375898605f529 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Thu, 23 Feb 2012 09:23:10 -0600 | ||
4 | Subject: [PATCH 08/13] Turn on the USB regulator on Beagle xM explicitly | ||
5 | |||
6 | Turn on the USB regulator on Beagle xM explicitly when the USB | ||
7 | subsystem asks for it, rather than relying on u-boot to do it. | ||
8 | |||
9 | http://www.spinics.net/lists/linux-omap/msg65102.html | ||
10 | |||
11 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
12 | --- | ||
13 | arch/arm/mach-omap2/board-omap3beagle.c | 19 +++++++++++++++++++ | ||
14 | 1 files changed, 19 insertions(+), 0 deletions(-) | ||
15 | |||
16 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
17 | index e28ae72..30cb2f0 100644 | ||
18 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
19 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
20 | @@ -411,6 +411,24 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = { | ||
21 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), | ||
22 | }; | ||
23 | |||
24 | +static struct regulator_consumer_supply beagle_usb_supply[] = { | ||
25 | + REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"), | ||
26 | + REGULATOR_SUPPLY("hsusb1", "ehci-omap.0") | ||
27 | +}; | ||
28 | + | ||
29 | +static struct regulator_init_data usb_power = { | ||
30 | + .constraints = { | ||
31 | + .min_uV = 1800000, | ||
32 | + .max_uV = 1800000, | ||
33 | + .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
34 | + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
35 | + | REGULATOR_CHANGE_MODE | ||
36 | + | REGULATOR_CHANGE_STATUS, | ||
37 | + }, | ||
38 | + .num_consumer_supplies = ARRAY_SIZE(beagle_usb_supply), | ||
39 | + .consumer_supplies = beagle_usb_supply | ||
40 | +}; | ||
41 | + | ||
42 | static struct gpio_led gpio_leds[]; | ||
43 | |||
44 | static int beagle_twl_gpio_setup(struct device *dev, | ||
45 | @@ -513,6 +531,7 @@ static struct twl4030_platform_data beagle_twldata = { | ||
46 | .gpio = &beagle_gpio_data, | ||
47 | .vmmc1 = &beagle_vmmc1, | ||
48 | .vsim = &beagle_vsim, | ||
49 | + .vaux2 = &usb_power, | ||
50 | }; | ||
51 | |||
52 | static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { | ||
53 | -- | ||
54 | 1.7.7.4 | ||
55 | |||
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 @@ | |||
1 | From 1a553663864b5b69dcdfd7779640a1c0ce136a93 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Wed, 23 Mar 2011 08:37:54 -0500 | ||
4 | Subject: [PATCH 09/13] meego: modedb add Toshiba LTA070B220F 800x480 support | ||
5 | |||
6 | from http://wiki.meego.com/ARM/Meego_on_Beagleboard_from_scratch | ||
7 | |||
8 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
9 | --- | ||
10 | drivers/video/modedb.c | 4 ++++ | ||
11 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c | ||
14 | index 5b686de..69ad1ec 100644 | ||
15 | --- a/drivers/video/modedb.c | ||
16 | +++ b/drivers/video/modedb.c | ||
17 | @@ -293,6 +293,10 @@ static const struct fb_videomode modedb[] = { | ||
18 | /* 864x480 @ 60 Hz, 35.15 kHz hsync */ | ||
19 | { NULL, 60, 864, 480, 27777, 1, 1, 1, 1, 0, 0, | ||
20 | 0, FB_VMODE_NONINTERLACED }, | ||
21 | + | ||
22 | + /* 800x480 @ 60 Hz, Toshiba LTA070B220F 7 inch LCD */ | ||
23 | + { NULL, 60, 800, 480, 32787, 48, 80, 33, 31, 32, 2, | ||
24 | + FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED }, | ||
25 | }; | ||
26 | |||
27 | #ifdef CONFIG_FB_MODE_HELPERS | ||
28 | -- | ||
29 | 1.7.7.4 | ||
30 | |||
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 @@ | |||
1 | From 6a386a61fc5cd9c71f8c5dc577e70b4c0f892130 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 27 Apr 2012 16:57:27 +0200 | ||
4 | Subject: [PATCH 10/13] beagleboard: fix uLCD7 support | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-omap3beagle.c | 14 ++++++++++++-- | ||
9 | 1 files changed, 12 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
12 | index 30cb2f0..0299d47 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -44,6 +44,7 @@ | ||
16 | #include <plat/board.h> | ||
17 | #include <plat/common.h> | ||
18 | #include <video/omapdss.h> | ||
19 | +#include <video/omap-panel-generic-dpi.h> | ||
20 | #include <video/omap-panel-dvi.h> | ||
21 | #include <plat/gpmc.h> | ||
22 | #include <plat/nand.h> | ||
23 | @@ -349,14 +350,21 @@ static void beagle_disable_lcd(struct omap_dss_device *dssdev) | ||
24 | return; | ||
25 | } | ||
26 | |||
27 | +static struct panel_generic_dpi_data lcd_panel = { | ||
28 | + .name = "tfc_s9700rtwv35tr-01b", | ||
29 | + .platform_enable = beagle_enable_lcd, | ||
30 | + .platform_disable = beagle_disable_lcd, | ||
31 | +}; | ||
32 | + | ||
33 | static struct omap_dss_device beagle_lcd_device = { | ||
34 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
35 | .name = "lcd", | ||
36 | - .driver_name = "tfc_s9700rtwv35tr-01b", | ||
37 | + .driver_name = "generic_dpi_panel", | ||
38 | .phy.dpi.data_lines = 24, | ||
39 | .platform_enable = beagle_enable_lcd, | ||
40 | .platform_disable = beagle_disable_lcd, | ||
41 | .reset_gpio = -EINVAL, | ||
42 | + .data = &lcd_panel, | ||
43 | }; | ||
44 | |||
45 | static struct omap_dss_device *beagle_dss_devices[] = { | ||
46 | @@ -586,6 +594,8 @@ static struct tsc2007_platform_data tsc2007_info = { | ||
47 | static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] = { | ||
48 | { | ||
49 | I2C_BOARD_INFO("tlc59108", 0x40), | ||
50 | + }, | ||
51 | + { | ||
52 | I2C_BOARD_INFO("tsc2007", 0x48), | ||
53 | .irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_TSC2007_GPIO), | ||
54 | .platform_data = &tsc2007_info, | ||
55 | @@ -777,7 +787,7 @@ static void __init omap3_beagle_init(void) | ||
56 | |||
57 | /* TODO: set lcd_driver_name by command line or device tree */ | ||
58 | beagle_config.lcd_driver_name = "tfc_s9700rtwv35tr-01b", | ||
59 | - //lcd_panel.name = beagle_config.lcd_driver_name; | ||
60 | + lcd_panel.name = beagle_config.lcd_driver_name; | ||
61 | |||
62 | platform_add_devices(omap3_beagle_devices, | ||
63 | ARRAY_SIZE(omap3_beagle_devices)); | ||
64 | -- | ||
65 | 1.7.7.4 | ||
66 | |||
diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0011-default-to-fifo-mode-5-for-old-musb-beagles.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0011-default-to-fifo-mode-5-for-old-musb-beagles.patch new file mode 100644 index 00000000..53161194 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0011-default-to-fifo-mode-5-for-old-musb-beagles.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 16c97b9941534b54a2fdf4d310fd22deb10d0cc1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Sat, 8 Jan 2011 14:31:37 -0600 | ||
4 | Subject: [PATCH 11/13] default to fifo mode 5, for old musb beagles | ||
5 | |||
6 | The fifo mode 4, 16kb can cause corruption on musb/omap35xx, | ||
7 | use mode 5, 8kb... | ||
8 | |||
9 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
10 | --- | ||
11 | drivers/usb/musb/musb_core.c | 2 +- | ||
12 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c | ||
15 | index 920f04e..66ce5e0 100644 | ||
16 | --- a/drivers/usb/musb/musb_core.c | ||
17 | +++ b/drivers/usb/musb/musb_core.c | ||
18 | @@ -1015,7 +1015,7 @@ static void musb_shutdown(struct platform_device *pdev) | ||
19 | || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE) \ | ||
20 | || defined(CONFIG_USB_MUSB_AM35X) \ | ||
21 | || defined(CONFIG_USB_MUSB_AM35X_MODULE) | ||
22 | -static ushort __initdata fifo_mode = 4; | ||
23 | +static ushort __initdata fifo_mode = 5; | ||
24 | #elif defined(CONFIG_USB_MUSB_UX500) \ | ||
25 | || defined(CONFIG_USB_MUSB_UX500_MODULE) | ||
26 | static ushort __initdata fifo_mode = 5; | ||
27 | -- | ||
28 | 1.7.7.4 | ||
29 | |||
diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0012-backlight-Add-TLC59108-backlight-control-driver.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0012-backlight-Add-TLC59108-backlight-control-driver.patch new file mode 100644 index 00000000..850d3731 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0012-backlight-Add-TLC59108-backlight-control-driver.patch | |||
@@ -0,0 +1,215 @@ | |||
1 | From 9f4af290c74b77e16555858a338feb467a8eedb0 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Manjunathappa, Prakash" <prakash.pm@ti.com> | ||
3 | Date: Mon, 1 Aug 2011 18:25:11 +0530 | ||
4 | Subject: [PATCH 12/13] backlight: Add TLC59108 backlight control driver | ||
5 | |||
6 | This patch adds support for I2C configurable TLC59108 backlight | ||
7 | control driver. | ||
8 | |||
9 | Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> | ||
10 | Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> | ||
11 | --- | ||
12 | drivers/video/backlight/Kconfig | 8 ++ | ||
13 | drivers/video/backlight/Makefile | 1 + | ||
14 | drivers/video/backlight/tlc59108.c | 160 ++++++++++++++++++++++++++++++++++++ | ||
15 | 3 files changed, 169 insertions(+), 0 deletions(-) | ||
16 | create mode 100755 drivers/video/backlight/tlc59108.c | ||
17 | |||
18 | diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig | ||
19 | index 278aeaa..df9dac7 100644 | ||
20 | --- a/drivers/video/backlight/Kconfig | ||
21 | +++ b/drivers/video/backlight/Kconfig | ||
22 | @@ -342,6 +342,14 @@ config BACKLIGHT_AAT2870 | ||
23 | If you have a AnalogicTech AAT2870 say Y to enable the | ||
24 | backlight driver. | ||
25 | |||
26 | +config BACKLIGHT_TLC59108 | ||
27 | + tristate "TLC59108 LCD Backlight Driver" | ||
28 | + depends on I2C && BACKLIGHT_CLASS_DEVICE | ||
29 | + default n | ||
30 | + help | ||
31 | + If you have an LCD Panel with backlight control via TLC59108, | ||
32 | + say Y to enable its LCD control driver. | ||
33 | + | ||
34 | endif # BACKLIGHT_CLASS_DEVICE | ||
35 | |||
36 | endif # BACKLIGHT_LCD_SUPPORT | ||
37 | diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile | ||
38 | index fdd1fc4..ba31474 100644 | ||
39 | --- a/drivers/video/backlight/Makefile | ||
40 | +++ b/drivers/video/backlight/Makefile | ||
41 | @@ -39,4 +39,5 @@ obj-$(CONFIG_BACKLIGHT_ADP8870) += adp8870_bl.o | ||
42 | obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o | ||
43 | obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o | ||
44 | obj-$(CONFIG_BACKLIGHT_AAT2870) += aat2870_bl.o | ||
45 | +obj-$(CONFIG_BACKLIGHT_TLC59108) += tlc59108.o | ||
46 | |||
47 | diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tlc59108.c | ||
48 | new file mode 100755 | ||
49 | index 0000000..4f4ea34 | ||
50 | --- /dev/null | ||
51 | +++ b/drivers/video/backlight/tlc59108.c | ||
52 | @@ -0,0 +1,160 @@ | ||
53 | +/* | ||
54 | + * ti81xxhdmi_tlc59108.c | ||
55 | + * | ||
56 | + * Copyright (C) 2011 Texas Instruments | ||
57 | + * Author: Senthil Natarajan | ||
58 | + * | ||
59 | + * tlc59108 HDMI Driver | ||
60 | + * | ||
61 | + * This program is free software; you can redistribute it and/or modify it | ||
62 | + * under the terms of the GNU General Public License version 2 as published by | ||
63 | + * the Free Software Foundation. | ||
64 | + * | ||
65 | + * This program is distributed in the hope that it will be useful, but WITHOUT | ||
66 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
67 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
68 | + * more details. | ||
69 | + * | ||
70 | + * You should have received a copy of the GNU General Public License along with | ||
71 | + * this program. If not, see <http://www.gnu.org/licenses/>. | ||
72 | + * History: | ||
73 | + * | ||
74 | + * Senthil Natarajan<senthil.n@ti.com> July 2011 I2C driver for tlc59108 | ||
75 | + * backlight control | ||
76 | + */ | ||
77 | + | ||
78 | +#include <linux/i2c.h> | ||
79 | +#include <linux/kernel.h> | ||
80 | +#include <linux/module.h> | ||
81 | +#include <linux/backlight.h> | ||
82 | +#include <linux/fb.h> | ||
83 | + | ||
84 | +#define tlc59108_MODULE_NAME "tlc59108" | ||
85 | +#define TLC59108_MODE1 0x00 | ||
86 | +#define TLC59108_PWM2 0x04 | ||
87 | +#define TLC59108_LEDOUT0 0x0c | ||
88 | +#define TLC59108_LEDOUT1 0x0d | ||
89 | +#define TLC59108_MAX_BRIGHTNESS 0xFF | ||
90 | + | ||
91 | +struct tlc59108_bl { | ||
92 | + struct i2c_client *client; | ||
93 | + struct backlight_device *bl; | ||
94 | +}; | ||
95 | + | ||
96 | +static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightness) | ||
97 | +{ | ||
98 | + /* Set Mode1 Register */ | ||
99 | + i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); | ||
100 | + | ||
101 | + /* Set LEDOUT0 Register */ | ||
102 | + i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21); | ||
103 | + | ||
104 | + /* Set Backlight Duty Cycle*/ | ||
105 | + i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, | ||
106 | + brightness & 0xff); | ||
107 | +} | ||
108 | + | ||
109 | +static int tlc59108_bl_get_brightness(struct backlight_device *dev) | ||
110 | +{ | ||
111 | + struct backlight_properties *props = &dev->props; | ||
112 | + | ||
113 | + return props->brightness; | ||
114 | +} | ||
115 | + | ||
116 | +static int tlc59108_bl_update_status(struct backlight_device *dev) | ||
117 | +{ | ||
118 | + struct backlight_properties *props = &dev->props; | ||
119 | + struct tlc59108_bl *data = dev_get_drvdata(&dev->dev); | ||
120 | + int brightness = props->brightness; | ||
121 | + | ||
122 | + tlc59108_bl_set_backlight(data, brightness); | ||
123 | + | ||
124 | + return 0; | ||
125 | +} | ||
126 | + | ||
127 | +static const struct backlight_ops bl_ops = { | ||
128 | + .get_brightness = tlc59108_bl_get_brightness, | ||
129 | + .update_status = tlc59108_bl_update_status, | ||
130 | +}; | ||
131 | + | ||
132 | +static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id) | ||
133 | +{ | ||
134 | + struct backlight_properties props; | ||
135 | + struct tlc59108_bl *data = kzalloc(sizeof(struct tlc59108_bl), | ||
136 | + GFP_KERNEL); | ||
137 | + int ret = 0; | ||
138 | + | ||
139 | + if (!data) | ||
140 | + return -ENOMEM; | ||
141 | + | ||
142 | + i2c_set_clientdata(c, data); | ||
143 | + data->client = c; | ||
144 | + | ||
145 | + memset(&props, 0, sizeof(struct backlight_properties)); | ||
146 | + props.max_brightness = TLC59108_MAX_BRIGHTNESS; | ||
147 | + props.type = BACKLIGHT_RAW; | ||
148 | + data->bl = backlight_device_register("tlc59108-bl", &c->dev, data, | ||
149 | + &bl_ops, &props); | ||
150 | + if (IS_ERR(data->bl)) { | ||
151 | + ret = PTR_ERR(data->bl); | ||
152 | + goto err_reg; | ||
153 | + } | ||
154 | + | ||
155 | + data->bl->props.brightness = TLC59108_MAX_BRIGHTNESS; | ||
156 | + | ||
157 | + backlight_update_status(data->bl); | ||
158 | + | ||
159 | + return 0; | ||
160 | + | ||
161 | +err_reg: | ||
162 | + data->bl = NULL; | ||
163 | + kfree(data); | ||
164 | + return ret; | ||
165 | +} | ||
166 | + | ||
167 | +static int tlc59108_remove(struct i2c_client *c) | ||
168 | +{ | ||
169 | + struct tlc59108_bl *data = i2c_get_clientdata(c); | ||
170 | + | ||
171 | + backlight_device_unregister(data->bl); | ||
172 | + data->bl = NULL; | ||
173 | + | ||
174 | + kfree(data); | ||
175 | + | ||
176 | + return 0; | ||
177 | +} | ||
178 | + | ||
179 | +/* I2C Device ID table */ | ||
180 | +static const struct i2c_device_id tlc59108_id[] = { | ||
181 | + { "tlc59108", 0 }, | ||
182 | + { } | ||
183 | +}; | ||
184 | +MODULE_DEVICE_TABLE(i2c, tlc59108_id); | ||
185 | + | ||
186 | +/* I2C driver data */ | ||
187 | +static struct i2c_driver tlc59108_driver = { | ||
188 | + .driver = { | ||
189 | + .owner = THIS_MODULE, | ||
190 | + .name = tlc59108_MODULE_NAME, | ||
191 | + }, | ||
192 | + .probe = tlc59108_probe, | ||
193 | + .remove = tlc59108_remove, | ||
194 | + .id_table = tlc59108_id, | ||
195 | +}; | ||
196 | + | ||
197 | +static int __init tlc59108_init(void) | ||
198 | +{ | ||
199 | + return i2c_add_driver(&tlc59108_driver); | ||
200 | +} | ||
201 | + | ||
202 | +static void __exit tlc59108_exit(void) | ||
203 | +{ | ||
204 | + i2c_del_driver(&tlc59108_driver); | ||
205 | +} | ||
206 | + | ||
207 | +module_init(tlc59108_init); | ||
208 | +module_exit(tlc59108_exit); | ||
209 | + | ||
210 | +MODULE_DESCRIPTION("LCD/Backlight control for TLC59108"); | ||
211 | +MODULE_AUTHOR("Senthil Natarajan <senthil.n@ti.com>"); | ||
212 | +MODULE_LICENSE("GPL v2"); | ||
213 | -- | ||
214 | 1.7.7.4 | ||
215 | |||
diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0013-tlc59108-adjust-for-beagleboard-uLCD7.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0013-tlc59108-adjust-for-beagleboard-uLCD7.patch new file mode 100644 index 00000000..82d12919 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0013-tlc59108-adjust-for-beagleboard-uLCD7.patch | |||
@@ -0,0 +1,124 @@ | |||
1 | From a165f2f70ebcf073cfc934c510ecf86bb028ef4e Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 27 Apr 2012 21:30:00 +0200 | ||
4 | Subject: [PATCH 13/13] tlc59108: adjust for beagleboard+uLCD7 | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | drivers/video/backlight/tlc59108.c | 48 ++++++++++++++++++++++++------------ | ||
9 | 1 files changed, 32 insertions(+), 16 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tlc59108.c | ||
12 | index 4f4ea34..de2d2ee 100755 | ||
13 | --- a/drivers/video/backlight/tlc59108.c | ||
14 | +++ b/drivers/video/backlight/tlc59108.c | ||
15 | @@ -29,9 +29,16 @@ | ||
16 | #include <linux/backlight.h> | ||
17 | #include <linux/fb.h> | ||
18 | |||
19 | -#define tlc59108_MODULE_NAME "tlc59108" | ||
20 | #define TLC59108_MODE1 0x00 | ||
21 | -#define TLC59108_PWM2 0x04 | ||
22 | +#define TLC59108_MODE2 0x01 | ||
23 | +#define TLC59108_PWM0 0x02 | ||
24 | +#define TLC59108_PWM1 0x03 | ||
25 | +#define TLC59108_PWM2 0x04 | ||
26 | +#define TLC59108_PWM3 0x05 | ||
27 | +#define TLC59108_PWM4 0x06 | ||
28 | +#define TLC59108_PWM5 0x07 | ||
29 | +#define TLC59108_PWM6 0x08 | ||
30 | +#define TLC59108_PWM7 0x09 | ||
31 | #define TLC59108_LEDOUT0 0x0c | ||
32 | #define TLC59108_LEDOUT1 0x0d | ||
33 | #define TLC59108_MAX_BRIGHTNESS 0xFF | ||
34 | @@ -43,15 +50,9 @@ struct tlc59108_bl { | ||
35 | |||
36 | static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightness) | ||
37 | { | ||
38 | - /* Set Mode1 Register */ | ||
39 | - i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); | ||
40 | - | ||
41 | - /* Set LEDOUT0 Register */ | ||
42 | - i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21); | ||
43 | - | ||
44 | /* Set Backlight Duty Cycle*/ | ||
45 | i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, | ||
46 | - brightness & 0xff); | ||
47 | + 0xff - brightness ); | ||
48 | } | ||
49 | |||
50 | static int tlc59108_bl_get_brightness(struct backlight_device *dev) | ||
51 | @@ -65,7 +66,17 @@ static int tlc59108_bl_update_status(struct backlight_device *dev) | ||
52 | { | ||
53 | struct backlight_properties *props = &dev->props; | ||
54 | struct tlc59108_bl *data = dev_get_drvdata(&dev->dev); | ||
55 | - int brightness = props->brightness; | ||
56 | + | ||
57 | + int brightness = props->brightness; | ||
58 | + | ||
59 | + if (dev->props.state & BL_CORE_FBBLANK) { | ||
60 | + brightness = 0; | ||
61 | + /* Set LEDOUT0 Register */ | ||
62 | + i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x10); | ||
63 | + } else { | ||
64 | + /* Set LEDOUT0 Register */ | ||
65 | + i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x30); | ||
66 | + } | ||
67 | |||
68 | tlc59108_bl_set_backlight(data, brightness); | ||
69 | |||
70 | @@ -77,7 +88,7 @@ static const struct backlight_ops bl_ops = { | ||
71 | .update_status = tlc59108_bl_update_status, | ||
72 | }; | ||
73 | |||
74 | -static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id) | ||
75 | +static int __devinit tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id) | ||
76 | { | ||
77 | struct backlight_properties props; | ||
78 | struct tlc59108_bl *data = kzalloc(sizeof(struct tlc59108_bl), | ||
79 | @@ -104,6 +115,11 @@ static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id *id) | ||
80 | |||
81 | backlight_update_status(data->bl); | ||
82 | |||
83 | + i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); | ||
84 | + i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, 0x80); | ||
85 | + i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x05); | ||
86 | + i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x15); | ||
87 | + | ||
88 | return 0; | ||
89 | |||
90 | err_reg: | ||
91 | @@ -125,7 +141,7 @@ static int tlc59108_remove(struct i2c_client *c) | ||
92 | } | ||
93 | |||
94 | /* I2C Device ID table */ | ||
95 | -static const struct i2c_device_id tlc59108_id[] = { | ||
96 | +static struct i2c_device_id tlc59108_id[] = { | ||
97 | { "tlc59108", 0 }, | ||
98 | { } | ||
99 | }; | ||
100 | @@ -134,12 +150,12 @@ MODULE_DEVICE_TABLE(i2c, tlc59108_id); | ||
101 | /* I2C driver data */ | ||
102 | static struct i2c_driver tlc59108_driver = { | ||
103 | .driver = { | ||
104 | - .owner = THIS_MODULE, | ||
105 | - .name = tlc59108_MODULE_NAME, | ||
106 | + .owner = THIS_MODULE, | ||
107 | + .name = "tlc59108" | ||
108 | }, | ||
109 | + .id_table = tlc59108_id, | ||
110 | .probe = tlc59108_probe, | ||
111 | .remove = tlc59108_remove, | ||
112 | - .id_table = tlc59108_id, | ||
113 | }; | ||
114 | |||
115 | static int __init tlc59108_init(void) | ||
116 | @@ -157,4 +173,4 @@ module_exit(tlc59108_exit); | ||
117 | |||
118 | MODULE_DESCRIPTION("LCD/Backlight control for TLC59108"); | ||
119 | MODULE_AUTHOR("Senthil Natarajan <senthil.n@ti.com>"); | ||
120 | -MODULE_LICENSE("GPL v2"); | ||
121 | +MODULE_LICENSE("GPL"); | ||
122 | -- | ||
123 | 1.7.7.4 | ||
124 | |||