Example #1
0
static void __init bravo_init(void)
{
	int ret;

	printk("bravo_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 = bravo_reset;

	if (is_cdma_version(system_rev))
		msm_acpu_clock_init(&bravo_cdma_clock_data);
	else
		msm_acpu_clock_init(&bravo_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 = BRAVO_CDMA_GPIO_BT_WAKE;
		bravo_flashlight_data.torch = BRAVO_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(BRAVO_GPIO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(BRAVO_GPIO_TP_LS_EN, 0);
	gpio_request(BRAVO_GPIO_TP_EN, "tp_en");
	gpio_direction_output(BRAVO_GPIO_TP_EN, 0);
//	gpio_request(BRAVO_GPIO_PROXIMITY_EN, "proximity_en");
//	gpio_direction_output(BRAVO_GPIO_PROXIMITY_EN, 1);
	gpio_request(BRAVO_GPIO_LS_EN_N, "ls_en");
	gpio_request(BRAVO_GPIO_COMPASS_RST_N, "compass_rst");
	gpio_direction_output(BRAVO_GPIO_COMPASS_RST_N, 1);
	gpio_request(BRAVO_GPIO_COMPASS_INT_N, "compass_int");
	gpio_direction_input(BRAVO_GPIO_COMPASS_INT_N);

	gpio_request(BRAVO_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 */
	bravo_kgsl_power_rail_mode(0);
	bravo_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 (is_cdma_version(system_rev)) {
		i2c_register_board_info(0, rev_CX_i2c_devices,
			ARRAY_SIZE(rev_CX_i2c_devices));
	}

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

	bravo_audio_init();
	bravo_headset_init();

	platform_device_register(&bravo_timed_gpios);

	ds2784_battery_init();
	
	serialno_setup(board_serialno());
}
Example #2
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();
}
Example #3
0
static void __init htcleo_init(void)
{
#ifdef CONFIG_HTCLEO_BLINK_AT_BOOT
	volatile unsigned *bank6_in, *bank6_out;
#endif
	printk("htcleo_init()\n");

	msm_hw_reset_hook = htcleo_reset;

#ifdef CONFIG_PERFLOCK
	perflock_init(&htcleo_perflock_data);
#endif

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

	config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));

		gpio_request(HTCLEO_GPIO_TP_LS_EN, "tp_ls_en");
	gpio_direction_output(HTCLEO_GPIO_TP_LS_EN, 0);
	gpio_request(HTCLEO_GPIO_TP_EN, "tp_en");
	gpio_direction_output(HTCLEO_GPIO_TP_EN, 0);
//	gpio_request(HTCLEO_GPIO_PROXIMITY_EN, "proximity_en");
//	gpio_direction_output(HTCLEO_GPIO_PROXIMITY_EN, 1);
	gpio_request(HTCLEO_GPIO_LS_EN_N, "ls_en");
	gpio_request(HTCLEO_GPIO_COMPASS_RST_N, "compass_rst");
	gpio_direction_output(HTCLEO_GPIO_COMPASS_RST_N, 1);
	gpio_request(HTCLEO_GPIO_COMPASS_INT_N, "compass_int");
	gpio_direction_input(HTCLEO_GPIO_COMPASS_INT_N);

	gpio_request(HTCLEO_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 */
	htcleo_kgsl_power_rail_mode(0);
	htcleo_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 (htcleo_init_mmc(system_rev, debug_uart) != 0)
		pr_crit("%s: Unable to initialize MMC\n", __func__);

	htcleo_audio_init();
	htcleo_headset_init();

	platform_device_register(&htcleo_timed_gpios);

	ds2784_battery_init();

	msm_acpu_clock_init(&htcleo_clock_data);



//}   what's this??


#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 */
	msm_device_uart_dm1.resource[3].end = 6;
#endif

	config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));

//	bt_export_bd_address();

	htcleo_audio_init();

//	msm_device_i2c_init();

	/* set the gpu power rail to manual mode so clk en/dis will not
	* turn off gpu power, and hang it on resume */

	htcleo_kgsl_power_rail_mode(0);
	htcleo_kgsl_power(false);
	mdelay(100);
	htcleo_kgsl_power(true);

	platform_add_devices(devices, ARRAY_SIZE(devices));

	htcleo_init_panel();


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

#ifdef CONFIG_USB_ANDROID
//	htcleo_add_usb_devices();
#endif

//	htcleo_init_mmc(0);
	platform_device_register(&htcleo_timed_gpios);


	/* Blink the camera LED shortly to show that we're alive! */
#ifdef CONFIG_HTCLEO_BLINK_AT_BOOT
	bank6_in = (unsigned int*)(MSM_GPIO1_BASE + 0x0864);
	bank6_out = (unsigned int*)(MSM_GPIO1_BASE + 0x0814);
	*bank6_out = *bank6_in ^ 0x200000;
	mdelay(50);
	*bank6_out = *bank6_in | 0x200000;
	mdelay(200);
#endif

}