Example #1
0
static void bf5xx_ac97_warm_reset(struct snd_ac97 *ac97)
{
#if defined(CONFIG_BF54x) || defined(CONFIG_BF561) || \
 (defined(BF537_FAMILY) && (CONFIG_SND_BF5XX_SPORT_NUM == 1))

#define CONCAT(a, b, c) a ## b ## c
#define BFIN_SPORT_RFS(x) CONCAT(P_SPORT, x, _RFS)

	u16 per = BFIN_SPORT_RFS(CONFIG_SND_BF5XX_SPORT_NUM);
	u16 gpio = P_IDENT(BFIN_SPORT_RFS(CONFIG_SND_BF5XX_SPORT_NUM));

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

	peripheral_free(per);
	gpio_request(gpio, "bf5xx-ac97");
	gpio_direction_output(gpio, 1);
	udelay(2);
	gpio_set_value(gpio, 0);
	udelay(1);
	gpio_free(gpio);
	peripheral_request(per, "soc-audio");
#else
	pr_info("%s: Not implemented\n", __func__);
#endif
}
static int __init gptimer_example_init(void)
{
	int ret;

	
	ret = peripheral_request(P_TMR5, DRIVER_NAME);
	if (ret) {
		printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
		return ret;
	}

	
	ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data);
	if (ret) {
		printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
		peripheral_free(P_TMR5);
		return ret;
	}

	
	set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
	enable_gptimers(TIMER5bit);

	return 0;
}
Example #3
0
static void bfin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
{
	struct bfin_pwm *priv = pwm_get_chip_data(pwm);

	if (priv) {
		peripheral_free(priv->pin);
		kfree(priv);
	}
}
Example #4
0
static int iio_bfin_tmr_trigger_remove(struct platform_device *pdev)
{
	struct bfin_tmr_state *st = platform_get_drvdata(pdev);

	disable_gptimers(st->t->bit);
	if (st->output_enable)
		peripheral_free(st->t->pin);
	free_irq(st->irq, st);
	iio_trigger_unregister(st->trig);
	iio_trigger_put(st->trig);

	return 0;
}
Example #5
0
static void
port_peripherals_free(struct smpc_peripheral_port *port)
{

        assert(port != NULL);

        struct smpc_peripheral *peripheral;
        struct smpc_peripheral *tmp_peripheral;

        for (peripheral = TAILQ_FIRST(&port->peripherals);
             (peripheral != NULL) && (tmp_peripheral = TAILQ_NEXT(peripheral, peripherals), 1);
             peripheral = tmp_peripheral) {
                TAILQ_REMOVE(&port->peripherals, peripheral, peripherals);

                peripheral_free(peripheral);
        }
}
Example #6
0
int peripheral_request_list(const unsigned short per[], const char *label)
{
	u16 cnt;
	int ret;

	for (cnt = 0; per[cnt] != 0; cnt++) {

		ret = peripheral_request(per[cnt], label);

		if (ret < 0) {
			for ( ; cnt > 0; cnt--)
				peripheral_free(per[cnt - 1]);

			return ret;
		}
	}

	return 0;
}
Example #7
0
void pwm_free(struct pwm_device *pwm)
{
	peripheral_free(pwm->pin);
	kfree(pwm);
}
Example #8
0
void peripheral_free_list(const unsigned short per[])
{
	u16 cnt;
	for (cnt = 0; per[cnt] != 0; cnt++)
		peripheral_free(per[cnt]);
}
static void __exit gptimer_example_exit(void)
{
	disable_gptimers(TIMER5bit);
	free_irq(IRQ_TIMER5, &data);
	peripheral_free(P_TMR5);
}