Пример #1
0
static int __devexit imx_3stack_audio_remove(struct platform_device *pdev)
{
	struct snd_soc_machine *machine = platform_get_drvdata(pdev);
	struct snd_soc_codec *codec;
	struct snd_soc_pcm_link *pcm_link;

	gpio_free_irq(WM8903_IRQ_GPIO_PORT, WM8903_IRQ_GPIO_NUM, GPIO_LOW_PRIO);

	pcm_link = list_first_entry(&machine->active_list,
				    struct snd_soc_pcm_link, active_list);

	codec = pcm_link->codec;
	codec->ops->io_remove(codec, machine);

	snd_soc_machine_free(machine);

	driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
	kfree(machine);
	return 0;
}
Пример #2
0
int mxc_iomux_gpio_isp1301_set (struct otg_instance *otg, int usb_mode)
{

        int gpio = 1;

        printk (KERN_INFO"MXC gpio setting for isp1301\n");

        isp1301_mod_init(otg, &zasevb_isp1301_bh);

        TRACE_MSG0(otg->tcd->TAG, "5. IOMUX and GPIO Interrupt Configuration");
        iomux_config_mux(PIN_GPIO2, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);

        //Setting interrupt for ISP1301
        #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
        set_irq_type(IOMUX_TO_IRQ(PIN_GPIO2), IRQF_TRIGGER_FALLING);
        #else
        set_irq_type(IOMUX_TO_IRQ(PIN_GPIO2), IRQT_FALLING);
        #endif
        gpio = request_irq(IOMUX_TO_IRQ(PIN_GPIO2), zasevb_gpio_int_hndlr,
                        0, "ISP1301", (void *)&ocd_ops);
        THROW_IF(gpio, error);


        iomux_config_mux(PIN_USB_XRXD,  OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
        iomux_config_mux(PIN_USB_VMOUT, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
        iomux_config_mux(PIN_USB_VPOUT, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
        iomux_config_mux(PIN_USB_VPIN,  OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
        iomux_config_mux(PIN_USB_TXENB, OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);
        iomux_config_mux(PIN_USB_VMIN,  OUTPUTCONFIG_FUNC, INPUTCONFIG_FUNC);



        CATCH(error) {
                printk(KERN_INFO"%s: failed\n", __FUNCTION__);
                UNLESS (gpio) gpio_free_irq (ZGPIO_PORT, ZGPIO_PIN, GPIO_HIGH_PRIO);
                return -EINVAL;
        }

        return 0;
}