unsigned int val = 0;
unsigned int power_key, auto_download = 0;
- val = ~(gpio_get_value(&gpio2->x2, 1));
+ /* volume down */
+ val = !(gpio_get_value(&gpio2->x2, 1));
power_key = pmic_get_irq(PWRONR);
static void lcd_cfg_gpio(void)
{
unsigned int i;
- struct swi_platform_data swi_pd;
for (i = 0; i < 8; i++) {
/* set GPF0,1,2[0:7] for RGB Interface and Data lines (32bit) */
gpio_set_pull(&gpio1->f0, i, GPIO_PULL_NONE);
/* LED_BACKLIGHT_PWM */
- swi_pd.swi_bank = &gpio1->d0;
- swi_pd.controller_data = 1;
- gpio_cfg_pin(&gpio1->d0, swi_pd.controller_data, GPIO_FUNC(2));
+ nt39411_pd.swi.swi_bank = &gpio1->d0;
+ nt39411_pd.swi.controller_data = 0;
+ gpio_cfg_pin(&gpio1->d0, nt39411_pd.swi.controller_data, GPIO_FUNC(2));
/* LVDS_nSHDN */
gpio_direction_output(&gpio1->e1, 5, 1);
/* LCD_LDO_EN */
gpio_direction_output(&gpio1->e2, 3, 1);
- swi_pd.low_period = 30;
- swi_pd.high_period = 30;
- swi_set_platform_data(&swi_pd);
+ nt39411_pd.swi.low_period = 30;
+ nt39411_pd.swi.high_period = 30;
return;
}
void init_panel_info(vidinfo_t *vid)
{
vid->vl_freq = 60;
- vid->vl_col = 600;
- vid->vl_row = 1024;
- vid->vl_width = 600;
- vid->vl_height = 1024;
+ vid->vl_col = 1024;
+ vid->vl_row = 600;
+ vid->vl_width = 1024;
+ vid->vl_height = 600;
vid->vl_clkp = CONFIG_SYS_LOW;
vid->vl_hsp = CONFIG_SYS_HIGH;
vid->vl_vsp = CONFIG_SYS_HIGH;
vid->vl_dp = CONFIG_SYS_LOW;
+ vid->vl_bpix = 32;
vid->enable_ldo = nt39411_send_intensity;
/* NT39411 LCD Panel */
vid->reset_delay = 0;
vid->interface_mode = FIMD_RGB_INTERFACE;
nt39411_pd.brightness = NT39411_DEFAULT_INTENSITY;
- nt39411_pd.a_onoff = A1_A2_ON;
- nt39411_pd.b_onoff = B1_B2_ALL_ON;
+ nt39411_pd.a_onoff = A1_ON;
+ nt39411_pd.b_onoff = B1_ON;
nt39411_set_platform_data(&nt39411_pd);
setenv("lcdinfo", "lcd=nt39411");
}
struct swi_platform_data *swi;
-int swi_transfer_command(unsigned int command)
+int swi_transfer_command(struct swi_platform_data *swi, unsigned int command)
{
switch (command) {
case SWI_LOW:
return 1;
}
-
-/*
- * register SWI devices for a given board.
- *
- * @info : array of chip descriptors.
- * @n : how many descriptors are provided.
- */
-void swi_set_platform_data(struct swi_platform_data *pd)
-{
- if (pd == NULL) {
- printf("pd is NULL.\n");
- return;
- }
-
- swi = pd;
-}
/* A1-A3 current select */
for (i = 0; i < A1_A3_CURRENT; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
for (i = 0; i < gamma_table_10[level]; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
/* B1-B2 current select */
for (i = 0; i < B1_B2_CURRENT; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
for (i = 0; i < gamma_table_10[level]; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
if (first) {
/* A1-A3 on/off select */
for (i = 0; i < A1_A3_ONOFF; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
/* A1-A3 all on */
for (i = 0; i < nt39411->a_onoff; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
/* B1-B2 on/off select */
for (i = 0; i < B1_B2_ONOFF; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
udelay(500);
/* B1-B2 all on */
for (i = 0; i < nt39411->b_onoff; i++)
- swi_transfer_command(SWI_CHANGE);
+ swi_transfer_command(&nt39411->swi, SWI_CHANGE);
first = 0;
}
#define CONFIG_SYS_DOWN_ADDR CONFIG_SYS_SDRAM_BASE
/* LCD */
-#if 0
+#if 1
#define CONFIG_LCD 1
#define CONFIG_FB_ADDR 0x52504000
#define CONFIG_S5PC1XXFB 1
#define _NT39411_H_
struct nt39411_platform_data {
+ struct swi_platform_data swi;
int a_onoff;
int b_onoff;
unsigned int brightness;
#define A1_A3_ALL_OFF 1
#define B1_B2_ALL_ON 4
-#define B1_ON_B2_OFF 3
-#define B1_OFF_B2_ON 2
-#define B1_OFF_B2_OFF 1
+#define B1_ON 3
+#define B2_ON 2
+#define B1_B2_ALL_OFF 1
void nt39411_set_platform_data(struct nt39411_platform_data *pd);
void nt39411_send_intensity(void);
};
-int swi_transfer_command(unsigned int command);
-void swi_set_platform_data(struct swi_platform_data *pd);
+int swi_transfer_command(struct swi_platform_data *swi, unsigned int command);
#endif /*_SWI_H_*/