static void report_key(struct gpio_kp *kp, int key_index, int out, int in) { struct gpio_event_matrix_info *mi = kp->keypad_info; int pressed = test_bit(key_index, kp->keys_pressed); unsigned short keyentry = mi->keymap[key_index]; unsigned short keycode = keyentry & MATRIX_KEY_MASK; unsigned short dev = keyentry >> MATRIX_CODE_BITS; #ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL static unsigned need_send_spec_key = 1; #endif if (pressed != test_bit(keycode, kp->input_devs->dev[dev]->key)) { if (keycode == KEY_RESERVED) { if (mi->flags & GPIOKPF_PRINT_UNMAPPED_KEYS) pr_info("gpiomatrix: unmapped key, %d-%d " "(%d-%d) changed to %d\n", out, in, mi->output_gpios[out], mi->input_gpios[in], pressed); } else { if (mi->flags & GPIOKPF_PRINT_MAPPED_KEYS) pr_info("gpiomatrix: key %x, %d-%d (%d-%d) " "changed to %d\n", keycode, out, in, mi->output_gpios[out], mi->input_gpios[in], pressed); #ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL if ((machine_is_bravo() || machine_is_legend() || machine_is_latte() || machine_is_liberty() || machine_is_paradise() || machine_is_bravoc() || machine_is_bee()) && keycode == BTN_MOUSE) ; else #endif #ifdef CONFIG_MACH_HEROC if (button_filter(kp->input_devs->dev[dev], EV_KEY, keycode, pressed, kp->keys_pressed)) #endif input_report_key(kp->input_devs->dev[dev], keycode, pressed); } } #ifdef CONFIG_OPTICALJOYSTICK_CRUCIAL if ((machine_is_bravo() || machine_is_legend() || machine_is_latte() || machine_is_liberty() || machine_is_paradise() || machine_is_bravoc() || machine_is_bee()) && keycode == BTN_MOUSE) { if (need_send_spec_key == pressed) { curcial_oj_send_key(keycode, pressed); need_send_spec_key = !pressed; printk(KERN_DEBUG "%s: send key, pressed: %d\n", __func__, need_send_spec_key); } } #endif }
int __init bravo_init_panel(void) { int ret; if (!machine_is_bravo() && !machine_is_bravoc()) return 0; if (system_rev > 0xC0) { /* CDMA version (except for EVT1) supports RGB666 */ init_tablep = samsung_oled_rgb666_init_table; init_table_sz = ARRAY_SIZE(samsung_oled_rgb666_init_table); bravo_lcdc_fb_data.output_format = MSM_MDP_OUT_IF_FMT_RGB666; } ret = platform_device_register(&msm_device_mdp); if (ret != 0) return ret; ret = bravo_init_spi_hack(); if (ret != 0) return ret; if (gpio_get_value(BRAVO_GPIO_LCD_ID0)) { pr_info("%s: tft panel\n", __func__); vreg_lcm_rftx_2v6 = vreg_get(0, "rftx"); if (IS_ERR(vreg_lcm_rftx_2v6)) return PTR_ERR(vreg_lcm_rftx_2v6); vreg_set_level(vreg_lcm_rftx_2v6, 2600); #ifdef CONFIG_MACH_BRAVO vreg_lcm_aux_2v6 = vreg_get(0, "gp4"); #else vreg_lcm_aux_2v6 = vreg_get(0, "gp6"); #endif if (IS_ERR(vreg_lcm_aux_2v6)) return PTR_ERR(vreg_lcm_aux_2v6); vreg_set_level(vreg_lcm_aux_2v6, 2600); if (gpio_get_value(BRAVO_GPIO_LCD_RST_N)) tft_panel_on = 1; ret = platform_device_register(&bravo_lcdc_tft_device); INIT_WORK(&brightness_delayed_work, bravo_brightness_tft_set_work); } else { pr_info("%s: amoled panel\n", __func__); ret = platform_device_register(&bravo_lcdc_amoled_device); INIT_WORK(&brightness_delayed_work, bravo_brightness_amoled_set_work); } if (ret != 0) return ret; ret = led_classdev_register(NULL, &bravo_brightness_led); if (ret != 0) { pr_err("%s: Cannot register brightness led\n", __func__); return ret; } return 0; }
static int __init bravo_wifi_init(void) { if (!machine_is_bravo() && !machine_is_bravoc()) return 0; printk("%s: start\n", __func__); bravo_wifi_update_nvs("sd_oobonly=1\r\n", 0); bravo_wifi_update_nvs("btc_params70=0x32\r\n", 1); bravo_init_wifi_mem(); return platform_device_register(&bravo_wifi_device); }
static int __init bravo_init_keypad_jogball(void) { int ret; if (!machine_is_bravo()) return 0; ret = platform_device_register(&bravo_reset_keys_device); if (ret != 0) return ret; ret = platform_device_register(&bravo_input_device); if (ret != 0) return ret; return 0; }
static int __init bravommc_dbg_init(void) { struct dentry *dent; if (!machine_is_bravo() && !machine_is_bravoc()) return 0; dent = debugfs_create_dir("bravo_mmc_dbg", 0); if (IS_ERR(dent)) return PTR_ERR(dent); debugfs_create_file("wifi_reset", 0644, dent, NULL, &bravommc_dbg_wifi_reset_fops); debugfs_create_file("wifi_cd", 0644, dent, NULL, &bravommc_dbg_wifi_cd_fops); debugfs_create_file("wifi_pwr", 0644, dent, NULL, &bravommc_dbg_wifi_pwr_fops); debugfs_create_file("sd_pwr", 0644, dent, NULL, &bravommc_dbg_sd_pwr_fops); debugfs_create_file("sd_cd", 0644, dent, NULL, &bravommc_dbg_sd_cd_fops); return 0; }