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();
}
Пример #2
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);
}
Пример #3
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();
}
Пример #4
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);
}
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);
}
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);
}
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);

    /* 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(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;
    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(LIBERTY_GPIO_USB_ID_PIN);
    msm_add_usb_devices(liberty_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);
    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_panel();

    liberty_init_keypad();
}
Пример #8
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);
}
Пример #9
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();
}
int wm8350_init(struct wm8350 *wm8350)
{
    int ret = 0;

    /* register regulator and set constraints */
    wm8350_device_register_pmic(wm8350);
    set_regulator_constraints(wm8350);
#ifdef NOT_PORTED_TO_IMX37
    wm8350_device_register_rtc(wm8350);
    wm8350_device_register_wdg(wm8350);
    wm8350_device_register_power(wm8350);
#endif
    mxc_init_wm8350();

    /*Note: Needs to be moved into a regulator function. */
    /* Configuring -- GPIO 7 pin */
    if (wm8350_gpio_config(wm8350, 7, WM8350_GPIO_DIR_OUT, 0,
                           WM8350_GPIO_ACTIVE_LOW, WM8350_GPIO_PULL_NONE,
                           WM8350_GPIO_INVERT_OFF,
                           WM8350_GPIO_DEBOUNCE_OFF) == 0)
        wm8350_gpio_set_status(wm8350, 7, 1);
    else
        printk(KERN_ERR "Error in setting Wolfson GPIO pin 7 \n");
    /* enable gpio4:USB_VBUS_EN */
    ret =
        wm8350_gpio_config(wm8350, 4, WM8350_GPIO_DIR_IN,
                           WM8350_GPIO4_MR_IN, WM8350_GPIO_ACTIVE_HIGH,
                           WM8350_GPIO_PULL_UP, WM8350_GPIO_INVERT_OFF,
                           WM8350_GPIO_DEBOUNCE_OFF);
    if (ret)
        printk(KERN_ERR "Error in setting USB VBUS enable pin\n");

    /*PMIC RDY*/
    if (wm8350_gpio_config(wm8350, 9, WM8350_GPIO_DIR_OUT, WM8350_GPIO9_GPIO_OUT,
                           WM8350_GPIO_ACTIVE_LOW, WM8350_GPIO_PULL_NONE,
                           WM8350_GPIO_INVERT_OFF, WM8350_GPIO_DEBOUNCE_OFF) == 0)
        wm8350_gpio_set_status(wm8350, 9, 1);
    else
        printk(KERN_ERR "Error in setting Wolfson GPIO pin 9 \n");

    /* register sound */
    printk("Registering imx37_snd_device");
    imx_snd_device = platform_device_alloc("wm8350-imx-3stack-audio", -1);
    if (!imx_snd_device) {
        ret = -ENOMEM;
        goto err;
    }
    imx_snd_device->dev.platform_data = &imx_3stack_audio_platform_data;
    platform_set_drvdata(imx_snd_device, &wm8350->audio);
    ret = platform_device_add(imx_snd_device);
    if (ret)
        goto snd_err;

    /* set up PMIC IRQ (active high) to i.MX32ADS */
    printk("Registering PMIC INT");
    INIT_WORK(&wm8350->work, wm8350_irq_work);
    wm8350_reg_unlock(wm8350);
    wm8350_set_bits(wm8350, WM8350_SYSTEM_CONTROL_1, WM8350_IRQ_POL);
    wm8350_reg_lock(wm8350);
    set_irq_type(MXC_PMIC_INT_LINE, IRQT_RISING);
    ret = request_irq(MXC_PMIC_INT_LINE, wm8350_irq_handler,
                      IRQF_DISABLED, "wm8350-pmic", wm8350);
    if (ret != 0) {
        printk(KERN_ERR "wm8350: cant request irq %d\n",
               MXC_PMIC_INT_LINE);
        goto err;
    }
    wm8350->nirq = MXC_PMIC_INT_LINE;

    set_irq_wake(MXC_PMIC_INT_LINE, 1);

#ifdef NOT_PORTED_TO_IMX37
    printk("Configuring WM8350 GPIOS");
    config_gpios(wm8350);
    config_hibernate(wm8350);
#endif

    /* Sw1 --> PWR_ON */
    printk("Registering and unmasking the WM8350 wakeup key\n");
    wm8350_register_irq(wm8350, WM8350_IRQ_WKUP_ONKEY,
                        imx37_3stack_switch_handler, NULL);
    wm8350_unmask_irq(wm8350, WM8350_IRQ_WKUP_ONKEY);

    /* unmask all & clear sticky */
    printk("Unmasking WM8350 local interrupts\n");
    wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0x3ffe);
    schedule_work(&wm8350->work);

#if BATTERY
    /* not much use without a battery atm */
    wm8350_init_battery(wm8350);
#endif

    printk("Exiting normally from wm8350_init()");
    return ret;
snd_err:
    platform_device_put(imx_snd_device);

err:
    printk("wm8350_init() FAILED");
    kfree(wm8350->reg_cache);
    return ret;
}