/* ============================================================================= hardware self adapt =============================================================================*/ lcd_panel_type lcd_panel_probe(void) { lcd_panel_type hw_lcd_panel = LCD_NONE; if(machine_is_msm7x25_u8120() || machine_is_msm7x25_u8110()) { switch (lcd_id) { case 0: hw_lcd_panel = LCD_SPFD5408B_KGM_QVGA; break; case 1: hw_lcd_panel = LCD_ILI9325_INNOLUX_QVGA; break; case 2: hw_lcd_panel = LCD_ILI9325_BYD_QVGA; break; case 3: hw_lcd_panel = LCD_ILI9325_WINTEK_QVGA; break; default : hw_lcd_panel = LCD_ILI9325_INNOLUX_QVGA; break; } } else if(machine_is_msm7x25_c8600()) { switch (lcd_id) { case 0: hw_lcd_panel = LCD_S6D74A0_SAMSUNG_HVGA; break; default : hw_lcd_panel = LCD_S6D74A0_SAMSUNG_HVGA; break; } } else if(machine_is_msm7x25_u7610()) { } else { /*if no lcd panel installed, make innolux LCD panel as the default panel */ hw_lcd_panel = LCD_ILI9325_INNOLUX_QVGA; } printk(KERN_ERR "lcd_panel:*********hw_lcd_panel == %d;***************\n", hw_lcd_panel); return hw_lcd_panel; }
/* * leds-msm-pmic.c - MSM PMIC LEDs driver. * * Copyright (c) 2009, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/leds.h> #include <mach/pmic.h> #include <asm/mach-types.h> #ifdef CONFIG_HUAWEI_APPS #define MAX_KEYPAD_BL_LEVEL 64 #else #define MAX_KEYPAD_BL_LEVEL 16 #endif extern atomic_t kp_suspend_flag; atomic_t button_flag = ATOMIC_INIT(0); /* "0" means turn 0ff */ static void msm_keypad_bl_led_set(struct led_classdev *led_cdev, enum led_brightness value) { int ret = 0; /* U8110 has no keypad backlight */ if( machine_is_msm7x25_u8110() ) { /* there is nothing to do */ } /* U8100 series uses LCD_DRV to control keypad backlight */ else if( machine_is_msm7x25_u8100() || machine_is_msm7x25_u8105() \ || machine_is_msm7x25_u8107() || machine_is_msm7x25_u8109() ) { /*set keypad backlight current to 10mA*/ ret = pmic_set_led_intensity(LED_LCD, value / LED_FULL); } else if ( machine_is_msm7x25_u8150() || machine_is_msm7x25_c8150() || machine_is_msm7x25_u8159() ) { ret = pmic_set_led_intensity(LED_KEYPAD, 0); /* never turn on */ if ( !atomic_read(&kp_suspend_flag) ) { ret = pmic_set_led_intensity(LED_LCD, value / LED_FULL); } if (LED_FULL == value) { atomic_set(&button_flag, 1); } else { atomic_set(&button_flag, 0); } } /* other series uses KEYPAD_DRV to control keypad backlight */ else { /*set keypad backlight current to 10mA*/ ret = pmic_set_led_intensity(LED_KEYPAD, value / LED_FULL); } if (ret) dev_err(led_cdev->dev, "can't set keypad backlight\n"); }
int board_use_tssc_touch(bool * use_touch_key) { int result = 0; if (use_touch_key == NULL) { return -ENOMEM; } if (machine_is_msm7x25_u8120()) { *use_touch_key = false; } else if (machine_is_msm7x25_u8110()) { *use_touch_key = true; } else { *use_touch_key = false; } return result; }
static void __init msm7x2x_init(void) { if (socinfo_init() < 0) BUG(); #ifdef CONFIG_HUAWEI_CAMERA sensor_vreg_disable(sensor_vreg_array,ARRAY_SIZE(sensor_vreg_array)); #endif #if defined(CONFIG_MSM_SERIAL_DEBUGGER) msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3, &msm_device_uart3.dev, 1); #endif /*delete*/ msm_acpu_clock_init(&msm7x2x_clock_data); msm_hsusb_pdata.swfi_latency = msm7x25_pm_data [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency; if(machine_is_msm7x25_u8110()) { msm_device_hsusb_peripheral.dev.platform_data = &msm_hsusb_tmo_pdata; } else { msm_device_hsusb_peripheral.dev.platform_data = &msm_hsusb_pdata; } if(machine_is_msm7x25_u8110()) { mass_storage_device.dev.platform_data = &usb_mass_storage_tmo_pdata; } platform_add_devices(devices, ARRAY_SIZE(devices)); #ifdef CONFIG_MSM_CAMERA config_camera_off_gpios(); /* might not be necessary */ #endif msm_device_i2c_init(); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); #ifdef CONFIG_SURF_FFA_GPIO_KEYPAD if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) platform_device_register(&keypad_device_7k_ffa); else platform_device_register(&keypad_device_surf); #endif #ifdef CONFIG_HUAWEI_GPIO_KEYPAD if (machine_is_msm7x25_c8600()) platform_device_register(&keypad_device_c8600); else if (machine_is_msm7x25_u8110()) //machine_is_msm7x25_u8100() platform_device_register(&keypad_device_u8100); else if (machine_is_msm7x25_u7610()) platform_device_register(&keypad_device_u7610); else platform_device_register(&keypad_device_c8600); //default use c6800 keypad #endif lcdc_gpio_init(); #ifdef CONFIG_HUAWEI_JOGBALL //config_jogball_gpios(); //init_jogball(); if (machine_is_msm7x25_c8600()) platform_device_register(&jogball_device); #endif msm_fb_add_devices(); msm7x2x_init_mmc(); bt_power_init(); msm_pm_set_platform_data(msm7x25_pm_data); #ifdef CONFIG_HUAWEI_MSM_VIBRATOR msm_init_pmic_vibrator(); #endif }