/* 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);

}
Esempio n. 2
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();
}
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();

}
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();

}