From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752137AbdLFRZ3 (ORCPT ); Wed, 6 Dec 2017 12:25:29 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:15806 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbdLFRZ0 (ORCPT ); Wed, 6 Dec 2017 12:25:26 -0500 Subject: Re: [PATCH v2 18/19] ASoC: tlv320aic31xx: Add headphone/headset detection To: Mark Brown CC: Liam Girdwood , Rob Herring , Mark Rutland , =?UTF-8?Q?Beno=c3=aet_Cousson?= , Tony Lindgren , , , References: <20171129213300.20021-1-afd@ti.com> <20171129213300.20021-19-afd@ti.com> <20171201134127.2msgmjrfj47ypl3w@sirena.org.uk> From: "Andrew F. Davis" Message-ID: Date: Wed, 6 Dec 2017 11:25:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171201134127.2msgmjrfj47ypl3w@sirena.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/01/2017 07:41 AM, Mark Brown wrote: > On Wed, Nov 29, 2017 at 03:32:59PM -0600, Andrew F. Davis wrote: >> This device can detect the insertion/removal of headphones and headsets. >> Enable reporting this status by enabling this interrupt and forwarding >> this to upper-layers if a jack has been defined. >> >> This jack definition and the resulting operation from a jack detection >> event must currently be defined by sound card platform code until CODEC >> outputs to jack mappings can be defined generically. > > This only does half the job, there's no way for anything to specify a > jack here. > Other CODECs drivers expose some kind of platform/machine specific function(s) to send the jack definition to the CODEC, we seem to be missing a generic way to report jack information up to the machine layer driver. Perhaps a struct with a jack enable/disable and call-back functions could be created when registering the codec/platform component driver? Then machines can hook to this as they need?