void __init msm7627a_add_io_devices(void)
{
	hs_platform_data.ignore_end_key = true;
	platform_add_devices(v3_input_devices, ARRAY_SIZE(v3_input_devices));

#if defined(CONFIG_TOUCHSCREEN_MELFAS_MMS128S)
	lge_add_gpio_i2c_device(v3eu_init_i2c_touch);
#else /*qct original*/
	/* touchscreen */
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
#endif

#if defined (CONFIG_SENSORS_BMM050) ||defined(CONFIG_SENSORS_BMA250)
	lge_add_gpio_i2c_device(v3_init_i2c_sensor);
#endif
	lge_add_gpio_i2c_device(v3_init_i2c_prox);

#ifdef CONFIG_LEDS_LP5521	
	lge_add_gpio_i2c_device(lp5521_init_i2c_rgb);
#endif	
	msm_init_pmic_vibrator();
}
示例#2
0
void __init msm7627a_add_io_devices(void)
{
	/* touchscreen */
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
	/* keypad */
	platform_device_register(&kp_pdev);

	/* headset */
	platform_device_register(&hs_pdev);

	/* LED: configure it as a pdm function */
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

	/* Vibrator */
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa())
		msm_init_pmic_vibrator();
}
/* main interface */
void __init lge_add_misc_devices(void)
{
	platform_add_devices(m4eu_misc_devices, ARRAY_SIZE(m4eu_misc_devices));

	/* QCT native Vibrator enable [mach-msm/msm_vibrator.c] */
	msm_init_pmic_vibrator();
}
static void __init heroc_init(void)
{
	int rc;
	printk(KERN_INFO "heroc_init() revision=%d\n", system_rev);

	config_gpios();

//	gpio_request(HEROC_GPIO_H2W_POWER, "heroc_gpio_h2w_power");
//	gpio_request(HEROC_GPIO_CABLE_IN2, "heroc_gpio_cable_in2");
	gpio_request(HEROC_GPIO_AUD_EXTMIC_SEL, "heroc_gpio_aud_extmic_sel");

	msm_hw_reset_hook = heroc_reset;

	msm_acpu_clock_init(&heroc_clock_data);
	perflock_init(&heroc_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
				      &msm_device_uart3.dev, 1, INT_UART3_RX);
#endif

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#endif

	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;

	msm_init_pmic_vibrator(3000);

	rc = heroc_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	msm_i2c_gpio_init();
	msm_device_i2c.dev.platform_data = &heroc_i2c_device_data; 

/*	for (rc=0;rc<ARRAY_SIZE(i2c_devices);rc++){
            if (!strcmp(i2c_devices[rc].type,AKM8973_I2C_NAME)){
                if (!system_rev)
                    i2c_devices[rc].irq = 0x1E; //XA
                else
                    i2c_devices[rc].irq = 0x1C;
            }
        } 
	
	if(system_rev < 2) {
		microp_data.num_pins   = ARRAY_SIZE(microp_pins_0);
		microp_data.pin_config = microp_pins_0;
	} */

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	platform_add_devices(devices, ARRAY_SIZE(devices));

	clear_bluetooth_rx_irq_status();

//	heroc_init_panel();
}
void __init msm7627a_add_io_devices(void)
{
	/* touchscreen */
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

/* MTD-BSP-VT-GPIO-02-[ */
#if 0
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
#endif
/* MTD-BSP-VT-GPIO-02-] */

#if 0
	/* keypad */
/* FIH-SW-MM-VH-DISPLAY-JB00*[ */
    if (0){
		platform_device_register(&kp_pdev);
	}
/* FIH-SW-MM-VH-DISPLAY-JB00*] */
#endif

	// MTD-BSP-Y.S-Enable drivers
	if( gpio_tlmm_config( GPIO_CFG( 37, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA ), GPIO_CFG_ENABLE ) )
		pr_err( "GKEY: gpio_tlmm_config(37) failed\n" );

	if( gpio_tlmm_config( GPIO_CFG( 38, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA ), GPIO_CFG_ENABLE ) )
		pr_err( "GKEY: gpio_tlmm_config(38) failed\n" );

	platform_device_register( &GUA_BMB_GPIO_key );
	platform_device_register( &hs_pdev );
	// MTD-BSP-Y.S-Enable drivers

#if 0
	/* LED: configure it as a pdm function */
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

	/* Vibrator */
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa())
		msm_init_pmic_vibrator();
#endif // 0

}
static void __init msm_qrd1_init(void)
{
	msm7x2x_misc_init();
	msm7627a_init_regulators();
	msm_device_i2c_init();
#ifdef CONFIG_SERIAL_MSM_HS
	msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#endif

#ifdef CONFIG_USB_MSM_OTG_72K
	msm_otg_pdata.swfi_latency = msm7627a_pm_data
		[MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
	msm_device_otg.dev.platform_data = &msm_otg_pdata;
#endif
	msm_device_gadget_peripheral.dev.platform_data =
		&msm_gadget_pdata;
	platform_add_devices(qrd1_devices,
			ARRAY_SIZE(qrd1_devices));
	msm7627a_init_mmc();

#ifdef CONFIG_USB_EHCI_MSM_72K
	msm7627a_init_host();
#endif
	msm_pm_set_platform_data(msm7627a_pm_data,
				ARRAY_SIZE(msm7627a_pm_data));
	BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));

	msm_fb_add_devices();

#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
	msm7627a_bt_power_init();
#endif

	msm7627a_camera_init();

#if defined(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C) || \
	defined(CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C_MODULE)
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				synaptic_i2c_clearpad3k,
				ARRAY_SIZE(synaptic_i2c_clearpad3k));
#endif
	platform_device_register(&hs_pdev);

#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif
}
示例#7
0
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
}
static void __init buzzc_init(void)
{
	int rc;
	struct kobject *properties_kobj;

	printk("buzzc_init() revision=%d\n", system_rev);
	printk(KERN_INFO "mfg_mode=%d\n", board_mfg_mode());
	if (board_mfg_mode() == 1) {
		tssc_ts_device_data.cal_err = 25;
		printk(KERN_INFO "cal_err=%d\n", tssc_ts_device_data.cal_err);
	}


	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_direction_output(BUZZC_GPIO_LS_EN, 0);
	/* disable power for cm3602 chip */
	__capella_cm3602_power(0);

	msm_hw_reset_hook = buzzc_reset;

	msm_acpu_clock_init(&buzzc_clock_data);
	perflock_init(&buzzc_perflock_data);
	/* adjust GPIOs based on bootloader request */

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(BUZZC_GPIO_UART3_RX));
#endif

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
	msm_add_usb_id_pin_gpio(BUZZC_GPIO_USB_ID_PIN);
	msm_add_usb_devices(buzzc_phy_reset, NULL);

	msm_add_mem_devices(&pmem_setting);
	msm_init_pmic_vibrator();
#ifdef CONFIG_MICROP_COMMON
	buzzc_microp_init();
