Example #1
0
static void __exit minnow_gpio_module_exit(void)
{
	if (minnow_lvds_detect())
		gpio_free_array(expansion_aux_gpios,
				ARRAY_SIZE(expansion_aux_gpios));
	gpio_free_array(expansion_gpios, ARRAY_SIZE(expansion_gpios));
}
static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
{
	if (skt->nr == 0)
		gpio_free_array(vpac270_pcmcia_gpios,
					ARRAY_SIZE(vpac270_pcmcia_gpios));
	else
		gpio_free_array(vpac270_cf_gpios,
					ARRAY_SIZE(vpac270_cf_gpios));
}
int msm_camera_request_gpio_table(struct msm_camera_sensor_info *sinfo,
	int gpio_en)
{
	int rc = 0;
	struct msm_camera_gpio_conf *gpio_conf =
		sinfo->sensor_platform_info->gpio_conf;

	if (!gpio_conf->gpio_no_mux) {
		if (gpio_conf->cam_gpio_req_tbl == NULL ||
			gpio_conf->cam_gpio_common_tbl == NULL) {
			pr_err("%s: NULL camera gpio table\n", __func__);
			return -EFAULT;
		}
	}
	if (gpio_conf->gpio_no_mux)
		config_gpio_table(gpio_conf);

	if (gpio_en) {
		if (!gpio_conf->gpio_no_mux && !gpio_ref_count) {
			if (gpio_conf->cam_gpiomux_conf_tbl != NULL) {
				msm_gpiomux_install(
					(struct msm_gpiomux_config *)
					gpio_conf->cam_gpiomux_conf_tbl,
					gpio_conf->cam_gpiomux_conf_tbl_size);
			}
			rc = gpio_request_array(gpio_conf->cam_gpio_common_tbl,
				gpio_conf->cam_gpio_common_tbl_size);
			if (rc < 0) {
				pr_err("%s common gpio request failed\n"
						, __func__);
				return rc;
			}
		}
		gpio_ref_count++;
		if (gpio_conf->cam_gpio_req_tbl_size) {
			rc = gpio_request_array(gpio_conf->cam_gpio_req_tbl,
				gpio_conf->cam_gpio_req_tbl_size);
			if (rc < 0) {
				pr_err("%s camera gpio"
					"request failed\n", __func__);
				gpio_free_array(gpio_conf->cam_gpio_common_tbl,
					gpio_conf->cam_gpio_common_tbl_size);
				return rc;
			}
		}
	} else {
		gpio_ref_count--;
		gpio_free_array(gpio_conf->cam_gpio_req_tbl,
				gpio_conf->cam_gpio_req_tbl_size);
		if (!gpio_conf->gpio_no_mux && !gpio_ref_count)
			gpio_free_array(gpio_conf->cam_gpio_common_tbl,
				gpio_conf->cam_gpio_common_tbl_size);
	}
	return rc;
}
Example #4
0
static int __init sg2_pcmcia_init(void)
{
	int ret;

	if (!machine_is_stargate2())
		return -ENODEV;

	sg2_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
	if (!sg2_pcmcia_device)
		return -ENOMEM;

	ret = gpio_request_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
	if (ret)
		goto error_put_platform_device;

	ret = platform_device_add_data(sg2_pcmcia_device,
				       &sg2_pcmcia_ops,
				       sizeof(sg2_pcmcia_ops));
	if (ret)
		goto error_free_gpios;

	ret = platform_device_add(sg2_pcmcia_device);
	if (ret)
		goto error_free_gpios;

	return 0;
error_free_gpios:
	gpio_free_array(sg2_pcmcia_gpios, ARRAY_SIZE(sg2_pcmcia_gpios));
error_put_platform_device:
	platform_device_put(sg2_pcmcia_device);

	return ret;
}
Example #5
0
static int __init minnow_gpio_module_init(void)
{
	int err;

	err = -ENODEV;
	if (!minnow_detect())
		goto out;

	/* Auxillary Expansion GPIOs */
	if (!minnow_lvds_detect()) {
		pr_debug("LVDS_DETECT not asserted, configuring Aux GPIO lines\n");
		err = gpio_request_array(expansion_aux_gpios,
					 ARRAY_SIZE(expansion_aux_gpios));
		if (err) {
			pr_err("Failed to request expansion aux GPIO lines\n");
			goto out;
		}
	} else {
		pr_debug("LVDS_DETECT asserted, ignoring aux GPIO lines\n");
	}

	/* Expansion GPIOs */
	err = gpio_request_array(expansion_gpios, ARRAY_SIZE(expansion_gpios));
	if (err) {
		pr_err("Failed to request expansion GPIO lines\n");
		if (minnow_lvds_detect())
			gpio_free_array(expansion_aux_gpios,
					ARRAY_SIZE(expansion_aux_gpios));
		goto out;
	}

 out:
	return err;
}
static int vision_spi_mmc_init(struct device *pdev,
			irqreturn_t (*func)(int, void *), void *pdata)
{
	int err;

	err = gpio_request_array(vision_spi_mmc_gpios,
				 ARRAY_SIZE(vision_spi_mmc_gpios));
	if (err)
		return err;

	err = gpio_set_debounce(VISION_SPI_MMC_CD, 1);
	if (err)
		goto exit_err;

	err = request_irq(gpio_to_irq(VISION_SPI_MMC_CD), func,
			IRQ_TYPE_EDGE_BOTH, "mmc_spi:cd", pdata);
	if (err)
		goto exit_err;

	return 0;

exit_err:
	gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios));
	return err;

}
int msm_camera_request_gpio_table(struct gpio *gpio_tbl, uint8_t size,
	int gpio_en)
{
	int rc = 0, i = 0;

	if (!gpio_tbl || !size) {
		pr_err("%s:%d invalid gpio_tbl %p / size %d\n", __func__,
			__LINE__, gpio_tbl, size);
		return -EINVAL;
	}
	for (i = 0; i < size; i++) {
		CDBG("%s:%d i %d, gpio %d dir %ld\n", __func__, __LINE__, i,
			gpio_tbl[i].gpio, gpio_tbl[i].flags);
	}
	if (gpio_en) {
		rc = gpio_request_array(gpio_tbl, size);
		if (rc < 0) {
			pr_err("%s:%d camera gpio request failed\n", __func__,
				__LINE__);
			return rc;
		}
	} else {
		gpio_free_array(gpio_tbl, size);
	}
	return rc;
}
Example #8
0
int msm_camera_request_gpio_table(struct gpio *gpio_tbl, uint8_t size,
	int gpio_en)
{
	int rc = 0, i = 0, err = 0;

	if (!gpio_tbl || !size) {
		pr_err("%s:%d invalid gpio_tbl %p / size %d\n", __func__,
			__LINE__, gpio_tbl, size);
		return -EINVAL;
	}
	for (i = 0; i < size; i++) {
		CDBG("%s:%d i %d, gpio %d dir %ld\n", __func__, __LINE__, i,
			gpio_tbl[i].gpio, gpio_tbl[i].flags);
	}
	if (gpio_en) {
		for (i = 0; i < size; i++) {
			err = gpio_request_one(gpio_tbl[i].gpio,
				gpio_tbl[i].flags, gpio_tbl[i].label);
			if (err) {
				/*
				* After GPIO request fails, contine to
				* apply new gpios, outout a error message
				* for driver bringup debug
				*/
				pr_err("%s:%d gpio %d:%s request fails\n",
					__func__, __LINE__,
					gpio_tbl[i].gpio, gpio_tbl[i].label);
			}
		}
	} else {
		gpio_free_array(gpio_tbl, size);
	}
	return rc;
}
Example #9
0
static int __init qi_lb60_init(void)
{
	int ret;

	qi_lb60_snd_device = platform_device_alloc("soc-audio", -1);

	if (!qi_lb60_snd_device)
		return -ENOMEM;

	ret = gpio_request_array(qi_lb60_gpios, ARRAY_SIZE(qi_lb60_gpios));
	if (ret) {
		pr_err("qi_lb60 snd: Failed to request gpios: %d\n", ret);
		goto err_device_put;
	}

	platform_set_drvdata(qi_lb60_snd_device, &qi_lb60);

	ret = platform_device_add(qi_lb60_snd_device);
	if (ret) {
		pr_err("qi_lb60 snd: Failed to add snd soc device: %d\n", ret);
		goto err_unset_pdata;
	}

	 return 0;

err_unset_pdata:
	platform_set_drvdata(qi_lb60_snd_device, NULL);
/*err_gpio_free_array:*/
	gpio_free_array(qi_lb60_gpios, ARRAY_SIZE(qi_lb60_gpios));
err_device_put:
	platform_device_put(qi_lb60_snd_device);

	return ret;
}
void ev3_output_port_unregister(struct lego_port_device *port)
{
	struct ev3_output_port_data *data;

	/* port can be null if disabled via module parameter */
	if (!port)
		return;

	data = container_of(port, struct ev3_output_port_data, out_port);
	pwm_disable(data->pwm);
	pwm_put(data->pwm);
	hrtimer_cancel(&data->timer);
	cancel_work_sync(&data->change_uevent_work);
	cancel_work_sync(&data->work);
	if (data->motor)
		ev3_output_port_unregister_motor(&data->work);
	if (port->mode == EV3_OUTPUT_PORT_MODE_RAW)
		ev3_output_port_disable_raw_mode(data);
	lego_port_unregister(&data->out_port);
	ev3_output_port_float(data);
	gpio_free_array(data->gpio, ARRAY_SIZE(data->gpio));
	put_legoev3_analog(data->analog);
	dev_set_drvdata(&port->dev, NULL);
	kfree(data);
}
Example #11
0
static int mx31_3ds_sdhc1_init(struct device *dev,
			       irq_handler_t detect_irq,
			       void *data)
{
	int ret;

	ret = gpio_request_array(mx31_3ds_sdhc1_gpios,
				 ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
	if (ret) {
		pr_warning("Unable to request the SD/MMC GPIOs.\n");
		return ret;
	}

	ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
			  detect_irq, IRQF_DISABLED |
			  IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
			  "sdhc1-detect", data);
	if (ret) {
		pr_warning("Unable to request the SD/MMC card-detect IRQ.\n");
		goto gpio_free;
	}

	return 0;

gpio_free:
	gpio_free_array(mx31_3ds_sdhc1_gpios,
			ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
	return ret;
}
Example #12
0
static __devinit int palmld_pata_probe(struct platform_device *pdev)
{
	struct ata_host *host;
	struct ata_port *ap;
	void __iomem *mem;
	int ret;

	/* allocate host */
	host = ata_host_alloc(&pdev->dev, 1);
	if (!host) {
		ret = -ENOMEM;
		goto err1;
	}

	/* remap drive's physical memory address */
	mem = devm_ioremap(&pdev->dev, PALMLD_IDE_PHYS, 0x1000);
	if (!mem) {
		ret = -ENOMEM;
		goto err1;
	}

	/* request and activate power GPIO, IRQ GPIO */
	ret = gpio_request_array(palmld_hdd_gpios,
				ARRAY_SIZE(palmld_hdd_gpios));
	if (ret)
		goto err1;

	/* reset the drive */
	gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 0);
	msleep(30);
	gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 1);
	msleep(30);

	/* setup the ata port */
	ap = host->ports[0];
	ap->ops	= &palmld_port_ops;
	ap->pio_mask = ATA_PIO4;
	ap->flags |= ATA_FLAG_PIO_POLLING;

	/* memory mapping voodoo */
	ap->ioaddr.cmd_addr = mem + 0x10;
	ap->ioaddr.altstatus_addr = mem + 0xe;
	ap->ioaddr.ctl_addr = mem + 0xe;

	/* start the port */
	ata_sff_std_ports(&ap->ioaddr);

	/* activate host */
	ret = ata_host_activate(host, 0, NULL, IRQF_TRIGGER_RISING,
					&palmld_sht);
	if (ret)
		goto err2;

	return ret;

