Skip to content

Commit

Permalink
Add changes from LG's p990 v30a drop
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcc committed Dec 11, 2012
1 parent 75aa604 commit c3cd6ce
Show file tree
Hide file tree
Showing 47 changed files with 7,680 additions and 145 deletions.
32 changes: 29 additions & 3 deletions arch/arm/mach-tegra/include/mach/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,29 @@

#include <linux/types.h>
#include <linux/spi/spi.h>
#if defined(CONFIG_MACH_STAR_P999)
typedef void (*callback)(struct spi_device *spi);

/**
* register_spi_slave_callback - registers notification callback provided by
* the client.
* This callback indicate that the controller is all set to receive/transfer
* data.
* @spi: struct spi_device - refer to linux/spi/spi.h
* @func: Callback function
* Context: can not sleep
*/
int spi_tegra_register_callback(struct spi_device *spi, callback func);

#if defined(CONFIG_MACH_BSSQ) || defined(CONFIG_MACH_STAR_P999)
//
void spi_tegra_abort_transfer(struct spi_device *spi);
bool spi_tegra_is_suspended(struct spi_device *spi);
//extern bool spi_tegra_suspend_failed(struct spi_device *spi);
//
#endif

#else
typedef int (*callback)(void *client_data);

/**
Expand All @@ -39,12 +61,16 @@ typedef int (*callback)(void *client_data);
int spi_tegra_register_callback(struct spi_device *spi, callback func,
void *client_data);

#ifdef CONFIG_MACH_BSSQ
// 20110628 youngjin.yoo@lge.com added spi control function [S]
#if defined(CONFIG_MACH_BSSQ) || defined(CONFIG_MACH_STAR_P999)
//
void spi_tegra_abort_transfer(struct spi_device *spi);
bool spi_tegra_is_suspended(struct spi_device *spi);
//extern bool spi_tegra_suspend_failed(struct spi_device *spi);
// 20110628 youngjin.yoo@lge.com added spi control function [E]
//
#endif

#endif



#endif
46 changes: 43 additions & 3 deletions arch/arm/mach-tegra/lge/star/board-star-baseband.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,76 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/tegra_caif.h>
#include <lge/board-star-baseband.h> // 20120202 jisil.park@lge.com
#include <lge/board-star-baseband.h> //

// 20120202 jisil.park@lge.com Add SPI [START]
//
/****************************************************************************************************
* SPI devices
****************************************************************************************************/
static struct spi_board_info __initdata spi_bus1_devices_info[] = {
{
#ifdef CONFIG_MACH_STAR_P999
.modalias = "mdm6600",
#else
.modalias = "ifxn721",
#endif
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_1,
.max_speed_hz = 24000000,
#ifdef CONFIG_MACH_STAR_P999
.controller_data = &tegra_spi_slave_device1,
#endif
//.controller_data = &tegra_spi_device1,
.irq = 0, // 277 ? GPIO_IRQ(TEGRA_GPIO_PO5),
.platform_data = 0,
},

};


#ifdef CONFIG_MACH_STAR_P999
#ifdef CONFIG_DUAL_SPI
static struct spi_board_info __initdata spi_bus2_devices_info[] = {
{
.modalias = "mdm6600",
.bus_num = 1,
.chip_select = 1,
.mode = SPI_MODE_1,
.max_speed_hz = 24000000,
.controller_data = &tegra_spi_slave_device2,
.irq = 0,
.platform_data = 0,
},
};
#endif
#endif


static int spi_init(void)
{
#ifdef CONFIG_MACH_STAR_P999
platform_device_register(&tegra_spi_slave_device1);

#ifdef CONFIG_DUAL_SPI
platform_device_register(&tegra_spi_slave_device2);
#endif

spi_register_board_info(spi_bus1_devices_info, ARRAY_SIZE(spi_bus1_devices_info));

#ifdef CONFIG_DUAL_SPI
spi_register_board_info(spi_bus2_devices_info, ARRAY_SIZE(spi_bus2_devices_info));
#endif
#else
platform_device_register(&tegra_spi_device1);
//platform_device_register(&tegra_spi_device3);

spi_register_board_info(spi_bus1_devices_info, ARRAY_SIZE(spi_bus1_devices_info));
#endif
return 0;
}

// 20120202 jisil.park@lge.com Add SPI [END]
//


unsigned long baseband_type = BOARD_WHISTLER_BASEBAND_U3XX;
Expand Down
26 changes: 13 additions & 13 deletions arch/arm/mach-tegra/lge/star/board-star-gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@
#include <mach-tegra/devices.h>
#include <mach-tegra/gpio-names.h>

/* LGE_CHANGE_S youngseok@lge.com
모델 회로도에서 GPS가 사용하는 RESET/ POWERON(STANDBY) 를 확인, LNA는 추후 확인.
B2(P940)' ( kernel manager :엄주관 J)
GPS_PWR_ON : KB_ROW6 / GPIO_PJ2
GPS_RESET_N : KB_ROW7 / GPIO_PJ0
/*
GPS_UART_TXD : UART4
GPS_UART_RXD : UART4
GPS_UART_RTS_N : UART4
GPS_UART_CTS_N : UART4
LGE_CHANGE_E youngseok@lge.com */
/* LGE_CHANGE_S 20111104 gsd5xp dongseon.kim@lge.com
26MHz_GPS_REF_EN : GMI_AD8 / GPIO_H00
LGE_CHANGE_S 20111104 gsd5xp dongseon.kim@lge.com */
*/

/*
*/

struct gps_gpio_platform_data gps_pdata = {
.pwron = TEGRA_GPIO_PJ2,
Expand Down
8 changes: 5 additions & 3 deletions arch/arm/mach-tegra/lge/star/board-star-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ static int star_wakeup_key(void);
.wakeup = _iswake, \
.debounce_interval = 10, \
}

static struct gpio_keys_button star_keys[] = {
#if defined(CONFIG_MACH_STAR_SU660)
GPIO_KEY(KEY_HOME, PV6, 1),
Expand Down Expand Up @@ -85,10 +84,13 @@ static int star_wakeup_key(void)
status = readl(IO_ADDRESS(TEGRA_PMC_BASE) + PMC_WAKE_STATUS);

printk("star_wakeup_key : status %lu\n", status);

// HONGIK JE.PARK HOME KEY remove
#if defined(CONFIG_MACH_STAR_P990) || defined(CONFIG_MACH_STAR_P999)
return status & TEGRA_WAKE_GPIO_PV2 ? KEY_POWER : KEY_RESERVED;
#else
return (status & TEGRA_WAKE_GPIO_PV2) ? KEY_POWER :
(status & TEGRA_WAKE_GPIO_PV6) ? KEY_HOME : KEY_RESERVED;
#endif
// return status & TEGRA_WAKE_GPIO_PV2 ? KEY_POWER : KEY_RESERVED;
}

Expand Down
7 changes: 5 additions & 2 deletions arch/arm/mach-tegra/lge/star/board-star-panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static int star_panel_postpoweron(void)
// ???
gpio_set_value(STAR_HITACHI_LCD_CS, 0);
gpio_set_value(STAR_HITACHI_LCD_CS, 1);
mdelay(1);
// mdelay(1);
//
if (!reg_lcd_1v8) {
reg_lcd_1v8 = regulator_get_exclusive(NULL, "vcc_lcd_1v8");
Expand All @@ -629,8 +629,8 @@ static int star_panel_postpoweron(void)
if(!regulator_is_enabled(reg_lcd_vdd))
regulator_enable(reg_lcd_vdd);

mdelay(1);
gpio_set_value(STAR_HITACHI_LCD_RESET, 1);

mdelay(10);

gpio_direction_output(STAR_HITACHI_LCD_CS, 1);
Expand Down Expand Up @@ -1085,6 +1085,9 @@ static void star_panel_late_resume(struct early_suspend *h)
#endif
for (i = 0; i < num_registered_fb; i++)
fb_blank(registered_fb[i], FB_BLANK_UNBLANK);

if(MARKED_ID)
mdelay(50);
}
#endif

Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-tegra/lge/star/board-star-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ static struct regulator_consumer_supply max8952_MODE1_supply[] = {
#if defined( CONFIG_MACH_STAR) && defined(CONFIG_MACH_STAR_SU660)
REGULATOR_SUPPLY("vdd_cpu", NULL),
#endif
#if defined( CONFIG_MACH_STAR) && defined(CONFIG_MACH_STAR_P990)
REGULATOR_SUPPLY("vdd_cpu", NULL),
#endif
#if defined( CONFIG_MACH_STAR) && defined(CONFIG_MACH_STAR_P999)
REGULATOR_SUPPLY("vdd_cpu", NULL),
#endif
};