#endif

	rc = buzzc_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);

	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
					 &buzzc_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	msm_device_i2c.dev.platform_data = &buzzc_i2c_device_data;

	platform_add_devices(devices, ARRAY_SIZE(devices));

	i2c_register_board_info(0, i2c_sensor, ARRAY_SIZE(i2c_sensor));
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	i2c_register_board_info(0 , &i2c_microp_devices, 1);

	buzzc_init_keypad();
}
static void __init latte_init(void)
{
    int rc;
    char *cid = NULL;
    printk("latte_init() revision = 0x%X\n", system_rev);
    board_get_cid_tag(&cid);

    /*
     * Setup common MSM GPIOS
     */
    config_gpios();

    /* We need to set this pin to 0 only once on power-up; we will
     * not actually enable the chip until we apply power to it via
     * vreg.
     */
    gpio_direction_output(LATTE_GPIO_LS_EN, 0);
    /* disable power for cm3602 chip */
    __capella_cm3602_power(0);

    msm_hw_reset_hook = latte_reset;

    msm_acpu_clock_init(&latte_clock_data);
    perflock_init(&latte_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
    if (!opt_disable_uart3)
        msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
                              &msm_device_uart3.dev, 1,
                              MSM_GPIO_TO_INT(LATTE_GPIO_UART3_RX));
#endif

    msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
    msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
    msm_add_serial_devices(3);
#else
    msm_add_serial_devices(0);
#endif

    msm_add_serial_devices(2);
    /*
    	msm_change_usb_id(0x0bb4, 0x0c10);
    */
    msm_add_usb_id_pin_gpio(LATTE_GPIO_USB_ID_PIN);

    msm_register_usb_phy_init_seq(espresso_phy_init_seq);
    msm_hsusb_set_product(espresso_usb_products,
                          ARRAY_SIZE(espresso_usb_products));
    msm_add_usb_devices(latte_phy_reset, latte_phy_shutdown);


    msm_add_mem_devices(&pmem_setting);

    msm_init_pmic_vibrator();
#ifdef CONFIG_MICROP_COMMON
    latte_microp_init();
#endif

    latte_init_h2w_power_gpio();

    rc = latte_init_mmc(system_rev);
    if (rc)
        printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

    /* register flashlight at new-XA above */
    platform_device_register(&latte_flashlight_device);

    /* probe camera driver */
    i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

    msm_device_i2c.dev.platform_data = &latte_i2c_device_data;
    platform_add_devices(devices, ARRAY_SIZE(devices));
    i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

    latte_init_keypad();
}
示例#10
0
static void __init bahamas_init(void)
{
	int rc;
	printk("bahamas_init() revision=%d\n", system_rev);

	/*
	 * Setup common MSM GPIOS
	 */
	sdc1_boot_reset();
//        printk("\n\nboard-mega.c: sdc1 boot reset\n\n");

	config_gpios();
//        printk("\n\nboard-mega.c: config gpios\n\n");

	msm_hw_reset_hook = bahamas_reset;
//        printk("\n\nboard-mega.c: msm hw reset hook\n\n");

	msm_acpu_clock_init(&bahamas_clock_data);
//        printk("\n\nmsm acpu clock init\n\n");
	perflock_init(&bahamas_perflock_data);
//        printk("\n\nperflock init\n\n");
	/* adjust GPIOs based on bootloader request */
	/* XXX: on Memphis,
	 *      GPIO#86 is H2W DAT / UART RX for HTC 11-Pin
	 *      GPIO#87 is H2W CLK / UART TX for HTC 11-Pin
	 *      We would need to use UART3 as debug port
	 *
	 * TODO: switch UART3 and H2W (for headset detect)
	 *       based on bootloader request.
	 */

/*#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
				      &msm_device_uart3.dev, 1);
#endif*/


	/* touchscreen must be powered before we enable i2c pullup */
#if 0 /* TODO: do some equivalent operations here */
	udelay(50);
	trout_gpio_write(NULL, TROUT_GPIO_I2C_PULL, 1);
#endif

	/* put the AF VCM in powerdown mode to avoid noise */
#if 0
	trout_gpio_write(NULL, TROUT_GPIO_VCM_PWDN, 1);
	mdelay(100);
	trout_i2c_sysdev_resume(NULL);
#endif

#if 0 /* TODO: do some equivalent operations here */
	if(sysdev_class_register(&trout_i2c_sysdev_class) == 0)
		sysdev_register(&trout_i2c_sys_device);
#endif

	#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_add_serial_devices(3);
	#else
	msm_add_serial_devices(0);
	#endif

	msm_add_serial_devices(2);

	msm_add_usb_devices(NULL,NULL);

	//msm_change_usb_id(0x0bb4, 0x0c06);
	if (board_mcp_monodie())
		msm_add_mem_devices(&pmem_setting_monodie);
	else
		msm_add_mem_devices(&pmem_setting_dualdie);
	msm_init_pmic_vibrator();
//        printk("\n\nboard-mega.c: msm init pmic vibrator\n\n");

	bahamas_init_h2w_power_gpio();
//        printk("\n\nboard-mega.c: bahamas init h2w power gpio\n\n");
//#if 1
	rc = bahamas_init_mmc(system_rev);
//        printk("\n\nboard-mega.c: init mmc\n\n");
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);
//#endif
	if(!system_rev)
		bahamas_reset_keys_device.dev.platform_data = &bahamas_reset_keys_pdata0;
	/*CC090319*/
/*	if  (bahamas_is_3M_camera())   {
		msm_camera_device_data.sinfo = &msm_camera_sensor_mt9t013;
		}
	else  {
		msm_camera_device_data.sinfo = &msm_camera_sensor_s5k4b2fx;
	}*/

	if(system_rev < 3) {
		if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins   = ARRAY_SIZE(microp_pins_0_wint);
			microp_data.pin_config = microp_pins_0_wint;
		} else {
			microp_data.num_pins   = ARRAY_SIZE(microp_pins_0);
			microp_data.pin_config = microp_pins_0;
		}
		i2c_microp_devices.irq = 0;
	} else if (panel_detect() == PANEL_WINTEK) {
		microp_data.num_pins   = ARRAY_SIZE(microp_pins_1_wint);
		microp_data.pin_config = microp_pins_1_wint;
	}

/*~CC090319*/
	//platform_add_devices(devices, ARRAY_SIZE(devices));

	/* Read Config 8 200 (Full Speed USB Mode) */
	/*if (readl(MSM_SHARED_RAM_BASE + 0xFC054) & 0x200)
		bahamas_h2w_data.flags |= FULL_SPEED_USB;

	if (system_rev >= 3)
		bahamas_h2w_data.flags |= _35MM_MIC_DET_L2H;

/*	if (system_rev >= 5)
		i2c_register_board_info(0, i2c_sensor, ARRAY_SIZE(i2c_sensor));

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	i2c_register_board_info(0 ,&i2c_microp_devices, 1);

	/* SD card door should wake the device */
	//trout_gpio_irq_set_wake(TROUT_GPIO_TO_INT(TROUT_GPIO_SD_DOOR_N), 1);
	msm_hsusb_set_vbus_state(1);
}
示例#11
0
static void __init hero_init(void)
{
	int rc;
	printk("hero_init() revision = 0x%X\n", system_rev);

	android_usb_pdata.serial_number = board_serialno();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	msm_hw_reset_hook = hero_reset;

	gpio_request(HERO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(HERO_TP_LS_EN, 0);
	gpio_request(HERO_GPIO_EXT_3V_EN, "hero_gpio_ext_3v_en");
	gpio_request(HERO_GPIO_CABLE_IN2, "hero_gpio_cable_in2");
	gpio_request(HERO_GPIO_AUD_EXTMIC_SEL, "hero_gpio_aud_extmic_sel");

	msm_acpu_clock_init(&hero_clock_data);
	perflock_init(&hero_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
				      &msm_device_uart3.dev, 1, INT_UART3_RX);
#endif

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#endif

	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;

	msm_init_pmic_vibrator(3000);

	rc = hero_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	msm_i2c_gpio_init();
	msm_device_i2c.dev.platform_data = &hero_i2c_device_data;

	if (system_rev == 0 || system_rev == 1) {
		for (rc = 0; rc < ARRAY_SIZE(i2c_devices); rc++) {
			if (!strcmp(i2c_devices[rc].type, MICROP_I2C_NAME))
				i2c_devices[rc].irq = MSM_GPIO_TO_INT(HERO_GPIO_UP_INT_N_XAXB);
			if (!strcmp(i2c_devices[rc].type, AKM8973_I2C_NAME))
				i2c_devices[rc].irq = MSM_GPIO_TO_INT(HERO_GPIO_COMPASS_INT_N_XAXB);
		}
	} else if (system_rev == 2 || system_rev == 3) /*XC and XD*/
		hero_h2w.dev.platform_data = &hero_h2w_data_xc;
	else /*above XE*/
		hero_h2w.dev.platform_data = &hero_h2w_data_xe;

	if (hero_engineerid() || system_rev > 2) {
		if (system_rev >= 4) {
			microp_data.num_pins = ARRAY_SIZE(microp_pins_skuid_3);
			microp_data.pin_config = microp_pins_skuid_3;
		} else if (system_rev == 3) {
			microp_data.num_pins = ARRAY_SIZE(microp_pins_skuid_2);
			microp_data.pin_config = microp_pins_skuid_2;
		} else {
			microp_data.num_pins = ARRAY_SIZE(microp_pins_skuid_1);
			microp_data.pin_config = microp_pins_skuid_1;
		}
		microp_data.cabc_backlight_enable = 1;
	}

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	platform_add_devices(devices, ARRAY_SIZE(devices));
	
	hero_init_panel();
}
void __init qrd7627a_add_io_devices(void)
{
        int rc;	
       	int i; //hanjue
	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
	#if 1   //linxc 2012-12-21 +++
		if (machine_is_msm8625_qrd5()) {
			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID, 
			himax_ts_i2c_info, 
			ARRAY_SIZE(himax_ts_i2c_info));
		}
	#else
		/* Use configuration data for sku5 */
		if (machine_is_msm8625_qrd5()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		if (machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5a;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5a);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	#endif  //linxc 2012-12-21 ---	
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7() || machine_is_msm8625q_skud() || machine_is_msm8625q_skue()) {
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif
//add by hanjue
    /* change the keymap for qrd sku5 */
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;
		kp_matrix_info_8625.output_gpios = kp_row_gpios_8625_qrd5;
		kp_matrix_info_8625.noutputs = ARRAY_SIZE(kp_row_gpios_8625_qrd5);

		
		for (i = 0; i < kp_matrix_info_8625.noutputs; i++) {
			rc = gpio_tlmm_config(GPIO_CFG(kp_matrix_info_8625.output_gpios[i], 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_2MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, kp_matrix_info_8625.output_gpios[i]);
			}
		}
		for (i = 0; i < kp_matrix_info_8625.ninputs; i++) {
			rc = gpio_tlmm_config(GPIO_CFG(kp_matrix_info_8625.input_gpios[i], 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_2MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, kp_matrix_info_8625.input_gpios[i]);
			}
		}
		

	}
	/* keypad */
	if (machine_is_msm7627a_evb() ||
		 machine_is_msm8625_evb()||
		 machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ||
		 machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_skud);
    #if 0
	/* keypad */
	if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_skud);
     #endif
/*start by lf 2012.12.26 */	 
#if 0
	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {

		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	} else if (machine_is_msm8625q_skud()) {
		platform_device_register(&pmic_mpp_leds_pdev_skud);
		/* enable the skud flash and torch by gpio leds driver */
		platform_device_register(&gpio_flash_skud);
	}
#endif
/*end by lf 2012.12.26 */
#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		platform_device_register(&msm_device_tricolor_leds);
		tricolor_leds_gpio_setup();
	}
#endif
}
示例#13
0
static void __init chacha_init(void)
{
	int rc;
	char *cid = NULL;
	char *qwerty_color = NULL;
	struct kobject *properties_kobj;

	printk("chacha_init() revision = 0x%X\n", system_rev);
	msm_clock_init();
	board_get_cid_tag(&cid);
	board_get_qwerty_color_tag(&qwerty_color);

	if (qwerty_color && strcmp(qwerty_color, "white") == 0) {
		cm3628_pdata.levels[2] = 24;
		cm3628_pdata.levels[3] = 79;
		pr_info("[LS][CM3628] Update white table\n");
	} else
		pr_info("[LS][CM3628] Update %s table\n", qwerty_color);

	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(CHACHA_GPIO_LS_EN, "ls_en");
	gpio_direction_output(CHACHA_GPIO_LS_EN, 0);


	msm_hw_reset_hook = chacha_reset;

	if (socinfo_init() < 0)
		BUG();

	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) > 1)
		|| ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
		&& (SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 3)))
		{
			msm_acpu_clock_init(&chacha_turbo_clock_data);
			perflock_init(&chacha_turbo_perflock_data);
		}else{
			msm_acpu_clock_init(&chacha_clock_data);
			perflock_init(&chacha_perflock_data);
		}

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(CHACHA_GPIO_UART3_RX));
#endif

	msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
	/*
	msm_change_usb_id(0x0bb4, 0x0c10);
	*/
#ifdef CONFIG_USB_FUNCTION
	msm_add_usb_id_pin_gpio(CHACHA_GPIO_USB_ID_PIN);
	msm_add_usb_devices(chacha_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	config_chacha_usb_id_gpios(0);
	platform_device_register(&msm_device_hsusb);
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
	chacha_microp_init();
#endif

	rc = chacha_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
						&chacha_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	printk(KERN_INFO "[HS_BOARD] (%s) system_rev = %d\n", __func__,
	       system_rev);
	if (system_rev >= 2) {
		htc_headset_microp.dev.platform_data = &htc_headset_microp_data_xc;
		htc_headset_mgr_data.headset_config_num =
			ARRAY_SIZE(htc_headset_mgr_config);
		htc_headset_mgr_data.headset_config = htc_headset_mgr_config;
		printk(KERN_INFO "[HS_BOARD] (%s) Set MEMS config\n", __func__);
	}

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));

	if (system_rev == 0)
		i2c_register_board_info(0, i2c_devices_XA,
			ARRAY_SIZE(i2c_devices_XA));
	else
		i2c_register_board_info(0, i2c_devices_XB,
			ARRAY_SIZE(i2c_devices_XB));

	chacha_init_panel();

	chacha_init_keypad();

	chacha_wifi_init();

	msm_init_pmic_vibrator(3100);
}
示例#14
0
static void msm7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length = ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_touchpad_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
					GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				mxt_device_info,
				ARRAY_SIZE(mxt_device_info));

	}else if (machine_is_msm7627a_qrd3() || 
			machine_is_msm8625_skua() ||
			machine_is_msm8625_qrd7()){
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* change the keymap for qrd sku5 */
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;

	/* keypad */
	if (machine_is_msm7627a_evb() ||
		 machine_is_msm8625_evb()||
		 machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ||
		 machine_is_msm8625_qrd7() ||
		 machine_is_msm8625_skua())
		platform_device_register(&kp_pdev_8625);

	/* leds */
/* disable the AP leds
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5()) {
		rc = gpio_tlmm_config(GPIO_CFG(LED_RED_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_RED_GPIO_8625);
		}

		rc = gpio_tlmm_config(GPIO_CFG(LED_GREEN_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_GREEN_GPIO_8625);
		}

		platform_device_register(&gpio_leds_8625);
	}
*/
#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	tricolor_leds_gpio_setup();
#endif
}
示例#15
0
static void __init mahimahi_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("mahimahi_init() revision=%d\n", system_rev);

	if (is_cdma_version(system_rev))
		smd_set_channel_list(smd_cdma_default_channels,
					ARRAY_SIZE(smd_cdma_default_channels));

	msm_hw_reset_hook = mahimahi_reset;

	if (is_cdma_version(system_rev))
		msm_acpu_clock_init(&mahimahi_cdma_clock_data);
	else
		msm_acpu_clock_init(&mahimahi_clock_data);

	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
			      &msm_device_uart1.dev, 1, MSM_GPIO_TO_INT(139));

	config_gpio_table(misc_gpio_table, ARRAY_SIZE(misc_gpio_table));

	if (is_cdma_version(system_rev)) {
		bcm_bt_lpm_pdata.gpio_wake = MAHIMAHI_CDMA_GPIO_BT_WAKE;
		mahimahi_flashlight_data.torch = MAHIMAHI_CDMA_GPIO_FLASHLIGHT_TORCH;
		config_gpio_table(bt_gpio_table_rev_CX, ARRAY_SIZE(bt_gpio_table_rev_CX));
	} else {
		config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));
	}

	gpio_request(MAHIMAHI_GPIO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(MAHIMAHI_GPIO_TP_LS_EN, 0);
	gpio_request(MAHIMAHI_GPIO_TP_EN, "tp_en");
	gpio_direction_output(MAHIMAHI_GPIO_TP_EN, 0);
	gpio_request(MAHIMAHI_GPIO_PROXIMITY_EN, "proximity_en");
	gpio_direction_output(MAHIMAHI_GPIO_PROXIMITY_EN, 1);
	gpio_request(MAHIMAHI_GPIO_COMPASS_RST_N, "compass_rst");
	gpio_direction_output(MAHIMAHI_GPIO_COMPASS_RST_N, 1);
	gpio_request(MAHIMAHI_GPIO_COMPASS_INT_N, "compass_int");
	gpio_direction_input(MAHIMAHI_GPIO_COMPASS_INT_N);

	gpio_request(MAHIMAHI_GPIO_DS2482_SLP_N, "ds2482_slp_n");

	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	mahimahi_kgsl_power_rail_mode(0);
	mahimahi_kgsl_power(true);

	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;

	platform_add_devices(devices, ARRAY_SIZE(devices));

	i2c_register_board_info(0, base_i2c_devices,
		ARRAY_SIZE(base_i2c_devices));

	if (system_rev == 0) {
		/* Only board after XB with Audience A1026 */
		i2c_register_board_info(0, rev0_i2c_devices,
			ARRAY_SIZE(rev0_i2c_devices));
	}

	if (system_rev > 0) {
		/* Only board after XB with Audience A1026 */
		i2c_register_board_info(0, rev1_i2c_devices,
			ARRAY_SIZE(rev1_i2c_devices));
	}

	if (is_cdma_version(system_rev)) {
		/* Only CDMA version with TI TPA2018D1 Speaker Amp. */
		i2c_register_board_info(0, rev_CX_i2c_devices,
			ARRAY_SIZE(rev_CX_i2c_devices));
		if ((system_rev & 0x0F) == 0x00) {
			a1026_data.gpio_a1026_clk = MAHIMAHI_CDMA_XA_AUD_A1026_CLK;
		} else if ((system_rev & 0x0F) >= 0x01) {
			a1026_data.gpio_a1026_wakeup = MAHIMAHI_CDMA_XB_AUD_A1026_WAKEUP;
			a1026_data.gpio_a1026_reset = MAHIMAHI_CDMA_XB_AUD_A1026_RESET;
			a1026_data.gpio_a1026_clk = MAHIMAHI_CDMA_XB_AUD_A1026_CLK;
		}
	}

	ret = mahimahi_init_mmc(system_rev, debug_uart);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
					 &mahimahi_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	mahimahi_audio_init();
	mahimahi_headset_init();

	if (system_rev > 0)
		platform_device_register(&mahimahi_timed_gpios);
	else
		msm_init_pmic_vibrator();

	ds2784_battery_init();
}
示例#16
0
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_qrd_skud_prime()) {
		ft5x06_touchpad_setup();
	}

	
	
	hs_platform_data.ignore_end_key = true;
	platform_device_register(&hs_pdev);

	
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	

	if (machine_is_qrd_skud_prime()) {
		kp_matrix_info_sku3.keymap = keymap_skud;
		kp_matrix_info_sku3.output_gpios = kp_row_gpios_skud;
		kp_matrix_info_sku3.input_gpios = kp_col_gpios_skud;
		kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_skud);
		kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_skud);
	}

	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
		|| machine_is_qrd_skud_prime())
		platform_device_register(&kp_pdev_sku3);

	
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
						machine_is_msm8625_evt()) {
		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	}
}
示例#17
0
/* system_rev == higher 16bits of PCBID
XA -> 0000FFFF -> 0x0000
XB -> 0101FFFF -> 0x0101
XC -> 0202FFFF -> 0x0202
*/
static void __init supersonic_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("supersonic_init() revision=%d\n", system_rev);

	android_usb_pdata.serial_number = board_serialno();

	msm_hw_reset_hook = supersonic_reset;

	OJ_BMA_power();

	msm_acpu_clock_init(&supersonic_clock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
				  &msm_device_uart1.dev, 1, MSM_GPIO_TO_INT(SUPERSONIC_GPIO_UART1_RX));
#endif

#ifdef CONFIG_ARCH_QSD8X50
	bt_export_bd_address();
#endif

	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	supersonic_kgsl_power_rail_mode(0);
	supersonic_kgsl_power(true);

#ifdef CONFIG_SPI_QSD
	msm_device_spi.dev.platform_data = &supersonic_spi_pdata;
#endif

	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;

	config_gpio_table(usb_phy_3v3_table, ARRAY_SIZE(usb_phy_3v3_table));
	config_gpio_table(camera_off_gpio_table,
		ARRAY_SIZE(camera_off_gpio_table));
	gpio_request(SUPERSONIC_GPIO_TP_EN, "tp_en");
	gpio_direction_output(SUPERSONIC_GPIO_TP_EN, 0);

	supersonic_audio_init();
	supersonic_init_panel();
#ifdef CONFIG_MICROP_COMMON
	supersonic_microp_init();
#endif

	platform_add_devices(devices, ARRAY_SIZE(devices));
	if (!opt_usb_h2w_sw) {
		msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
		config_supersonic_usb_id_gpios(0);
	}
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	ret = supersonic_init_mmc(system_rev);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
				&supersonic_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	msm_init_pmic_vibrator();
}
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		/* Use configuration data for EVT */
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_qrd_skud_prime()
				|| machine_is_msm8625q_skud()
				|| machine_is_msm8625q_evbd()) {
		ft5x06_touchpad_setup();
		/* evbd+ can support synaptic as well */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			/* for QPR EVBD+ with synaptic touch panel */
			/* TODO: Add  gpio request to the driver
				to support proper dynamic touch detection */
			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_ATTEN_GPIO_EVBD_PLUS, 0,
				GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_set_value(CLEARPAD3000_RESET_GPIO, 0);
			usleep(10000);
			gpio_set_value(CLEARPAD3000_RESET_GPIO, 1);
			usleep(50000);

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				rmi4_i2c_devices,
				ARRAY_SIZE(rmi4_i2c_devices));
		}
		else {
			if (machine_is_msm8625q_evbd()) {
				mxt_config_array[0].config = mxt_config_data;
				mxt_config_array[0].config_length =
				ARRAY_SIZE(mxt_config_data);
				mxt_platform_data.panel_maxy = 875;
				mxt_platform_data.need_calibration = true;
				mxt_platform_data.irq_gpio = MXT_TS_EVBD_IRQ_GPIO;
				mxt_vkey_setup();

			rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_EVBD_IRQ_GPIO, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
						__func__, MXT_TS_EVBD_IRQ_GPIO);
			}

			rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
						__func__, MXT_TS_RESET_GPIO);
			}

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				mxt_device_info,
				ARRAY_SIZE(mxt_device_info));
			}
		}
	}

	/* handset and power key*/
	/* ignore end key as this target doesn't need it */
	hs_platform_data.ignore_end_key = true;
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */

	if (machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud()) {
		kp_matrix_info_sku3.keymap = keymap_skud;
		kp_matrix_info_sku3.output_gpios = kp_row_gpios_skud;
		kp_matrix_info_sku3.input_gpios = kp_col_gpios_skud;
		kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_skud);
		kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_skud);
		/* keypad info for EVBD+ */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			gpio_tlmm_config(GPIO_CFG(37, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(42, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(31, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			kp_matrix_info_sku3.output_gpios = kp_row_gpios_evbdp;
			kp_matrix_info_sku3.input_gpios = kp_col_gpios_evbdp;
			kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_evbdp);
			kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_evbdp);
		}
	}

	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
		|| machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_sku3);

	/* leds */

	if (machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud()) {
		ctp_backlight_info.flags =
			PM_MPP__I_SINK__LEVEL_40mA << 16 | PM_MPP_8;
	}

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
		machine_is_msm8625_evt() || machine_is_qrd_skud_prime()
		|| machine_is_msm8625q_evbd() || machine_is_msm8625q_skud())
		platform_device_register(&pmic_mpp_leds_pdev);

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
		machine_is_msm8625_evt() || machine_is_msm8625q_evbd())
		platform_device_register(&tricolor_leds_pdev);
}
static void __init incrediblec_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("incrediblec_init() revision=%d, engineerid=%d\n", system_rev, engineerid);

	 msm_hw_reset_hook = incrediblec_reset;

	if (0 == engineerid || 0xF == engineerid) {
		mdp_pmem_pdata.start = MSM_PMEM_MDP_XA_BASE;
		android_pmem_adsp_pdata.start = MSM_PMEM_ADSP_XA_BASE;
	} else if (engineerid >= 3) {
		mdp_pmem_pdata.start = MSM_PMEM_MDP_BASE + MSM_MEM_128MB_OFFSET;
		android_pmem_adsp_pdata.start = MSM_PMEM_ADSP_BASE + MSM_MEM_128MB_OFFSET;
	}

	incrediblec_board_serialno_setup(board_serialno());

	OJ_BMA_power();

	msm_acpu_clock_init(&incrediblec_clock_data);

	perflock_init(&incrediblec_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
				&msm_device_uart1.dev, 1, INT_UART1_RX);
#endif

	bcm_bt_lpm_pdata.gpio_wake = INCREDIBLEC_GPIO_BT_CHIP_WAKE;
	config_gpio_table(bt_gpio_table_rev_CX, ARRAY_SIZE(bt_gpio_table_rev_CX));
	
#ifdef CONFIG_SPI_QSD
	msm_device_spi.dev.platform_data = &incrediblec_spi_pdata;
#endif	
	
	#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs";	/* for bcm */
	#endif

	incrediblec_config_uart_gpios();
	config_gpio_table(usb_phy_3v3_table, ARRAY_SIZE(usb_phy_3v3_table));
	config_gpio_table(camera_off_gpio_table,
		ARRAY_SIZE(camera_off_gpio_table));
	/*gpio_direction_output(INCREDIBLEC_GPIO_TP_LS_EN, 0);*/
	gpio_direction_output(INCREDIBLEC_GPIO_TP_EN, 0);

	incrediblec_audio_init();
#ifdef CONFIG_MICROP_COMMON
	incrediblec_microp_init();
#endif

	if (system_rev >= 2) {
		microp_data.num_functions   = ARRAY_SIZE(microp_functions_1);
		microp_data.microp_function = microp_functions_1;
	}

	platform_add_devices(devices, ARRAY_SIZE(devices));

	platform_add_devices(msm_footswitch_devices,
			msm_num_footswitch_devices);

	if (!opt_usb_h2w_sw) {
		msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	}	
	if (system_rev > 2) {
		incrediblec_atmel_ts_data[0].config_T9[7] = 33;
		incrediblec_atmel_ts_data[0].object_crc[0] = 0x2E;
		incrediblec_atmel_ts_data[0].object_crc[1] = 0x80;
		incrediblec_atmel_ts_data[0].object_crc[2] = 0xE0;
	}
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	ret = incrediblec_init_mmc(system_rev);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
				&incrediblec_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	msm_init_pmic_vibrator();

}
示例#20
0
static void __init desirec_init(void)
{
    int rc;
    struct kobject *properties_kobj;
    printk(KERN_INFO "%s() revision = %d\n", __func__, system_rev);

    config_gpios();

    if (system_rev > 0) {
        /* We need to set this pin to 0 only once on power-up; we will
         * not actually enable the chip until we apply power to it via
         * vreg.
         */
        gpio_direction_output(DESIREC_GPIO_CM3602_EN, 0);
        /* disable power for cm3602 chip */
        __capella_cm3602_power(0);
    }

    msm_hw_reset_hook = desirec_reset;

    msm_acpu_clock_init(&desirec_clock_data);
    perflock_init(&desirec_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
    if (!opt_disable_uart3)
        msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
                              &msm_device_uart3.dev, 1, INT_UART3_RX);
#endif

    msm_add_devices();

    clear_bluetooth_rx_irq_status();

#ifdef CONFIG_SERIAL_MSM_HS
    msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
    msm_add_serial_devices(MSM_SERIAL_UART1DM);
#else
    msm_add_serial_devices(MSM_SERIAL_UART1);
#endif

    msm_add_serial_devices(MSM_SERIAL_UART3);

    msm_add_usb_devices(desirec_phy_reset, desirec_phy_shutdown);

    if (board_mcp_monodie())
        msm_add_mem_devices(&pmem_mono_die_setting);
    else
        msm_add_mem_devices(&pmem_dual_die_setting);

    msm_init_pmic_vibrator();

    rc = desirec_init_mmc(system_rev);
    if (rc)
        printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

    properties_kobj = kobject_create_and_add("board_properties", NULL);
    if (properties_kobj)
        rc = sysfs_create_group(properties_kobj,
                                &desirec_properties_attr_group);
    if (!properties_kobj || rc)
        pr_err("failed to create board_properties\n");

    msm_device_i2c.dev.platform_data = &desirec_i2c_device_data;

    if (system_rev > 0) /*Aobve XB*/
        platform_add_devices(devices, ARRAY_SIZE(devices));
    else /* XA */
        platform_add_devices(devices0, ARRAY_SIZE(devices0));

    if (system_rev > 0) {
        microp_data.ls_power = capella_cm3602_power;
        if (system_rev >= 2) {
            microp_data.num_pins = ARRAY_SIZE(microp_pins_2);
            microp_data.pin_config = microp_pins_2;
        }
    }

    i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
    /* r porting*///	i2c_register_board_info(0, &i2c_s5k3e2fx, 1);
}
示例#21
0
static void __init marvelc_init(void)
{
	int rc;
	char *cid = NULL;
	struct kobject *properties_kobj;

	printk("marvelc_init() revision = 0x%X\n", system_rev);
	msm_clock_init();
	board_get_cid_tag(&cid);

	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(MARVELC_GPIO_LS_EN, "ls_en");
	gpio_direction_output(MARVELC_GPIO_LS_EN, 0);


	msm_hw_reset_hook = marvelc_reset;

	msm_acpu_clock_init(&marvelc_clock_data);
	perflock_init(&marvelc_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(MARVELC_GPIO_UART3_RX));
#endif

	msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
	/*
	msm_change_usb_id(0x0bb4, 0x0c10);
	*/
#ifdef CONFIG_USB_FUNCTION
	msm_add_usb_id_pin_gpio(MARVELC_GPIO_USB_ID_PIN);
	msm_add_usb_devices(marvelc_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	config_marvelc_usb_id_gpios(0);
	platform_device_register(&msm_device_hsusb);
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
	marvelc_microp_init();
#endif

	rc = marvelc_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
						&marvelc_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	printk(KERN_INFO "[HS_BOARD] (%s) system_rev = %d\n", __func__,
	       system_rev);
	if (system_rev >= 1) {
		htc_headset_microp.dev.platform_data =
			&htc_headset_microp_data_xb;
		htc_headset_mgr_data.headset_config_num =
			ARRAY_SIZE(htc_headset_mgr_config);
		htc_headset_mgr_data.headset_config = htc_headset_mgr_config;
		printk(KERN_INFO "[HS_BOARD] (%s) Set MEMS config\n", __func__);
	}

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	/* probe g-sensor driver */
	i2c_register_board_info(0, i2c_bma250_devices,
	ARRAY_SIZE(i2c_bma250_devices));

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	marvelc_init_panel();

	marvelc_init_keypad();

	marvelc_wifi_init();

	msm_init_pmic_vibrator(2800);
}
示例#22
0
static void __init latte_init(void)
{
	int rc;
	char *cid = NULL;
	printk("latte_init() revision = 0x%X\n", system_rev);
	board_get_cid_tag(&cid);

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(LATTE_GPIO_LS_EN, "ls_en");
	gpio_direction_output(LATTE_GPIO_LS_EN, 0);
	/* disable power for cm3602 chip */
	/*__capella_cm3602_power(0);*/

	msm_hw_reset_hook = latte_reset;

	msm_acpu_clock_init(&latte_clock_data);
	perflock_init(&latte_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(LATTE_GPIO_UART3_RX));
#endif

	msm_add_devices();

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#ifndef CONFIG_SERIAL_MSM_HS_PURE_ANDROID
	msm_device_uart_dm1.name = "msm_serial_hs_ti"; /* for ti */
#endif
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
#ifdef CONFIG_USB_FUNCTION
        msm_register_usb_phy_init_seq(latte_phy_init_seq);
        msm_add_usb_id_pin_gpio(LATTE_GPIO_USB_ID_PIN);
        msm_add_usb_devices(latte_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
        android_usb_pdata.products[0].product_id =
                android_usb_pdata.product_id;
        android_usb_pdata.serial_number = board_serialno();
        msm_hsusb_pdata.serial_number = board_serialno();
        msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
#ifdef CONFIG_USB_ANDROID_RNDIS
	platform_device_register(&rndis_device);
#endif
        platform_device_register(&msm_device_hsusb);
        platform_device_register(&usb_mass_storage_device);
        platform_device_register(&android_usb_device);
#endif

	msm_add_mem_devices(&pmem_setting);

	msm_init_pmic_vibrator();
#ifdef CONFIG_MICROP_COMMON
	latte_microp_init();
#endif

	rc = latte_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	/* register flashlight at new-XA above */
	platform_device_register(&latte_flashlight_device);

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	msm_device_i2c_init();

	platform_add_devices(devices, ARRAY_SIZE(devices));
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	latte_init_keypad();
}
static void __init incrediblec_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("incrediblec_init() revision=%d, engineerid=%d\n", system_rev, engineerid);

	 msm_hw_reset_hook = incrediblec_reset;

	if (0 == engineerid || 0xF == engineerid) {
		mdp_pmem_pdata.start = MSM_PMEM_MDP_XA_BASE;
		android_pmem_adsp_pdata.start = MSM_PMEM_ADSP_XA_BASE;
                msm_kgsl_resources[1].start = MSM_GPU_MEM_XA_BASE;
                msm_kgsl_resources[1].end = MSM_GPU_MEM_XA_BASE + MSM_GPU_MEM_SIZE - 1;
	} else if (engineerid >= 3) {
		mdp_pmem_pdata.start = MSM_PMEM_MDP_BASE + MSM_MEM_128MB_OFFSET;
		android_pmem_adsp_pdata.start = MSM_PMEM_ADSP_BASE + MSM_MEM_128MB_OFFSET;
		msm_kgsl_resources[1].start = MSM_GPU_MEM_BASE;
		msm_kgsl_resources[1].end =  msm_kgsl_resources[1].start + MSM_GPU_MEM_SIZE - 1;
	}

	OJ_BMA_power();

	msm_acpu_clock_init(&incrediblec_clock_data);

	perflock_init(&incrediblec_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
				&msm_device_uart1.dev, 1, INT_UART1_RX);
#endif

#ifdef CONFIG_ARCH_QSD8X50
	bt_export_bd_address();
#endif
	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	incrediblec_kgsl_power_rail_mode(0);
	incrediblec_kgsl_power(true);

	#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs";	/* for bcm */
	#endif

	incrediblec_config_uart_gpios();

	config_gpio_table(camera_off_gpio_table,
		ARRAY_SIZE(camera_off_gpio_table));
	/*gpio_direction_output(INCREDIBLEC_GPIO_TP_LS_EN, 0);*/
	gpio_direction_output(INCREDIBLEC_GPIO_TP_EN, 0);

	incrediblec_audio_init();
	msm_device_i2c_init();
#ifdef CONFIG_MICROP_COMMON
	incrediblec_microp_init();
#endif

#ifdef CONFIG_USB_ANDROID
	inc_add_usb_devices();
#endif

	if (system_rev >= 2) {
		microp_data.num_functions   = ARRAY_SIZE(microp_functions_1);
		microp_data.microp_function = microp_functions_1;
	}

	platform_add_devices(devices, ARRAY_SIZE(devices));
	incrediblec_init_panel();
	if (system_rev > 2) {
		incrediblec_atmel_ts_data[0].config_T9[7] = 33;
		incrediblec_atmel_ts_data[0].object_crc[0] = 0x2E;
		incrediblec_atmel_ts_data[0].object_crc[1] = 0x80;
		incrediblec_atmel_ts_data[0].object_crc[2] = 0xE0;
	}
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	ret = incrediblec_init_mmc(system_rev);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
				&incrediblec_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	msm_init_pmic_vibrator();

}
void __init msm7627a_add_io_devices(void)
{
	/* touchscreen */
	#ifdef CONFIG_TOUCHSCREEN_ATMEL_MAXTOUCH
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
	#endif

	//>>MelChang,[Harry] Add ELAN eKTF2040 and ILITEK ILI2013t touch panel IC
	#if defined(CONFIG_TOUCHSCREEN_ELAN_EKTF2040) || defined(CONFIG_TOUCHSCREEN_ILITEK_2103T) || defined(CONFIG_TOUCHSCREEN_CYPRESS_CY8CTMA340)
	gpio_tlmm_config(GPIO_CFG(CAP_TOUCH_DETECT, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	mdelay(10);
	if(gpio_get_value(CAP_TOUCH_DETECT))
	{
		#if defined(CONFIG_TOUCHSCREEN_CYPRESS_CY8CTMA340)
		pr_info("-- CAP_TOUCH_DETECT is Cypress IC + Jtouch Panel  --\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
		i2c_touch_devices_cypress_tma340, ARRAY_SIZE(i2c_touch_devices_cypress_tma340));
		#else
		pr_info("-- CAP_TOUCH_DETECT High - Fail --\n");
		#endif
	}
	else
	{
		#if defined(CONFIG_TOUCHSCREEN_ELAN_EKTF2040)
		pr_info("-- CAP_TOUCH_DETECT is ELAN IC  --\n");
		elan_ktf2k_ts_power(1);
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID, i2c_touch_devices_harry_elan, ARRAY_SIZE(i2c_touch_devices_harry_elan));
		#elif defined(CONFIG_TOUCHSCREEN_CYPRESS_CY8CTMA340)
		pr_info("-- CAP_TOUCH_DETECT is Cypress IC + Second Source Panel  --\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
								i2c_touch_devices_cypress_tma340,
								ARRAY_SIZE(i2c_touch_devices_cypress_tma340));
		#else
		pr_info("-- CAP_TOUCH_DETECT Low - Fail --\n");
		#endif
	}
	#endif
	//>>MelChang,[Harry] Add ELAN eKTF2040 and ILITEK ILI2013t touch panel IC

	/*++ Huize - 20110914 Register sensor device ++*/
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
							Sensor_devices_info,
							ARRAY_SIZE(Sensor_devices_info));
	/*-- Huize - 20110914 Register sensor device --*/

	/* keypad */
	//Mel, 2012/4/18, Enable Key GPIO. ++
	#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
	platform_device_register(&NanHu_button_device);
	#endif
	//Mel, 2012/4/18, Enable Key GPIO. --

	//Mel, 2012/4/18, Disable Key Matrix. ++
	#if 0
	platform_device_register(&kp_pdev);
	#endif
	//Mel, 2012/4/18, Disable Key Matrix. --

	/* headset */
	platform_device_register(&hs_pdev);

	/* LED: configure it as a pdm function */
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);
	/* ++ Edison add led device ++ */
	#ifdef CONFIG_LEDS_CHIP_LM3533
	led_lm3533_hw_init();
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
							i2c_led_devices_LM3533,
							ARRAY_SIZE(i2c_led_devices_LM3533));
	#endif
	/* -- Edison add led device -- */

	/* Vibrator */
	//<<Skies, 2011/10/12 enable vibrator function
	//if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
	//				|| machine_is_msm8625_ffa())
	//>>Skies, 2011/10/12
		msm_init_pmic_vibrator();
}
示例#25
0
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		/* Use configuration data for EVT */
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */
	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_sku3);

	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
						machine_is_msm8625_evt()) {
		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	}
}
static void __init bahamas_init(void)
{
	int rc;
	char *cid = NULL;

	printk("bahamas_init() revision = 0x%X\n", system_rev);
	printk(KERN_INFO "mfg_mode=%d\n", board_mfg_mode());
	msm_clock_init();
	board_get_cid_tag(&cid);

	/*
	* Setup common MSM GPIOS
	*/
	config_gpios();

	gpio_request(BAHAMAS_GPIO_CABLE_IN2, "gpio_cable_in2");
	gpio_request(BAHAMAS_GPIO_AUD_EXTMIC_SEL, "gpio_aud_extmic_sel");
	gpio_request(BAHAMAS_GPIO_WFM_ANT_SW, "gpio_wfm_ant_sw");

	msm_hw_reset_hook = bahamas_reset;

	msm_acpu_clock_init(&bahamas_clock_data);
#if defined(CONFIG_PERFLOCK)
	perflock_init(&bahamas_perflock_data);
#endif

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(BAHAMAS_GPIO_UART3_RX));
#endif

	msm_add_devices();

