Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
918cae14
Commit
918cae14
authored
Feb 12, 2010
by
Tony Lindgren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-tony' of
git://gitorious.org/linux-omap-dss2/linux
into omap-for-linus
parents
0482e3c6
7f049ad1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
618 additions
and
12 deletions
+618
-12
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-am3517evm.c
+145
-0
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t35.c
+238
-1
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3evm.c
+235
-11
No files found.
arch/arm/mach-omap2/board-am3517evm.c
View file @
918cae14
...
@@ -29,9 +29,151 @@
...
@@ -29,9 +29,151 @@
#include <plat/board.h>
#include <plat/board.h>
#include <plat/common.h>
#include <plat/common.h>
#include <plat/usb.h>
#include <plat/usb.h>
#include <plat/display.h>
#include "mux.h"
#include "mux.h"
#define LCD_PANEL_PWR 176
#define LCD_PANEL_BKLIGHT_PWR 182
#define LCD_PANEL_PWM 181
static
int
lcd_enabled
;
static
int
dvi_enabled
;
static
void
__init
am3517_evm_display_init
(
void
)
{
int
r
;
omap_mux_init_gpio
(
LCD_PANEL_PWR
,
OMAP_PIN_INPUT_PULLUP
);
omap_mux_init_gpio
(
LCD_PANEL_BKLIGHT_PWR
,
OMAP_PIN_INPUT_PULLDOWN
);
omap_mux_init_gpio
(
LCD_PANEL_PWM
,
OMAP_PIN_INPUT_PULLDOWN
);
/*
* Enable GPIO 182 = LCD Backlight Power
*/
r
=
gpio_request
(
LCD_PANEL_BKLIGHT_PWR
,
"lcd_backlight_pwr"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_backlight_pwr
\n
"
);
return
;
}
gpio_direction_output
(
LCD_PANEL_BKLIGHT_PWR
,
1
);
/*
* Enable GPIO 181 = LCD Panel PWM
*/
r
=
gpio_request
(
LCD_PANEL_PWM
,
"lcd_pwm"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_pwm
\n
"
);
goto
err_1
;
}
gpio_direction_output
(
LCD_PANEL_PWM
,
1
);
/*
* Enable GPIO 176 = LCD Panel Power enable pin
*/
r
=
gpio_request
(
LCD_PANEL_PWR
,
"lcd_panel_pwr"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_pwr
\n
"
);
goto
err_2
;
}
gpio_direction_output
(
LCD_PANEL_PWR
,
1
);
printk
(
KERN_INFO
"Display initialized successfully
\n
"
);
return
;
err_2:
gpio_free
(
LCD_PANEL_PWM
);
err_1:
gpio_free
(
LCD_PANEL_BKLIGHT_PWR
);
}
static
int
am3517_evm_panel_enable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
if
(
dvi_enabled
)
{
printk
(
KERN_ERR
"cannot enable LCD, DVI is enabled
\n
"
);
return
-
EINVAL
;
}
gpio_set_value
(
LCD_PANEL_PWR
,
1
);
lcd_enabled
=
1
;
return
0
;
}
static
void
am3517_evm_panel_disable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
gpio_set_value
(
LCD_PANEL_PWR
,
0
);
lcd_enabled
=
0
;
}
static
struct
omap_dss_device
am3517_evm_lcd_device
=
{
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
name
=
"lcd"
,
.
driver_name
=
"sharp_lq_panel"
,
.
phy
.
dpi
.
data_lines
=
16
,
.
platform_enable
=
am3517_evm_panel_enable_lcd
,
.
platform_disable
=
am3517_evm_panel_disable_lcd
,
};
static
int
am3517_evm_panel_enable_tv
(
struct
omap_dss_device
*
dssdev
)
{
return
0
;
}
static
void
am3517_evm_panel_disable_tv
(
struct
omap_dss_device
*
dssdev
)
{
}
static
struct
omap_dss_device
am3517_evm_tv_device
=
{
.
type
=
OMAP_DISPLAY_TYPE_VENC
,
.
name
=
"tv"
,
.
driver_name
=
"venc"
,
.
phy
.
venc
.
type
=
OMAP_DSS_VENC_TYPE_SVIDEO
,
.
platform_enable
=
am3517_evm_panel_enable_tv
,
.
platform_disable
=
am3517_evm_panel_disable_tv
,
};
static
int
am3517_evm_panel_enable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
if
(
lcd_enabled
)
{
printk
(
KERN_ERR
"cannot enable DVI, LCD is enabled
\n
"
);
return
-
EINVAL
;
}
dvi_enabled
=
1
;
return
0
;
}
static
void
am3517_evm_panel_disable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
dvi_enabled
=
0
;
}
static
struct
omap_dss_device
am3517_evm_dvi_device
=
{
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
name
=
"dvi"
,
.
driver_name
=
"generic_panel"
,
.
phy
.
dpi
.
data_lines
=
24
,
.
platform_enable
=
am3517_evm_panel_enable_dvi
,
.
platform_disable
=
am3517_evm_panel_disable_dvi
,
};
static
struct
omap_dss_device
*
am3517_evm_dss_devices
[]
=
{
&
am3517_evm_lcd_device
,
&
am3517_evm_tv_device
,
&
am3517_evm_dvi_device
,
};
static
struct
omap_dss_board_info
am3517_evm_dss_data
=
{
.
num_devices
=
ARRAY_SIZE
(
am3517_evm_dss_devices
),
.
devices
=
am3517_evm_dss_devices
,
.
default_device
=
&
am3517_evm_lcd_device
,
};
struct
platform_device
am3517_evm_dss_device
=
{
.
name
=
"omapdss"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
am3517_evm_dss_data
,
},
};
/*
/*
* Board initialization
* Board initialization
*/
*/
...
@@ -39,6 +181,7 @@ static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
...
@@ -39,6 +181,7 @@ static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
};
};
static
struct
platform_device
*
am3517_evm_devices
[]
__initdata
=
{
static
struct
platform_device
*
am3517_evm_devices
[]
__initdata
=
{
&
am3517_evm_dss_device
,
};
};
static
void
__init
am3517_evm_init_irq
(
void
)
static
void
__init
am3517_evm_init_irq
(
void
)
...
@@ -78,6 +221,8 @@ static void __init am3517_evm_init(void)
...
@@ -78,6 +221,8 @@ static void __init am3517_evm_init(void)
omap_serial_init
();
omap_serial_init
();
usb_ehci_init
(
&
ehci_pdata
);
usb_ehci_init
(
&
ehci_pdata
);
/* DSS */
am3517_evm_display_init
();
}
}
static
void
__init
am3517_evm_map_io
(
void
)
static
void
__init
am3517_evm_map_io
(
void
)
...
...
arch/arm/mach-omap2/board-cm-t35.c
View file @
918cae14
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#include <linux/i2c/twl.h>
#include <linux/i2c/twl.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/machine.h>
#include <linux/spi/spi.h>
#include <linux/spi/tdo24m.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/map.h>
...
@@ -41,6 +44,7 @@
...
@@ -41,6 +44,7 @@
#include <plat/nand.h>
#include <plat/nand.h>
#include <plat/gpmc.h>
#include <plat/gpmc.h>
#include <plat/usb.h>
#include <plat/usb.h>
#include <plat/display.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
...
@@ -248,7 +252,6 @@ static inline void cm_t35_init_nand(void) {}
...
@@ -248,7 +252,6 @@ static inline void cm_t35_init_nand(void) {}
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
#include <linux/spi/ads7846.h>
#include <plat/mcspi.h>
#include <plat/mcspi.h>
...
@@ -304,6 +307,193 @@ static void __init cm_t35_init_ads7846(void)
...
@@ -304,6 +307,193 @@ static void __init cm_t35_init_ads7846(void)
static
inline
void
cm_t35_init_ads7846
(
void
)
{}
static
inline
void
cm_t35_init_ads7846
(
void
)
{}
#endif
#endif
#define CM_T35_LCD_EN_GPIO 157
#define CM_T35_LCD_BL_GPIO 58
#define CM_T35_DVI_EN_GPIO 54
static
int
lcd_bl_gpio
;
static
int
lcd_en_gpio
;
static
int
dvi_en_gpio
;
static
int
lcd_enabled
;
static
int
dvi_enabled
;
static
int
cm_t35_panel_enable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
if
(
dvi_enabled
)
{
printk
(
KERN_ERR
"cannot enable LCD, DVI is enabled
\n
"
);
return
-
EINVAL
;
}
gpio_set_value
(
lcd_en_gpio
,
1
);
gpio_set_value
(
lcd_bl_gpio
,
1
);
lcd_enabled
=
1
;
return
0
;
}
static
void
cm_t35_panel_disable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
lcd_enabled
=
0
;
gpio_set_value
(
lcd_bl_gpio
,
0
);
gpio_set_value
(
lcd_en_gpio
,
0
);
}
static
int
cm_t35_panel_enable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
if
(
lcd_enabled
)
{
printk
(
KERN_ERR
"cannot enable DVI, LCD is enabled
\n
"
);
return
-
EINVAL
;
}
gpio_set_value
(
dvi_en_gpio
,
0
);
dvi_enabled
=
1
;
return
0
;
}
static
void
cm_t35_panel_disable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
gpio_set_value
(
dvi_en_gpio
,
1
);
dvi_enabled
=
0
;
}
static
int
cm_t35_panel_enable_tv
(
struct
omap_dss_device
*
dssdev
)
{
return
0
;
}
static
void
cm_t35_panel_disable_tv
(
struct
omap_dss_device
*
dssdev
)
{
}
static
struct
omap_dss_device
cm_t35_lcd_device
=
{
.
name
=
"lcd"
,
.
driver_name
=
"toppoly_tdo35s_panel"
,
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
phy
.
dpi
.
data_lines
=
18
,
.
platform_enable
=
cm_t35_panel_enable_lcd
,
.
platform_disable
=
cm_t35_panel_disable_lcd
,
};
static
struct
omap_dss_device
cm_t35_dvi_device
=
{
.
name
=
"dvi"
,
.
driver_name
=
"generic_panel"
,
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
phy
.
dpi
.
data_lines
=
24
,
.
platform_enable
=
cm_t35_panel_enable_dvi
,
.
platform_disable
=
cm_t35_panel_disable_dvi
,
};
static
struct
omap_dss_device
cm_t35_tv_device
=
{
.
name
=
"tv"
,
.
driver_name
=
"venc"
,
.
type
=
OMAP_DISPLAY_TYPE_VENC
,
.
phy
.
venc
.
type
=
OMAP_DSS_VENC_TYPE_SVIDEO
,
.
platform_enable
=
cm_t35_panel_enable_tv
,
.
platform_disable
=
cm_t35_panel_disable_tv
,
};
static
struct
omap_dss_device
*
cm_t35_dss_devices
[]
=
{
&
cm_t35_lcd_device
,
&
cm_t35_dvi_device
,
&
cm_t35_tv_device
,
};
static
struct
omap_dss_board_info
cm_t35_dss_data
=
{
.
num_devices
=
ARRAY_SIZE
(
cm_t35_dss_devices
),
.
devices
=
cm_t35_dss_devices
,
.
default_device
=
&
cm_t35_dvi_device
,
};
static
struct
platform_device
cm_t35_dss_device
=
{
.
name
=
"omapdss"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
cm_t35_dss_data
,
},
};
static
struct
omap2_mcspi_device_config
tdo24m_mcspi_config
=
{
.
turbo_mode
=
0
,
.
single_channel
=
1
,
/* 0: slave, 1: master */
};
static
struct
tdo24m_platform_data
tdo24m_config
=
{
.
model
=
TDO35S
,
};
static
struct
spi_board_info
cm_t35_lcd_spi_board_info
[]
__initdata
=
{
{
.
modalias
=
"tdo24m"
,
.
bus_num
=
4
,
.
chip_select
=
0
,
.
max_speed_hz
=
1000000
,
.
controller_data
=
&
tdo24m_mcspi_config
,
.
platform_data
=
&
tdo24m_config
,
},
};
static
void
__init
cm_t35_init_display
(
void
)
{
int
err
;
lcd_en_gpio
=
CM_T35_LCD_EN_GPIO
;
lcd_bl_gpio
=
CM_T35_LCD_BL_GPIO
;
dvi_en_gpio
=
CM_T35_DVI_EN_GPIO
;
spi_register_board_info
(
cm_t35_lcd_spi_board_info
,
ARRAY_SIZE
(
cm_t35_lcd_spi_board_info
));
err
=
gpio_request
(
lcd_en_gpio
,
"LCD RST"
);
if
(
err
)
{
pr_err
(
"CM-T35: failed to get LCD reset GPIO
\n
"
);
goto
out
;
}
err
=
gpio_request
(
lcd_bl_gpio
,
"LCD BL"
);
if
(
err
)
{
pr_err
(
"CM-T35: failed to get LCD backlight control GPIO
\n
"
);
goto
err_lcd_bl
;
}
err
=
gpio_request
(
dvi_en_gpio
,
"DVI EN"
);
if
(
err
)
{
pr_err
(
"CM-T35: failed to get DVI reset GPIO
\n
"
);
goto
err_dvi_en
;
}
gpio_export
(
lcd_en_gpio
,
0
);
gpio_export
(
lcd_bl_gpio
,
0
);
gpio_export
(
dvi_en_gpio
,
0
);
gpio_direction_output
(
lcd_en_gpio
,
0
);
gpio_direction_output
(
lcd_bl_gpio
,
0
);
gpio_direction_output
(
dvi_en_gpio
,
1
);
msleep
(
50
);
gpio_set_value
(
lcd_en_gpio
,
1
);
err
=
platform_device_register
(
&
cm_t35_dss_device
);
if
(
err
)
{
pr_err
(
"CM-T35: failed to register DSS device
\n
"
);
goto
err_dev_reg
;
}
return
;
err_dev_reg:
gpio_free
(
dvi_en_gpio
);
err_dvi_en:
gpio_free
(
lcd_bl_gpio
);
err_lcd_bl:
gpio_free
(
lcd_en_gpio
);
out:
return
;
}
static
struct
regulator_consumer_supply
cm_t35_vmmc1_supply
=
{
static
struct
regulator_consumer_supply
cm_t35_vmmc1_supply
=
{
.
supply
=
"vmmc"
,
.
supply
=
"vmmc"
,
};
};
...
@@ -312,6 +502,16 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = {
...
@@ -312,6 +502,16 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = {
.
supply
=
"vmmc_aux"
,
.
supply
=
"vmmc_aux"
,
};
};
static
struct
regulator_consumer_supply
cm_t35_vdac_supply
=
{
.
supply
=
"vdda_dac"
,
.
dev
=
&
cm_t35_dss_device
.
dev
,
};
static
struct
regulator_consumer_supply
cm_t35_vdvi_supply
=
{
.
supply
=
"vdvi"
,
.
dev
=
&
cm_t35_dss_device
.
dev
,
};
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static
struct
regulator_init_data
cm_t35_vmmc1
=
{
static
struct
regulator_init_data
cm_t35_vmmc1
=
{
.
constraints
=
{
.
constraints
=
{
...
@@ -342,6 +542,35 @@ static struct regulator_init_data cm_t35_vsim = {
...
@@ -342,6 +542,35 @@ static struct regulator_init_data cm_t35_vsim = {
.
consumer_supplies
=
&
cm_t35_vsim_supply
,
.
consumer_supplies
=
&
cm_t35_vsim_supply
,
};
};
/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
static
struct
regulator_init_data
cm_t35_vdac
=
{
.
constraints
=
{
.
min_uV
=
1800000
,
.
max_uV
=
1800000
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_STANDBY
,
.
valid_ops_mask
=
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
.
consumer_supplies
=
&
cm_t35_vdac_supply
,
};
/* VPLL2 for digital video outputs */
static
struct
regulator_init_data
cm_t35_vpll2
=
{
.
constraints
=
{
.
name
=
"VDVI"
,
.
min_uV
=
1800000
,
.
max_uV
=
1800000
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_STANDBY
,
.
valid_ops_mask
=
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
.
consumer_supplies
=
&
cm_t35_vdvi_supply
,
};
static
struct
twl4030_usb_data
cm_t35_usb_data
=
{
static
struct
twl4030_usb_data
cm_t35_usb_data
=
{
.
usb_mode
=
T2_USB_MODE_ULPI
,
.
usb_mode
=
T2_USB_MODE_ULPI
,
};
};
...
@@ -445,6 +674,8 @@ static struct twl4030_platform_data cm_t35_twldata = {
...
@@ -445,6 +674,8 @@ static struct twl4030_platform_data cm_t35_twldata = {
.
gpio
=
&
cm_t35_gpio_data
,
.
gpio
=
&
cm_t35_gpio_data
,
.
vmmc1
=
&
cm_t35_vmmc1
,
.
vmmc1
=
&
cm_t35_vmmc1
,
.
vsim
=
&
cm_t35_vsim
,
.
vsim
=
&
cm_t35_vsim
,
.
vdac
=
&
cm_t35_vdac
,
.
vpll2
=
&
cm_t35_vpll2
,
};
};
static
struct
i2c_board_info
__initdata
cm_t35_i2c_boardinfo
[]
=
{
static
struct
i2c_board_info
__initdata
cm_t35_i2c_boardinfo
[]
=
{
...
@@ -568,6 +799,11 @@ static struct omap_board_mux board_mux[] __initdata = {
...
@@ -568,6 +799,11 @@ static struct omap_board_mux board_mux[] __initdata = {
OMAP3_MUX
(
DSS_DATA22
,
OMAP_MUX_MODE0
|
OMAP_PIN_OUTPUT
),
OMAP3_MUX
(
DSS_DATA22
,
OMAP_MUX_MODE0
|
OMAP_PIN_OUTPUT
),
OMAP3_MUX
(
DSS_DATA23
,
OMAP_MUX_MODE0
|
OMAP_PIN_OUTPUT
),
OMAP3_MUX
(
DSS_DATA23
,
OMAP_MUX_MODE0
|
OMAP_PIN_OUTPUT
),
/* display controls */
OMAP3_MUX
(
MCBSP1_FSR
,
OMAP_MUX_MODE4
|
OMAP_PIN_OUTPUT
),
OMAP3_MUX
(
GPMC_NCS7
,
OMAP_MUX_MODE4
|
OMAP_PIN_OUTPUT
),
OMAP3_MUX
(
GPMC_NCS3
,
OMAP_MUX_MODE4
|
OMAP_PIN_OUTPUT
),
/* TPS IRQ */
/* TPS IRQ */
OMAP3_MUX
(
SYS_NIRQ
,
OMAP_MUX_MODE0
|
OMAP_WAKEUP_EN
|
\
OMAP3_MUX
(
SYS_NIRQ
,
OMAP_MUX_MODE0
|
OMAP_WAKEUP_EN
|
\
OMAP_PIN_INPUT_PULLUP
),
OMAP_PIN_INPUT_PULLUP
),
...
@@ -584,6 +820,7 @@ static void __init cm_t35_init(void)
...
@@ -584,6 +820,7 @@ static void __init cm_t35_init(void)
cm_t35_init_ads7846
();
cm_t35_init_ads7846
();
cm_t35_init_ethernet
();
cm_t35_init_ethernet
();
cm_t35_init_led
();
cm_t35_init_led
();
cm_t35_init_display
();
usb_musb_init
();
usb_musb_init
();
}
}
...
...
arch/arm/mach-omap2/board-omap3evm.c
View file @
918cae14
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include <plat/usb.h>
#include <plat/usb.h>
#include <plat/common.h>
#include <plat/common.h>
#include <plat/mcspi.h>
#include <plat/mcspi.h>
#include <plat/display.h>
#include "mux.h"
#include "mux.h"
#include "sdram-micron-mt46h32m32lf-6.h"
#include "sdram-micron-mt46h32m32lf-6.h"
...
@@ -147,6 +148,187 @@ static inline void __init omap3evm_init_smsc911x(void)
...
@@ -147,6 +148,187 @@ static inline void __init omap3evm_init_smsc911x(void)
static
inline
void
__init
omap3evm_init_smsc911x
(
void
)
{
return
;
}
static
inline
void
__init
omap3evm_init_smsc911x
(
void
)
{
return
;
}
#endif
#endif
/*
* OMAP3EVM LCD Panel control signals
*/
#define OMAP3EVM_LCD_PANEL_LR 2
#define OMAP3EVM_LCD_PANEL_UD 3
#define OMAP3EVM_LCD_PANEL_INI 152
#define OMAP3EVM_LCD_PANEL_ENVDD 153
#define OMAP3EVM_LCD_PANEL_QVGA 154
#define OMAP3EVM_LCD_PANEL_RESB 155
#define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
#define OMAP3EVM_DVI_PANEL_EN_GPIO 199
static
int
lcd_enabled
;
static
int
dvi_enabled
;
static
void
__init
omap3_evm_display_init
(
void
)
{
int
r
;
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_RESB
,
"lcd_panel_resb"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_resb
\n
"
);
return
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_RESB
,
1
);
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_INI
,
"lcd_panel_ini"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_ini
\n
"
);
goto
err_1
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_INI
,
1
);
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_QVGA
,
"lcd_panel_qvga"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_qvga
\n
"
);
goto
err_2
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_QVGA
,
0
);
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_LR
,
"lcd_panel_lr"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_lr
\n
"
);
goto
err_3
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_LR
,
1
);
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_UD
,
"lcd_panel_ud"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_ud
\n
"
);
goto
err_4
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_UD
,
1
);
r
=
gpio_request
(
OMAP3EVM_LCD_PANEL_ENVDD
,
"lcd_panel_envdd"
);
if
(
r
)
{
printk
(
KERN_ERR
"failed to get lcd_panel_envdd
\n
"
);
goto
err_5
;
}
gpio_direction_output
(
OMAP3EVM_LCD_PANEL_ENVDD
,
0
);
return
;
err_5:
gpio_free
(
OMAP3EVM_LCD_PANEL_UD
);
err_4:
gpio_free
(
OMAP3EVM_LCD_PANEL_LR
);
err_3:
gpio_free
(
OMAP3EVM_LCD_PANEL_QVGA
);
err_2:
gpio_free
(
OMAP3EVM_LCD_PANEL_INI
);
err_1:
gpio_free
(
OMAP3EVM_LCD_PANEL_RESB
);
}
static
int
omap3_evm_enable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
if
(
dvi_enabled
)
{
printk
(
KERN_ERR
"cannot enable LCD, DVI is enabled
\n
"
);
return
-
EINVAL
;
}
gpio_set_value
(
OMAP3EVM_LCD_PANEL_ENVDD
,
0
);
if
(
get_omap3_evm_rev
()
>=
OMAP3EVM_BOARD_GEN_2
)
gpio_set_value
(
OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO
,
0
);
else
gpio_set_value
(
OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO
,
1
);
lcd_enabled
=
1
;
return
0
;
}
static
void
omap3_evm_disable_lcd
(
struct
omap_dss_device
*
dssdev
)
{
gpio_set_value
(
OMAP3EVM_LCD_PANEL_ENVDD
,
1
);
if
(
get_omap3_evm_rev
()
>=
OMAP3EVM_BOARD_GEN_2
)
gpio_set_value
(
OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO
,
1
);
else
gpio_set_value
(
OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO
,
0
);
lcd_enabled
=
0
;
}
static
struct
omap_dss_device
omap3_evm_lcd_device
=
{
.
name
=
"lcd"
,
.
driver_name
=
"sharp_ls_panel"
,
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
phy
.
dpi
.
data_lines
=
18
,
.
platform_enable
=
omap3_evm_enable_lcd
,
.
platform_disable
=
omap3_evm_disable_lcd
,
};
static
int
omap3_evm_enable_tv
(
struct
omap_dss_device
*
dssdev
)
{
return
0
;
}
static
void
omap3_evm_disable_tv
(
struct
omap_dss_device
*
dssdev
)
{
}
static
struct
omap_dss_device
omap3_evm_tv_device
=
{
.
name
=
"tv"
,
.
driver_name
=
"venc"
,
.
type
=
OMAP_DISPLAY_TYPE_VENC
,
.
phy
.
venc
.
type
=
OMAP_DSS_VENC_TYPE_SVIDEO
,
.
platform_enable
=
omap3_evm_enable_tv
,
.
platform_disable
=
omap3_evm_disable_tv
,
};
static
int
omap3_evm_enable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
if
(
lcd_enabled
)
{
printk
(
KERN_ERR
"cannot enable DVI, LCD is enabled
\n
"
);
return
-
EINVAL
;
}
gpio_set_value
(
OMAP3EVM_DVI_PANEL_EN_GPIO
,
1
);
dvi_enabled
=
1
;
return
0
;
}
static
void
omap3_evm_disable_dvi
(
struct
omap_dss_device
*
dssdev
)
{
gpio_set_value
(
OMAP3EVM_DVI_PANEL_EN_GPIO
,
0
);
dvi_enabled
=
0
;
}
static
struct
omap_dss_device
omap3_evm_dvi_device
=
{
.
name
=
"dvi"
,
.
driver_name
=
"generic_panel"
,
.
type
=
OMAP_DISPLAY_TYPE_DPI
,
.
phy
.
dpi
.
data_lines
=
24
,
.
platform_enable
=
omap3_evm_enable_dvi
,
.
platform_disable
=
omap3_evm_disable_dvi
,
};
static
struct
omap_dss_device
*
omap3_evm_dss_devices
[]
=
{
&
omap3_evm_lcd_device
,
&
omap3_evm_tv_device
,
&
omap3_evm_dvi_device
,
};
static
struct
omap_dss_board_info
omap3_evm_dss_data
=
{
.
num_devices
=
ARRAY_SIZE
(
omap3_evm_dss_devices
),
.
devices
=
omap3_evm_dss_devices
,
.
default_device
=
&
omap3_evm_lcd_device
,
};
static
struct
platform_device
omap3_evm_dss_device
=
{
.
name
=
"omapdss"
,
.
id
=
-
1
,
.
dev
=
{
.
platform_data
=
&
omap3_evm_dss_data
,
},
};
static
struct
regulator_consumer_supply
omap3evm_vmmc1_supply
=
{
static
struct
regulator_consumer_supply
omap3evm_vmmc1_supply
=
{
.
supply
=
"vmmc"
,
.
supply
=
"vmmc"
,
};
};
...
@@ -236,6 +418,14 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
...
@@ -236,6 +418,14 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
* the P2 connector; notably LEDA for the LCD backlight.
* the P2 connector; notably LEDA for the LCD backlight.
*/
*/
/* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
gpio_request
(
gpio
+
TWL4030_GPIO_MAX
,
"EN_LCD_BKL"
);
gpio_direction_output
(
gpio
+
TWL4030_GPIO_MAX
,
0
);
/* gpio + 7 == DVI Enable */
gpio_request
(
gpio
+
7
,
"EN_DVI"
);
gpio_direction_output
(
gpio
+
7
,
0
);
/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
/* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */
gpio_leds
[
2
].
gpio
=
gpio
+
TWL4030_GPIO_MAX
+
1
;
gpio_leds
[
2
].
gpio
=
gpio
+
TWL4030_GPIO_MAX
+
1
;
...
@@ -300,6 +490,47 @@ static struct twl4030_codec_data omap3evm_codec_data = {
...
@@ -300,6 +490,47 @@ static struct twl4030_codec_data omap3evm_codec_data = {
.
audio
=
&
omap3evm_audio_data
,
.
audio
=
&
omap3evm_audio_data
,
};
};
static
struct
regulator_consumer_supply
omap3_evm_vdda_dac_supply
=
{
.
supply
=
"vdda_dac"
,
.
dev
=
&
omap3_evm_dss_device
.
dev
,
};
/* VDAC for DSS driving S-Video */
static
struct
regulator_init_data
omap3_evm_vdac
=
{
.
constraints
=
{
.
min_uV
=
1800000
,
.
max_uV
=
1800000
,
.
apply_uV
=
true
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_STANDBY
,
.
valid_ops_mask
=
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
.
consumer_supplies
=
&
omap3_evm_vdda_dac_supply
,
};
/* VPLL2 for digital video outputs */
static
struct
regulator_consumer_supply
omap3_evm_vpll2_supply
=
{
.
supply
=
"vdvi"
,
.
dev
=
&
omap3_evm_lcd_device
.
dev
,
};
static
struct
regulator_init_data
omap3_evm_vpll2
=
{
.
constraints
=
{
.
name
=
"VDVI"
,
.
min_uV
=
1800000
,
.
max_uV
=
1800000
,
.
apply_uV
=
true
,
.
valid_modes_mask
=
REGULATOR_MODE_NORMAL
|
REGULATOR_MODE_STANDBY
,
.
valid_ops_mask
=
REGULATOR_CHANGE_MODE
|
REGULATOR_CHANGE_STATUS
,
},
.
num_consumer_supplies
=
1
,
.
consumer_supplies
=
&
omap3_evm_vpll2_supply
,
};
static
struct
twl4030_platform_data
omap3evm_twldata
=
{
static
struct
twl4030_platform_data
omap3evm_twldata
=
{
.
irq_base
=
TWL4030_IRQ_BASE
,
.
irq_base
=
TWL4030_IRQ_BASE
,
.
irq_end
=
TWL4030_IRQ_END
,
.
irq_end
=
TWL4030_IRQ_END
,
...
@@ -310,6 +541,8 @@ static struct twl4030_platform_data omap3evm_twldata = {
...
@@ -310,6 +541,8 @@ static struct twl4030_platform_data omap3evm_twldata = {
.
usb
=
&
omap3evm_usb_data
,
.
usb
=
&
omap3evm_usb_data
,
.
gpio
=
&
omap3evm_gpio_data
,
.
gpio
=
&
omap3evm_gpio_data
,
.
codec
=
&
omap3evm_codec_data
,
.
codec
=
&
omap3evm_codec_data
,
.
vdac
=
&
omap3_evm_vdac
,
.
vpll2
=
&
omap3_evm_vpll2
,
};
};
static
struct
i2c_board_info
__initdata
omap3evm_i2c_boardinfo
[]
=
{
static
struct
i2c_board_info
__initdata
omap3evm_i2c_boardinfo
[]
=
{
...
@@ -337,15 +570,6 @@ static int __init omap3_evm_i2c_init(void)
...
@@ -337,15 +570,6 @@ static int __init omap3_evm_i2c_init(void)
return
0
;
return
0
;
}
}
static
struct
platform_device
omap3_evm_lcd_device
=
{
.
name
=
"omap3evm_lcd"
,
.
id
=
-
1
,
};
static
struct
omap_lcd_config
omap3_evm_lcd_config
__initdata
=
{
.
ctrl_name
=
"internal"
,
};
static
void
ads7846_dev_init
(
void
)
static
void
ads7846_dev_init
(
void
)
{
{
if
(
gpio_request
(
OMAP3_EVM_TS_GPIO
,
"ADS7846 pendown"
)
<
0
)
if
(
gpio_request
(
OMAP3_EVM_TS_GPIO
,
"ADS7846 pendown"
)
<
0
)
...
@@ -393,7 +617,6 @@ struct spi_board_info omap3evm_spi_board_info[] = {
...
@@ -393,7 +617,6 @@ struct spi_board_info omap3evm_spi_board_info[] = {
};
};
static
struct
omap_board_config_kernel
omap3_evm_config
[]
__initdata
=
{
static
struct
omap_board_config_kernel
omap3_evm_config
[]
__initdata
=
{
{
OMAP_TAG_LCD
,
&
omap3_evm_lcd_config
},
};
};
static
void
__init
omap3_evm_init_irq
(
void
)
static
void
__init
omap3_evm_init_irq
(
void
)
...
@@ -406,7 +629,7 @@ static void __init omap3_evm_init_irq(void)
...
@@ -406,7 +629,7 @@ static void __init omap3_evm_init_irq(void)
}
}
static
struct
platform_device
*
omap3_evm_devices
[]
__initdata
=
{
static
struct
platform_device
*
omap3_evm_devices
[]
__initdata
=
{
&
omap3_evm_
lcd
_device
,
&
omap3_evm_
dss
_device
,
};
};
static
struct
ehci_hcd_omap_platform_data
ehci_pdata
__initconst
=
{
static
struct
ehci_hcd_omap_platform_data
ehci_pdata
__initconst
=
{
...
@@ -473,6 +696,7 @@ static void __init omap3_evm_init(void)
...
@@ -473,6 +696,7 @@ static void __init omap3_evm_init(void)
usb_ehci_init
(
&
ehci_pdata
);
usb_ehci_init
(
&
ehci_pdata
);
ads7846_dev_init
();
ads7846_dev_init
();
omap3evm_init_smsc911x
();
omap3evm_init_smsc911x
();
omap3_evm_display_init
();
}
}
static
void
__init
omap3_evm_map_io
(
void
)
static
void
__init
omap3_evm_map_io
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment