Beispiel #1
0
void mot_setup_power(void)
{
	unsigned int i;
	int error;

	unsigned long pmc_cntrl_0;
	pmc_cntrl_0 = readl(IO_ADDRESS(TEGRA_PMC_BASE));
	printk(KERN_INFO "pICS_%s: pmc_cntrl_0 = 0x%X\n",__func__, pmc_cntrl_0);

	/* CPCAP standby lines connected to CPCAP GPIOs on Etna P1B & Olympus P2 */
	if ( HWREV_TYPE_IS_FINAL(system_rev) ||
	     (machine_is_etna() &&
	      HWREV_TYPE_IS_PORTABLE(system_rev) &&
	       (HWREV_REV(system_rev)  >= HWREV_REV_1B))  ||
	     (machine_is_olympus() &&
	       HWREV_TYPE_IS_PORTABLE(system_rev) &&
	       (HWREV_REV(system_rev)  >= HWREV_REV_2)) ||
		  machine_is_tegra_daytona() || machine_is_sunfire()) {
		tegra_cpcap_data.hwcfg[1] |= CPCAP_HWCFG1_STBY_GPIO;
	}

	/* For Olympus P3 the following is done:
	 * 1. VWLAN2 is  shutdown in standby by the CPCAP uC.
	 * 2. VWLAN1 is shutdown all of the time.
	 */
	if (HWREV_TYPE_IS_FINAL(system_rev) ||
		(HWREV_TYPE_IS_PORTABLE(system_rev) &&
		 (HWREV_REV(system_rev) >= HWREV_REV_3))) {
		pr_info("Detected P3 Olympus hardware.\n");
		tegra_cpcap_data.hwcfg[1] |= CPCAP_HWCFG1_SEC_STBY_VWLAN2;
		tegra_cpcap_data.hwcfg[1] &= ~CPCAP_HWCFG1_SEC_STBY_VWLAN1;
		cpcap_regulator[CPCAP_VWLAN2].constraints.always_on = 0;
	} else {
		/* Currently only Olympus P3 or greater can handle turning off the
		   external SD card. */
		fixed_sdio_config.enabled_at_boot = 1;
	}
	/* Indicate the macro controls SW5. */
	tegra_cpcap_leds.rgb_led.regulator_macro_controlled = true;

	/* For all machine types, disable watchdog when HWREV is debug, brassboard or mortable */
	if (HWREV_TYPE_IS_DEBUG(system_rev) || HWREV_TYPE_IS_BRASSBOARD(system_rev) ||
	    HWREV_TYPE_IS_MORTABLE(system_rev) ){
		tegra_cpcap_data.wdt_disable = 1;
	}

	spi_register_board_info(tegra_spi_devices, ARRAY_SIZE(tegra_spi_devices));

	for (i = 0; i < sizeof(fixed_regulator_devices)/sizeof(fixed_regulator_devices[0]); i++) {
		error = platform_device_register(&fixed_regulator_devices[i]);
		pr_info("Registered reg-fixed-voltage: %d result: %d\n", i, error);
	}

#ifdef CONFIG_REGULATOR_VIRTUAL_CONSUMER
	(void) platform_device_register(&cpcap_reg_virt_vcam);
	(void) platform_device_register(&cpcap_reg_virt_vcsi);
	(void) platform_device_register(&cpcap_reg_virt_vcsi_2);
	(void) platform_device_register(&cpcap_reg_virt_sw5);
#endif
}
int __init mot_modem_init(void)
{
	char bp_ctrl_bus[40] = "UART";
	char bp_data_bus[20] = "only";

	if ((machine_is_olympus() &&
	     !(HWREV_TYPE_IS_MORTABLE(system_rev) &&
	       HWREV_REV(system_rev) <= HWREV_REV_1)) ||
	    (machine_is_etna() &&
	     ((HWREV_TYPE_IS_PORTABLE(system_rev) &&
	       HWREV_REV(system_rev) >= HWREV_REV_2C) ||
	      (HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
	       HWREV_REV(system_rev) >= HWREV_REV_3))) ||
	    machine_is_tegra_daytona() ||
	    machine_is_sunfire()) {
		strcat(bp_ctrl_bus, " (with mdm_ctrl)");
		mot_mdm_ctrl_init();
		mot_mdm6600_agent_init();
	} else
		strcat(bp_ctrl_bus, " (NO mdm_ctrl)");

	if (machine_is_olympus() || machine_is_tegra_daytona() ||
		machine_is_sunfire()) {
		strcpy(bp_data_bus, "and SPI");
		mot_setup_mdm6600_spi_ipc();
		mot_setup_mdm6600_usb_ipc(0);
	} else if (machine_is_etna()) {
		strcpy(bp_data_bus, "and USB");
		mot_setup_mdm6600_usb_ipc(MDM6600_HOST_WAKE_GPIO);
	}

	/* All hardware at least has MDM6x00 at the moment. */
	printk(KERN_INFO "%s: MDM6x00 on %s %s\n", __func__,
				bp_ctrl_bus, bp_data_bus);

	if (machine_is_etna() &&
	    ((HWREV_TYPE_IS_PORTABLE(system_rev) &&
	      HWREV_REV(system_rev) >= HWREV_REV_2C) ||
	     (HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
	      HWREV_REV(system_rev) >= HWREV_REV_3)))
		mot_setup_wrigley_host_wake();

	return 0;
}
int __init mot_modem_init(void)
{
	char bp_ctrl_bus[40] = "UART";
	char bp_data_bus[20] = "only";

	if ( !(HWREV_TYPE_IS_MORTABLE(system_rev) && HWREV_REV(system_rev) <= HWREV_REV_1) ) {
		strcat(bp_ctrl_bus, " (with mdm_ctrl)");
		mot_mdm_ctrl_init();
		mot_mdm6600_agent_init();
	} else
		strcat(bp_ctrl_bus, " (NO mdm_ctrl)");

	strcpy(bp_data_bus, "and SPI");
	mot_setup_mdm6600_spi_ipc();
	mot_setup_mdm6600_usb_ipc(0);

	/* All hardware at least has MDM6x00 at the moment. */
	printk(KERN_INFO "%s: MDM6x00 on %s %s\n", __func__,
				bp_ctrl_bus, bp_data_bus);

	return 0;
}
void mot_setup_power(void)
{
	unsigned int i;
	int error;

	/* CPCAP standby lines connected to CPCAP GPIOs on Etna P1B & Olympus P2 */
	if ( HWREV_TYPE_IS_FINAL(system_rev) ||
	     (machine_is_etna() &&
	      HWREV_TYPE_IS_PORTABLE(system_rev) &&
	       (HWREV_REV(system_rev)  >= HWREV_REV_1B))  ||
	     (machine_is_olympus() &&
	       HWREV_TYPE_IS_PORTABLE(system_rev) &&
	       (HWREV_REV(system_rev)  >= HWREV_REV_2)) ||
		  machine_is_tegra_daytona() || machine_is_sunfire()) {
		tegra_cpcap_data.hwcfg[1] |= CPCAP_HWCFG1_STBY_GPIO;
	}

	/* For Olympus P3 the following is done:
	 * 1. VWLAN2 is  shutdown in standby by the CPCAP uC.
	 * 2. VWLAN1 is shutdown all of the time.
	 */
	if (machine_is_olympus()) {
		if (HWREV_TYPE_IS_FINAL(system_rev) ||
			(HWREV_TYPE_IS_PORTABLE(system_rev) &&
			 (HWREV_REV(system_rev) >= HWREV_REV_3))) {
			pr_info("Detected P3 Olympus hardware.\n");
			tegra_cpcap_data.hwcfg[1] |= CPCAP_HWCFG1_SEC_STBY_VWLAN2;
			tegra_cpcap_data.hwcfg[1] &= ~CPCAP_HWCFG1_SEC_STBY_VWLAN1;
			cpcap_regulator[CPCAP_VWLAN2].constraints.always_on = 0;
		} else {
			/* Currently only Olympus P3 or greater can handle turning off the
			   external SD card. */
			fixed_sdio_config.enabled_at_boot = 1;
		}
		/* Indicate the macro controls SW5. */
		tegra_cpcap_leds.rgb_led.regulator_macro_controlled = true;
	}

	/* For Etna the following is done:
	 * 1. VWLAN1 is shutdown all the time for P3B+
	 * 2. External SDIO can turn off on P2+ and S3+
	 * 3. SW5 is enabled in the blink macro for <P4FB and brassboard
	 * 4. regulator control for button LED is removed for P2C+ & S3+ (moved to B+)
	 * 5. regulator control for RGB LED is removed for P4FB+ (moved to B+)
	 */
	else if (machine_is_etna()) {
		if ( HWREV_TYPE_IS_FINAL(system_rev) ||
		     (HWREV_TYPE_IS_PORTABLE(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_3B))) {
			tegra_cpcap_data.hwcfg[1] &= ~CPCAP_HWCFG1_SEC_STBY_VWLAN1;
		}
		if ( HWREV_TYPE_IS_FINAL(system_rev) ||
		     (HWREV_TYPE_IS_PORTABLE(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_2)) ||
		     (HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_3)) ){
			fixed_sdio_config.enabled_at_boot = 0;
		} else {
			fixed_sdio_config.enabled_at_boot = 1;
		}
		if ( HWREV_TYPE_IS_FINAL(system_rev) ||
		     (HWREV_TYPE_IS_PORTABLE(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_2C)) ||
		     (HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_3)) ) {
			tegra_cpcap_leds.button_led.regulator = NULL;
		}

		if ( HWREV_TYPE_IS_FINAL(system_rev) ||
		     (HWREV_TYPE_IS_PORTABLE(system_rev) &&
		       (HWREV_REV(system_rev) >= HWREV_REV_4FB)) ) {
			tegra_cpcap_leds.rgb_led.regulator = NULL;
		} else {
			tegra_cpcap_leds.rgb_led.regulator_macro_controlled = true;
		}
	}
	/* For Daytona the following is done
	 * 1. VWLAN1 is shutdown all the time
	 */
	else if (machine_is_tegra_daytona()) {
		tegra_cpcap_data.hwcfg[1] &= ~CPCAP_HWCFG1_SEC_STBY_VWLAN1;
	}
	/* For Sunfire the following is done
	 * 1. VWLAN1 is shutdown all the time
	 * 2. VWLAN2 is  shutdown in standby by the CPCAP uC.
	 * 3. Regulator control for button LED is removed (on B+)
	 * 4. SW5 is enabled in the blink macro
	 */
	else if (machine_is_sunfire()) {
		tegra_cpcap_data.hwcfg[1] |= CPCAP_HWCFG1_SEC_STBY_VWLAN2;
		tegra_cpcap_data.hwcfg[1] &= ~CPCAP_HWCFG1_SEC_STBY_VWLAN1;
		cpcap_regulator[CPCAP_VWLAN2].constraints.always_on = 0;
		tegra_cpcap_leds.button_led.regulator = NULL;
		tegra_cpcap_leds.rgb_led.regulator_macro_controlled = true;
	}
	else {
		printk(KERN_ERR "Unkown hardware type encountered: 0x%x\n", machine_arch_type);
	}

	if ((machine_is_etna() &&
	     (HWREV_TYPE_IS_FINAL(system_rev) ||
	        (HWREV_TYPE_IS_PORTABLE(system_rev) &&
		(HWREV_REV(system_rev)  >= HWREV_REV_1)))) ||
		machine_is_tegra_daytona() || machine_is_sunfire()) {
		printk(KERN_INFO "%s: updating button backlight for portable\n",
		       __func__);
		tegra_cpcap_leds.button_led.button_reg = CPCAP_REG_ADLC;
		tegra_cpcap_leds.button_led.button_mask = 0x7FF;
		tegra_cpcap_leds.button_led.button_on = 0x67F3;
	}
	if (machine_is_tegra_daytona()) {
		/* IKDAYTONA-123  reduce current through 4 android hard keys */
		tegra_cpcap_leds.button_led.button_mask = 0x7FF;
		tegra_cpcap_leds.button_led.button_on = 0x7F1;
	}
	/* For all machine types, disable watchdog when HWREV is debug, brassboard or mortable */
	if (HWREV_TYPE_IS_DEBUG(system_rev) || HWREV_TYPE_IS_BRASSBOARD(system_rev) ||
	    HWREV_TYPE_IS_MORTABLE(system_rev) ){
		tegra_cpcap_data.wdt_disable = 1;
	}

	spi_register_board_info(tegra_spi_devices, ARRAY_SIZE(tegra_spi_devices));

	for (i = 0; i < sizeof(fixed_regulator_devices)/sizeof(fixed_regulator_devices[0]); i++) {
		error = platform_device_register(&fixed_regulator_devices[i]);
		pr_info("Registered reg-fixed-voltage: %d result: %d\n", i, error);
	}

