void __init fixup_archos(struct machine_desc *desc,
		struct tag *tags, char **cmdline, struct meminfo *mi)
{
	if ( machine_is_archos_a43() || machine_is_archos_a70s()) {
		// regular boards
		*cmdline = command_line[0];
	} else if (machine_is_archos_a70h()) {
		// hdd boards
		*cmdline = command_line[1];
	} else if (machine_is_archos_a28()) {
		// 3611 boards
		*cmdline = command_line[2];
	} else if (machine_is_archos_a35()) {
		// 3611 boards with bigger screen...
		*cmdline = command_line[3];
	} else if (machine_is_archos_a101it() || machine_is_archos_a70s2()) {
		// Bigger Screen
		*cmdline = command_line[4];
	} else if (machine_is_archos_a32() || machine_is_archos_a32sd() || machine_is_archos_a35dm() || machine_is_archos_a35de()) {
		// Small screen and only TV out
		*cmdline = command_line[5];
	} else if (machine_is_archos_a70h2()) {
		// hdd boards with bigger screen...
		*cmdline = command_line[6];
	} else {
		printk("%s : NO COMMAND LINE FOUND!", __FUNCTION__);
		return;
	}

	printk("fixup_archos: [%s]\n", *cmdline);
}
Пример #2
0
int __init panel_wqvga_32_init(struct omap_dss_device *disp_data)
{
    const struct archos_display_config *disp_cfg;
    int ret = -ENODEV;

    pr_debug("panel_wqvga_32_init\n");

    disp_cfg = omap_get_config( ARCHOS_TAG_DISPLAY, struct archos_display_config );
    if (disp_cfg == NULL)
        return ret;

    if ( hardware_rev >= disp_cfg->nrev ) {
        printk(KERN_DEBUG "archos_display_init: hardware_rev (%i) >= nrev (%i)\n",
               hardware_rev, disp_cfg->nrev);
        return ret;
    }

    display_gpio = disp_cfg->rev[hardware_rev];

    /* init spi, bus line is used as mcspi */
    omap_cfg_reg(display_gpio.spi.spi_clk.mux_cfg);
    omap_cfg_reg(display_gpio.spi.spi_cs.mux_cfg);
    omap_cfg_reg(display_gpio.spi.spi_data.mux_cfg);

    spi_register_board_info(lcd_spi_board_info, 1);

    panel_init(&byd_wqvga_32_panel);

#if defined(CONFIG_FB_OMAP_BOOTLOADER_INIT)
    panel_set_backlight_level(NULL, 255);
#endif
    if ( machine_is_archos_a32() && ( hardware_rev < 3 ) ) {
        byd_wqvga_32_panel.phy.dpi.data_lines = 24;
        byd_wqvga_32_panel.phy.dpi.dither = OMAP_DSS_DITHER_NONE;
    }
    *disp_data = byd_wqvga_32_panel;

    return 0;
}
Пример #3
0
static int __init usb_android_init(void)
{
#if defined(CONFIG_USB_ANDROID) || defined(CONFIG_USB_ANDROID_MODULE)

	u32 prod_id[4];

	get_dieid(prod_id);

	if (machine_is_archos_a32()) {
		sprintf(android_usb_pdata.serial_number, "A32-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1416;
		android_usb_pdata.product_name = A32;
		android_usb_pdata.nluns = 1;
		usb_mass_storage_pdata.product = A32;
	} else if ( machine_is_archos_a28() ) {
		sprintf(android_usb_pdata.serial_number, "A28-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1415;
		android_usb_pdata.product_name = A28;
		android_usb_pdata.nluns = 1;
		usb_mass_storage_pdata.product = A28;
	} else if ( machine_is_archos_a35() ) {
		sprintf(android_usb_pdata.serial_number, "A35-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1424;
		android_usb_pdata.product_name = A35;
		android_usb_pdata.nluns = 2;
		usb_mass_storage_pdata.product = A35;
	} else if ( machine_is_archos_a35dm() ) {
		sprintf(android_usb_pdata.serial_number, "A35DM-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1425;
		android_usb_pdata.product_name = A35DM;
		android_usb_pdata.nluns = 2;
		usb_mass_storage_pdata.product = A35DM;
	} else if ( machine_is_archos_a43() ) {
		sprintf(android_usb_pdata.serial_number, "A43-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1417;
		android_usb_pdata.product_name = A43;
		android_usb_pdata.nluns = 2;
		usb_mass_storage_pdata.product = A43;
	} else if ( machine_is_archos_a101it() ) {
		sprintf(android_usb_pdata.serial_number, "A10-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1419;
		android_usb_pdata.product_name = A10;
		android_usb_pdata.nluns = 2;
		usb_mass_storage_pdata.product = A10;
	} else if ( machine_is_archos_a70s() ||  machine_is_archos_a70h() ) {
		sprintf(android_usb_pdata.serial_number, "A70-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1420;
		if( machine_is_archos_a70s()){
			android_usb_pdata.product_id = 0x1420;
			android_usb_pdata.product_name = A70S;
			android_usb_pdata.nluns = 2;
			usb_mass_storage_pdata.product = A70S;
		}else{
			android_usb_pdata.product_id = 0x1422;
			android_usb_pdata.product_name = A70H;
			android_usb_pdata.nluns = 1;
			usb_mass_storage_pdata.product = A70H;
		}
	} else if ( machine_is_archos_a32sd() ) {
		sprintf(android_usb_pdata.serial_number, "A32-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
		android_usb_pdata.product_id = 0x1423;
		android_usb_pdata.product_name = A32SD;
		android_usb_pdata.nluns = 2;
		usb_mass_storage_pdata.product = A32SD;
	} else {
		sprintf(android_usb_pdata.serial_number, "A5x-%08X-%08X-%08X-%08X", prod_id[0],prod_id[1],prod_id[2],prod_id[3]);
	}
	
	if ( machine_charges_from_USB() ) {
		android_usb_pdata.bmAttributes = USB_CONFIG_ATT_ONE;
		android_usb_pdata.bMaxPower = 250; /* 500mA */
	} else {
		android_usb_pdata.bmAttributes	= USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
		android_usb_pdata.bMaxPower	= CONFIG_USB_GADGET_VBUS_DRAW / 2;
	}
	
	printk(KERN_ERR "registering Android USB device (%s)\n", android_usb_pdata.serial_number);

	if (platform_device_register(&android_usb_device) < 0) {
		printk(KERN_ERR "Unable to register Android USB device\n");
		return -ENODEV;
	}
	printk(KERN_ERR "registering Android USB mass storage device  (%s)\n", android_usb_pdata.serial_number);
	if (platform_device_register(&android_usb_mass_storage) < 0) {
		printk(KERN_ERR "Unable to register Android USB mass storage device\n");
		return -ENODEV;
	}
#endif

	return 0;
}
Пример #4
0
int __init archos_audio_gpio_init(void)
{
	const struct archos_audio_config *audio_cfg;
	struct clk *clkout2_src_ck;
	struct clk *sys_clkout2;
	struct clk *core_ck;

	/* audio  */
	audio_cfg = omap_get_config( ARCHOS_TAG_AUDIO, struct archos_audio_config );
	if (audio_cfg == NULL) {
		pr_err("archos_audio_gpio_init: no board configuration found\n");
		return -ENODEV;
	}
	if ( hardware_rev >= audio_cfg->nrev ) {
		pr_err("archos_audio_gpio_init: hardware_rev (%i) >= nrev (%i)\n",
			hardware_rev, audio_cfg->nrev);
		return -ENODEV;
	}

	audio_gpio = audio_cfg->rev[hardware_rev];

	// a32 & a43 protos where using clkout1.
	if (hardware_rev >= 1 || !(machine_is_archos_a32() || machine_is_archos_a43())) {
		core_ck = clk_get(NULL, "cm_96m_fck");
		if (IS_ERR(core_ck)) {
			printk(KERN_ERR "failed to get core_ck\n");
		}
	
		clkout2_src_ck = clk_get(NULL, "clkout2_src_ck");
		if (IS_ERR(clkout2_src_ck)) {
			printk(KERN_ERR "failed to get clkout2_src_ck\n");
		}
	
		sys_clkout2 = clk_get(NULL, "sys_clkout2");
		if (IS_ERR(sys_clkout2)) {
			printk(KERN_ERR "failed to get sys_clkout2\n");
		}
	
		if ( clk_set_parent(clkout2_src_ck, core_ck) != 0) {
			printk(KERN_ERR "failed to set sys_clkout2 parent to clkout2\n");
		}
	
		/* Set the clock to 12 Mhz */
		omap2_clksel_set_rate(sys_clkout2, 12000000);

		clk_put(sys_clkout2);
		clk_put(clkout2_src_ck);
		clk_put(core_ck);

		sysclock_name = sys_clkout2_name;
		use_mcbsp1_fclk = 1;
	} else {
		sysclock_name = sys_clkout1_name;
	}

	if (GPIO_PIN( audio_gpio.spdif ) != -1)
		archos_gpio_init_output( &audio_gpio.spdif, "spdif" );

	if (GPIO_PIN( audio_gpio.hp_on ) != -1)
		archos_gpio_init_output( &audio_gpio.hp_on, "hp_on" );

	if (GPIO_PIN( audio_gpio.headphone_plugged ) != -1)
		archos_gpio_init_input( &audio_gpio.headphone_plugged, "hp_detect" );

	if (GPIO_PIN( audio_gpio.vamp_vbat ) != -1)
		archos_gpio_init_output( &audio_gpio.vamp_vbat, "vamp_vbat" );
	if (GPIO_PIN( audio_gpio.vamp_dc ) != -1)
		archos_gpio_init_output( &audio_gpio.vamp_dc, "vamp_dc" );

	// XXX maybe prevents OFF mode?
	if (GPIO_PIN( audio_gpio.headphone_plugged ) != -1)
		gpio_set_debounce(GPIO_PIN(audio_gpio.headphone_plugged), (1 + 1) * 0x1f);

	if (GPIO_PIN(audio_gpio.vamp_dc) != -1) {
		int ret = platform_device_register(&archos_audio_vamp_device);
		if (ret < 0)
			return ret;

		ret = platform_driver_register(&archos_audio_vamp_driver);
		if (ret < 0)
			return ret;

		ret = device_create_file(&archos_audio_vamp_device.dev, &dev_attr_vamp_vusb_ctrl);
		if (ret < 0)
			return ret;

		hrtimer_init(&vamp_watchdog_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
		vamp_watchdog_timer.function = vamp_watchdog_timer_func;
	}

	pr_debug("%s init done\n", __FUNCTION__);
	return 0;
}