From patchwork Wed Apr 20 04:48:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Lee X-Patchwork-Id: 12819766 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 3ACD1C433EF for ; Wed, 20 Apr 2022 04:50:18 +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 9375E18A7; Wed, 20 Apr 2022 06:49:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9375E18A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650430216; bh=y0F1fLzeSJ9EcKU267noV2/Ykxt51nRAovHA5aiyRQ4=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=eIW8X0D3RB2geRADSh7wip3ENK4Q3S7uxx7dnGtIXNUBj4jP319qzUhh75Cl88ysU 4rIbeB1ybZuclbgY2VqjmwGzQNxW3dQjvP8uQ6kxNal2iIyu95eGEx1vkbBX/5kVTd RE35+kKcAXXvIWGSylm7UC/zEGVxR8P0rDT8tqmU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1BE09F80116; Wed, 20 Apr 2022 06:49:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0FFFDF80125; Wed, 20 Apr 2022 06:49:23 +0200 (CEST) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 2AF53F8010B for ; Wed, 20 Apr 2022 06:49:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2AF53F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c4KMrt+f" Received: by mail-pg1-x52e.google.com with SMTP id g9so514692pgc.10 for ; Tue, 19 Apr 2022 21:49:17 -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=F+SNI6ZhHsirUO9usNliSeUPedFWMdKyf9VNSlCdVbY=; b=c4KMrt+fwRje0c7WzOZQubm2Gpc13Z+BKkK+K6SoqWf7LTdw68mI7t6Z6Cfkf0TiNY E7i0SuiB9EPgX5yUoFfspleKuNib8po0ItT5myeK3+qa8+42qE+H8nU2kJGn/83rn0RO U6470hFqvwycQn3JUTjwSRiZRi23veobH195i9RNCtKheEiP9swwicPa98xfYFQr9Odm M6Gpa8ooYnX16610o0STT8AZonBO+AIN9hv/vT9CAA+tqI0alSbfsECfuAaarafNQdla /ZNBd+z7RkgpVxQpEBzFvQ7GB5cU5d7yq41zo9KwurtZVN6u15jPDaPk4Epms02+jbFr XyJA== 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=F+SNI6ZhHsirUO9usNliSeUPedFWMdKyf9VNSlCdVbY=; b=s6ws2y5CQop3hUu0qxzvglELUY5GtVkIVI/C8HGAWV2C4LW2pdoum3LcTnjkOI5+ML RPtcBem/vyuWxqw3H4DEWa0bBRJY4/cVO5uM+sQC1tzOACIdBBmySDyM7N03KYIA4nIL FqdkpbTCTjHP76WvW0lh591/CLRhTNCloQpOlh4ZJL5qfTE2YwoYR9r1mpJCZ4HZL/5J WK9isifAfkevAyGsiaR4H3QTNpEcDrfekmL4Io3VsVg4qryUavQTMFaw6rZBwAfFbqY+ EsPUSV3ASLn6EApDiav5TM7SeDiaMFiFsesSrFzbJ5YLB8vpkm4UZyULfamZQIMMueva nEWw== X-Gm-Message-State: AOAM532PmgyPLnkdrYcNj8WYxMIQD1SuyDU1rVxfTD1+W/vPinpcohZQ shBFUDlFbh6l1PxdjeZb6SM= X-Google-Smtp-Source: ABdhPJyRBK4IecUu8kA+XNAbcJU+Yc1QJ5QFkvvT2Vi+gKVJH9tNsi1WUtHoYam7N5VPv83WMhxMag== X-Received: by 2002:a05:6a00:2442:b0:4fd:8b00:d2f with SMTP id d2-20020a056a00244200b004fd8b000d2fmr21364305pfj.39.1650430155675; Tue, 19 Apr 2022 21:49:15 -0700 (PDT) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id o3-20020a056a001bc300b0050a7b7257b2sm7957225pfw.25.2022.04.19.21.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 21:49:15 -0700 (PDT) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [V4 1/2] ASoC: max98390: Add reset gpio control Date: Wed, 20 Apr 2022 13:48:59 +0900 Message-Id: <20220420044900.2989-1-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Steve Lee , ryans.lee@analog.com, 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 Acked-by: Nuno Sá --- V3 -> V4: change reset gpio control as GPIO_ACTIVE_LOW in DT 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..bdfd6cccc3d2 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_HIGH); + + /* Power on device */ + if (reset_gpio) { + usleep_range(1000, 2000); + /* bring out of reset */ + gpiod_set_value_cansleep(reset_gpio, 0); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); From patchwork Wed Apr 20 04:49:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lee X-Patchwork-Id: 12819767 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 06A31C433F5 for ; Wed, 20 Apr 2022 04:50:51 +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 E26E91947; Wed, 20 Apr 2022 06:49:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E26E91947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650430250; 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=pKYlIt/oxK34lV55h6OR/zx285I4YRMxwZyU7OxGTt0ICPpYnnChF+hGeDLPqVxLu 3PVuXHJwzkOd0XPF9TIVK2MzlNUtLLWZnYMf664+4IeoJBw3ESWvtL0ZlFMg/gYnjR F5ZTGClWzUZRvksjSo3dyp2k4zOTtsgnNO4UMvs4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DDF0EF804FB; Wed, 20 Apr 2022 06:49:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 153F5F804FD; Wed, 20 Apr 2022 06:49:32 +0200 (CEST) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (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 342ADF8010B for ; Wed, 20 Apr 2022 06:49:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 342ADF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dkaik8Ui" Received: by mail-pf1-x42d.google.com with SMTP id y14so79567pfe.10 for ; Tue, 19 Apr 2022 21:49:28 -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=dkaik8UizHe3S9fhvxry7osL6TYV8tA93uoKj+sy5Zw8YYLEBUDS3mnJ8lj6qovuq/ pDIOumiZgkLEnpdI59TVi3rWAc9fNIhFbflyVS1rMYFZwQU1aT4dsHM2Sif8qpgzPnmy e+iNx8ptfhTtEaNXOKXDyQxgKpCYzadm8Zd6Lr/O/kSCgcK09x4+wvUnsm1W+pYb09Yj pSRV7LJGy2sq5qrsO+h6PhiyHb55YzGi3A9X1wGHwjvHq48d1pjmycCTEM99pT5Rog0o qKj8zs9TmRShaSPpzkby4N8qWpelIdI4QLItNoPoN+NenV2Q+DgWIF0LpWwi1DYneskJ T0Rg== 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=wKVHGYfzed6j4GcOt6VUut3B2twHhOOs8h/w05FgsFX/EMx7b+TCLt3dul7/TawFf9 SnoYB97M9hxBCB27jDD1f+tKq12Q828mipMxkc5K8YpB67PxFQql+WT6vd986OmU3YDB u2tx6mKwqQ2UHitpIWYZTlhkvn8qr6xG0dMVslNWzhcOL60lfnd2QrTbUqQlpayzapDC 9Uo0qwO8Zf2keYX4b52pbl4Ns9ea1deAfhW+KkCrublRd8WPN4R2K0NIvVuyWE01awa0 lzux/Sxo00mubaj/nimPAU23336rHA3HdcOpPoR+IkqEYEwQvsmmPYWYMFUrsqwFTj4X anDw== X-Gm-Message-State: AOAM531iPt8eok7IR5FPG7xob1w02BrzDrAqZ2jGifrM8/bbuJnsFFcc BXquARVfT3uCsnZoh2fFSUA= X-Google-Smtp-Source: ABdhPJxbzkBDUxr3dcGMJn74akRdabzXE1dMP8yCFLgxFEz3tAZGP4CYW+bD/OwbTdegAOFK9yyJWQ== X-Received: by 2002:a63:fc05:0:b0:3a9:f17d:3f4f with SMTP id j5-20020a63fc05000000b003a9f17d3f4fmr12360427pgi.590.1650430166574; Tue, 19 Apr 2022 21:49:26 -0700 (PDT) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id o3-20020a056a001bc300b0050a7b7257b2sm7957225pfw.25.2022.04.19.21.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 21:49:26 -0700 (PDT) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [V4 2/2] ASoC: dt-bindings: max98390: add reset gpio bindings Date: Wed, 20 Apr 2022 13:49:00 +0900 Message-Id: <20220420044900.2989-2-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220420044900.2989-1-steve.lee.analog@gmail.com> References: <20220420044900.2989-1-steve.lee.analog@gmail.com> Cc: Steve Lee , ryans.lee@analog.com, 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>; }; };