static struct regulator_consumer_supply max8952_MODE2_supply[] = {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-tegra/lge/star/board-star-sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
#define MPU_COMPASS_ADDR 0x0E
#define MPU_COMPASS_BUS_NUM 2

#if (defined(CONFIG_MACH_STAR_P990) || defined(CONFIG_MACH_STAR_P999))
// P990 Compass Sensor change 2012.11.02
#if 0//(defined(CONFIG_MACH_STAR_P990) || defined(CONFIG_MACH_STAR_P999))
#define MPU_COMPASS_ORIENTATION { 0, -1, 0, 1, 0, 0, 0, 0, -1 }
#else
#define MPU_COMPASS_ORIENTATION { 0, -1, 0, -1, 0, 0, 0, 0, -1 }
Expand Down
40 changes: 37 additions & 3 deletions arch/arm/mach-tegra/lge/star/board-star.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,23 @@ static struct platform_device bd_address_device = {
#endif
//LGE_CHANGE_E


#if defined(CONFIG_MACH_STAR)
static struct i2c_board_info __initdata star_i2c6_board_info[] = {
{
I2C_BOARD_INFO("max14526", 0x44), // MUIC(R:0x88)
.platform_data = NULL,
},
};

static int __init star_muic_init(void)
{

i2c_register_board_info(6, star_i2c6_board_info, ARRAY_SIZE(star_i2c6_board_info));
return 0;
}
#endif

static struct tegra_i2c_platform_data star_i2c1_platform_data = {
.adapter_nr = 0,
.bus_count = 1,
Expand Down Expand Up @@ -242,13 +259,23 @@ static struct i2c_gpio_platform_data star_gpioi2c1_platform_data = {
.sda_pin = TEGRA_GPIO_PQ0,
.scl_pin = TEGRA_GPIO_PQ1,
};

#if defined(CONFIG_MACH_STAR)
// MUIC - FUEL GAUGE
static struct i2c_gpio_platform_data star_gpioi2c2_platform_data = {
.sda_pin = TEGRA_GPIO_PK4,
.scl_pin = TEGRA_GPIO_PI7,
.udelay = 5, /* (500 / udelay) kHz */
.timeout = 100, /* jiffies */
};
#else
static struct i2c_gpio_platform_data star_gpioi2c2_platform_data = {
.udelay = 2,
.scl_is_output_only = 1,
.sda_pin = TEGRA_GPIO_PK4,
.scl_pin = TEGRA_GPIO_PI7,
};
#endif


static void star_i2c_init(void)
{
Expand All @@ -265,6 +292,10 @@ static void star_i2c_init(void)

static void star_gpioi2c_init(void)
{
#if defined(CONFIG_MACH_STAR)
tegra_gpio_enable(TEGRA_GPIO_PK4);
tegra_gpio_enable(TEGRA_GPIO_PI7);
#endif
tegra_gpioi2c_device2.dev.platform_data = &star_gpioi2c2_platform_data;
platform_device_register(&tegra_gpioi2c_device2);
}
Expand Down Expand Up @@ -363,7 +394,7 @@ static void star_dmb_init(void)
platform_device_register(&tegra_spi_device2);
spi_register_board_info(spi_bus2_devices_info, ARRAY_SIZE(spi_bus2_devices_info));
}
#endif /* CONFIG_LGE_BROADCAST */
#endif /* */

#if !defined(CONFIG_BRCM_LPM)
extern void star_setup_bluesleep(void);
Expand Down Expand Up @@ -402,7 +433,10 @@ static void __init tegra_star_init(void)
tegra_release_bootloader_fb();
#if defined(CONFIG_LGE_BROADCAST_TDMB)
star_dmb_init();
#endif /* CONFIG_LGE_BROADCAST */
#endif /* */
#if defined(CONFIG_MACH_STAR)
star_muic_init();
#endif
}

int __init tegra_star_protected_aperture_init(void)
Expand Down
13 changes: 6 additions & 7 deletions arch/arm/mach-tegra/lge/star/include/lge/board-star-nv.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#ifndef __MACH_TEGRA_X2_NV_H
#define __MACH_TEGRA_X2_NV_H

//#define LGE_NVDATA_PARTITION "/dev/block/platform/sdhci-tegra.3/by-num/p3"
#define LGE_NVDATA_PARTITION "/dev/block/mmcblk0p5"
#define LGE_NVDATA_PARTITION "/dev/block/mmcblk0p3"


// modify this file and /android/vendor/lge/tegra/core/system/fastboot/lge_boot/inc/lge_boot_utils.h
Expand All @@ -28,19 +27,19 @@ typedef enum{

LGE_NVDATA_FACTORY_RESET_STATUS_OFFSET = 518, // used size 1 byte, for at%frst & at%frstatus
LGE_NVDATA_FBOOT_OFFSET = 520, // used size 1 byte, for at%fboot
//LGE_NVDATA_FRSTSTATUS_OFFSET = 522,// at%frststatus //moves to static nv area.
//

// CHEOLGWAK 2011-2-26 CP_CRASH_COUNT
LGE_NVDATA_CP_CRASH_COUNT_OFFSET = 523, // used size 1 byte
// CHEOLGWAK 2011-2-26 CP_CRASH_COUNT

//LGE_ChangeS jaesung.woo@lge.com 20110131 CIQ [START]
//
LGE_NVDATA_CIQ_NVDATA_RESET_OFFSET = 524, // used size 2 byte //RESET SIDE & CAUSE
//LGE_ChangeS jaesung.woo@lge.com 20110131 CIQ [END]
//

//LGE_S woosock.yang@lge.com 20110512
//
LGE_NVDATA_HARD_RESET_OFFSET = 526,
//LGE_E
//

LGE_NVDATA_RTC_INIT_OFFSET = 528,
LGE_NVDATA_FRSTSTATUS3_OFFSET = 530,//11.07.23 if set, must jump to recovery mode.
Expand Down
10 changes: 8 additions & 2 deletions arch/arm/mach-tegra/lge/star/include/lge/board_star_su660_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,14 @@ const struct tegra_init_gpio_info tegra_sleep_gpio_info_array[] = {
{ 'u'-'a', 1, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, GPU}, // AP20_UART_SW
{ 'u'-'a', 2, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, GPU}, // MDM_UART_SW
{ 'u'-'a', 4, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, GPU}, // VIBE_EN
//{ 'j'-'a', 6, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, IRRX}, // IPC_MRDY1 (P999bn)

#if defined(CONFIG_MACH_STAR_P999)
{ 'j'-'a', 6, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, IRRX}, // IPC_MRDY1 (P999bn)
#endif

#if defined(CONFIG_MACH_STAR_P990)
{ 'r'-'a', 7, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_HIGH, KBCB}, // IFX_VBUS_EN
#elif defined(CONFIG_MACH_STAR_SU660)
#elif defined(CONFIG_MACH_STAR_SU660) || defined(CONFIG_MACH_STAR_P999)
{ 'r'-'a', 7, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, KBCB}, // DMB_EN
#else
#error
Expand Down Expand Up @@ -232,6 +236,8 @@ const struct tegra_init_gpio_info tegra_sleep_gpio_info_array[] = {
{ 'r'-'a', 5, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_LOW, KBCD}, // NC
#elif defined(CONFIG_MACH_STAR_SU660)
{ 'r'-'a', 5, GPIO_ENABLE, GPIO_OUTPUT, GPIO_SLEEP_HIGH, KBCD}, // IFX_VBUS_EN
#elif defined(CONFIG_MACH_STAR_P999)
{ 'r'-'a', 5, GPIO_ENABLE, GPIO_INPUT, GPIO_SLEEP_LOW, KBCD},
#else
#error
//{ 'r'-'a', 5, GPIO_ENABLE, GPIO_INPUT, GPIO_SLEEP_LOW, KBCD}, // BATT_ID(P999BN)??
Expand Down
Loading

0 comments on commit c3cd6ce

Please sign in to comment.