void __init htc_8226_init(void)
{
	struct of_dev_auxdata *adata = htc_8226_auxdata_lookup;
	printk(KERN_INFO"[htc_8226_init]: Test to see htc_8226_init()\n");

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

	pr_info("%s: pid=%d, pcbid=%d, socver=0x%x\n", __func__
		, of_machine_pid(), of_machine_pcbid(), of_machine_socver());

#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
	msm8226_htc_init_gpiomux();
	board_dt_populate(adata);
	htc_8226_add_drivers();
#ifdef CONFIG_HTC_BUILD_EDIAG
	platform_device_register(&android_pmem_ediag_device);
	platform_device_register(&android_pmem_ediag1_device);
	platform_device_register(&android_pmem_ediag2_device);
	platform_device_register(&android_pmem_ediag3_device);
#endif
#ifdef CONFIG_PERFLOCK
	platform_device_register(&msm8226_device_perf_lock);
#endif
#ifdef CONFIG_HTC_POWER_DEBUG
	htc_monitor_init();
#endif
}
예제 #2
0
void __init htc_8974_init(void)
{
	struct of_dev_auxdata *adata = htc_8974_auxdata_lookup;

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

	pr_info("%s: pid=%d, pcbid=%d, socver=0x%x\n", __func__
		, of_machine_pid(), of_machine_pcbid(), of_machine_socver());

	msm_htc_8974_init_gpiomux();
	regulator_has_full_constraints();
	board_dt_populate(adata);
	htc_8974_add_drivers();
#ifdef CONFIG_HTC_BUILD_EDIAG
	platform_device_register(&android_pmem_ediag_device);
	platform_device_register(&android_pmem_ediag1_device);
	platform_device_register(&android_pmem_ediag2_device);
	platform_device_register(&android_pmem_ediag3_device);
#endif
#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
#ifdef CONFIG_HTC_POWER_DEBUG
	htc_monitor_init();
#endif
}
static void __init htc_8916_init(void)
{
	struct of_dev_auxdata *adata = htc_8916_auxdata_lookup;

	of_platform_populate(NULL, of_default_bus_match_table, adata, NULL);
	msm_smem_init();

	if (socinfo_init() < 0)
		pr_err("%s: socinfo_init() failed\n", __func__);

       pr_info("%s: pid=%d, pcbid=0x%X, subtype=0x%X, socver=0x%X\n", __func__
               , of_machine_pid(), of_machine_pcbid(), of_machine_subtype(), of_machine_socver());

	htc_8916_add_drivers();

#ifdef CONFIG_HTC_POWER_DEBUG
        htc_monitor_init();
#endif

#ifdef CONFIG_BT
	bt_export_bd_address();
#endif
#ifdef CONFIG_PERFLOCK
	platform_device_register(&msm8916_device_perf_lock);
#endif
}
static void __init htcleo_init(void)
{
	printk("htcleo_init()\n");
	msm_hw_reset_hook = htcleo_reset;

	do_grp_reset();
	do_sdc1_reset();

	msm_acpu_clock_init(&htcleo_clock_data);
	
	perflock_init(&htcleo_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

	init_dex_comm();

	parse_tag_bdaddr();

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

	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;

	platform_add_devices(devices, ARRAY_SIZE(devices));

	htcleo_init_panel();

#ifdef CONFIG_USB_ANDROID
	htcleo_add_usb_devices();
#endif

	i2c_register_board_info(0, base_i2c_devices, ARRAY_SIZE(base_i2c_devices));
	
	htcleo_init_mmc(0);
	platform_device_register(&htcleo_timed_gpios);
	
//#ifdef CONFIG_HTCLEO_BLINK_ON_BOOT
	/* Blink the camera LED shortly to show that we're alive! */
	htcleo_blink_camera_led();
//#endif // CONFIG_HTCLEO_BLINK_ON_BOOT

}
예제 #5
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();

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

}
static int htc_rfkill_probe(struct platform_device *pdev)
{
    int rc = 0;
    bool default_state = true;
    struct pinctrl_state *set_state;

    printk(KERN_INFO "[BT]== rfkill_probe ==\n");

    bt_export_bd_address();
    fm_ant_node_init();


    if (pdev->dev.of_node) {
        gpio_bt_reg_on = of_get_named_gpio(pdev->dev.of_node,
                                           "brcm,bt-regon-gpio", 0);
        if (gpio_bt_reg_on < 0) {
            printk("[BT]bt-regon-gpio not provided in device tree !!!");

        } else {
            printk("[BT]bt-regon-gpio: %d", gpio_bt_reg_on);
        }
    }


    bt_pinctrl = devm_pinctrl_get(&pdev->dev);
    if (IS_ERR(bt_pinctrl)) {
        if (PTR_ERR(bt_pinctrl) == -EPROBE_DEFER) {
            printk("[BT] bt_pinctrl EPROBE_DEFER !!");
            return -EPROBE_DEFER;
        }
    }

    if (bt_pinctrl) {
        printk("[BT] Init GPIO pins\n");
        set_state = pinctrl_lookup_state(bt_pinctrl, "bt_wake_host_gpio_on");
        if (IS_ERR(set_state)) {
            printk("[BT] cannot get BT pinctrl state bt_wake_host_gpio_on\n");

        } else
            bt_wake_host_set_state_on = set_state;

        set_state = pinctrl_lookup_state(bt_pinctrl, "bt_wake_host_gpio_off");
        if (IS_ERR(set_state)) {
            printk("[BT] cannot get BT pinctrl state bt_wake_host_gpio_off\n");

        } else
            bt_wake_host_set_state_off = set_state;

    }





    bluetooth_set_power(NULL, default_state);

    bt_rfk = rfkill_alloc(bt_name, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
                          &htc_rfkill_ops, NULL);
    if (!bt_rfk) {
        rc = -ENOMEM;
        goto err_rfkill_alloc;
    }

    rfkill_set_states(bt_rfk, default_state, false);



    rc = rfkill_register(bt_rfk);
    if (rc)
        goto err_rfkill_reg;

    return 0;

err_rfkill_reg:
    rfkill_destroy(bt_rfk);
err_rfkill_alloc:
    return rc;
}
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();

}
예제 #9
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);
}
static void __init liberty_init(void)
{
	int rc;
	char *cid = NULL;
	struct kobject *properties_kobj;

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

#ifndef CONFIG_SERIAL_MSM_HS_PURE_ANDROID
	/* for bcm */
	bt_export_bd_address();
#endif

	/*
	 * 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(LIBERTY_GPIO_LS_EN, "ls_en");
	gpio_direction_output(LIBERTY_GPIO_LS_EN, 0);
	/* disable power for cm3602 chip */
	/*__capella_cm3602_power(0);*/

	msm_hw_reset_hook = liberty_reset;

	msm_acpu_clock_init(&liberty_clock_data);
	perflock_init(&liberty_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(LIBERTY_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_bcm";	/* for bcm */
#endif
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);

#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
	liberty_microp_init();
#endif

	rc = liberty_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,
						&liberty_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));

	msm_device_i2c_init();

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

	liberty_init_keypad();
}
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 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);
}
예제 #13
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();
}
예제 #14
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);
}