From patchwork Wed Nov 2 23:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 14549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp201298wru; Wed, 2 Nov 2022 16:26:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tkFYEGsQxXADHUpIPVmOrARgoAJr5MGkNFGznnrvkULlVA7LRUQR3H0UXQXQKT0ovw/sL X-Received: by 2002:a05:6402:1d4f:b0:461:d2ed:788c with SMTP id dz15-20020a0564021d4f00b00461d2ed788cmr27225416edb.418.1667431560983; Wed, 02 Nov 2022 16:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667431560; cv=none; d=google.com; s=arc-20160816; b=CDCH/zgPvhurt317OtUY57o3+VF+o/5fWiWlC9Uj/lj0l8U2LmBNWulR9AalFq77qb 88emHrt6V5+pk7USN7yBCDZsz+foZGxG/G5I3SKJ+RbEf0pRDu+22/1jBQfmBOYU+ESW KNxAkK4LDpgJyV6GL2AISIKrC5SfbRd3NKUa2/FRKO38tIBspuy9o01h/8y1s3nC5tUX WW0VdIJ5bkimsHUYueuNDPsmaJE6lRJtpOxSjMsxb61QShMzyn165uIln7+MG77R2hOM KvyBOIjN0YO5ybtf42Ymhvw2d5zdAzHrl8gdI18ffDhhD9eqNRmuxDEmcxtQVZVuWkUq tAzg== 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=NnNf+3cP8WzFVUxvQcRTeKMHqTn6WlUgTme+xs4Lr1c=; b=OwWTsavN/VWqtP1+8spYiOiKGa9PYLN4kPHeybzMg5CCxrczdONKJDAnTd2Jys2Y9s zgP0vEKilHYop4BsifS9sbWlvEAu6vYV5lT/9yO+s/asoC7ggzJJrDLpqks3Z4NqMmb7 /Axa5sMCfoW5/wrhF4yVuCZhx9CAHUzZUFrAYp6Rfzl9W64bvRqkG+7M683cTxp+u6Ox eeZzt2LebYQ3FUq1oJlaemA779HM7ZX0CXLKWF2+MpevBJJ+p7sycpY+TsCILqbJnv4r q88iAS0kXKs1mYYa6enp/f2PGfZPR0muF9GDK2/n3f3zXo4JxDG09ZsR/RyLr7ZuLsT4 tekw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=esqjWm9y; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb26-20020a1709071c9a00b0078dcf11ccf7si14988926ejc.802.2022.11.02.16.25.37; Wed, 02 Nov 2022 16:26:00 -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=@gmail.com header.s=20210112 header.b=esqjWm9y; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231537AbiKBXZN (ORCPT + 99 others); Wed, 2 Nov 2022 19:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiKBXYG (ORCPT ); Wed, 2 Nov 2022 19:24:06 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157A5CE34; Wed, 2 Nov 2022 16:20:20 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id m6-20020a17090a5a4600b00212f8dffec9so230300pji.0; Wed, 02 Nov 2022 16:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NnNf+3cP8WzFVUxvQcRTeKMHqTn6WlUgTme+xs4Lr1c=; b=esqjWm9yPT2RZZNGv5txzWInMtNIYEnIhT1tdYbIVI+irrFWDuOKPj7BJsCOzcwg27 USsq8m/H/SN0gAg68pm6Wz15lsNVoqM6E620HsynmlPAuOq3DqwV2yOh4wc7ZK/AdWqT fpqty4yJPcOMSbwaNDf603ehNQPFwNc5AsqsbF+eTuettFS2mFZ1G+FT202JigFD5JJu rFDG8BBQ5PtoMxa11CFTgVwBQzUSy6dCf6oAQK5Ho8YvazmHQLVLkd8BtMVr4uA1XSqW n12qg6C2nhBlFwHXl65b3hY9M5ffp37sso4PRWRbXRLSUGsqhVcEukgPod79F6MWD+bv t+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NnNf+3cP8WzFVUxvQcRTeKMHqTn6WlUgTme+xs4Lr1c=; b=S4231+ppn5R2ZQUi3cooIBfSv8yl6LKYLt/hfqXCpousbfZKDMtw2RWVT9STIjSyo3 elc0Bnw89VLmVL5VpenWQLfs6CdXXevHzsuTQTsJFUMkA4nnY/n1VfAOIgWPAsbEmpw8 TzXYsdi8SxRk0REPQfLz0fXtuEw9UcqdHWTrKxvyV2tgMn9BGfFrWMBt1uSlImHMJHNx y2ot2cReeibl/fhnpcEj8Nn9ExsQuYjHb2VB3eFB7miNWqX7261arNfTVRRPlg9gTwMt 9AAiKMnYu8F2Jc0vNo8hfJr0N+VfRgQO/3/yFP3QCV66sqsdjHJVcgKKAiEbIkUtdLnQ J7AQ== X-Gm-Message-State: ACrzQf04Q3oDIe6UVFKZANR9AjdWw7g1mifzHeVxsbXSX8x6FlFPkTuS 0Uqvl2ifrgUGAwq2KKE+l1o= X-Received: by 2002:a17:902:bb98:b0:186:988d:a0f0 with SMTP id m24-20020a170902bb9800b00186988da0f0mr26931407pls.10.1667431209114; Wed, 02 Nov 2022 16:20:09 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id p8-20020a170902780800b00186e2123506sm8842073pll.300.2022.11.02.16.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 16:20:08 -0700 (PDT) From: Dmitry Torokhov To: Tony Lindgren , Mark Brown Cc: Liam Girdwood , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] arm: omap2: n8x0: stop instantiating codec platform data Date: Wed, 2 Nov 2022 16:20:02 -0700 Message-Id: <20221102232004.1721864-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1748428716567066117?= X-GMAIL-MSGID: =?utf-8?q?1748428716567066117?= As of 0426370b58b2 ("ARM: dts: omap2420-n810: Correct the audio codec (tlv320aic33) node") the DTS properly specifies reset GPIO, and the device name in auxdata lookup table does not even match the one in device tree anymore, so stop instantiating it. Signed-off-by: Dmitry Torokhov Acked-by: Tony Lindgren --- arch/arm/mach-omap2/board-n8x0.c | 5 ----- arch/arm/mach-omap2/common-board-devices.h | 2 -- arch/arm/mach-omap2/pdata-quirks.c | 1 - 3 files changed, 8 deletions(-) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 5e86145db0e2..8897364e550b 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -567,10 +566,6 @@ struct menelaus_platform_data n8x0_menelaus_platform_data = { .late_init = n8x0_menelaus_late_init, }; -struct aic3x_pdata n810_aic33_data = { - .gpio_reset = 118, -}; - static int __init n8x0_late_initcall(void) { if (!board_caps) diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h index b23962c38fb2..69694af71475 100644 --- a/arch/arm/mach-omap2/common-board-devices.h +++ b/arch/arm/mach-omap2/common-board-devices.h @@ -2,12 +2,10 @@ #ifndef __OMAP_COMMON_BOARD_DEVICES__ #define __OMAP_COMMON_BOARD_DEVICES__ -#include #include void *n8x0_legacy_init(void); extern struct menelaus_platform_data n8x0_menelaus_platform_data; -extern struct aic3x_pdata n810_aic33_data; #endif /* __OMAP_COMMON_BOARD_DEVICES__ */ diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 9409b9f5711c..baba73fd6f11 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -439,7 +439,6 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { #ifdef CONFIG_MACH_NOKIA_N8X0 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data), - OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data), #endif #ifdef CONFIG_ARCH_OMAP3 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu", From patchwork Wed Nov 2 23:20:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 14547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp201280wru; Wed, 2 Nov 2022 16:25:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7smhlpKFnwFx4j84GEAchpYPLl1Uftnh5DtjnoGY285SeyrumUEnfyr/rrKdJT7940pGgk X-Received: by 2002:a05:6402:380a:b0:451:ae08:7a6c with SMTP id es10-20020a056402380a00b00451ae087a6cmr26171597edb.161.1667431558754; Wed, 02 Nov 2022 16:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667431558; cv=none; d=google.com; s=arc-20160816; b=Tq0N+2KusTjYR8YXKGFPRrmonSW8U2EH4y8eb/OfTehqiEkc94hzvdtIjmVztWtGCq e7r/AiQytvmNa4/PLe4nJnnCFjlLkT4UEySrnTX7D3XFpZ4d80JKZoXEAI2h9KJRChbP xH5sy0mI0mWpy73g4AjYw2PzdgY0UbAvv2aToLD040gCK+ER0/TLmTLZQ813+XCchkXm 6YceK+xJGlJ6OQt2kb0aWW8sOlQ+qFVbWjii4vSqjviX3cQDZkYpxp95DGxJs6qjl7eZ ZVuDRpL1R2W+diI68dfJKRU62zaAe/ylaADgM/BYdisFuENyuJzQypO2k/67BN4I+cDX WJKg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Zl1LKmv4RLjwNkqEhUgdxCW+8uunPRUGj73i8adfR+c=; b=FI4bmNa3CypE2kpT8x2/SEfC+xE6V72b5pQxyvt88iPT92dDk+au+AhFQIs7oO6FHV U4zkwVArSObsh6bfOIqL4OY+2rwEg8scipsBFquKTQ76zm5k5vyM+MkEYZh3M+seXYVX +/86f4m2SUbZzO9KqCXGif7NGlHSmaWj3VNdPpXpa3lvgypyLCQU96Loshu4K64yLe36 JpecoXEilKm65tTqJDHpZ6hZB+SR2xnqCdX1oYjl+eADuEATIKKo8+D876eST251VfI0 o/YihfJk9nKlJdSQqmqL1tH0cztFIkFNZ9queEln9kv0RA0EOUUWcWOjidr5+z1c24hO mJ+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Zral2Tj/"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d37-20020a056402402500b004613ae68ca0si17274395eda.442.2022.11.02.16.25.35; Wed, 02 Nov 2022 16:25:58 -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=@gmail.com header.s=20210112 header.b="Zral2Tj/"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbiKBXZJ (ORCPT + 99 others); Wed, 2 Nov 2022 19:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231378AbiKBXYG (ORCPT ); Wed, 2 Nov 2022 19:24:06 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CBA6DF93; Wed, 2 Nov 2022 16:20:21 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id v3so175756pgh.4; Wed, 02 Nov 2022 16:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zl1LKmv4RLjwNkqEhUgdxCW+8uunPRUGj73i8adfR+c=; b=Zral2Tj/aqfFI6R5Pqa5+FbaXdIvhtCzWT9QuQkI1+iVSW6VPfvqYzp5hZbaGyM9zV dviv0OaZpUtGn+8f3wdQhkx8rhgri5HxRR5b7zoIsvQhSHZ/XEpT2lBzZUyHER398uIo Q2woa/bwgmHk85q/XSl4Pxxrcfi26Bp8OdIo9KBB2pUKqzhwlgKJwDjQjnO/9PzrfmDG lpocig4tQCJfGtwVIIomgjZt2tYopKPbZw7X9iOFDecI9rPcUrz2z+JiyHpgyJFqCVZz fTWV6omQ7w4zOLKfWc8vE0NZNN7IFZ6FTIiyRK9O2blO6De32TTBZCVAFxBn3346LjBp p+2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zl1LKmv4RLjwNkqEhUgdxCW+8uunPRUGj73i8adfR+c=; b=VX1Z1iN+Na5Kl1vW4DO50r/+C9UJotVAM1uXxcyXjUiHqnkIZNU/E4TJBfYaWn17zz Tr9RtyN2CCLeQnfAcVKRdvmufqXMt++f02sFCb+J8iaLAUpmx5ZwzsQ+D3OwIcp8b/Fw JNJpwCe/w9RLsvqgL7zJxLLyLIjz+nkzdimkwUNoPIMoDdL6CGtLBw7Ph29XcJK+vJDU hTd+CQ3TRvVRLQlub+Gt5ckrRc1ANcBjdx26sbl3amSIsh3p4z9yz6+/kT2Maf5vJe67 7jUnRsxKxYMosoq57i/YOCxFAwnUVo0hwWMS0v4ESHeKCC0ei6du4y5tQWIFhndF/Z2A Rl4g== X-Gm-Message-State: ACrzQf2N5e8N6Kyk7CFuBj8Ovyt634u0orh4G6UUEfT5MT3KEVDr0we+ Xnb7ZGdIVuQMgRlLChEu5zM= X-Received: by 2002:a63:105e:0:b0:46e:9bac:1c3 with SMTP id 30-20020a63105e000000b0046e9bac01c3mr22873269pgq.388.1667431210664; Wed, 02 Nov 2022 16:20:10 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id p8-20020a170902780800b00186e2123506sm8842073pll.300.2022.11.02.16.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 16:20:09 -0700 (PDT) From: Dmitry Torokhov To: Tony Lindgren , Mark Brown Cc: Liam Girdwood , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] ASoC: tlv320aic3x: remove support for platform data Date: Wed, 2 Nov 2022 16:20:03 -0700 Message-Id: <20221102232004.1721864-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221102232004.1721864-1-dmitry.torokhov@gmail.com> References: <20221102232004.1721864-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1748428714251935873?= X-GMAIL-MSGID: =?utf-8?q?1748428714251935873?= Signed-off-by: Dmitry Torokhov --- include/sound/tlv320aic3x.h | 65 ---------------------------------- sound/soc/codecs/tlv320aic3x.c | 12 +++---- sound/soc/codecs/tlv320aic3x.h | 43 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 72 deletions(-) delete mode 100644 include/sound/tlv320aic3x.h diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h deleted file mode 100644 index b660a9ed05ec..000000000000 --- a/include/sound/tlv320aic3x.h +++ /dev/null @@ -1,65 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Platform data for Texas Instruments TLV320AIC3x codec - * - * Author: Jarkko Nikula - */ -#ifndef __TLV320AIC3x_H__ -#define __TLV320AIC3x_H__ - -/* GPIO API */ -enum { - AIC3X_GPIO1_FUNC_DISABLED = 0, - AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1, - AIC3X_GPIO1_FUNC_CLOCK_MUX = 2, - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3, - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4, - AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5, - AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6, - AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7, - AIC3X_GPIO1_FUNC_INPUT = 8, - AIC3X_GPIO1_FUNC_OUTPUT = 9, - AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10, - AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11, - AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12, - AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13, - AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14, - AIC3X_GPIO1_FUNC_ALL_IRQ = 16 -}; - -enum { - AIC3X_GPIO2_FUNC_DISABLED = 0, - AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2, - AIC3X_GPIO2_FUNC_INPUT = 3, - AIC3X_GPIO2_FUNC_OUTPUT = 4, - AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5, - AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8, - AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9, - AIC3X_GPIO2_FUNC_ALL_IRQ = 10, - AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11, - AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12, - AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13, - AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14, - AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 -}; - -enum aic3x_micbias_voltage { - AIC3X_MICBIAS_OFF = 0, - AIC3X_MICBIAS_2_0V = 1, - AIC3X_MICBIAS_2_5V = 2, - AIC3X_MICBIAS_AVDDV = 3, -}; - -struct aic3x_setup_data { - unsigned int gpio_func[2]; -}; - -struct aic3x_pdata { - int gpio_reset; /* < 0 if not used */ - struct aic3x_setup_data *setup; - - /* Selects the micbias voltage */ - enum aic3x_micbias_voltage micbias_vg; -}; - -#endif diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 08938801daec..9b2bb99cc165 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -45,7 +45,6 @@ #include #include #include -#include #include "tlv320aic3x.h" @@ -66,6 +65,10 @@ struct aic3x_disable_nb { struct aic3x_priv *aic3x; }; +struct aic3x_setup_data { + unsigned int gpio_func[2]; +}; + /* codec private data */ struct aic3x_priv { struct snd_soc_component *component; @@ -1748,7 +1751,6 @@ static const struct reg_sequence aic3007_class_d[] = { int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver_data) { - struct aic3x_pdata *pdata = dev->platform_data; struct aic3x_priv *aic3x; struct aic3x_setup_data *ai3x_setup; struct device_node *np = dev->of_node; @@ -1768,11 +1770,7 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver regcache_cache_only(aic3x->regmap, true); dev_set_drvdata(dev, aic3x); - if (pdata) { - aic3x->gpio_reset = pdata->gpio_reset; - aic3x->setup = pdata->setup; - aic3x->micbias_vg = pdata->micbias_vg; - } else if (np) { + if (np) { ai3x_setup = devm_kzalloc(dev, sizeof(*ai3x_setup), GFP_KERNEL); if (!ai3x_setup) return -ENOMEM; diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h index 14298f9e6d9b..066e5a6322b8 100644 --- a/sound/soc/codecs/tlv320aic3x.h +++ b/sound/soc/codecs/tlv320aic3x.h @@ -298,4 +298,47 @@ enum { #define AIC3X_BUTTON_DEBOUNCE_SHIFT 0 #define AIC3X_BUTTON_DEBOUNCE_MASK 3 +/* GPIO API */ +enum { + AIC3X_GPIO1_FUNC_DISABLED = 0, + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1, + AIC3X_GPIO1_FUNC_CLOCK_MUX = 2, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5, + AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6, + AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7, + AIC3X_GPIO1_FUNC_INPUT = 8, + AIC3X_GPIO1_FUNC_OUTPUT = 9, + AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10, + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11, + AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12, + AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13, + AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14, + AIC3X_GPIO1_FUNC_ALL_IRQ = 16 +}; + +enum { + AIC3X_GPIO2_FUNC_DISABLED = 0, + AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2, + AIC3X_GPIO2_FUNC_INPUT = 3, + AIC3X_GPIO2_FUNC_OUTPUT = 4, + AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5, + AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8, + AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9, + AIC3X_GPIO2_FUNC_ALL_IRQ = 10, + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11, + AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12, + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13, + AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14, + AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 +}; + +enum aic3x_micbias_voltage { + AIC3X_MICBIAS_OFF = 0, + AIC3X_MICBIAS_2_0V = 1, + AIC3X_MICBIAS_2_5V = 2, + AIC3X_MICBIAS_AVDDV = 3, +}; + #endif /* _AIC3X_H */ From patchwork Wed Nov 2 23:20:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 14550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp201299wru; Wed, 2 Nov 2022 16:26:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6MJ/roRJNW3rOBETsrzODx5S2yYgbLd8Mvovj93ssXNJgCYwM69qiTfPPyGDPE1SZdNsqC X-Received: by 2002:a17:902:f541:b0:188:4e43:bd1f with SMTP id h1-20020a170902f54100b001884e43bd1fmr2778481plf.116.1667431561071; Wed, 02 Nov 2022 16:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667431561; cv=none; d=google.com; s=arc-20160816; b=B9PDuysxryZocJcGkzpAUVk+6EP0Tjol8l0Me6gXpf0UvyIEjTo4tTCoOc+uLA0o7X IIYhCiBguXij8Gv2lbyY17Z+mQfEKd9kpIyTLgDyvgoMUJ1VNq+I+9H69MsSTWgJYz1c eLbiV7QTBQ98q3GNHGIdCW5oNXaAAO6W4RwLZuCnKdsdmVnxkKvCCd/Nia7lTcNRJ94m a5PH5Bh6tI0pOtaDmKso6GVKpU1/TWDEp6+Cj3GRbJvznl22X2j6zKICxfiDFRxzMvKe LP/cAtptWHwSDrNfLas1gy/yEhc9Fg2jpJHw+1WhfGXULbLL8Oj0zY1lEAWZGn61Vmgz NUPA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WS1e+43uL+FT/xkdxSFm6nee4mo2YYL1lmvIqpiOoFU=; b=AwwC6Lx2uRQWH2IbcHLzbPtsuimNlPvhJuBYXl77IfxotmC9LBS2Y8KxekhK3ewWju lkyoDuKAD/ncbVQtiZ8Qo3uJ+YG7MVLpyHlH0mxWA5MJIluBNypVCfZiNK1cpbYJXwZL PM1EmwN+LPQc9d425bjUh0XrTZpY7pyAdowjwNZ9+2kNuK3KJE6myZy+HLxStLGfLKZR XyhhkOlJo9kHqPOS765GlSoZtI5vFQCszRaSTdUC++W245uMW0V+PqdWdQBxuGuNYXw9 NOOX3dpURZaWaWTl3TP7J17O0ZUBaaGbIQ66Rmn/xWET7o72w3f9Rsu69XHdecDEkLM8 0cBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eNAW09AP; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a056a00140800b0056b940147c6si18551418pfu.322.2022.11.02.16.25.48; Wed, 02 Nov 2022 16:26:01 -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=@gmail.com header.s=20210112 header.b=eNAW09AP; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231564AbiKBXZS (ORCPT + 99 others); Wed, 2 Nov 2022 19:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbiKBXYI (ORCPT ); Wed, 2 Nov 2022 19:24:08 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC43210FCE; Wed, 2 Nov 2022 16:20:26 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id k22so91424pfd.3; Wed, 02 Nov 2022 16:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WS1e+43uL+FT/xkdxSFm6nee4mo2YYL1lmvIqpiOoFU=; b=eNAW09APtQMwcF8srtLQ4v8T0sRnvgNmfHGFMZdDwC5B5NONfljMrDCUSdXxhZxwAS Si8f5RiURn8L/pDIk4NbK0PLKvOa7/cphvsv2PAk05tU/zHdSrErO4Tn9/5HTvSAEtg4 lloTdn1gVPlq+FLxaAtcBdz2Q+90hZULEalsqBD79E7eNlFV8N1Qp16tg64WEBLNN27y +ezxfpXb6N0KSdbh3UxwH8EnTRlBfNmcRVbvdyC5A1qYNNtqFT/IKBzoMMB12zEXybfD GRRF3owJwOlceGHIY33m7J39WzvkUNZl+dSZqvRpG/1vDqeJ2BtCDUSYLqHi3rgFbUxA ZSGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WS1e+43uL+FT/xkdxSFm6nee4mo2YYL1lmvIqpiOoFU=; b=p8E/kToKpD1qANu8dEtojRKzFj+lhiPJvzcUHjNH6uqizoMAeLFosrNn+SKjwMYV9D hNy5stvv8m2dWC3111S21oj0UwAVHQ7ZIhQMooTXP3li09U0LmZLL7jyxmXNoD56GTsn /rhxXQ0A7xrtM4k2BxHmAMyvtPH/ChQuho5u3qHEVfFgwxG7akRLa4/IE0zOS9wy1Xug uTCJ/KyRAzDJ+b2iJxTm1kGtc3GgZ65U8QUKYN06/DxAvQ/RZEhOebD/RShxH+HqitAa hCeYym06nthUTTei70/3MB8nDCZ6tZL3cn+1GVPpdo5E4fJHc9EerLqEWiP4P101uOe8 w6OA== X-Gm-Message-State: ACrzQf1DtFU/8AHXL2KShovBESCE8+KwipQqZeBFZeHK40M8ucXsLszR uTFZEKBsJChCapaHI4FMWoI= X-Received: by 2002:a63:f903:0:b0:46f:1b5:b4fd with SMTP id h3-20020a63f903000000b0046f01b5b4fdmr23233195pgi.544.1667431212859; Wed, 02 Nov 2022 16:20:12 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id p8-20020a170902780800b00186e2123506sm8842073pll.300.2022.11.02.16.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 16:20:12 -0700 (PDT) From: Dmitry Torokhov To: Tony Lindgren , Mark Brown Cc: Liam Girdwood , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ASoC: tlv320aic3x: switch to using gpiod API Date: Wed, 2 Nov 2022 16:20:04 -0700 Message-Id: <20221102232004.1721864-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221102232004.1721864-1-dmitry.torokhov@gmail.com> References: <20221102232004.1721864-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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?1748428716531880520?= X-GMAIL-MSGID: =?utf-8?q?1748428716531880520?= Switch the driver from legacy gpio API that is deprecated to the newer gpiod API that respects line polarities described in ACPI/DT. The driver still tries to support shared reset lines, by first trying to allocate the reset GPIO normally, and then non-exclusively, although the utility of such support is questionable, toggling reset line from one driver/instance will result in all chips being reset, potentially at an inopportune moment. Note that this change depends on commit fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines with legacy bindings") to translate request for "reset" GPIO to the legacy name "gpio-reset" in case when proper name is not used. Signed-off-by: Dmitry Torokhov --- sound/soc/codecs/tlv320aic3x.c | 108 ++++++++++++--------------------- 1 file changed, 39 insertions(+), 69 deletions(-) diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 9b2bb99cc165..56e795a00e22 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -32,12 +32,12 @@ #include #include #include +#include #include #include -#include +#include #include #include -#include #include #include #include @@ -56,8 +56,6 @@ static const char *aic3x_supply_names[AIC3X_NUM_SUPPLIES] = { "DRVDD", /* ADC Analog and Output Driver Voltage */ }; -static LIST_HEAD(reset_list); - struct aic3x_priv; struct aic3x_disable_nb { @@ -80,9 +78,9 @@ struct aic3x_priv { unsigned int dai_fmt; unsigned int tdm_delay; unsigned int slot_width; - struct list_head list; int master; - int gpio_reset; + struct gpio_desc *gpio_reset; + bool shared_reset; int power; u16 model; @@ -1369,8 +1367,8 @@ static int aic3x_regulator_event(struct notifier_block *nb, * Put codec to reset and require cache sync as at least one * of the supplies was disabled */ - if (gpio_is_valid(aic3x->gpio_reset)) - gpio_set_value(aic3x->gpio_reset, 0); + if (aic3x->gpio_reset) + gpiod_set_value(aic3x->gpio_reset, 1); regcache_mark_dirty(aic3x->regmap); } @@ -1390,9 +1388,9 @@ static int aic3x_set_power(struct snd_soc_component *component, int power) goto out; aic3x->power = 1; - if (gpio_is_valid(aic3x->gpio_reset)) { + if (aic3x->gpio_reset) { udelay(1); - gpio_set_value(aic3x->gpio_reset, 1); + gpiod_set_value(aic3x->gpio_reset, 0); } /* Sync reg_cache with the hardware */ @@ -1598,19 +1596,6 @@ static int aic3x_init(struct snd_soc_component *component) return 0; } -static bool aic3x_is_shared_reset(struct aic3x_priv *aic3x) -{ - struct aic3x_priv *a; - - list_for_each_entry(a, &reset_list, list) { - if (gpio_is_valid(aic3x->gpio_reset) && - aic3x->gpio_reset == a->gpio_reset) - return true; - } - - return false; -} - static int aic3x_component_probe(struct snd_soc_component *component) { struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); @@ -1775,19 +1760,6 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver if (!ai3x_setup) return -ENOMEM; - ret = of_get_named_gpio(np, "reset-gpios", 0); - if (ret >= 0) { - aic3x->gpio_reset = ret; - } else { - ret = of_get_named_gpio(np, "gpio-reset", 0); - if (ret > 0) { - dev_warn(dev, "Using deprecated property \"gpio-reset\", please update your DT"); - aic3x->gpio_reset = ret; - } else { - aic3x->gpio_reset = -1; - } - } - if (of_property_read_u32_array(np, "ai3x-gpio-func", ai3x_setup->gpio_func, 2) >= 0) { aic3x->setup = ai3x_setup; @@ -1812,29 +1784,43 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver } else { aic3x->micbias_vg = AIC3X_MICBIAS_OFF; } - - } else { - aic3x->gpio_reset = -1; } aic3x->model = driver_data; - if (gpio_is_valid(aic3x->gpio_reset) && - !aic3x_is_shared_reset(aic3x)) { - ret = gpio_request(aic3x->gpio_reset, "tlv320aic3x reset"); - if (ret != 0) - goto err; - gpio_direction_output(aic3x->gpio_reset, 0); + aic3x->gpio_reset = devm_gpiod_get_optional(dev, "reset", + GPIOD_OUT_HIGH); + ret = PTR_ERR_OR_ZERO(aic3x->gpio_reset); + if (ret) { + if (ret != -EBUSY) + return ret; + + /* + * Apparently there are setups where the codec is sharing + * its reset line. Try to get it non-exclusively, although + * the utility of this is unclear: how do we make sure that + * resetting one chip will not disturb the others that share + * the same line? + */ + aic3x->gpio_reset = devm_gpiod_get(dev, "reset", + GPIOD_ASIS | GPIOD_FLAGS_BIT_NONEXCLUSIVE); + ret = PTR_ERR_OR_ZERO(aic3x->gpio_reset); + if (ret) + return ret; + + aic3x->shared_reset = true; } + gpiod_set_consumer_name(aic3x->gpio_reset, "tlv320aic3x reset"); + for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) aic3x->supplies[i].supply = aic3x_supply_names[i]; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(aic3x->supplies), aic3x->supplies); - if (ret != 0) { + if (ret) { dev_err(dev, "Failed to request supplies: %d\n", ret); - goto err_gpio; + return ret; } aic3x_configure_ocmv(dev, aic3x); @@ -1843,26 +1829,14 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver ret = regmap_register_patch(aic3x->regmap, aic3007_class_d, ARRAY_SIZE(aic3007_class_d)); if (ret != 0) - dev_err(dev, "Failed to init class D: %d\n", - ret); + dev_err(dev, "Failed to init class D: %d\n", ret); } ret = devm_snd_soc_register_component(dev, &soc_component_dev_aic3x, &aic3x_dai, 1); - - if (ret != 0) - goto err_gpio; - - INIT_LIST_HEAD(&aic3x->list); - list_add(&aic3x->list, &reset_list); + if (ret) + return ret; return 0; - -err_gpio: - if (gpio_is_valid(aic3x->gpio_reset) && - !aic3x_is_shared_reset(aic3x)) - gpio_free(aic3x->gpio_reset); -err: - return ret; } EXPORT_SYMBOL(aic3x_probe); @@ -1870,13 +1844,9 @@ void aic3x_remove(struct device *dev) { struct aic3x_priv *aic3x = dev_get_drvdata(dev); - list_del(&aic3x->list); - - if (gpio_is_valid(aic3x->gpio_reset) && - !aic3x_is_shared_reset(aic3x)) { - gpio_set_value(aic3x->gpio_reset, 0); - gpio_free(aic3x->gpio_reset); - } + /* Leave the codec in reset state */ + if (aic3x->gpio_reset && !aic3x->shared_reset) + gpiod_set_value(aic3x->gpio_reset, 1); } EXPORT_SYMBOL(aic3x_remove);