#if defined(CONFIG_SERIAL_MSM_HS)
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
#if defined(CONFIG_USB_FUNCTION)
	msm_register_usb_phy_init_seq(bahamas_phy_init_seq);
	msm_add_usb_devices(bahamas_phy_reset, NULL);
#endif

#if defined(CONFIG_USB_ANDROID)
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	platform_device_register(&msm_device_hsusb);
#if defined(CONFIG_USB_ANDROID_RNDIS)
	platform_device_register(&rndis_device);
#endif
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	if (board_mcp_monodie())
		msm_add_mem_devices(&pmem_setting_monodie);
	else
		msm_add_mem_devices(&pmem_setting_dualdie);

	bahamas_init_h2w_power_gpio();

	rc = bahamas_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	if(system_rev < 3) {
		if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_0_wint);
			microp_data.pin_config	= microp_pins_0_wint;
		} else {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_0);
			microp_data.pin_config	= microp_pins_0;
		}
			i2c_microp_devices.irq = 0;
		} else if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_1_wint);
			microp_data.pin_config	= microp_pins_1_wint;
	}

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));

	if (system_rev >= 3)
		bahamas_h2w_data.flags |= _35MM_MIC_DET_L2H;

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	i2c_register_board_info(0 ,&i2c_microp_devices, 1);

	bahamas_init_keypad();
	bahamas_init_panel();

	msm_init_pmic_vibrator(3000);
}
示例#27
0
static void __init msm7x2x_init(void)
{
	msm7x2x_misc_init();

	/* Initialize regulators first so that other devices can use them */
	msm7x27a_init_regulators();

	/* Common functions for SURF/FFA/RUMI3 */
	msm_device_i2c_init();
	msm7x27a_init_ebi2();
	msm7x27a_cfg_uart2dm_serial();
#ifdef CONFIG_SERIAL_MSM_HS
	msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#endif

#ifdef CONFIG_USB_MSM_OTG_72K
	msm_otg_pdata.swfi_latency =
		msm7x27a_pm_data
		[MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
	msm_device_otg.dev.platform_data = &msm_otg_pdata;
#endif
	msm_device_gadget_peripheral.dev.platform_data =
		&msm_gadget_pdata;
	msm7x27a_cfg_smsc911x();
	platform_add_devices(msm_footswitch_devices,
			msm_num_footswitch_devices);
	platform_add_devices(surf_ffa_devices,
			ARRAY_SIZE(surf_ffa_devices));
	/* Ensure ar6000pm device is registered before MMC/SDC */
	msm7x27a_init_ar6000pm();
#ifdef CONFIG_MMC_MSM
	msm7627a_init_mmc();
#endif
	msm_fb_add_devices();
#ifdef CONFIG_USB_EHCI_MSM_72K
	msm7x2x_init_host();
#endif

	msm_pm_set_platform_data(msm7x27a_pm_data,
				ARRAY_SIZE(msm7x27a_pm_data));
	BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));

#if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X)
	register_i2c_devices();
#endif
#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
	msm7627a_bt_power_init();
#endif
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
		atmel_ts_i2c_info,
		ARRAY_SIZE(atmel_ts_i2c_info));

