示例#1
0
/* Only e800 has 128MB RAM */
void __init eseries_fixup(struct tag *tags, char **cmdline)
{
	if (machine_is_e800())
		memblock_add(0xa0000000, SZ_128M);
	else
		memblock_add(0xa0000000, SZ_64M);
}
示例#2
0
/* Only e800 has 128MB RAM */
void __init eseries_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
{
	mi->nr_banks=1;
	mi->bank[0].start = 0xa0000000;
	if (machine_is_e800())
		mi->bank[0].size = (128*1024*1024);
	else
		mi->bank[0].size = (64*1024*1024);
}
示例#3
0
static int eseries_battery_init(void) {
	int ret;

	if(!(machine_is_e740() || machine_is_e750() || machine_is_e800()))
		return -ENODEV;

	ret = request_irq(IRQ_GPIO(10), eseries_battery_irq, 0, "battery", NULL);
	if(ret)
		return ret;
	set_irq_type(IRQ_GPIO(10), IRQT_BOTHEDGE);

	eseries_battery_probe(NULL);

	return 0;
}
示例#4
0
static int __init e800_init(void)
{
	int ret;

	if (!machine_is_e800())
		return -ENODEV;

	ret = gpio_request(GPIO_E800_HP_AMP_OFF,  "Headphone amp");
	if (ret)
		return ret;

	ret = gpio_request(GPIO_E800_SPK_AMP_ON, "Speaker amp");
	if (ret)
		goto free_hp_amp_gpio;

	ret = gpio_direction_output(GPIO_E800_HP_AMP_OFF, 1);
	if (ret)
		goto free_spk_amp_gpio;

	ret = gpio_direction_output(GPIO_E800_SPK_AMP_ON, 1);
	if (ret)
		goto free_spk_amp_gpio;

	e800_snd_device = platform_device_alloc("soc-audio", -1);
	if (!e800_snd_device)
		return -ENOMEM;

	platform_set_drvdata(e800_snd_device, &e800_snd_devdata);
	e800_snd_devdata.dev = &e800_snd_device->dev;
	ret = platform_device_add(e800_snd_device);

	if (!ret)
		return 0;

/* Fail gracefully */
	platform_device_put(e800_snd_device);
free_spk_amp_gpio:
	gpio_free(GPIO_E800_SPK_AMP_ON);
free_hp_amp_gpio:
	gpio_free(GPIO_E800_HP_AMP_OFF);

	return ret;
}
static int __init e800_init(void)
{
	int ret;

	if (!machine_is_e800())
		return -ENODEV;

	e800_snd_device = platform_device_alloc("soc-audio", -1);
	if (!e800_snd_device)
		return -ENOMEM;

	platform_set_drvdata(e800_snd_device, &e800_snd_devdata);
	e800_snd_devdata.dev = &e800_snd_device->dev;
	ret = platform_device_add(e800_snd_device);

	if (ret)
		platform_device_put(e800_snd_device);

	return ret;
}