err2:
	gpio_free_array(palmld_hdd_gpios, ARRAY_SIZE(palmld_hdd_gpios));
err1:
	return ret;
}
Example #13
0
/**
 * gpio_pmodoled_init_gpio - Initialize GPIO for ZED Onboard OLED
 * @dev - gpio_pmodoled_device
 *
 * Initializes OLED GPIO Control Pins.
 * It returns 0, if the gpio pins are successfully
 * initialized, or a negative value if there is an error.
 */
static int gpio_pmodoled_init_gpio(struct gpio_pmodoled_device *dev)
{
	struct gpio gpio_pmodoled_ctrl[] = {
		{dev->iVBAT, GPIOF_OUT_INIT_HIGH, "OLED VBat"},
		{dev->iVDD, GPIOF_OUT_INIT_HIGH, "OLED VDD"},
		{dev->iRES, GPIOF_OUT_INIT_HIGH, "OLED_RESET"},
		{dev->iDC, GPIOF_OUT_INIT_HIGH, "OLED_D/C"},
	};
	int status;
	int i;

	for (i = 0; i < ARRAY_SIZE(gpio_pmodoled_ctrl); i++) {
		status = gpio_is_valid(gpio_pmodoled_ctrl[i].gpio);
		if (!status) {
			dev_err(&dev->spi->dev, "!! gpio_is_valid for GPIO %d, %s FAILED!, status: %d\n",
					gpio_pmodoled_ctrl[i].gpio, gpio_pmodoled_ctrl[i].label, status);
			goto gpio_invalid;
		}
	}

	status = gpio_request_array(gpio_pmodoled_ctrl, ARRAY_SIZE(gpio_pmodoled_ctrl));
	if (status) {
		dev_err(&dev->spi->dev, "!!  gpio_request_array FAILED!\n");
		dev_err(&dev->spi->dev, "          status is: %d\n", status);
		gpio_free_array(gpio_pmodoled_ctrl, 4);
		goto gpio_invalid;
	}

gpio_invalid:
	return status;
}
static void __init cm_t35_init_display(void)
{
	int err;

	spi_register_board_info(cm_t35_lcd_spi_board_info,
				ARRAY_SIZE(cm_t35_lcd_spi_board_info));

	err = gpio_request_array(cm_t35_dss_gpios,
				 ARRAY_SIZE(cm_t35_dss_gpios));
	if (err) {
		pr_err("CM-T35: failed to request DSS control GPIOs\n");
		return;
	}

	gpio_export(CM_T35_LCD_EN_GPIO, 0);
	gpio_export(CM_T35_LCD_BL_GPIO, 0);
	gpio_export(CM_T35_DVI_EN_GPIO, 0);

	msleep(50);
	gpio_set_value(CM_T35_LCD_EN_GPIO, 1);

	err = omap_display_init(&cm_t35_dss_data);
	if (err) {
		pr_err("CM-T35: failed to register DSS device\n");
		gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
	}
}
Example #15
0
static void wm1250_ev1_free(struct i2c_client *i2c)
{
	struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev);

	if (wm1250)
		gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios));
}
Example #16
0
static void __init omap3_beagle_init_rev(void)
{
	int ret;
	u16 beagle_rev = 0;

	omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP);
	omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP);

	ret = gpio_request_array(omap3_beagle_rev_gpios,
				 ARRAY_SIZE(omap3_beagle_rev_gpios));
	if (ret < 0) {
		printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
		return;
	}

	beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1)
			| (gpio_get_value(173) << 2);

	gpio_free_array(omap3_beagle_rev_gpios,
			ARRAY_SIZE(omap3_beagle_rev_gpios));

	switch (beagle_rev) {
	case 7:
		printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX;
		beagle_config.mmc1_gpio_wp = 29;
		beagle_config.reset_gpio = 170;
		beagle_config.usr_button_gpio = 7;
		break;
	case 6:
		printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3;
		beagle_config.mmc1_gpio_wp = 23;
		beagle_config.reset_gpio = 170;
		beagle_config.usr_button_gpio = 7;
		break;
	case 5:
		printk(KERN_INFO "OMAP3 Beagle Rev: C4\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
		beagle_config.mmc1_gpio_wp = 23;
		beagle_config.reset_gpio = 170;
		beagle_config.usr_button_gpio = 7;
		break;
	case 0:
		printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
		beagle_config.usb_pwr_level = GPIOF_OUT_INIT_HIGH;
		break;
	case 2:
		printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
		break;
	default:
		printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
		omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
	}
}
Example #17
0
static int hx4700_audio_remove(struct platform_device *pdev)
{
	gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
	gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);

	gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
	return 0;
}
Example #18
0
static int e750_remove(struct platform_device *pdev)
{
	struct snd_soc_card *card = platform_get_drvdata(pdev);

	gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
	snd_soc_unregister_card(card);
	return 0;
}
Example #19
0
// Exit of the module
static void __exit tphonekp_exit(void)
{
    int i;

    // Unregister and free the input device
    input_unregister_device(input);
    input_free_device(input);
    
    printk(KERN_NOTICE "toxphone: freeing GPIO");

    // Free irqs and GPIOs
    for(i=0 ; i<NB_ROWS ; i++) { free_irq(irq_pin[i], &gpio_rows[i]); }
    gpio_free_array(gpio_col, NB_COLUMN);
    gpio_free_array(gpio_rows, NB_ROWS);

    printk(KERN_NOTICE "toxphone: keypad driver exit");
}
static int hummingbird_touch_release_resources(struct device  *dev)
{

	regulator_put(hummingbird_touch_vdd);
	regulator_put(hummingbird_touch_power);
	gpio_free_array(hummingbird_touch_gpios, ARRAY_SIZE(hummingbird_touch_gpios));

	return 0;
}
static int mmi_factory_remove(struct platform_device *pdev)
{
	struct mmi_factory_info *info = platform_get_drvdata(pdev);

	if (info)
		gpio_free_array(info->list, info->num_gpios);

	return 0;
}
static void __exit neo1973_exit(void)
{
	platform_device_unregister(neo1973_snd_device);

	if (machine_is_neo1973_gta02()) {
		gpio_free_array(neo1973_gta02_gpios,
				ARRAY_SIZE(neo1973_gta02_gpios));
	}
}
static int baseband_xmm_power_driver_remove(struct platform_device *device)
{
	int i;
	struct baseband_power_platform_data *data
		= (struct baseband_power_platform_data *)
			device->dev.platform_data;
	struct device *dev = &device->dev;

	pr_debug("%s\n", __func__);

	/* check for platform data */
	if (!data)
		return 0;

	usb_unregister_notify(&usb_xmm_nb);

	/* free work structure */
	kfree(baseband_xmm_power_work);
	baseband_xmm_power_work = (struct baseband_xmm_power_work_t *) 0;

	/* free baseband irq(s) */
	if (modem_flash && modem_pm) {
		free_irq(gpio_to_irq(baseband_power_driver_data
			->modem.xmm.ipc_ap_wake), NULL);
	}

	/* free baseband gpio(s) */
	gpio_free_array(tegra_baseband_gpios,
		ARRAY_SIZE(tegra_baseband_gpios));

	/* disable regulator LDO7 for hsic power*/
	regulator_disable(reg_grouper_hsic);
	regulator_put(reg_grouper_hsic);
	reg_grouper_hsic = NULL;

	/* destroy wake lock */
	wake_lock_destroy(&wakelock);
	wake_lock_destroy(&modem_recovery_wakelock);

	/* delete device file */
	/*
	device_remove_file(dev, &dev_attr_xmm_onoff);
	*/
	for (i = 0; i < (ARRAY_SIZE(xmm_device_attr) - 1); i++) {
		device_remove_file(dev, &xmm_device_attr[i]);
	}

	/* unregister usb host controller */
	if (data->hsic_unregister && (!register_hsic_device)) {
		register_hsic_device = true;
		data->hsic_unregister(data->modem.xmm.hsic_device);
	}else
		pr_err("%s: hsic_unregister is missing\n", __func__);

	return 0;
}
Example #24
0
/** @brief The LKM cleanup function
 *  Similar to the initialization function, it is static. The __exit macro notifies that if this
 *  code is used for a built-in driver (not a LKM) that this function is not required.
 */
