Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1244370pxp; Thu, 10 Mar 2022 01:26:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/OZKn1wQg/lWf6oYlEpmFs68BtjE2/h4lrnqN5oJm6OtOv/xDAuX/PjIQxdWacbw97o0M X-Received: by 2002:aa7:d4d6:0:b0:416:30a2:58c7 with SMTP id t22-20020aa7d4d6000000b0041630a258c7mr3300568edr.271.1646904379639; Thu, 10 Mar 2022 01:26:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646904379; cv=none; d=google.com; s=arc-20160816; b=OBpHKkc+YlsUQjwjr2D7cox96ucGjqM5FkJoqrqRKi0ji1nUezcfgixEvdggyLfF2u asdrW85l7xty3Qb1WP5+C5u7oSwY+Nu65BakQKVPG02jlDcgjjwQxktiP08W9UorNs+K VZNOMcnKRGydtz1rqlvdBvH2R3oNtTiqu3lJgacOQSdFdrHyPW7KZrh5yWa0z74sbepz g2c6/JyypR1wLQRzNK00pLdTDtB6fTIITgNgeVhL5at5QWSJs4An+Sl2kBvn/xsLnrQo fzjm7i6OC2hjyP6g3x91DcrdO+pKgUaZRxODKyi6bIDGjCd7tR2Re2fD0i2OFHOIRiXI XM+A== 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=UqlG/qlH51JzZZsCgyFBRJweMGZD26FahP+uwp4r9BQ=; b=tY32KSouARCpkaraBbVdVFM7gobXCoWvfgDfGyInyFUHCoxCV+LmfPdt1xjaUftJRN F9ghdWXxhfCld7E4JeVzcf47nsgV26YcXGobmlgAjl5RzapsLsdchQa0DhQOgTI8YCmo TJ867KkqHUG4QL83M5Tj5KDU1N/LNTlTvCJeYlMGt5yBGjGT4k2pStiD+lDN+/zWaTcE asTcGy3p0ejlRF4q+bFKmiLSZGnaD1Uy6iUuAgHX/VNjRFj2g2eZWXDSZec7lZ7WYqu0 O7cmeAj2OSTlxxRhHAwtnyZu+w0CUdup5ANf37L9TM3ruO3ir4pCPBa7NTbn3+ZuKKbP 9rRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FSykQPtD; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a056402430600b0041699da93fesi2862841edc.186.2022.03.10.01.25.55; Thu, 10 Mar 2022 01:26:19 -0800 (PST) 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=FSykQPtD; 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 S240249AbiCJIRH (ORCPT + 99 others); Thu, 10 Mar 2022 03:17:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238910AbiCJIRE (ORCPT ); Thu, 10 Mar 2022 03:17:04 -0500 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C441342F2 for ; Thu, 10 Mar 2022 00:16:04 -0800 (PST) Received: by mail-pj1-x1043.google.com with SMTP id mr24-20020a17090b239800b001bf0a375440so7556215pjb.4 for ; Thu, 10 Mar 2022 00:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=UqlG/qlH51JzZZsCgyFBRJweMGZD26FahP+uwp4r9BQ=; b=FSykQPtDCQ1wMMLVzooyDgNeZvg0vebosc8YpUWUKsz0xMGoHdez5Xrx+9YJDKnn+i rD3Xmudvj5gGZ3vlviX0TbDh/pwPZSic27LxDN1LUg7XX5NneYzM4QgwtA7ncuVzSU/w 6uJ/5RDzmnKepU4FdBxQw3ZKXBZbM19S1BVWvAHXx8e9Kv/faT43TvyHEaozwqwUb78b jjxirwC/D84rrn03DOKiYMjYmjsyFIDm6Fm+KBaFHWogt3sph4RL+FJHK9DMQT7adsZs N0/Fz1JPrd30+TkezrquUviXm3ls1n2RDbOvZNXcg+0RnQy96wxXfqE1RHYZUF/Um+s4 vocA== 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=UqlG/qlH51JzZZsCgyFBRJweMGZD26FahP+uwp4r9BQ=; b=E+Sa4k80Nvv5qaN2AZOBD3sp34P+xU0g6xP02LtSSe6PuDG7MgTIqWrK5P+oPcipPA uQ4hJUoMaEl6dMTzqsFnfZSojo4stxZ3DvtefuAWgHXmcKiJn7Xpvd7wvH6g02wT1hif u8Kji6Tahkg/LIY0bdsL2tk3zdkZog7FGIeR01Zko+yf31DKZ0Dq4g2tT07QtNkOZP43 GGqYpZAkm3dLjiez7G+pCFRKVDVpu/2Ha7CCVEZzBlhYE6YVczYYoaraWpLFZXvhVXVq nQ4j1yf9ma3D2b3S8+Yt8gOHNl+l2sF+4mMjCsiM7qfapBIyoZynpgmA5eoydomzavmP NDGQ== X-Gm-Message-State: AOAM532Y9hElWk2oFjx9BeOh5VhgyC33kr1IbZliuz/kxmyECt5c0rvu ASThkGuYPTEUS51LTjH89BI= X-Received: by 2002:a17:902:d4c9:b0:151:d074:cbe8 with SMTP id o9-20020a170902d4c900b00151d074cbe8mr3840413plg.102.1646900163675; Thu, 10 Mar 2022 00:16:03 -0800 (PST) Received: from localhost.localdomain ([211.212.143.131]) by smtp.gmail.com with ESMTPSA id q11-20020a056a00084b00b004f73e6c26b8sm5976727pfk.25.2022.03.10.00.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 00:16:03 -0800 (PST) From: Steve Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ckeepax@opensource.cirrus.com, geert@linux-m68k.org, rf@opensource.wolfsonmicro.com, shumingf@realtek.com, srinivas.kandagatla@linaro.org, krzk@kernel.org, dmurphy@ti.com, jack.yu@realtek.com, nuno.sa@analog.com, steves.lee@maximintegrated.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: Steve Lee Subject: [PATCH] ASoC: max98390: Add reset gpio control Date: Thu, 10 Mar 2022 17:15:48 +0900 Message-Id: <20220310081548.31846-1-steve.lee.analog@gmail.com> X-Mailer: git-send-email 2.17.1 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,T_SCC_BODY_TEXT_LINE 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 Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee --- sound/soc/codecs/max98390.c | 18 ++++++++++++++++++ sound/soc/codecs/max98390.h | 1 + 2 files changed, 19 insertions(+) diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index b392567c2b3e..574d8d5f1119 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1073,6 +1073,24 @@ static int max98390_i2c_probe(struct i2c_client *i2c, return ret; } + max98390->reset_gpio = of_get_named_gpio(i2c->dev.of_node, + "maxim,reset-gpios", 0); + + /* Power on device */ + if (gpio_is_valid(max98390->reset_gpio)) { + ret = devm_gpio_request(&i2c->dev, max98390->reset_gpio, + "MAX98390_RESET"); + if (ret) { + dev_err(&i2c->dev, "%s: Failed to request gpio %d\n", + __func__, max98390->reset_gpio); + return -EINVAL; + } + gpio_direction_output(max98390->reset_gpio, 0); + usleep_range(1000, 2000); + gpio_direction_output(max98390->reset_gpio, 1); + usleep_range(1000, 2000); + } + /* Check Revision ID */ ret = regmap_read(max98390->regmap, MAX98390_R24FF_REV_ID, ®); diff --git a/sound/soc/codecs/max98390.h b/sound/soc/codecs/max98390.h index c250740f73a2..5518f2340247 100644 --- a/sound/soc/codecs/max98390.h +++ b/sound/soc/codecs/max98390.h @@ -655,6 +655,7 @@ struct max98390_priv { struct regmap *regmap; + int reset_gpio; unsigned int sysclk; unsigned int master; unsigned int tdm_mode; -- 2.17.1