コード例 #1
0
static void __init bravo_init(void)
{
	int ret;

	printk("bravo_init() revision=%d\n", system_rev);
	printk(KERN_INFO "%s: microp version = %s\n", __func__, microp_ver);

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

	if (system_rev >= 2) {
		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;
	}

	gpio_request(BRAVO_GPIO_LS_EN, "ls_en");

	msm_acpu_clock_init(&bravo_clock_data);
	perflock_init(&bravo_perflock_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(139));
#endif

#ifdef CONFIG_ARCH_QSD8X50
        bt_export_bd_address();
#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 */
#endif

	bravo_config_serial_debug_gpios();

	config_gpio_table(camera_off_gpio_table,
		ARRAY_SIZE(camera_off_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);

	bravo_audio_init();
	msm_device_i2c_init();
#ifdef CONFIG_MICROP_COMMON
	bravo_microp_init();
#endif

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

	platform_add_devices(devices, ARRAY_SIZE(devices));
	bravo_init_panel();
	if (!opt_usb_h2w_sw) {
#ifdef CONFIG_USB_FUNCTION
		msm_register_usb_phy_init_seq(bravo_phy_init_seq);
		msm_add_usb_devices(bravo_usb_phy_reset, NULL);
#endif
#ifdef CONFIG_USB_ANDROID
		bravo_add_usb_devices();
#endif
	}

	for (ret = 0; ret < ARRAY_SIZE(i2c_devices); ret++) {
		if (!strcmp(i2c_devices[ret].type, AKM8973_I2C_NAME))
			i2c_devices[ret].irq = MSM_GPIO_TO_INT(BRAVO_GPIO_COMPASS_INT);
       }
	compass_platform_data.intr = BRAVO_GPIO_COMPASS_INT;

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

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

	ret = platform_device_register(&android_timed_gpios);
	if (ret != 0)
		pr_err("failed to register vibrator\n");

	headset_init();

}
コード例 #2
0
ファイル: manager.c プロジェクト: dev-life/GT-I9300_Platform
static void handle_uuid(const char *uuidstr, struct audio_device *device)
{
	uuid_t uuid;
	uint16_t uuid16;

	if (bt_string2uuid(&uuid, uuidstr) < 0) {
		error("%s not detected as an UUID-128", uuidstr);
		return;
	}

	if (!sdp_uuid128_to_uuid(&uuid) && uuid.type != SDP_UUID16) {
		error("Could not convert %s to a UUID-16", uuidstr);
		return;
	}

	uuid16 = uuid.value.uuid16;

	if (!server_is_enabled(&device->src, uuid16)) {
		DBG("server not enabled for %s (0x%04x)", uuidstr, uuid16);
		return;
	}

	switch (uuid16) {
	case HEADSET_SVCLASS_ID:
		DBG("Found Headset record");
		if (device->headset)
			headset_update(device, uuid16, uuidstr);
		else
			device->headset = headset_init(device, uuid16,
							uuidstr);
		break;
	case HEADSET_AGW_SVCLASS_ID:
		DBG("Found Headset AG record");
		break;
	case HANDSFREE_SVCLASS_ID:
		DBG("Found Handsfree record");
		if (device->headset)
			headset_update(device, uuid16, uuidstr);
		else
			device->headset = headset_init(device, uuid16,
								uuidstr);
		break;
	case HANDSFREE_AGW_SVCLASS_ID:
		DBG("Found Handsfree AG record");
		if (enabled.gateway && (device->gateway == NULL))
			device->gateway = gateway_init(device);
		break;
	case AUDIO_SINK_SVCLASS_ID:
		DBG("Found Audio Sink");
		if (device->sink == NULL)
			device->sink = sink_init(device);
		break;
	case AUDIO_SOURCE_SVCLASS_ID:
		DBG("Found Audio Source");
		if (device->source == NULL)
			device->source = source_init(device);
		break;
	case AV_REMOTE_SVCLASS_ID:
	case AV_REMOTE_TARGET_SVCLASS_ID:
		DBG("Found AV %s", uuid16 == AV_REMOTE_SVCLASS_ID ?
							"Remote" : "Target");
		if (device->control)
			control_update(device, uuid16);
		else
			device->control = control_init(device, uuid16);
		/* SS_Bluetooth(sunjo4.kim) 2012.2.16 - add for a2dp connect fail */
		//if (device->sink && sink_is_active(device))
		//	avrcp_connect(device);
                /* SS_Bluetooth(sunjo4.kim) End */
		break;
	default:
		DBG("Unrecognized UUID: 0x%04X", uuid16);
		break;
	}
}