예제 #1
0
static int __init e750_pcmcia_init(void)
{
	int ret = 0;

	if(!machine_is_e750())
		return -ENODEV;

	printk("pcmcia: e750 detected.\n");

	ret = platform_device_register(&e750_pcmcia_device);

	return ret;
}
예제 #2
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;
}
예제 #3
0
static int __init e750_init(void)
{
    int ret;

    if (!machine_is_e750())
        return -ENODEV;

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

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

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

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

    e750_snd_device = platform_device_alloc("soc-audio", -1);
    if (!e750_snd_device) {
        ret = -ENOMEM;
        goto free_spk_amp_gpio;
    }

    platform_set_drvdata(e750_snd_device, &e750_snd_devdata);
    e750_snd_devdata.dev = &e750_snd_device->dev;
    ret = platform_device_add(e750_snd_device);

    if (!ret)
        return 0;


    platform_device_put(e750_snd_device);
free_spk_amp_gpio:
    gpio_free(GPIO_E750_SPK_AMP_OFF);
free_hp_amp_gpio:
    gpio_free(GPIO_E750_HP_AMP_OFF);

    return ret;
}