Skip to content

Commit

Permalink
Applied omap24xx openwrt patches (2.6.38)
Browse files Browse the repository at this point in the history
patch -p1 < 200-omap-platform.patch
patch -p1 < 300-nokia-board.patch
patch -p1 < 301-nokia-board-additional.patch
patch -p1 < 310-n8x0-gpioswitch-input.patch
patch -p1 < 400-bluetooth-hci_h4p.patch
patch -p1 < 410-hci-h4p-fixes.patch
patch -p1 < 420-hci-h4p-interrupt-workaround.patch
patch -p1 < 500-cbus.patch
patch -p1 < 501-cbus-retu-irq-nr-fix.patch
patch -p1 < 505-cbus-retu-write-lock.patch
patch -p1 < 506-cbus-retu-irq-handler-locking.patch
patch -p1 < 510-cbus-retu-defines.patch
patch -p1 < 520-cbus-tahvo-defines.patch
patch -p1 < 530-cbus-retu-wdt-preemptible.patch
patch -p1 < 531-cbus-retu-wdt-fix-bitfield.patch
patch -p1 < 534-cbus-retu-wdt-remove-unused-interfaces.patch
patch -p1 < 535-cbus-retu-wdt-cleanup.patch
patch -p1 < 540-cbus-retu-wdt-remove-static-variables.patch
patch -p1 < 545-cbus-retu-wdt-constify-info-struct.patch
patch -p1 < 590-cbus-tahvo-usb-ptr-fix.patch
patch -p1 < 595-cbus-tahvo-usb-leak.patch
patch -p1 < 596-cbus-tahvo-usb-clk.patch
patch -p1 < 597-cbus-tahvo-usb-platform.patch
patch -p1 < 600-tsc2005.patch
patch -p1 < 710-evdev-events-without-grab.patch
patch -p1 < 810-mmc-fixes.patch
patch -p1 < 811-mmc-null-ptr-fix.patch
patch -p1 < 820-backlight-fixes.patch
patch -p1 < 830-omap2-serial-fixes.patch
patch -p1 < 850-musb-tusb-modular-fixes.patch
patch -p1 < 900-n810-battery-management.patch
  • Loading branch information
ssvb committed May 6, 2012
1 parent 4b7a6d2 commit f8d1fb2
Show file tree
Hide file tree
Showing 55 changed files with 9,731 additions and 47 deletions.
4 changes: 4 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,10 @@ source "net/Kconfig"

source "drivers/Kconfig"

if ARCH_OMAP
source "drivers/cbus/Kconfig"
endif

source "fs/Kconfig"

source "arch/arm/Kconfig.debug"
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ struct tag_acorn {
__u8 adfsdrives;
};

/* TI OMAP specific information */
#define ATAG_BOARD 0x414f4d50

struct tag_omap {
u8 data[0];
};

/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
#define ATAG_MEMCLK 0x41000402

Expand All @@ -161,6 +168,11 @@ struct tag {
*/
struct tag_acorn acorn;

/*
* OMAP specific
*/
struct tag_omap omap;

/*
* DC21285 specific
*/
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
hsmmc.o \
board-flash.o
obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0-lcd.o
obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
sdram-nokia.o \
hsmmc.o
Expand Down
159 changes: 159 additions & 0 deletions arch/arm/mach-omap2/board-n8x0-lcd.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
* linux/arch/arm/mach-omap2/board-n8x0.c
*
* Copyright (C) 2005-2009 Nokia Corporation
* Author: Juha Yrjola <[email protected]>
*
* Modified from mach-omap2/board-generic.c
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/omapfb.h>

#include <plat/lcd_mipid.h>
#include <plat/blizzard.h>

#include <../drivers/cbus/tahvo.h>

#define N8X0_BLIZZARD_POWERDOWN_GPIO 15

// MIPID LCD Panel

static void mipid_shutdown(struct mipid_platform_data *pdata)
{
if (pdata->nreset_gpio != -1) {
pr_info("shutdown LCD\n");
gpio_set_value(pdata->nreset_gpio, 0);
msleep(120);
}
}

static int n8x0_get_backlight_level(struct mipid_platform_data *pdata)
{
return tahvo_get_backlight_level();
}

static int n8x0_get_max_backlight_level(struct mipid_platform_data *pdata)
{
return tahvo_get_max_backlight_level();
}

static void n8x0_set_backlight_level(struct mipid_platform_data *pdata, int level)
{
tahvo_set_backlight_level(level);
}

struct mipid_platform_data n8x0_mipid_platform_data = {
.shutdown = mipid_shutdown,
.get_bklight_level = n8x0_get_backlight_level,
.set_bklight_level = n8x0_set_backlight_level,
.get_bklight_max = n8x0_get_max_backlight_level,
};

void __init n8x0_mipid_init(void)
{
const struct omap_lcd_config *conf;
int err;

conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
if (conf != NULL) {
n8x0_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
n8x0_mipid_platform_data.data_lines = conf->data_lines;
if (conf->nreset_gpio != -1) {
err = gpio_request(conf->nreset_gpio, "MIPID nreset");
if (err) {
printk(KERN_ERR "N8x0 MIPID failed to request nreset GPIO %d\n",
conf->nreset_gpio);
} else {
err = gpio_direction_output(conf->nreset_gpio, 1);
if (err) {
printk(KERN_ERR "N8x0 MIPID failed to set nreset GPIO %d\n",
conf->nreset_gpio);
}
}
}
printk(KERN_INFO "N8x0 MIPID config loaded");
}
else
printk(KERN_INFO "N8x0 MIPID config not provided");
}


// Epson Blizzard LCD Controller

static struct {
struct clk *sys_ck;
} blizzard;

static int blizzard_get_clocks(void)
{
blizzard.sys_ck = clk_get(0, "osc_ck");
if (IS_ERR(blizzard.sys_ck)) {
printk(KERN_ERR "can't get Blizzard clock\n");
return PTR_ERR(blizzard.sys_ck);
}
return 0;
}

static unsigned long blizzard_get_clock_rate(struct device *dev)
{
return clk_get_rate(blizzard.sys_ck);
}

static void blizzard_enable_clocks(int enable)
{
if (enable)
clk_enable(blizzard.sys_ck);
else
clk_disable(blizzard.sys_ck);
}

static void blizzard_power_up(struct device *dev)
{
/* Vcore to 1.475V */
tahvo_set_clear_reg_bits(0x07, 0, 0xf);
msleep(10);

blizzard_enable_clocks(1);
gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
}

static void blizzard_power_down(struct device *dev)
{
gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 0);
blizzard_enable_clocks(0);

/* Vcore to 1.005V */
tahvo_set_clear_reg_bits(0x07, 0xf, 0);
}

static struct blizzard_platform_data n8x0_blizzard_data = {
.power_up = blizzard_power_up,
.power_down = blizzard_power_down,
.get_clock_rate = blizzard_get_clock_rate,
.te_connected = 1,
};

void __init n8x0_blizzard_init(void)
{
int r;

r = gpio_request(N8X0_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
if (r < 0)
{
printk(KERN_ERR "Can't get N8x0 Blizzard powerdown GPIO %d\n", N8X0_BLIZZARD_POWERDOWN_GPIO);
return;
}
gpio_direction_output(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);

blizzard_get_clocks();
omapfb_set_ctrl_platform_data(&n8x0_blizzard_data);

printk(KERN_INFO "N8x0 Blizzard initialized");
}
Loading

0 comments on commit f8d1fb2

Please sign in to comment.