diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/base')
28 files changed, 3408 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0001-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch b/extras/recipes-kernel/linux/linux-omap/base/0001-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch new file mode 100644 index 00000000..42bfa4e2 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0001-omap3-beaglexm-fix-EHCI-power-up-GPIO-dir.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 3d2f0e2f29320d9c6a6e4d8d5aeff9127a2106cb Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@beagleboard.org> | ||
3 | Date: Tue, 11 Jan 2011 17:13:35 +0000 | ||
4 | Subject: [PATCH 01/28] omap3: beaglexm: fix EHCI power up GPIO dir | ||
5 | |||
6 | EHCI enable power pin is inverted (active high) in comparison | ||
7 | to vanilla beagle which is active low. Handle this case conditionally. | ||
8 | |||
9 | Without this fix, Beagle XM 4 port EHCI will not function and no | ||
10 | networking will be available | ||
11 | |||
12 | [nm@ti.com: split up, added descriptive changelogs] | ||
13 | Signed-off-by: Nishanth Menon <nm@ti.com> | ||
14 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
15 | Signed-off-by: Tony Lindgren <tony@atomide.com> | ||
16 | --- | ||
17 | arch/arm/mach-omap2/board-omap3beagle.c | 10 ++++++++-- | ||
18 | 1 files changed, 8 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
21 | index 6c12760..af1166b 100644 | ||
22 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
23 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
24 | @@ -297,9 +297,15 @@ static int beagle_twl_gpio_setup(struct device *dev, | ||
25 | gpio_request(gpio + 1, "EHCI_nOC"); | ||
26 | gpio_direction_input(gpio + 1); | ||
27 | |||
28 | - /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ | ||
29 | + /* | ||
30 | + * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active | ||
31 | + * high / others active low) | ||
32 | + */ | ||
33 | gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); | ||
34 | - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
35 | + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) | ||
36 | + gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); | ||
37 | + else | ||
38 | + gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
39 | |||
40 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
41 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
42 | -- | ||
43 | 1.6.6.1 | ||
44 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0002-omap3-beaglexm-fix-DVI-reset-GPIO.patch b/extras/recipes-kernel/linux/linux-omap/base/0002-omap3-beaglexm-fix-DVI-reset-GPIO.patch new file mode 100644 index 00000000..1808a861 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0002-omap3-beaglexm-fix-DVI-reset-GPIO.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From e1dd1afba99853083da545f632a1f7c6899ae379 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@beagleboard.org> | ||
3 | Date: Tue, 11 Jan 2011 17:13:36 +0000 | ||
4 | Subject: [PATCH 02/28] omap3: beaglexm: fix DVI reset GPIO | ||
5 | |||
6 | GPIO reset line for Beagle XM is different from vanilla beagle | ||
7 | so we populate it as part of gpio update routine. | ||
8 | |||
9 | This in part fixes the issue of display not functioning on beagle XM | ||
10 | platform. | ||
11 | |||
12 | [nm@ti.com: split up, added descriptive changelogs] | ||
13 | Signed-off-by: Nishanth Menon <nm@ti.com> | ||
14 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
15 | Signed-off-by: Tony Lindgren <tony@atomide.com> | ||
16 | --- | ||
17 | arch/arm/mach-omap2/board-omap3beagle.c | 8 +++++++- | ||
18 | 1 files changed, 7 insertions(+), 1 deletions(-) | ||
19 | |||
20 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
21 | index af1166b..673deb9 100644 | ||
22 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
23 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
24 | @@ -199,7 +199,7 @@ static struct omap_dss_device beagle_dvi_device = { | ||
25 | .name = "dvi", | ||
26 | .driver_name = "generic_panel", | ||
27 | .phy.dpi.data_lines = 24, | ||
28 | - .reset_gpio = 170, | ||
29 | + .reset_gpio = -EINVAL, | ||
30 | .platform_enable = beagle_enable_dvi, | ||
31 | .platform_disable = beagle_disable_dvi, | ||
32 | }; | ||
33 | @@ -307,6 +307,12 @@ static int beagle_twl_gpio_setup(struct device *dev, | ||
34 | else | ||
35 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
36 | |||
37 | + /* DVI reset GPIO is different between beagle revisions */ | ||
38 | + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) | ||
39 | + beagle_dvi_device.reset_gpio = 129; | ||
40 | + else | ||
41 | + beagle_dvi_device.reset_gpio = 170; | ||
42 | + | ||
43 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
44 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
45 | |||
46 | -- | ||
47 | 1.6.6.1 | ||
48 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0003-omap3-beaglexm-fix-power-on-of-DVI.patch b/extras/recipes-kernel/linux/linux-omap/base/0003-omap3-beaglexm-fix-power-on-of-DVI.patch new file mode 100644 index 00000000..90446e40 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0003-omap3-beaglexm-fix-power-on-of-DVI.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | From 4004c3e68b973f4cb736048b1e90ee3b511f5865 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@beagleboard.org> | ||
3 | Date: Wed, 12 Jan 2011 00:23:29 +0000 | ||
4 | Subject: [PATCH 03/28] omap3: beaglexm: fix power on of DVI | ||
5 | |||
6 | TFP410 DVI chip is used to provide display out. | ||
7 | This chip is controlled by 2 lines: | ||
8 | LDO which supplies the power is controlled over gpio + 2 | ||
9 | and the enable of the chip itself is done over gpio + 1 | ||
10 | NOTE: the LDO is necessary for LED, serial blocks as well. | ||
11 | |||
12 | gpio + 1 was used to sense USB overcurrent in vanilla beagle. | ||
13 | |||
14 | Without this fix, the display would not function as the LDO | ||
15 | remains shut down. | ||
16 | |||
17 | [nm@ti.com: split up, added descriptive changelogs] | ||
18 | Signed-off-by: Nishanth Menon <nm@ti.com> | ||
19 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
20 | Signed-off-by: Tony Lindgren <tony@atomide.com> | ||
21 | --- | ||
22 | arch/arm/mach-omap2/board-omap3beagle.c | 42 ++++++++++++++++++++++++++++-- | ||
23 | 1 files changed, 39 insertions(+), 3 deletions(-) | ||
24 | |||
25 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
26 | index 673deb9..2ed8040 100644 | ||
27 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
28 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
29 | @@ -273,6 +273,8 @@ static struct gpio_led gpio_leds[]; | ||
30 | static int beagle_twl_gpio_setup(struct device *dev, | ||
31 | unsigned gpio, unsigned ngpio) | ||
32 | { | ||
33 | + int r; | ||
34 | + | ||
35 | if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { | ||
36 | mmc[0].gpio_wp = -EINVAL; | ||
37 | } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) || | ||
38 | @@ -293,9 +295,16 @@ static int beagle_twl_gpio_setup(struct device *dev, | ||
39 | /* REVISIT: need ehci-omap hooks for external VBUS | ||
40 | * power switch and overcurrent detect | ||
41 | */ | ||
42 | - | ||
43 | - gpio_request(gpio + 1, "EHCI_nOC"); | ||
44 | - gpio_direction_input(gpio + 1); | ||
45 | + if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) { | ||
46 | + r = gpio_request(gpio + 1, "EHCI_nOC"); | ||
47 | + if (!r) { | ||
48 | + r = gpio_direction_input(gpio + 1); | ||
49 | + if (r) | ||
50 | + gpio_free(gpio + 1); | ||
51 | + } | ||
52 | + if (r) | ||
53 | + pr_err("%s: unable to configure EHCI_nOC\n", __func__); | ||
54 | + } | ||
55 | |||
56 | /* | ||
57 | * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active | ||
58 | @@ -316,6 +325,33 @@ static int beagle_twl_gpio_setup(struct device *dev, | ||
59 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
60 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
61 | |||
62 | + /* | ||
63 | + * gpio + 1 on Xm controls the TFP410's enable line (active low) | ||
64 | + * gpio + 2 control varies depending on the board rev as follows: | ||
65 | + * P7/P8 revisions(prototype): Camera EN | ||
66 | + * A2+ revisions (production): LDO (supplies DVI, serial, led blocks) | ||
67 | + */ | ||
68 | + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { | ||
69 | + r = gpio_request(gpio + 1, "nDVI_PWR_EN"); | ||
70 | + if (!r) { | ||
71 | + r = gpio_direction_output(gpio + 1, 0); | ||
72 | + if (r) | ||
73 | + gpio_free(gpio + 1); | ||
74 | + } | ||
75 | + if (r) | ||
76 | + pr_err("%s: unable to configure nDVI_PWR_EN\n", | ||
77 | + __func__); | ||
78 | + r = gpio_request(gpio + 2, "DVI_LDO_EN"); | ||
79 | + if (!r) { | ||
80 | + r = gpio_direction_output(gpio + 2, 1); | ||
81 | + if (r) | ||
82 | + gpio_free(gpio + 2); | ||
83 | + } | ||
84 | + if (r) | ||
85 | + pr_err("%s: unable to configure DVI_LDO_EN\n", | ||
86 | + __func__); | ||
87 | + } | ||
88 | + | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | -- | ||
93 | 1.6.6.1 | ||
94 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0004-omap-Beagle-detect-new-xM-revision-B.patch b/extras/recipes-kernel/linux/linux-omap/base/0004-omap-Beagle-detect-new-xM-revision-B.patch new file mode 100644 index 00000000..43371618 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0004-omap-Beagle-detect-new-xM-revision-B.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 24b7a742b27ed2c05c6bc7800b0299a77af37a82 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Nelson <robertcnelson@gmail.com> | ||
3 | Date: Tue, 9 Nov 2010 08:34:55 -0600 | ||
4 | Subject: [PATCH 04/28] omap: Beagle: detect new xM revision B | ||
5 | |||
6 | The xM B uses a DM3730 ES1.1 over the ES1.0 on xM A's, no other board changes. | ||
7 | |||
8 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
9 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
10 | --- | ||
11 | arch/arm/mach-omap2/board-omap3beagle.c | 9 +++++++-- | ||
12 | 1 files changed, 7 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | index 2ed8040..f9fb64b 100644 | ||
16 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
17 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
18 | @@ -58,7 +58,8 @@ | ||
19 | * AXBX = GPIO173, GPIO172, GPIO171: 1 1 1 | ||
20 | * C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0 | ||
21 | * C4 = GPIO173, GPIO172, GPIO171: 1 0 1 | ||
22 | - * XM = GPIO173, GPIO172, GPIO171: 0 0 0 | ||
23 | + * XMA = GPIO173, GPIO172, GPIO171: 0 0 0 | ||
24 | + * XMB = GPIO173, GPIO172, GPIO171: 0 0 1 | ||
25 | */ | ||
26 | enum { | ||
27 | OMAP3BEAGLE_BOARD_UNKN = 0, | ||
28 | @@ -117,7 +118,11 @@ static void __init omap3_beagle_init_rev(void) | ||
29 | omap3_beagle_version = OMAP3BEAGLE_BOARD_C4; | ||
30 | break; | ||
31 | case 0: | ||
32 | - printk(KERN_INFO "OMAP3 Beagle Rev: xM\n"); | ||
33 | + printk(KERN_INFO "OMAP3 Beagle Rev: xM A\n"); | ||
34 | + omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; | ||
35 | + break; | ||
36 | + case 1: | ||
37 | + printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n"); | ||
38 | omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; | ||
39 | break; | ||
40 | default: | ||
41 | -- | ||
42 | 1.6.6.1 | ||
43 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0005-ARM-OMAP-beagleboard-Add-infrastructure-to-do-fixups.patch b/extras/recipes-kernel/linux/linux-omap/base/0005-ARM-OMAP-beagleboard-Add-infrastructure-to-do-fixups.patch new file mode 100644 index 00000000..21d8d8fe --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0005-ARM-OMAP-beagleboard-Add-infrastructure-to-do-fixups.patch | |||
@@ -0,0 +1,219 @@ | |||
1 | From a564ca287c115928a9e7febf7c99bbab582290e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Wed, 6 Oct 2010 10:19:34 +0200 | ||
4 | Subject: [PATCH 05/28] ARM: OMAP: beagleboard: Add infrastructure to do fixups based on expansionboard name passed by u-boot | ||
5 | |||
6 | Add support for Tincantools Zippy and Zippy2 expansionboards as well | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
9 | --- | ||
10 | arch/arm/mach-omap2/board-omap3beagle.c | 142 ++++++++++++++++++++++++++++++- | ||
11 | 1 files changed, 139 insertions(+), 3 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | index f9fb64b..d777b3b 100644 | ||
15 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
16 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
17 | @@ -21,6 +21,7 @@ | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/leds.h> | ||
20 | #include <linux/gpio.h> | ||
21 | +#include <linux/irq.h> | ||
22 | #include <linux/input.h> | ||
23 | #include <linux/gpio_keys.h> | ||
24 | |||
25 | @@ -143,6 +144,92 @@ fail0: | ||
26 | return; | ||
27 | } | ||
28 | |||
29 | +char expansionboard_name[16]; | ||
30 | + | ||
31 | +#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) | ||
32 | + | ||
33 | +#include <plat/mcspi.h> | ||
34 | +#include <linux/spi/spi.h> | ||
35 | + | ||
36 | +#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 | ||
37 | + | ||
38 | +static struct omap2_mcspi_device_config enc28j60_spi_chip_info = { | ||
39 | + .turbo_mode = 0, | ||
40 | + .single_channel = 1, /* 0: slave, 1: master */ | ||
41 | +}; | ||
42 | + | ||
43 | +static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = { | ||
44 | + { | ||
45 | + .modalias = "enc28j60", | ||
46 | + .bus_num = 4, | ||
47 | + .chip_select = 0, | ||
48 | + .max_speed_hz = 20000000, | ||
49 | + .controller_data = &enc28j60_spi_chip_info, | ||
50 | + }, | ||
51 | +}; | ||
52 | + | ||
53 | +static void __init omap3beagle_enc28j60_init(void) | ||
54 | +{ | ||
55 | + if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) && | ||
56 | + (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) { | ||
57 | + gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); | ||
58 | + omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ); | ||
59 | + set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); | ||
60 | + } else { | ||
61 | + printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n"); | ||
62 | + return; | ||
63 | + } | ||
64 | + | ||
65 | + spi_register_board_info(omap3beagle_zippy_spi_board_info, | ||
66 | + ARRAY_SIZE(omap3beagle_zippy_spi_board_info)); | ||
67 | +} | ||
68 | + | ||
69 | +#else | ||
70 | +static inline void __init omap3beagle_enc28j60_init(void) { return; } | ||
71 | +#endif | ||
72 | + | ||
73 | +#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) | ||
74 | + | ||
75 | +#include <plat/mcspi.h> | ||
76 | +#include <linux/spi/spi.h> | ||
77 | + | ||
78 | +#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157 | ||
79 | + | ||
80 | +static struct omap2_mcspi_device_config ks8851_spi_chip_info = { | ||
81 | + .turbo_mode = 0, | ||
82 | + .single_channel = 1, /* 0: slave, 1: master */ | ||
83 | +}; | ||
84 | + | ||
85 | +static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = { | ||
86 | + { | ||
87 | + .modalias = "ks8851", | ||
88 | + .bus_num = 4, | ||
89 | + .chip_select = 0, | ||
90 | + .max_speed_hz = 36000000, | ||
91 | + .controller_data = &ks8851_spi_chip_info, | ||
92 | + }, | ||
93 | +}; | ||
94 | + | ||
95 | +static void __init omap3beagle_ks8851_init(void) | ||
96 | +{ | ||
97 | + if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) && | ||
98 | + (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) { | ||
99 | + gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0); | ||
100 | + omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ); | ||
101 | + set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); | ||
102 | + } else { | ||
103 | + printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n"); | ||
104 | + return; | ||
105 | + } | ||
106 | + | ||
107 | + spi_register_board_info(omap3beagle_zippy2_spi_board_info, | ||
108 | + ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); | ||
109 | +} | ||
110 | + | ||
111 | +#else | ||
112 | +static inline void __init omap3beagle_ks8851_init(void) { return; } | ||
113 | +#endif | ||
114 | + | ||
115 | static struct mtd_partition omap3beagle_nand_partitions[] = { | ||
116 | /* All the partition sizes are listed in terms of NAND block size */ | ||
117 | { | ||
118 | @@ -262,6 +349,12 @@ static struct omap2_hsmmc_info mmc[] = { | ||
119 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
120 | .gpio_wp = 29, | ||
121 | }, | ||
122 | + { | ||
123 | + .mmc = 2, | ||
124 | + .caps = MMC_CAP_4_BIT_DATA, | ||
125 | + .transceiver = true, | ||
126 | + .ocr_mask = 0x00100000, /* 3.3V */ | ||
127 | + }, | ||
128 | {} /* Terminator */ | ||
129 | }; | ||
130 | |||
131 | @@ -457,7 +550,7 @@ static struct twl4030_platform_data beagle_twldata = { | ||
132 | .vpll2 = &beagle_vpll2, | ||
133 | }; | ||
134 | |||
135 | -static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { | ||
136 | +static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = { | ||
137 | { | ||
138 | I2C_BOARD_INFO("twl4030", 0x48), | ||
139 | .flags = I2C_CLIENT_WAKE, | ||
140 | @@ -472,10 +565,24 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | +#if defined(CONFIG_RTC_DRV_DS1307) || \ | ||
145 | + defined(CONFIG_RTC_DRV_DS1307_MODULE) | ||
146 | + | ||
147 | +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { | ||
148 | + { | ||
149 | + I2C_BOARD_INFO("ds1307", 0x68), | ||
150 | + }, | ||
151 | +}; | ||
152 | +#else | ||
153 | +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; | ||
154 | +#endif | ||
155 | + | ||
156 | static int __init omap3_beagle_i2c_init(void) | ||
157 | { | ||
158 | - omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, | ||
159 | - ARRAY_SIZE(beagle_i2c_boardinfo)); | ||
160 | + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, | ||
161 | + ARRAY_SIZE(beagle_i2c1_boardinfo)); | ||
162 | + omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, | ||
163 | + ARRAY_SIZE(beagle_i2c2_boardinfo)); | ||
164 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | ||
165 | * projector don't work reliably with 400kHz */ | ||
166 | omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); | ||
167 | @@ -609,6 +716,15 @@ static struct omap_musb_board_data musb_board_data = { | ||
168 | .power = 100, | ||
169 | }; | ||
170 | |||
171 | +static int __init expansionboard_setup(char *str) | ||
172 | +{ | ||
173 | + if (!str) | ||
174 | + return -EINVAL; | ||
175 | + strncpy(expansionboard_name, str, 16); | ||
176 | + printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name); | ||
177 | + return 0; | ||
178 | +} | ||
179 | + | ||
180 | static void __init omap3_beagle_init(void) | ||
181 | { | ||
182 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
183 | @@ -623,6 +739,24 @@ static void __init omap3_beagle_init(void) | ||
184 | /* REVISIT leave DVI powered down until it's needed ... */ | ||
185 | gpio_direction_output(170, true); | ||
186 | |||
187 | + if(!strcmp(expansionboard_name, "zippy")) | ||
188 | + { | ||
189 | + printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n"); | ||
190 | + omap3beagle_enc28j60_init(); | ||
191 | + printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); | ||
192 | + mmc[1].gpio_wp = 141; | ||
193 | + mmc[1].gpio_cd = 162; | ||
194 | + } | ||
195 | + | ||
196 | + if(!strcmp(expansionboard_name, "zippy2")) | ||
197 | + { | ||
198 | + printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n"); | ||
199 | + omap3beagle_ks8851_init(); | ||
200 | + printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); | ||
201 | + mmc[1].gpio_wp = 141; | ||
202 | + mmc[1].gpio_cd = 162; | ||
203 | + } | ||
204 | + | ||
205 | usb_musb_init(&musb_board_data); | ||
206 | usb_ehci_init(&ehci_pdata); | ||
207 | omap3beagle_flash_init(); | ||
208 | @@ -634,6 +768,8 @@ static void __init omap3_beagle_init(void) | ||
209 | beagle_display_init(); | ||
210 | } | ||
211 | |||
212 | +early_param("buddy", expansionboard_setup); | ||
213 | + | ||
214 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | ||
215 | /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ | ||
216 | .boot_params = 0x80000100, | ||
217 | -- | ||
218 | 1.6.6.1 | ||
219 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0006-ARM-OMAP-beagleboard-pre-export-GPIOs-to-userspace-w.patch b/extras/recipes-kernel/linux/linux-omap/base/0006-ARM-OMAP-beagleboard-pre-export-GPIOs-to-userspace-w.patch new file mode 100644 index 00000000..3c8547a1 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0006-ARM-OMAP-beagleboard-pre-export-GPIOs-to-userspace-w.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 0c2c9a4d7fd299444b66e08aa34acc868261003f Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Sun, 5 Dec 2010 13:25:00 +0100 | ||
4 | Subject: [PATCH 06/28] ARM: OMAP: beagleboard: pre-export GPIOs to userspace when using a Tincantools trainerboard | ||
5 | |||
6 | This really needs a for loop, patches welcome | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
9 | --- | ||
10 | arch/arm/mach-omap2/board-omap3beagle.c | 31 +++++++++++++++++++++++++++++++ | ||
11 | 1 files changed, 31 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | index d777b3b..64a181e 100644 | ||
15 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
16 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
17 | @@ -757,6 +757,37 @@ static void __init omap3_beagle_init(void) | ||
18 | mmc[1].gpio_cd = 162; | ||
19 | } | ||
20 | |||
21 | + if(!strcmp(expansionboard_name, "trainer")) | ||
22 | + { | ||
23 | + printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n"); | ||
24 | + gpio_request(130, "sysfs"); | ||
25 | + gpio_export(130, 1); | ||
26 | + gpio_request(131, "sysfs"); | ||
27 | + gpio_export(131, 1); | ||
28 | + gpio_request(132, "sysfs"); | ||
29 | + gpio_export(132, 1); | ||
30 | + gpio_request(133, "sysfs"); | ||
31 | + gpio_export(133, 1); | ||
32 | + gpio_request(134, "sysfs"); | ||
33 | + gpio_export(134, 1); | ||
34 | + gpio_request(135, "sysfs"); | ||
35 | + gpio_export(135, 1); | ||
36 | + gpio_request(136, "sysfs"); | ||
37 | + gpio_export(136, 1); | ||
38 | + gpio_request(137, "sysfs"); | ||
39 | + gpio_export(137, 1); | ||
40 | + gpio_request(138, "sysfs"); | ||
41 | + gpio_export(138, 1); | ||
42 | + gpio_request(139, "sysfs"); | ||
43 | + gpio_export(139, 1); | ||
44 | + gpio_request(140, "sysfs"); | ||
45 | + gpio_export(140, 1); | ||
46 | + gpio_request(141, "sysfs"); | ||
47 | + gpio_export(141, 1); | ||
48 | + gpio_request(162, "sysfs"); | ||
49 | + gpio_export(162, 1); | ||
50 | + } | ||
51 | + | ||
52 | usb_musb_init(&musb_board_data); | ||
53 | usb_ehci_init(&ehci_pdata); | ||
54 | omap3beagle_flash_init(); | ||
55 | -- | ||
56 | 1.6.6.1 | ||
57 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0007-modedb.c-add-proper-720p60-mode.patch b/extras/recipes-kernel/linux/linux-omap/base/0007-modedb.c-add-proper-720p60-mode.patch new file mode 100644 index 00000000..575ee6f5 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0007-modedb.c-add-proper-720p60-mode.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From ed12d865de851c5aed3ae7685337551b831bb045 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Mon, 8 Mar 2010 14:38:31 +0100 | ||
4 | Subject: [PATCH 07/28] modedb.c: add proper 720p60 mode | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
7 | --- | ||
8 | drivers/video/modedb.c | 4 ++++ | ||
9 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c | ||
12 | index de450c1..1cd8153 100644 | ||
13 | --- a/drivers/video/modedb.c | ||
14 | +++ b/drivers/video/modedb.c | ||
15 | @@ -46,6 +46,10 @@ static const struct fb_videomode modedb[] = { | ||
16 | NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, | ||
17 | 0, FB_VMODE_NONINTERLACED | ||
18 | }, { | ||
19 | + /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */ | ||
20 | + "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5, | ||
21 | + 0, FB_VMODE_NONINTERLACED | ||
22 | + }, { | ||
23 | /* 800x600 @ 56 Hz, 35.15 kHz hsync */ | ||
24 | NULL, 56, 800, 600, 27777, 128, 24, 22, 1, 72, 2, | ||
25 | 0, FB_VMODE_NONINTERLACED | ||
26 | -- | ||
27 | 1.6.6.1 | ||
28 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0008-mmc-don-t-display-single-block-read-console-messages.patch b/extras/recipes-kernel/linux/linux-omap/base/0008-mmc-don-t-display-single-block-read-console-messages.patch new file mode 100644 index 00000000..7e776412 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0008-mmc-don-t-display-single-block-read-console-messages.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 13235700be3729d183143bdb75ee58742372d6aa Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Mon, 4 Jan 2010 19:20:25 -0800 | ||
4 | Subject: [PATCH 08/28] mmc: don't display single block read console messages | ||
5 | |||
6 | mmc: don't display single block read console messages | ||
7 | --- | ||
8 | drivers/mmc/card/block.c | 4 ++-- | ||
9 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c | ||
12 | index 217f820..b0b68cc 100644 | ||
13 | --- a/drivers/mmc/card/block.c | ||
14 | +++ b/drivers/mmc/card/block.c | ||
15 | @@ -434,8 +434,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req) | ||
16 | if (brq.cmd.error || brq.data.error || brq.stop.error) { | ||
17 | if (brq.data.blocks > 1 && rq_data_dir(req) == READ) { | ||
18 | /* Redo read one sector at a time */ | ||
19 | - printk(KERN_WARNING "%s: retrying using single " | ||
20 | - "block read\n", req->rq_disk->disk_name); | ||
21 | + /* printk(KERN_WARNING "%s: retrying using single " | ||
22 | + "block read\n", req->rq_disk->disk_name); */ | ||
23 | disable_multi = 1; | ||
24 | continue; | ||
25 | } | ||
26 | -- | ||
27 | 1.6.6.1 | ||
28 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0009-MTD-silence-ecc-errors-on-mtdblock0.patch b/extras/recipes-kernel/linux/linux-omap/base/0009-MTD-silence-ecc-errors-on-mtdblock0.patch new file mode 100644 index 00000000..e665e23a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0009-MTD-silence-ecc-errors-on-mtdblock0.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From 8b0c56b910811acd23c15bed273b3dbd959ef96a Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Mon, 26 Apr 2010 11:17:26 -0700 | ||
4 | Subject: [PATCH 09/28] MTD: silence ecc errors on mtdblock0 | ||
5 | |||
6 | mtdblock0 is the x-load partition, which uses hw ecc | ||
7 | this confuses linux, which uses sw ecc | ||
8 | this patch silences ecc error messages when linux peeks into mtdblock0 | ||
9 | * not for upstream submission * | ||
10 | --- | ||
11 | block/blk-core.c | 7 ++++--- | ||
12 | drivers/mtd/nand/nand_ecc.c | 2 +- | ||
13 | fs/buffer.c | 3 ++- | ||
14 | 3 files changed, 7 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/block/blk-core.c b/block/blk-core.c | ||
17 | index 4ce953f..1ef9a01 100644 | ||
18 | --- a/block/blk-core.c | ||
19 | +++ b/block/blk-core.c | ||
20 | @@ -2028,9 +2028,10 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) | ||
21 | |||
22 | if (error && req->cmd_type == REQ_TYPE_FS && | ||
23 | !(req->cmd_flags & REQ_QUIET)) { | ||
24 | - printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n", | ||
25 | - req->rq_disk ? req->rq_disk->disk_name : "?", | ||
26 | - (unsigned long long)blk_rq_pos(req)); | ||
27 | + if (req->rq_disk && (strcmp(req->rq_disk->disk_name, "mtdblock0") != 0)) | ||
28 | + printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n", | ||
29 | + req->rq_disk ? req->rq_disk->disk_name : "?", | ||
30 | + (unsigned long long)blk_rq_pos(req)); | ||
31 | } | ||
32 | |||
33 | blk_account_io_completion(req, nr_bytes); | ||
34 | diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c | ||
35 | index 271b8e7..5924ba7 100644 | ||
36 | --- a/drivers/mtd/nand/nand_ecc.c | ||
37 | +++ b/drivers/mtd/nand/nand_ecc.c | ||
38 | @@ -507,7 +507,7 @@ int __nand_correct_data(unsigned char *buf, | ||
39 | if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1) | ||
40 | return 1; /* error in ecc data; no action needed */ | ||
41 | |||
42 | - printk(KERN_ERR "uncorrectable error : "); | ||
43 | +// printk(KERN_ERR "uncorrectable error : "); | ||
44 | return -1; | ||
45 | } | ||
46 | EXPORT_SYMBOL(__nand_correct_data); | ||
47 | diff --git a/fs/buffer.c b/fs/buffer.c | ||
48 | index 5930e38..06a00d5 100644 | ||
49 | --- a/fs/buffer.c | ||
50 | +++ b/fs/buffer.c | ||
51 | @@ -114,7 +114,8 @@ static int quiet_error(struct buffer_head *bh) | ||
52 | static void buffer_io_error(struct buffer_head *bh) | ||
53 | { | ||
54 | char b[BDEVNAME_SIZE]; | ||
55 | - printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n", | ||
56 | + if (strcmp(bdevname(bh->b_bdev, b), "mtdblock0") != 0) | ||
57 | + printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n", | ||
58 | bdevname(bh->b_bdev, b), | ||
59 | (unsigned long long)bh->b_blocknr); | ||
60 | } | ||
61 | -- | ||
62 | 1.6.6.1 | ||
63 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0010-Miracle-patch.patch b/extras/recipes-kernel/linux/linux-omap/base/0010-Miracle-patch.patch new file mode 100644 index 00000000..c5eba83d --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0010-Miracle-patch.patch | |||
@@ -0,0 +1,504 @@ | |||
1 | From ce4f1f734efd638af01f1849ffffdc2746ad4a55 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Galbraith <efault@gmx.de> | ||
3 | Date: Fri, 19 Nov 2010 12:52:42 +0100 | ||
4 | Subject: [PATCH 10/28] Miracle patch | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | On Sun, 2010-11-14 at 16:26 -0800, Linus Torvalds wrote: | ||
10 | > On Sun, Nov 14, 2010 at 4:15 PM, Linus Torvalds | ||
11 | > <torvalds@linux-foundation.org> wrote: | ||
12 | > > | ||
13 | > > THAT is why I think it's so silly to try to be so strict and walk over | ||
14 | > > all processes while holding a couple of spinlocks. | ||
15 | > | ||
16 | > Btw, let me say that I think the patch is great even with that thing | ||
17 | > in. It looks clean, the thing I'm complaining about is not a big deal, | ||
18 | > and it seems to perform very much as advertized. The difference with | ||
19 | > autogroup scheduling is very noticeable with a simple "make -j64" | ||
20 | > kernel compile. | ||
21 | > | ||
22 | > So I really don't think it's a big deal. The sysctl handler isn't even | ||
23 | > complicated. But boy does it hurt my eyes to see a spinlock held | ||
24 | > around a "do_each_thread()". And I do get the feeling that the | ||
25 | > simplest way to fix it would be to just remove the code entirely, and | ||
26 | > just say that "enabling/disabling may be delayed for old processes | ||
27 | > with existing autogroups". | ||
28 | |||
29 | Which is what I just did. If the oddball case isn't a big deal, the | ||
30 | patch shrinks, which is a good thing. I just wanted to cover all bases. | ||
31 | |||
32 | Patchlet with handler whacked: | ||
33 | |||
34 | A recurring complaint from CFS users is that parallel kbuild has a negative | ||
35 | impact on desktop interactivity. This patch implements an idea from Linus, | ||
36 | to automatically create task groups. This patch only implements Linus' per | ||
37 | tty task group suggestion, and only for fair class tasks, but leaves the way | ||
38 | open for enhancement. | ||
39 | |||
40 | Implementation: each task's signal struct contains an inherited pointer to a | ||
41 | refcounted autogroup struct containing a task group pointer, the default for | ||
42 | all tasks pointing to the init_task_group. When a task calls __proc_set_tty(), | ||
43 | the process wide reference to the default group is dropped, a new task group is | ||
44 | created, and the process is moved into the new task group. Children thereafter | ||
45 | inherit this task group, and increase it's refcount. On exit, a reference to the | ||
46 | current task group is dropped when the last reference to each signal struct is | ||
47 | dropped. The task group is destroyed when the last signal struct referencing | ||
48 | it is freed. At runqueue selection time, IFF a task has no cgroup assignment, | ||
49 | it's current autogroup is used. | ||
50 | |||
51 | The feature is enabled from boot by default if CONFIG_SCHED_AUTOGROUP is | ||
52 | selected, but can be disabled via the boot option noautogroup, and can be | ||
53 | also be turned on/off on the fly via.. | ||
54 | echo [01] > /proc/sys/kernel/sched_autogroup_enabled. | ||
55 | ..which will automatically move tasks to/from the root task group. | ||
56 | |||
57 | Some numbers. | ||
58 | |||
59 | A 100% hog overhead measurement proggy pinned to the same CPU as a make -j10 | ||
60 | |||
61 | About measurement proggy: | ||
62 | pert/sec = perturbations/sec | ||
63 | min/max/avg = scheduler service latencies in usecs | ||
64 | sum/s = time accrued by the competition per sample period (1 sec here) | ||
65 | overhead = %CPU received by the competition per sample period | ||
66 | |||
67 | pert/s: 31 >40475.37us: 3 min: 0.37 max:48103.60 avg:29573.74 sum/s:916786us overhead:90.24% | ||
68 | pert/s: 23 >41237.70us: 12 min: 0.36 max:56010.39 avg:40187.01 sum/s:924301us overhead:91.99% | ||
69 | pert/s: 24 >42150.22us: 12 min: 8.86 max:61265.91 avg:39459.91 sum/s:947038us overhead:92.20% | ||
70 | pert/s: 26 >42344.91us: 11 min: 3.83 max:52029.60 avg:36164.70 sum/s:940282us overhead:91.12% | ||
71 | pert/s: 24 >44262.90us: 14 min: 5.05 max:82735.15 avg:40314.33 sum/s:967544us overhead:92.22% | ||
72 | |||
73 | Same load with this patch applied. | ||
74 | |||
75 | pert/s: 229 >5484.43us: 41 min: 0.15 max:12069.42 avg:2193.81 sum/s:502382us overhead:50.24% | ||
76 | pert/s: 222 >5652.28us: 43 min: 0.46 max:12077.31 avg:2248.56 sum/s:499181us overhead:49.92% | ||
77 | pert/s: 211 >5809.38us: 43 min: 0.16 max:12064.78 avg:2381.70 sum/s:502538us overhead:50.25% | ||
78 | pert/s: 223 >6147.92us: 43 min: 0.15 max:16107.46 avg:2282.17 sum/s:508925us overhead:50.49% | ||
79 | pert/s: 218 >6252.64us: 43 min: 0.16 max:12066.13 avg:2324.11 sum/s:506656us overhead:50.27% | ||
80 | |||
81 | Average service latency is an order of magnitude better with autogroup. | ||
82 | (Imagine that pert were Xorg or whatnot instead) | ||
83 | |||
84 | Using Mathieu Desnoyers' wakeup-latency testcase: | ||
85 | |||
86 | With taskset -c 3 make -j 10 running.. | ||
87 | |||
88 | taskset -c 3 ./wakeup-latency& sleep 30;killall wakeup-latency | ||
89 | |||
90 | without: | ||
91 | maximum latency: 42963.2 µs | ||
92 | average latency: 9077.0 µs | ||
93 | missed timer events: 0 | ||
94 | |||
95 | with: | ||
96 | maximum latency: 4160.7 µs | ||
97 | average latency: 149.4 µs | ||
98 | missed timer events: 0 | ||
99 | |||
100 | Signed-off-by: Mike Galbraith <efault@gmx.de> | ||
101 | --- | ||
102 | Documentation/kernel-parameters.txt | 2 + | ||
103 | drivers/tty/tty_io.c | 1 + | ||
104 | include/linux/sched.h | 19 +++++ | ||
105 | init/Kconfig | 12 +++ | ||
106 | kernel/fork.c | 5 +- | ||
107 | kernel/sched.c | 25 ++++-- | ||
108 | kernel/sched_autogroup.c | 140 +++++++++++++++++++++++++++++++++++ | ||
109 | kernel/sched_autogroup.h | 18 +++++ | ||
110 | kernel/sysctl.c | 11 +++ | ||
111 | 9 files changed, 224 insertions(+), 9 deletions(-) | ||
112 | create mode 100644 kernel/sched_autogroup.c | ||
113 | create mode 100644 kernel/sched_autogroup.h | ||
114 | |||
115 | diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt | ||
116 | index 01ece1b..1031923 100644 | ||
117 | --- a/Documentation/kernel-parameters.txt | ||
118 | +++ b/Documentation/kernel-parameters.txt | ||
119 | @@ -1622,6 +1622,8 @@ and is between 256 and 4096 characters. It is defined in the file | ||
120 | noapic [SMP,APIC] Tells the kernel to not make use of any | ||
121 | IOAPICs that may be present in the system. | ||
122 | |||
123 | + noautogroup Disable scheduler automatic task group creation. | ||
124 | + | ||
125 | nobats [PPC] Do not use BATs for mapping kernel lowmem | ||
126 | on "Classic" PPC cores. | ||
127 | |||
128 | diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c | ||
129 | index 35480dd..1849f4a 100644 | ||
130 | --- a/drivers/tty/tty_io.c | ||
131 | +++ b/drivers/tty/tty_io.c | ||
132 | @@ -3169,6 +3169,7 @@ static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) | ||
133 | put_pid(tsk->signal->tty_old_pgrp); | ||
134 | tsk->signal->tty = tty_kref_get(tty); | ||
135 | tsk->signal->tty_old_pgrp = NULL; | ||
136 | + sched_autogroup_create_attach(tsk); | ||
137 | } | ||
138 | |||
139 | static void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) | ||
140 | diff --git a/include/linux/sched.h b/include/linux/sched.h | ||
141 | index 2238745..3a775e3 100644 | ||
142 | --- a/include/linux/sched.h | ||
143 | +++ b/include/linux/sched.h | ||
144 | @@ -509,6 +509,8 @@ struct thread_group_cputimer { | ||
145 | spinlock_t lock; | ||
146 | }; | ||
147 | |||
148 | +struct autogroup; | ||
149 | + | ||
150 | /* | ||
151 | * NOTE! "signal_struct" does not have it's own | ||
152 | * locking, because a shared signal_struct always | ||
153 | @@ -576,6 +578,9 @@ struct signal_struct { | ||
154 | |||
155 | struct tty_struct *tty; /* NULL if no tty */ | ||
156 | |||
157 | +#ifdef CONFIG_SCHED_AUTOGROUP | ||
158 | + struct autogroup *autogroup; | ||
159 | +#endif | ||
160 | /* | ||
161 | * Cumulative resource counters for dead threads in the group, | ||
162 | * and for reaped dead child processes forked by this group. | ||
163 | @@ -1931,6 +1936,20 @@ int sched_rt_handler(struct ctl_table *table, int write, | ||
164 | |||
165 | extern unsigned int sysctl_sched_compat_yield; | ||
166 | |||
167 | +#ifdef CONFIG_SCHED_AUTOGROUP | ||
168 | +extern unsigned int sysctl_sched_autogroup_enabled; | ||
169 | + | ||
170 | +extern void sched_autogroup_create_attach(struct task_struct *p); | ||
171 | +extern void sched_autogroup_detach(struct task_struct *p); | ||
172 | +extern void sched_autogroup_fork(struct signal_struct *sig); | ||
173 | +extern void sched_autogroup_exit(struct signal_struct *sig); | ||
174 | +#else | ||
175 | +static inline void sched_autogroup_create_attach(struct task_struct *p) { } | ||
176 | +static inline void sched_autogroup_detach(struct task_struct *p) { } | ||
177 | +static inline void sched_autogroup_fork(struct signal_struct *sig) { } | ||
178 | +static inline void sched_autogroup_exit(struct signal_struct *sig) { } | ||
179 | +#endif | ||
180 | + | ||
181 | #ifdef CONFIG_RT_MUTEXES | ||
182 | extern int rt_mutex_getprio(struct task_struct *p); | ||
183 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | ||
184 | diff --git a/init/Kconfig b/init/Kconfig | ||
185 | index c972899..a4985d9 100644 | ||
186 | --- a/init/Kconfig | ||
187 | +++ b/init/Kconfig | ||
188 | @@ -741,6 +741,18 @@ config NET_NS | ||
189 | |||
190 | endif # NAMESPACES | ||
191 | |||
192 | +config SCHED_AUTOGROUP | ||
193 | + bool "Automatic process group scheduling" | ||
194 | + select CGROUPS | ||
195 | + select CGROUP_SCHED | ||
196 | + select FAIR_GROUP_SCHED | ||
197 | + help | ||
198 | + This option optimizes the scheduler for common desktop workloads by | ||
199 | + automatically creating and populating task groups. This separation | ||
200 | + of workloads isolates aggressive CPU burners (like build jobs) from | ||
201 | + desktop applications. Task group autogeneration is currently based | ||
202 | + upon task tty association. | ||
203 | + | ||
204 | config MM_OWNER | ||
205 | bool | ||
206 | |||
207 | diff --git a/kernel/fork.c b/kernel/fork.c | ||
208 | index 5447dc7..70ea75f 100644 | ||
209 | --- a/kernel/fork.c | ||
210 | +++ b/kernel/fork.c | ||
211 | @@ -174,8 +174,10 @@ static inline void free_signal_struct(struct signal_struct *sig) | ||
212 | |||
213 | static inline void put_signal_struct(struct signal_struct *sig) | ||
214 | { | ||
215 | - if (atomic_dec_and_test(&sig->sigcnt)) | ||
216 | + if (atomic_dec_and_test(&sig->sigcnt)) { | ||
217 | + sched_autogroup_exit(sig); | ||
218 | free_signal_struct(sig); | ||
219 | + } | ||
220 | } | ||
221 | |||
222 | void __put_task_struct(struct task_struct *tsk) | ||
223 | @@ -905,6 +907,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | ||
224 | posix_cpu_timers_init_group(sig); | ||
225 | |||
226 | tty_audit_fork(sig); | ||
227 | + sched_autogroup_fork(sig); | ||
228 | |||
229 | sig->oom_adj = current->signal->oom_adj; | ||
230 | sig->oom_score_adj = current->signal->oom_score_adj; | ||
231 | diff --git a/kernel/sched.c b/kernel/sched.c | ||
232 | index 297d1a0..53ff9a1 100644 | ||
233 | --- a/kernel/sched.c | ||
234 | +++ b/kernel/sched.c | ||
235 | @@ -78,6 +78,7 @@ | ||
236 | |||
237 | #include "sched_cpupri.h" | ||
238 | #include "workqueue_sched.h" | ||
239 | +#include "sched_autogroup.h" | ||
240 | |||
241 | #define CREATE_TRACE_POINTS | ||
242 | #include <trace/events/sched.h> | ||
243 | @@ -605,11 +606,14 @@ static inline int cpu_of(struct rq *rq) | ||
244 | */ | ||
245 | static inline struct task_group *task_group(struct task_struct *p) | ||
246 | { | ||
247 | + struct task_group *tg; | ||
248 | struct cgroup_subsys_state *css; | ||
249 | |||
250 | css = task_subsys_state_check(p, cpu_cgroup_subsys_id, | ||
251 | lockdep_is_held(&task_rq(p)->lock)); | ||
252 | - return container_of(css, struct task_group, css); | ||
253 | + tg = container_of(css, struct task_group, css); | ||
254 | + | ||
255 | + return autogroup_task_group(p, tg); | ||
256 | } | ||
257 | |||
258 | /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */ | ||
259 | @@ -2063,6 +2067,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta) | ||
260 | #include "sched_idletask.c" | ||
261 | #include "sched_fair.c" | ||
262 | #include "sched_rt.c" | ||
263 | +#include "sched_autogroup.c" | ||
264 | #include "sched_stoptask.c" | ||
265 | #ifdef CONFIG_SCHED_DEBUG | ||
266 | # include "sched_debug.c" | ||
267 | @@ -8164,7 +8169,7 @@ void __init sched_init(void) | ||
268 | #ifdef CONFIG_CGROUP_SCHED | ||
269 | list_add(&init_task_group.list, &task_groups); | ||
270 | INIT_LIST_HEAD(&init_task_group.children); | ||
271 | - | ||
272 | + autogroup_init(&init_task); | ||
273 | #endif /* CONFIG_CGROUP_SCHED */ | ||
274 | |||
275 | #if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP | ||
276 | @@ -8694,15 +8699,11 @@ void sched_destroy_group(struct task_group *tg) | ||
277 | /* change task's runqueue when it moves between groups. | ||
278 | * The caller of this function should have put the task in its new group | ||
279 | * by now. This function just updates tsk->se.cfs_rq and tsk->se.parent to | ||
280 | - * reflect its new group. | ||
281 | + * reflect its new group. Called with the runqueue lock held. | ||
282 | */ | ||
283 | -void sched_move_task(struct task_struct *tsk) | ||
284 | +void __sched_move_task(struct task_struct *tsk, struct rq *rq) | ||
285 | { | ||
286 | int on_rq, running; | ||
287 | - unsigned long flags; | ||
288 | - struct rq *rq; | ||
289 | - | ||
290 | - rq = task_rq_lock(tsk, &flags); | ||
291 | |||
292 | running = task_current(rq, tsk); | ||
293 | on_rq = tsk->se.on_rq; | ||
294 | @@ -8723,7 +8724,15 @@ void sched_move_task(struct task_struct *tsk) | ||
295 | tsk->sched_class->set_curr_task(rq); | ||
296 | if (on_rq) | ||
297 | enqueue_task(rq, tsk, 0); | ||
298 | +} | ||
299 | |||
300 | +void sched_move_task(struct task_struct *tsk) | ||
301 | +{ | ||
302 | + struct rq *rq; | ||
303 | + unsigned long flags; | ||
304 | + | ||
305 | + rq = task_rq_lock(tsk, &flags); | ||
306 | + __sched_move_task(tsk, rq); | ||
307 | task_rq_unlock(rq, &flags); | ||
308 | } | ||
309 | #endif /* CONFIG_CGROUP_SCHED */ | ||
310 | diff --git a/kernel/sched_autogroup.c b/kernel/sched_autogroup.c | ||
311 | new file mode 100644 | ||
312 | index 0000000..62f1d0e | ||
313 | --- /dev/null | ||
314 | +++ b/kernel/sched_autogroup.c | ||
315 | @@ -0,0 +1,140 @@ | ||
316 | +#ifdef CONFIG_SCHED_AUTOGROUP | ||
317 | + | ||
318 | +unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1; | ||
319 | + | ||
320 | +struct autogroup { | ||
321 | + struct kref kref; | ||
322 | + struct task_group *tg; | ||
323 | +}; | ||
324 | + | ||
325 | +static struct autogroup autogroup_default; | ||
326 | + | ||
327 | +static void autogroup_init(struct task_struct *init_task) | ||
328 | +{ | ||
329 | + autogroup_default.tg = &init_task_group; | ||
330 | + kref_init(&autogroup_default.kref); | ||
331 | + init_task->signal->autogroup = &autogroup_default; | ||
332 | +} | ||
333 | + | ||
334 | +static inline void autogroup_destroy(struct kref *kref) | ||
335 | +{ | ||
336 | + struct autogroup *ag = container_of(kref, struct autogroup, kref); | ||
337 | + struct task_group *tg = ag->tg; | ||
338 | + | ||
339 | + kfree(ag); | ||
340 | + sched_destroy_group(tg); | ||
341 | +} | ||
342 | + | ||
343 | +static inline void autogroup_kref_put(struct autogroup *ag) | ||
344 | +{ | ||
345 | + kref_put(&ag->kref, autogroup_destroy); | ||
346 | +} | ||
347 | + | ||
348 | +static inline struct autogroup *autogroup_kref_get(struct autogroup *ag) | ||
349 | +{ | ||
350 | + kref_get(&ag->kref); | ||
351 | + return ag; | ||
352 | +} | ||
353 | + | ||
354 | +static inline struct autogroup *autogroup_create(void) | ||
355 | +{ | ||
356 | + struct autogroup *ag = kmalloc(sizeof(*ag), GFP_KERNEL); | ||
357 | + | ||
358 | + if (!ag) | ||
359 | + goto out_fail; | ||
360 | + | ||
361 | + ag->tg = sched_create_group(&init_task_group); | ||
362 | + kref_init(&ag->kref); | ||
363 | + | ||
364 | + if (!(IS_ERR(ag->tg))) | ||
365 | + return ag; | ||
366 | + | ||
367 | +out_fail: | ||
368 | + if (ag) { | ||
369 | + kfree(ag); | ||
370 | + WARN_ON(1); | ||
371 | + } else | ||
372 | + WARN_ON(1); | ||
373 | + | ||
374 | + return autogroup_kref_get(&autogroup_default); | ||
375 | +} | ||
376 | + | ||
377 | +static inline struct task_group * | ||
378 | +autogroup_task_group(struct task_struct *p, struct task_group *tg) | ||
379 | +{ | ||
380 | + int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled); | ||
381 | + | ||
382 | + enabled &= (tg == &root_task_group); | ||
383 | + enabled &= (p->sched_class == &fair_sched_class); | ||
384 | + enabled &= (!(p->flags & PF_EXITING)); | ||
385 | + | ||
386 | + if (enabled) | ||
387 | + return p->signal->autogroup->tg; | ||
388 | + | ||
389 | + return tg; | ||
390 | +} | ||
391 | + | ||
392 | +static void | ||
393 | +autogroup_move_group(struct task_struct *p, struct autogroup *ag) | ||
394 | +{ | ||
395 | + struct autogroup *prev; | ||
396 | + struct task_struct *t; | ||
397 | + struct rq *rq; | ||
398 | + unsigned long flags; | ||
399 | + | ||
400 | + rq = task_rq_lock(p, &flags); | ||
401 | + prev = p->signal->autogroup; | ||
402 | + if (prev == ag) { | ||
403 | + task_rq_unlock(rq, &flags); | ||
404 | + return; | ||
405 | + } | ||
406 | + | ||
407 | + p->signal->autogroup = autogroup_kref_get(ag); | ||
408 | + __sched_move_task(p, rq); | ||
409 | + task_rq_unlock(rq, &flags); | ||
410 | + | ||
411 | + rcu_read_lock(); | ||
412 | + list_for_each_entry_rcu(t, &p->thread_group, thread_group) { | ||
413 | + sched_move_task(t); | ||
414 | + } | ||
415 | + rcu_read_unlock(); | ||
416 | + | ||
417 | + autogroup_kref_put(prev); | ||
418 | +} | ||
419 | + | ||
420 | +void sched_autogroup_create_attach(struct task_struct *p) | ||
421 | +{ | ||
422 | + struct autogroup *ag = autogroup_create(); | ||
423 | + | ||
424 | + autogroup_move_group(p, ag); | ||
425 | + /* drop extra refrence added by autogroup_create() */ | ||
426 | + autogroup_kref_put(ag); | ||
427 | +} | ||
428 | +EXPORT_SYMBOL(sched_autogroup_create_attach); | ||
429 | + | ||
430 | +/* currently has no users */ | ||
431 | +void sched_autogroup_detach(struct task_struct *p) | ||
432 | +{ | ||
433 | + autogroup_move_group(p, &autogroup_default); | ||
434 | +} | ||
435 | +EXPORT_SYMBOL(sched_autogroup_detach); | ||
436 | + | ||
437 | +void sched_autogroup_fork(struct signal_struct *sig) | ||
438 | +{ | ||
439 | + sig->autogroup = autogroup_kref_get(current->signal->autogroup); | ||
440 | +} | ||
441 | + | ||
442 | +void sched_autogroup_exit(struct signal_struct *sig) | ||
443 | +{ | ||
444 | + autogroup_kref_put(sig->autogroup); | ||
445 | +} | ||
446 | + | ||
447 | +static int __init setup_autogroup(char *str) | ||
448 | +{ | ||
449 | + sysctl_sched_autogroup_enabled = 0; | ||
450 | + | ||
451 | + return 1; | ||
452 | +} | ||
453 | + | ||
454 | +__setup("noautogroup", setup_autogroup); | ||
455 | +#endif | ||
456 | diff --git a/kernel/sched_autogroup.h b/kernel/sched_autogroup.h | ||
457 | new file mode 100644 | ||
458 | index 0000000..6048f5d | ||
459 | --- /dev/null | ||
460 | +++ b/kernel/sched_autogroup.h | ||
461 | @@ -0,0 +1,18 @@ | ||
462 | +#ifdef CONFIG_SCHED_AUTOGROUP | ||
463 | + | ||
464 | +static void __sched_move_task(struct task_struct *tsk, struct rq *rq); | ||
465 | + | ||
466 | +static inline struct task_group * | ||
467 | +autogroup_task_group(struct task_struct *p, struct task_group *tg); | ||
468 | + | ||
469 | +#else /* !CONFIG_SCHED_AUTOGROUP */ | ||
470 | + | ||
471 | +static inline void autogroup_init(struct task_struct *init_task) { } | ||
472 | + | ||
473 | +static inline struct task_group * | ||
474 | +autogroup_task_group(struct task_struct *p, struct task_group *tg) | ||
475 | +{ | ||
476 | + return tg; | ||
477 | +} | ||
478 | + | ||
479 | +#endif /* CONFIG_SCHED_AUTOGROUP */ | ||
480 | diff --git a/kernel/sysctl.c b/kernel/sysctl.c | ||
481 | index 5abfa15..b162f65 100644 | ||
482 | --- a/kernel/sysctl.c | ||
483 | +++ b/kernel/sysctl.c | ||
484 | @@ -382,6 +382,17 @@ static struct ctl_table kern_table[] = { | ||
485 | .mode = 0644, | ||
486 | .proc_handler = proc_dointvec, | ||
487 | }, | ||
488 | +#ifdef CONFIG_SCHED_AUTOGROUP | ||
489 | + { | ||
490 | + .procname = "sched_autogroup_enabled", | ||
491 | + .data = &sysctl_sched_autogroup_enabled, | ||
492 | + .maxlen = sizeof(unsigned int), | ||
493 | + .mode = 0644, | ||
494 | + .proc_handler = proc_dointvec, | ||
495 | + .extra1 = &zero, | ||
496 | + .extra2 = &one, | ||
497 | + }, | ||
498 | +#endif | ||
499 | #ifdef CONFIG_PROVE_LOCKING | ||
500 | { | ||
501 | .procname = "prove_locking", | ||
502 | -- | ||
503 | 1.6.6.1 | ||
504 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0011-ARM-OMAP-add-omap_rev_-macros.patch b/extras/recipes-kernel/linux/linux-omap/base/0011-ARM-OMAP-add-omap_rev_-macros.patch new file mode 100644 index 00000000..b89302bc --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0011-ARM-OMAP-add-omap_rev_-macros.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From 8b34449d7eb89e1ae1c1c84f90ef5ea1e397787e Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Tue, 23 Nov 2010 11:40:20 +0100 | ||
4 | Subject: [PATCH 11/28] ARM: OMAP: add omap_rev_* macros | ||
5 | |||
6 | This is just to make the SGX modules build that depend on omap_rev_lt_3_0 | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
9 | --- | ||
10 | arch/arm/plat-omap/include/plat/cpu.h | 55 +++++++++++++++++++++++++++++++++ | ||
11 | 1 files changed, 55 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h | ||
14 | index 3fd8b40..1a8c347 100644 | ||
15 | --- a/arch/arm/plat-omap/include/plat/cpu.h | ||
16 | +++ b/arch/arm/plat-omap/include/plat/cpu.h | ||
17 | @@ -394,6 +394,61 @@ IS_OMAP_TYPE(3517, 0x3517) | ||
18 | #define OMAP4430_REV_ES2_0 0x44301044 | ||
19 | |||
20 | /* | ||
21 | + * Silicon revisions | ||
22 | + */ | ||
23 | +#define OMAP_ES_1_0 0x00 | ||
24 | +#define OMAP_ES_2_0 0x10 | ||
25 | +#define OMAP_ES_2_1 0x20 | ||
26 | +#define OMAP_ES_3_0 0x30 | ||
27 | +#define OMAP_ES_3_1 0x40 | ||
28 | + | ||
29 | +#define OMAP_REV_MASK 0x0000ff00 | ||
30 | +#define OMAP_REV_BITS ((omap_rev() & OMAP_REV_MASK) >> 8) | ||
31 | + | ||
32 | +#define OMAP_REV_IS(revid) \ | ||
33 | +static inline u8 omap_rev_is_ ##revid (void) \ | ||
34 | +{ \ | ||
35 | + return (OMAP_REV_BITS == OMAP_ES_ ##revid) ? 1 : 0; \ | ||
36 | +} | ||
37 | + | ||
38 | +#define OMAP_REV_LT(revid) \ | ||
39 | +static inline u8 omap_rev_lt_ ##revid (void) \ | ||
40 | +{ \ | ||
41 | + return (OMAP_REV_BITS < OMAP_ES_ ##revid) ? 1 : 0; \ | ||
42 | +} | ||
43 | + | ||
44 | +#define OMAP_REV_LE(revid) \ | ||
45 | +static inline u8 omap_rev_le_ ##revid (void) \ | ||
46 | +{ \ | ||
47 | + return (OMAP_REV_BITS <= OMAP_ES_ ##revid) ? 1 : 0; \ | ||
48 | +} | ||
49 | + | ||
50 | +#define OMAP_REV_GT(revid) \ | ||
51 | +static inline u8 omap_rev_gt_ ##revid (void) \ | ||
52 | +{ \ | ||
53 | + return (OMAP_REV_BITS > OMAP_ES_ ##revid) ? 1 : 0; \ | ||
54 | +} | ||
55 | + | ||
56 | +#define OMAP_REV_GE(revid) \ | ||
57 | +static inline u8 omap_rev_ge_ ##revid (void) \ | ||
58 | +{ \ | ||
59 | + return (OMAP_REV_BITS >= OMAP_ES_ ##revid) ? 1 : 0; \ | ||
60 | +} | ||
61 | + | ||
62 | +#define OMAP_REV_FUNCTIONS(revid) \ | ||
63 | + OMAP_REV_IS(revid) \ | ||
64 | + OMAP_REV_LT(revid) \ | ||
65 | + OMAP_REV_LE(revid) \ | ||
66 | + OMAP_REV_GT(revid) \ | ||
67 | + OMAP_REV_GE(revid) | ||
68 | + | ||
69 | +OMAP_REV_FUNCTIONS(1_0) | ||
70 | +OMAP_REV_FUNCTIONS(2_0) | ||
71 | +OMAP_REV_FUNCTIONS(2_1) | ||
72 | +OMAP_REV_FUNCTIONS(3_0) | ||
73 | +OMAP_REV_FUNCTIONS(3_1) | ||
74 | + | ||
75 | +/* | ||
76 | * omap_chip bits | ||
77 | * | ||
78 | * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is | ||
79 | -- | ||
80 | 1.6.6.1 | ||
81 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0012-OMAP-DSS2-enable-hsclk-in-dsi_pll_init-for-OMAP36XX.patch b/extras/recipes-kernel/linux/linux-omap/base/0012-OMAP-DSS2-enable-hsclk-in-dsi_pll_init-for-OMAP36XX.patch new file mode 100644 index 00000000..7413b5f8 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0012-OMAP-DSS2-enable-hsclk-in-dsi_pll_init-for-OMAP36XX.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From cd8a01e55dc674bba0030b99bff4f58d587aaecd Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Mon, 10 May 2010 20:44:09 -0700 | ||
4 | Subject: [PATCH 12/28] OMAP: DSS2: enable hsclk in dsi_pll_init for OMAP36XX | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
7 | --- | ||
8 | drivers/video/omap2/dss/dpi.c | 7 ++++++- | ||
9 | 1 files changed, 6 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c | ||
12 | index 960e977..23047b6 100644 | ||
13 | --- a/drivers/video/omap2/dss/dpi.c | ||
14 | +++ b/drivers/video/omap2/dss/dpi.c | ||
15 | @@ -177,7 +177,12 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) | ||
16 | |||
17 | #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL | ||
18 | dss_clk_enable(DSS_CLK_FCK2); | ||
19 | - r = dsi_pll_init(dssdev, 0, 1); | ||
20 | + | ||
21 | + if (cpu_is_omap3630()) | ||
22 | + r = dsi_pll_init(dssdev, 1, 1); | ||
23 | + else | ||
24 | + r = dsi_pll_init(dssdev, 0, 1); | ||
25 | + | ||
26 | if (r) | ||
27 | goto err3; | ||
28 | #endif | ||
29 | -- | ||
30 | 1.6.6.1 | ||
31 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0013-omap3-beagleboard-add-WIP-support-for-beagleboardtoy.patch b/extras/recipes-kernel/linux/linux-omap/base/0013-omap3-beagleboard-add-WIP-support-for-beagleboardtoy.patch new file mode 100644 index 00000000..af12b2c9 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0013-omap3-beagleboard-add-WIP-support-for-beagleboardtoy.patch | |||
@@ -0,0 +1,128 @@ | |||
1 | From f7d71be36165002251727019b1a03a19938bfa64 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@beagleboard.org> | ||
3 | Date: Mon, 20 Dec 2010 11:57:56 +0100 | ||
4 | Subject: [PATCH 13/28] omap3: beagleboard: add WIP support for beagleboardtoys WL12xx board | ||
5 | |||
6 | Based on a patch by Luciano Coelho <luciano.coelho@nokia.com> | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@beagleboard.org> | ||
9 | --- | ||
10 | arch/arm/mach-omap2/board-omap3beagle.c | 84 ++++++++++++++++++++++++++++++- | ||
11 | 1 files changed, 83 insertions(+), 1 deletions(-) | ||
12 | |||
13 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | index 64a181e..59b26da 100644 | ||
15 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
16 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
17 | @@ -146,6 +146,67 @@ fail0: | ||
18 | |||
19 | char expansionboard_name[16]; | ||
20 | |||
21 | +#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE) | ||
22 | +#include <linux/regulator/fixed.h> | ||
23 | +#include <linux/wl12xx.h> | ||
24 | + | ||
25 | +#define OMAP_BEAGLE_WLAN_EN_GPIO (139) | ||
26 | +#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137) | ||
27 | + | ||
28 | +struct wl12xx_platform_data omap_beagle_wlan_data __initdata = { | ||
29 | + .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO), | ||
30 | + .board_ref_clock = 2, /* 38.4 MHz */ | ||
31 | +}; | ||
32 | + | ||
33 | + static struct omap2_hsmmc_info mmcbbt[] = { | ||
34 | + { | ||
35 | + .mmc = 1, | ||
36 | + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
37 | + .gpio_wp = 29, | ||
38 | + }, | ||
39 | + { | ||
40 | + .name = "wl1271", | ||
41 | + .mmc = 2, | ||
42 | + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
43 | + .gpio_wp = -EINVAL, | ||
44 | + .gpio_cd = -EINVAL, | ||
45 | + .nonremovable = true, | ||
46 | + }, | ||
47 | + {} /* Terminator */ | ||
48 | + }; | ||
49 | + | ||
50 | +static struct regulator_consumer_supply beagle_vmmc2_supply = { | ||
51 | + .supply = "vmmc", | ||
52 | + .dev_name = "mmci-omap-hs.1", | ||
53 | +}; | ||
54 | + | ||
55 | +static struct regulator_init_data beagle_vmmc2 = { | ||
56 | + .constraints = { | ||
57 | + .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
58 | + }, | ||
59 | + .num_consumer_supplies = 1, | ||
60 | + .consumer_supplies = &beagle_vmmc2_supply, | ||
61 | +}; | ||
62 | + | ||
63 | +static struct fixed_voltage_config beagle_vwlan = { | ||
64 | + .supply_name = "vwl1271", | ||
65 | + .microvolts = 1800000, /* 1.8V */ | ||
66 | + .gpio = OMAP_BEAGLE_WLAN_EN_GPIO, | ||
67 | + .startup_delay = 70000, /* 70ms */ | ||
68 | + .enable_high = 1, | ||
69 | + .enabled_at_boot = 0, | ||
70 | + .init_data = &beagle_vmmc2, | ||
71 | +}; | ||
72 | + | ||
73 | +static struct platform_device omap_vwlan_device = { | ||
74 | + .name = "reg-fixed-voltage", | ||
75 | + .id = 1, | ||
76 | + .dev = { | ||
77 | + .platform_data = &beagle_vwlan, | ||
78 | + }, | ||
79 | +}; | ||
80 | +#endif | ||
81 | + | ||
82 | #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) | ||
83 | |||
84 | #include <plat/mcspi.h> | ||
85 | @@ -384,11 +445,24 @@ static int beagle_twl_gpio_setup(struct device *dev, | ||
86 | } | ||
87 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | ||
88 | mmc[0].gpio_cd = gpio + 0; | ||
89 | +#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE) | ||
90 | + if(!strcmp(expansionboard_name, "bbtoys-wifi")) { | ||
91 | + omap2_hsmmc_init(mmcbbt); | ||
92 | + /* link regulators to MMC adapters */ | ||
93 | + beagle_vmmc1_supply.dev = mmcbbt[0].dev; | ||
94 | + beagle_vsim_supply.dev = mmcbbt[0].dev; | ||
95 | + } else { | ||
96 | + omap2_hsmmc_init(mmc); | ||
97 | + /* link regulators to MMC adapters */ | ||
98 | + beagle_vmmc1_supply.dev = mmc[0].dev; | ||
99 | + beagle_vsim_supply.dev = mmc[0].dev; | ||
100 | + } | ||
101 | +#else | ||
102 | omap2_hsmmc_init(mmc); | ||
103 | - | ||
104 | /* link regulators to MMC adapters */ | ||
105 | beagle_vmmc1_supply.dev = mmc[0].dev; | ||
106 | beagle_vsim_supply.dev = mmc[0].dev; | ||
107 | +#endif | ||
108 | |||
109 | /* REVISIT: need ehci-omap hooks for external VBUS | ||
110 | * power switch and overcurrent detect | ||
111 | @@ -788,6 +862,14 @@ static void __init omap3_beagle_init(void) | ||
112 | gpio_export(162, 1); | ||
113 | } | ||
114 | |||
115 | + if(!strcmp(expansionboard_name, "bbtoys-wifi")) | ||
116 | + { | ||
117 | + if (wl12xx_set_platform_data(&omap_beagle_wlan_data)) | ||
118 | + pr_err("error setting wl12xx data\n"); | ||
119 | + printk(KERN_INFO "Beagle expansionboard: registering wl12xx platform device\n"); | ||
120 | + platform_device_register(&omap_vwlan_device); | ||
121 | + } | ||
122 | + | ||
123 | usb_musb_init(&musb_board_data); | ||
124 | usb_ehci_init(&ehci_pdata); | ||
125 | omap3beagle_flash_init(); | ||
126 | -- | ||
127 | 1.6.6.1 | ||
128 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0014-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch b/extras/recipes-kernel/linux/linux-omap/base/0014-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch new file mode 100644 index 00000000..2eac323b --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0014-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From a47bbc5c9742e4ce250ee3bfba62732f3fea40b7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <sakoman@gmail.com> | ||
3 | Date: Tue, 15 Dec 2009 15:17:44 -0800 | ||
4 | Subject: [PATCH 14/28] drivers: net: smsc911x: return ENODEV if device is not found | ||
5 | |||
6 | Signed-off-by: Steve Sakoman <sakoman@gmail.com> | ||
7 | --- | ||
8 | drivers/net/smsc911x.c | 4 +++- | ||
9 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c | ||
12 | index 64bfdae..ba2a00e 100644 | ||
13 | --- a/drivers/net/smsc911x.c | ||
14 | +++ b/drivers/net/smsc911x.c | ||
15 | @@ -2019,8 +2019,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | ||
16 | } | ||
17 | |||
18 | retval = smsc911x_init(dev); | ||
19 | - if (retval < 0) | ||
20 | + if (retval < 0) { | ||
21 | + retval = -ENODEV; | ||
22 | goto out_unmap_io_3; | ||
23 | + } | ||
24 | |||
25 | /* configure irq polarity and type before connecting isr */ | ||
26 | if (pdata->config.irq_polarity == SMSC911X_IRQ_POLARITY_ACTIVE_HIGH) | ||
27 | -- | ||
28 | 1.6.6.1 | ||
29 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0015-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/extras/recipes-kernel/linux/linux-omap/base/0015-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch new file mode 100644 index 00000000..74691ab8 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0015-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 713eb96dd137e1436198aa07094049ae0e0f9f1f Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <sakoman@gmail.com> | ||
3 | Date: Tue, 15 Dec 2009 15:24:10 -0800 | ||
4 | Subject: [PATCH 15/28] drivers: input: touchscreen: ads7846: return ENODEV if device is not found | ||
5 | |||
6 | Signed-off-by: Steve Sakoman <sakoman@gmail.com> | ||
7 | --- | ||
8 | drivers/input/touchscreen/ads7846.c | 13 ++++++++++--- | ||
9 | 1 files changed, 10 insertions(+), 3 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c | ||
12 | index 14ea54b..c775e38 100644 | ||
13 | --- a/drivers/input/touchscreen/ads7846.c | ||
14 | +++ b/drivers/input/touchscreen/ads7846.c | ||
15 | @@ -1325,11 +1325,18 @@ static int __devinit ads7846_probe(struct spi_device *spi) | ||
16 | * the touchscreen, in case it's not connected. | ||
17 | */ | ||
18 | if (ts->model == 7845) | ||
19 | - ads7845_read12_ser(&spi->dev, PWRDOWN); | ||
20 | + err = ads7845_read12_ser(&spi->dev, PWRDOWN); | ||
21 | else | ||
22 | - (void) ads7846_read12_ser(&spi->dev, | ||
23 | + err = ads7846_read12_ser(&spi->dev, | ||
24 | READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON); | ||
25 | |||
26 | + /* if sample is all 0's or all 1's then there is no device on spi */ | ||
27 | + if ( (err == 0x000) || (err == 0xfff)) { | ||
28 | + dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err); | ||
29 | + err = -ENODEV; | ||
30 | + goto err_free_irq; | ||
31 | + } | ||
32 | + | ||
33 | err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); | ||
34 | if (err) | ||
35 | goto err_remove_hwmon; | ||
36 | @@ -1353,7 +1360,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | ||
37 | err_put_regulator: | ||
38 | regulator_put(ts->reg); | ||
39 | err_free_gpio: | ||
40 | - if (ts->gpio_pendown != -1) | ||
41 | + if (!ts->get_pendown_state && ts->gpio_pendown != -1) | ||
42 | gpio_free(ts->gpio_pendown); | ||
43 | err_cleanup_filter: | ||
44 | if (ts->filter_cleanup) | ||
45 | -- | ||
46 | 1.6.6.1 | ||
47 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0016-ASoC-enable-audio-capture-by-default-for-twl4030.patch b/extras/recipes-kernel/linux/linux-omap/base/0016-ASoC-enable-audio-capture-by-default-for-twl4030.patch new file mode 100644 index 00000000..081aa5b9 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0016-ASoC-enable-audio-capture-by-default-for-twl4030.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From de63bf4fdf6c64e543c207792cb2d8ebcd089342 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 17 Dec 2009 12:45:20 -0800 | ||
4 | Subject: [PATCH 16/28] ASoC: enable audio capture by default for twl4030 | ||
5 | |||
6 | --- | ||
7 | sound/soc/codecs/twl4030.c | 4 ++-- | ||
8 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c | ||
11 | index cbebec6..430cd10 100644 | ||
12 | --- a/sound/soc/codecs/twl4030.c | ||
13 | +++ b/sound/soc/codecs/twl4030.c | ||
14 | @@ -56,8 +56,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = { | ||
15 | 0x00, /* REG_OPTION (0x2) */ | ||
16 | 0x00, /* REG_UNKNOWN (0x3) */ | ||
17 | 0x00, /* REG_MICBIAS_CTL (0x4) */ | ||
18 | - 0x00, /* REG_ANAMICL (0x5) */ | ||
19 | - 0x00, /* REG_ANAMICR (0x6) */ | ||
20 | + 0x34, /* REG_ANAMICL (0x5) */ | ||
21 | + 0x14, /* REG_ANAMICR (0x6) */ | ||
22 | 0x00, /* REG_AVADC_CTL (0x7) */ | ||
23 | 0x00, /* REG_ADCMICSEL (0x8) */ | ||
24 | 0x00, /* REG_DIGMIXING (0x9) */ | ||
25 | -- | ||
26 | 1.6.6.1 | ||
27 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0017-MFD-enable-madc-clock.patch b/extras/recipes-kernel/linux/linux-omap/base/0017-MFD-enable-madc-clock.patch new file mode 100644 index 00000000..2f3d1a43 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0017-MFD-enable-madc-clock.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 18934b05f81025c1254d64c1774832e95187cbd9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Sat, 23 Jan 2010 06:26:54 -0800 | ||
4 | Subject: [PATCH 17/28] MFD: enable madc clock | ||
5 | |||
6 | --- | ||
7 | drivers/mfd/twl-core.c | 8 ++++++++ | ||
8 | include/linux/i2c/twl.h | 1 + | ||
9 | 2 files changed, 9 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c | ||
12 | index 35275ba..5aa7358 100644 | ||
13 | --- a/drivers/mfd/twl-core.c | ||
14 | +++ b/drivers/mfd/twl-core.c | ||
15 | @@ -208,6 +208,11 @@ | ||
16 | |||
17 | /* Few power values */ | ||
18 | #define R_CFG_BOOT 0x05 | ||
19 | +#define R_GPBR1 0x0C | ||
20 | + | ||
21 | +/* MADC clock values for R_GPBR1 */ | ||
22 | +#define MADC_HFCLK_EN 0x80 | ||
23 | +#define DEFAULT_MADC_CLK_EN 0x10 | ||
24 | |||
25 | /* some fields in R_CFG_BOOT */ | ||
26 | #define HFCLK_FREQ_19p2_MHZ (1 << 0) | ||
27 | @@ -929,6 +934,9 @@ static void clocks_init(struct device *dev, | ||
28 | |||
29 | e |= unprotect_pm_master(); | ||
30 | /* effect->MADC+USB ck en */ | ||
31 | + if (twl_has_madc()) | ||
32 | + e |= twl_i2c_write_u8(TWL_MODULE_INTBR, | ||
33 | + MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1); | ||
34 | e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, ctrl, R_CFG_BOOT); | ||
35 | e |= protect_pm_master(); | ||
36 | |||
37 | diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h | ||
38 | index c760991..cfdfdd3 100644 | ||
39 | --- a/include/linux/i2c/twl.h | ||
40 | +++ b/include/linux/i2c/twl.h | ||
41 | @@ -74,6 +74,7 @@ | ||
42 | |||
43 | #define TWL_MODULE_USB TWL4030_MODULE_USB | ||
44 | #define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE | ||
45 | +#define TWL_MODULE_INTBR TWL4030_MODULE_INTBR | ||
46 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | ||
47 | #define TWL_MODULE_MADC TWL4030_MODULE_MADC | ||
48 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | ||
49 | -- | ||
50 | 1.6.6.1 | ||
51 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0018-MFD-add-twl4030-madc-driver.patch b/extras/recipes-kernel/linux/linux-omap/base/0018-MFD-add-twl4030-madc-driver.patch new file mode 100644 index 00000000..a55136db --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0018-MFD-add-twl4030-madc-driver.patch | |||
@@ -0,0 +1,740 @@ | |||
1 | From 562dc52ebe3df1e5d23416e78306db7c568dc427 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 17 Dec 2009 14:19:34 -0800 | ||
4 | Subject: [PATCH 18/28] MFD: add twl4030 madc driver | ||
5 | |||
6 | --- | ||
7 | drivers/mfd/Kconfig | 21 ++ | ||
8 | drivers/mfd/Makefile | 1 + | ||
9 | drivers/mfd/twl4030-madc.c | 537 ++++++++++++++++++++++++++++++++++++++ | ||
10 | include/linux/i2c/twl4030-madc.h | 130 +++++++++ | ||
11 | 4 files changed, 689 insertions(+), 0 deletions(-) | ||
12 | create mode 100644 drivers/mfd/twl4030-madc.c | ||
13 | create mode 100644 include/linux/i2c/twl4030-madc.h | ||
14 | |||
15 | diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig | ||
16 | index 3a1493b..26ca160 100644 | ||
17 | --- a/drivers/mfd/Kconfig | ||
18 | +++ b/drivers/mfd/Kconfig | ||
19 | @@ -186,6 +186,27 @@ config TWL4030_CODEC | ||
20 | select MFD_CORE | ||
21 | default n | ||
22 | |||
23 | +config TWL4030_MADC | ||
24 | + tristate "TWL4030 MADC Driver" | ||
25 | + depends on TWL4030_CORE | ||
26 | + help | ||
27 | + The TWL4030 Monitoring ADC driver enables the host | ||
28 | + processor to monitor analog signals using analog-to-digital | ||
29 | + conversions on the input source. TWL4030 MADC provides the | ||
30 | + following features: | ||
31 | + - Single 10-bit ADC with successive approximation register (SAR) conversion; | ||
32 | + - Analog multiplexer for 16 inputs; | ||
33 | + - Seven (of the 16) inputs are freely available; | ||
34 | + - Battery voltage monitoring; | ||
35 | + - Concurrent conversion request management; | ||
36 | + - Interrupt signal to Primary Interrupt Handler; | ||
37 | + - Averaging feature; | ||
38 | + - Selective enable/disable of the averaging feature. | ||
39 | + | ||
40 | + Say 'y' here to statically link this module into the kernel or 'm' | ||
41 | + to build it as a dinamically loadable module. The module will be | ||
42 | + called twl4030-madc.ko | ||
43 | + | ||
44 | config TWL6030_PWM | ||
45 | tristate "TWL6030 PWM (Pulse Width Modulator) Support" | ||
46 | depends on TWL4030_CORE | ||
47 | diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile | ||
48 | index f54b365..8c4ccb2 100644 | ||
49 | --- a/drivers/mfd/Makefile | ||
50 | +++ b/drivers/mfd/Makefile | ||
51 | @@ -39,6 +39,7 @@ obj-$(CONFIG_MENELAUS) += menelaus.o | ||
52 | obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o | ||
53 | obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o | ||
54 | obj-$(CONFIG_TWL4030_CODEC) += twl4030-codec.o | ||
55 | +obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o | ||
56 | obj-$(CONFIG_TWL6030_PWM) += twl6030-pwm.o | ||
57 | |||
58 | obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o | ||
59 | diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c | ||
60 | new file mode 100644 | ||
61 | index 0000000..4adf880 | ||
62 | --- /dev/null | ||
63 | +++ b/drivers/mfd/twl4030-madc.c | ||
64 | @@ -0,0 +1,537 @@ | ||
65 | +/* | ||
66 | + * TWL4030 MADC module driver | ||
67 | + * | ||
68 | + * Copyright (C) 2008 Nokia Corporation | ||
69 | + * Mikko Ylinen <mikko.k.ylinen@nokia.com> | ||
70 | + * | ||
71 | + * This program is free software; you can redistribute it and/or | ||
72 | + * modify it under the terms of the GNU General Public License | ||
73 | + * version 2 as published by the Free Software Foundation. | ||
74 | + * | ||
75 | + * This program is distributed in the hope that it will be useful, but | ||
76 | + * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
77 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
78 | + * General Public License for more details. | ||
79 | + * | ||
80 | + * You should have received a copy of the GNU General Public License | ||
81 | + * along with this program; if not, write to the Free Software | ||
82 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
83 | + * 02110-1301 USA | ||
84 | + * | ||
85 | + */ | ||
86 | + | ||
87 | +#include <linux/delay.h> | ||
88 | +#include <linux/fs.h> | ||
89 | +#include <linux/init.h> | ||
90 | +#include <linux/interrupt.h> | ||
91 | +#include <linux/kernel.h> | ||
92 | +#include <linux/miscdevice.h> | ||
93 | +#include <linux/module.h> | ||
94 | +#include <linux/platform_device.h> | ||
95 | +#include <linux/slab.h> | ||
96 | +#include <linux/types.h> | ||
97 | +#include <linux/i2c/twl.h> | ||
98 | +#include <linux/i2c/twl4030-madc.h> | ||
99 | + | ||
100 | +#include <asm/uaccess.h> | ||
101 | + | ||
102 | +#define TWL4030_MADC_PFX "twl4030-madc: " | ||
103 | + | ||
104 | +struct twl4030_madc_data { | ||
105 | + struct device *dev; | ||
106 | + struct mutex lock; | ||
107 | + struct work_struct ws; | ||
108 | + struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS]; | ||
109 | + int imr; | ||
110 | + int isr; | ||
111 | +}; | ||
112 | + | ||
113 | +static struct twl4030_madc_data *the_madc; | ||
114 | + | ||
115 | +static | ||
116 | +const struct twl4030_madc_conversion_method twl4030_conversion_methods[] = { | ||
117 | + [TWL4030_MADC_RT] = { | ||
118 | + .sel = TWL4030_MADC_RTSELECT_LSB, | ||
119 | + .avg = TWL4030_MADC_RTAVERAGE_LSB, | ||
120 | + .rbase = TWL4030_MADC_RTCH0_LSB, | ||
121 | + }, | ||
122 | + [TWL4030_MADC_SW1] = { | ||
123 | + .sel = TWL4030_MADC_SW1SELECT_LSB, | ||
124 | + .avg = TWL4030_MADC_SW1AVERAGE_LSB, | ||
125 | + .rbase = TWL4030_MADC_GPCH0_LSB, | ||
126 | + .ctrl = TWL4030_MADC_CTRL_SW1, | ||
127 | + }, | ||
128 | + [TWL4030_MADC_SW2] = { | ||
129 | + .sel = TWL4030_MADC_SW2SELECT_LSB, | ||
130 | + .avg = TWL4030_MADC_SW2AVERAGE_LSB, | ||
131 | + .rbase = TWL4030_MADC_GPCH0_LSB, | ||
132 | + .ctrl = TWL4030_MADC_CTRL_SW2, | ||
133 | + }, | ||
134 | +}; | ||
135 | + | ||
136 | +static int twl4030_madc_read(struct twl4030_madc_data *madc, u8 reg) | ||
137 | +{ | ||
138 | + int ret; | ||
139 | + u8 val; | ||
140 | + | ||
141 | + ret = twl_i2c_read_u8(TWL4030_MODULE_MADC, &val, reg); | ||
142 | + if (ret) { | ||
143 | + dev_dbg(madc->dev, "unable to read register 0x%X\n", reg); | ||
144 | + return ret; | ||
145 | + } | ||
146 | + | ||
147 | + return val; | ||
148 | +} | ||
149 | + | ||
150 | +static void twl4030_madc_write(struct twl4030_madc_data *madc, u8 reg, u8 val) | ||
151 | +{ | ||
152 | + int ret; | ||
153 | + | ||
154 | + ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, val, reg); | ||
155 | + if (ret) | ||
156 | + dev_err(madc->dev, "unable to write register 0x%X\n", reg); | ||
157 | +} | ||
158 | + | ||
159 | +static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg) | ||
160 | +{ | ||
161 | + u8 msb, lsb; | ||
162 | + | ||
163 | + /* For each ADC channel, we have MSB and LSB register pair. MSB address | ||
164 | + * is always LSB address+1. reg parameter is the addr of LSB register */ | ||
165 | + msb = twl4030_madc_read(madc, reg + 1); | ||
166 | + lsb = twl4030_madc_read(madc, reg); | ||
167 | + | ||
168 | + return (int)(((msb << 8) | lsb) >> 6); | ||
169 | +} | ||
170 | + | ||
171 | +static int twl4030_madc_read_channels(struct twl4030_madc_data *madc, | ||
172 | + u8 reg_base, u16 channels, int *buf) | ||
173 | +{ | ||
174 | + int count = 0; | ||
175 | + u8 reg, i; | ||
176 | + | ||
177 | + if (unlikely(!buf)) | ||
178 | + return 0; | ||
179 | + | ||
180 | + for (i = 0; i < TWL4030_MADC_MAX_CHANNELS; i++) { | ||
181 | + if (channels & (1<<i)) { | ||
182 | + reg = reg_base + 2*i; | ||
183 | + buf[i] = twl4030_madc_channel_raw_read(madc, reg); | ||
184 | + count++; | ||
185 | + } | ||
186 | + } | ||
187 | + return count; | ||
188 | +} | ||
189 | + | ||
190 | +static void twl4030_madc_enable_irq(struct twl4030_madc_data *madc, int id) | ||
191 | +{ | ||
192 | + u8 val; | ||
193 | + | ||
194 | + val = twl4030_madc_read(madc, madc->imr); | ||
195 | + val &= ~(1 << id); | ||
196 | + twl4030_madc_write(madc, madc->imr, val); | ||
197 | +} | ||
198 | + | ||
199 | +static void twl4030_madc_disable_irq(struct twl4030_madc_data *madc, int id) | ||
200 | +{ | ||
201 | + u8 val; | ||
202 | + | ||
203 | + val = twl4030_madc_read(madc, madc->imr); | ||
204 | + val |= (1 << id); | ||
205 | + twl4030_madc_write(madc, madc->imr, val); | ||
206 | +} | ||
207 | + | ||
208 | +static irqreturn_t twl4030_madc_irq_handler(int irq, void *_madc) | ||
209 | +{ | ||
210 | + struct twl4030_madc_data *madc = _madc; | ||
211 | + u8 isr_val, imr_val; | ||
212 | + int i; | ||
213 | + | ||
214 | +#ifdef CONFIG_LOCKDEP | ||
215 | + /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which | ||
216 | + * we don't want and can't tolerate. Although it might be | ||
217 | + * friendlier not to borrow this thread context... | ||
218 | + */ | ||
219 | + local_irq_enable(); | ||
220 | +#endif | ||
221 | + | ||
222 | + /* Use COR to ack interrupts since we have no shared IRQs in ISRx */ | ||
223 | + isr_val = twl4030_madc_read(madc, madc->isr); | ||
224 | + imr_val = twl4030_madc_read(madc, madc->imr); | ||
225 | + | ||
226 | + isr_val &= ~imr_val; | ||
227 | + | ||
228 | + for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) { | ||
229 | + | ||
230 | + if (!(isr_val & (1<<i))) | ||
231 | + continue; | ||
232 | + | ||
233 | + twl4030_madc_disable_irq(madc, i); | ||
234 | + madc->requests[i].result_pending = 1; | ||
235 | + } | ||
236 | + | ||
237 | + schedule_work(&madc->ws); | ||
238 | + | ||
239 | + return IRQ_HANDLED; | ||
240 | +} | ||
241 | + | ||
242 | +static void twl4030_madc_work(struct work_struct *ws) | ||
243 | +{ | ||
244 | + const struct twl4030_madc_conversion_method *method; | ||
245 | + struct twl4030_madc_data *madc; | ||
246 | + struct twl4030_madc_request *r; | ||
247 | + int len, i; | ||
248 | + | ||
249 | + madc = container_of(ws, struct twl4030_madc_data, ws); | ||
250 | + mutex_lock(&madc->lock); | ||
251 | + | ||
252 | + for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) { | ||
253 | + | ||
254 | + r = &madc->requests[i]; | ||
255 | + | ||
256 | + /* No pending results for this method, move to next one */ | ||
257 | + if (!r->result_pending) | ||
258 | + continue; | ||
259 | + | ||
260 | + method = &twl4030_conversion_methods[r->method]; | ||
261 | + | ||
262 | + /* Read results */ | ||
263 | + len = twl4030_madc_read_channels(madc, method->rbase, | ||
264 | + r->channels, r->rbuf); | ||
265 | + | ||
266 | + /* Return results to caller */ | ||
267 | + if (r->func_cb != NULL) { | ||
268 | + r->func_cb(len, r->channels, r->rbuf); | ||
269 | + r->func_cb = NULL; | ||
270 | + } | ||
271 | + | ||
272 | + /* Free request */ | ||
273 | + r->result_pending = 0; | ||
274 | + r->active = 0; | ||
275 | + } | ||
276 | + | ||
277 | + mutex_unlock(&madc->lock); | ||
278 | +} | ||
279 | + | ||
280 | +static int twl4030_madc_set_irq(struct twl4030_madc_data *madc, | ||
281 | + struct twl4030_madc_request *req) | ||
282 | +{ | ||
283 | + struct twl4030_madc_request *p; | ||
284 | + | ||
285 | + p = &madc->requests[req->method]; | ||
286 | + | ||
287 | + memcpy(p, req, sizeof *req); | ||
288 | + | ||
289 | + twl4030_madc_enable_irq(madc, req->method); | ||
290 | + | ||
291 | + return 0; | ||
292 | +} | ||
293 | + | ||
294 | +static inline void twl4030_madc_start_conversion(struct twl4030_madc_data *madc, | ||
295 | + int conv_method) | ||
296 | +{ | ||
297 | + const struct twl4030_madc_conversion_method *method; | ||
298 | + | ||
299 | + method = &twl4030_conversion_methods[conv_method]; | ||
300 | + | ||
301 | + switch (conv_method) { | ||
302 | + case TWL4030_MADC_SW1: | ||
303 | + case TWL4030_MADC_SW2: | ||
304 | + twl4030_madc_write(madc, method->ctrl, TWL4030_MADC_SW_START); | ||
305 | + break; | ||
306 | + case TWL4030_MADC_RT: | ||
307 | + default: | ||
308 | + break; | ||
309 | + } | ||
310 | +} | ||
311 | + | ||
312 | +static int twl4030_madc_wait_conversion_ready( | ||
313 | + struct twl4030_madc_data *madc, | ||
314 | + unsigned int timeout_ms, u8 status_reg) | ||
315 | +{ | ||
316 | + unsigned long timeout; | ||
317 | + | ||
318 | + timeout = jiffies + msecs_to_jiffies(timeout_ms); | ||
319 | + do { | ||
320 | + u8 reg; | ||
321 | + | ||
322 | + reg = twl4030_madc_read(madc, status_reg); | ||
323 | + if (!(reg & TWL4030_MADC_BUSY) && (reg & TWL4030_MADC_EOC_SW)) | ||
324 | + return 0; | ||
325 | + } while (!time_after(jiffies, timeout)); | ||
326 | + | ||
327 | + return -EAGAIN; | ||
328 | +} | ||
329 | + | ||
330 | +int twl4030_madc_conversion(struct twl4030_madc_request *req) | ||
331 | +{ | ||
332 | + const struct twl4030_madc_conversion_method *method; | ||
333 | + u8 ch_msb, ch_lsb; | ||
334 | + int ret; | ||
335 | + | ||
336 | + if (unlikely(!req)) | ||
337 | + return -EINVAL; | ||
338 | + | ||
339 | + mutex_lock(&the_madc->lock); | ||
340 | + | ||
341 | + /* Do we have a conversion request ongoing */ | ||
342 | + if (the_madc->requests[req->method].active) { | ||
343 | + ret = -EBUSY; | ||
344 | + goto out; | ||
345 | + } | ||
346 | + | ||
347 | + ch_msb = (req->channels >> 8) & 0xff; | ||
348 | + ch_lsb = req->channels & 0xff; | ||
349 | + | ||
350 | + method = &twl4030_conversion_methods[req->method]; | ||
351 | + | ||
352 | + /* Select channels to be converted */ | ||
353 | + twl4030_madc_write(the_madc, method->sel + 1, ch_msb); | ||
354 | + twl4030_madc_write(the_madc, method->sel, ch_lsb); | ||
355 | + | ||
356 | + /* Select averaging for all channels if do_avg is set */ | ||
357 | + if (req->do_avg) { | ||
358 | + twl4030_madc_write(the_madc, method->avg + 1, ch_msb); | ||
359 | + twl4030_madc_write(the_madc, method->avg, ch_lsb); | ||
360 | + } | ||
361 | + | ||
362 | + if ((req->type == TWL4030_MADC_IRQ_ONESHOT) && (req->func_cb != NULL)) { | ||
363 | + twl4030_madc_set_irq(the_madc, req); | ||
364 | + twl4030_madc_start_conversion(the_madc, req->method); | ||
365 | + the_madc->requests[req->method].active = 1; | ||
366 | + ret = 0; | ||
367 | + goto out; | ||
368 | + } | ||
369 | + | ||
370 | + /* With RT method we should not be here anymore */ | ||
371 | + if (req->method == TWL4030_MADC_RT) { | ||
372 | + ret = -EINVAL; | ||
373 | + goto out; | ||
374 | + } | ||
375 | + | ||
376 | + twl4030_madc_start_conversion(the_madc, req->method); | ||
377 | + the_madc->requests[req->method].active = 1; | ||
378 | + | ||
379 | + /* Wait until conversion is ready (ctrl register returns EOC) */ | ||
380 | + ret = twl4030_madc_wait_conversion_ready(the_madc, 5, method->ctrl); | ||
381 | + if (ret) { | ||
382 | + dev_dbg(the_madc->dev, "conversion timeout!\n"); | ||
383 | + the_madc->requests[req->method].active = 0; | ||
384 | + goto out; | ||
385 | + } | ||
386 | + | ||
387 | + ret = twl4030_madc_read_channels(the_madc, method->rbase, req->channels, | ||
388 | + req->rbuf); | ||
389 | + | ||
390 | + the_madc->requests[req->method].active = 0; | ||
391 | + | ||
392 | +out: | ||
393 | + mutex_unlock(&the_madc->lock); | ||
394 | + | ||
395 | + return ret; | ||
396 | +} | ||
397 | +EXPORT_SYMBOL(twl4030_madc_conversion); | ||
398 | + | ||
399 | +static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc, | ||
400 | + int chan, int on) | ||
401 | +{ | ||
402 | + int ret; | ||
403 | + u8 regval; | ||
404 | + | ||
405 | + /* Current generator is only available for ADCIN0 and ADCIN1. NB: | ||
406 | + * ADCIN1 current generator only works when AC or VBUS is present */ | ||
407 | + if (chan > 1) | ||
408 | + return EINVAL; | ||
409 | + | ||
410 | + ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE, | ||
411 | + ®val, TWL4030_BCI_BCICTL1); | ||
412 | + if (on) | ||
413 | + regval |= (chan) ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN; | ||
414 | + else | ||
415 | + regval &= (chan) ? ~TWL4030_BCI_ITHEN : ~TWL4030_BCI_TYPEN; | ||
416 | + ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE, | ||
417 | + regval, TWL4030_BCI_BCICTL1); | ||
418 | + | ||
419 | + return ret; | ||
420 | +} | ||
421 | + | ||
422 | +static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on) | ||
423 | +{ | ||
424 | + u8 regval; | ||
425 | + | ||
426 | + regval = twl4030_madc_read(madc, TWL4030_MADC_CTRL1); | ||
427 | + if (on) | ||
428 | + regval |= TWL4030_MADC_MADCON; | ||
429 | + else | ||
430 | + regval &= ~TWL4030_MADC_MADCON; | ||
431 | + twl4030_madc_write(madc, TWL4030_MADC_CTRL1, regval); | ||
432 | + | ||
433 | + return 0; | ||
434 | +} | ||
435 | + | ||
436 | +static long twl4030_madc_ioctl(struct file *filp, unsigned int cmd, | ||
437 | + unsigned long arg) | ||
438 | +{ | ||
439 | + struct twl4030_madc_user_parms par; | ||
440 | + int val, ret; | ||
441 | + | ||
442 | + ret = copy_from_user(&par, (void __user *) arg, sizeof(par)); | ||
443 | + if (ret) { | ||
444 | + dev_dbg(the_madc->dev, "copy_from_user: %d\n", ret); | ||
445 | + return -EACCES; | ||
446 | + } | ||
447 | + | ||
448 | + switch (cmd) { | ||
449 | + case TWL4030_MADC_IOCX_ADC_RAW_READ: { | ||
450 | + struct twl4030_madc_request req; | ||
451 | + if (par.channel >= TWL4030_MADC_MAX_CHANNELS) | ||
452 | + return -EINVAL; | ||
453 | + | ||
454 | + req.channels = (1 << par.channel); | ||
455 | + req.do_avg = par.average; | ||
456 | + req.method = TWL4030_MADC_SW1; | ||
457 | + req.func_cb = NULL; | ||
458 | + | ||
459 | + val = twl4030_madc_conversion(&req); | ||
460 | + if (val <= 0) { | ||
461 | + par.status = -1; | ||
462 | + } else { | ||
463 | + par.status = 0; | ||
464 | + par.result = (u16)req.rbuf[par.channel]; | ||
465 | + } | ||
466 | + break; | ||
467 | + } | ||
468 | + default: | ||
469 | + return -EINVAL; | ||
470 | + } | ||
471 | + | ||
472 | + ret = copy_to_user((void __user *) arg, &par, sizeof(par)); | ||
473 | + if (ret) { | ||
474 | + dev_dbg(the_madc->dev, "copy_to_user: %d\n", ret); | ||
475 | + return -EACCES; | ||
476 | + } | ||
477 | + | ||
478 | + return 0; | ||
479 | +} | ||
480 | + | ||
481 | +static struct file_operations twl4030_madc_fileops = { | ||
482 | + .owner = THIS_MODULE, | ||
483 | + .unlocked_ioctl = twl4030_madc_ioctl | ||
484 | +}; | ||
485 | + | ||
486 | +static struct miscdevice twl4030_madc_device = { | ||
487 | + .minor = MISC_DYNAMIC_MINOR, | ||
488 | + .name = "twl4030-madc", | ||
489 | + .fops = &twl4030_madc_fileops | ||
490 | +}; | ||
491 | + | ||
492 | +static int __init twl4030_madc_probe(struct platform_device *pdev) | ||
493 | +{ | ||
494 | + struct twl4030_madc_data *madc; | ||
495 | + struct twl4030_madc_platform_data *pdata = pdev->dev.platform_data; | ||
496 | + int ret; | ||
497 | + u8 regval; | ||
498 | + | ||
499 | + madc = kzalloc(sizeof *madc, GFP_KERNEL); | ||
500 | + if (!madc) | ||
501 | + return -ENOMEM; | ||
502 | + | ||
503 | + if (!pdata) { | ||
504 | + dev_dbg(&pdev->dev, "platform_data not available\n"); | ||
505 | + ret = -EINVAL; | ||
506 | + goto err_pdata; | ||
507 | + } | ||
508 | + | ||
509 | + madc->imr = (pdata->irq_line == 1) ? TWL4030_MADC_IMR1 : TWL4030_MADC_IMR2; | ||
510 | + madc->isr = (pdata->irq_line == 1) ? TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2; | ||
511 | + | ||
512 | + ret = misc_register(&twl4030_madc_device); | ||
513 | + if (ret) { | ||
514 | + dev_dbg(&pdev->dev, "could not register misc_device\n"); | ||
515 | + goto err_misc; | ||
516 | + } | ||
517 | + twl4030_madc_set_power(madc, 1); | ||
518 | + twl4030_madc_set_current_generator(madc, 0, 1); | ||
519 | + | ||
520 | + /* Enable ADCIN3 through 6 */ | ||
521 | + ret = twl_i2c_read_u8(TWL4030_MODULE_USB, | ||
522 | + ®val, TWL4030_USB_CARKIT_ANA_CTRL); | ||
523 | + | ||
524 | + regval |= TWL4030_USB_SEL_MADC_MCPC; | ||
525 | + | ||
526 | + ret = twl_i2c_write_u8(TWL4030_MODULE_USB, | ||
527 | + regval, TWL4030_USB_CARKIT_ANA_CTRL); | ||
528 | + | ||
529 | + | ||
530 | + ret = twl_i2c_read_u8(TWL4030_MODULE_MAIN_CHARGE, | ||
531 | + ®val, TWL4030_BCI_BCICTL1); | ||
532 | + | ||
533 | + regval |= TWL4030_BCI_MESBAT; | ||
534 | + | ||
535 | + ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE, | ||
536 | + regval, TWL4030_BCI_BCICTL1); | ||
537 | + | ||
538 | + ret = request_irq(platform_get_irq(pdev, 0), twl4030_madc_irq_handler, | ||
539 | + 0, "twl4030_madc", madc); | ||
540 | + if (ret) { | ||
541 | + dev_dbg(&pdev->dev, "could not request irq\n"); | ||
542 | + goto err_irq; | ||
543 | + } | ||
544 | + | ||
545 | + platform_set_drvdata(pdev, madc); | ||
546 | + mutex_init(&madc->lock); | ||
547 | + INIT_WORK(&madc->ws, twl4030_madc_work); | ||
548 | + | ||
549 | + the_madc = madc; | ||
550 | + | ||
551 | + return 0; | ||
552 | + | ||
553 | +err_irq: | ||
554 | + misc_deregister(&twl4030_madc_device); | ||
555 | + | ||
556 | +err_misc: | ||
557 | +err_pdata: | ||
558 | + kfree(madc); | ||
559 | + | ||
560 | + return ret; | ||
561 | +} | ||
562 | + | ||
563 | +static int __exit twl4030_madc_remove(struct platform_device *pdev) | ||
564 | +{ | ||
565 | + struct twl4030_madc_data *madc = platform_get_drvdata(pdev); | ||
566 | + | ||
567 | + twl4030_madc_set_power(madc, 0); | ||
568 | + twl4030_madc_set_current_generator(madc, 0, 0); | ||
569 | + free_irq(platform_get_irq(pdev, 0), madc); | ||
570 | + cancel_work_sync(&madc->ws); | ||
571 | + misc_deregister(&twl4030_madc_device); | ||
572 | + | ||
573 | + return 0; | ||
574 | +} | ||
575 | + | ||
576 | +static struct platform_driver twl4030_madc_driver = { | ||
577 | + .probe = twl4030_madc_probe, | ||
578 | + .remove = __exit_p(twl4030_madc_remove), | ||
579 | + .driver = { | ||
580 | + .name = "twl4030_madc", | ||
581 | + .owner = THIS_MODULE, | ||
582 | + }, | ||
583 | +}; | ||
584 | + | ||
585 | +static int __init twl4030_madc_init(void) | ||
586 | +{ | ||
587 | + return platform_driver_register(&twl4030_madc_driver); | ||
588 | +} | ||
589 | +module_init(twl4030_madc_init); | ||
590 | + | ||
591 | +static void __exit twl4030_madc_exit(void) | ||
592 | +{ | ||
593 | + platform_driver_unregister(&twl4030_madc_driver); | ||
594 | +} | ||
595 | +module_exit(twl4030_madc_exit); | ||
596 | + | ||
597 | +MODULE_ALIAS("platform:twl4030-madc"); | ||
598 | +MODULE_AUTHOR("Nokia Corporation"); | ||
599 | +MODULE_DESCRIPTION("twl4030 ADC driver"); | ||
600 | +MODULE_LICENSE("GPL"); | ||
601 | + | ||
602 | diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h | ||
603 | new file mode 100644 | ||
604 | index 0000000..341a665 | ||
605 | --- /dev/null | ||
606 | +++ b/include/linux/i2c/twl4030-madc.h | ||
607 | @@ -0,0 +1,130 @@ | ||
608 | +/* | ||
609 | + * include/linux/i2c/twl4030-madc.h | ||
610 | + * | ||
611 | + * TWL4030 MADC module driver header | ||
612 | + * | ||
613 | + * Copyright (C) 2008 Nokia Corporation | ||
614 | + * Mikko Ylinen <mikko.k.ylinen@nokia.com> | ||
615 | + * | ||
616 | + * This program is free software; you can redistribute it and/or | ||
617 | + * modify it under the terms of the GNU General Public License | ||
618 | + * version 2 as published by the Free Software Foundation. | ||
619 | + * | ||
620 | + * This program is distributed in the hope that it will be useful, but | ||
621 | + * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
622 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
623 | + * General Public License for more details. | ||
624 | + * | ||
625 | + * You should have received a copy of the GNU General Public License | ||
626 | + * along with this program; if not, write to the Free Software | ||
627 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
628 | + * 02110-1301 USA | ||
629 | + * | ||
630 | + */ | ||
631 | + | ||
632 | +#ifndef _TWL4030_MADC_H | ||
633 | +#define _TWL4030_MADC_H | ||
634 | + | ||
635 | +struct twl4030_madc_conversion_method { | ||
636 | + u8 sel; | ||
637 | + u8 avg; | ||
638 | + u8 rbase; | ||
639 | + u8 ctrl; | ||
640 | +}; | ||
641 | + | ||
642 | +#define TWL4030_MADC_MAX_CHANNELS 16 | ||
643 | + | ||
644 | +struct twl4030_madc_request { | ||
645 | + u16 channels; | ||
646 | + u16 do_avg; | ||
647 | + u16 method; | ||
648 | + u16 type; | ||
649 | + int active; | ||
650 | + int result_pending; | ||
651 | + int rbuf[TWL4030_MADC_MAX_CHANNELS]; | ||
652 | + void (*func_cb)(int len, int channels, int *buf); | ||
653 | +}; | ||
654 | + | ||
655 | +enum conversion_methods { | ||
656 | + TWL4030_MADC_RT, | ||
657 | + TWL4030_MADC_SW1, | ||
658 | + TWL4030_MADC_SW2, | ||
659 | + TWL4030_MADC_NUM_METHODS | ||
660 | +}; | ||
661 | + | ||
662 | +enum sample_type { | ||
663 | + TWL4030_MADC_WAIT, | ||
664 | + TWL4030_MADC_IRQ_ONESHOT, | ||
665 | + TWL4030_MADC_IRQ_REARM | ||
666 | +}; | ||
667 | + | ||
668 | +#define TWL4030_MADC_CTRL1 0x00 | ||
669 | +#define TWL4030_MADC_CTRL2 0x01 | ||
670 | + | ||
671 | +#define TWL4030_MADC_RTSELECT_LSB 0x02 | ||
672 | +#define TWL4030_MADC_SW1SELECT_LSB 0x06 | ||
673 | +#define TWL4030_MADC_SW2SELECT_LSB 0x0A | ||
674 | + | ||
675 | +#define TWL4030_MADC_RTAVERAGE_LSB 0x04 | ||
676 | +#define TWL4030_MADC_SW1AVERAGE_LSB 0x08 | ||
677 | +#define TWL4030_MADC_SW2AVERAGE_LSB 0x0C | ||
678 | + | ||
679 | +#define TWL4030_MADC_CTRL_SW1 0x12 | ||
680 | +#define TWL4030_MADC_CTRL_SW2 0x13 | ||
681 | + | ||
682 | +#define TWL4030_MADC_RTCH0_LSB 0x17 | ||
683 | +#define TWL4030_MADC_GPCH0_LSB 0x37 | ||
684 | + | ||
685 | +#define TWL4030_MADC_MADCON (1<<0) /* MADC power on */ | ||
686 | +#define TWL4030_MADC_BUSY (1<<0) /* MADC busy */ | ||
687 | +#define TWL4030_MADC_EOC_SW (1<<1) /* MADC conversion completion */ | ||
688 | +#define TWL4030_MADC_SW_START (1<<5) /* MADC SWx start conversion */ | ||
689 | + | ||
690 | +#define TWL4030_MADC_ADCIN0 (1<<0) | ||
691 | +#define TWL4030_MADC_ADCIN1 (1<<1) | ||
692 | +#define TWL4030_MADC_ADCIN2 (1<<2) | ||
693 | +#define TWL4030_MADC_ADCIN3 (1<<3) | ||
694 | +#define TWL4030_MADC_ADCIN4 (1<<4) | ||
695 | +#define TWL4030_MADC_ADCIN5 (1<<5) | ||
696 | +#define TWL4030_MADC_ADCIN6 (1<<6) | ||
697 | +#define TWL4030_MADC_ADCIN7 (1<<7) | ||
698 | +#define TWL4030_MADC_ADCIN8 (1<<8) | ||
699 | +#define TWL4030_MADC_ADCIN9 (1<<9) | ||
700 | +#define TWL4030_MADC_ADCIN10 (1<<10) | ||
701 | +#define TWL4030_MADC_ADCIN11 (1<<11) | ||
702 | +#define TWL4030_MADC_ADCIN12 (1<<12) | ||
703 | +#define TWL4030_MADC_ADCIN13 (1<<13) | ||
704 | +#define TWL4030_MADC_ADCIN14 (1<<14) | ||
705 | +#define TWL4030_MADC_ADCIN15 (1<<15) | ||
706 | + | ||
707 | +/* Fixed channels */ | ||
708 | +#define TWL4030_MADC_BTEMP TWL4030_MADC_ADCIN1 | ||
709 | +#define TWL4030_MADC_VBUS TWL4030_MADC_ADCIN8 | ||
710 | +#define TWL4030_MADC_VBKB TWL4030_MADC_ADCIN9 | ||
711 | +#define TWL4030_MADC_ICHG TWL4030_MADC_ADCIN10 | ||
712 | +#define TWL4030_MADC_VCHG TWL4030_MADC_ADCIN11 | ||
713 | +#define TWL4030_MADC_VBAT TWL4030_MADC_ADCIN12 | ||
714 | + | ||
715 | +/* BCI related - XXX To be moved elsewhere */ | ||
716 | +#define TWL4030_BCI_BCICTL1 0x23 | ||
717 | +#define TWL4030_BCI_MESBAT (1<<1) | ||
718 | +#define TWL4030_BCI_TYPEN (1<<4) | ||
719 | +#define TWL4030_BCI_ITHEN (1<<3) | ||
720 | + | ||
721 | +/* USB related - XXX To be moved elsewhere */ | ||
722 | +#define TWL4030_USB_CARKIT_ANA_CTRL 0xBB | ||
723 | +#define TWL4030_USB_SEL_MADC_MCPC (1<<3) | ||
724 | + | ||
725 | +#define TWL4030_MADC_IOC_MAGIC '`' | ||
726 | +#define TWL4030_MADC_IOCX_ADC_RAW_READ _IO(TWL4030_MADC_IOC_MAGIC, 0) | ||
727 | + | ||
728 | +struct twl4030_madc_user_parms { | ||
729 | + int channel; | ||
730 | + int average; | ||
731 | + int status; | ||
732 | + u16 result; | ||
733 | +}; | ||
734 | + | ||
735 | +int twl4030_madc_conversion(struct twl4030_madc_request *conv); | ||
736 | + | ||
737 | +#endif | ||
738 | -- | ||
739 | 1.6.6.1 | ||
740 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch b/extras/recipes-kernel/linux/linux-omap/base/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch new file mode 100644 index 00000000..b24e4dd2 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From a33c4e0fb917ca059e900c2851849ba604758ff9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 17 Dec 2009 14:27:15 -0800 | ||
4 | Subject: [PATCH 19/28] ARM: OMAP: Add twl4030 madc support to Overo | ||
5 | |||
6 | --- | ||
7 | arch/arm/mach-omap2/board-overo.c | 5 +++++ | ||
8 | 1 files changed, 5 insertions(+), 0 deletions(-) | ||
9 | |||
10 | diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c | ||
11 | index cb26e5d..17f066a 100644 | ||
12 | --- a/arch/arm/mach-omap2/board-overo.c | ||
13 | +++ b/arch/arm/mach-omap2/board-overo.c | ||
14 | @@ -369,10 +369,15 @@ static struct twl4030_codec_data overo_codec_data = { | ||
15 | |||
16 | /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */ | ||
17 | |||
18 | +static struct twl4030_madc_platform_data overo_madc_data = { | ||
19 | + .irq_line = 1, | ||
20 | +}; | ||
21 | + | ||
22 | static struct twl4030_platform_data overo_twldata = { | ||
23 | .irq_base = TWL4030_IRQ_BASE, | ||
24 | .irq_end = TWL4030_IRQ_END, | ||
25 | .gpio = &overo_gpio_data, | ||
26 | + .madc = &overo_madc_data, | ||
27 | .usb = &overo_usb_data, | ||
28 | .codec = &overo_codec_data, | ||
29 | .vmmc1 = &overo_vmmc1, | ||
30 | -- | ||
31 | 1.6.6.1 | ||
32 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0020-ARM-OMAP-Add-twl4030-madc-support-to-Beagle.patch b/extras/recipes-kernel/linux/linux-omap/base/0020-ARM-OMAP-Add-twl4030-madc-support-to-Beagle.patch new file mode 100644 index 00000000..7028c17b --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0020-ARM-OMAP-Add-twl4030-madc-support-to-Beagle.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From fe51c97f26f8d6798909b1f22a5fb4ca84684f36 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 17 Dec 2009 14:32:36 -0800 | ||
4 | Subject: [PATCH 20/28] ARM: OMAP: Add twl4030 madc support to Beagle | ||
5 | |||
6 | --- | ||
7 | arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++ | ||
8 | 1 files changed, 5 insertions(+), 0 deletions(-) | ||
9 | |||
10 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | ||
11 | index f699701..9259780 100644 | ||
12 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
13 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | @@ -604,6 +604,10 @@ static struct twl4030_codec_data beagle_codec_data = { | ||
15 | .audio = &beagle_audio_data, | ||
16 | }; | ||
17 | |||
18 | +static struct twl4030_madc_platform_data beagle_madc_data = { | ||
19 | + .irq_line = 1, | ||
20 | +}; | ||
21 | + | ||
22 | static struct twl4030_platform_data beagle_twldata = { | ||
23 | .irq_base = TWL4030_IRQ_BASE, | ||
24 | .irq_end = TWL4030_IRQ_END, | ||
25 | @@ -612,6 +616,7 @@ static struct twl4030_platform_data beagle_twldata = { | ||
26 | .usb = &beagle_usb_data, | ||
27 | .gpio = &beagle_gpio_data, | ||
28 | .codec = &beagle_codec_data, | ||
29 | + .madc = &beagle_madc_data, | ||
30 | .vmmc1 = &beagle_vmmc1, | ||
31 | .vsim = &beagle_vsim, | ||
32 | .vdac = &beagle_vdac, | ||
33 | -- | ||
34 | 1.6.6.1 | ||
35 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0021-OMAP-DSS2-Add-support-for-Samsung-LTE430WQ-F0C-panel.patch b/extras/recipes-kernel/linux/linux-omap/base/0021-OMAP-DSS2-Add-support-for-Samsung-LTE430WQ-F0C-panel.patch new file mode 100644 index 00000000..823ab9f3 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0021-OMAP-DSS2-Add-support-for-Samsung-LTE430WQ-F0C-panel.patch | |||
@@ -0,0 +1,173 @@ | |||
1 | From f8049ce6302904c1d08d8813f8a60b10b8a476e7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Tue, 23 Feb 2010 14:40:27 -0800 | ||
4 | Subject: [PATCH 21/28] OMAP: DSS2: Add support for Samsung LTE430WQ-F0C panel | ||
5 | |||
6 | --- | ||
7 | .../omap2/displays/panel-samsung-lte430wq-f0c.c | 154 ++++++++++++++++++++ | ||
8 | 1 files changed, 154 insertions(+), 0 deletions(-) | ||
9 | create mode 100644 drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c | ||
10 | |||
11 | diff --git a/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c | ||
12 | new file mode 100644 | ||
13 | index 0000000..6a29f9c | ||
14 | --- /dev/null | ||
15 | +++ b/drivers/video/omap2/displays/panel-samsung-lte430wq-f0c.c | ||
16 | @@ -0,0 +1,154 @@ | ||
17 | +/* | ||
18 | + * LCD panel driver for Samsung LTE430WQ-F0C | ||
19 | + * | ||
20 | + * Author: Steve Sakoman <steve@sakoman.com> | ||
21 | + * | ||
22 | + * This program is free software; you can redistribute it and/or modify it | ||
23 | + * under the terms of the GNU General Public License version 2 as published by | ||
24 | + * the Free Software Foundation. | ||
25 | + * | ||
26 | + * This program is distributed in the hope that it will be useful, but WITHOUT | ||
27 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
28 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
29 | + * more details. | ||
30 | + * | ||
31 | + * You should have received a copy of the GNU General Public License along with | ||
32 | + * this program. If not, see <http://www.gnu.org/licenses/>. | ||
33 | + */ | ||
34 | + | ||
35 | +#include <linux/module.h> | ||
36 | +#include <linux/delay.h> | ||
37 | + | ||
38 | +#include <plat/display.h> | ||
39 | + | ||
40 | +static struct omap_video_timings samsung_lte_timings = { | ||
41 | + .x_res = 480, | ||
42 | + .y_res = 272, | ||
43 | + | ||
44 | + .pixel_clock = 9200, | ||
45 | + | ||
46 | + .hsw = 41, | ||
47 | + .hfp = 8, | ||
48 | + .hbp = 45-41, | ||
49 | + | ||
50 | + .vsw = 10, | ||
51 | + .vfp = 4, | ||
52 | + .vbp = 12-10, | ||
53 | +}; | ||
54 | + | ||
55 | +static int samsung_lte_panel_power_on(struct omap_dss_device *dssdev) | ||
56 | +{ | ||
57 | + int r; | ||
58 | + | ||
59 | + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
60 | + return 0; | ||
61 | + | ||
62 | + r = omapdss_dpi_display_enable(dssdev); | ||
63 | + if (r) | ||
64 | + goto err0; | ||
65 | + | ||
66 | + if (dssdev->platform_enable) { | ||
67 | + r = dssdev->platform_enable(dssdev); | ||
68 | + if (r) | ||
69 | + goto err1; | ||
70 | + } | ||
71 | + | ||
72 | + return 0; | ||
73 | +err1: | ||
74 | + omapdss_dpi_display_disable(dssdev); | ||
75 | +err0: | ||
76 | + return r; | ||
77 | +} | ||
78 | + | ||
79 | +static void samsung_lte_panel_power_off(struct omap_dss_device *dssdev) | ||
80 | +{ | ||
81 | + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
82 | + return; | ||
83 | + | ||
84 | + if (dssdev->platform_disable) | ||
85 | + dssdev->platform_disable(dssdev); | ||
86 | + | ||
87 | + omapdss_dpi_display_disable(dssdev); | ||
88 | +} | ||
89 | + | ||
90 | +static int samsung_lte_panel_probe(struct omap_dss_device *dssdev) | ||
91 | +{ | ||
92 | + dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | | ||
93 | + OMAP_DSS_LCD_IHS; | ||
94 | + dssdev->panel.timings = samsung_lte_timings; | ||
95 | + | ||
96 | + return 0; | ||
97 | +} | ||
98 | + | ||
99 | +static void samsung_lte_panel_remove(struct omap_dss_device *dssdev) | ||
100 | +{ | ||
101 | +} | ||
102 | + | ||
103 | +static int samsung_lte_panel_enable(struct omap_dss_device *dssdev) | ||
104 | +{ | ||
105 | + int r = 0; | ||
106 | + | ||
107 | + r = samsung_lte_panel_power_on(dssdev); | ||
108 | + if (r) | ||
109 | + return r; | ||
110 | + | ||
111 | + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
112 | + | ||
113 | + return 0; | ||
114 | +} | ||
115 | + | ||
116 | +static void samsung_lte_panel_disable(struct omap_dss_device *dssdev) | ||
117 | +{ | ||
118 | + samsung_lte_panel_power_off(dssdev); | ||
119 | + | ||
120 | + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | ||
121 | +} | ||
122 | + | ||
123 | +static int samsung_lte_panel_suspend(struct omap_dss_device *dssdev) | ||
124 | +{ | ||
125 | + samsung_lte_panel_disable(dssdev); | ||
126 | + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | ||
127 | + return 0; | ||
128 | +} | ||
129 | + | ||
130 | +static int samsung_lte_panel_resume(struct omap_dss_device *dssdev) | ||
131 | +{ | ||
132 | + int r; | ||
133 | + | ||
134 | + r = samsung_lte_panel_enable(dssdev); | ||
135 | + if (r) | ||
136 | + return r; | ||
137 | + | ||
138 | + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
139 | + | ||
140 | + return 0; | ||
141 | +} | ||
142 | + | ||
143 | +static struct omap_dss_driver samsung_lte_driver = { | ||
144 | + .probe = samsung_lte_panel_probe, | ||
145 | + .remove = samsung_lte_panel_remove, | ||
146 | + | ||
147 | + .enable = samsung_lte_panel_enable, | ||
148 | + .disable = samsung_lte_panel_disable, | ||
149 | + .suspend = samsung_lte_panel_suspend, | ||
150 | + .resume = samsung_lte_panel_resume, | ||
151 | + | ||
152 | + .driver = { | ||
153 | + .name = "samsung_lte_panel", | ||
154 | + .owner = THIS_MODULE, | ||
155 | + }, | ||
156 | +}; | ||
157 | + | ||
158 | +static int __init samsung_lte_panel_drv_init(void) | ||
159 | +{ | ||
160 | + return omap_dss_register_driver(&samsung_lte_driver); | ||
161 | +} | ||
162 | + | ||
163 | +static void __exit samsung_lte_panel_drv_exit(void) | ||
164 | +{ | ||
165 | + omap_dss_unregister_driver(&samsung_lte_driver); | ||
166 | +} | ||
167 | + | ||
168 | +module_init(samsung_lte_panel_drv_init); | ||
169 | +module_exit(samsung_lte_panel_drv_exit); | ||
170 | +MODULE_LICENSE("GPL"); | ||
171 | -- | ||
172 | 1.6.6.1 | ||
173 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch b/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch new file mode 100644 index 00000000..c3029423 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0022-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch | |||
@@ -0,0 +1,299 @@ | |||
1 | From 93032782a4803072d7ab1e22da029325f8f3cf44 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 17 Dec 2009 15:05:30 -0800 | ||
4 | Subject: [PATCH 22/28] OMAP: DSS2: Add support for LG Philips LB035Q02 panel | ||
5 | |||
6 | --- | ||
7 | drivers/video/omap2/displays/Kconfig | 12 + | ||
8 | drivers/video/omap2/displays/Makefile | 2 + | ||
9 | .../omap2/displays/panel-lgphilips-lb035q02.c | 244 ++++++++++++++++++++ | ||
10 | 3 files changed, 258 insertions(+), 0 deletions(-) | ||
11 | create mode 100644 drivers/video/omap2/displays/panel-lgphilips-lb035q02.c | ||
12 | |||
13 | diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig | ||
14 | index 12327bb..48e872f 100644 | ||
15 | --- a/drivers/video/omap2/displays/Kconfig | ||
16 | +++ b/drivers/video/omap2/displays/Kconfig | ||
17 | @@ -7,6 +7,18 @@ config PANEL_GENERIC | ||
18 | Generic panel driver. | ||
19 | Used for DVI output for Beagle and OMAP3 SDP. | ||
20 | |||
21 | +config PANEL_LGPHILIPS_LB035Q02 | ||
22 | + tristate "LG.Philips LB035Q02 LCD Panel" | ||
23 | + depends on OMAP2_DSS | ||
24 | + help | ||
25 | + LCD Panel used on Overo Palo35 | ||
26 | + | ||
27 | +config PANEL_SAMSUNG_LTE430WQ_F0C | ||
28 | + tristate "Samsung LTE430WQ-F0C LCD Panel" | ||
29 | + depends on OMAP2_DSS | ||
30 | + help | ||
31 | + LCD Panel used on Overo Palo43 | ||
32 | + | ||
33 | config PANEL_SHARP_LS037V7DW01 | ||
34 | tristate "Sharp LS037V7DW01 LCD Panel" | ||
35 | depends on OMAP2_DSS | ||
36 | diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile | ||
37 | index aa38609..2fb1a57 100644 | ||
38 | --- a/drivers/video/omap2/displays/Makefile | ||
39 | +++ b/drivers/video/omap2/displays/Makefile | ||
40 | @@ -1,4 +1,6 @@ | ||
41 | obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o | ||
42 | +obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o | ||
43 | +obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o | ||
44 | obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o | ||
45 | obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o | ||
46 | |||
47 | diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c | ||
48 | new file mode 100644 | ||
49 | index 0000000..4ad709d | ||
50 | --- /dev/null | ||
51 | +++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c | ||
52 | @@ -0,0 +1,244 @@ | ||
53 | +/* | ||
54 | + * LCD panel driver for LG.Philips LB035Q02 | ||
55 | + * | ||
56 | + * Author: Steve Sakoman <steve@sakoman.com> | ||
57 | + * | ||
58 | + * This program is free software; you can redistribute it and/or modify it | ||
59 | + * under the terms of the GNU General Public License version 2 as published by | ||
60 | + * the Free Software Foundation. | ||
61 | + * | ||
62 | + * This program is distributed in the hope that it will be useful, but WITHOUT | ||
63 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
64 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
65 | + * more details. | ||
66 | + * | ||
67 | + * You should have received a copy of the GNU General Public License along with | ||
68 | + * this program. If not, see <http://www.gnu.org/licenses/>. | ||
69 | + */ | ||
70 | + | ||
71 | +#include <linux/module.h> | ||
72 | +#include <linux/delay.h> | ||
73 | +#include <linux/spi/spi.h> | ||
74 | + | ||
75 | +#include <plat/display.h> | ||
76 | + | ||
77 | +static struct spi_device *spidev; | ||
78 | + | ||
79 | +static struct omap_video_timings lb035q02_timings = { | ||
80 | + .x_res = 320, | ||
81 | + .y_res = 240, | ||
82 | + | ||
83 | + .pixel_clock = 6500, | ||
84 | + | ||
85 | + .hsw = 2, | ||
86 | + .hfp = 20, | ||
87 | + .hbp = 68, | ||
88 | + | ||
89 | + .vsw = 2, | ||
90 | + .vfp = 4, | ||
91 | + .vbp = 18, | ||
92 | +}; | ||
93 | + | ||
94 | +static int lb035q02_write_reg(u8 reg, u16 val) | ||
95 | +{ | ||
96 | + struct spi_message msg; | ||
97 | + struct spi_transfer index_xfer = { | ||
98 | + .len = 3, | ||
99 | + .cs_change = 1, | ||
100 | + }; | ||
101 | + struct spi_transfer value_xfer = { | ||
102 | + .len = 3, | ||
103 | + }; | ||
104 | + u8 buffer[16]; | ||
105 | + | ||
106 | + spi_message_init(&msg); | ||
107 | + | ||
108 | + /* register index */ | ||
109 | + buffer[0] = 0x70; | ||
110 | + buffer[1] = 0x00; | ||
111 | + buffer[2] = reg & 0x7f; | ||
112 | + index_xfer.tx_buf = buffer; | ||
113 | + spi_message_add_tail(&index_xfer, &msg); | ||
114 | + | ||
115 | + /* register value */ | ||
116 | + buffer[4] = 0x72; | ||
117 | + buffer[5] = val >> 8; | ||
118 | + buffer[6] = val; | ||
119 | + value_xfer.tx_buf = buffer + 4; | ||
120 | + spi_message_add_tail(&value_xfer, &msg); | ||
121 | + | ||
122 | + return spi_sync(spidev, &msg); | ||
123 | +} | ||
124 | + | ||
125 | +static int lb035q02_panel_power_on(struct omap_dss_device *dssdev) | ||
126 | +{ | ||
127 | + int r; | ||
128 | + | ||
129 | + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
130 | + return 0; | ||
131 | + | ||
132 | + r = omapdss_dpi_display_enable(dssdev); | ||
133 | + if (r) | ||
134 | + goto err0; | ||
135 | + | ||
136 | + if (dssdev->platform_enable) { | ||
137 | + r = dssdev->platform_enable(dssdev); | ||
138 | + if (r) | ||
139 | + goto err1; | ||
140 | + } | ||
141 | + | ||
142 | + /* Panel init sequence from page 28 of the spec */ | ||
143 | + lb035q02_write_reg(0x01, 0x6300); | ||
144 | + lb035q02_write_reg(0x02, 0x0200); | ||
145 | + lb035q02_write_reg(0x03, 0x0177); | ||
146 | + lb035q02_write_reg(0x04, 0x04c7); | ||
147 | + lb035q02_write_reg(0x05, 0xffc0); | ||
148 | + lb035q02_write_reg(0x06, 0xe806); | ||
149 | + lb035q02_write_reg(0x0a, 0x4008); | ||
150 | + lb035q02_write_reg(0x0b, 0x0000); | ||
151 | + lb035q02_write_reg(0x0d, 0x0030); | ||
152 | + lb035q02_write_reg(0x0e, 0x2800); | ||
153 | + lb035q02_write_reg(0x0f, 0x0000); | ||
154 | + lb035q02_write_reg(0x16, 0x9f80); | ||
155 | + lb035q02_write_reg(0x17, 0x0a0f); | ||
156 | + lb035q02_write_reg(0x1e, 0x00c1); | ||
157 | + lb035q02_write_reg(0x30, 0x0300); | ||
158 | + lb035q02_write_reg(0x31, 0x0007); | ||
159 | + lb035q02_write_reg(0x32, 0x0000); | ||
160 | + lb035q02_write_reg(0x33, 0x0000); | ||
161 | + lb035q02_write_reg(0x34, 0x0707); | ||
162 | + lb035q02_write_reg(0x35, 0x0004); | ||
163 | + lb035q02_write_reg(0x36, 0x0302); | ||
164 | + lb035q02_write_reg(0x37, 0x0202); | ||
165 | + lb035q02_write_reg(0x3a, 0x0a0d); | ||
166 | + lb035q02_write_reg(0x3b, 0x0806); | ||
167 | + | ||
168 | + return 0; | ||
169 | +err1: | ||
170 | + omapdss_dpi_display_disable(dssdev); | ||
171 | +err0: | ||
172 | + return r; | ||
173 | +} | ||
174 | + | ||
175 | +static void lb035q02_panel_power_off(struct omap_dss_device *dssdev) | ||
176 | +{ | ||
177 | + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
178 | + return; | ||
179 | + | ||
180 | + if (dssdev->platform_disable) | ||
181 | + dssdev->platform_disable(dssdev); | ||
182 | + | ||
183 | + omapdss_dpi_display_disable(dssdev); | ||
184 | +} | ||
185 | + | ||
186 | +static int lb035q02_panel_probe(struct omap_dss_device *dssdev) | ||
187 | +{ | ||
188 | + dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | | ||
189 | + OMAP_DSS_LCD_IHS; | ||
190 | + dssdev->panel.timings = lb035q02_timings; | ||
191 | + | ||
192 | + return 0; | ||
193 | +} | ||
194 | + | ||
195 | +static void lb035q02_panel_remove(struct omap_dss_device *dssdev) | ||
196 | +{ | ||
197 | +} | ||
198 | + | ||
199 | +static int lb035q02_panel_enable(struct omap_dss_device *dssdev) | ||
200 | +{ | ||
201 | + int r = 0; | ||
202 | + | ||
203 | + r = lb035q02_panel_power_on(dssdev); | ||
204 | + if (r) | ||
205 | + return r; | ||
206 | + | ||
207 | + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
208 | + | ||
209 | + return 0; | ||
210 | +} | ||
211 | + | ||
212 | +static void lb035q02_panel_disable(struct omap_dss_device *dssdev) | ||
213 | +{ | ||
214 | + lb035q02_panel_power_off(dssdev); | ||
215 | + | ||
216 | + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; | ||
217 | +} | ||
218 | + | ||
219 | +static int lb035q02_panel_suspend(struct omap_dss_device *dssdev) | ||
220 | +{ | ||
221 | + lb035q02_panel_disable(dssdev); | ||
222 | + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; | ||
223 | + return 0; | ||
224 | +} | ||
225 | + | ||
226 | +static int lb035q02_panel_resume(struct omap_dss_device *dssdev) | ||
227 | +{ | ||
228 | + int r; | ||
229 | + | ||
230 | + r = lb035q02_panel_power_on(dssdev); | ||
231 | + if (r) | ||
232 | + return r; | ||
233 | + | ||
234 | + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | ||
235 | + | ||
236 | + return 0; | ||
237 | +} | ||
238 | + | ||
239 | +static struct omap_dss_driver lb035q02_driver = { | ||
240 | + .probe = lb035q02_panel_probe, | ||
241 | + .remove = lb035q02_panel_remove, | ||
242 | + | ||
243 | + .enable = lb035q02_panel_enable, | ||
244 | + .disable = lb035q02_panel_disable, | ||
245 | + .suspend = lb035q02_panel_suspend, | ||
246 | + .resume = lb035q02_panel_resume, | ||
247 | + | ||
248 | + .driver = { | ||
249 | + .name = "lgphilips_lb035q02_panel", | ||
250 | + .owner = THIS_MODULE, | ||
251 | + }, | ||
252 | +}; | ||
253 | + | ||
254 | +static int __devinit lb035q02_panel_spi_probe(struct spi_device *spi) | ||
255 | +{ | ||
256 | + spidev = spi; | ||
257 | + return 0; | ||
258 | +} | ||
259 | + | ||
260 | +static int __devexit lb035q02_panel_spi_remove(struct spi_device *spi) | ||
261 | +{ | ||
262 | + return 0; | ||
263 | +} | ||
264 | + | ||
265 | +static struct spi_driver lb035q02_spi_driver = { | ||
266 | + .driver = { | ||
267 | + .name = "lgphilips_lb035q02_panel-spi", | ||
268 | + .owner = THIS_MODULE, | ||
269 | + }, | ||
270 | + .probe = lb035q02_panel_spi_probe, | ||
271 | + .remove = __devexit_p (lb035q02_panel_spi_remove), | ||
272 | +}; | ||
273 | + | ||
274 | +static int __init lb035q02_panel_drv_init(void) | ||
275 | +{ | ||
276 | + int r; | ||
277 | + r = spi_register_driver(&lb035q02_spi_driver); | ||
278 | + if (r != 0) | ||
279 | + pr_err("lgphilips_lb035q02: Unable to register SPI driver: %d\n", r); | ||
280 | + | ||
281 | + r = omap_dss_register_driver(&lb035q02_driver); | ||
282 | + if (r != 0) | ||
283 | + pr_err("lgphilips_lb035q02: Unable to register panel driver: %d\n", r); | ||
284 | + | ||
285 | + return r; | ||
286 | +} | ||
287 | + | ||
288 | +static void __exit lb035q02_panel_drv_exit(void) | ||
289 | +{ | ||
290 | + spi_unregister_driver(&lb035q02_spi_driver); | ||
291 | + omap_dss_unregister_driver(&lb035q02_driver); | ||
292 | +} | ||
293 | + | ||
294 | +module_init(lb035q02_panel_drv_init); | ||
295 | +module_exit(lb035q02_panel_drv_exit); | ||
296 | +MODULE_LICENSE("GPL"); | ||
297 | -- | ||
298 | 1.6.6.1 | ||
299 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0023-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch b/extras/recipes-kernel/linux/linux-omap/base/0023-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch new file mode 100644 index 00000000..12f7d7b0 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0023-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From f046a207183e3e338c7e851085265f0df95f4cc2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Tue, 19 Jan 2010 21:19:15 -0800 | ||
4 | Subject: [PATCH 23/28] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output | ||
5 | |||
6 | also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp | ||
7 | --- | ||
8 | drivers/video/omap2/dss/venc.c | 22 ++++++++++++++++++++++ | ||
9 | drivers/video/omap2/omapfb/omapfb-main.c | 10 +++++++++- | ||
10 | 2 files changed, 31 insertions(+), 1 deletions(-) | ||
11 | |||
12 | diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c | ||
13 | index eff3505..e1f4aab 100644 | ||
14 | --- a/drivers/video/omap2/dss/venc.c | ||
15 | +++ b/drivers/video/omap2/dss/venc.c | ||
16 | @@ -87,6 +87,11 @@ | ||
17 | #define VENC_OUTPUT_TEST 0xC8 | ||
18 | #define VENC_DAC_B__DAC_C 0xC8 | ||
19 | |||
20 | +static char *tv_connection; | ||
21 | + | ||
22 | +module_param_named(tvcable, tv_connection, charp, 0); | ||
23 | +MODULE_PARM_DESC(tvcable, "TV connection type (svideo, composite)"); | ||
24 | + | ||
25 | struct venc_config { | ||
26 | u32 f_control; | ||
27 | u32 vidout_ctrl; | ||
28 | @@ -459,6 +464,23 @@ static int venc_panel_probe(struct omap_dss_device *dssdev) | ||
29 | { | ||
30 | dssdev->panel.timings = omap_dss_pal_timings; | ||
31 | |||
32 | + /* Allow the TV output to be overriden */ | ||
33 | + if (tv_connection) { | ||
34 | + if (strcmp(tv_connection, "svideo") == 0) { | ||
35 | + printk(KERN_INFO | ||
36 | + "omapdss: tv output is svideo.\n"); | ||
37 | + dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO; | ||
38 | + } else if (strcmp(tv_connection, "composite") == 0) { | ||
39 | + printk(KERN_INFO | ||
40 | + "omapdss: tv output is composite.\n"); | ||
41 | + dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE; | ||
42 | + } else { | ||
43 | + printk(KERN_INFO | ||
44 | + "omapdss: unsupported output type'%s'.\n", | ||
45 | + tv_connection); | ||
46 | + } | ||
47 | + } | ||
48 | + | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c | ||
53 | index 6a704f1..7ee833f 100644 | ||
54 | --- a/drivers/video/omap2/omapfb/omapfb-main.c | ||
55 | +++ b/drivers/video/omap2/omapfb/omapfb-main.c | ||
56 | @@ -2036,7 +2036,15 @@ static int omapfb_mode_to_timings(const char *mode_str, | ||
57 | int r; | ||
58 | |||
59 | #ifdef CONFIG_OMAP2_DSS_VENC | ||
60 | - if (strcmp(mode_str, "pal") == 0) { | ||
61 | + if (strcmp(mode_str, "pal-16") == 0) { | ||
62 | + *timings = omap_dss_pal_timings; | ||
63 | + *bpp = 16; | ||
64 | + return 0; | ||
65 | + } else if (strcmp(mode_str, "ntsc-16") == 0) { | ||
66 | + *timings = omap_dss_ntsc_timings; | ||
67 | + *bpp = 16; | ||
68 | + return 0; | ||
69 | + } else if (strcmp(mode_str, "pal") == 0) { | ||
70 | *timings = omap_dss_pal_timings; | ||
71 | *bpp = 24; | ||
72 | return 0; | ||
73 | -- | ||
74 | 1.6.6.1 | ||
75 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0024-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch b/extras/recipes-kernel/linux/linux-omap/base/0024-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch new file mode 100644 index 00000000..f012a91a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0024-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 66bba5baf225a1420c734aa0268e7dd37fc3f73b Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Sun, 24 Jan 2010 09:33:56 -0800 | ||
4 | Subject: [PATCH 24/28] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test | ||
5 | |||
6 | otherwise it is not executed on systems that use non-twl regulators | ||
7 | --- | ||
8 | arch/arm/mach-omap2/hsmmc.c | 14 ++++++-------- | ||
9 | 1 files changed, 6 insertions(+), 8 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c | ||
12 | index 34272e4..a74631d 100644 | ||
13 | --- a/arch/arm/mach-omap2/hsmmc.c | ||
14 | +++ b/arch/arm/mach-omap2/hsmmc.c | ||
15 | @@ -186,15 +186,13 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot, | ||
16 | if (mmc->slots[0].remux) | ||
17 | mmc->slots[0].remux(dev, slot, power_on); | ||
18 | |||
19 | - if (power_on) { | ||
20 | - /* Only MMC2 supports a CLKIN */ | ||
21 | - if (mmc->slots[0].internal_clock) { | ||
22 | - u32 reg; | ||
23 | + /* Only MMC2 supports a CLKIN */ | ||
24 | + if (mmc->slots[0].internal_clock) { | ||
25 | + u32 reg; | ||
26 | |||
27 | - reg = omap_ctrl_readl(control_devconf1_offset); | ||
28 | - reg |= OMAP2_MMCSDIO2ADPCLKISEL; | ||
29 | - omap_ctrl_writel(reg, control_devconf1_offset); | ||
30 | - } | ||
31 | + reg = omap_ctrl_readl(control_devconf1_offset); | ||
32 | + reg |= OMAP2_MMCSDIO2ADPCLKISEL; | ||
33 | + omap_ctrl_writel(reg, control_devconf1_offset); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | -- | ||
38 | 1.6.6.1 | ||
39 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0025-RTC-add-support-for-backup-battery-recharge.patch b/extras/recipes-kernel/linux/linux-omap/base/0025-RTC-add-support-for-backup-battery-recharge.patch new file mode 100644 index 00000000..419e7648 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0025-RTC-add-support-for-backup-battery-recharge.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From ae08111e55d17183382dd06d161066adf9f80f3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 4 Feb 2010 12:26:22 -0800 | ||
4 | Subject: [PATCH 25/28] RTC: add support for backup battery recharge | ||
5 | |||
6 | --- | ||
7 | drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++ | ||
8 | 1 files changed, 25 insertions(+), 0 deletions(-) | ||
9 | |||
10 | diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c | ||
11 | index ed1b868..33a8598 100644 | ||
12 | --- a/drivers/rtc/rtc-twl.c | ||
13 | +++ b/drivers/rtc/rtc-twl.c | ||
14 | @@ -30,6 +30,23 @@ | ||
15 | |||
16 | #include <linux/i2c/twl.h> | ||
17 | |||
18 | +/* | ||
19 | + * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER) | ||
20 | + */ | ||
21 | +#define REG_BB_CFG 0x12 | ||
22 | + | ||
23 | +/* PM_RECEIVER BB_CFG bitfields */ | ||
24 | +#define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10 | ||
25 | +#define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C | ||
26 | +#define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00 | ||
27 | +#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04 | ||
28 | +#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08 | ||
29 | +#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c | ||
30 | +#define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03 | ||
31 | +#define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00 | ||
32 | +#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01 | ||
33 | +#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02 | ||
34 | +#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03 | ||
35 | |||
36 | /* | ||
37 | * RTC block register offsets (use TWL_MODULE_RTC) | ||
38 | @@ -508,6 +525,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) | ||
39 | if (ret < 0) | ||
40 | goto out2; | ||
41 | |||
42 | + /* enable backup battery charging */ | ||
43 | + /* use a conservative 25uA @ 3.1V */ | ||
44 | + ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, | ||
45 | + BIT_PM_RECEIVER_BB_CFG_BBCHEN | | ||
46 | + BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 | | ||
47 | + BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA, | ||
48 | + REG_BB_CFG); | ||
49 | + | ||
50 | return ret; | ||
51 | |||
52 | out2: | ||
53 | -- | ||
54 | 1.6.6.1 | ||
55 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0026-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch b/extras/recipes-kernel/linux/linux-omap/base/0026-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch new file mode 100644 index 00000000..b002f288 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0026-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From dd53a7c1ab8addfd2a943ea44b5ccc5700648323 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Wed, 24 Feb 2010 10:37:22 -0800 | ||
4 | Subject: [PATCH 26/28] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options | ||
5 | |||
6 | --- | ||
7 | arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++ | ||
8 | arch/arm/mach-omap2/board-overo.c | 6 ++++++ | ||
9 | 2 files changed, 12 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 9259780..ad0c1d8 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | ||
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | ||
15 | @@ -785,7 +785,13 @@ static struct omap_board_mux board_mux[] __initdata = { | ||
16 | |||
17 | static struct omap_musb_board_data musb_board_data = { | ||
18 | .interface_type = MUSB_INTERFACE_ULPI, | ||
19 | +#if defined(CONFIG_USB_MUSB_OTG) | ||
20 | .mode = MUSB_OTG, | ||
21 | +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC) | ||
22 | + .mode = MUSB_PERIPHERAL, | ||
23 | +#else | ||
24 | + .mode = MUSB_HOST, | ||
25 | +#endif | ||
26 | .power = 100, | ||
27 | }; | ||
28 | |||
29 | diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c | ||
30 | index 17f066a..b28a9d5 100644 | ||
31 | --- a/arch/arm/mach-omap2/board-overo.c | ||
32 | +++ b/arch/arm/mach-omap2/board-overo.c | ||
33 | @@ -447,7 +447,13 @@ static struct omap_board_mux board_mux[] __initdata = { | ||
34 | |||
35 | static struct omap_musb_board_data musb_board_data = { | ||
36 | .interface_type = MUSB_INTERFACE_ULPI, | ||
37 | +#if defined(CONFIG_USB_MUSB_OTG) | ||
38 | .mode = MUSB_OTG, | ||
39 | +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC) | ||
40 | + .mode = MUSB_PERIPHERAL, | ||
41 | +#else | ||
42 | + .mode = MUSB_HOST, | ||
43 | +#endif | ||
44 | .power = 100, | ||
45 | }; | ||
46 | |||
47 | -- | ||
48 | 1.6.6.1 | ||
49 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0027-OMAP-DSS2-check-for-both-cpu-type-and-revision-rathe.patch b/extras/recipes-kernel/linux/linux-omap/base/0027-OMAP-DSS2-check-for-both-cpu-type-and-revision-rathe.patch new file mode 100644 index 00000000..8f672d9a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0027-OMAP-DSS2-check-for-both-cpu-type-and-revision-rathe.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From ec3e66ef2e222feb0408f16a3498be1ea9b6a9c0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Mon, 10 May 2010 13:59:14 -0700 | ||
4 | Subject: [PATCH 27/28] OMAP: DSS2: check for both cpu type and revision, rather than just revision | ||
5 | |||
6 | --- | ||
7 | drivers/video/omap2/dss/dispc.c | 4 ++-- | ||
8 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c | ||
11 | index fa40fa5..133916a 100644 | ||
12 | --- a/drivers/video/omap2/dss/dispc.c | ||
13 | +++ b/drivers/video/omap2/dss/dispc.c | ||
14 | @@ -2101,7 +2101,7 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode) | ||
15 | static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | ||
16 | int vsw, int vfp, int vbp) | ||
17 | { | ||
18 | - if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { | ||
19 | + if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) { | ||
20 | if (hsw < 1 || hsw > 64 || | ||
21 | hfp < 1 || hfp > 256 || | ||
22 | hbp < 1 || hbp > 256 || | ||
23 | @@ -2134,7 +2134,7 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp, | ||
24 | { | ||
25 | u32 timing_h, timing_v; | ||
26 | |||
27 | - if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { | ||
28 | + if (cpu_is_omap24xx() || (cpu_is_omap34xx() && omap_rev_lt_3_0())) { | ||
29 | timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) | | ||
30 | FLD_VAL(hbp-1, 27, 20); | ||
31 | |||
32 | -- | ||
33 | 1.6.6.1 | ||
34 | |||
diff --git a/extras/recipes-kernel/linux/linux-omap/base/0028-OMAP-DSS2-Add-DSS2-support-for-Overo.patch b/extras/recipes-kernel/linux/linux-omap/base/0028-OMAP-DSS2-Add-DSS2-support-for-Overo.patch new file mode 100644 index 00000000..ff2ab556 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/base/0028-OMAP-DSS2-Add-DSS2-support-for-Overo.patch | |||
@@ -0,0 +1,355 @@ | |||
1 | From 9b2bfa418f2e1b7ed3e210cb7cba3cdd67f9925f Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Fri, 18 Dec 2009 06:39:24 -0800 | ||
4 | Subject: [PATCH 28/28] OMAP: DSS2: Add DSS2 support for Overo | ||
5 | |||
6 | --- | ||
7 | arch/arm/mach-omap2/board-overo.c | 238 +++++++++++++++++++++++++++++++------ | ||
8 | 1 files changed, 204 insertions(+), 34 deletions(-) | ||
9 | |||
10 | diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c | ||
11 | index b28a9d5..8a44c17 100644 | ||
12 | --- a/arch/arm/mach-omap2/board-overo.c | ||
13 | +++ b/arch/arm/mach-omap2/board-overo.c | ||
14 | @@ -28,6 +28,7 @@ | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/i2c/twl.h> | ||
17 | #include <linux/regulator/machine.h> | ||
18 | +#include <linux/spi/spi.h> | ||
19 | |||
20 | #include <linux/mtd/mtd.h> | ||
21 | #include <linux/mtd/nand.h> | ||
22 | @@ -41,10 +42,13 @@ | ||
23 | |||
24 | #include <plat/board.h> | ||
25 | #include <plat/common.h> | ||
26 | +#include <plat/display.h> | ||
27 | #include <mach/gpio.h> | ||
28 | #include <plat/gpmc.h> | ||
29 | #include <mach/hardware.h> | ||
30 | #include <plat/nand.h> | ||
31 | +#include <plat/mcspi.h> | ||
32 | +#include <plat/mux.h> | ||
33 | #include <plat/usb.h> | ||
34 | |||
35 | #include "mux.h" | ||
36 | @@ -68,8 +72,6 @@ | ||
37 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | ||
38 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
39 | |||
40 | -#include <plat/mcspi.h> | ||
41 | -#include <linux/spi/spi.h> | ||
42 | #include <linux/spi/ads7846.h> | ||
43 | |||
44 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { | ||
45 | @@ -94,18 +96,6 @@ static struct ads7846_platform_data ads7846_config = { | ||
46 | .keep_vref_on = 1, | ||
47 | }; | ||
48 | |||
49 | -static struct spi_board_info overo_spi_board_info[] __initdata = { | ||
50 | - { | ||
51 | - .modalias = "ads7846", | ||
52 | - .bus_num = 1, | ||
53 | - .chip_select = 0, | ||
54 | - .max_speed_hz = 1500000, | ||
55 | - .controller_data = &ads7846_mcspi_config, | ||
56 | - .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), | ||
57 | - .platform_data = &ads7846_config, | ||
58 | - } | ||
59 | -}; | ||
60 | - | ||
61 | static void __init overo_ads7846_init(void) | ||
62 | { | ||
63 | if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && | ||
64 | @@ -115,9 +105,6 @@ static void __init overo_ads7846_init(void) | ||
65 | printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); | ||
66 | return; | ||
67 | } | ||
68 | - | ||
69 | - spi_register_board_info(overo_spi_board_info, | ||
70 | - ARRAY_SIZE(overo_spi_board_info)); | ||
71 | } | ||
72 | |||
73 | #else | ||
74 | @@ -233,6 +220,139 @@ static inline void __init overo_init_smsc911x(void) | ||
75 | static inline void __init overo_init_smsc911x(void) { return; } | ||
76 | #endif | ||
77 | |||
78 | +/* DSS */ | ||
79 | +static int lcd_enabled; | ||
80 | +static int dvi_enabled; | ||
81 | + | ||
82 | +#define OVERO_GPIO_LCD_EN 144 | ||
83 | +#define OVERO_GPIO_LCD_BL 145 | ||
84 | + | ||
85 | +static void __init overo_display_init(void) | ||
86 | +{ | ||
87 | + if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) && | ||
88 | + (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0)) | ||
89 | + gpio_export(OVERO_GPIO_LCD_EN, 0); | ||
90 | + else | ||
91 | + printk(KERN_ERR "could not obtain gpio for " | ||
92 | + "OVERO_GPIO_LCD_EN\n"); | ||
93 | + | ||
94 | + if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) && | ||
95 | + (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0)) | ||
96 | + gpio_export(OVERO_GPIO_LCD_BL, 0); | ||
97 | + else | ||
98 | + printk(KERN_ERR "could not obtain gpio for " | ||
99 | + "OVERO_GPIO_LCD_BL\n"); | ||
100 | +} | ||
101 | + | ||
102 | +static int overo_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
103 | +{ | ||
104 | + if (lcd_enabled) { | ||
105 | + printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
106 | + return -EINVAL; | ||
107 | + } | ||
108 | + dvi_enabled = 1; | ||
109 | + | ||
110 | + return 0; | ||
111 | +} | ||
112 | + | ||
113 | +static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
114 | +{ | ||
115 | + dvi_enabled = 0; | ||
116 | +} | ||
117 | + | ||
118 | +static struct omap_dss_device overo_dvi_device = { | ||
119 | + .type = OMAP_DISPLAY_TYPE_DPI, | ||
120 | + .name = "dvi", | ||
121 | + .driver_name = "generic_panel", | ||
122 | + .phy.dpi.data_lines = 24, | ||
123 | + .platform_enable = overo_panel_enable_dvi, | ||
124 | + .platform_disable = overo_panel_disable_dvi, | ||
125 | +}; | ||
126 | + | ||
127 | +static struct omap_dss_device overo_tv_device = { | ||
128 | + .name = "tv", | ||
129 | + .driver_name = "venc", | ||
130 | + .type = OMAP_DISPLAY_TYPE_VENC, | ||
131 | + .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
132 | +}; | ||
133 | + | ||
134 | +static int overo_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
135 | +{ | ||
136 | + if (dvi_enabled) { | ||
137 | + printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
138 | + return -EINVAL; | ||
139 | + } | ||
140 | + | ||
141 | + gpio_set_value(OVERO_GPIO_LCD_EN, 1); | ||
142 | + gpio_set_value(OVERO_GPIO_LCD_BL, 1); | ||
143 | + lcd_enabled = 1; | ||
144 | + return 0; | ||
145 | +} | ||
146 | + | ||
147 | +static void overo_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
148 | +{ | ||
149 | + gpio_set_value(OVERO_GPIO_LCD_EN, 0); | ||
150 | + gpio_set_value(OVERO_GPIO_LCD_BL, 0); | ||
151 | + lcd_enabled = 0; | ||
152 | +} | ||
153 | + | ||
154 | +#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ | ||
155 | + defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) | ||
156 | +static struct omap_dss_device overo_lcd35_device = { | ||
157 | + .type = OMAP_DISPLAY_TYPE_DPI, | ||
158 | + .name = "lcd35", | ||
159 | + .driver_name = "lgphilips_lb035q02_panel", | ||
160 | + .phy.dpi.data_lines = 24, | ||
161 | + .platform_enable = overo_panel_enable_lcd, | ||
162 | + .platform_disable = overo_panel_disable_lcd, | ||
163 | +}; | ||
164 | +#endif | ||
165 | + | ||
166 | +#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \ | ||
167 | + defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE) | ||
168 | +static struct omap_dss_device overo_lcd43_device = { | ||
169 | + .type = OMAP_DISPLAY_TYPE_DPI, | ||
170 | + .name = "lcd43", | ||
171 | + .driver_name = "samsung_lte_panel", | ||
172 | + .phy.dpi.data_lines = 24, | ||
173 | + .platform_enable = overo_panel_enable_lcd, | ||
174 | + .platform_disable = overo_panel_disable_lcd, | ||
175 | +}; | ||
176 | +#endif | ||
177 | + | ||
178 | +static struct omap_dss_device *overo_dss_devices[] = { | ||
179 | + &overo_dvi_device, | ||
180 | + &overo_tv_device, | ||
181 | +#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ | ||
182 | + defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) | ||
183 | + &overo_lcd35_device, | ||
184 | +#endif | ||
185 | +#if defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) || \ | ||
186 | + defined(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C_MODULE) | ||
187 | + &overo_lcd43_device, | ||
188 | +#endif | ||
189 | +}; | ||
190 | + | ||
191 | +static struct omap_dss_board_info overo_dss_data = { | ||
192 | + .num_devices = ARRAY_SIZE(overo_dss_devices), | ||
193 | + .devices = overo_dss_devices, | ||
194 | + .default_device = &overo_dvi_device, | ||
195 | +}; | ||
196 | + | ||
197 | +static struct platform_device overo_dss_device = { | ||
198 | + .name = "omapdss", | ||
199 | + .id = -1, | ||
200 | + .dev = { | ||
201 | + .platform_data = &overo_dss_data, | ||
202 | + }, | ||
203 | +}; | ||
204 | + | ||
205 | +static struct regulator_consumer_supply overo_vdda_dac_supply = | ||
206 | + REGULATOR_SUPPLY("vdda_dac", "omapdss"); | ||
207 | + | ||
208 | +static struct regulator_consumer_supply overo_vdds_dsi_supply = | ||
209 | + REGULATOR_SUPPLY("vdds_dsi", "omapdss"); | ||
210 | + | ||
211 | static struct mtd_partition overo_nand_partitions[] = { | ||
212 | { | ||
213 | .name = "xloader", | ||
214 | @@ -358,6 +478,37 @@ static struct regulator_init_data overo_vmmc1 = { | ||
215 | .consumer_supplies = &overo_vmmc1_supply, | ||
216 | }; | ||
217 | |||
218 | +/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | ||
219 | +static struct regulator_init_data overo_vdac = { | ||
220 | + .constraints = { | ||
221 | + .min_uV = 1800000, | ||
222 | + .max_uV = 1800000, | ||
223 | + .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
224 | + | REGULATOR_MODE_STANDBY, | ||
225 | + .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
226 | + | REGULATOR_CHANGE_STATUS, | ||
227 | + }, | ||
228 | + .num_consumer_supplies = 1, | ||
229 | + .consumer_supplies = &overo_vdda_dac_supply, | ||
230 | +}; | ||
231 | + | ||
232 | +/* VPLL2 for digital video outputs */ | ||
233 | +static struct regulator_init_data overo_vpll2 = { | ||
234 | + .constraints = { | ||
235 | + .name = "VDVI", | ||
236 | + .min_uV = 1800000, | ||
237 | + .max_uV = 1800000, | ||
238 | + .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
239 | + | REGULATOR_MODE_STANDBY, | ||
240 | + .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
241 | + | REGULATOR_CHANGE_STATUS, | ||
242 | + }, | ||
243 | + .num_consumer_supplies = 1, | ||
244 | + .consumer_supplies = &overo_vdds_dsi_supply, | ||
245 | +}; | ||
246 | + | ||
247 | +/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */ | ||
248 | + | ||
249 | static struct twl4030_codec_audio_data overo_audio_data = { | ||
250 | .audio_mclk = 26000000, | ||
251 | }; | ||
252 | @@ -367,8 +518,6 @@ static struct twl4030_codec_data overo_codec_data = { | ||
253 | .audio = &overo_audio_data, | ||
254 | }; | ||
255 | |||
256 | -/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */ | ||
257 | - | ||
258 | static struct twl4030_madc_platform_data overo_madc_data = { | ||
259 | .irq_line = 1, | ||
260 | }; | ||
261 | @@ -381,6 +530,8 @@ static struct twl4030_platform_data overo_twldata = { | ||
262 | .usb = &overo_usb_data, | ||
263 | .codec = &overo_codec_data, | ||
264 | .vmmc1 = &overo_vmmc1, | ||
265 | + .vdac = &overo_vdac, | ||
266 | + .vpll2 = &overo_vpll2, | ||
267 | }; | ||
268 | |||
269 | static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { | ||
270 | @@ -401,23 +552,41 @@ static int __init overo_i2c_init(void) | ||
271 | return 0; | ||
272 | } | ||
273 | |||
274 | -static struct platform_device overo_lcd_device = { | ||
275 | - .name = "overo_lcd", | ||
276 | - .id = -1, | ||
277 | -}; | ||
278 | - | ||
279 | -static struct omap_lcd_config overo_lcd_config __initdata = { | ||
280 | - .ctrl_name = "internal", | ||
281 | +static struct spi_board_info overo_spi_board_info[] __initdata = { | ||
282 | +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | ||
283 | + defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
284 | + { | ||
285 | + .modalias = "ads7846", | ||
286 | + .bus_num = 1, | ||
287 | + .chip_select = 0, | ||
288 | + .max_speed_hz = 1500000, | ||
289 | + .controller_data = &ads7846_mcspi_config, | ||
290 | + .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), | ||
291 | + .platform_data = &ads7846_config, | ||
292 | + }, | ||
293 | +#endif | ||
294 | +#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ | ||
295 | + defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) | ||
296 | + { | ||
297 | + .modalias = "lgphilips_lb035q02_panel-spi", | ||
298 | + .bus_num = 1, | ||
299 | + .chip_select = 1, | ||
300 | + .max_speed_hz = 500000, | ||
301 | + .mode = SPI_MODE_3, | ||
302 | + }, | ||
303 | +#endif | ||
304 | }; | ||
305 | |||
306 | -static struct omap_board_config_kernel overo_config[] __initdata = { | ||
307 | - { OMAP_TAG_LCD, &overo_lcd_config }, | ||
308 | -}; | ||
309 | +static int __init overo_spi_init(void) | ||
310 | +{ | ||
311 | + overo_ads7846_init(); | ||
312 | + spi_register_board_info(overo_spi_board_info, | ||
313 | + ARRAY_SIZE(overo_spi_board_info)); | ||
314 | + return 0; | ||
315 | +} | ||
316 | |||
317 | static void __init overo_init_irq(void) | ||
318 | { | ||
319 | - omap_board_config = overo_config; | ||
320 | - omap_board_config_size = ARRAY_SIZE(overo_config); | ||
321 | omap2_init_common_infrastructure(); | ||
322 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | ||
323 | mt46h32m32lf6_sdrc_params); | ||
324 | @@ -425,7 +594,7 @@ static void __init overo_init_irq(void) | ||
325 | } | ||
326 | |||
327 | static struct platform_device *overo_devices[] __initdata = { | ||
328 | - &overo_lcd_device, | ||
329 | + &overo_dss_device, | ||
330 | }; | ||
331 | |||
332 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | ||
333 | @@ -466,8 +635,9 @@ static void __init overo_init(void) | ||
334 | overo_flash_init(); | ||
335 | usb_musb_init(&musb_board_data); | ||
336 | usb_ehci_init(&ehci_pdata); | ||
337 | - overo_ads7846_init(); | ||
338 | + overo_spi_init(); | ||
339 | overo_init_smsc911x(); | ||
340 | + overo_display_init(); | ||
341 | |||
342 | /* Ensure SDRC pins are mux'd for self-refresh */ | ||
343 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | ||
344 | @@ -510,7 +680,7 @@ static void __init overo_init(void) | ||
345 | "OVERO_GPIO_USBH_CPEN\n"); | ||
346 | } | ||
347 | |||
348 | -MACHINE_START(OVERO, "Gumstix Overo") | ||
349 | +MACHINE_START(OVERO, "Gumstsix Overo") | ||
350 | .boot_params = 0x80000100, | ||
351 | .map_io = omap3_map_io, | ||
352 | .reserve = omap_reserve, | ||
353 | -- | ||
354 | 1.6.6.1 | ||
355 | |||