#if defined(CONFIG_MSM_CAMERA)
	msm7627a_camera_init();
#endif
	platform_device_register(&kp_pdev);
	platform_device_register(&hs_pdev);

	/* configure it as a pdm function*/
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

#ifdef CONFIG_MSM_RPC_VIBRATOR
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
		msm_init_pmic_vibrator();
#endif
	/*7x25a kgsl initializations*/
	msm7x25a_kgsl_3d0_init();
}
static void __init buzz_init(void)
{
	int rc;
	char *cid = NULL;
	struct kobject *properties_kobj;

	printk("buzz_init() revision = 0x%X\n", system_rev);
	msm_clock_init();
	board_get_cid_tag(&cid);

	/* for bcm */
	bt_export_bd_address();

	/*
	 * Setup common MSM GPIOS
	 */
	config_gpios();

	/* We need to set this pin to 0 only once on power-up; we will
	 * not actually enable the chip until we apply power to it via
	 * vreg.
	 */
	gpio_request(BUZZ_GPIO_LS_EN, "ls_en");
	gpio_direction_output(BUZZ_GPIO_LS_EN, 0);

	gpio_request(BUZZ_PS_2V85_EN, "ps_2v85_en");

	msm_hw_reset_hook = buzz_reset;

	msm_acpu_clock_init(&buzz_clock_data);
#ifdef CONFIG_PERFLOCK
	perflock_init(&buzz_perflock_data);
#endif

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(BUZZ_GPIO_UART3_RX));
#endif

#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#ifndef CONFIG_SERIAL_MSM_HS_PURE_ANDROID
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
#endif
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif
	msm_add_serial_devices(2);

#ifdef CONFIG_USB_FUNCTION
	msm_register_usb_phy_init_seq(buzz_phy_init_seq);
	msm_add_usb_id_pin_gpio(BUZZ_GPIO_USB_ID_PIN);
	msm_add_usb_devices(buzz_phy_reset, NULL);
#endif

#ifdef CONFIG_USB_ANDROID
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	platform_device_register(&msm_device_hsusb);
#ifdef CONFIG_USB_ANDROID_RNDIS
	platform_device_register(&rndis_device);
#endif
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	msm_add_mem_devices(&pmem_setting);

#ifdef CONFIG_MICROP_COMMON
	buzz_microp_init();
#endif

	rc = buzz_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	properties_kobj = kobject_create_and_add("board_properties", NULL);

	if (properties_kobj)
		rc = sysfs_create_group(properties_kobj,
					&buzz_properties_attr_group);
	if (!properties_kobj || rc)
		pr_err("failed to create board_properties\n");

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	if (system_rev < 3) {
		i2c_microp_devices.platform_data = &microp_data_xc;
		platform_device_register(&buzz_leds);
	}
	if (system_rev >= 4) {
		platform_device_register(&buzz_oj);

	}
	i2c_register_board_info(0, &i2c_microp_devices, 1);

	/* probe camera driver */
	i2c_register_board_info(0, i2c_camera_devices, ARRAY_SIZE(i2c_camera_devices));

	buzz_init_keypad();
	buzz_wifi_init();
	buzz_panel_init();

	msm_init_pmic_vibrator(3000);
}
/* system_rev == higher 16bits of PCBID
XA -> 0000FFFF -> 0x0000
XB -> 0101FFFF -> 0x0101
XC -> 0202FFFF -> 0x0202
*/
static void __init supersonic_init(void)
{
	int ret;
	struct kobject *properties_kobj;

	printk("supersonic_init() revision=%d\n", system_rev);

	/* Must set msm_hw_reset_hook before first proc comm */
	msm_hw_reset_hook = supersonic_reset;

	OJ_BMA_power();

	msm_acpu_clock_init(&supersonic_clock_data);

	perflock_init(&supersonic_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	msm_device_uart1.dev.platform_data = &msm_uart_debug_pdata;
	msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1,
			      &msm_device_uart1.dev, 1, MSM_GPIO_TO_INT(SUPERSONIC_GPIO_UART1_RX));
#endif

#ifdef CONFIG_ARCH_QSD8X50
	bt_export_bd_address();
#endif

	/* set the gpu power rail to manual mode so clk en/dis will not
	 * turn off gpu power, and hang it on resume */
	supersonic_kgsl_power_rail_mode(0);
	supersonic_kgsl_power(true);

	#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_device_uart_dm1.name = "msm_serial_hs_bcm";	/* for bcm */
	#endif

	config_gpio_table(camera_off_gpio_table,
		ARRAY_SIZE(camera_off_gpio_table));
	/*gpio_direction_output(SUPERSONIC_GPIO_TP_LS_EN, 0);*/
	gpio_direction_output(SUPERSONIC_GPIO_TP_EN, 0);

	supersonic_audio_init();
	supersonic_init_panel();
#ifdef CONFIG_MICROP_COMMON
	supersonic_microp_init();
#endif
	msm_device_i2c_init();

	platform_add_devices(devices, ARRAY_SIZE(devices));
#ifdef CONFIG_USB_ANDROID
	if (!opt_usb_h2w_sw)
		suc_add_usb_devices();
#endif
	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));

	ret = supersonic_init_mmc(system_rev);
	if (ret != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
				&supersonic_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");

	msm_init_pmic_vibrator(3000);

}
示例#30
0
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		/* Use configuration data for sku5 */
		if (machine_is_msm8625_qrd5()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		if (machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5a;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5a);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_msm8625q_skud()
				|| machine_is_msm8625q_evbd()
				|| machine_is_msm8625q_skue()) {
		ft5x06_touchpad_setup();
		/* evbd+ can support synaptic as well */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			/* for QPR EVBD+ with synaptic touch panel */
			/* TODO: Add  gpio request to the driver
				to support proper dynamic touch detection */
			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_ATTEN_GPIO_EVBD_PLUS, 0,
				GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_set_value(CLEARPAD3000_RESET_GPIO, 0);
			usleep(10000);
			gpio_set_value(CLEARPAD3000_RESET_GPIO, 1);
			usleep(50000);

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				rmi4_i2c_devices,
				ARRAY_SIZE(rmi4_i2c_devices));
		}
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */
	if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;
	/* keypad info for EVBD+ */
	if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 13)) {
			gpio_tlmm_config(GPIO_CFG(37, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(42, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(31, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			kp_matrix_info_skud.output_gpios = kp_row_gpios_evbdp;
			kp_matrix_info_skud.input_gpios = kp_col_gpios_evbdp;
			kp_matrix_info_skud.noutputs = ARRAY_SIZE(kp_row_gpios_evbdp);
			kp_matrix_info_skud.ninputs = ARRAY_SIZE(kp_col_gpios_evbdp);
	}

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud()||machine_is_msm8625q_evbd())
		platform_device_register(&kp_pdev_skud);
	else if (machine_is_msm8625q_skue())
		platform_device_register(&kp_pdev_skue);

	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {

		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	} else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd()) {
		platform_device_register(&pmic_mpp_leds_pdev_skud);
		/* enable the skud flash and torch by gpio leds driver */
		platform_device_register(&gpio_flash_skud);
	} else if (machine_is_msm8625q_skue()) {
		 /* enable the skue flashlight by gpio leds driver */
                platform_device_register(&gpio_flash_skue);
	}

#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		platform_device_register(&msm_device_tricolor_leds);
		tricolor_leds_gpio_setup();
	}
#endif
}