From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/2] ASoC: Add support for Conexant CX2072X CODEC Date: Wed, 08 May 2019 11:16:18 +0200 Message-ID: References: <20190427175938.GJ14916@sirena.org.uk> <20190503064729.GF14916@sirena.org.uk> <20190506042625.GK14916@sirena.org.uk> <20190506140506.GQ14916@sirena.org.uk> <20190508081006.GZ14916@sirena.org.uk> <20190508085953.GF14916@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A8CABF8075E for ; Wed, 8 May 2019 11:16:19 +0200 (CEST) In-Reply-To: <20190508085953.GF14916@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Mark Brown Cc: alsa-devel@alsa-project.org, Pierre-Louis Bossart List-Id: alsa-devel@alsa-project.org On Wed, 08 May 2019 10:59:53 +0200, Mark Brown wrote: > > On Wed, May 08, 2019 at 10:16:06AM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > The GPIO/IRQ equivalence thing should just be a purely Linux internal > > > thing - looking at the driver it appears that there's no need to look at > > > the GPIO status, Linux can tell if something is plugged in purely by > > > reading the chip registers so the jack status function could directly be > > > the interrupt handler. > > > But it can't see the button status or detect the headset type without > > reading the codec's magic registers... So some help from the codec > > side is required, and the irq handler isn't in the codec side because > > The whole thing should be in the CODEC side. > > > there is no i2c irq assigned but only ACPI gpio, as far as I checked. > > You can map through an ACPI GPIO to an interrupt without worrying about > the fact that it's mapped as a GPIO in ACPI IIRC - if you can't there's > lots of other drivers are going to have issues. But what gives a benefit? It needs more plumbing between codec and machine driver. The i2c probe doesn't give the irq, so you'd need and extra stuff to enable the irq in a different route if you'd need to implement the handler in the codec driver. Actually, my latest patchset already eliminates the exported stuff by moving to set_jack callback like some other drivers do. If you have an idea for further simplification / fixes, let me know. I haven't submitted because of the merge window. The patch is found at topic/soc-cx2072x-5.2 branch, the commit is https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=topic/soc-cx2072x-5.2&id=ca7f4eee5ecbefcf347f5a4984c0a17629360186 thanks, Takashi