Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp899123pxb; Fri, 22 Apr 2022 13:47:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl2rGtdsDA/4jOa56yx3zKdgmp8KtaIwUcPxKSYOxxOtJUvfeDM4+paMR8XPp8rTIkYLLM X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr6492812plr.31.1650660424963; Fri, 22 Apr 2022 13:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650660424; cv=none; d=google.com; s=arc-20160816; b=NliaHMvVZA2rzAsdJ8R0RrX8G80Bm8OqvAPDuU1mMWSFQnOG4U2mjGjsUMZVvKnTrV EqtwnNI3TVjVYuCBxSVSLzm/YM7esp4mmtEpJPKDYWmonHf6a+Bk2pgk5wBQjcOAVqi1 kkxiIy2j3H9gAwHHKxXN3A1AXG/Jxlum2JjSWgxLLE18KhA4+aPs2abKLqHTCSsfX511 61NKQ8wSo2UJVbfDhjEtImEgyouraKW06dUpmnF3fr0gWq8RGfU/T3SwqrK3DUdiPjJD W3xtuRg4/19LH4Z6LZXbm5yJAk+e54IzzC4HhgljCI83bbKCNabp6PsVXd3cKRDIcSx6 8yFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=F+SNI6ZhHsirUO9usNliSeUPedFWMdKyf9VNSlCdVbY=; b=TLCbjODGDZ/zvdE6/FU8mpg0IkKeb12zvHPtUB2h9DQUyDzsTxaKDycTd6F8w02vHQ SlENy65zdcPlF4Grs5ZE+kXtuXD2M4G9uWm7XTszxjlLlIMba+WlcZDHGrwKPMxxg203 yf2Tgm4UtP/PyCavy9casQEsrRG9k3DEzDhvZhfh+4Yfg9vLG/B+yN4XwVD1MHQ7nn/V Fio1woUKXtmCbUjUAfsctMqImYZOgagB0at8tDUZiWMsW0HXJkKjoRRLp5KDtaOrhyZ7 mXdloiKB9vkICFGgb0vv4mT3ZmPsUdzklLhSXhqIUVkXJXvskKEouNVfhJhQfnf1+y8c lhcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c4KMrt+f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bk18-20020a17090b081200b001d63970bc44si5114954pjb.78.2022.04.22.13.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:47:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c4KMrt+f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 020E22DA5DA; Fri, 22 Apr 2022 12:35:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359344AbiDTEwC (ORCPT + 99 others); Wed, 20 Apr 2022 00:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238259AbiDTEwB (ORCPT ); Wed, 20 Apr 2022 00:52:01 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23912275D4 for ; Tue, 19 Apr 2022 21:49:16 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id t4so546478pgc.1 for ; Tue, 19 Apr 2022 21:49:16 -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=z5h+1sJn1XOdhoo7WRQrAEX84ikX4twEpo6aSf/TJgBwak/pIWOKohLBpt+TuhfRcC 0wQEqvHhWnM3EpL44t+XMvAWBwCapaNGDtNtReJV59VdSjogBPORuzufhfHWH4NU/gCf M45DnBfG5VLimhlYM57vWAVAgikvdmsxLIb0uM5fqxasHOd0uJHGG41InG3oNtsCP2PI sDtR0d6oC+IQIzsgwNp7kYy6cmz7Z5m8X8MZozG3fxtpf2Ir73B1VfuSvO4KqtDiw3dG M7OWbLaINlUi5yWiTdpekCUv44dYsPQSq5gnmcp+3EkV9UVJCvRSMNftyLfhqkBtzJnG o7yQ== X-Gm-Message-State: AOAM53258EpQ019x6W8mLouPGzeTxFNgakNOr4QO8P7dEnNBLRyeBxqX C4Jv7jF4eFmmok+1X4m6uho= 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 Cc: krzk@kernel.org, nuno.sa@analog.com, ryans.lee@analog.com, Steve Lee 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 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee --- 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, ®); -- 2.17.1