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