Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1111957ybh; Sat, 7 Mar 2020 19:15:09 -0800 (PST) X-Google-Smtp-Source: ADFU+vtH7n/q79m3VHtCPAYsVKwcZ41MHCea8tlXtzB4dLNSDjQVfAB9gK/YgMkX7syRzeheuefK X-Received: by 2002:aca:4987:: with SMTP id w129mr7742755oia.103.1583637308905; Sat, 07 Mar 2020 19:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583637308; cv=none; d=google.com; s=arc-20160816; b=mEihZvyGhcCYSQfBSUEs/P8Fk3NuXFRthDlZOGkebTydBUvpmS8O7FuG33zCZnrruL 8pLyNM54aWDB/Oe2IcAj8VHyDZpOea9jTYsHBhvsUfqzwHuqM+ykp58bxd218cd3/H4U HHcQbYrhdryV2M/FmnFnzCw1j8R5Ep6qpkcl+lyWPcC+AROI6/fJqIT5fvlKhgW8ZOvq kdBkc+D3AT8q5o4JNBtFLG4hdhx+YTjuBIaBqBDZgZxsP00++NsuH7kerZMhXuBt+Wyc jlCPhkmtooqWjPTIXVxIi6pO2l/h2COCxt6+QXyQjfRTG5aJkZ4mvuWyt358GStdnuHv vXng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Zvcy+aTFD2yF2F7agTfSAI5x+M5mwDHXKZI3mtZgwGI=; b=Wyr9QIVoGpbiKFYLm60wdCAhRhMbWQfEG1wrIgONX/wrNAquumeCihCXACLeTEbs3D ifSbFeZLNDfEXapxk/VR+a/ngSQyJfBXz2SGKpHamnS5IuedkDo486R0WdWUgC5EVgrB sc7HfxiwtFL5r1ihOhVpaHM/t846cqiUvvG4lDnpRX86xU7KG4pNhAjxItf2yiBVxBMO MmutBDzXZaJ+3f9A4XQpMb4MwoLnL7fSrp2Z9ih0S9enSe53Jwiv3oBtGF02Yr4do+aV 2jpR2NQxKkUsCFh7JpatRj5Dr95cYDfSLwUvbpNd6PCck8d7NJvJ18MjzI5PxyKkTF5r K3YA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17si1936146oic.145.2020.03.07.19.14.54; Sat, 07 Mar 2020 19:15:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbgCHDOV (ORCPT + 99 others); Sat, 7 Mar 2020 22:14:21 -0500 Received: from mail.manjaro.org ([176.9.38.148]:57726 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgCHDOV (ORCPT ); Sat, 7 Mar 2020 22:14:21 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 8509C3960EFB; Sun, 8 Mar 2020 04:14:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D4ahqBaiLqYL; Sun, 8 Mar 2020 04:14:18 +0100 (CET) From: Tobias Schramm To: Jaroslav Kysela , Takashi Iwai Cc: Liam Girdwood , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [RFC PATCH 0/1] Use native gpiolib inversion for jack gpios Date: Sun, 8 Mar 2020 04:13:54 +0100 Message-Id: <20200308031355.1149173-1-t.schramm@manjaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch changes the logic used for jack gpio state inversion to utilize gpiolib inversion. Previously the gpio active state would not correspond to the plugged-in state of the jack. Since the active state of a gpio is usually defined by its purpose in a specific application I'd expect the active state to represent the jacks plug status. However, judging by the users [1], [2] of snd_soc_jack_add_gpiods the ACPI tables of some devices seem to indicate the "wrong" polarity for their jack detect gpios. I'm not entirely sure how to deal with those devices. At the moment I'd vote for inverting the gpio active level again (via gpiod_toggle_active_low) inside snd_soc_jack_add_gpios if gpio->gpiod_dev != NULL and gpio->invert is set. I'm not entirely sure about [3] either. In my opinion removing invert = 1 from ams_delta_hook_switch_gpios and adding GPIO_ACTIVE_LOW to the flags of hook_switch in [4] would be the right move here. What are your thoughts on this? Best regards, Tobias [1] /sound/soc/intel/boards/byt-max98090.c [2] /sound/soc/intel/boards/cht_bsw_max98090_ti.c [3] /sound/soc/ti/ams-delta.c [4] /arch/arm/mach-omap1/board-ams-delta.c Tobias Schramm (1): ASoC: jack: use gpiolib inversion flag for inverted gpios sound/soc/soc-jack.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.24.1