From patchwork Mon Mar 28 02:11:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lee X-Patchwork-Id: 12793108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F001FC433F5 for ; Mon, 28 Mar 2022 02:13:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 55984163D; Mon, 28 Mar 2022 04:12:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55984163D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648433581; bh=BPo9/ymVuPa63xevNJUmqSfqUdXLcNgDTIaawN58o34=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=U2PctDWxfb3KGhYxGGbfhQ4GFXsS+R+E+ll6eMistLUqs1XV53HZAYOlUblY6PPdD CbX5Unzg1n3aEN2nIAki9IHECD1PkO3dHohB5sdfL/85A6Uo+x6l0Al8svj/CEa7W7 zoZ4LCvOlGROXHTfCaKvxtL6EvPPmDZZt9QHCCOw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DEDB6F80128; Mon, 28 Mar 2022 04:12:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27719F8024C; Mon, 28 Mar 2022 04:12:10 +0200 (CEST) Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 87189F800CB for ; Mon, 28 Mar 2022 04:12:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87189F800CB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ByyC85NI" Received: by mail-pj1-x1043.google.com with SMTP id mr5-20020a17090b238500b001c67366ae93so17327420pjb.4 for ; Sun, 27 Mar 2022 19:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=rUHIWinBLG6g3Xi9+MUcsHpYsUZn1UkahgGOhqUSwAo=; b=ByyC85NIdi1Ve9pqan/WfzM2XYMfuKn3CCtZANGGya2Ss2oL4SZYsyVnf0OEXVxqM+ NlWfBOfMsvpFMBHl8ERRxXmXQtuzccHXUlYyM9m/uRKOMCz6QzS5xAaSboA5lDQTSx2s yt2c+lBVhmyV/cfJpPpmzbZ+WnXCRFdcJbXGrmGyKdiEyIlle0UKaNumtHMKD09ZyvRo ER4DmEYTfjFQdFg2653XMB3h3c9hvLkq1PQhnPmvKj9+lAr9lO/Ptwejnqm9oYLDjgvI H34KW+QREWOLw0hNIHLsV5CUhGPPFHIdlB8xooOeY1/e4UyH39Zh23M1Hn6d9sJWL8np 7Xmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rUHIWinBLG6g3Xi9+MUcsHpYsUZn1UkahgGOhqUSwAo=; b=Gdu6+jO16cJFmjTLr1g95SSgRgAMGG/4DSbPrWN/zeSdz57Icvl7fGNFNamvZKWKke w5yZ0+oWGyfYZz8fvjqYrY4SRQzUK3ds9Q72JFsNfDiHst8RlByt74QiDYTeET4/FThx nZ6OyXkIgWfJmsE4UTOr4+jVUkSrKyLrdK6xL0ZYIA4LydscS8CMDXgM3gFqRHfz7IAo cJhqI0PmPxHodTFdLIc59+6tqParmxC1gzR/JAzkdqlnQcqYhQv4Uihs2lGXtV2rGNLQ nyu0oH4EBsFWXtxf1X1aqns6KbnOpiqTwtnMSfwxodsoxaRVtQZnqMgoDcssYuQoPJop DNAQ== X-Gm-Message-State: AOAM531oSU3Bspe88vnorgKPDy3E2TYgPTjUJnUEL5cXrb7TwgeHyCpY cI/bDL1Vn7CvpIHOKATl2qc= X-Google-Smtp-Source: ABdhPJw/rhtmPMAo55tnqm5NaD1eJHN71Eb8+RgZ283zFRwrUZKw9etqglyxTYSO75pWg2fPCGMGdg== X-Received: by 2002:a17:902:9a8d:b0:155:ff17:c9fc with SMTP id w13-20020a1709029a8d00b00155ff17c9fcmr7396091plp.28.1648433525098; Sun, 27 Mar 2022 19:12:05 -0700 (PDT) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id c63-20020a624e42000000b004fa9ee41b7bsm13322058pfb.217.2022.03.27.19.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 19:12:04 -0700 (PDT) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [V3 1/2] ASoC: max98390: Add reset gpio control Date: Mon, 28 Mar 2022 11:11:38 +0900 Message-Id: <20220328021139.8700-1-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Steve Lee , krzk@kernel.org, nuno.sa@analog.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee --- sound/soc/codecs/max98390.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index 40fd6f363f35..05df9b85d9b0 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1022,6 +1022,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c, struct max98390_priv *max98390 = NULL; struct i2c_adapter *adapter = i2c->adapter; + struct gpio_desc *reset_gpio; ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE @@ -1073,6 +1074,17 @@ static int max98390_i2c_probe(struct i2c_client *i2c, return ret; } + reset_gpio = devm_gpiod_get_optional(&i2c->dev, + "reset", GPIOD_OUT_LOW); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 1); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); From patchwork Mon Mar 28 02:11:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lee X-Patchwork-Id: 12793109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25B06C433EF for ; Mon, 28 Mar 2022 02:13:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4C03F1650; Mon, 28 Mar 2022 04:12:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C03F1650 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648433615; bh=iZjhAdUGxgzrQgSAjpa9nlRTRCWTFI/rAdKhQdUdecY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z2JM5cud5g10J2XX7lgndjliLD47NBGaRchjfQZ6K+FsR/P9Amnt5EpYsbnmgRY70 7SKjDlPvOmlhQxa2IkmHmQ1k/0V7YAC13PkmhUMSVaLmwLJopY9qgJ1WkO0sW/haOw Z0fKIpcBMeqWWEGwSsmsjd85ObUBZz3BnQDvxPuI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8AE78F800FA; Mon, 28 Mar 2022 04:12:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12D64F80271; Mon, 28 Mar 2022 04:12:19 +0200 (CEST) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 58B51F800FA for ; Mon, 28 Mar 2022 04:12:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 58B51F800FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="at4e3yxg" Received: by mail-pg1-x544.google.com with SMTP id t13so9871007pgn.8 for ; Sun, 27 Mar 2022 19:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=785BQAgQ/fmXmnK7LN9iPs9KhRHeXeAbtde080rNxiU=; b=at4e3yxgx2xDwFHe6ilij5ANvI+EBic1G+1lp3r9Qs2kHPOKb4f/C4U6fyF5mFaH6n 2ad+n3zjlC9dS+OkzGDJc2Ou0f5vs5uvKK/ExojsgVvf6kpTZGSm0u14n8TEPdEAIL2r 7mgCXT5dIQfSGQuumy05SWABdMOBhZG/rjt463qSXXWjDccUIU3oBpvEKu9kmthxUUhw ByOI5yaMeBwa/C4oKIs5KExpEE580tEh+Ax2EHfEEHQlXm7Vx/E2zKPi57GeFv1oQ5vE C39TJqvyYvN43dtgIRHBkaG2/IGw70bj6soTSd/dGk1S2rLjIm8tnjVey14Yel1cRecE mvEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=785BQAgQ/fmXmnK7LN9iPs9KhRHeXeAbtde080rNxiU=; b=R72xg2fn1udAMCMqpcC1Fdm4WDanWFkzOIpFb611ulbiKSyd3VaP3a5SdM0/Nug9sZ WCICSUzSMCAe5x4ZCyszNr92nQ5sGlTAPbZFjAr1GSA8Aho4f29sZSLCthqux/KRZSsO dZgXQ1d1ThLFoBfwZP9Apk1D/rtjhN06jNWvO+PQ7pQsA0dEUI+vzjCJkczCYyQmpr5z RToqBx9wPFmTr+wHnt0B6WCrCRs10ZYpLwic8E/4Pxmfqwmy5Q0jMGIc0dU0QwSgi8gk Uc8jOhg4/R/K0oNGhyNK/34Dd3WYBJyI69iZu3t0fvLWv4JLqhositVUy/1jh88HjZXP wH0Q== X-Gm-Message-State: AOAM531ITLw3tSOvayuwDpAKcPq0kSx+cgvgk0pFvdk8LcsS9yGdMHJs lQ0/R/FcQ6fGm5r2/4seHd0= X-Google-Smtp-Source: ABdhPJz3Fmr4nLVOv9MmVn4Rx1d3jkYMkLMxoem6hmY+OZtwNuwPfgPq+/fccaY2ZxV7h8v2raIksA== X-Received: by 2002:a63:5311:0:b0:373:9fdb:ce03 with SMTP id h17-20020a635311000000b003739fdbce03mr8679354pgb.518.1648433533205; Sun, 27 Mar 2022 19:12:13 -0700 (PDT) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id c63-20020a624e42000000b004fa9ee41b7bsm13322058pfb.217.2022.03.27.19.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 19:12:13 -0700 (PDT) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [V3 2/2] ASoC: dt-bindings: max98390: add reset gpio bindings Date: Mon, 28 Mar 2022 11:11:39 +0900 Message-Id: <20220328021139.8700-2-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220328021139.8700-1-steve.lee.analog@gmail.com> References: <20220328021139.8700-1-steve.lee.analog@gmail.com> Cc: Steve Lee , krzk@kernel.org, nuno.sa@analog.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This adds support for the reset gpio binding. Signed-off-by: Steve Lee Acked-by: Rob Herring --- Documentation/devicetree/bindings/sound/maxim,max98390.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/maxim,max98390.yaml b/Documentation/devicetree/bindings/sound/maxim,max98390.yaml index fea9a1b6619a..deaa6886c42f 100644 --- a/Documentation/devicetree/bindings/sound/maxim,max98390.yaml +++ b/Documentation/devicetree/bindings/sound/maxim,max98390.yaml @@ -29,6 +29,9 @@ properties: minimum: 1 maximum: 8388607 + reset-gpios: + maxItems: 1 + required: - compatible - reg @@ -37,6 +40,7 @@ additionalProperties: false examples: - | + #include i2c { #address-cells = <1>; #size-cells = <0>; @@ -45,5 +49,6 @@ examples: reg = <0x38>; maxim,temperature_calib = <1024>; maxim,r0_calib = <100232>; + reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>; }; };