[alsa-devel] [PATCH 2/3] ASoC: mid-x86 machine driver - add jack detect support

Harsha, Priya priya.harsha at intel.com
Fri Feb 4 04:54:24 CET 2011


>> +#define IRQ_BASE 0xFFFF7FCD
>> +#define IRQ_SIZE 1
>
>This looks like it should be coming in via a platform device or
>something?
I can make it a part of platform data.

>
>> +static struct snd_soc_jack_pin mfld_jack_pins[] = {
>> +	{
>> +		.pin = "Headphones",
>> +		.mask = SND_JACK_HEADPHONE,
>> +	},
>> +	{
>> +		.pin = "AMIC1",
>> +		.mask = SND_JACK_MICROPHONE,
>> +	},
>> +};
>> +/* jack detection voltage zones */
>
>Blank line between these - in general it'd be worth checking into this.
Will add it

>
>> +	/* retrive the irq number */
>> +	irq = platform_get_irq(pdev, 0);
>> +	/*	audio interrupt base of SRAM location where
>> +	*	interrupts are stored by System FW */
>> +	mc_drv_ctx.int_base = ioremap_nocache(IRQ_BASE, IRQ_SIZE);
>> +	if (!mc_drv_ctx.int_base) {
>> +		pr_err("Mapping of cache failed\n");
>> +		ret_val = -ENOMEM;
>> +		goto unalloc;
>> +	}
>> +	/* create botoom half handler for interrupt */
>> +	mc_drv_ctx.mfld_jack_wq = create_workqueue("mfld_jack_wq");
>> +	if (!mc_drv_ctx.mfld_jack_wq) {
>> +		pr_err("cannot create jack workqueue\n");
>> +		ret_val = -ENOMEM;
>> +		goto unalloc;
>> +	}
>> +	/* register for interrupt */
>> +	ret_val = request_irq(irq, snd_mfld_jack_intr_handler,
>> +				IRQF_SHARED, pdev->dev.driver->name,
>> +				&mc_drv_ctx);
>
>I suspect you can just use request_threaded_irq() here which would ave
>open coding the workqueue.
I will try this out .

-Harsha


More information about the Alsa-devel mailing list