From patchwork Fri Apr 21 12:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 8532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1040872vqo; Fri, 21 Apr 2023 05:51:09 -0700 (PDT) X-Google-Smtp-Source: AKy350YuIltcmVXPEBcJhrA9pJ7hg45zLxzM2FcYmmEY1YF/Xeu8B5US9jslWaQHvQ4wzPt+o/DC X-Received: by 2002:a17:90a:ca88:b0:23d:294:6a5a with SMTP id y8-20020a17090aca8800b0023d02946a5amr5657544pjt.22.1682081469525; Fri, 21 Apr 2023 05:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682081469; cv=none; d=google.com; s=arc-20160816; b=YSw158F0ZWK71NZ0eUuV8ur+kaJZa60TESu4pPo9Oa2XF355misPjDQejtV8Ve9KY8 oQo6cEm4UVSqirYs3kHchBtNZtyBSFk4q9KjGeOhQ4GambLwPrlOXxBO68atR9EFaKXt vRK8yrfyFTdIP7/jms5OSBKlAOfelOLSus0V44Ft/ej0KjaVsPJZC+nd2iI82VzfIFcq M8BZZOpogUpxLrEbdA1HHZuixxbv7tAMMVv7Isrgk7+ZABUMV3BTLcHamahvJigDUnix AUjCupkVzSo43H7E9fZGTomLxeRruyYXMWxHEhI/GTqKzIR3/uq9ptEzdLiv8BVdOaZV KuNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wPUr6k3hoHACmnMjvKMllT2pYnYBLSNWQbpWAPrti6c=; b=mkH6kn6QeWjno0GbYZ6DWiJz1TxdwJnhyLRZ5LM83Z8VCDEtj38qgsAEZANtQ8ClDe ot1XvS/m8QPcFDnq27sGBQ+gnlbCRR5jxOIdajqoMOVG1WHUUAeXh76X2bb/36VjifUj MMKEJ1LrxKJalj7908cQ7wGx3Dgjn6mc0IcGcHmnG8y8DlRET26k2k9dPrlkMmS3CBXW Sk9tyMl0bzdByCYxzkGttoNq3SxrVRP3ifN79Z6vFbyHywtawDoXRuYVXofHLt6Zw3P4 UWxOf9r+vng2lW8gNuTuJiwDP01L8rLJNULESqb9KzAxQGDiNeFA7VM4QF7LnM5k6kC1 fPdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZY1kyb2J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a17090ac70500b00246d776cbdcsi6827063pjt.57.2023.04.21.05.50.54; Fri, 21 Apr 2023 05:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZY1kyb2J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbjDUMmS (ORCPT + 99 others); Fri, 21 Apr 2023 08:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjDUMmQ (ORCPT ); Fri, 21 Apr 2023 08:42:16 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D70915B80; Fri, 21 Apr 2023 05:41:36 -0700 (PDT) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 9F26140006; Fri, 21 Apr 2023 12:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1682080894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPUr6k3hoHACmnMjvKMllT2pYnYBLSNWQbpWAPrti6c=; b=ZY1kyb2J62UJI4c0SfVLqsVPO1m7nV0B93j0DP4ZGCaAOzE1CbG/rfJQcX37ZRFoVehfhh upR/4/e72nslwE2fTICG1qEMN8ng6UgnW/um2dvgBFTXvUlNqWoB3igr2a4t1uuY/7Lkro Q/JhPYuDi5GxZpU0fQy2OP38mAcOcXNchUoMIQqo7M40VyXV+qkS7V+ez7cPrUcQq/dwQJ 7RiV6UZ0It/tQHwGbleMlub0joaN3sIPkqhES+YpLHAMaqCugaNyCLSPE7nBv6bFDncT8L wVATcJ86n+Yo+oKKILY2rhK1ZNkc/tVbJZfasc01RiuXZTPB9ryuz3nqDHFcZQ== From: Herve Codina To: Herve Codina , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jonathan Cameron , Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Christophe Leroy , Thomas Petazzoni Subject: [PATCH 0/4] Add support for IIO devices in ASoC Date: Fri, 21 Apr 2023 14:41:18 +0200 Message-Id: <20230421124122.324820-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763790259087665826?= X-GMAIL-MSGID: =?utf-8?q?1763790259087665826?= Several weeks ago, I sent a series [1] for adding a potentiometer as an auxiliary device in ASoC. The feedback was that the potentiometer should be directly handled in IIO (as other potentiometers) and something more generic should be present in ASoC in order to have a binding to import some IIO devices into sound cards. The series related to the IIO potentiometer device is already under review [2]. This series introduces simple-iio-aux. Its goal is to offer the binding between IIO and ASoC. It exposes attached IIO devices as ASoC auxiliary devices and allows to control them through mixer controls. On my system, the IIO device is a potentiometer and it is present in an amplifier design present in the audio path. Best regards, Hervé [1] https://lore.kernel.org/linux-kernel/20230203111422.142479-1-herve.codina@bootlin.com/ [2] https://lore.kernel.org/linux-kernel/20230421085245.302169-1-herve.codina@bootlin.com/ Herve Codina (4): dt-bindings: sound: Add simple-iio-aux iio: inkern: Add a helper to query an available minimum raw value ASoC: soc-dapm.h: Add a helper to build a DAPM widget dynamically ASoC: codecs: Add support for the generic IIO auxiliary devices .../bindings/sound/simple-iio-aux.yaml | 65 ++++ drivers/iio/inkern.c | 67 ++++ include/linux/iio/consumer.h | 11 + include/sound/soc-dapm.h | 12 +- sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/simple-iio-aux.c | 307 ++++++++++++++++++ 7 files changed, 475 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/sound/simple-iio-aux.yaml create mode 100644 sound/soc/codecs/simple-iio-aux.c