#ifdef CONFIG_REGULATOR_VIRTUAL_CONSUMER
	(void) platform_device_register(&cpcap_reg_virt_vcam);
	(void) platform_device_register(&cpcap_reg_virt_vcsi);
	(void) platform_device_register(&cpcap_reg_virt_vcsi_2);
	(void) platform_device_register(&cpcap_reg_virt_sw5);
#endif
}
Beispiel #5
0
static void __init tegra_mot_init(void)
{
	tegra_common_init();
	tegra_setup_nvodm(true, true);
	tegra_register_socdev();

#ifdef CONFIG_APANIC_RAM
	apanic_ram_init();
#endif
#ifdef CONFIG_APANIC_MMC
	apanic_mmc_init();
#endif

	mot_setup_power();
	mot_setup_lights(&tegra_i2c_bus0_board_info[BACKLIGHT_DEV]);
	mot_setup_touch(&tegra_i2c_bus0_board_info[TOUCHSCREEN_DEV]);

	mot_sec_init();
	mot_tcmd_init();

	mot_setup_gadget();

	if(machine_is_olympus()) {
		tegra_uart_platform[UART_IPC_OLYMPUS].uart_ipc = 1;
		tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_host = TEGRA_GPIO_PA0;
		tegra_uart_platform[UART_IPC_OLYMPUS].uart_wake_request = TEGRA_GPIO_PF1;
		tegra_uart_platform[UART_IPC_OLYMPUS].peer_register = mot_mdm_ctrl_peer_register;
	}
	else if(machine_is_etna()) {
		if (HWREV_TYPE_IS_BRASSBOARD(system_rev)) {
			/* The modem is dead on S2, which makes the UART angry. */
			tegra_uart_platform[UART_IPC_ETNA].uart_ipc = 0;
			tegra_uart_platform[UART_IPC_ETNA].p.irq = ~0;
		} else {
			tegra_uart_platform[UART_IPC_ETNA].uart_ipc = 1;
			tegra_uart_platform[UART_IPC_ETNA].uart_wake_host = TEGRA_GPIO_PA0;
			tegra_uart_platform[UART_IPC_ETNA].uart_wake_request = TEGRA_GPIO_PF1;
			tegra_uart_platform[UART_IPC_ETNA].peer_register = mot_mdm_ctrl_peer_register;
		}
	}
	else if(machine_is_tegra_daytona()) {
		tegra_uart_platform[UART_IPC_DAYTONA].uart_ipc = 1;
		tegra_uart_platform[UART_IPC_DAYTONA].uart_wake_host = TEGRA_GPIO_PA0;
		tegra_uart_platform[UART_IPC_DAYTONA].uart_wake_request = TEGRA_GPIO_PF1;
		tegra_uart_platform[UART_IPC_DAYTONA].peer_register = mot_mdm_ctrl_peer_register;
	}
	else if(machine_is_sunfire()) {
		tegra_uart_platform[UART_IPC_SUNFIRE].uart_ipc = 1;
		tegra_uart_platform[UART_IPC_SUNFIRE].uart_wake_host = TEGRA_GPIO_PA0;
		tegra_uart_platform[UART_IPC_SUNFIRE].uart_wake_request = TEGRA_GPIO_PF1;
		tegra_uart_platform[UART_IPC_SUNFIRE].peer_register = mot_mdm_ctrl_peer_register;
	}

	if( (bi_powerup_reason() & PWRUP_FACTORY_CABLE) &&
	    (bi_powerup_reason() != PWRUP_INVALID) ){
#ifdef NEED_FACT_BUSY_HINT
		FactoryBusyHint(); //factory workaround no longer needed
#endif
	}

	mot_modem_init();

	(void) platform_driver_register(&cpcap_usb_connected_driver);

#ifdef CONFIG_MOT_WIMAX
	mot_wimax_gpio_init();
#endif
	mot_wlan_init();
	mot_sensors_init();

	mot_nvodmcam_init();

	printk("%s: registering i2c devices...\n", __func__);

	if(!(bi_powerup_reason() & PWRUP_BAREBOARD)) {
		printk("bus 0: %d devices\n", ARRAY_SIZE(tegra_i2c_bus0_board_info));
		i2c_register_board_info(0, tegra_i2c_bus0_board_info, 
								ARRAY_SIZE(tegra_i2c_bus0_board_info));
	}
	if (machine_is_etna() || machine_is_tegra_daytona() || machine_is_sunfire()) {
		printk("bus 2: %d devices\n", ARRAY_SIZE(tegra_i2c_bus2_board_info));
		i2c_register_board_info(2, tegra_i2c_bus2_board_info,
								ARRAY_SIZE(tegra_i2c_bus2_board_info));
	}
	printk("bus 3: %d devices\n", ARRAY_SIZE(tegra_i2c_bus3_board_info));
	i2c_register_board_info(3, tegra_i2c_bus3_board_info, 
							ARRAY_SIZE(tegra_i2c_bus3_board_info));

	if (machine_is_olympus()){
		/* console UART can be routed to 'headset jack by setting HSJ mux to 0*/
		short hsj_mux_gpio=1;

		if ( HWREV_TYPE_IS_DEBUG(system_rev) ){
			printk("%s: Enabling console on headset jack\n", __FUNCTION__);
			hsj_mux_gpio=0;
		}
		mot_set_hsj_mux( hsj_mux_gpio );
	}

	pm_power_off = mot_system_power_off;
	tegra_setup_bluesleep();

	/* Configure SPDIF_OUT as GPIO by default, it can be later controlled
	   as needed. When SPDIF_OUT is enabled and if HDMI is connected, it
	   can interefere with CPCAP ID pin, as SPDIF_OUT and ID are coupled.
	*/
	tegra_gpio_enable(TEGRA_GPIO_PD4);
	gpio_request(TEGRA_GPIO_PD4, "spdif_enable");
	gpio_direction_output(TEGRA_GPIO_PD4, 0);
	gpio_export(TEGRA_GPIO_PD4, false);

	if (machine_is_olympus() && (HWREV_TYPE_IS_PORTABLE(system_rev) || HWREV_TYPE_IS_FINAL(system_rev)))
	{
		if (HWREV_REV(system_rev) >= HWREV_REV_1 && HWREV_REV(system_rev) < HWREV_REV_2)
		{
			// Olympus P1
			config_unused_pins(oly_unused_pins_p1, ARRAY_SIZE(oly_unused_pins_p1));
		}
		else if (HWREV_REV(system_rev) >= HWREV_REV_2 && HWREV_REV(system_rev) < HWREV_REV_3)
		{
			// Olympus P2
			config_unused_pins(oly_unused_pins_p2, ARRAY_SIZE(oly_unused_pins_p2));
		}
		else if (HWREV_REV(system_rev) >= HWREV_REV_3 || HWREV_TYPE_IS_FINAL(system_rev))
		{
			// Olympus P3 and newer
			config_unused_pins(oly_unused_pins_p3, ARRAY_SIZE(oly_unused_pins_p3));
		}
	}

	if (machine_is_etna())
	{
		if (HWREV_TYPE_IS_PORTABLE(system_rev) && (HWREV_REV(system_rev) >= HWREV_REV_2) && (HWREV_REV(system_rev) < HWREV_REV_2C))
		{
			config_unused_pins(etna_unused_pins_p2a, ARRAY_SIZE(etna_unused_pins_p2a));
		}
		else if ((HWREV_TYPE_IS_PORTABLE(system_rev) && HWREV_REV(system_rev) >= HWREV_REV_2C) ||
			(HWREV_TYPE_IS_MORTABLE(system_rev) && HWREV_REV(system_rev) >= HWREV_REV_3) ||
 			HWREV_TYPE_IS_FINAL(system_rev))
		{
			config_unused_pins(etna_unused_pins_p2c, ARRAY_SIZE(etna_unused_pins_p2c));
		}
	}

        if (machine_is_tegra_daytona())
                config_unused_pins(daytona_unused_pins_p1, ARRAY_SIZE(daytona_unused_pins_p1));


	if (machine_is_etna() || machine_is_tegra_daytona() || machine_is_sunfire())
		// UTS tool support
		mot_keymap_update_init();
}
int __init mot_nvodmcam_init(void)
{
	int i;

	memset((unsigned char *)&pdata, 0, sizeof(pdata));

	for(i = 0; i < NVODMCAM_MAX_CAMERAS; i++) {
		UNASSIGN(pdata.camera[i].cam_pd);
		UNASSIGN(pdata.camera[i].cam_rs);
		UNASSIGN(pdata.camera[i].flash_rs);
	}

	/* ===== ETNA ===== */
	if (machine_is_etna()) {
		pdata.num_cameras = 2;
		/* camera 0 - back camera */
		if (HWREV_TYPE_IS_FINAL(system_rev) ||
			(HWREV_TYPE_IS_PORTABLE(system_rev) &&
			 HWREV_REV(system_rev) >= HWREV_REV_3B) ||
			(HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
			 HWREV_REV(system_rev) >= HWREV_REV_3)) {
			/* Etna P3B+,S3+ -> AP8140 pd=D2,no rs */
			SENSOR(pdata.camera[0], AP8140);
			ASSIGN(pdata.camera[0].cam_pd, D2, 1);
		}
		else if (system_rev == HWREV_UNDEFINED ||
			(HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
			 HWREV_REV(system_rev) == HWREV_REV_1)) {
			/* Etna UND,S1 -> OV5650 pd=N5,rs=D2 */
			SENSOR(pdata.camera[0], OV5650);
			ASSIGN(pdata.camera[0].cam_pd, N5, 0);
			ASSIGN(pdata.camera[0].cam_rs, D2, 1);
		}
		else {
			/* Etna other -> OV5650 pd=BB1,rs=D2 */
			SENSOR(pdata.camera[0], OV5650);
			ASSIGN(pdata.camera[0].cam_pd, BB1, 0);
			ASSIGN(pdata.camera[0].cam_rs, D2,  1);
		}

		/* camera 0 - flash */
		if (system_rev == HWREV_UNDEFINED ||
			(HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
			 (HWREV_REV(system_rev) == HWREV_REV_1 ||
			  HWREV_REV(system_rev) == HWREV_REV_2))) {
			/* Etna UND,S1,S2 -> LM3554 rs=BB4 */
			ASSIGN(pdata.camera[0].flash_rs, BB4, 1);
		}
		else {
			/* Etna other -> LM3554 rs=T3 */
			ASSIGN(pdata.camera[0].flash_rs, T3, 1);
		}

		/* camera 1 - front camera */
		if (HWREV_TYPE_IS_FINAL(system_rev) ||
			(HWREV_TYPE_IS_PORTABLE(system_rev) &&
			 HWREV_REV(system_rev) >= HWREV_REV_3) ||
			(HWREV_TYPE_IS_BRASSBOARD(system_rev) &&
			 HWREV_REV(system_rev) >= HWREV_REV_3)) {
			/* Etna P3+,S3+ -> OV7739 pd=BB5,rs=L4 */
			SENSOR(pdata.camera[1], OV7739);
			ASSIGN(pdata.camera[1].cam_pd, BB5, 0);
			ASSIGN(pdata.camera[1].cam_rs, L4,  1);
		}
		else {
			/* Etna other -> OV7692 pd=BB5,no rs */
			SENSOR(pdata.camera[1], OV7692);
			ASSIGN(pdata.camera[1].cam_pd, BB5, 0);
		}
	}

	/* ===== DAYTONA ===== */
	else if (machine_is_tegra_daytona()) {
		pdata.num_cameras = 1;

		/* camera 0 - back camera */
		/* Daytona All HW -> AP8140 pd=D2,no rs */
		SENSOR(pdata.camera[0], AP8140);
		ASSIGN(pdata.camera[0].cam_pd, D2, 1);

		/* camera 0 - flash */
		/* Daytona All HW -> LM3559 rs=T3 */
		ASSIGN(pdata.camera[0].flash_rs, T3, 1);
	}

	/* ===== SUNFIRE ===== */
	else if (machine_is_sunfire()) {
		pdata.num_cameras = 2;

		/* camera 0 - back camera */
		/* Sunfire All HW -> AP8140 pd=D2,no rs */
		SENSOR(pdata.camera[0], AP8140);
		ASSIGN(pdata.camera[0].cam_pd, D2, 1);

		/* camera 0 - flash */
		/* Daytona All HW -> LM3554 rs=T3 */
		ASSIGN(pdata.camera[0].flash_rs, T3, 1);

		/* camera 1 - front camera */
		/* Sunfire All HW -> OV7739 pd=BB5,rs=L4 */
		SENSOR(pdata.camera[1], OV7739);
		ASSIGN(pdata.camera[1].cam_pd, BB5, 0);
		ASSIGN(pdata.camera[1].cam_rs, L4, 1);
	}

	/* ===== OLYMPUS ===== */
	else if (machine_is_olympus()) {
		pdata.num_cameras = 2;

		/* camera 0 - back camera */
		if (system_rev == HWREV_UNDEFINED ||
			(HWREV_TYPE_IS_MORTABLE(system_rev) &&
			 (HWREV_REV(system_rev) == HWREV_REV_1 ||
			  HWREV_REV(system_rev) == HWREV_REV_1B))) {
			/* Olympus UND,M1,M1B -> OV5650 pd=N5,rs=D2 */
			SENSOR(pdata.camera[0], OV5650);
			ASSIGN(pdata.camera[0].cam_pd, N5, 0);
			ASSIGN(pdata.camera[0].cam_rs, D2, 1);
		}
		else {
			/* Olympus other -> OV5650 pd=BB1,rs=D2 */
			SENSOR(pdata.camera[0], OV5650);
			ASSIGN(pdata.camera[0].cam_pd, BB1, 0);
			ASSIGN(pdata.camera[0].cam_rs, D2,  1);
		}

		/* camera 0 - flash */
		if (system_rev == HWREV_UNDEFINED ||
			(HWREV_TYPE_IS_MORTABLE(system_rev) &&
			 (HWREV_REV(system_rev) == HWREV_REV_1 ||
			  HWREV_REV(system_rev) == HWREV_REV_1B)) ||
			(HWREV_TYPE_IS_PORTABLE(system_rev) &&
			 (HWREV_REV(system_rev) == HWREV_REV_0))) {
			/* Olympus UND,M1,M1B,P0 -> LM3554 rs=BB4 */
			ASSIGN(pdata.camera[0].flash_rs, BB4, 1);
		}
		else {
			/* Olympus other -> LM3554 rs=T3 */
			ASSIGN(pdata.camera[0].flash_rs, T3, 1);
		}

		/* camera 1 - front camera */
		if (HWREV_TYPE_IS_FINAL(system_rev) ||
			(HWREV_TYPE_IS_PORTABLE(system_rev) &&
			 HWREV_REV(system_rev) >= HWREV_REV_2C)) {
			/* Olympus P2C+ -> SOC380 pd=BB5,rs=L4 */
			SENSOR(pdata.camera[1], SOC380);
			ASSIGN(pdata.camera[1].cam_pd, BB5, 0);
			ASSIGN(pdata.camera[1].cam_rs, L4,  1);
		}
		else {
			/* Olympus other -> OV7692 pd=BB5,no rs */
			SENSOR(pdata.camera[1], OV7692);
			ASSIGN(pdata.camera[1].cam_pd, BB5, 0);
		}
	}

	else {
		printk(KERN_ERR "%s: your hw not supported\n", __func__);
		return -ENODEV;
	}

	return platform_device_register(&nvodmcam_platform_device);
}