static void __exit ebbButton_exit(void)
{
    printk(KERN_INFO "EBB Button: The button was pressed %d times\n", numberPresses);
    kobject_put(ebb_kobj);                   // clean up -- remove the kobject sysfs entry
    free_irq(irqNumber, NULL);               // Free the IRQ number, no *dev_id required in this case
    // free inputs
    gpio_free_array(btn_gpios, ARRAY_SIZE(btn_gpios));

    printk(KERN_INFO "EBB Button: Goodbye from the EBB Button LKM!\n");
}
static int __devexit hx4700_audio_remove(struct platform_device *pdev)
{
	snd_soc_jack_free_gpios(&hs_jack, 1, &hs_jack_gpio);
	snd_soc_unregister_card(&snd_soc_card_hx4700);

	gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
	gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);

	gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
	return 0;
}
static void tlc5947_exit(void) {
	if(tlc5947_cdev) {
		cdev_del(tlc5947_cdev);
	}
	if(tlc5947_major_number > -1) {
		unregister_chrdev_region(tlc5947_numbers, tlc5947_minor_count);
	}
	if((tlc5947[0].gpio == tlc5947_data) && (tlc5947[1].gpio == tlc5947_clock) && (tlc5947[2].gpio == tlc5947_latch)) {
		gpio_free_array(tlc5947, TLC5947_GPIOS);
	}
}
Example #27
0
static inline void __init palmz72_cam_gpio_init(void)
{
	int ret;

	ret = gpio_request_array(ARRAY_AND_SIZE(palmz72_camera_gpios));
	if (!ret)
		gpio_free_array(ARRAY_AND_SIZE(palmz72_camera_gpios));
	else
		printk(KERN_ERR "Camera GPIO init failed!\n");

	return;
}
Example #28
0
static __devexit int palmld_pata_remove(struct platform_device *dev)
{
	struct ata_host *host = platform_get_drvdata(dev);

	ata_host_detach(host);

	/* power down the HDD */
	gpio_set_value(GPIO_NR_PALMLD_IDE_PWEN, 0);

	gpio_free_array(palmld_hdd_gpios, ARRAY_SIZE(palmld_hdd_gpios));

	return 0;
}
Example #29
0
static void uc_msp430_exit(void)
{
        D(KERN_INFO, "exit.\n");

	gpio_set_value(UC_MSP430_RED_GPIO, 1);
	gpio_set_value(UC_MSP430_GREEN_GPIO, 0);

	free_irq(uc_msp430_irq_addr, (void*) uc_msp430_driver);

	gpio_free_array(uc_msp430_gpio_array, ARRAY_SIZE(uc_msp430_gpio_array));

        D(KERN_INFO "exited.\n");
}
Example #30
0
/*
 * Module exit function
 */
static void __exit gpiomod_exit(void)
{
	int i;

	printk(KERN_INFO "%s\n", __func__);

	// turn all LEDs off
	for(i = 0; i < ARRAY_SIZE(leds); i++) {
		gpio_set_value(leds[i].gpio, 0); 
	}
	
	// unregister all GPIOs
	gpio_free_array(leds, ARRAY_SIZE(leds));
}